From 55eb85d5460523b60196df4eaa9b2d833a886735 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Sat, 18 Sep 2021 23:57:52 -0700 Subject: [PATCH 001/620] Updated MaterialPropertyId class in preparation for nested material property sets. Here the class has been generalized for a list of group names and a final property name, rather than assuming a single group containing the property. This included removing the unused GetPropertyName and GetGroupName functions. All that's really need from this class is conversion to a full property ID string. Testing: New unit test. Reprocessed all core material types and StandardPBR test materials used in Atom Sample Viewer's material screenshot test. Atom Sample Viewer material screenshot test script. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../RPI.Edit/Material/MaterialPropertyId.h | 18 +-- .../RPI.Edit/Material/MaterialPropertyId.cpp | 83 ++++++----- .../RPI.Edit/Material/MaterialSourceData.cpp | 12 +- .../Material/MaterialTypeSourceData.cpp | 12 +- .../Material/MaterialPropertyIdTests.cpp | 131 ++++++++++++++++++ Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake | 1 + .../Code/Source/Document/MaterialDocument.cpp | 8 +- .../MaterialInspector/MaterialInspector.cpp | 4 +- .../EditorMaterialComponentInspector.cpp | 2 +- .../Material/EditorMaterialComponentUtil.cpp | 4 +- .../EditorMaterialModelUvNameMapInspector.cpp | 4 +- 11 files changed, 216 insertions(+), 63 deletions(-) create mode 100644 Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h index 77d49f3407..4b6d78c092 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h @@ -9,6 +9,7 @@ #pragma once #include +#include namespace AZ { @@ -16,27 +17,28 @@ namespace AZ { class MaterialAsset; - //! Utility for building material property names consisting of a group name and a property sub-name. - //! Represented as "[groupName].[propertyName]". - //! The group name is optional, in which case the ID will just be "[propertyName]". + //! Utility for building material property IDs. + //! These IDs are represented like "groupA.groupB.[...].propertyName". + //! The groups are optional, in which case the full property ID will just be like "propertyName". class MaterialPropertyId { public: static bool IsValidName(AZStd::string_view name); static bool IsValidName(const AZ::Name& name); - //! Creates a MaterialPropertyId from a full name string like "[groupName].[propertyName]" or just "[propertyName]" + //! Creates a MaterialPropertyId from a full name string like "groupA.groupB.[...].propertyName" or just "propertyName". + //! Also checks the name for validity. static MaterialPropertyId Parse(AZStd::string_view fullPropertyId); MaterialPropertyId() = default; + explicit MaterialPropertyId(AZStd::string_view propertyName); MaterialPropertyId(AZStd::string_view groupName, AZStd::string_view propertyName); MaterialPropertyId(const Name& groupName, const Name& propertyName); + MaterialPropertyId(const AZStd::array_view names); AZ_DEFAULT_COPY_MOVE(MaterialPropertyId); - const Name& GetGroupName() const; - const Name& GetPropertyName() const; - const Name& GetFullName() const; + operator const Name&() const; //! Returns a pointer to the full name ("[groupName].[propertyName]"). //! This is included for convenience so it can be used for error messages in the same way an AZ::Name is used. @@ -52,8 +54,6 @@ namespace AZ private: Name m_fullName; - Name m_groupName; - Name m_propertyName; }; } // namespace RPI diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp index e74ec3e6e0..1be5c4485c 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp @@ -27,63 +27,84 @@ namespace AZ bool MaterialPropertyId::IsValid() const { - const bool groupNameIsValid = m_groupName.IsEmpty() || IsValidName(m_groupName); - const bool propertyNameIsValid = IsValidName(m_propertyName); - return groupNameIsValid && propertyNameIsValid; + return !m_fullName.IsEmpty(); } MaterialPropertyId MaterialPropertyId::Parse(AZStd::string_view fullPropertyId) { AZStd::vector tokens; - AzFramework::StringFunc::Tokenize(fullPropertyId.data(), tokens, '.', true, true); + AzFramework::StringFunc::Tokenize(fullPropertyId, tokens, '.', true, true); - if (tokens.size() == 1) + if (tokens.empty()) { - return MaterialPropertyId{"", tokens[0]}; + AZ_Error("MaterialPropertyId", false, "Property ID is empty.", fullPropertyId.data()); + return MaterialPropertyId{}; } - else if (tokens.size() == 2) + + for (const auto& token : tokens) { - return MaterialPropertyId{tokens[0], tokens[1]}; + if (!IsValidName(token)) + { + AZ_Error("MaterialPropertyId", false, "Property ID '%.*s' is not a valid identifier.", AZ_STRING_ARG(fullPropertyId)); + return MaterialPropertyId{}; + } + } + + MaterialPropertyId id; + id.m_fullName = fullPropertyId; + return id; + } + + MaterialPropertyId::MaterialPropertyId(AZStd::string_view propertyName) + { + if (!IsValidName(propertyName)) + { + AZ_Error("MaterialPropertyId", false, "Property name '%.*s' is not a valid identifier.", AZ_STRING_ARG(propertyName)); } else { - AZ_Error("MaterialPropertyId", false, "Property ID '%s' is not a valid identifier.", fullPropertyId.data()); - return MaterialPropertyId{}; + m_fullName = propertyName; } } MaterialPropertyId::MaterialPropertyId(AZStd::string_view groupName, AZStd::string_view propertyName) - : MaterialPropertyId(Name{groupName}, Name{propertyName}) { - } - - MaterialPropertyId::MaterialPropertyId(const Name& groupName, const Name& propertyName) - { - AZ_Error("MaterialPropertyId", groupName.IsEmpty() || IsValidName(groupName), "Group name '%s' is not a valid identifier.", groupName.GetCStr()); - AZ_Error("MaterialPropertyId", IsValidName(propertyName), "Property name '%s' is not a valid identifier.", propertyName.GetCStr()); - m_groupName = groupName; - m_propertyName = propertyName; - if (groupName.IsEmpty()) + if (!IsValidName(groupName)) { - m_fullName = m_propertyName.GetStringView(); + AZ_Error("MaterialPropertyId", false, "Group name '%.*s' is not a valid identifier.", AZ_STRING_ARG(groupName)); + } + else if (!IsValidName(propertyName)) + { + AZ_Error("MaterialPropertyId", false, "Property name '%.*s' is not a valid identifier.", AZ_STRING_ARG(propertyName)); } else { - m_fullName = AZStd::string::format("%s.%s", m_groupName.GetCStr(), m_propertyName.GetCStr()); + m_fullName = AZStd::string::format("%.*s.%.*s", AZ_STRING_ARG(groupName), AZ_STRING_ARG(propertyName)); } } - - const Name& MaterialPropertyId::GetGroupName() const + + MaterialPropertyId::MaterialPropertyId(const Name& groupName, const Name& propertyName) + : MaterialPropertyId(groupName.GetStringView(), propertyName.GetStringView()) { - return m_groupName; + } + + MaterialPropertyId::MaterialPropertyId(const AZStd::array_view names) + { + for (const auto& name : names) + { + if (!IsValidName(name)) + { + AZ_Error("MaterialPropertyId", false, "'%s' is not a valid identifier.", name.c_str()); + return; + } + } + + AZStd::string fullName; + AzFramework::StringFunc::Join(fullName, names.begin(), names.end(), "."); + m_fullName = fullName; } - const Name& MaterialPropertyId::GetPropertyName() const - { - return m_propertyName; - } - - const Name& MaterialPropertyId::GetFullName() const + MaterialPropertyId::operator const Name&() const { return m_fullName; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp index f697f33a3f..b48d0938a7 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp @@ -130,7 +130,7 @@ namespace AZ } else { - MaterialPropertyIndex propertyIndex = materialAssetCreator.m_materialPropertiesLayout->FindPropertyIndex(propertyId.GetFullName()); + MaterialPropertyIndex propertyIndex = materialAssetCreator.m_materialPropertiesLayout->FindPropertyIndex(propertyId); if (propertyIndex.IsValid()) { const MaterialPropertyDescriptor* propertyDescriptor = materialAssetCreator.m_materialPropertiesLayout->GetPropertyDescriptor(propertyIndex); @@ -145,11 +145,11 @@ namespace AZ auto& imageAsset = imageAssetResult.GetValue(); // Load referenced images when load material imageAsset.SetAutoLoadBehavior(Data::AssetLoadBehavior::PreLoad); - materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAsset); + materialAssetCreator.SetPropertyValue(propertyId, imageAsset); } else { - materialAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetFullName().GetCStr(), property.second.m_value.GetValue().data()); + materialAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), property.second.m_value.GetValue().data()); } } break; @@ -163,18 +163,18 @@ namespace AZ } else { - materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), enumValue); + materialAssetCreator.SetPropertyValue(propertyId, enumValue); } } break; default: - materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), property.second.m_value); + materialAssetCreator.SetPropertyValue(propertyId, property.second.m_value); break; } } else { - materialAssetCreator.ReportWarning("Can not find property id '%s' in MaterialPropertyLayout", propertyId.GetFullName().GetStringView().data()); + materialAssetCreator.ReportWarning("Can not find property id '%s' in MaterialPropertyLayout", propertyId.GetCStr()); } } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index a13a8df16e..7134830fe8 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -354,7 +354,7 @@ namespace AZ continue; } - materialTypeAssetCreator.BeginMaterialProperty(propertyId.GetFullName(), property.m_dataType); + materialTypeAssetCreator.BeginMaterialProperty(propertyId, property.m_dataType); if (property.m_dataType == MaterialPropertyDataType::Enum) { @@ -404,17 +404,17 @@ namespace AZ if (imageAssetResult.IsSuccess()) { - materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAssetResult.GetValue()); + materialTypeAssetCreator.SetPropertyValue(propertyId, imageAssetResult.GetValue()); } else { - materialTypeAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetFullName().GetCStr(), property.m_value.GetValue().data()); + materialTypeAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), property.m_value.GetValue().data()); } } break; case MaterialPropertyDataType::Enum: { - MaterialPropertyIndex propertyIndex = materialTypeAssetCreator.GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId.GetFullName()); + MaterialPropertyIndex propertyIndex = materialTypeAssetCreator.GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAssetCreator.GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); AZ::Name enumName = AZ::Name(property.m_value.GetValue()); @@ -425,12 +425,12 @@ namespace AZ } else { - materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), enumValue); + materialTypeAssetCreator.SetPropertyValue(propertyId, enumValue); } } break; default: - materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), property.m_value); + materialTypeAssetCreator.SetPropertyValue(propertyId, property.m_value); break; } } diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp new file mode 100644 index 0000000000..2b729ed8ef --- /dev/null +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp @@ -0,0 +1,131 @@ +/* + * 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 + * + */ + +#include +#include +#include +#include + +namespace UnitTest +{ + using namespace AZ; + using namespace RPI; + + class MaterialPropertyIdTests + : public RPITestFixture + { + }; + + TEST_F(MaterialPropertyIdTests, TestConstructWithPropertyName) + { + MaterialPropertyId id{"color"}; + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "color"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"color"}); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithPropertyName_BadName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + MaterialPropertyId id{"color?"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithTwoNames) + { + MaterialPropertyId id{"baseColor", "factor"}; + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "baseColor.factor"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"baseColor.factor"}); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithTwoNames_BadGroupName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + MaterialPropertyId id{"layer1.baseColor", "factor"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithTwoNames_BadPropertyName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + MaterialPropertyId id{"baseColor", ".factor"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithMultipleNames) + { + AZStd::vector names{"layer1", "clearCoat", "normal", "factor"}; + MaterialPropertyId id{names}; + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "layer1.clearCoat.normal.factor"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"layer1.clearCoat.normal.factor"}); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithMultipleNames_BadName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + AZStd::vector names{"layer1", "clear-coat", "normal", "factor"}; + MaterialPropertyId id{names}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestParse) + { + MaterialPropertyId id = MaterialPropertyId::Parse("layer1.clearCoat.normal.factor"); + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "layer1.clearCoat.normal.factor"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"layer1.clearCoat.normal.factor"}); + } + + TEST_F(MaterialPropertyIdTests, TestParse_BadName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + MaterialPropertyId id = MaterialPropertyId::Parse("layer1.clearCoat.normal,factor"); + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestNameValidity) + { + EXPECT_TRUE(MaterialPropertyId::IsValidName("a")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("z")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("A")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("Z")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("_")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("m_layer10bazBAZ")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("1layer")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("base-color")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("base.color")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("base/color")); + } +} diff --git a/Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake index e99e4e456b..923fdc9338 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake @@ -39,6 +39,7 @@ set(FILES Tests/Material/MaterialSourceDataTests.cpp Tests/Material/MaterialFunctorTests.cpp Tests/Material/MaterialFunctorSourceDataSerializerTests.cpp + Tests/Material/MaterialPropertyIdTests.cpp Tests/Material/MaterialPropertyValueSourceDataTests.cpp Tests/Material/MaterialTests.cpp Tests/Model/ModelTests.cpp diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index 17e292ac16..3f4aa71a9c 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -596,7 +596,7 @@ namespace MaterialEditor const MaterialPropertyId propertyId(groupName, propertyName); - const auto it = m_properties.find(propertyId.GetFullName()); + const auto it = m_properties.find(propertyId); if (it != m_properties.end() && propertyFilter(it->second)) { MaterialPropertyValue propertyValue = AtomToolsFramework::ConvertToRuntimeType(it->second.GetValue()); @@ -604,7 +604,7 @@ namespace MaterialEditor { if (!m_materialTypeSourceData.ConvertPropertyValueToSourceDataFormat(propertyDefinition, propertyValue)) { - AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.GetFullName().GetCStr(), m_absolutePath.c_str()); + AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.GetCStr(), m_absolutePath.c_str()); result = false; return false; } @@ -774,7 +774,7 @@ namespace MaterialEditor AtomToolsFramework::DynamicPropertyConfig propertyConfig; // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = MaterialPropertyId(groupName, propertyName).GetCStr(); + propertyConfig.m_id = MaterialPropertyId(groupName, propertyName); const auto& propertyIndex = m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); const bool propertyIndexInBounds = propertyIndex.IsValid() && propertyIndex.GetIndex() < m_materialAsset->GetPropertyValues().size(); @@ -845,7 +845,7 @@ namespace MaterialEditor propertyConfig = {}; propertyConfig.m_dataType = AtomToolsFramework::DynamicPropertyType::String; - propertyConfig.m_id = MaterialPropertyId(UvGroupName, shaderInput).GetCStr(); + propertyConfig.m_id = MaterialPropertyId(UvGroupName, shaderInput); propertyConfig.m_name = shaderInput; propertyConfig.m_displayName = shaderInput; propertyConfig.m_groupName = "UV Sets"; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp index df0b179dc1..f6b42bf13a 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp @@ -145,7 +145,7 @@ namespace MaterialEditor AtomToolsFramework::DynamicProperty property; AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult( property, m_documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetProperty, - AZ::RPI::MaterialPropertyId(groupName, uvNamePair.m_shaderInput.ToString()).GetFullName()); + AZ::RPI::MaterialPropertyId(groupName, uvNamePair.m_shaderInput.ToString())); group.m_properties.push_back(property); property.SetValue(property.GetConfig().m_parentValue); @@ -182,7 +182,7 @@ namespace MaterialEditor AtomToolsFramework::DynamicProperty property; AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult( property, m_documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetProperty, - AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name).GetFullName()); + AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name)); group.m_properties.push_back(property); } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp index f10a125456..c05b84db39 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp @@ -300,7 +300,7 @@ namespace AZ AtomToolsFramework::DynamicPropertyConfig propertyConfig; // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name).GetFullName(); + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name); AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, propertyDefinition); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp index 070c42fd7c..e851bc5fce 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp @@ -140,7 +140,7 @@ namespace AZ editData.m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& groupName, const AZStd::string& propertyName, const auto& propertyDefinition) { const AZ::RPI::MaterialPropertyId propertyId(groupName, propertyName); const AZ::RPI::MaterialPropertyIndex propertyIndex = - editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId.GetFullName()); + editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); AZ::RPI::MaterialPropertyValue propertyValue = editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]; @@ -151,7 +151,7 @@ namespace AZ } // Check for and apply any property overrides before saving property values - auto propertyOverrideItr = editData.m_materialPropertyOverrideMap.find(propertyId.GetFullName()); + auto propertyOverrideItr = editData.m_materialPropertyOverrideMap.find(propertyId); if(propertyOverrideItr != editData.m_materialPropertyOverrideMap.end()) { propertyValue = AZ::RPI::MaterialPropertyValue::FromAny(propertyOverrideItr->second); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialModelUvNameMapInspector.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialModelUvNameMapInspector.cpp index 64bc54bae8..1fa6a4e58d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialModelUvNameMapInspector.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialModelUvNameMapInspector.cpp @@ -96,7 +96,7 @@ namespace AZ const AZStd::string materialUvName = m_materialUvNames[i].m_uvName.GetStringView(); propertyConfig.m_dataType = AtomToolsFramework::DynamicPropertyType::Enum; - propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput).GetFullName(); + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput); propertyConfig.m_name = shaderInput; propertyConfig.m_displayName = materialUvName; propertyConfig.m_description = shaderInput; @@ -248,7 +248,7 @@ namespace AZ const AZStd::string materialUvName = m_materialUvNames[i].m_uvName.GetStringView(); propertyConfig.m_dataType = AtomToolsFramework::DynamicPropertyType::Enum; - propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput).GetFullName(); + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput); propertyConfig.m_name = shaderInput; propertyConfig.m_displayName = materialUvName; propertyConfig.m_description = shaderInput; From f0e8af72aed61a6163aa88d741c98480f27d4e5c Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 30 Sep 2021 01:08:54 -0700 Subject: [PATCH 002/620] Updated StringFunc::Tokenize to support returning a list of string_view instead of string, which should be more efficient. string is still supported as well, but users should prefer the string_view version. Testing: Updated unit tests. Reprocessed Atom material assets. Ran AtomSampleViewer material screenshot test. Opened, edited, saved materail in the Material Editor. Opened a level, edited material property overrides, saved and reloaded. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../AzCore/AzCore/StringFunc/StringFunc.cpp | 24 ++++++++++---- .../AzCore/AzCore/StringFunc/StringFunc.h | 12 ++++--- Code/Framework/AzCore/Tests/StringFunc.cpp | 31 +++++++++++++++---- 3 files changed, 51 insertions(+), 16 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp index ff30291a70..eec23b6bcb 100644 --- a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp +++ b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp @@ -759,13 +759,18 @@ namespace AZ } return value; } - - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) + + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) { return Tokenize(in, tokens, { &delimiter, 1 }, keepEmptyStrings, keepSpaceStrings); } - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings) + template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings); + template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings); + + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings) { auto insertVisitor = [&tokens](AZStd::string_view token) { @@ -773,6 +778,9 @@ namespace AZ }; return TokenizeVisitor(in, insertVisitor, delimiters, keepEmptyStrings, keepSpaceStrings); } + + template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings); + template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings); void TokenizeVisitor(AZStd::string_view in, const TokenVisitor& tokenVisitor, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) { @@ -920,8 +928,9 @@ namespace AZ return found; } - - void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/) + + template + void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/) { if (input.empty()) { @@ -941,7 +950,7 @@ namespace AZ } // Take the substring, not including the separator, and increment our offset - AZStd::string nextSubstring = input.substr(offset, nextOffset - offset); + AZStd::string_view nextSubstring = input.substr(offset, nextOffset - offset); if (keepEmptyStrings || keepSpaceStrings || !nextSubstring.empty()) { tokens.push_back(nextSubstring); @@ -950,6 +959,9 @@ namespace AZ offset = nextOffset + delimiters[nextMatch].size(); } } + + template void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/); + template void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/); int ToInt(const char* in) { diff --git a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h index 1e651afc93..51357312bc 100644 --- a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h +++ b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h @@ -258,17 +258,21 @@ namespace AZ bool Strip(AZStd::string& inout, const char* stripCharacters = " ", bool bCaseSensitive = false, bool bStripBeginning = false, bool bStripEnding = false); //! Tokenize - /*! Tokenize a c-string, into a vector of AZStd::string(s) optionally keeping empty string + /*! Tokenize a c-string, into a vector of strings optionally keeping empty string *! and optionally keeping space only strings + *! (The string type may be AZStd::string or AZStd::string_view. New code should use AZStd::string_view for better performance. AZStd::string version is preserved for compatibility.) Example: Tokenize the words of a sentence. StringFunc::Tokenize("Hello World", d, ' '); s[0] == "Hello", s[1] == "World" Example: Tokenize a comma and end line delimited string StringFunc::Tokenize("Hello,World\nHello,World", d, ' '); s[0] == "Hello", s[1] == "World" s[2] == "Hello", s[3] == "World" */ - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings = false, bool keepSpaceStrings = false); - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters = "\\//, \t\n", bool keepEmptyStrings = false, bool keepSpaceStrings = false); - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings = false, bool keepSpaceStrings = false); + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings = false, bool keepSpaceStrings = false); + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters = "\\//, \t\n", bool keepEmptyStrings = false, bool keepSpaceStrings = false); + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings = false, bool keepSpaceStrings = false); //! TokenizeVisitor /*! Tokenize a string_view and invoke a handler for each token found. diff --git a/Code/Framework/AzCore/Tests/StringFunc.cpp b/Code/Framework/AzCore/Tests/StringFunc.cpp index 68821ba3f9..79dabe3462 100644 --- a/Code/Framework/AzCore/Tests/StringFunc.cpp +++ b/Code/Framework/AzCore/Tests/StringFunc.cpp @@ -199,7 +199,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SingleDelimeter_Empty) { AZStd::string input = ""; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, ' '); ASSERT_EQ(tokens.size(), 0); } @@ -207,7 +207,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SingleDelimeter) { AZStd::string input = "a b,c"; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, ' '); ASSERT_EQ(tokens.size(), 2); @@ -218,7 +218,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_MultiDelimeter_Empty) { AZStd::string input = ""; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, " ,"); ASSERT_EQ(tokens.size(), 0); } @@ -226,7 +226,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_MultiDelimeters) { AZStd::string input = " -a +b +c -d-e"; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, "-+"); ASSERT_EQ(tokens.size(), 5); @@ -240,7 +240,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SubstringDelimeters_Empty) { AZStd::string input = ""; - AZStd::vector tokens; + AZStd::vector tokens; AZStd::vector delimeters = {" -", " +"}; AZ::StringFunc::Tokenize(input.c_str(), tokens, delimeters); ASSERT_EQ(tokens.size(), 0); @@ -249,7 +249,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SubstringDelimeters) { AZStd::string input = " -a +b +c -d-e"; - AZStd::vector tokens; + AZStd::vector tokens; AZStd::vector delimeters = { " -", " +" }; AZ::StringFunc::Tokenize(input.c_str(), tokens, delimeters); @@ -259,6 +259,25 @@ namespace AZ ASSERT_TRUE(tokens[2] == "c"); ASSERT_TRUE(tokens[3] == "d-e"); // Test for something like a guid, which contain typical separator characters } + + TEST_F(StringFuncTest, Tokenize_MultiDelimeters_String) + { + // Test with AZStd::string for backward compatibility. The functions + // use to only work with AZStd::string, and now they are templatized + // to support both AZStd::string and AZStd::string_view (the latter + // being perferred for performance). + + AZStd::string input = " -a +b +c -d-e"; + AZStd::vector tokens; + AZ::StringFunc::Tokenize(input.c_str(), tokens, "-+"); + + ASSERT_EQ(tokens.size(), 5); + ASSERT_TRUE(tokens[0] == "a "); + ASSERT_TRUE(tokens[1] == "b "); + ASSERT_TRUE(tokens[2] == "c "); + ASSERT_TRUE(tokens[3] == "d"); + ASSERT_TRUE(tokens[4] == "e"); + } TEST_F(StringFuncTest, TokenizeVisitor_EmptyString_DoesNotInvokeVisitor) { From 1a99103999e132b21fc67ed4948401f788dc1c59 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 30 Sep 2021 01:30:28 -0700 Subject: [PATCH 003/620] Overhauled the .materialtype file format to group all related properties data together. This prepares the way for a number of possible improvements, especially unlocking the ability to factor out material type configuration to be shared by multiple material types. Here we formalize the concept of a Property Set, which replaces property "groups", containing the group name and description, properties, and functors all in one place. The Property Set structure will allow arbitrarily deep nesting, whereas before you only had one level of grouping. This nesting is not fully supported yet throughout the system, particularly in the Material Editor. It was easier to go ahead and put in some of the nesting mechanims, parituclar in the implementation of MaterialTypeSourceData. This change is backward compatible, which is proved with unit tests, and by the fact that only MinimalPBR.materialtype has been updated to the new format. StandardPBR, EnhancedPBR, and others are still using the old format. (In a subsequent commit I'll update these as well, to prove that the new format works correctly). Other changes and improvements... - A new constructor for MaterialPropertyId - Improved API for MaterialTypeSourceData that hides a good deal more of it's data as private, with clear and convenient APIs. Especially AddProperty, AddPropertySet, FindProperty, FindPropertySet, EnumerateProperties, EnumeratePropertySets. - Added lots of new unit tests - Updated MinimalPBR.materialtype to the new format. Testing: - Updated unit tests. - Reprocessed Atom material assets. - Ran AtomSampleViewer material screenshot test. - Opened, edited, saved material in the Material Editor. - Opened a level, edited material property overrides, saved and reloaded. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../RPI.Edit/Material/MaterialPropertyId.h | 4 + .../Material/MaterialTypeSourceData.h | 142 ++- .../RPI.Edit/Material/MaterialPropertyId.cpp | 35 + .../MaterialPropertyValueSerializer.cpp | 4 +- .../Material/MaterialSourceDataSerializer.cpp | 1 + .../Material/MaterialTypeSourceData.cpp | 749 ++++++++--- .../RPI.Edit/Material/MaterialUtils.cpp | 1 + .../Code/Tests/Common/ErrorMessageFinder.cpp | 2 +- .../Material/MaterialPropertyIdTests.cpp | 34 + .../Material/MaterialSourceDataTests.cpp | 117 +- .../Material/MaterialTypeSourceDataTests.cpp | 1134 +++++++++++++---- .../Materials/Types/MinimalPBR.materialtype | 80 +- .../Code/Source/Document/MaterialDocument.cpp | 113 +- .../MaterialInspector/MaterialInspector.cpp | 31 +- .../EditorMaterialComponentInspector.cpp | 42 +- .../Material/EditorMaterialComponentUtil.cpp | 70 +- 16 files changed, 1890 insertions(+), 669 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h index 4b6d78c092..496485d0d6 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h @@ -35,6 +35,7 @@ namespace AZ MaterialPropertyId(AZStd::string_view groupName, AZStd::string_view propertyName); MaterialPropertyId(const Name& groupName, const Name& propertyName); MaterialPropertyId(const AZStd::array_view names); + MaterialPropertyId(const AZStd::array_view groupNames, AZStd::string_view propertyName); AZ_DEFAULT_COPY_MOVE(MaterialPropertyId); @@ -44,6 +45,9 @@ namespace AZ //! This is included for convenience so it can be used for error messages in the same way an AZ::Name is used. const char* GetCStr() const; + //! Wraps Name::GetStringView() for convenience. + AZStd::string_view GetStringView() const; + //! Returns a hash of the full name. This is needed for compatibility with NameIdReflectionMap. Name::Hash GetHash() const; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index 04b6222404..56f7c4612c 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -68,8 +68,9 @@ namespace AZ struct PropertyDefinition { + AZ_CLASS_ALLOCATOR(PropertyDefinition, SystemAllocator, 0); AZ_TYPE_INFO(AZ::RPI::MaterialTypeSourceData::PropertyDefinition, "{E0DB3C0D-75DB-4ADB-9E79-30DA63FA18B7}"); - + static const float DefaultMin; static const float DefaultMax; static const float DefaultStep; @@ -117,68 +118,159 @@ namespace AZ AZStd::unordered_map m_shaderOptionValues; }; - using PropertyList = AZStd::vector; + using PropertyList = AZStd::vector>; + + struct PropertySet + { + friend class MaterialTypeSourceData; + + AZ_CLASS_ALLOCATOR(PropertySet, SystemAllocator, 0); + AZ_TYPE_INFO(AZ::RPI::MaterialTypeSourceData::PropertySet, "{BA3AA0E4-C74D-4FD0-ADB2-00B060F06314}"); + + public: + + PropertySet() = default; + AZ_DISABLE_COPY(PropertySet) + + const AZStd::string& GetName() const { return m_name; } + const AZStd::string& GetDisplayName() const { return m_displayName; } + const AZStd::string& GetDescription() const { return m_description; } + const PropertyList& GetProperties() const { return m_properties; } + const AZStd::vector>& GetPropertySets() const { return m_propertySets; } + const AZStd::vector>& GetFunctors() const { return m_materialFunctorSourceData; } + + void SetDisplayName(AZStd::string_view displayName) { m_displayName = displayName; } + void SetDescription(AZStd::string_view description) { m_description = description; } + + PropertyDefinition* AddProperty(AZStd::string_view name); + PropertySet* AddPropertySet(AZStd::string_view name); + + private: + + static PropertySet* AddPropertySet(AZStd::string_view name, AZStd::vector>& toPropertySetList); + + AZStd::string m_name; + AZStd::string m_displayName; + AZStd::string m_description; + PropertyList m_properties; + AZStd::vector> m_propertySets; + AZStd::vector> m_materialFunctorSourceData; + }; + struct PropertyLayout { AZ_TYPE_INFO(AZ::RPI::MaterialTypeSourceData::PropertyLayout, "{AE53CF3F-5C3B-44F5-B2FB-306F0EB06393}"); + PropertyLayout() = default; + AZ_DISABLE_COPY(PropertyLayout) + //! Indicates the version of the set of available properties. Can be used to detect materials that might need to be updated. uint32_t m_version = 0; + //! [Deprecated] Use m_propertySets instead //! List of groups that will contain the available properties AZStd::vector m_groups; + //! [Deprecated] Use m_propertySets instead //! Collection of all available user-facing properties - AZStd::map m_properties; + AZStd::map> m_properties; + + AZStd::vector> m_propertySets; }; + + PropertySet* AddPropertySet(AZStd::string_view propertySetId); + //PropertySet* AddPropertySet(AZStd::string_view parentPropertySetId, AZStd::string_view name); + PropertyDefinition* AddProperty(AZStd::string_view propertyId); + //PropertyDefinition* AddProperty(AZStd::string_view parentPropertySetId, AZStd::string_view name); - AZStd::string m_description; + const PropertyLayout& GetPropertyLayout() const { return m_propertyLayout; } - PropertyLayout m_propertyLayout; + AZStd::string m_description; //< TODO: Make this private //! A list of shader variants that are always used at runtime; they cannot be turned off - AZStd::vector m_shaderCollection; + AZStd::vector m_shaderCollection; //< TODO: Make this private //! Material functors provide custom logic and calculations to configure shaders, render states, and more. See MaterialFunctor.h for details. - AZStd::vector> m_materialFunctorSourceData; + AZStd::vector> m_materialFunctorSourceData; //< TODO: Make this private //! Override names for UV input in the shaders of this material type. //! Using ordered map to sort names on loading. using UvNameMap = AZStd::map; - UvNameMap m_uvNameMap; + UvNameMap m_uvNameMap; //< TODO: Make this private //! Copy over UV custom names to the properties enum values. void ResolveUvEnums(); + + const PropertySet* FindPropertySet(AZStd::string_view propertySetId) const; - const GroupDefinition* FindGroup(AZStd::string_view groupName) const; + const PropertyDefinition* FindProperty(AZStd::string_view propertyId) const; - const PropertyDefinition* FindProperty(AZStd::string_view groupName, AZStd::string_view propertyName) const; + //! Tokenizes an ID string like "itemA.itemB.itemC" into a vector like ["itemA", "itemB", "itemC"] + static AZStd::vector TokenizeId(AZStd::string_view id); + + //! Splits an ID string like "itemA.itemB.itemC" into a vector like ["itemA.itemB", "itemC"] + static AZStd::vector SplitId(AZStd::string_view id); - //! Construct a complete list of group definitions, including implicit groups, arranged in the same order as the source data - //! Groups with the same name will be consolidated into a single entry - AZStd::vector GetGroupDefinitionsInDisplayOrder() const; + //! Call back function type used with the enumeration functions + using EnumeratePropertySetsCallback = AZStd::function; + //! Recursively traverses all of the property sets contained in the material type, executing a callback function for each. + //! @return false if the enumeration was terminated early by the callback returning false. + bool EnumeratePropertySets(const EnumeratePropertySetsCallback& callback) const; //! Call back function type used with the numeration functions using EnumeratePropertiesCallback = AZStd::function; - - //! Traverse all of the properties contained in the source data executing a callback function - //! Traversal will occur in group alphabetical order and stop once all properties have been enumerated or the callback function returns false - void EnumerateProperties(const EnumeratePropertiesCallback& callback) const; - - //! Traverse all of the properties in the source data in display/storage order executing a callback function - //! Traversal will stop once all properties have been enumerated or the callback function returns false - void EnumeratePropertiesInDisplayOrder(const EnumeratePropertiesCallback& callback) const; + + //! Recursively traverses all of the properties contained in the material type, executing a callback function for each. + //! @return false if the enumeration was terminated early by the callback returning false. + bool EnumerateProperties(const EnumeratePropertiesCallback& callback) const; //! Convert the property value into the format that will be stored in the source data //! This is primarily needed to support conversions of special types like enums and images bool ConvertPropertyValueToSourceDataFormat(const PropertyDefinition& propertyDefinition, MaterialPropertyValue& propertyValue) const; Outcome> CreateMaterialTypeAsset(Data::AssetId assetId, AZStd::string_view materialTypeSourceFilePath = "", bool elevateWarnings = true) const; + + bool ConvertToNewDataFormat(); + + private: + + //PropertySet* FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList); + const PropertySet* FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) const; + + //PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList); + const PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) const; + + //PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, PropertySet& inPropertySet); + //const PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, const PropertySet& inPropertySet) const; + + // Function overloads for recursion, returns false to indicate that recursion should end. + bool EnumeratePropertySets(const EnumeratePropertySetsCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertySetList) const; + bool EnumerateProperties(const EnumeratePropertiesCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertySetList) const; + + //! Recursively populates a material asset with properties from the tree of material property sets. + //! @param materialTypeSourceFilePath path to the material type file that is being processed, used to look up relative paths + //! @param propertyNameContext the accumulated prefix that should be applied to any property names encountered in the current @propertySet + //! @param propertySet the current PropertySet that is being processed + //! @return false if errors are detected and processing should abort + bool BuildPropertyList( + const AZStd::string& materialTypeSourceFilePath, + MaterialTypeAssetCreator& materialTypeAssetCreator, + AZStd::vector& propertyNameContext, + const MaterialTypeSourceData::PropertySet* propertySet) const; + + //! Construct a complete list of group definitions, including implicit groups, arranged in the same order as the source data. + //! Groups with the same name will be consolidated into a single entry. + //! Operates on the old format PropertyLayout::m_groups, used for conversion to the new format. + AZStd::vector GetOldFormatGroupDefinitionsInDisplayOrder() const; + + PropertyLayout m_propertyLayout; }; //! The wrapper class for derived material functors. @@ -207,7 +299,7 @@ namespace AZ return m_actualSourceData ? m_actualSourceData->CreateFunctor(editorContext) : Failure(); } - const Ptr GetActualSourceData() const { return m_actualSourceData; } + Ptr GetActualSourceData() const { return m_actualSourceData; } private: Ptr m_actualSourceData = nullptr; // The derived material functor instance. }; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp index 1be5c4485c..47e41fa6fa 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp @@ -103,6 +103,36 @@ namespace AZ AzFramework::StringFunc::Join(fullName, names.begin(), names.end(), "."); m_fullName = fullName; } + + MaterialPropertyId::MaterialPropertyId(const AZStd::array_view groupNames, AZStd::string_view propertyName) + { + for (const auto& name : groupNames) + { + if (!IsValidName(name)) + { + AZ_Error("MaterialPropertyId", false, "'%s' is not a valid identifier.", name.c_str()); + return; + } + } + + if (!IsValidName(propertyName)) + { + AZ_Error("MaterialPropertyId", false, "'%.*s' is not a valid identifier.", AZ_STRING_ARG(propertyName)); + return; + } + + if (groupNames.empty()) + { + m_fullName = propertyName; + } + else + { + AZStd::string fullName; + AzFramework::StringFunc::Join(fullName, groupNames.begin(), groupNames.end(), "."); + fullName = AZStd::string::format("%s.%.*s", fullName.c_str(), AZ_STRING_ARG(propertyName)); + m_fullName = fullName; + } + } MaterialPropertyId::operator const Name&() const { @@ -113,6 +143,11 @@ namespace AZ { return m_fullName.GetCStr(); } + + AZStd::string_view MaterialPropertyId::GetStringView() const + { + return m_fullName.GetStringView(); + } Name::Hash MaterialPropertyId::GetHash() const { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp index 3b2d36451a..5bf78d1639 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -63,6 +64,7 @@ namespace AZ } // Construct the full property name (groupName.propertyName) by parsing it from the JSON path string. + // Note we don't yet support full nested property sets, but eventually this should not be limited to just one group with one list of properties... size_t startPropertyName = context.GetPath().Get().rfind('/'); size_t startGroupName = context.GetPath().Get().rfind('/', startPropertyName-1); AZStd::string_view groupName = context.GetPath().Get().substr(startGroupName + 1, startPropertyName - startGroupName - 1); @@ -70,7 +72,7 @@ namespace AZ JSR::ResultCode result(JSR::Tasks::ReadField); - auto propertyDefinition = materialType->FindProperty(groupName, propertyName); + auto propertyDefinition = materialType->FindProperty(MaterialPropertyId{groupName, propertyName}.GetStringView()); if (!propertyDefinition) { AZStd::string message = AZStd::string::format("Property '%.*s.%.*s' not found in material type.", AZ_STRING_ARG(groupName), AZ_STRING_ARG(propertyName)); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp index 5e4af07aae..e24655b7a6 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp @@ -103,6 +103,7 @@ namespace AZ settings.m_clearContainers = context.ShouldClearContainers(); JsonSerializationResult::ResultCode materialTypeLoadResult = JsonSerialization::Load(materialTypeData, materialTypeJson.GetValue(), settings); + materialTypeData.ConvertToNewDataFormat(); materialTypeData.ResolveUvEnums(); // Restore prior configuration diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index f69b082292..de55cbecb5 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -56,7 +56,11 @@ namespace AZ serializeContext->Class()->Version(3); serializeContext->Class()->Version(4); serializeContext->Class()->Version(1); - + + serializeContext->RegisterGenericType>(); + serializeContext->RegisterGenericType>(); + serializeContext->RegisterGenericType>>(); + serializeContext->RegisterGenericType>>(); serializeContext->RegisterGenericType(); serializeContext->Class() @@ -66,11 +70,22 @@ namespace AZ ->Field("options", &ShaderVariantReferenceData::m_shaderOptionValues) ; + serializeContext->Class() + ->Version(1) + ->Field("name", &PropertySet::m_name) + ->Field("displayName", &PropertySet::m_displayName) + ->Field("description", &PropertySet::m_description) + ->Field("properties", &PropertySet::m_properties) + ->Field("propertySets", &PropertySet::m_propertySets) + ->Field("functors", &PropertySet::m_materialFunctorSourceData) + ; + serializeContext->Class() ->Version(1) ->Field("version", &PropertyLayout::m_version) - ->Field("groups", &PropertyLayout::m_groups) - ->Field("properties", &PropertyLayout::m_properties) + ->Field("groups", &PropertyLayout::m_groups) //< Old, preserved for backward compatibility, replaced by propertySets + ->Field("properties", &PropertyLayout::m_properties) //< Old, preserved for backward compatibility, replaced by propertySets + ->Field("propertySets", &PropertyLayout::m_propertySets) ; serializeContext->RegisterGenericType(); @@ -92,43 +107,397 @@ namespace AZ , m_shaderIndex(shaderIndex) { } - + const float MaterialTypeSourceData::PropertyDefinition::DefaultMin = std::numeric_limits::lowest(); const float MaterialTypeSourceData::PropertyDefinition::DefaultMax = std::numeric_limits::max(); const float MaterialTypeSourceData::PropertyDefinition::DefaultStep = 0.1f; - - const MaterialTypeSourceData::GroupDefinition* MaterialTypeSourceData::FindGroup(AZStd::string_view groupName) const + + /*static*/ MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::PropertySet::AddPropertySet(AZStd::string_view name, AZStd::vector>& toPropertySetList) { - for (const GroupDefinition& group : m_propertyLayout.m_groups) - { - if (group.m_name == groupName) + auto iter = AZStd::find_if(toPropertySetList.begin(), toPropertySetList.end(), [name](const AZStd::unique_ptr& existingPropertySet) { - return &group; + return existingPropertySet->m_name == name; + }); + + if (iter != toPropertySetList.end()) + { + AZ_Error("Material source data", false, "PropertySet named '%.*s' already exists", AZ_STRING_ARG(name)); + return nullptr; + } + + if (!MaterialPropertyId::IsValidName(name)) + { + AZ_Error("Material source data", false, "'%.*s' is not a valid identifier", AZ_STRING_ARG(name)); + return nullptr; + } + + toPropertySetList.push_back(AZStd::make_unique()); + toPropertySetList.back()->m_name = name; + return toPropertySetList.back().get(); + } + + MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::PropertySet::AddProperty(AZStd::string_view name) + { + auto propertyIter = AZStd::find_if(m_properties.begin(), m_properties.end(), [name](const AZStd::unique_ptr& existingProperty) + { + return existingProperty->m_name == name; + }); + + if (propertyIter != m_properties.end()) + { + AZ_Error("Material source data", false, "PropertySet '%s' already contains a property named '%.*s'", m_name.c_str(), AZ_STRING_ARG(name)); + return nullptr; + } + + auto propertySetIter = AZStd::find_if(m_propertySets.begin(), m_propertySets.end(), [name](const AZStd::unique_ptr& existingPropertySet) + { + return existingPropertySet->m_name == name; + }); + + if (propertySetIter != m_propertySets.end()) + { + AZ_Error("Material source data", false, "Property name '%.*s' collides with a PropertySet of the same name", AZ_STRING_ARG(name)); + return nullptr; + } + + if (!MaterialPropertyId::IsValidName(name)) + { + AZ_Error("Material source data", false, "'%.*s' is not a valid identifier", AZ_STRING_ARG(name)); + return nullptr; + } + + m_properties.emplace_back(AZStd::make_unique()); + m_properties.back()->m_name = name; + return m_properties.back().get(); + } + + MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::PropertySet::AddPropertySet(AZStd::string_view name) + { + auto iter = AZStd::find_if(m_properties.begin(), m_properties.end(), [name](const AZStd::unique_ptr& existingProperty) + { + return existingProperty->m_name == name; + }); + + if (iter != m_properties.end()) + { + AZ_Error("Material source data", false, "PropertySet name '%.*s' collides with a Property of the same name", AZ_STRING_ARG(name)); + return nullptr; + } + + return AddPropertySet(name, m_propertySets); + } + + MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::AddPropertySet(AZStd::string_view propertySetId) + { + AZStd::vector splitPropertySetId = SplitId(propertySetId); + + if (splitPropertySetId.size() == 1) + { + return PropertySet::AddPropertySet(propertySetId, m_propertyLayout.m_propertySets); + } + + // TODO: Delete + //return AddPropertySet(splitPropertySetId[0], splitPropertySetId[1]); + + PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(splitPropertySetId[0])); + + if (!parentPropertySet) + { + AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(splitPropertySetId[0])); + return nullptr; + } + + return parentPropertySet->AddPropertySet(splitPropertySetId[1]); + } + + // TODO: Delete + //MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::AddPropertySet(AZStd::string_view parentPropertySetId, AZStd::string_view name) + //{ + // PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(parentPropertySetId)); + // + // if (!parentPropertySet) + // { + // AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(parentPropertySetId)); + // return nullptr; + // } + + // return parentPropertySet->AddPropertySet(name); + //} + + MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::AddProperty(AZStd::string_view propertyId) + { + AZStd::vector splitPropertyId = SplitId(propertyId); + //if (splitPropertyId.empty()) + //{ + // return nullptr; + //} + + if (splitPropertyId.size() == 1) + { + AZ_Error("Material source data", false, "Property id '%.*s' is invalid. Properties must be added to a PropertySet (i.e. \"general.%.*s\").", AZ_STRING_ARG(propertyId), AZ_STRING_ARG(propertyId)); + return nullptr; + } + + // TODO: Delete + //return AddProperty(splitPropertyId[0], splitPropertyId[1]); + + PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(splitPropertyId[0])); + + if (!parentPropertySet) + { + AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(splitPropertyId[0])); + return nullptr; + } + + return parentPropertySet->AddProperty(splitPropertyId[1]); + } + + // TODO: Delete + //MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::AddProperty(AZStd::string_view parentPropertySetId, AZStd::string_view name) + //{ + // PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(parentPropertySetId)); + // + // if (!parentPropertySet) + // { + // AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(parentPropertySetId)); + // return nullptr; + // } + + // return parentPropertySet->AddProperty(name); + //} + + const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) const + { + for (const auto& propertySet : inPropertySetList) + { + if (propertySet->m_name != parsedPropertySetId[0]) + { + continue; + } + else if (parsedPropertySetId.size() == 1) + { + return propertySet.get(); + } + else + { + AZStd::array_view subPath{parsedPropertySetId.begin() + 1, parsedPropertySetId.end()}; + + if (!subPath.empty()) + { + const MaterialTypeSourceData::PropertySet* propertySubset = FindPropertySet(subPath, propertySet->m_propertySets); + if (propertySubset) + { + return propertySubset; + } + } } } return nullptr; } - const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::string_view groupName, AZStd::string_view propertyName) const - { - auto groupIter = m_propertyLayout.m_properties.find(groupName); - if (groupIter == m_propertyLayout.m_properties.end()) - { - return nullptr; - } + //MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) + //{ + // return const_cast(const_cast(this)->FindPropertySet(parsedPropertySetId, inPropertySetList)); + //} - for (const PropertyDefinition& property : groupIter->second) + const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::string_view propertySetId) const + { + AZStd::vector tokens = TokenizeId(propertySetId); + return FindPropertySet(tokens, m_propertyLayout.m_propertySets); + } + + //MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, PropertySet& inPropertySet) + //{ + // if (parsedPropertyId.size() == 1) + // { + // for (AZStd::unique_ptr& property : inPropertySet.m_properties) + // { + // if (property->m_name == parsedPropertyId[0]) + // { + // return property.get(); + // } + // } + // } + + // return FindProperty(parsedPropertyId, inPropertySet.m_propertySets); + //} + + //const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, const PropertySet& inPropertySet) const + //{ + // MaterialTypeSourceData* nonConstThis = const_cast(this); + // PropertySet& nonConstPropertySet = *const_cast(&inPropertySet); + // return const_cast(nonConstThis->FindProperty(parsedPropertyId, nonConstPropertySet)); + //} + + const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty( + AZStd::array_view parsedPropertyId, + AZStd::array_view> inPropertySetList) const + { + for (const auto& propertySet : inPropertySetList) { - if (property.m_name == propertyName) + if (propertySet->m_name == parsedPropertyId[0]) { - return &property; + AZStd::array_view subPath {parsedPropertyId.begin() + 1, parsedPropertyId.end()}; + + if (subPath.size() == 1) + { + for (AZStd::unique_ptr& property : propertySet->m_properties) + { + if (property->m_name == subPath[0]) + { + return property.get(); + } + } + } + else if(subPath.size() > 1) + { + const MaterialTypeSourceData::PropertyDefinition* property = FindProperty(subPath, propertySet->m_propertySets); + if (property) + { + return property; + } + } } } return nullptr; } + //MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) + //{ + // return const_cast(const_cast(this)->FindProperty(parsedPropertyId, inPropertySetList)); + //} + + const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::string_view propertyId) const + { + AZStd::vector tokens = TokenizeId(propertyId); + return FindProperty(tokens, m_propertyLayout.m_propertySets); + } + + AZStd::vector MaterialTypeSourceData::TokenizeId(AZStd::string_view id) + { + AZStd::vector tokens; + AzFramework::StringFunc::Tokenize(id, tokens, "./", true, true); + return tokens; + } + + AZStd::vector MaterialTypeSourceData::SplitId(AZStd::string_view id) + { + AZStd::vector parts; + parts.reserve(2); + size_t lastDelim = id.rfind('.', id.size()-1); + if (lastDelim == AZStd::string::npos) + { + parts.push_back(id); + } + else + { + parts.push_back(AZStd::string_view{id.begin(), id.begin()+lastDelim}); + parts.push_back(AZStd::string_view{id.begin()+lastDelim+1, id.end()}); + } + + return parts; + } + + bool MaterialTypeSourceData::EnumeratePropertySets(const EnumeratePropertySetsCallback& callback, AZStd::string propertyNameContext, const AZStd::vector>& inPropertySetList) const + { + for (auto& propertySet : inPropertySetList) + { + if (!callback(propertyNameContext, propertySet.get())) + { + return false; // Stop processing + } + + const AZStd::string propertyNameContext2 = propertyNameContext + propertySet->m_name + "."; + + if (!EnumeratePropertySets(callback, propertyNameContext2, propertySet->m_propertySets)) + { + return false; // Stop processing + } + } + + return true; + } + + bool MaterialTypeSourceData::EnumeratePropertySets(const EnumeratePropertySetsCallback& callback) const + { + if (!callback) + { + return false; + } + + return EnumeratePropertySets(callback, {}, m_propertyLayout.m_propertySets); + } + + bool MaterialTypeSourceData::EnumerateProperties(const EnumeratePropertiesCallback& callback, AZStd::string propertyNameContext, const AZStd::vector>& inPropertySetList) const + { + + for (auto& propertySet : inPropertySetList) + { + const AZStd::string propertyNameContext2 = propertyNameContext + propertySet->m_name + "."; + + for (auto& property : propertySet->m_properties) + { + if (!callback(propertyNameContext2, property.get())) + { + return false; // Stop processing + } + } + + if (!EnumerateProperties(callback, propertyNameContext2, propertySet->m_propertySets)) + { + return false; // Stop processing + } + } + + return true; + } + + bool MaterialTypeSourceData::EnumerateProperties(const EnumeratePropertiesCallback& callback) const + { + if (!callback) + { + return false; + } + + return EnumerateProperties(callback, {}, m_propertyLayout.m_propertySets); + } + + bool MaterialTypeSourceData::ConvertToNewDataFormat() + { + for (const auto& group : GetOldFormatGroupDefinitionsInDisplayOrder()) + { + auto propertyListItr = m_propertyLayout.m_properties.find(group.m_name); + if (propertyListItr != m_propertyLayout.m_properties.end()) + { + const auto& propertyList = propertyListItr->second; + for (auto& propertyDefinition : propertyList) + { + PropertySet* propertySet = const_cast(const_cast(this)->FindPropertySet(group.m_name)); + + if (!propertySet) + { + m_propertyLayout.m_propertySets.emplace_back(AZStd::make_unique()); + m_propertyLayout.m_propertySets.back()->m_name = group.m_name; + m_propertyLayout.m_propertySets.back()->m_displayName = group.m_displayName; + m_propertyLayout.m_propertySets.back()->m_description = group.m_description; + propertySet = m_propertyLayout.m_propertySets.back().get(); + } + + PropertyDefinition* newProperty = propertySet->AddProperty(propertyDefinition.m_name); + + *newProperty = propertyDefinition; + } + } + } + + m_propertyLayout.m_groups.clear(); + m_propertyLayout.m_properties.clear(); + + return true; + } + void MaterialTypeSourceData::ResolveUvEnums() { AZStd::vector enumValues; @@ -137,20 +506,20 @@ namespace AZ { enumValues.push_back(uvNamePair.second); } - - for (auto& group : m_propertyLayout.m_properties) - { - for (PropertyDefinition& property : group.second) + + EnumerateProperties([&enumValues](const AZStd::string&, const MaterialTypeSourceData::PropertyDefinition* property) { - if (property.m_dataType == AZ::RPI::MaterialPropertyDataType::Enum && property.m_enumIsUv) + if (property->m_dataType == AZ::RPI::MaterialPropertyDataType::Enum && property->m_enumIsUv) { - property.m_enumValues = enumValues; + // const_cast is safe because this is internal to the MaterialTypeSourceData. It isn't worth complicating things + // by adding another version of EnumerateProperties. + const_cast(property)->m_enumValues = enumValues; } - } - } + return true; + }); } - AZStd::vector MaterialTypeSourceData::GetGroupDefinitionsInDisplayOrder() const + AZStd::vector MaterialTypeSourceData::GetOldFormatGroupDefinitionsInDisplayOrder() const { AZStd::vector groupDefinitions; groupDefinitions.reserve(m_propertyLayout.m_properties.size()); @@ -184,54 +553,7 @@ namespace AZ return groupDefinitions; } - void MaterialTypeSourceData::EnumerateProperties(const EnumeratePropertiesCallback& callback) const - { - if (!callback) - { - return; - } - - for (const auto& propertyListPair : m_propertyLayout.m_properties) - { - const AZStd::string& groupName = propertyListPair.first; - const auto& propertyList = propertyListPair.second; - for (const auto& propertyDefinition : propertyList) - { - const AZStd::string& propertyName = propertyDefinition.m_name; - if (!callback(groupName, propertyName, propertyDefinition)) - { - return; - } - } - } - } - - void MaterialTypeSourceData::EnumeratePropertiesInDisplayOrder(const EnumeratePropertiesCallback& callback) const - { - if (!callback) - { - return; - } - - for (const auto& groupDefinition : GetGroupDefinitionsInDisplayOrder()) - { - const AZStd::string& groupName = groupDefinition.m_name; - const auto propertyListItr = m_propertyLayout.m_properties.find(groupName); - if (propertyListItr != m_propertyLayout.m_properties.end()) - { - const auto& propertyList = propertyListItr->second; - for (const auto& propertyDefinition : propertyList) - { - const AZStd::string& propertyName = propertyDefinition.m_name; - if (!callback(groupName, propertyName, propertyDefinition)) - { - return; - } - } - } - } - } - + // TODO: It looks like this function doesn't operate on MaterialTypeSourceData data, it belongs in MaterialUtils bool MaterialTypeSourceData::ConvertPropertyValueToSourceDataFormat(const PropertyDefinition& propertyDefinition, MaterialPropertyValue& propertyValue) const { if (propertyDefinition.m_dataType == AZ::RPI::MaterialPropertyDataType::Enum && propertyValue.Is()) @@ -274,6 +596,178 @@ namespace AZ return true; } + bool MaterialTypeSourceData::BuildPropertyList( + const AZStd::string& materialTypeSourceFilePath, + MaterialTypeAssetCreator& materialTypeAssetCreator, + AZStd::vector& propertyNameContext, + const MaterialTypeSourceData::PropertySet* propertySet) const + { + for (const AZStd::unique_ptr& property : propertySet->m_properties) + { + // Register the property... + + MaterialPropertyId propertyId{propertyNameContext, property->m_name}; + + if (!propertyId.IsValid()) + { + // MaterialPropertyId reports an error message + return false; + } + + auto propertySetIter = AZStd::find_if(propertySet->GetPropertySets().begin(), propertySet->GetPropertySets().end(), + [&property](const AZStd::unique_ptr& existingPropertySet) + { + return existingPropertySet->GetName() == property->m_name; + }); + + if (propertySetIter != propertySet->GetPropertySets().end()) + { + AZ_Error("Material source data", false, "Material property '%s' collides with a PropertySet with the same ID.", propertyId.GetCStr()); + return false; + } + + materialTypeAssetCreator.BeginMaterialProperty(propertyId, property->m_dataType); + + if (property->m_dataType == MaterialPropertyDataType::Enum) + { + materialTypeAssetCreator.SetMaterialPropertyEnumNames(property->m_enumValues); + } + + for (auto& output : property->m_outputConnections) + { + switch (output.m_type) + { + case MaterialPropertyOutputType::ShaderInput: + { + materialTypeAssetCreator.ConnectMaterialPropertyToShaderInput(Name{output.m_fieldName}); + break; + } + case MaterialPropertyOutputType::ShaderOption: + { + if (output.m_shaderIndex >= 0) + { + materialTypeAssetCreator.ConnectMaterialPropertyToShaderOption(Name{output.m_fieldName}, output.m_shaderIndex); + } + else + { + materialTypeAssetCreator.ConnectMaterialPropertyToShaderOptions(Name{output.m_fieldName}); + } + break; + } + case MaterialPropertyOutputType::Invalid: + // Don't add any output mappings, this is the case when material functors are expected to process the property + break; + default: + AZ_Assert(false, "Unsupported MaterialPropertyOutputType"); + return false; + } + } + + materialTypeAssetCreator.EndMaterialProperty(); + + // Parse and set the property's value... + if (!property->m_value.IsValid()) + { + AZ_Warning("Material source data", false, "Source data for material property value is invalid."); + } + else + { + switch (property->m_dataType) + { + case MaterialPropertyDataType::Image: + { + Outcome> imageAssetResult = MaterialUtils::GetImageAssetReference(materialTypeSourceFilePath, property->m_value.GetValue()); + + if (imageAssetResult.IsSuccess()) + { + materialTypeAssetCreator.SetPropertyValue(propertyId, imageAssetResult.GetValue()); + } + else + { + materialTypeAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), property->m_value.GetValue().data()); + } + } + break; + case MaterialPropertyDataType::Enum: + { + MaterialPropertyIndex propertyIndex = materialTypeAssetCreator.GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); + const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAssetCreator.GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); + + AZ::Name enumName = AZ::Name(property->m_value.GetValue()); + uint32_t enumValue = propertyDescriptor->GetEnumValue(enumName); + if (enumValue == MaterialPropertyDescriptor::InvalidEnumValue) + { + materialTypeAssetCreator.ReportError("Enum value '%s' couldn't be found in the 'enumValues' list", enumName.GetCStr()); + } + else + { + materialTypeAssetCreator.SetPropertyValue(propertyId, enumValue); + } + } + break; + default: + materialTypeAssetCreator.SetPropertyValue(propertyId, property->m_value); + break; + } + } + } + + for (const AZStd::unique_ptr& propertySubset : propertySet->m_propertySets) + { + propertyNameContext.push_back(propertySubset->m_name); + + bool success = BuildPropertyList( + materialTypeSourceFilePath, + materialTypeAssetCreator, + propertyNameContext, + propertySubset.get()); + + propertyNameContext.pop_back(); + + if (!success) + { + return false; + } + } + + // We cannot create the MaterialFunctor until after all the properties are added because + // CreateFunctor() may need to look up properties in the MaterialPropertiesLayout + for (auto& functorData : propertySet->m_materialFunctorSourceData) + { + MaterialFunctorSourceData::FunctorResult result = functorData->CreateFunctor( + MaterialFunctorSourceData::RuntimeContext( + materialTypeSourceFilePath, + materialTypeAssetCreator.GetMaterialPropertiesLayout(), + materialTypeAssetCreator.GetMaterialShaderResourceGroupLayout(), + materialTypeAssetCreator.GetShaderCollection() + ) + ); + + if (result.IsSuccess()) + { + Ptr& functor = result.GetValue(); + if (functor != nullptr) + { + materialTypeAssetCreator.AddMaterialFunctor(functor); + + for (const AZ::Name& optionName : functorData->GetActualSourceData()->GetShaderOptionDependencies()) + { + materialTypeAssetCreator.ClaimShaderOptionOwnership(Name{optionName.GetCStr()}); + } + } + } + else + { + materialTypeAssetCreator.ReportError("Failed to create MaterialFunctor"); + return false; + } + } + + + return true; + } + + Outcome> MaterialTypeSourceData::CreateMaterialTypeAsset(Data::AssetId assetId, AZStd::string_view materialTypeSourceFilePath, bool elevateWarnings) const { MaterialTypeAssetCreator materialTypeAssetCreator; @@ -327,103 +821,16 @@ namespace AZ return Failure(); } } - - for (auto& groupIter : m_propertyLayout.m_properties) + + for (const AZStd::unique_ptr& propertySet : m_propertyLayout.m_propertySets) { - const AZStd::string& groupName = groupIter.first; + AZStd::vector propertyNameContext; + propertyNameContext.push_back(propertySet->m_name); + bool success = BuildPropertyList(materialTypeSourceFilePath, materialTypeAssetCreator, propertyNameContext, propertySet.get()); - for (const PropertyDefinition& property : groupIter.second) + if (!success) { - // Register the property... - - MaterialPropertyId propertyId{ groupName, property.m_name }; - - if (!propertyId.IsValid()) - { - materialTypeAssetCreator.ReportWarning("Cannot create material property with invalid ID '%s'.", propertyId.GetCStr()); - continue; - } - - materialTypeAssetCreator.BeginMaterialProperty(propertyId, property.m_dataType); - - if (property.m_dataType == MaterialPropertyDataType::Enum) - { - materialTypeAssetCreator.SetMaterialPropertyEnumNames(property.m_enumValues); - } - - for (auto& output : property.m_outputConnections) - { - switch (output.m_type) - { - case MaterialPropertyOutputType::ShaderInput: - materialTypeAssetCreator.ConnectMaterialPropertyToShaderInput(Name{ output.m_fieldName.data() }); - break; - case MaterialPropertyOutputType::ShaderOption: - if (output.m_shaderIndex >= 0) - { - materialTypeAssetCreator.ConnectMaterialPropertyToShaderOption(Name{ output.m_fieldName.data() }, output.m_shaderIndex); - } - else - { - materialTypeAssetCreator.ConnectMaterialPropertyToShaderOptions(Name{ output.m_fieldName.data() }); - } - break; - case MaterialPropertyOutputType::Invalid: - // Don't add any output mappings, this is the case when material functors are expected to process the property - break; - default: - AZ_Assert(false, "Unsupported MaterialPropertyOutputType"); - return Failure(); - } - } - - materialTypeAssetCreator.EndMaterialProperty(); - - // Parse and set the property's value... - if (!property.m_value.IsValid()) - { - AZ_Warning("Material source data", false, "Source data for material property value is invalid."); - } - else - { - switch (property.m_dataType) - { - case MaterialPropertyDataType::Image: - { - Outcome> imageAssetResult = MaterialUtils::GetImageAssetReference(materialTypeSourceFilePath, property.m_value.GetValue()); - - if (imageAssetResult.IsSuccess()) - { - materialTypeAssetCreator.SetPropertyValue(propertyId, imageAssetResult.GetValue()); - } - else - { - materialTypeAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), property.m_value.GetValue().data()); - } - } - break; - case MaterialPropertyDataType::Enum: - { - MaterialPropertyIndex propertyIndex = materialTypeAssetCreator.GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); - const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAssetCreator.GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); - - AZ::Name enumName = AZ::Name(property.m_value.GetValue()); - uint32_t enumValue = propertyDescriptor ? propertyDescriptor->GetEnumValue(enumName) : MaterialPropertyDescriptor::InvalidEnumValue; - if (enumValue == MaterialPropertyDescriptor::InvalidEnumValue) - { - materialTypeAssetCreator.ReportError("Enum value '%s' couldn't be found in the 'enumValues' list", enumName.GetCStr()); - } - else - { - materialTypeAssetCreator.SetPropertyValue(propertyId, enumValue); - } - } - break; - default: - materialTypeAssetCreator.SetPropertyValue(propertyId, property.m_value); - break; - } - } + return Failure(); } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp index 90ce9e66ce..174a2e682a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp @@ -90,6 +90,7 @@ namespace AZ settings.m_metadata.Add(fileLoadContext); JsonSerialization::Load(materialType, *document, settings); + materialType.ConvertToNewDataFormat(); materialType.ResolveUvEnums(); if (reportingHelper.ErrorsReported()) diff --git a/Gems/Atom/RPI/Code/Tests/Common/ErrorMessageFinder.cpp b/Gems/Atom/RPI/Code/Tests/Common/ErrorMessageFinder.cpp index fa88f145a6..06cdb073e9 100644 --- a/Gems/Atom/RPI/Code/Tests/Common/ErrorMessageFinder.cpp +++ b/Gems/Atom/RPI/Code/Tests/Common/ErrorMessageFinder.cpp @@ -84,7 +84,7 @@ namespace UnitTest } } - m_checked = true; + m_checked = true; } void ErrorMessageFinder::ReportFailure(const AZStd::string& failureMessage) diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp index 2b729ed8ef..80da59b430 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp @@ -94,6 +94,40 @@ namespace UnitTest errorMessageFinder.CheckExpectedErrorsFound(); } + TEST_F(MaterialPropertyIdTests, TestConstructWithMultipleParentNamesSeparateFromPropertyName) + { + AZStd::vector names{"layer1", "clearCoat", "normal"}; + MaterialPropertyId id{names, "factor"}; + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "layer1.clearCoat.normal.factor"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"layer1.clearCoat.normal.factor"}); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithMultipleParentNamesSeparateFromPropertyName_BadParentName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + AZStd::vector names{"layer1", "clear-coat", "normal"}; + MaterialPropertyId id{names, "factor"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithMultipleParentNamesSeparateFromPropertyName_BadPropertyName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + AZStd::vector names{"layer1", "clearCoat", "normal"}; + MaterialPropertyId id{names, "#factor"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + TEST_F(MaterialPropertyIdTests, TestParse) { MaterialPropertyId id = MaterialPropertyId::Parse("layer1.clearCoat.normal.factor"); diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp index dd3b3b2711..293289b00f 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp @@ -201,33 +201,38 @@ namespace UnitTest TEST_F(MaterialSourceDataTests, TestJsonRoundTrip) { const char* materialTypeJson = - "{ \n" - " \"propertyLayout\": { \n" - " \"version\": 1, \n" - " \"groups\": [ \n" - " { \"name\": \"groupA\" }, \n" - " { \"name\": \"groupB\" }, \n" - " { \"name\": \"groupC\" } \n" - " ], \n" - " \"properties\": { \n" - " \"groupA\": [ \n" - " {\"name\": \"MyBool\", \"type\": \"bool\"}, \n" - " {\"name\": \"MyInt\", \"type\": \"int\"}, \n" - " {\"name\": \"MyUInt\", \"type\": \"uint\"} \n" - " ], \n" - " \"groupB\": [ \n" - " {\"name\": \"MyFloat\", \"type\": \"float\"}, \n" - " {\"name\": \"MyFloat2\", \"type\": \"vector2\"}, \n" - " {\"name\": \"MyFloat3\", \"type\": \"vector3\"} \n" - " ], \n" - " \"groupC\": [ \n" - " {\"name\": \"MyFloat4\", \"type\": \"vector4\"}, \n" - " {\"name\": \"MyColor\", \"type\": \"color\"}, \n" - " {\"name\": \"MyImage\", \"type\": \"image\"} \n" - " ] \n" - " } \n" - " } \n" - "} \n"; + R"( + { + "propertyLayout": { + "propertySets": [ + { + "name": "groupA", + "properties": [ + {"name": "MyBool", "type": "bool"}, + {"name": "MyInt", "type": "int"}, + {"name": "MyUInt", "type": "uint"} + ] + }, + { + "name": "groupB", + "properties": [ + {"name": "MyFloat", "type": "float"}, + {"name": "MyFloat2", "type": "vector2"}, + {"name": "MyFloat3", "type": "vector3"} + ] + }, + { + "name": "groupC", + "properties": [ + {"name": "MyFloat4", "type": "vector4"}, + {"name": "MyColor", "type": "color"}, + {"name": "MyImage", "type": "image"} + ] + } + ] + } + } + )"; const char* materialTypeFilePath = "@exefolder@/Gems/Atom/RPI/Code/Tests/Material/Temp/roundTripTest.materialtype"; @@ -259,25 +264,29 @@ namespace UnitTest MaterialSourceData sourceDataCopy; JsonTestResult loadResult = LoadTestDataFromJson(sourceDataCopy, sourceDataSerialized); - + CheckEqual(sourceDataOriginal, sourceDataCopy); } TEST_F(MaterialSourceDataTests, Load_MaterialTypeAfterPropertyList) { const AZStd::string simpleMaterialTypeJson = R"( - { - "propertyLayout": { - "properties": { - "general": [ + { + "propertyLayout": { + "propertySets": + [ { - "name": "testColor", - "type": "color" + "name": "general", + "properties": [ + { + "name": "testColor", + "type": "color" + } + ] } ] } } - } )"; const char* materialTypeFilePath = "@exefolder@/Gems/Atom/RPI/Code/Tests/Material/Temp/simpleMaterialType.materialtype"; @@ -376,18 +385,22 @@ namespace UnitTest TEST_F(MaterialSourceDataTests, Load_MaterialTypeMessagesAreReported) { const AZStd::string simpleMaterialTypeJson = R"( - { - "propertyLayout": { - "properties": { - "general": [ + { + "propertyLayout": { + "propertySets": + [ { - "name": "testColor", - "type": "color" + "name": "general", + "properties": [ + { + "name": "testColor", + "type": "color" + } + ] } ] } } - } )"; const char* materialTypeFilePath = "@exefolder@/Gems/Atom/RPI/Code/Tests/Material/Temp/simpleMaterialType.materialtype"; @@ -416,24 +429,28 @@ namespace UnitTest EXPECT_EQ(AZ::JsonSerializationResult::Processing::Completed, loadResult.m_jsonResultCode.GetProcessing()); // propertyLayout is a field in the material type, not the material - EXPECT_TRUE(loadResult.ContainsMessage("[simpleMaterialType.materialtype]/propertyLayout/properties", "Successfully read")); + EXPECT_TRUE(loadResult.ContainsMessage("[simpleMaterialType.materialtype]/propertyLayout/propertySets", "Successfully read")); } TEST_F(MaterialSourceDataTests, Load_Error_PropertyNotFound) { const AZStd::string simpleMaterialTypeJson = R"( - { - "propertyLayout": { - "properties": { - "general": [ + { + "propertyLayout": { + "propertySets": + [ { - "name": "testColor", - "type": "color" + "name": "general", + "properties": [ + { + "name": "testColor", + "type": "color" + } + ] } ] } } - } )"; const char* materialTypeFilePath = "@exefolder@/Gems/Atom/RPI/Code/Tests/Material/Temp/simpleMaterialType.materialtype"; diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp index ba4a58b9ff..00523abbd8 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -225,6 +226,7 @@ namespace UnitTest { serializeContext->Class() ->Version(1) + ->Field("enableProperty", &SetShaderOptionFunctorSourceData::m_enablePropertyName) ; } } @@ -243,6 +245,8 @@ namespace UnitTest Ptr functor = aznew SetShaderOptionFunctor; return Success(Ptr(functor)); } + + AZStd::string m_enablePropertyName; }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -350,9 +354,316 @@ namespace UnitTest EXPECT_EQ(propertyDescriptor->GetOutputConnections()[i].m_containerIndex.GetIndex(), expectedValues.m_outputConnections[i].m_shaderIndex); } } - }; + TEST_F(MaterialTypeSourceDataTests, PopulateAndSearchPropertyLayout) + { + MaterialTypeSourceData sourceData; + + // Here we are building up multiple layers of property sets and properties, using a variety of different Add functions, + // going through the MaterialTypeSourceData or going to the PropertySet directly. + + MaterialTypeSourceData::PropertySet* layer1 = sourceData.AddPropertySet("layer1"); + MaterialTypeSourceData::PropertySet* layer2 = sourceData.AddPropertySet("layer2"); + MaterialTypeSourceData::PropertySet* blend = sourceData.AddPropertySet("blend"); + + MaterialTypeSourceData::PropertySet* layer1_baseColor = layer1->AddPropertySet("baseColor"); + MaterialTypeSourceData::PropertySet* layer2_baseColor = layer2->AddPropertySet("baseColor"); + + MaterialTypeSourceData::PropertySet* layer1_roughness = sourceData.AddPropertySet("layer1.roughness"); + MaterialTypeSourceData::PropertySet* layer2_roughness = sourceData.AddPropertySet("layer2.roughness"); + + MaterialTypeSourceData::PropertyDefinition* layer1_baseColor_texture = layer1_baseColor->AddProperty("texture"); + MaterialTypeSourceData::PropertyDefinition* layer2_baseColor_texture = layer2_baseColor->AddProperty("texture"); + + MaterialTypeSourceData::PropertyDefinition* layer1_roughness_texture = sourceData.AddProperty("layer1.roughness.texture"); + MaterialTypeSourceData::PropertyDefinition* layer2_roughness_texture = sourceData.AddProperty("layer2.roughness.texture"); + + // We're doing clear coat only on layer2, for brevity + MaterialTypeSourceData::PropertySet* layer2_clearCoat = layer2->AddPropertySet("clearCoat"); + MaterialTypeSourceData::PropertySet* layer2_clearCoat_roughness = layer2_clearCoat->AddPropertySet("roughness"); + MaterialTypeSourceData::PropertySet* layer2_clearCoat_normal = layer2_clearCoat->AddPropertySet("normal"); + MaterialTypeSourceData::PropertyDefinition* layer2_clearCoat_enabled = layer2_clearCoat->AddProperty("enabled"); + MaterialTypeSourceData::PropertyDefinition* layer2_clearCoat_roughness_texture = layer2_clearCoat_roughness->AddProperty("texture"); + MaterialTypeSourceData::PropertyDefinition* layer2_clearCoat_normal_texture = layer2_clearCoat_normal->AddProperty("texture"); + MaterialTypeSourceData::PropertyDefinition* layer2_clearCoat_normal_factor = layer2_clearCoat_normal->AddProperty("factor"); + + MaterialTypeSourceData::PropertyDefinition* blend_factor = blend->AddProperty("factor"); + + // Check the available Find functions + + EXPECT_EQ(nullptr, sourceData.FindProperty("DoesNotExist")); + EXPECT_EQ(nullptr, sourceData.FindProperty("layer1.DoesNotExist")); + EXPECT_EQ(nullptr, sourceData.FindProperty("layer1.baseColor.DoesNotExist")); + EXPECT_EQ(nullptr, sourceData.FindProperty("baseColor.texture")); + EXPECT_EQ(nullptr, sourceData.FindProperty("baseColor")); // This is a property set, not a property + EXPECT_EQ(nullptr, sourceData.FindPropertySet("baseColor.texture")); // This is a property, not a property set + + EXPECT_EQ(layer1, sourceData.FindPropertySet("layer1")); + EXPECT_EQ(layer2, sourceData.FindPropertySet("layer2")); + EXPECT_EQ(blend, sourceData.FindPropertySet("blend")); + + EXPECT_EQ(layer1_baseColor, sourceData.FindPropertySet("layer1.baseColor")); + EXPECT_EQ(layer2_baseColor, sourceData.FindPropertySet("layer2.baseColor")); + + EXPECT_EQ(layer1_roughness, sourceData.FindPropertySet("layer1.roughness")); + EXPECT_EQ(layer2_roughness, sourceData.FindPropertySet("layer2.roughness")); + + EXPECT_EQ(layer1_baseColor_texture, sourceData.FindProperty("layer1.baseColor.texture")); + EXPECT_EQ(layer2_baseColor_texture, sourceData.FindProperty("layer2.baseColor.texture")); + EXPECT_EQ(layer1_roughness_texture, sourceData.FindProperty("layer1.roughness.texture")); + EXPECT_EQ(layer2_roughness_texture, sourceData.FindProperty("layer2.roughness.texture")); + + EXPECT_EQ(layer2_clearCoat, sourceData.FindPropertySet("layer2.clearCoat")); + EXPECT_EQ(layer2_clearCoat_roughness, sourceData.FindPropertySet("layer2.clearCoat.roughness")); + EXPECT_EQ(layer2_clearCoat_normal, sourceData.FindPropertySet("layer2.clearCoat.normal")); + + EXPECT_EQ(layer2_clearCoat_enabled, sourceData.FindProperty("layer2.clearCoat.enabled")); + EXPECT_EQ(layer2_clearCoat_roughness_texture, sourceData.FindProperty("layer2.clearCoat.roughness.texture")); + EXPECT_EQ(layer2_clearCoat_normal_texture, sourceData.FindProperty("layer2.clearCoat.normal.texture")); + EXPECT_EQ(layer2_clearCoat_normal_factor, sourceData.FindProperty("layer2.clearCoat.normal.factor")); + + EXPECT_EQ(blend_factor, sourceData.FindProperty("blend.factor")); + + // Check EnumeratePropertySets + + struct EnumeratePropertySetsResult + { + AZStd::string m_propertyIdContext; + const MaterialTypeSourceData::PropertySet* m_propertySet; + + void Check(AZStd::string expectedIdContext, const MaterialTypeSourceData::PropertySet* expectedPropertySet) + { + EXPECT_EQ(expectedIdContext, m_propertyIdContext); + EXPECT_EQ(expectedPropertySet, m_propertySet); + } + }; + AZStd::vector enumeratePropertySetsResults; + + sourceData.EnumeratePropertySets([&enumeratePropertySetsResults](const AZStd::string& propertyIdContext, const MaterialTypeSourceData::PropertySet* propertySet) + { + enumeratePropertySetsResults.push_back(EnumeratePropertySetsResult{propertyIdContext, propertySet}); + return true; + }); + + int resultIndex = 0; + enumeratePropertySetsResults[resultIndex++].Check("", layer1); + enumeratePropertySetsResults[resultIndex++].Check("layer1.", layer1_baseColor); + enumeratePropertySetsResults[resultIndex++].Check("layer1.", layer1_roughness); + enumeratePropertySetsResults[resultIndex++].Check("", layer2); + enumeratePropertySetsResults[resultIndex++].Check("layer2.", layer2_baseColor); + enumeratePropertySetsResults[resultIndex++].Check("layer2.", layer2_roughness); + enumeratePropertySetsResults[resultIndex++].Check("layer2.", layer2_clearCoat); + enumeratePropertySetsResults[resultIndex++].Check("layer2.clearCoat.", layer2_clearCoat_roughness); + enumeratePropertySetsResults[resultIndex++].Check("layer2.clearCoat.", layer2_clearCoat_normal); + enumeratePropertySetsResults[resultIndex++].Check("", blend); + EXPECT_EQ(resultIndex, enumeratePropertySetsResults.size()); + + // Check EnumerateProperties + + struct EnumeratePropertiesResult + { + AZStd::string m_propertyIdContext; + const MaterialTypeSourceData::PropertyDefinition* m_propertyDefinition; + + void Check(AZStd::string expectedIdContext, const MaterialTypeSourceData::PropertyDefinition* expectedPropertyDefinition) + { + EXPECT_EQ(expectedIdContext, m_propertyIdContext); + EXPECT_EQ(expectedPropertyDefinition, m_propertyDefinition); + } + }; + AZStd::vector enumeratePropertiesResults; + + sourceData.EnumerateProperties([&enumeratePropertiesResults](const AZStd::string& propertyIdContext, const MaterialTypeSourceData::PropertyDefinition* propertyDefinition) + { + enumeratePropertiesResults.push_back(EnumeratePropertiesResult{propertyIdContext, propertyDefinition}); + return true; + }); + + resultIndex = 0; + enumeratePropertiesResults[resultIndex++].Check("layer1.baseColor.", layer1_baseColor_texture); + enumeratePropertiesResults[resultIndex++].Check("layer1.roughness.", layer1_roughness_texture); + enumeratePropertiesResults[resultIndex++].Check("layer2.baseColor.", layer2_baseColor_texture); + enumeratePropertiesResults[resultIndex++].Check("layer2.roughness.", layer2_roughness_texture); + enumeratePropertiesResults[resultIndex++].Check("layer2.clearCoat.", layer2_clearCoat_enabled); + enumeratePropertiesResults[resultIndex++].Check("layer2.clearCoat.roughness.", layer2_clearCoat_roughness_texture); + enumeratePropertiesResults[resultIndex++].Check("layer2.clearCoat.normal.", layer2_clearCoat_normal_texture); + enumeratePropertiesResults[resultIndex++].Check("layer2.clearCoat.normal.", layer2_clearCoat_normal_factor); + enumeratePropertiesResults[resultIndex++].Check("blend.", blend_factor); + EXPECT_EQ(resultIndex, enumeratePropertiesResults.size()); + } + + TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_AddPropertyWithInvalidName) + { + MaterialTypeSourceData sourceData; + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("main"); + + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("'' is not a valid identifier"); + errorMessageFinder.AddExpectedErrorMessage("'main.' is not a valid identifier"); + errorMessageFinder.AddExpectedErrorMessage("'base-color' is not a valid identifier"); + + EXPECT_FALSE(propertySet->AddProperty("")); + EXPECT_FALSE(propertySet->AddProperty("main.")); + EXPECT_FALSE(sourceData.AddProperty("main.base-color")); + + EXPECT_TRUE(propertySet->GetProperties().empty()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddPropertySet_Error_InvalidName) + { + MaterialTypeSourceData sourceData; + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("'' is not a valid identifier", 2); + errorMessageFinder.AddExpectedErrorMessage("'base-color' is not a valid identifier"); + errorMessageFinder.AddExpectedErrorMessage("'look@it' is not a valid identifier"); + + EXPECT_FALSE(propertySet->AddPropertySet("")); + EXPECT_FALSE(sourceData.AddPropertySet("")); + EXPECT_FALSE(sourceData.AddPropertySet("base-color")); + EXPECT_FALSE(sourceData.AddPropertySet("general.look@it")); + + EXPECT_TRUE(propertySet->GetProperties().empty()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_AddDuplicateProperty) + { + MaterialTypeSourceData sourceData; + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("main"); + + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("PropertySet 'main' already contains a property named 'foo'", 2); + + EXPECT_TRUE(propertySet->AddProperty("foo")); + EXPECT_FALSE(propertySet->AddProperty("foo")); + EXPECT_FALSE(sourceData.AddProperty("main.foo")); + + EXPECT_EQ(propertySet->GetProperties().size(), 1); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_AddLooseProperty) + { + MaterialTypeSourceData sourceData; + ErrorMessageFinder errorMessageFinder("Property id 'foo' is invalid. Properties must be added to a PropertySet"); + EXPECT_FALSE(sourceData.AddProperty("foo")); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_PropertySetDoesNotExist ) + { + MaterialTypeSourceData sourceData; + ErrorMessageFinder errorMessageFinder("PropertySet 'DNE' does not exists"); + EXPECT_FALSE(sourceData.AddProperty("DNE.foo")); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddPropertySet_Error_PropertySetDoesNotExist ) + { + MaterialTypeSourceData sourceData; + ErrorMessageFinder errorMessageFinder("PropertySet 'DNE' does not exists"); + EXPECT_FALSE(sourceData.AddPropertySet("DNE.foo")); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddPropertySet_Error_AddDuplicatePropertySet) + { + MaterialTypeSourceData sourceData; + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("main"); + sourceData.AddPropertySet("main.level2"); + + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("PropertySet named 'main' already exists", 1); + errorMessageFinder.AddExpectedErrorMessage("PropertySet named 'level2' already exists", 2); + + EXPECT_FALSE(sourceData.AddPropertySet("main")); + EXPECT_FALSE(sourceData.AddPropertySet("main.level2")); + EXPECT_FALSE(propertySet->AddPropertySet("level2")); + + errorMessageFinder.CheckExpectedErrorsFound(); + + EXPECT_EQ(sourceData.GetPropertyLayout().m_propertySets.size(), 1); + EXPECT_EQ(propertySet->GetPropertySets().size(), 1); + } + + TEST_F(MaterialTypeSourceDataTests, AddPropertySet_Error_NameCollidesWithProperty ) + { + MaterialTypeSourceData sourceData; + sourceData.AddPropertySet("main"); + sourceData.AddProperty("main.foo"); + + ErrorMessageFinder errorMessageFinder("PropertySet name 'foo' collides with a Property of the same name"); + EXPECT_FALSE(sourceData.AddPropertySet("main.foo")); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_NameCollidesWithPropertySet ) + { + MaterialTypeSourceData sourceData; + sourceData.AddPropertySet("main"); + sourceData.AddPropertySet("main.foo"); + + ErrorMessageFinder errorMessageFinder("Property name 'foo' collides with a PropertySet of the same name"); + EXPECT_FALSE(sourceData.AddProperty("main.foo")); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, ResolveUvStreamAsEnum) + { + MaterialTypeSourceData sourceData; + + sourceData.m_uvNameMap["UV0"] = "Tiled"; + sourceData.m_uvNameMap["UV1"] = "Unwrapped"; + sourceData.m_uvNameMap["UV2"] = "Other"; + + sourceData.AddPropertySet("a"); + sourceData.AddPropertySet("a.b"); + sourceData.AddPropertySet("c"); + sourceData.AddPropertySet("c.d"); + sourceData.AddPropertySet("c.d.e"); + + MaterialTypeSourceData::PropertyDefinition* enum1 = sourceData.AddProperty("a.enum1"); + MaterialTypeSourceData::PropertyDefinition* enum2 = sourceData.AddProperty("a.b.enum2"); + MaterialTypeSourceData::PropertyDefinition* enum3 = sourceData.AddProperty("c.d.e.enum3"); + MaterialTypeSourceData::PropertyDefinition* notEnum = sourceData.AddProperty("c.d.myFloat"); + + enum1->m_dataType = MaterialPropertyDataType::Enum; + enum2->m_dataType = MaterialPropertyDataType::Enum; + enum3->m_dataType = MaterialPropertyDataType::Enum; + notEnum->m_dataType = MaterialPropertyDataType::Float; + + enum1->m_enumIsUv = true; + enum2->m_enumIsUv = false; + enum3->m_enumIsUv = true; + + sourceData.ResolveUvEnums(); + + EXPECT_STREQ(enum1->m_enumValues[0].c_str(), "Tiled"); + EXPECT_STREQ(enum1->m_enumValues[1].c_str(), "Unwrapped"); + EXPECT_STREQ(enum1->m_enumValues[2].c_str(), "Other"); + + EXPECT_STREQ(enum3->m_enumValues[0].c_str(), "Tiled"); + EXPECT_STREQ(enum3->m_enumValues[1].c_str(), "Unwrapped"); + EXPECT_STREQ(enum3->m_enumValues[2].c_str(), "Other"); + + // enum2 is not a UV stream enum + EXPECT_EQ(enum2->m_enumValues.size(), 0); + + // myFloat is not even an enum + EXPECT_EQ(notEnum->m_enumValues.size(), 0); + } + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_GetMaterialSrgAsset) { MaterialTypeSourceData sourceData; @@ -509,15 +820,14 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ TestShaderFilename }); - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyBool"; - propertySource.m_displayName = "My Bool"; - propertySource.m_description = "This is a bool"; - propertySource.m_dataType = MaterialPropertyDataType::Bool; - propertySource.m_value = true; - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_bool") }); - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyBool"); + property->m_displayName = "My Bool"; + property->m_description = "This is a bool"; + property->m_dataType = MaterialPropertyDataType::Bool; + property->m_value = true; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_bool") }); + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); EXPECT_TRUE(materialTypeOutcome.IsSuccess()); Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); @@ -525,7 +835,7 @@ namespace UnitTest const MaterialPropertyIndex propertyIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{ "general.MyBool" }); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); - ValidateCommonDescriptorFields(propertySource, propertyDescriptor); + ValidateCommonDescriptorFields(*property, propertyDescriptor); EXPECT_EQ(propertyDescriptor->GetOutputConnections()[0].m_itemIndex.GetIndex(), 7); } @@ -534,20 +844,19 @@ namespace UnitTest MaterialTypeSourceData sourceData; sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ TestShaderFilename }); - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyFloat"; - propertySource.m_displayName = "My Float"; - propertySource.m_description = "This is a float"; - propertySource.m_min = 0.0f; - propertySource.m_max = 1.0f; - propertySource.m_softMin = 0.2f; - propertySource.m_softMax = 1.0f; - propertySource.m_step = 0.01f; - propertySource.m_dataType = MaterialPropertyDataType::Float; - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_float") }); - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyFloat"); + property->m_displayName = "My Float"; + property->m_description = "This is a float"; + property->m_min = 0.0f; + property->m_max = 1.0f; + property->m_softMin = 0.2f; + property->m_softMax = 1.0f; + property->m_step = 0.01f; + property->m_dataType = MaterialPropertyDataType::Float; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_float") }); + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); EXPECT_TRUE(materialTypeOutcome.IsSuccess()); Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); @@ -555,7 +864,7 @@ namespace UnitTest const MaterialPropertyIndex propertyIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"general.MyFloat" }); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); - ValidateCommonDescriptorFields(propertySource, propertyDescriptor); + ValidateCommonDescriptorFields(*property, propertyDescriptor); EXPECT_EQ(propertyDescriptor->GetOutputConnections()[0].m_itemIndex.GetIndex(), 1); } @@ -564,15 +873,14 @@ namespace UnitTest MaterialTypeSourceData sourceData; sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ TestShaderFilename }); - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyImage"; - propertySource.m_displayName = "My Image"; - propertySource.m_description = "This is an image"; - propertySource.m_dataType = MaterialPropertyDataType::Image; - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_image") }); - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyImage"); + property->m_displayName = "My Image"; + property->m_description = "This is an image"; + property->m_dataType = MaterialPropertyDataType::Image; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_image") }); + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); EXPECT_TRUE(materialTypeOutcome.IsSuccess()); Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); @@ -580,7 +888,7 @@ namespace UnitTest const MaterialPropertyIndex propertyIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"general.MyImage" }); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); - ValidateCommonDescriptorFields(propertySource, propertyDescriptor); + ValidateCommonDescriptorFields(*property, propertyDescriptor); EXPECT_EQ(propertyDescriptor->GetOutputConnections()[0].m_itemIndex.GetIndex(), 0); } @@ -589,21 +897,20 @@ namespace UnitTest MaterialTypeSourceData sourceData; sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyInt"; - propertySource.m_displayName = "My Integer"; - propertySource.m_dataType = MaterialPropertyDataType::Int; - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{MaterialPropertyOutputType::ShaderOption, AZStd::string("o_foo"), 0}); - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyInt"); + property->m_displayName = "My Integer"; + property->m_dataType = MaterialPropertyDataType::Int; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{MaterialPropertyOutputType::ShaderOption, AZStd::string("o_foo"), 0}); + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); EXPECT_TRUE(materialTypeOutcome.IsSuccess()); Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(MaterialPropertyIndex{0}); - ValidateCommonDescriptorFields(propertySource, propertyDescriptor); + ValidateCommonDescriptorFields(*property, propertyDescriptor); EXPECT_EQ(propertyDescriptor->GetOutputConnections()[0].m_itemIndex.GetIndex(), 1); } @@ -612,13 +919,12 @@ namespace UnitTest MaterialTypeSourceData sourceData; sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyInt"; - propertySource.m_dataType = MaterialPropertyDataType::Int; - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{MaterialPropertyOutputType::ShaderOption, AZStd::string("DoesNotExist"), 0}); - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyInt"); + property->m_dataType = MaterialPropertyDataType::Int; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{MaterialPropertyOutputType::ShaderOption, AZStd::string("DoesNotExist"), 0}); + AZ_TEST_START_TRACE_SUPPRESSION; auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); AZ_TEST_STOP_TRACE_SUPPRESSION(2); // There happens to be an extra assert for "Cannot continue building MaterialAsset because 1 error(s) reported" @@ -626,66 +932,140 @@ namespace UnitTest EXPECT_FALSE(materialTypeOutcome.IsSuccess()); } - TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_InvalidGroupNameId) + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_InvalidGroupName) { + const AZStd::string inputJson = R"( + { + "propertyLayout": { + "propertySets": [ + { + "name": "not a valid name because it has spaces", + "properties": [ + { + "name": "foo", + "type": "Bool" + } + ] + } + ] + } + } + )"; + MaterialTypeSourceData sourceData; - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_dataType = MaterialPropertyDataType::Int; - - propertySource.m_name = "a"; - sourceData.m_propertyLayout.m_properties["not a valid name because it has spaces"].push_back(propertySource); - - // Expected errors: - // Group name 'not a valid name because it has spaces' is not a valid identifier. - // Warning: Cannot create material property with invalid ID 'not a valid name because it has spaces'. - // Failed to build MaterialAsset because 1 warning(s) reported - AZ_TEST_START_TRACE_SUPPRESSION; + JsonTestResult loadResult = LoadTestDataFromJson(sourceData, inputJson); + EXPECT_EQ(loadResult.m_jsonResultCode.GetProcessing(), JsonSerializationResult::Processing::Completed); + + ErrorMessageFinder errorMessageFinder{"'not a valid name because it has spaces' is not a valid identifier"}; auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); - AZ_TEST_STOP_TRACE_SUPPRESSION(2); - EXPECT_FALSE(materialTypeOutcome.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); } - TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_InvalidPropertyNameId) + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_InvalidPropertyName) { + const AZStd::string inputJson = R"( + { + "propertyLayout": { + "propertySets": [ + { + "name": "general", + "properties": [ + { + "name": "not a valid name because it has spaces", + "type": "Bool" + } + ] + } + ] + } + } + )"; + MaterialTypeSourceData sourceData; - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_dataType = MaterialPropertyDataType::Int; - - propertySource.m_name = "not a valid name because it has spaces"; - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - - // Expected errors: - // Property name 'not a valid name because it has spaces' is not a valid identifier. - // Warning: Cannot create material property with invalid ID 'not a valid name because it has spaces'. - // Failed to build MaterialAsset because 1 warning(s) reported - AZ_TEST_START_TRACE_SUPPRESSION; + JsonTestResult loadResult = LoadTestDataFromJson(sourceData, inputJson); + EXPECT_EQ(loadResult.m_jsonResultCode.GetProcessing(), JsonSerializationResult::Processing::Completed); + + ErrorMessageFinder errorMessageFinder{"'not a valid name because it has spaces' is not a valid identifier"}; auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); - AZ_TEST_STOP_TRACE_SUPPRESSION(2); - EXPECT_FALSE(materialTypeOutcome.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); } TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_DuplicatePropertyId) { + const AZStd::string inputJson = R"( + { + "propertyLayout": { + "propertySets": [ + { + "name": "general", + "properties": [ + { + "name": "foo", + "type": "Bool" + }, + { + "name": "foo", + "type": "Bool" + } + ] + } + ] + } + } + )"; + MaterialTypeSourceData sourceData; - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_dataType = MaterialPropertyDataType::Int; - propertySource.m_name = "a"; - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - - // Expected errors: - // Material property 'general.a': A property with this ID already exists. - // Cannot continue building MaterialAsset because 1 error(s) reported - AZ_TEST_START_TRACE_SUPPRESSION; + JsonTestResult loadResult = LoadTestDataFromJson(sourceData, inputJson); + EXPECT_EQ(loadResult.m_jsonResultCode.GetProcessing(), JsonSerializationResult::Processing::Completed); + + ErrorMessageFinder errorMessageFinder("Material property 'general.foo': A property with this ID already exists"); + errorMessageFinder.AddExpectedErrorMessage("Cannot continue building MaterialTypeAsset"); auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); - AZ_TEST_STOP_TRACE_SUPPRESSION(2); - EXPECT_FALSE(materialTypeOutcome.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_PropertyAndPropertySetNameCollision) + { + const AZStd::string inputJson = R"( + { + "propertyLayout": { + "propertySets": [ + { + "name": "general", + "properties": [ + { + "name": "foo", + "type": "Bool" + } + ], + "propertySets": [ + { + "name": "foo", + "properties": [ + { + "name": "bar", + "type": "Bool" + } + ] + } + ] + } + ] + } + } + )"; + + MaterialTypeSourceData sourceData; + JsonTestResult loadResult = LoadTestDataFromJson(sourceData, inputJson); + EXPECT_EQ(loadResult.m_jsonResultCode.GetProcessing(), JsonSerializationResult::Processing::Completed); + + ErrorMessageFinder errorMessageFinder("Material property 'general.foo' collides with a PropertySet with the same ID"); + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); + EXPECT_FALSE(materialTypeOutcome.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); } TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_PropertyConnectedToMultipleOutputs) @@ -736,25 +1116,25 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ "shaderA.shader" }); sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ "shaderB.shader" }); sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ "shaderC.shader" }); + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyInt"); - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyInt"; - propertySource.m_displayName = "Integer"; - propertySource.m_description = "Integer property that is connected to multiple shader settings"; - propertySource.m_dataType = MaterialPropertyDataType::Int; + property->m_displayName = "Integer"; + property->m_description = "Integer property that is connected to multiple shader settings"; + property->m_dataType = MaterialPropertyDataType::Int; // The value maps to m_int in the SRG - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_int") }); + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_int") }); // The value also maps to m_uint in the SRG - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_uint") }); + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_uint") }); // The value also maps to the first shader's "o_speed" option - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderOption, AZStd::string("o_speed"), 0 }); + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderOption, AZStd::string("o_speed"), 0 }); // The value also maps to the second shader's "o_speed" option - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderOption, AZStd::string("o_speed"), 1 }); + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderOption, AZStd::string("o_speed"), 1 }); // This case doesn't specify an index, so it will apply to all shaders that have a "o_efficiency", which means it will create two outputs in the property descriptor. - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderOption, AZStd::string("o_efficiency") }); - - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderOption, AZStd::string("o_efficiency") }); + // Do the actual test... @@ -795,15 +1175,15 @@ namespace UnitTest TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_PropertyWithShaderInputFunctor) { MaterialTypeSourceData sourceData; + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("floatForFunctor"); - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "NonAliasFloat"; - propertySource.m_displayName = "Non-Alias Float"; - propertySource.m_description = "This float is processed by a functor, not with a direct alias"; - propertySource.m_dataType = MaterialPropertyDataType::Float; - // Note that we don't fill propertySource.m_aliasOutputId because this is not an aliased property - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + property->m_displayName = "Float for Functor"; + property->m_description = "This float is processed by a functor, not with a direct connection"; + property->m_dataType = MaterialPropertyDataType::Float; + // Note that we don't fill property->m_outputConnections because this is not an aliased property + sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); sourceData.m_materialFunctorSourceData.push_back( @@ -811,7 +1191,7 @@ namespace UnitTest ( aznew MaterialFunctorSourceDataHolder ( - aznew Splat3FunctorSourceData{ "general.NonAliasFloat", "m_float3" } + aznew Splat3FunctorSourceData{ "general.floatForFunctor", "m_float3" } ) ) ); @@ -820,10 +1200,10 @@ namespace UnitTest EXPECT_TRUE(materialTypeOutcome.IsSuccess()); Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); - const MaterialPropertyIndex propertyIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"general.NonAliasFloat" }); + const MaterialPropertyIndex propertyIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"general.floatForFunctor" }); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); - ValidateCommonDescriptorFields(propertySource, propertyDescriptor); + ValidateCommonDescriptorFields(*property, propertyDescriptor); EXPECT_EQ(1, materialTypeAsset->GetMaterialFunctors().size()); auto shaderInputFunctor = azrtti_cast(materialTypeAsset->GetMaterialFunctors()[0].get()); @@ -841,15 +1221,13 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "EnableSpecialPassA"; - propertySource.m_displayName = "Enable Special Pass"; - propertySource.m_description = "This is a bool to enable an extra shader/pass"; - propertySource.m_dataType = MaterialPropertyDataType::Bool; - // Note that we don't fill propertySource.m_outputConnections because this is not a direct-connected property - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - propertySource.m_name = "EnableSpecialPassB"; - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property1 = propertySet->AddProperty("EnableSpecialPassA"); + MaterialTypeSourceData::PropertyDefinition* property2 = propertySet->AddProperty("EnableSpecialPassB"); + + property1->m_displayName = property2->m_displayName = "Enable Special Pass"; + property1->m_description = property2->m_description = "This is a bool to enable an extra shader/pass"; + property1->m_dataType = property2->m_dataType = MaterialPropertyDataType::Bool; sourceData.m_materialFunctorSourceData.push_back( Ptr @@ -880,8 +1258,8 @@ namespace UnitTest const MaterialPropertyIndex propertyBIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"general.EnableSpecialPassB"}); const MaterialPropertyDescriptor* propertyBDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyBIndex); - ValidateCommonDescriptorFields(propertySource, propertyADescriptor); - ValidateCommonDescriptorFields(propertySource, propertyBDescriptor); + ValidateCommonDescriptorFields(*sourceData.FindProperty("general.EnableSpecialPassA"), propertyADescriptor); + ValidateCommonDescriptorFields(*sourceData.FindProperty("general.EnableSpecialPassB"), propertyBDescriptor); EXPECT_EQ(2, materialTypeAsset->GetMaterialFunctors().size()); auto functorA = azrtti_cast(materialTypeAsset->GetMaterialFunctors()[0].get()); @@ -900,13 +1278,13 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyProperty"); - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyProperty"; - propertySource.m_dataType = MaterialPropertyDataType::Bool; - // Note that we don't fill propertySource.m_outputConnections because this is not a direct-connected property - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + property->m_dataType = MaterialPropertyDataType::Bool; + // Note that we don't fill property->m_outputConnections because this is not a direct-connected property + sourceData.m_materialFunctorSourceData.push_back( Ptr ( @@ -928,6 +1306,45 @@ namespace UnitTest EXPECT_TRUE(materialTypeAsset->GetShaderCollection()[0].MaterialOwnsShaderOption(Name{"o_foo"})); EXPECT_TRUE(materialTypeAsset->GetShaderCollection()[0].MaterialOwnsShaderOption(Name{"o_bar"})); } + + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_FunctorIsInsidePropertySet) + { + MaterialTypeSourceData sourceData; + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("floatForFunctor"); + + property->m_dataType = MaterialPropertyDataType::Float; + + sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); + + sourceData.m_materialFunctorSourceData.push_back( + Ptr + ( + aznew MaterialFunctorSourceDataHolder + ( + aznew Splat3FunctorSourceData{ "general.floatForFunctor", "m_float3" } + ) + ) + ); + + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); + EXPECT_TRUE(materialTypeOutcome.IsSuccess()); + Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); + + const MaterialPropertyIndex propertyIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"general.floatForFunctor" }); + const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); + + ValidateCommonDescriptorFields(*property, propertyDescriptor); + + EXPECT_EQ(1, materialTypeAsset->GetMaterialFunctors().size()); + auto shaderInputFunctor = azrtti_cast(materialTypeAsset->GetMaterialFunctors()[0].get()); + EXPECT_TRUE(nullptr != shaderInputFunctor); + EXPECT_EQ(propertyIndex, shaderInputFunctor->m_floatIndex); + + const RHI::ShaderInputConstantIndex expectedVector3Index = materialTypeAsset->GetMaterialSrgLayout()->FindShaderInputConstantIndex(Name{ "m_float3" }); + EXPECT_EQ(expectedVector3Index, shaderInputFunctor->m_vector3Index); + } TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_PropertyValues_AllTypes) { @@ -937,23 +1354,23 @@ namespace UnitTest auto addProperty = [&sourceData](MaterialPropertyDataType dateType, const char* propertyName, const char* srgConstantName, const AZ::RPI::MaterialPropertyValue& value) { - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = propertyName; - propertySource.m_dataType = dateType; - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string(srgConstantName) }); - propertySource.m_value = value; - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); + MaterialTypeSourceData::PropertyDefinition* property = sourceData.AddProperty(propertyName); + property->m_dataType = dateType; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string(srgConstantName) }); + property->m_value = value; }; + + sourceData.AddPropertySet("general"); - addProperty(MaterialPropertyDataType::Bool, "MyBool", "m_bool", true); - addProperty(MaterialPropertyDataType::Float, "MyFloat", "m_float", 1.2f); - addProperty(MaterialPropertyDataType::Int, "MyInt", "m_int", -12); - addProperty(MaterialPropertyDataType::UInt, "MyUInt", "m_uint", 12u); - addProperty(MaterialPropertyDataType::Vector2, "MyFloat2", "m_float2", AZ::Vector2{1.1f, 2.2f}); - addProperty(MaterialPropertyDataType::Vector3, "MyFloat3", "m_float3", AZ::Vector3{3.3f, 4.4f, 5.5f}); - addProperty(MaterialPropertyDataType::Vector4, "MyFloat4", "m_float4", AZ::Vector4{6.6f, 7.7f, 8.8f, 9.9f}); - addProperty(MaterialPropertyDataType::Color, "MyColor", "m_color", AZ::Color{0.1f, 0.2f, 0.3f, 0.4f}); - addProperty(MaterialPropertyDataType::Image, "MyImage", "m_image", AZStd::string{TestImageFilename}); + addProperty(MaterialPropertyDataType::Bool, "general.MyBool", "m_bool", true); + addProperty(MaterialPropertyDataType::Float, "general.MyFloat", "m_float", 1.2f); + addProperty(MaterialPropertyDataType::Int, "general.MyInt", "m_int", -12); + addProperty(MaterialPropertyDataType::UInt, "general.MyUInt", "m_uint", 12u); + addProperty(MaterialPropertyDataType::Vector2, "general.MyFloat2", "m_float2", AZ::Vector2{1.1f, 2.2f}); + addProperty(MaterialPropertyDataType::Vector3, "general.MyFloat3", "m_float3", AZ::Vector3{3.3f, 4.4f, 5.5f}); + addProperty(MaterialPropertyDataType::Vector4, "general.MyFloat4", "m_float4", AZ::Vector4{6.6f, 7.7f, 8.8f, 9.9f}); + addProperty(MaterialPropertyDataType::Color, "general.MyColor", "m_color", AZ::Color{0.1f, 0.2f, 0.3f, 0.4f}); + addProperty(MaterialPropertyDataType::Image, "general.MyImage", "m_image", AZStd::string{TestImageFilename}); auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); EXPECT_TRUE(materialTypeOutcome.IsSuccess()); @@ -970,6 +1387,88 @@ namespace UnitTest CheckPropertyValue>(materialTypeAsset, Name{"general.MyImage"}, m_testImageAsset); } + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_NestedPropertySets) + { + RHI::Ptr layeredMaterialSrgLayout = RHI::ShaderResourceGroupLayout::Create(); + layeredMaterialSrgLayout->SetName(Name{"MaterialSrg"}); + layeredMaterialSrgLayout->SetBindingSlot(SrgBindingSlot::Material); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_layer1_baseColor_texture" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_layer1_roughness_texture" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_layer2_baseColor_texture" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_layer2_roughness_texture" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_layer2_clearCoat_roughness_texture" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_layer2_clearCoat_normal_texture" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputConstantDescriptor{ Name{ "m_layer2_clearCoat_normal_factor" }, 0, 4, 0 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputConstantDescriptor{ Name{ "m_blendFactor" }, 4, 4, 0 }); + layeredMaterialSrgLayout->Finalize(); + + AZStd::vector boolOptionValues; + boolOptionValues.push_back({Name("False"), RPI::ShaderOptionValue(0)}); + boolOptionValues.push_back({Name("True"), RPI::ShaderOptionValue(1)}); + Ptr shaderOptionsLayout = ShaderOptionGroupLayout::Create(); + uint32_t order = 0; + shaderOptionsLayout->AddShaderOption(ShaderOptionDescriptor{Name{"o_layer2_clearCoat_enable"}, ShaderOptionType::Boolean, 0, order++, boolOptionValues, Name{"False"}}); + shaderOptionsLayout->Finalize(); + + Data::Asset layeredMaterialShaderAsset = CreateTestShaderAsset(Uuid::CreateRandom(), layeredMaterialSrgLayout, shaderOptionsLayout); + + Data::AssetInfo testShaderAssetInfo; + testShaderAssetInfo.m_assetId = layeredMaterialShaderAsset.GetId(); + m_assetSystemStub.RegisterSourceInfo("layeredMaterial.shader", testShaderAssetInfo, ""); + + MaterialTypeSourceData sourceData; + + sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ "layeredMaterial.shader" }); + + auto addSrgProperty = [&sourceData](MaterialPropertyDataType dateType, MaterialPropertyOutputType connectionType, const char* propertyName, const char* srgConstantName, const AZ::RPI::MaterialPropertyValue& value) + { + MaterialTypeSourceData::PropertyDefinition* property = sourceData.AddProperty(propertyName); + property->m_dataType = dateType; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ connectionType, AZStd::string(srgConstantName) }); + property->m_value = value; + }; + + sourceData.AddPropertySet("layer1"); + sourceData.AddPropertySet("layer2"); + sourceData.AddPropertySet("blend"); + sourceData.AddPropertySet("layer1.baseColor"); + sourceData.AddPropertySet("layer2.baseColor"); + sourceData.AddPropertySet("layer1.roughness"); + sourceData.AddPropertySet("layer2.roughness"); + sourceData.AddPropertySet("layer2.clearCoat"); + sourceData.AddPropertySet("layer2.clearCoat.roughness"); + sourceData.AddPropertySet("layer2.clearCoat.normal"); + + addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer1.baseColor.texture", "m_layer1_baseColor_texture", AZStd::string{TestImageFilename}); + addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer1.roughness.texture", "m_layer1_roughness_texture", AZStd::string{TestImageFilename}); + addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer2.baseColor.texture", "m_layer2_baseColor_texture", AZStd::string{TestImageFilename}); + addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer2.roughness.texture", "m_layer2_roughness_texture", AZStd::string{TestImageFilename}); + addSrgProperty(MaterialPropertyDataType::Bool, MaterialPropertyOutputType::ShaderOption, "layer2.clearCoat.enabled", "o_layer2_clearCoat_enable", true); + addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer2.clearCoat.roughness.texture", "m_layer2_clearCoat_roughness_texture", AZStd::string{TestImageFilename}); + addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer2.clearCoat.normal.texture", "m_layer2_clearCoat_normal_texture", AZStd::string{TestImageFilename}); + addSrgProperty(MaterialPropertyDataType::Float, MaterialPropertyOutputType::ShaderInput, "layer2.clearCoat.normal.factor", "m_layer2_clearCoat_normal_factor", 0.4f); + addSrgProperty(MaterialPropertyDataType::Float, MaterialPropertyOutputType::ShaderInput, "blend.factor", "m_blendFactor", 0.5f); + + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); + EXPECT_TRUE(materialTypeOutcome.IsSuccess()); + Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); + + CheckPropertyValue>(materialTypeAsset, Name{"layer1.baseColor.texture"}, m_testImageAsset); + CheckPropertyValue>(materialTypeAsset, Name{"layer1.roughness.texture"}, m_testImageAsset); + CheckPropertyValue>(materialTypeAsset, Name{"layer2.baseColor.texture"}, m_testImageAsset); + CheckPropertyValue>(materialTypeAsset, Name{"layer2.roughness.texture"}, m_testImageAsset); + CheckPropertyValue(materialTypeAsset, Name{"layer2.clearCoat.enabled"}, true); + CheckPropertyValue>(materialTypeAsset, Name{"layer2.clearCoat.roughness.texture"}, m_testImageAsset); + CheckPropertyValue>(materialTypeAsset, Name{"layer2.clearCoat.normal.texture"}, m_testImageAsset); + CheckPropertyValue(materialTypeAsset, Name{"layer2.clearCoat.normal.factor"}, 0.4f); + CheckPropertyValue(materialTypeAsset, Name{"blend.factor"}, 0.5f); + + // Note it might be nice to check that the right property connections are prescribed in the final MaterialTypeAsset, + // but it's not really necessary because CreateMaterialTypeAsset reports errors when a connection target is not found + // in the shader options layout or SRG layout. If one of the output names like "m_layer2_roughness_texture" is wrong + // these errors will cause this test to fail. + } + TEST_F(MaterialTypeSourceDataTests, LoadAndStoreJson_AllFields) { // Note that serialization of individual fields within material properties is thoroughly tested in @@ -980,46 +1479,92 @@ namespace UnitTest "description": "This is a general description about the material", "propertyLayout": { "version": 2, - "groups": [ + "propertySets": [ { "name": "groupA", "displayName": "Property Group A", - "description": "Description of property group A" + "description": "Description of property group A", + "properties": [ + { + "name": "foo", + "type": "Bool", + "defaultValue": true + }, + { + "name": "bar", + "type": "Image", + "defaultValue": "Default.png", + "visibility": "Hidden" + } + ], + "functors": [ + { + "type": "EnableShader", + "args": { + "enablePassProperty": "foo", + "shaderIndex": 1 + } + } + ] }, { "name": "groupB", "displayName": "Property Group B", - "description": "Description of property group B" + "description": "Description of property group B", + "properties": [ + { + "name": "foo", + "type": "Float", + "defaultValue": 0.5 + }, + { + "name": "bar", + "type": "Color", + "defaultValue": [0.5, 0.5, 0.5], + "visibility": "Disabled" + } + ], + "functors": [ + { + "type": "Splat3", + "args": { + "floatPropertyInput": "foo", + "float3ShaderSettingOutput": "m_someFloat3" + } + } + ] + }, + { + "name": "groupC", + "displayName": "Property Group C", + "description": "Property group C has a nested property set", + "propertySets": [ + { + "name": "groupD", + "displayName": "Property Group D", + "description": "Description of property group D", + "properties": [ + { + "name": "foo", + "type": "Int", + "defaultValue": -1 + } + ] + }, + { + "name": "groupE", + "displayName": "Property Group E", + "description": "Description of property group E", + "properties": [ + { + "name": "bar", + "type": "UInt" + } + ] + } + ] } - ], - "properties": { - "groupA": [ - { - "name": "foo", - "type": "Bool", - "defaultValue": true - }, - { - "name": "bar", - "type": "Image", - "defaultValue": "Default.png", - "visibility": "Hidden" - } - ], - "groupB": [ - { - "name": "foo", - "type": "Float", - "defaultValue": 0.5 - }, - { - "name": "bar", - "type": "Color", - "defaultValue": [0.5, 0.5, 0.5], - "visibility": "Disabled" - } - ] - } + ] }, "shaders": [ { @@ -1040,17 +1585,9 @@ namespace UnitTest ], "functors": [ { - "type": "EnableShader", + "type": "SetShaderOption", "args": { - "enablePassProperty": "groupA.foo", - "shaderIndex": 1 - } - }, - { - "type": "Splat3", - "args": { - "floatPropertyInput": "groupB.foo", - "float3ShaderSettingOutput": "m_someFloat3" + "enableProperty": "groupA.foo" } } ] @@ -1062,35 +1599,72 @@ namespace UnitTest EXPECT_EQ(material.m_description, "This is a general description about the material"); - EXPECT_EQ(material.m_propertyLayout.m_version, 2); + EXPECT_EQ(material.GetPropertyLayout().m_version, 2); - EXPECT_EQ(material.m_propertyLayout.m_groups.size(), 2); - EXPECT_TRUE(material.FindGroup("groupA") != nullptr); - EXPECT_TRUE(material.FindGroup("groupB") != nullptr); - EXPECT_EQ(material.FindGroup("groupA")->m_displayName, "Property Group A"); - EXPECT_EQ(material.FindGroup("groupB")->m_displayName, "Property Group B"); - EXPECT_EQ(material.FindGroup("groupA")->m_description, "Description of property group A"); - EXPECT_EQ(material.FindGroup("groupB")->m_description, "Description of property group B"); + EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 3); + EXPECT_TRUE(material.FindPropertySet("groupA") != nullptr); + EXPECT_TRUE(material.FindPropertySet("groupB") != nullptr); + EXPECT_TRUE(material.FindPropertySet("groupC") != nullptr); + EXPECT_TRUE(material.FindPropertySet("groupC.groupD") != nullptr); + EXPECT_TRUE(material.FindPropertySet("groupC.groupE") != nullptr); + EXPECT_EQ(material.FindPropertySet("groupA")->GetDisplayName(), "Property Group A"); + EXPECT_EQ(material.FindPropertySet("groupB")->GetDisplayName(), "Property Group B"); + EXPECT_EQ(material.FindPropertySet("groupC")->GetDisplayName(), "Property Group C"); + EXPECT_EQ(material.FindPropertySet("groupC.groupD")->GetDisplayName(), "Property Group D"); + EXPECT_EQ(material.FindPropertySet("groupC.groupE")->GetDisplayName(), "Property Group E"); + EXPECT_EQ(material.FindPropertySet("groupA")->GetDescription(), "Description of property group A"); + EXPECT_EQ(material.FindPropertySet("groupB")->GetDescription(), "Description of property group B"); + EXPECT_EQ(material.FindPropertySet("groupC")->GetDescription(), "Property group C has a nested property set"); + EXPECT_EQ(material.FindPropertySet("groupC.groupD")->GetDescription(), "Description of property group D"); + EXPECT_EQ(material.FindPropertySet("groupC.groupE")->GetDescription(), "Description of property group E"); + EXPECT_EQ(material.FindPropertySet("groupA")->GetProperties().size(), 2); + EXPECT_EQ(material.FindPropertySet("groupB")->GetProperties().size(), 2); + EXPECT_EQ(material.FindPropertySet("groupC")->GetProperties().size(), 0); + EXPECT_EQ(material.FindPropertySet("groupC.groupD")->GetProperties().size(), 1); + EXPECT_EQ(material.FindPropertySet("groupC.groupE")->GetProperties().size(), 1); + + EXPECT_NE(material.FindProperty("groupA.foo"), nullptr); + EXPECT_NE(material.FindProperty("groupA.bar"), nullptr); + EXPECT_NE(material.FindProperty("groupB.foo"), nullptr); + EXPECT_NE(material.FindProperty("groupB.bar"), nullptr); + EXPECT_NE(material.FindProperty("groupC.groupD.foo"), nullptr); + EXPECT_NE(material.FindProperty("groupC.groupE.bar"), nullptr); - EXPECT_EQ(material.m_propertyLayout.m_properties.size(), 2); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"].size(), 2); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"].size(), 2); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_name, "foo"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_name, "bar"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_name, "foo"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_name, "bar"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_dataType, MaterialPropertyDataType::Bool); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_dataType, MaterialPropertyDataType::Image); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_dataType, MaterialPropertyDataType::Float); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_dataType, MaterialPropertyDataType::Color); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_visibility, MaterialPropertyVisibility::Enabled); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_visibility, MaterialPropertyVisibility::Hidden); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_visibility, MaterialPropertyVisibility::Enabled); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_visibility, MaterialPropertyVisibility::Disabled); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_value, true); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_value, AZStd::string{"Default.png"}); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_value, 0.5f); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_value, AZ::Color(0.5f, 0.5f, 0.5f, 1.0f)); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_name, "foo"); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_name, "bar"); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_name, "foo"); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_name, "bar"); + EXPECT_EQ(material.FindProperty("groupC.groupD.foo")->m_name, "foo"); + EXPECT_EQ(material.FindProperty("groupC.groupE.bar")->m_name, "bar"); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_dataType, MaterialPropertyDataType::Bool); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_dataType, MaterialPropertyDataType::Image); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_dataType, MaterialPropertyDataType::Float); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_dataType, MaterialPropertyDataType::Color); + EXPECT_EQ(material.FindProperty("groupC.groupD.foo")->m_dataType, MaterialPropertyDataType::Int); + EXPECT_EQ(material.FindProperty("groupC.groupE.bar")->m_dataType, MaterialPropertyDataType::UInt); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_visibility, MaterialPropertyVisibility::Enabled); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_visibility, MaterialPropertyVisibility::Hidden); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_visibility, MaterialPropertyVisibility::Enabled); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_visibility, MaterialPropertyVisibility::Disabled); + EXPECT_EQ(material.FindProperty("groupC.groupD.foo")->m_visibility, MaterialPropertyVisibility::Enabled); + EXPECT_EQ(material.FindProperty("groupC.groupE.bar")->m_visibility, MaterialPropertyVisibility::Enabled); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_value, true); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_value, AZStd::string{"Default.png"}); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_value, 0.5f); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_value, AZ::Color(0.5f, 0.5f, 0.5f, 1.0f)); + EXPECT_EQ(material.FindProperty("groupC.groupD.foo")->m_value, -1); + EXPECT_EQ(material.FindProperty("groupC.groupE.bar")->m_value, 0u); + + EXPECT_EQ(material.FindPropertySet("groupA")->GetFunctors().size(), 1); + EXPECT_EQ(material.FindPropertySet("groupB")->GetFunctors().size(), 1); + Ptr functorA = material.FindPropertySet("groupA")->GetFunctors()[0]->GetActualSourceData(); + Ptr functorB = material.FindPropertySet("groupB")->GetFunctors()[0]->GetActualSourceData(); + EXPECT_TRUE(azrtti_cast(functorA.get())); + EXPECT_EQ(azrtti_cast(functorA.get())->m_enablePassPropertyId, "foo"); + EXPECT_EQ(azrtti_cast(functorA.get())->m_shaderIndex, 1); + EXPECT_TRUE(azrtti_cast(functorB.get())); + EXPECT_EQ(azrtti_cast(functorB.get())->m_floatPropertyInputId, "foo"); + EXPECT_EQ(azrtti_cast(functorB.get())->m_float3ShaderSettingOutputId, "m_someFloat3"); EXPECT_EQ(material.m_shaderCollection.size(), 2); EXPECT_EQ(material.m_shaderCollection[0].m_shaderFilePath, "ForwardPass.shader"); @@ -1103,13 +1677,10 @@ namespace UnitTest EXPECT_EQ(material.m_shaderCollection[1].m_shaderOptionValues[Name{"o_optionD"}], Name{"2"}); EXPECT_EQ(material.m_shaderCollection[0].m_shaderTag, Name{"ForwardPass"}); - EXPECT_EQ(material.m_materialFunctorSourceData.size(), 2); - EXPECT_TRUE(azrtti_cast(material.m_materialFunctorSourceData[0]->GetActualSourceData().get())); - EXPECT_EQ(azrtti_cast(material.m_materialFunctorSourceData[0]->GetActualSourceData().get())->m_enablePassPropertyId, "groupA.foo"); - EXPECT_EQ(azrtti_cast(material.m_materialFunctorSourceData[0]->GetActualSourceData().get())->m_shaderIndex, 1); - EXPECT_TRUE(azrtti_cast(material.m_materialFunctorSourceData[1]->GetActualSourceData().get())); - EXPECT_EQ(azrtti_cast(material.m_materialFunctorSourceData[1]->GetActualSourceData().get())->m_floatPropertyInputId, "groupB.foo"); - EXPECT_EQ(azrtti_cast(material.m_materialFunctorSourceData[1]->GetActualSourceData().get())->m_float3ShaderSettingOutputId, "m_someFloat3"); + EXPECT_EQ(material.m_materialFunctorSourceData.size(), 1); + Ptr functorC = material.m_materialFunctorSourceData[0]->GetActualSourceData(); + EXPECT_TRUE(azrtti_cast(functorC.get())); + EXPECT_EQ(azrtti_cast(functorC.get())->m_enablePropertyName, "groupA.foo"); AZStd::string outputJson; JsonTestResult storeResult = StoreTestDataToJson(material, outputJson); @@ -1120,6 +1691,9 @@ namespace UnitTest { // The content of this test was copied from LoadAndStoreJson_AllFields to prove backward compatibility. // (The "store" part of the test was not included because the saved data will be the new format). + // Notable differences include: + // 1) the key "id" is used instead of "name" + // 2) the group metadata, property definitions, and functors are all defined in different sections rather than in a property set const AZStd::string inputJson = R"( { @@ -1206,37 +1780,57 @@ namespace UnitTest MaterialTypeSourceData material; JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); + // Before conversion to the new format, the data is in the old place + EXPECT_EQ(material.GetPropertyLayout().m_groups.size(), 2); + EXPECT_EQ(material.GetPropertyLayout().m_properties.size(), 2); + EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 0); + + material.ConvertToNewDataFormat(); + + // After conversion to the new format, the data is in the new place + EXPECT_EQ(material.GetPropertyLayout().m_groups.size(), 0); + EXPECT_EQ(material.GetPropertyLayout().m_properties.size(), 0); + EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 2); + EXPECT_EQ(material.m_description, "This is a general description about the material"); - EXPECT_EQ(material.m_propertyLayout.m_version, 2); + EXPECT_EQ(material.GetPropertyLayout().m_version, 2); - EXPECT_EQ(material.m_propertyLayout.m_groups.size(), 2); - EXPECT_TRUE(material.FindGroup("groupA") != nullptr); - EXPECT_TRUE(material.FindGroup("groupB") != nullptr); - EXPECT_EQ(material.FindGroup("groupA")->m_displayName, "Property Group A"); - EXPECT_EQ(material.FindGroup("groupB")->m_displayName, "Property Group B"); - EXPECT_EQ(material.FindGroup("groupA")->m_description, "Description of property group A"); - EXPECT_EQ(material.FindGroup("groupB")->m_description, "Description of property group B"); + EXPECT_TRUE(material.FindPropertySet("groupA") != nullptr); + EXPECT_TRUE(material.FindPropertySet("groupB") != nullptr); + EXPECT_EQ(material.FindPropertySet("groupA")->GetDisplayName(), "Property Group A"); + EXPECT_EQ(material.FindPropertySet("groupB")->GetDisplayName(), "Property Group B"); + EXPECT_EQ(material.FindPropertySet("groupA")->GetDescription(), "Description of property group A"); + EXPECT_EQ(material.FindPropertySet("groupB")->GetDescription(), "Description of property group B"); + EXPECT_EQ(material.FindPropertySet("groupA")->GetProperties().size(), 2); + EXPECT_EQ(material.FindPropertySet("groupB")->GetProperties().size(), 2); + + EXPECT_TRUE(material.FindProperty("groupA.foo") != nullptr); + EXPECT_TRUE(material.FindProperty("groupA.bar") != nullptr); + EXPECT_TRUE(material.FindProperty("groupB.foo") != nullptr); + EXPECT_TRUE(material.FindProperty("groupB.bar") != nullptr); - EXPECT_EQ(material.m_propertyLayout.m_properties.size(), 2); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"].size(), 2); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"].size(), 2); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_name, "foo"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_name, "bar"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_name, "foo"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_name, "bar"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_dataType, MaterialPropertyDataType::Bool); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_dataType, MaterialPropertyDataType::Image); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_dataType, MaterialPropertyDataType::Float); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_dataType, MaterialPropertyDataType::Color); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_visibility, MaterialPropertyVisibility::Enabled); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_visibility, MaterialPropertyVisibility::Hidden); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_visibility, MaterialPropertyVisibility::Enabled); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_visibility, MaterialPropertyVisibility::Disabled); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_value, true); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_value, AZStd::string{"Default.png"}); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_value, 0.5f); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_value, AZ::Color(0.5f, 0.5f, 0.5f, 1.0f)); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_name, "foo"); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_name, "bar"); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_name, "foo"); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_name, "bar"); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_dataType, MaterialPropertyDataType::Bool); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_dataType, MaterialPropertyDataType::Image); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_dataType, MaterialPropertyDataType::Float); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_dataType, MaterialPropertyDataType::Color); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_visibility, MaterialPropertyVisibility::Enabled); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_visibility, MaterialPropertyVisibility::Hidden); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_visibility, MaterialPropertyVisibility::Enabled); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_visibility, MaterialPropertyVisibility::Disabled); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_value, true); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_value, AZStd::string{"Default.png"}); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_value, 0.5f); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_value, AZ::Color(0.5f, 0.5f, 0.5f, 1.0f)); + + // The functors can appear either at the top level or within each property set. The format conversion + // function doesn't know how to move the functors, and they will be left at the top level. + EXPECT_EQ(material.FindPropertySet("groupA")->GetFunctors().size(), 0); + EXPECT_EQ(material.FindPropertySet("groupB")->GetFunctors().size(), 0); EXPECT_EQ(material.m_shaderCollection.size(), 2); EXPECT_EQ(material.m_shaderCollection[0].m_shaderFilePath, "ForwardPass.shader"); @@ -1257,7 +1851,7 @@ namespace UnitTest EXPECT_EQ(azrtti_cast(material.m_materialFunctorSourceData[1]->GetActualSourceData().get())->m_floatPropertyInputId, "groupB.foo"); EXPECT_EQ(azrtti_cast(material.m_materialFunctorSourceData[1]->GetActualSourceData().get())->m_float3ShaderSettingOutputId, "m_someFloat3"); } - + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_PropertyImagePath) { char inputJson[2048]; @@ -1267,27 +1861,25 @@ namespace UnitTest "description": "", "propertyLayout": { "version": 2, - "groups": [ + "propertySets": [ { "name": "general", "displayName": "General", - "description": "" + "description": "", + "properties": [ + { + "name": "absolute", + "type": "Image", + "defaultValue": "%s" + }, + { + "name": "relative", + "type": "Image", + "defaultValue": "%s" + } + ] } - ], - "properties": { - "general": [ - { - "name": "absolute", - "type": "Image", - "defaultValue": "%s" - }, - { - "name": "relative", - "type": "Image", - "defaultValue": "%s" - } - ] - } + ] } } )", diff --git a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR.materialtype b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR.materialtype index 81ebd63c28..ce59ec8b8e 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR.materialtype +++ b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR.materialtype @@ -2,50 +2,48 @@ "description": "Base Material with properties used to define Standard PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.", "propertyLayout": { "version": 3, - "groups": [ + "propertySets": [ { "name": "settings", - "displayName": "Settings" + "displayName": "Settings", + "properties": [ + { + "name": "color", + "displayName": "Color", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "metallic", + "displayName": "Metallic", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_metallic" + } + }, + { + "name": "roughness", + "displayName": "Roughness", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughness" + } + } + ] } - ], - "properties": { - "settings": [ - { - "name": "color", - "displayName": "Color", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_baseColor" - } - }, - { - "name": "metallic", - "displayName": "Metallic", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_metallic" - } - }, - { - "name": "roughness", - "displayName": "Roughness", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughness" - } - } - ] - } + ] }, "shaders": [ { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index 3f4aa71a9c..cf3205a037 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -230,7 +230,7 @@ namespace MaterialEditor // create source data from properties MaterialSourceData sourceData; - sourceData.m_propertyLayoutVersion = m_materialTypeSourceData.m_propertyLayout.m_version; + sourceData.m_propertyLayoutVersion = m_materialTypeSourceData.GetPropertyLayout().m_version; sourceData.m_materialType = m_materialSourceData.m_materialType; sourceData.m_parentMaterial = m_materialSourceData.m_parentMaterial; @@ -302,7 +302,7 @@ namespace MaterialEditor // create source data from properties MaterialSourceData sourceData; - sourceData.m_propertyLayoutVersion = m_materialTypeSourceData.m_propertyLayout.m_version; + sourceData.m_propertyLayoutVersion = m_materialTypeSourceData.GetPropertyLayout().m_version; sourceData.m_materialType = m_materialSourceData.m_materialType; sourceData.m_parentMaterial = m_materialSourceData.m_parentMaterial; @@ -373,7 +373,7 @@ namespace MaterialEditor // create source data from properties MaterialSourceData sourceData; - sourceData.m_propertyLayoutVersion = m_materialTypeSourceData.m_propertyLayout.m_version; + sourceData.m_propertyLayoutVersion = m_materialTypeSourceData.GetPropertyLayout().m_version; sourceData.m_materialType = m_materialSourceData.m_materialType; // Only assign a parent path if the source was a .material @@ -592,24 +592,26 @@ namespace MaterialEditor bool result = true; // populate sourceData with properties that meet the filter - m_materialTypeSourceData.EnumerateProperties([this, &sourceData, &propertyFilter, &result](const AZStd::string& groupName, const AZStd::string& propertyName, const auto& propertyDefinition) { + m_materialTypeSourceData.EnumerateProperties([this, &sourceData, &propertyFilter, &result](const AZStd::string& propertyIdContext, const auto& propertyDefinition) { - const MaterialPropertyId propertyId(groupName, propertyName); + const AZStd::string propertyId = propertyIdContext + propertyDefinition->m_name; - const auto it = m_properties.find(propertyId); + const auto it = m_properties.find(Name{propertyId}); if (it != m_properties.end() && propertyFilter(it->second)) { MaterialPropertyValue propertyValue = AtomToolsFramework::ConvertToRuntimeType(it->second.GetValue()); if (propertyValue.IsValid()) { - if (!m_materialTypeSourceData.ConvertPropertyValueToSourceDataFormat(propertyDefinition, propertyValue)) + if (!m_materialTypeSourceData.ConvertPropertyValueToSourceDataFormat(*propertyDefinition, propertyValue)) { - AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.GetCStr(), m_absolutePath.c_str()); + AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.c_str(), m_absolutePath.c_str()); result = false; return false; } - - sourceData.m_properties[groupName][propertyName].m_value = propertyValue; + + // TODO: Support populating the Material Editor with nested property sets, not just the top level. + const AZStd::string groupName = propertyId.substr(0, propertyId.size() - propertyDefinition->m_name.size() - 1); + sourceData.m_properties[groupName][propertyDefinition->m_name].m_value = propertyValue; } } return true; @@ -678,7 +680,7 @@ namespace MaterialEditor AZ_Error("MaterialDocument", false, "Material type source data could not be loaded: '%s'.", materialTypeSourceFilePath.c_str()); return false; } - m_materialTypeSourceData = materialTypeOutcome.GetValue(); + m_materialTypeSourceData = materialTypeOutcome.TakeValue(); } else if (AzFramework::StringFunc::Path::IsExtension(m_absolutePath.c_str(), MaterialTypeSourceData::Extension)) { @@ -691,7 +693,7 @@ namespace MaterialEditor AZ_Error("MaterialDocument", false, "Material type source data could not be loaded: '%s'.", m_absolutePath.c_str()); return false; } - m_materialTypeSourceData = materialTypeOutcome.GetValue(); + m_materialTypeSourceData = materialTypeOutcome.TakeValue(); // The document represents a material, not a material type. // If the input data is a material type file we have to generate the material source data by referencing it. @@ -770,33 +772,41 @@ namespace MaterialEditor // Populate the property map from a combination of source data and assets // Assets must still be used for now because they contain the final accumulated value after all other materials // in the hierarchy are applied - m_materialTypeSourceData.EnumerateProperties([this, &parentPropertyValues](const AZStd::string& groupName, const AZStd::string& propertyName, const auto& propertyDefinition) { - AtomToolsFramework::DynamicPropertyConfig propertyConfig; - - // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = MaterialPropertyId(groupName, propertyName); - - const auto& propertyIndex = m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); - const bool propertyIndexInBounds = propertyIndex.IsValid() && propertyIndex.GetIndex() < m_materialAsset->GetPropertyValues().size(); - AZ_Warning("MaterialDocument", propertyIndexInBounds, "Failed to add material property '%s' to document '%s'.", propertyConfig.m_id.GetCStr(), m_absolutePath.c_str()); - - if (propertyIndexInBounds) + m_materialTypeSourceData.EnumeratePropertySets([this, &parentPropertyValues](const AZStd::string& propertyIdContext, const MaterialTypeSourceData::PropertySet* propertySet) { - AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, propertyDefinition); - propertyConfig.m_showThumbnail = true; - propertyConfig.m_originalValue = AtomToolsFramework::ConvertToEditableType(m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]); - propertyConfig.m_parentValue = AtomToolsFramework::ConvertToEditableType(parentPropertyValues[propertyIndex.GetIndex()]); - auto groupDefinition = m_materialTypeSourceData.FindGroup(groupName); - propertyConfig.m_groupName = groupDefinition ? groupDefinition->m_displayName : groupName; - m_properties[propertyConfig.m_id] = AtomToolsFramework::DynamicProperty(propertyConfig); - } - return true; - }); + AtomToolsFramework::DynamicPropertyConfig propertyConfig; + + for (const auto& propertyDefinition : propertySet->GetProperties()) + { + // Assign id before conversion so it can be used in dynamic description + propertyConfig.m_id = propertyIdContext + propertySet->GetName() + "." + propertyDefinition->m_name; + + const auto& propertyIndex = m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); + const bool propertyIndexInBounds = propertyIndex.IsValid() && propertyIndex.GetIndex() < m_materialAsset->GetPropertyValues().size(); + AZ_Warning("MaterialDocument", propertyIndexInBounds, "Failed to add material property '%s' to document '%s'.", propertyConfig.m_id.GetCStr(), m_absolutePath.c_str()); + + if (propertyIndexInBounds) + { + AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, *propertyDefinition); + propertyConfig.m_showThumbnail = true; + propertyConfig.m_originalValue = AtomToolsFramework::ConvertToEditableType(m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]); + propertyConfig.m_parentValue = AtomToolsFramework::ConvertToEditableType(parentPropertyValues[propertyIndex.GetIndex()]); + + // TODO: Support populating the Material Editor with nested property sets, not just the top level. + // (Does DynamicPropertyConfig really even need m_groupName?) + propertyConfig.m_groupName = propertySet->GetDisplayName(); + m_properties[propertyConfig.m_id] = AtomToolsFramework::DynamicProperty(propertyConfig); + } + } + + return true; + }); // Populate the property group visibility map - for (MaterialTypeSourceData::GroupDefinition& group : m_materialTypeSourceData.GetGroupDefinitionsInDisplayOrder()) + // TODO: Support populating the Material Editor with nested property sets, not just the top level. + for (const AZStd::unique_ptr& propertySet : m_materialTypeSourceData.GetPropertyLayout().m_propertySets) { - m_propertyGroupVisibility[AZ::Name{group.m_name}] = true; + m_propertyGroupVisibility[AZ::Name{propertySet->GetName()}] = true; } // Adding properties for material type and parent as part of making dynamic @@ -877,6 +887,39 @@ namespace MaterialEditor return false; } } + + bool enumerateResult = m_materialTypeSourceData.EnumeratePropertySets( + [this, &materialTypeSourceFilePath](const AZStd::string&, const MaterialTypeSourceData::PropertySet* propertySet) + { + const MaterialFunctorSourceData::EditorContext editorContext = MaterialFunctorSourceData::EditorContext( + materialTypeSourceFilePath, m_materialAsset->GetMaterialPropertiesLayout()); + + for (Ptr functorData : propertySet->GetFunctors()) + { + MaterialFunctorSourceData::FunctorResult result = functorData->CreateFunctor(editorContext); + + if (result.IsSuccess()) + { + Ptr& functor = result.GetValue(); + if (functor != nullptr) + { + m_editorFunctors.push_back(functor); + } + } + else + { + AZ_Error("MaterialDocument", false, "Material functors were not created: '%s'.", m_absolutePath.c_str()); + return false; + } + } + + return true; + }); + + if (!enumerateResult) + { + return false; + } AZ::RPI::MaterialPropertyFlags dirtyFlags; dirtyFlags.set(); // Mark all properties as dirty since we just loaded the material and need to initialize property visibility diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp index f6b42bf13a..e279b7e5b0 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp @@ -163,28 +163,23 @@ namespace MaterialEditor const AZ::RPI::MaterialTypeSourceData* materialTypeSourceData = nullptr; MaterialDocumentRequestBus::EventResult( materialTypeSourceData, m_documentId, &MaterialDocumentRequestBus::Events::GetMaterialTypeSourceData); - - for (const auto& groupDefinition : materialTypeSourceData->GetGroupDefinitionsInDisplayOrder()) + + // TODO: Support populating the Material Editor with nested property sets, not just the top level. + for (const AZStd::unique_ptr& propertySet : materialTypeSourceData->GetPropertyLayout().m_propertySets) { - const AZStd::string& groupName = groupDefinition.m_name; - const AZStd::string& groupDisplayName = !groupDefinition.m_displayName.empty() ? groupDefinition.m_displayName : groupName; - const AZStd::string& groupDescription = - !groupDefinition.m_description.empty() ? groupDefinition.m_description : groupDisplayName; + const AZStd::string& groupName = propertySet->GetName(); + const AZStd::string& groupDisplayName = !propertySet->GetDisplayName().empty() ? propertySet->GetDisplayName() : groupName; + const AZStd::string& groupDescription = !propertySet->GetDescription().empty() ? propertySet->GetDescription() : groupDisplayName; auto& group = m_groups[groupName]; - const auto& propertyLayout = materialTypeSourceData->m_propertyLayout; - const auto& propertyListItr = propertyLayout.m_properties.find(groupName); - if (propertyListItr != propertyLayout.m_properties.end()) + group.m_properties.reserve(propertySet->GetProperties().size()); + for (const auto& propertyDefinition : propertySet->GetProperties()) { - group.m_properties.reserve(propertyListItr->second.size()); - for (const auto& propertyDefinition : propertyListItr->second) - { - AtomToolsFramework::DynamicProperty property; - AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult( - property, m_documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetProperty, - AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name)); - group.m_properties.push_back(property); - } + AtomToolsFramework::DynamicProperty property; + AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult( + property, m_documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetProperty, + AZ::RPI::MaterialPropertyId(groupName, propertyDefinition->m_name)); + group.m_properties.push_back(property); } // Passing in same group as main and comparison instance to enable custom value comparison for highlighting modified properties diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp index c05b84db39..86610ecc93 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp @@ -283,35 +283,31 @@ namespace AZ AddUvNamesGroup(); // Copy all of the properties from the material asset to the source data that will be exported - for (const auto& groupDefinition : m_editData.m_materialTypeSourceData.GetGroupDefinitionsInDisplayOrder()) + // TODO: Support populating the Material Editor with nested property sets, not just the top level. + for (const AZStd::unique_ptr& propertySet : m_editData.m_materialTypeSourceData.GetPropertyLayout().m_propertySets) { - const AZStd::string& groupName = groupDefinition.m_name; - const AZStd::string& groupDisplayName = !groupDefinition.m_displayName.empty() ? groupDefinition.m_displayName : groupName; - const AZStd::string& groupDescription = !groupDefinition.m_description.empty() ? groupDefinition.m_description : groupDisplayName; + const AZStd::string& groupName = propertySet->GetName(); + const AZStd::string& groupDisplayName = !propertySet->GetDisplayName().empty() ? propertySet->GetDisplayName() : groupName; + const AZStd::string& groupDescription = !propertySet->GetDescription().empty() ? propertySet->GetDescription() : groupDisplayName; auto& group = m_groups[groupName]; - - const auto& propertyLayout = m_editData.m_materialTypeSourceData.m_propertyLayout; - const auto& propertyListItr = propertyLayout.m_properties.find(groupName); - if (propertyListItr != propertyLayout.m_properties.end()) + + group.m_properties.reserve(propertySet->GetProperties().size()); + for (const auto& propertyDefinition : propertySet->GetProperties()) { - group.m_properties.reserve(propertyListItr->second.size()); - for (const auto& propertyDefinition : propertyListItr->second) - { - AtomToolsFramework::DynamicPropertyConfig propertyConfig; + AtomToolsFramework::DynamicPropertyConfig propertyConfig; - // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name); + // Assign id before conversion so it can be used in dynamic description + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition->m_name); - AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, propertyDefinition); + AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, *propertyDefinition.get()); - propertyConfig.m_groupName = groupDisplayName; - const auto& propertyIndex = m_editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); - propertyConfig.m_showThumbnail = true; - propertyConfig.m_defaultValue = AtomToolsFramework::ConvertToEditableType(m_editData.m_materialTypeAsset->GetDefaultPropertyValues()[propertyIndex.GetIndex()]); - propertyConfig.m_parentValue = AtomToolsFramework::ConvertToEditableType(m_editData.m_materialTypeAsset->GetDefaultPropertyValues()[propertyIndex.GetIndex()]); - propertyConfig.m_originalValue = AtomToolsFramework::ConvertToEditableType(m_editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]); - group.m_properties.emplace_back(propertyConfig); - } + propertyConfig.m_groupName = groupDisplayName; + const auto& propertyIndex = m_editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); + propertyConfig.m_showThumbnail = true; + propertyConfig.m_defaultValue = AtomToolsFramework::ConvertToEditableType(m_editData.m_materialTypeAsset->GetDefaultPropertyValues()[propertyIndex.GetIndex()]); + propertyConfig.m_parentValue = AtomToolsFramework::ConvertToEditableType(m_editData.m_materialTypeAsset->GetDefaultPropertyValues()[propertyIndex.GetIndex()]); + propertyConfig.m_originalValue = AtomToolsFramework::ConvertToEditableType(m_editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]); + group.m_properties.emplace_back(propertyConfig); } // Passing in same group as main and comparison instance to enable custom value comparison for highlighting modified properties diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp index e851bc5fce..2593a12f19 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp @@ -91,7 +91,7 @@ namespace AZ AZ_Error("AZ::Render::EditorMaterialComponentUtil", false, "Failed to load material type source data: %s", editData.m_materialTypeSourcePath.c_str()); return false; } - editData.m_materialTypeSourceData = materialTypeOutcome.GetValue(); + editData.m_materialTypeSourceData = materialTypeOutcome.TakeValue(); return true; } @@ -99,7 +99,7 @@ namespace AZ { // Construct the material source data object that will be exported AZ::RPI::MaterialSourceData exportData; - exportData.m_propertyLayoutVersion = editData.m_materialTypeSourceData.m_propertyLayout.m_version; + exportData.m_propertyLayoutVersion = editData.m_materialTypeSourceData.GetPropertyLayout().m_version; // Converting absolute material paths to relative paths bool result = false; @@ -137,42 +137,46 @@ namespace AZ // Copy all of the properties from the material asset to the source data that will be exported result = true; - editData.m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& groupName, const AZStd::string& propertyName, const auto& propertyDefinition) { - const AZ::RPI::MaterialPropertyId propertyId(groupName, propertyName); - const AZ::RPI::MaterialPropertyIndex propertyIndex = - editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); - - AZ::RPI::MaterialPropertyValue propertyValue = editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]; - - AZ::RPI::MaterialPropertyValue propertyValueDefault = propertyDefinition.m_value; - if (editData.m_materialParentAsset.IsReady()) + editData.m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& propertyIdContext, const AZ::RPI::MaterialTypeSourceData::PropertyDefinition* propertyDefinition) { - propertyValueDefault = editData.m_materialParentAsset->GetPropertyValues()[propertyIndex.GetIndex()]; - } + AZ::Name propertyId(propertyIdContext + propertyDefinition->m_name); - // Check for and apply any property overrides before saving property values - auto propertyOverrideItr = editData.m_materialPropertyOverrideMap.find(propertyId); - if(propertyOverrideItr != editData.m_materialPropertyOverrideMap.end()) - { - propertyValue = AZ::RPI::MaterialPropertyValue::FromAny(propertyOverrideItr->second); - } + const AZ::RPI::MaterialPropertyIndex propertyIndex = + editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); - if (!editData.m_materialTypeSourceData.ConvertPropertyValueToSourceDataFormat(propertyDefinition, propertyValue)) - { - AZ_Error("AZ::Render::EditorMaterialComponentUtil", false, "Failed to export: %s", path.c_str()); - result = false; - return false; - } + AZ::RPI::MaterialPropertyValue propertyValue = editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]; - // Don't export values if they are the same as the material type or parent - if (propertyValueDefault == propertyValue) - { + AZ::RPI::MaterialPropertyValue propertyValueDefault = propertyDefinition->m_value; + if (editData.m_materialParentAsset.IsReady()) + { + propertyValueDefault = editData.m_materialParentAsset->GetPropertyValues()[propertyIndex.GetIndex()]; + } + + // Check for and apply any property overrides before saving property values + auto propertyOverrideItr = editData.m_materialPropertyOverrideMap.find(propertyId); + if(propertyOverrideItr != editData.m_materialPropertyOverrideMap.end()) + { + propertyValue = AZ::RPI::MaterialPropertyValue::FromAny(propertyOverrideItr->second); + } + + if (!editData.m_materialTypeSourceData.ConvertPropertyValueToSourceDataFormat(*propertyDefinition, propertyValue)) + { + AZ_Error("AZ::Render::EditorMaterialComponentUtil", false, "Failed to export: %s", path.c_str()); + result = false; + return false; + } + + // Don't export values if they are the same as the material type or parent + if (propertyValueDefault == propertyValue) + { + return true; + } + + // TODO: Support populating the Material Editor with nested property sets, not just the top level. + const AZStd::string groupName = propertyId.GetStringView().substr(0, propertyId.GetStringView().size() - propertyDefinition->m_name.size() - 1); + exportData.m_properties[groupName][propertyDefinition->m_name].m_value = propertyValue; return true; - } - - exportData.m_properties[groupName][propertyDefinition.m_name].m_value = propertyValue; - return true; - }); + }); return result && AZ::RPI::JsonUtils::SaveObjectToFile(path, exportData); } From 9d09656023899e3faa0dcd1e6a6633f8a4dfb1d7 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 30 Sep 2021 01:33:05 -0700 Subject: [PATCH 004/620] Removed commented out code. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Material/MaterialTypeSourceData.h | 8 --- .../Material/MaterialTypeSourceData.cpp | 71 ------------------- 2 files changed, 79 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index 56f7c4612c..1d918702ff 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -180,9 +180,7 @@ namespace AZ }; PropertySet* AddPropertySet(AZStd::string_view propertySetId); - //PropertySet* AddPropertySet(AZStd::string_view parentPropertySetId, AZStd::string_view name); PropertyDefinition* AddProperty(AZStd::string_view propertyId); - //PropertyDefinition* AddProperty(AZStd::string_view parentPropertySetId, AZStd::string_view name); const PropertyLayout& GetPropertyLayout() const { return m_propertyLayout; } @@ -241,15 +239,9 @@ namespace AZ private: - //PropertySet* FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList); const PropertySet* FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) const; - - //PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList); const PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) const; - //PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, PropertySet& inPropertySet); - //const PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, const PropertySet& inPropertySet) const; - // Function overloads for recursion, returns false to indicate that recursion should end. bool EnumeratePropertySets(const EnumeratePropertySetsCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertySetList) const; bool EnumerateProperties(const EnumeratePropertiesCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertySetList) const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index de55cbecb5..816e9f4f8d 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -196,9 +196,6 @@ namespace AZ return PropertySet::AddPropertySet(propertySetId, m_propertyLayout.m_propertySets); } - // TODO: Delete - //return AddPropertySet(splitPropertySetId[0], splitPropertySetId[1]); - PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(splitPropertySetId[0])); if (!parentPropertySet) @@ -210,27 +207,9 @@ namespace AZ return parentPropertySet->AddPropertySet(splitPropertySetId[1]); } - // TODO: Delete - //MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::AddPropertySet(AZStd::string_view parentPropertySetId, AZStd::string_view name) - //{ - // PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(parentPropertySetId)); - // - // if (!parentPropertySet) - // { - // AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(parentPropertySetId)); - // return nullptr; - // } - - // return parentPropertySet->AddPropertySet(name); - //} - MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::AddProperty(AZStd::string_view propertyId) { AZStd::vector splitPropertyId = SplitId(propertyId); - //if (splitPropertyId.empty()) - //{ - // return nullptr; - //} if (splitPropertyId.size() == 1) { @@ -238,9 +217,6 @@ namespace AZ return nullptr; } - // TODO: Delete - //return AddProperty(splitPropertyId[0], splitPropertyId[1]); - PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(splitPropertyId[0])); if (!parentPropertySet) @@ -252,20 +228,6 @@ namespace AZ return parentPropertySet->AddProperty(splitPropertyId[1]); } - // TODO: Delete - //MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::AddProperty(AZStd::string_view parentPropertySetId, AZStd::string_view name) - //{ - // PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(parentPropertySetId)); - // - // if (!parentPropertySet) - // { - // AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(parentPropertySetId)); - // return nullptr; - // } - - // return parentPropertySet->AddProperty(name); - //} - const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) const { for (const auto& propertySet : inPropertySetList) @@ -296,40 +258,12 @@ namespace AZ return nullptr; } - //MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) - //{ - // return const_cast(const_cast(this)->FindPropertySet(parsedPropertySetId, inPropertySetList)); - //} - const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::string_view propertySetId) const { AZStd::vector tokens = TokenizeId(propertySetId); return FindPropertySet(tokens, m_propertyLayout.m_propertySets); } - //MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, PropertySet& inPropertySet) - //{ - // if (parsedPropertyId.size() == 1) - // { - // for (AZStd::unique_ptr& property : inPropertySet.m_properties) - // { - // if (property->m_name == parsedPropertyId[0]) - // { - // return property.get(); - // } - // } - // } - - // return FindProperty(parsedPropertyId, inPropertySet.m_propertySets); - //} - - //const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, const PropertySet& inPropertySet) const - //{ - // MaterialTypeSourceData* nonConstThis = const_cast(this); - // PropertySet& nonConstPropertySet = *const_cast(&inPropertySet); - // return const_cast(nonConstThis->FindProperty(parsedPropertyId, nonConstPropertySet)); - //} - const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty( AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) const @@ -364,11 +298,6 @@ namespace AZ return nullptr; } - //MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) - //{ - // return const_cast(const_cast(this)->FindProperty(parsedPropertyId, inPropertySetList)); - //} - const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::string_view propertyId) const { AZStd::vector tokens = TokenizeId(propertyId); From 95cfe056a1bc72eb5c77f01a347d538e9e7de8e8 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 1 Oct 2021 17:00:45 -0700 Subject: [PATCH 005/620] Updated .materialtype files to use the new format, "propertySets" instead of "groups". First I used some local changes to do an auto-conversion that loaded, upgraded, and then saved each .materialtype but some details were lost in translation. For example, comments were lost, and default values changed slightly. So I grabbed an original copy of each file, and copied/pasted each section from the old file to the new one, while preserving the new layout. I did not update StandardMultilayerPBR because that will be too much work, will wait until after common property sets can be factored out. And I will likely discard that auto-conversion soon. Testing: AtomSampleViewer MaterialScreenshotTest script passed with the same results as before. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Special/ShadowCatcher.materialtype | 58 +- .../Materials/Types/EnhancedPBR.materialtype | 2761 ++++++++--------- .../Assets/Materials/Types/Skin.materialtype | 1848 ++++++----- .../Materials/Types/StandardPBR.materialtype | 1909 ++++++------ .../Materials/Types/AutoBrick.materialtype | 327 +- 5 files changed, 3446 insertions(+), 3457 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype index 74246f85db..62d3db022b 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype @@ -2,38 +2,40 @@ "description": "Base material for the reflection probe visualization model.", "propertyLayout": { "version": 1, - "properties": { - "settings": [ - { - "name": "opacity", - "displayName": "Opacity", - "description": "Opacity of the shadow effect.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacity" + "propertySets": [ + { + "name": "settings", + "properties": [ + { + "name": "opacity", + "displayName": "Opacity", + "description": "Opacity of the shadow effect.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacity" + } + }, + { + "name": "shadeAll", + "displayName": "Shade All", + "description": "Shades the entire geometry with the shadow color, not just what's in shadow. For debugging.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_shadeAll" + } } - }, - { - "name": "shadeAll", - "displayName": "Shade All", - "description": "Shades the entire geometry with the shadow color, not just what's in shadow. For debugging.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_shadeAll" - } - } - ] - } + ] + } + ] }, "shaders": [ { "file": "ShadowCatcher.shader" } ] -} - +} \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index bed3b69c4c..3d227a9aa0 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -2,1456 +2,1453 @@ "description": "Material Type with properties used to define Enhanced PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model, with advanced features like subsurface scattering, transmission, and anisotropy.", "propertyLayout": { "version": 3, - "groups": [ + "propertySets": [ { "name": "baseColor", "displayName": "Base Color", - "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals." + "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals.", + "properties": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_baseColorFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Base color texture map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Base color map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMapUvIndex" + } + }, + { + "name": "textureBlendMode", + "displayName": "Texture Blend Mode", + "description": "Selects the equation to use when combining Color, Factor, and Texture.", + "type": "Enum", + "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], + "defaultValue": "Multiply", + "connection": { + "type": "ShaderOption", + "name": "o_baseColorTextureBlendMode" + } + } + ] }, { "name": "metallic", "displayName": "Metallic", - "description": "Properties for configuring whether the surface is metallic or not." + "description": "Properties for configuring whether the surface is metallic or not.", + "properties": [ + { + "name": "factor", + "displayName": "Factor", + "description": "This value is linear, black is non-metal and white means raw metal.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_metallicFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Metallic map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMapUvIndex" + } + } + ] }, { "name": "roughness", "displayName": "Roughness", - "description": "Properties for configuring how rough the surface appears." + "description": "Properties for configuring how rough the surface appears.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface roughness.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMapUvIndex" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "lowerBound", + "displayName": "Lower Bound", + "description": "The roughness value that corresponds to black in the texture.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessLowerBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "upperBound", + "displayName": "Upper Bound", + "description": "The roughness value that corresponds to white in the texture.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessUpperBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessFactor" + } + } + ] }, { "name": "specularF0", "displayName": "Specular Reflectance f0", - "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces." + "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces.", + "properties": [ + { + "name": "factor", + "displayName": "Factor", + "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Factor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface reflectance.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Map" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Specular reflection map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0MapUvIndex" + } + }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR + { + "name": "enableMultiScatterCompensation", + "displayName": "Multiscattering Compensation", + "description": "Whether to enable multiple scattering compensation.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_specularF0_enableMultiScatterCompensation" + } + } + ] }, { "name": "normal", "displayName": "Normal", - "description": "Properties related to configuring surface normal." + "description": "Properties related to configuring surface normal.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface normal direction.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_normalMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_normalMapUvIndex" + } + }, + { + "name": "flipX", + "displayName": "Flip X Channel", + "description": "Flip tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalX" + } + }, + { + "name": "flipY", + "displayName": "Flip Y Channel", + "description": "Flip bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalY" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_normalFactor" + } + } + ] }, { "name": "detailLayerGroup", "displayName": "Detail Layer", - "description": "Properties for Fine Details Layer." + "description": "Properties for Fine Details Layer.", + "properties": [ + { + "name": "enableDetailLayer", + "displayName": "Enable Detail Layer", + "description": "Enable detail layer for fine details and scratches", + "type": "Bool", + "defaultValue": false + }, + { + "name": "blendDetailFactor", + "displayName": "Blend Factor", + "description": "Scales the overall impact of the detail layer.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendFactor" + } + }, + { + "name": "blendDetailMask", + "displayName": "Blend Mask", + "description": "Detailed blend mask for application of the detail maps.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendMask_texture" + } + }, + { + "name": "enableDetailMaskTexture", + "displayName": " Use Texture", + "description": "Enable detail blend mask", + "type": "Bool", + "defaultValue": true + }, + { + "name": "blendDetailMaskUv", + "displayName": " Blend Mask UV", + "description": "Which UV set to use for sampling the detail blend mask", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendMask_uvIndex" + } + }, + { + "name": "textureMapUv", + "displayName": "Detail Map UVs", + "description": "Which UV set to use for detail map sampling", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_detail_allMapsUvIndex" + } + }, + { + "name": "enableBaseColor", + "displayName": "Enable Base Color", + "description": "Enable detail blending for base color", + "type": "Bool", + "defaultValue": false + }, + { + "name": "baseColorDetailMap", + "displayName": " Texture", + "description": "Detailed Base Color Texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_baseColor_texture" + } + }, + { + "name": "baseColorDetailBlend", + "displayName": " Blend Factor", + "description": "How much to blend the detail layer into the base color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_baseColor_factor" + } + }, + { + "name": "enableNormals", + "displayName": "Enable Normal", + "description": "Enable detail normal map to be used for fine detail normal such as scratches and small dents", + "type": "Bool", + "defaultValue": false + }, + { + "name": "normalDetailStrength", + "displayName": " Factor", + "description": "Strength factor for scaling the Detail Normal", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_factor" + } + }, + { + "name": "normalDetailMap", + "displayName": " Texture", + "description": "Detailed Normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_texture" + } + }, + { + "name": "normalDetailFlipX", + "displayName": " Flip X Channel", + "description": "Flip Detail tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_flipX" + } + }, + { + "name": "normalDetailFlipY", + "displayName": " Flip Y Channel", + "description": "Flip Detail bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_flipY" + } + } + ] }, { "name": "detailUV", "displayName": "Detail Layer UV", - "description": "Properties for modifying detail layer UV." + "description": "Properties for modifying detail layer UV.", + "properties": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ] }, { "name": "anisotropy", "displayName": "Anisotropic Material Response", - "description": "How much is this material response anisotropic." + "description": "How much is this material response anisotropic.", + "properties": [ + { + "name": "enableAnisotropy", + "displayName": "Enable Anisotropy", + "description": "Enable anisotropic surface response for non uniform reflection along the axis", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_enableAnisotropy" + } + }, + { + "name": "factor", + "displayName": "Anisotropy Factor", + "description": "Strength factor for the anisotropy: negative = along v, positive = along u", + "type": "Float", + "defaultValue": 0.0, + "min": -0.95, + "max": 0.95, + "connection": { + "type": "ShaderInput", + "name": "m_anisotropicFactor" + } + }, + { + "name": "anisotropyAngle", + "displayName": "Anisotropy Angle", + "description": "Anisotropy direction of major reflection axis: 0 = 0 degrees, 1.0 = 180 degrees", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_anisotropicAngle" + } + } + ] }, { "name": "occlusion", "displayName": "Occlusion", - "description": "Properties for baked textures that represent geometric occlusion of light." + "description": "Properties for baked textures that represent geometric occlusion of light.", + "properties": [ + { + "name": "diffuseTextureMap", + "displayName": "Diffuse AO", + "description": "Texture for defining occlusion area for diffuse ambient lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMap" + } + }, + { + "name": "diffuseUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Diffuse AO map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "diffuseTextureMapUv", + "displayName": " UV", + "description": "Diffuse AO map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMapUvIndex" + } + }, + { + "name": "diffuseFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Diffuse AO", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionFactor" + } + }, + { + "name": "specularTextureMap", + "displayName": "Specular Cavity", + "description": "Texture for defining occlusion area for specular lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMap" + } + }, + { + "name": "specularUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Specular Cavity map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "specularTextureMapUv", + "displayName": " UV", + "description": "Specular Cavity map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMapUvIndex" + } + }, + { + "name": "specularFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Specular Cavity", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionFactor" + } + } + ] }, { "name": "emissive", "displayName": "Emissive", - "description": "Properties to add light emission, independent of other lights in the scene." + "description": "Properties to add light emission, independent of other lights in the scene.", + "properties": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable the emissive group", + "type": "Bool", + "defaultValue": false + }, + { + "name": "unit", + "displayName": "Units", + "description": "The photometric units of the Intensity property.", + "type": "Enum", + "enumValues": ["Ev100"], + "defaultValue": "Ev100" + }, + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_emissiveColor" + } + }, + { + "name": "intensity", + "displayName": "Intensity", + "description": "The amount of energy emitted.", + "type": "Float", + "defaultValue": 4, + "min": -10, + "max": 20, + "softMin": -6, + "softMax": 16 + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining emissive area.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Emissive map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMapUvIndex" + } + } + ] }, { "name": "subsurfaceScattering", "displayName": "Subsurface Scattering", - "description": "Properties for configuring subsurface scattering effects." + "description": "Properties for configuring subsurface scattering effects.", + "properties": [ + { + "name": "enableSubsurfaceScattering", + "displayName": "Subsurface Scattering", + "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_enableSubsurfaceScattering" + } + }, + { + "name": "subsurfaceScatterFactor", + "displayName": " Factor", + "description": "Strength factor for scaling percentage of subsurface scattering effect applied", + "type": "float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Texture for controlling the strength of subsurface scattering", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Influence Map", + "description": "Whether to use the influence map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Influence map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringInfluenceMapUvIndex" + } + }, + { + "name": "scatterColor", + "displayName": " Scatter color", + "description": "Color of volume light traveled through", + "type": "Color", + "defaultValue": [ 1.0, 0.27, 0.13 ] + }, + { + "name": "scatterDistance", + "displayName": " Scatter distance", + "description": "How far light traveled inside the volume", + "type": "float", + "defaultValue": 8, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "quality", + "displayName": " Quality", + "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", + "type": "float", + "defaultValue": 0.4, + "min": 0.2, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringQuality" + } + }, + { + "name": "transmissionMode", + "displayName": "Transmission", + "description": "Algorithm used for calculating transmission", + "type": "Enum", + "enumValues": [ "None", "ThickObject", "ThinObject" ], + "defaultValue": "None", + "connection": { + "type": "ShaderOption", + "name": "o_transmission_mode" + } + }, + { + "name": "thickness", + "displayName": " Thickness", + "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", + "type": "float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0 + }, + { + "name": "thicknessMap", + "displayName": " Thickness Map", + "description": "Texture for controlling per pixel thickness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_transmissionThicknessMap" + } + }, + { + "name": "useThicknessMap", + "displayName": " Use Thickness Map", + "description": "Whether to use the thickness map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "thicknessMapUv", + "displayName": " UV", + "description": "Thickness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_transmissionThicknessMapUvIndex" + } + }, + { + "name": "transmissionTint", + "displayName": " Transmission Tint", + "description": "Color of the volume light traveling through", + "type": "Color", + "defaultValue": [ 1.0, 0.8, 0.6 ] + }, + { + "name": "transmissionPower", + "displayName": " Power", + "description": "How much transmitted light scatter radially ", + "type": "float", + "defaultValue": 6.0, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "transmissionDistortion", + "displayName": " Distortion", + "description": "How much light direction distorted towards surface normal", + "type": "float", + "defaultValue": 0.1, + "min": 0.0, + "max": 1.0 + }, + { + "name": "transmissionAttenuation", + "displayName": " Attenuation", + "description": "How fast transmitted light fade with thickness", + "type": "float", + "defaultValue": 4.0, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "transmissionScale", + "displayName": " Scale", + "description": "Strength of transmission", + "type": "float", + "defaultValue": 3.0, + "min": 0.0, + "softMax": 20.0 + } + ] }, { "name": "clearCoat", "displayName": "Clear Coat", - "description": "Properties for configuring gloss clear coat" - }, + "description": "Properties for configuring gloss clear coat", + "properties": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable clear coat", + "type": "Bool", + "defaultValue": false + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the percentage of effect applied", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Strength factor texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Strength factor map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMapUvIndex" + } + }, + { + "name": "roughness", + "displayName": "Roughness", + "description": "Clear coat layer roughness", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughness" + } + }, + { + "name": "roughnessMap", + "displayName": " Roughness Map", + "description": "Texture for defining surface roughness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMap" + } + }, + { + "name": "useRoughnessMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the roughness value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "roughnessMapUv", + "displayName": " UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMapUvIndex" + } + }, + { + "name": "normalStrength", + "displayName": "Normal Strength", + "description": "Scales the impact of the clear coat normal map", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalStrength" + } + }, + { + "name": "normalMap", + "displayName": "Normal Map", + "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMap" + } + }, + { + "name": "useNormalMap", + "displayName": " Use Texture", + "description": "Whether to use the normal map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "normalMapUv", + "displayName": " UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMapUvIndex" + } + } + ] + }, { "name": "parallax", "displayName": "Displacement", - "description": "Properties for parallax effect produced by a height map." + "description": "Properties for parallax effect produced by a height map.", + "properties": [ + { + "name": "textureMap", + "displayName": "Height Map", + "description": "Displacement height map to create parallax effect.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_heightmap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the height map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Height map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_parallaxUvIndex" + } + }, + { + "name": "factor", + "displayName": "Height Map Scale", + "description": "The total height of the height map in local model units.", + "type": "Float", + "defaultValue": 0.05, + "min": 0.0, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapScale" + } + }, + { + "name": "offset", + "displayName": "Offset", + "description": "Adjusts the overall displacement amount in local model units.", + "type": "Float", + "defaultValue": 0.0, + "softMin": -0.1, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapOffset" + } + }, + { + "name": "algorithm", + "displayName": "Algorithm", + "description": "Select the algorithm to use for parallax mapping.", + "type": "Enum", + "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], + "defaultValue": "POM", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_algorithm" + } + }, + { + "name": "quality", + "displayName": "Quality", + "description": "Quality of parallax mapping.", + "type": "Enum", + "enumValues": [ "Low", "Medium", "High", "Ultra" ], + "defaultValue": "Low", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_quality" + } + }, + { + "name": "pdo", + "displayName": "Pixel Depth Offset", + "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_enablePixelDepthOffset" + } + }, + { + "name": "showClipping", + "displayName": "Show Clipping", + "description": "Highlight areas where the height map is clipped by the mesh surface.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_highlightClipping" + } + } + ] }, { "name": "opacity", "displayName": "Opacity", - "description": "Properties for configuring the materials transparency." + "description": "Properties for configuring the materials transparency.", + "properties": [ + { + "name": "mode", + "displayName": "Opacity Mode", + "description": "Indicates the general approach how transparency is to be applied.", + "type": "Enum", + "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], + "defaultValue": "Opaque", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_mode" + } + }, + { + "name": "alphaSource", + "displayName": "Alpha Source", + "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", + "type": "Enum", + "enumValues": [ "Packed", "Split", "None" ], + "defaultValue": "Packed", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_source" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface opacity.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMap" + } + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Opacity map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMapUvIndex" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Factor for cutout threshold and blending", + "type": "Float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.5, + "connection": { + "type": "ShaderInput", + "name": "m_opacityFactor" + } + }, + { + "name": "doubleSided", + "displayName": "Double-sided", + "description": "Whether to render back-faces or just front-faces.", + "type": "Bool" + }, + { + "name": "alphaAffectsSpecular", + "displayName": "Alpha affects specular", + "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", + "type": "float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacityAffectsSpecularFactor" + } + } + ] }, { "name": "uv", "displayName": "UVs", - "description": "Properties for configuring UV transforms." + "description": "Properties for configuring UV transforms.", + "properties": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in U.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ] }, { // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader "name": "irradiance", "displayName": "Irradiance", - "description": "Properties for configuring the irradiance used in global illumination." + "description": "Properties for configuring the irradiance used in global illumination.", + "properties": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ] + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0 + } + ] }, { "name": "general", "displayName": "General Settings", - "description": "General settings." + "description": "General settings.", + "properties": [ + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + }, + { + "name": "forwardPassIBLSpecular", + "displayName": "Forward Pass IBL Specular", + "description": "Whether to apply IBL specular in the forward pass.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_materialUseForwardPassIBLSpecular" + } + } + ] } - ], - "properties": { - "general": [ - { - "name": "applySpecularAA", - "displayName": "Apply Specular AA", - "description": "Whether to apply specular anti-aliasing in the shader.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_applySpecularAA" - } - }, - { - "name": "enableShadows", - "displayName": "Enable Shadows", - "description": "Whether to use the shadow maps.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableShadows" - } - }, - { - "name": "enableDirectionalLights", - "displayName": "Enable Directional Lights", - "description": "Whether to use directional lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableDirectionalLights" - } - }, - { - "name": "enablePunctualLights", - "displayName": "Enable Punctual Lights", - "description": "Whether to use punctual lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enablePunctualLights" - } - }, - { - "name": "enableAreaLights", - "displayName": "Enable Area Lights", - "description": "Whether to use area lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableAreaLights" - } - }, - { - "name": "enableIBL", - "displayName": "Enable IBL", - "description": "Whether to use Image Based Lighting (IBL).", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableIBL" - } - }, - { - "name": "forwardPassIBLSpecular", - "displayName": "Forward Pass IBL Specular", - "description": "Whether to apply IBL specular in the forward pass.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_materialUseForwardPassIBLSpecular" - } - } - ], - "baseColor": [ - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_baseColor" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_baseColorFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Base color texture map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Base color map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMapUvIndex" - } - }, - { - "name": "textureBlendMode", - "displayName": "Texture Blend Mode", - "description": "Selects the equation to use when combining Color, Factor, and Texture.", - "type": "Enum", - "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], - "defaultValue": "Multiply", - "connection": { - "type": "ShaderOption", - "name": "o_baseColorTextureBlendMode" - } - } - ], - "metallic": [ - { - "name": "factor", - "displayName": "Factor", - "description": "This value is linear, black is non-metal and white means raw metal.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_metallicFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Metallic map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMapUvIndex" - } - } - ], - "roughness": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface roughness.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMapUvIndex" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "lowerBound", - "displayName": "Lower Bound", - "description": "The roughness value that corresponds to black in the texture.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessLowerBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "upperBound", - "displayName": "Upper Bound", - "description": "The roughness value that corresponds to white in the texture.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessUpperBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "factor", - "displayName": "Factor", - "description": "Controls the roughness value", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessFactor" - } - } - ], - "anisotropy": [ - { - "name": "enableAnisotropy", - "displayName": "Enable Anisotropy", - "description": "Enable anisotropic surface response for non uniform reflection along the axis", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_enableAnisotropy" - } - }, - { - "name": "factor", - "displayName": "Anisotropy Factor", - "description": "Strength factor for the anisotropy: negative = along v, positive = along u", - "type": "Float", - "defaultValue": 0.0, - "min": -0.95, - "max": 0.95, - "connection": { - "type": "ShaderInput", - "name": "m_anisotropicFactor" - } - }, - { - "name": "anisotropyAngle", - "displayName": "Anisotropy Angle", - "description": "Anisotropy direction of major reflection axis: 0 = 0 degrees, 1.0 = 180 degrees", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_anisotropicAngle" - } - } - ], - "specularF0": [ - { - "name": "factor", - "displayName": "Factor", - "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Factor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface reflectance.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Map" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Specular reflection map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0MapUvIndex" - } - }, - // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR - { - "name": "enableMultiScatterCompensation", - "displayName": "Multiscattering Compensation", - "description": "Whether to enable multiple scattering compensation.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_specularF0_enableMultiScatterCompensation" - } - } - ], - "clearCoat": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable clear coat", - "type": "Bool", - "defaultValue": false - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the percentage of effect applied", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Strength factor texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Strength factor map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMapUvIndex" - } - }, - { - "name": "roughness", - "displayName": "Roughness", - "description": "Clear coat layer roughness", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughness" - } - }, - { - "name": "roughnessMap", - "displayName": " Roughness Map", - "description": "Texture for defining surface roughness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMap" - } - }, - { - "name": "useRoughnessMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the roughness value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "roughnessMapUv", - "displayName": " UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMapUvIndex" - } - }, - { - "name": "normalStrength", - "displayName": "Normal Strength", - "description": "Scales the impact of the clear coat normal map", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalStrength" - } - }, - { - "name": "normalMap", - "displayName": "Normal Map", - "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMap" - } - }, - { - "name": "useNormalMap", - "displayName": " Use Texture", - "description": "Whether to use the normal map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "normalMapUv", - "displayName": " UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMapUvIndex" - } - } - ], - "normal": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface normal direction.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_normalMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just rely on vertex normals.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_normalMapUvIndex" - } - }, - { - "name": "flipX", - "displayName": "Flip X Channel", - "description": "Flip tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalX" - } - }, - { - "name": "flipY", - "displayName": "Flip Y Channel", - "description": "Flip bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalY" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the values", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_normalFactor" - } - } - ], - "opacity": [ - { - "name": "mode", - "displayName": "Opacity Mode", - "description": "Indicates the general approach how transparency is to be applied.", - "type": "Enum", - "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], - "defaultValue": "Opaque", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_mode" - } - }, - { - "name": "alphaSource", - "displayName": "Alpha Source", - "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", - "type": "Enum", - "enumValues": [ "Packed", "Split", "None" ], - "defaultValue": "Packed", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_source" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface opacity.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMap" - } - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Opacity map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMapUvIndex" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Factor for cutout threshold and blending", - "type": "Float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.5, - "connection": { - "type": "ShaderInput", - "name": "m_opacityFactor" - } - }, - { - "name": "doubleSided", - "displayName": "Double-sided", - "description": "Whether to render back-faces or just front-faces.", - "type": "Bool" - }, - { - "name": "alphaAffectsSpecular", - "displayName": "Alpha affects specular", - "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", - "type": "float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacityAffectsSpecularFactor" - } - } - ], - "uv": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in U.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ], - "occlusion": [ - { - "name": "diffuseTextureMap", - "displayName": "Diffuse AO", - "description": "Texture for defining occlusion area for diffuse ambient lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMap" - } - }, - { - "name": "diffuseUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Diffuse AO map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "diffuseTextureMapUv", - "displayName": " UV", - "description": "Diffuse AO map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMapUvIndex" - } - }, - { - "name": "diffuseFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Diffuse AO", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionFactor" - } - }, - { - "name": "specularTextureMap", - "displayName": "Specular Cavity", - "description": "Texture for defining occlusion area for specular lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMap" - } - }, - { - "name": "specularUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Specular Cavity map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "specularTextureMapUv", - "displayName": " UV", - "description": "Specular Cavity map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMapUvIndex" - } - }, - { - "name": "specularFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Specular Cavity", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionFactor" - } - } - ], - "emissive": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable the emissive group", - "type": "Bool", - "defaultValue": false - }, - { - "name": "unit", - "displayName": "Units", - "description": "The photometric units of the Intensity property.", - "type": "Enum", - "enumValues": ["Ev100"], - "defaultValue": "Ev100" - }, - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_emissiveColor" - } - }, - { - "name": "intensity", - "displayName": "Intensity", - "description": "The amount of energy emitted.", - "type": "Float", - "defaultValue": 4, - "min": -10, - "max": 20, - "softMin": -6, - "softMax": 16 - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining emissive area.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Emissive map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMapUvIndex" - } - } - ], - "parallax": [ - { - "name": "textureMap", - "displayName": "Height Map", - "description": "Displacement height map to create parallax effect.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_heightmap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the height map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Height map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_parallaxUvIndex" - } - }, - { - "name": "factor", - "displayName": "Height Map Scale", - "description": "The total height of the height map in local model units.", - "type": "Float", - "defaultValue": 0.05, - "min": 0.0, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapScale" - } - }, - { - "name": "offset", - "displayName": "Offset", - "description": "Adjusts the overall displacement amount in local model units.", - "type": "Float", - "defaultValue": 0.0, - "softMin": -0.1, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapOffset" - } - }, - { - "name": "algorithm", - "displayName": "Algorithm", - "description": "Select the algorithm to use for parallax mapping.", - "type": "Enum", - "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], - "defaultValue": "POM", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_algorithm" - } - }, - { - "name": "quality", - "displayName": "Quality", - "description": "Quality of parallax mapping.", - "type": "Enum", - "enumValues": [ "Low", "Medium", "High", "Ultra" ], - "defaultValue": "Low", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_quality" - } - }, - { - "name": "pdo", - "displayName": "Pixel Depth Offset", - "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_enablePixelDepthOffset" - } - }, - { - "name": "showClipping", - "displayName": "Show Clipping", - "description": "Highlight areas where the height map is clipped by the mesh surface.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_highlightClipping" - } - } - ], - "subsurfaceScattering": [ - { - "name": "enableSubsurfaceScattering", - "displayName": "Subsurface Scattering", - "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_enableSubsurfaceScattering" - } - }, - { - "name": "subsurfaceScatterFactor", - "displayName": " Factor", - "description": "Strength factor for scaling percentage of subsurface scattering effect applied", - "type": "float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Texture for controlling the strength of subsurface scattering", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Influence Map", - "description": "Whether to use the influence map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Influence map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringInfluenceMapUvIndex" - } - }, - { - "name": "scatterColor", - "displayName": " Scatter color", - "description": "Color of volume light traveled through", - "type": "Color", - "defaultValue": [ 1.0, 0.27, 0.13 ] - }, - { - "name": "scatterDistance", - "displayName": " Scatter distance", - "description": "How far light traveled inside the volume", - "type": "float", - "defaultValue": 8, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "quality", - "displayName": " Quality", - "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", - "type": "float", - "defaultValue": 0.4, - "min": 0.2, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringQuality" - } - }, - { - "name": "transmissionMode", - "displayName": "Transmission", - "description": "Algorithm used for calculating transmission", - "type": "Enum", - "enumValues": [ "None", "ThickObject", "ThinObject" ], - "defaultValue": "None", - "connection": { - "type": "ShaderOption", - "name": "o_transmission_mode" - } - }, - { - "name": "thickness", - "displayName": " Thickness", - "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", - "type": "float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0 - }, - { - "name": "thicknessMap", - "displayName": " Thickness Map", - "description": "Texture for controlling per pixel thickness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_transmissionThicknessMap" - } - }, - { - "name": "useThicknessMap", - "displayName": " Use Thickness Map", - "description": "Whether to use the thickness map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "thicknessMapUv", - "displayName": " UV", - "description": "Thickness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_transmissionThicknessMapUvIndex" - } - }, - { - "name": "transmissionTint", - "displayName": " Transmission Tint", - "description": "Color of the volume light traveling through", - "type": "Color", - "defaultValue": [ 1.0, 0.8, 0.6 ] - }, - { - "name": "transmissionPower", - "displayName": " Power", - "description": "How much transmitted light scatter radially ", - "type": "float", - "defaultValue": 6.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "transmissionDistortion", - "displayName": " Distortion", - "description": "How much light direction distorted towards surface normal", - "type": "float", - "defaultValue": 0.1, - "min": 0.0, - "max": 1.0 - }, - { - "name": "transmissionAttenuation", - "displayName": " Attenuation", - "description": "How fast transmitted light fade with thickness", - "type": "float", - "defaultValue": 4.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "transmissionScale", - "displayName": " Scale", - "description": "Strength of transmission", - "type": "float", - "defaultValue": 3.0, - "min": 0.0, - "softMax": 20.0 - } - ], - "detailLayerGroup": [ - { - "name": "enableDetailLayer", - "displayName": "Enable Detail Layer", - "description": "Enable detail layer for fine details and scratches", - "type": "Bool", - "defaultValue": false - }, - { - "name": "blendDetailFactor", - "displayName": "Blend Factor", - "description": "Scales the overall impact of the detail layer.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendFactor" - } - }, - { - "name": "blendDetailMask", - "displayName": "Blend Mask", - "description": "Detailed blend mask for application of the detail maps.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendMask_texture" - } - }, - { - "name": "enableDetailMaskTexture", - "displayName": " Use Texture", - "description": "Enable detail blend mask", - "type": "Bool", - "defaultValue": true - }, - { - "name": "blendDetailMaskUv", - "displayName": " Blend Mask UV", - "description": "Which UV set to use for sampling the detail blend mask", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendMask_uvIndex" - } - }, - { - "name": "textureMapUv", - "displayName": "Detail Map UVs", - "description": "Which UV set to use for detail map sampling", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_detail_allMapsUvIndex" - } - }, - { - "name": "enableBaseColor", - "displayName": "Enable Base Color", - "description": "Enable detail blending for base color", - "type": "Bool", - "defaultValue": false - }, - { - "name": "baseColorDetailMap", - "displayName": " Texture", - "description": "Detailed Base Color Texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_baseColor_texture" - } - }, - { - "name": "baseColorDetailBlend", - "displayName": " Blend Factor", - "description": "How much to blend the detail layer into the base color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_baseColor_factor" - } - }, - { - "name": "enableNormals", - "displayName": "Enable Normal", - "description": "Enable detail normal map to be used for fine detail normal such as scratches and small dents", - "type": "Bool", - "defaultValue": false - }, - { - "name": "normalDetailStrength", - "displayName": " Factor", - "description": "Strength factor for scaling the Detail Normal", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_factor" - } - }, - { - "name": "normalDetailMap", - "displayName": " Texture", - "description": "Detailed Normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_texture" - } - }, - { - "name": "normalDetailFlipX", - "displayName": " Flip X Channel", - "description": "Flip Detail tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_flipX" - } - }, - { - "name": "normalDetailFlipY", - "displayName": " Flip Y Channel", - "description": "Flip Detail bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_flipY" - } - } - ], - "detailUV": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ], - "irradiance": [ - // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ] - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0 - } - ] - } + ] }, "shaders": [ { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index 0969cc36e8..b462c936e9 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -2,970 +2,968 @@ "description": "Material Type tailored for rendering skin, with support for blended wrinkle maps that work with animated vertex blend shapes.", "propertyLayout": { "version": 3, - "groups": [ + "propertySets": [ { "name": "baseColor", "displayName": "Base Color", - "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals." + "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals.", + "properties": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_baseColorFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Base color texture map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Base color map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMapUvIndex" + } + }, + { + "name": "textureBlendMode", + "displayName": "Texture Blend Mode", + "description": "Selects the equation to use when combining Color, Factor, and Texture.", + "type": "Enum", + "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], + "defaultValue": "Multiply", + "connection": { + "type": "ShaderOption", + "name": "o_baseColorTextureBlendMode" + } + } + ] }, { "name": "roughness", "displayName": "Roughness", - "description": "Properties for configuring how rough the surface appears." + "description": "Properties for configuring how rough the surface appears.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface roughness.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMapUvIndex" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "lowerBound", + "displayName": "Lower Bound", + "description": "The roughness value that corresponds to black in the texture.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessLowerBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "upperBound", + "displayName": "Upper Bound", + "description": "The roughness value that corresponds to white in the texture.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessUpperBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessFactor" + } + } + ] }, { "name": "specularF0", "displayName": "Specular Reflectance f0", - "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces." + "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces.", + "properties": [ + { + "name": "factor", + "displayName": "Factor", + "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Factor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface reflectance.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Map" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Specular reflection map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0MapUvIndex" + } + }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR + { + "name": "enableMultiScatterCompensation", + "displayName": "Multiscattering Compensation", + "description": "Whether to enable multiple scattering compensation.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_specularF0_enableMultiScatterCompensation" + } + } + ] }, { "name": "normal", "displayName": "Normal", - "description": "Properties related to configuring surface normal." + "description": "Properties related to configuring surface normal.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface normal direction.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_normalMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_normalMapUvIndex" + } + }, + { + "name": "flipX", + "displayName": "Flip X Channel", + "description": "Flip tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalX" + } + }, + { + "name": "flipY", + "displayName": "Flip Y Channel", + "description": "Flip bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalY" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_normalFactor" + } + } + ] }, { "name": "detailLayerGroup", "displayName": "Detail Layer", - "description": "Properties for Fine Details Layer." + "description": "Properties for Fine Details Layer.", + "properties": [ + { + "name": "enableDetailLayer", + "displayName": "Enable Detail Layer", + "description": "Enable detail layer for fine details and scratches", + "type": "Bool", + "defaultValue": false + }, + { + "name": "blendDetailFactor", + "displayName": "Blend Factor", + "description": "Scales the overall impact of the detail layer.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendFactor" + } + }, + { + "name": "blendDetailMask", + "displayName": "Blend Mask", + "description": "Detailed blend mask for application of the detail maps.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendMask_texture" + } + }, + { + "name": "enableDetailMaskTexture", + "displayName": " Use Texture", + "description": "Enable detail blend mask", + "type": "Bool", + "defaultValue": true + }, + { + "name": "blendDetailMaskUv", + "displayName": " Blend Mask UV", + "description": "Which UV set to use for sampling the detail blend mask", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendMask_uvIndex" + } + }, + { + "name": "textureMapUv", + "displayName": "Detail Map UVs", + "description": "Which UV set to use for detail map sampling", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_detail_allMapsUvIndex" + } + }, + { + "name": "enableBaseColor", + "displayName": "Enable Base Color", + "description": "Enable detail blending for base color", + "type": "Bool", + "defaultValue": false + }, + { + "name": "baseColorDetailMap", + "displayName": " Texture", + "description": "Detailed Base Color Texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_baseColor_texture" + } + }, + { + "name": "baseColorDetailBlend", + "displayName": " Blend Factor", + "description": "How much to blend the detail layer into the base color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_baseColor_factor" + } + }, + { + "name": "enableNormals", + "displayName": "Enable Normal", + "description": "Enable detail normal map to be used for fine detail normal such as scratches and small dents", + "type": "Bool", + "defaultValue": false + }, + { + "name": "normalDetailStrength", + "displayName": " Factor", + "description": "Strength factor for scaling the Detail Normal", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_factor" + } + }, + { + "name": "normalDetailMap", + "displayName": " Texture", + "description": "Detailed Normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_texture" + } + }, + { + "name": "normalDetailFlipX", + "displayName": " Flip X Channel", + "description": "Flip Detail tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_flipX" + } + }, + { + "name": "normalDetailFlipY", + "displayName": " Flip Y Channel", + "description": "Flip Detail bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_flipY" + } + } + ] }, { "name": "detailUV", "displayName": "Detail Layer UV", - "description": "Properties for modifying detail layer UV." + "description": "Properties for modifying detail layer UV.", + "properties": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ] }, { "name": "occlusion", "displayName": "Occlusion", - "description": "Properties for baked textures that represent geometric occlusion of light." + "description": "Properties for baked textures that represent geometric occlusion of light.", + "properties": [ + { + "name": "diffuseTextureMap", + "displayName": "Diffuse AO", + "description": "Texture for defining occlusion area for diffuse ambient lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMap" + } + }, + { + "name": "diffuseUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Diffuse AO map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "diffuseTextureMapUv", + "displayName": " UV", + "description": "Diffuse AO map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMapUvIndex" + } + }, + { + "name": "diffuseFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Diffuse AO", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionFactor" + } + }, + { + "name": "specularTextureMap", + "displayName": "Specular Cavity", + "description": "Texture for defining occlusion area for specular lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMap" + } + }, + { + "name": "specularUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Specular Cavity map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "specularTextureMapUv", + "displayName": " UV", + "description": "Specular Cavity map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMapUvIndex" + } + }, + { + "name": "specularFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Specular Cavity", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionFactor" + } + } + ] }, { "name": "subsurfaceScattering", "displayName": "Subsurface Scattering", - "description": "Properties for configuring subsurface scattering effects." + "description": "Properties for configuring subsurface scattering effects.", + "properties": [ + { + "name": "enableSubsurfaceScattering", + "displayName": "Subsurface Scattering", + "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_enableSubsurfaceScattering" + } + }, + { + "name": "subsurfaceScatterFactor", + "displayName": " Factor", + "description": "Strength factor for scaling percentage of subsurface scattering effect applied", + "type": "float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Texture for controlling the strength of subsurface scattering", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Influence Map", + "description": "Whether to use the influence map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Influence map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringInfluenceMapUvIndex" + } + }, + { + "name": "scatterColor", + "displayName": " Scatter color", + "description": "Color of volume light traveled through", + "type": "Color", + "defaultValue": [ 1.0, 0.27, 0.13 ] + }, + { + "name": "scatterDistance", + "displayName": " Scatter distance", + "description": "How far light traveled inside the volume", + "type": "float", + "defaultValue": 8, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "quality", + "displayName": " Quality", + "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", + "type": "float", + "defaultValue": 0.4, + "min": 0.2, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringQuality" + } + }, + { + "name": "transmissionMode", + "displayName": "Transmission", + "description": "Algorithm used for calculating transmission", + "type": "Enum", + "enumValues": [ "None", "ThickObject", "ThinObject" ], + "defaultValue": "None", + "connection": { + "type": "ShaderOption", + "name": "o_transmission_mode" + } + }, + { + "name": "thickness", + "displayName": " Thickness", + "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", + "type": "float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0 + }, + { + "name": "thicknessMap", + "displayName": " Thickness Map", + "description": "Texture for controlling per pixel thickness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_transmissionThicknessMap" + } + }, + { + "name": "useThicknessMap", + "displayName": " Use Thickness Map", + "description": "Whether to use the thickness map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "thicknessMapUv", + "displayName": " UV", + "description": "Thickness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_transmissionThicknessMapUvIndex" + } + }, + { + "name": "transmissionTint", + "displayName": " Transmission Tint", + "description": "Color of the volume light traveling through", + "type": "Color", + "defaultValue": [ 1.0, 0.8, 0.6 ] + }, + { + "name": "transmissionPower", + "displayName": " Power", + "description": "How much transmitted light scatter radially ", + "type": "float", + "defaultValue": 6.0, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "transmissionDistortion", + "displayName": " Distortion", + "description": "How much light direction distorted towards surface normal", + "type": "float", + "defaultValue": 0.1, + "min": 0.0, + "max": 1.0 + }, + { + "name": "transmissionAttenuation", + "displayName": " Attenuation", + "description": "How fast transmitted light fade with thickness", + "type": "float", + "defaultValue": 4.0, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "transmissionScale", + "displayName": " Scale", + "description": "Strength of transmission", + "type": "float", + "defaultValue": 3.0, + "min": 0.0, + "softMax": 20.0 + } + ] }, { "name": "wrinkleLayers", "displayName": "Wrinkle Layers", - "description": "Properties for wrinkle maps to support morph animation, using vertex color blend weights." + "description": "Properties for wrinkle maps to support morph animation, using vertex color blend weights.", + "properties": [ + { + "name": "enable", + "displayName": "Enable Wrinkle Layers", + "description": "Enable wrinkle layers for morph animations, using vertex color blend weights.", + "type": "Bool", + "defaultValue": false + }, + { + "name": "count", + "displayName": "Number Of Layers", + "description": "The number of wrinkle map layers to use. The blend values come from the 'COLOR0' vertex stream, where R/G/B/A correspond to wrinkle layers 1/2/3/4 respectively.", + "type": "UInt", + "defaultValue": 4, + "min": 1, + "max": 4 + }, + { + "name": "showBlendValues", + "displayName": "Show Blend Values", + "description": "Enable a debug mode that draws the blend values as red, green, blue, and white overlays.", + "type": "Bool", + "defaultValue": false + }, + { + "name": "enableBaseColor", + "displayName": "Enable Base Color Maps", + "description": "Enable support for blending the base color according to morph animations.", + "type": "Bool", + "defaultValue": false + }, + { + "name": "baseColorMap1", + "displayName": " Base Color 1", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_baseColor_texture1" + } + }, + { + "name": "baseColorMap2", + "displayName": " Base Color 2", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_baseColor_texture2" + } + }, + { + "name": "baseColorMap3", + "displayName": " Base Color 3", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_baseColor_texture3" + } + }, + { + "name": "baseColorMap4", + "displayName": " Base Color 4", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_baseColor_texture4" + } + }, + { + "name": "enableNormal", + "displayName": "Enable Normal Maps", + "description": "Enable support for blending the normal maps according to morph animations.", + "type": "Bool", + "defaultValue": false + }, + { + "name": "normalMap1", + "displayName": " Normals 1", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_normal_texture1" + } + }, + { + "name": "normalMap2", + "displayName": " Normals 2", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_normal_texture2" + } + }, + { + "name": "normalMap3", + "displayName": " Normals 3", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_normal_texture3" + } + }, + { + "name": "normalMap4", + "displayName": " Normals 4", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_normal_texture4" + } + } + ] }, { "name": "general", "displayName": "General Settings", - "description": "General settings." + "description": "General settings.", + "properties": [ + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + } + ] } - ], - "properties": { - "general": [ - { - "name": "applySpecularAA", - "displayName": "Apply Specular AA", - "description": "Whether to apply specular anti-aliasing in the shader.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_applySpecularAA" - } - }, - { - "name": "enableShadows", - "displayName": "Enable Shadows", - "description": "Whether to use the shadow maps.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableShadows" - } - }, - { - "name": "enableDirectionalLights", - "displayName": "Enable Directional Lights", - "description": "Whether to use directional lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableDirectionalLights" - } - }, - { - "name": "enablePunctualLights", - "displayName": "Enable Punctual Lights", - "description": "Whether to use punctual lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enablePunctualLights" - } - }, - { - "name": "enableAreaLights", - "displayName": "Enable Area Lights", - "description": "Whether to use area lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableAreaLights" - } - }, - { - "name": "enableIBL", - "displayName": "Enable IBL", - "description": "Whether to use Image Based Lighting (IBL).", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableIBL" - } - } - ], - "baseColor": [ - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_baseColor" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_baseColorFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Base color texture map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Base color map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMapUvIndex" - } - }, - { - "name": "textureBlendMode", - "displayName": "Texture Blend Mode", - "description": "Selects the equation to use when combining Color, Factor, and Texture.", - "type": "Enum", - "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], - "defaultValue": "Multiply", - "connection": { - "type": "ShaderOption", - "name": "o_baseColorTextureBlendMode" - } - } - ], - "roughness": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface roughness.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMapUvIndex" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "lowerBound", - "displayName": "Lower Bound", - "description": "The roughness value that corresponds to black in the texture.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessLowerBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "upperBound", - "displayName": "Upper Bound", - "description": "The roughness value that corresponds to white in the texture.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessUpperBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "factor", - "displayName": "Factor", - "description": "Controls the roughness value", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessFactor" - } - } - ], - "specularF0": [ - { - "name": "factor", - "displayName": "Factor", - "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Factor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface reflectance.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Map" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Specular reflection map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0MapUvIndex" - } - }, - // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR - { - "name": "enableMultiScatterCompensation", - "displayName": "Multiscattering Compensation", - "description": "Whether to enable multiple scattering compensation.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_specularF0_enableMultiScatterCompensation" - } - } - ], - "normal": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface normal direction.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_normalMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just rely on vertex normals.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_normalMapUvIndex" - } - }, - { - "name": "flipX", - "displayName": "Flip X Channel", - "description": "Flip tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalX" - } - }, - { - "name": "flipY", - "displayName": "Flip Y Channel", - "description": "Flip bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalY" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the values", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_normalFactor" - } - } - ], - "occlusion": [ - { - "name": "diffuseTextureMap", - "displayName": "Diffuse AO", - "description": "Texture for defining occlusion area for diffuse ambient lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMap" - } - }, - { - "name": "diffuseUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Diffuse AO map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "diffuseTextureMapUv", - "displayName": " UV", - "description": "Diffuse AO map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMapUvIndex" - } - }, - { - "name": "diffuseFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Diffuse AO", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionFactor" - } - }, - { - "name": "specularTextureMap", - "displayName": "Specular Cavity", - "description": "Texture for defining occlusion area for specular lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMap" - } - }, - { - "name": "specularUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Specular Cavity map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "specularTextureMapUv", - "displayName": " UV", - "description": "Specular Cavity map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMapUvIndex" - } - }, - { - "name": "specularFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Specular Cavity", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionFactor" - } - } - ], - "subsurfaceScattering": [ - { - "name": "enableSubsurfaceScattering", - "displayName": "Subsurface Scattering", - "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_enableSubsurfaceScattering" - } - }, - { - "name": "subsurfaceScatterFactor", - "displayName": " Factor", - "description": "Strength factor for scaling percentage of subsurface scattering effect applied", - "type": "float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Texture for controlling the strength of subsurface scattering", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Influence Map", - "description": "Whether to use the influence map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Influence map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringInfluenceMapUvIndex" - } - }, - { - "name": "scatterColor", - "displayName": " Scatter color", - "description": "Color of volume light traveled through", - "type": "Color", - "defaultValue": [ 1.0, 0.27, 0.13 ] - }, - { - "name": "scatterDistance", - "displayName": " Scatter distance", - "description": "How far light traveled inside the volume", - "type": "float", - "defaultValue": 8, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "quality", - "displayName": " Quality", - "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", - "type": "float", - "defaultValue": 0.4, - "min": 0.2, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringQuality" - } - }, - { - "name": "transmissionMode", - "displayName": "Transmission", - "description": "Algorithm used for calculating transmission", - "type": "Enum", - "enumValues": [ "None", "ThickObject", "ThinObject" ], - "defaultValue": "None", - "connection": { - "type": "ShaderOption", - "name": "o_transmission_mode" - } - }, - { - "name": "thickness", - "displayName": " Thickness", - "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", - "type": "float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0 - }, - { - "name": "thicknessMap", - "displayName": " Thickness Map", - "description": "Texture for controlling per pixel thickness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_transmissionThicknessMap" - } - }, - { - "name": "useThicknessMap", - "displayName": " Use Thickness Map", - "description": "Whether to use the thickness map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "thicknessMapUv", - "displayName": " UV", - "description": "Thickness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_transmissionThicknessMapUvIndex" - } - }, - { - "name": "transmissionTint", - "displayName": " Transmission Tint", - "description": "Color of the volume light traveling through", - "type": "Color", - "defaultValue": [ 1.0, 0.8, 0.6 ] - }, - { - "name": "transmissionPower", - "displayName": " Power", - "description": "How much transmitted light scatter radially ", - "type": "float", - "defaultValue": 6.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "transmissionDistortion", - "displayName": " Distortion", - "description": "How much light direction distorted towards surface normal", - "type": "float", - "defaultValue": 0.1, - "min": 0.0, - "max": 1.0 - }, - { - "name": "transmissionAttenuation", - "displayName": " Attenuation", - "description": "How fast transmitted light fade with thickness", - "type": "float", - "defaultValue": 4.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "transmissionScale", - "displayName": " Scale", - "description": "Strength of transmission", - "type": "float", - "defaultValue": 3.0, - "min": 0.0, - "softMax": 20.0 - } - ], - "wrinkleLayers": [ - { - "name": "enable", - "displayName": "Enable Wrinkle Layers", - "description": "Enable wrinkle layers for morph animations, using vertex color blend weights.", - "type": "Bool", - "defaultValue": false - }, - { - "name": "count", - "displayName": "Number Of Layers", - "description": "The number of wrinkle map layers to use. The blend values come from the 'COLOR0' vertex stream, where R/G/B/A correspond to wrinkle layers 1/2/3/4 respectively.", - "type": "UInt", - "defaultValue": 4, - "min": 1, - "max": 4 - }, - { - "name": "showBlendValues", - "displayName": "Show Blend Values", - "description": "Enable a debug mode that draws the blend values as red, green, blue, and white overlays.", - "type": "Bool", - "defaultValue": false - }, - { - "name": "enableBaseColor", - "displayName": "Enable Base Color Maps", - "description": "Enable support for blending the base color according to morph animations.", - "type": "Bool", - "defaultValue": false - }, - { - "name": "baseColorMap1", - "displayName": " Base Color 1", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_baseColor_texture1" - } - }, - { - "name": "baseColorMap2", - "displayName": " Base Color 2", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_baseColor_texture2" - } - }, - { - "name": "baseColorMap3", - "displayName": " Base Color 3", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_baseColor_texture3" - } - }, - { - "name": "baseColorMap4", - "displayName": " Base Color 4", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_baseColor_texture4" - } - }, - { - "name": "enableNormal", - "displayName": "Enable Normal Maps", - "description": "Enable support for blending the normal maps according to morph animations.", - "type": "Bool", - "defaultValue": false - }, - { - "name": "normalMap1", - "displayName": " Normals 1", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_normal_texture1" - } - }, - { - "name": "normalMap2", - "displayName": " Normals 2", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_normal_texture2" - } - }, - { - "name": "normalMap3", - "displayName": " Normals 3", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_normal_texture3" - } - }, - { - "name": "normalMap4", - "displayName": " Normals 4", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_normal_texture4" - } - } - ], - "detailLayerGroup": [ - { - "name": "enableDetailLayer", - "displayName": "Enable Detail Layer", - "description": "Enable detail layer for fine details and scratches", - "type": "Bool", - "defaultValue": false - }, - { - "name": "blendDetailFactor", - "displayName": "Blend Factor", - "description": "Scales the overall impact of the detail layer.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendFactor" - } - }, - { - "name": "blendDetailMask", - "displayName": "Blend Mask", - "description": "Detailed blend mask for application of the detail maps.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendMask_texture" - } - }, - { - "name": "enableDetailMaskTexture", - "displayName": " Use Texture", - "description": "Enable detail blend mask", - "type": "Bool", - "defaultValue": true - }, - { - "name": "blendDetailMaskUv", - "displayName": " Blend Mask UV", - "description": "Which UV set to use for sampling the detail blend mask", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendMask_uvIndex" - } - }, - { - "name": "textureMapUv", - "displayName": "Detail Map UVs", - "description": "Which UV set to use for detail map sampling", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_detail_allMapsUvIndex" - } - }, - { - "name": "enableBaseColor", - "displayName": "Enable Base Color", - "description": "Enable detail blending for base color", - "type": "Bool", - "defaultValue": false - }, - { - "name": "baseColorDetailMap", - "displayName": " Texture", - "description": "Detailed Base Color Texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_baseColor_texture" - } - }, - { - "name": "baseColorDetailBlend", - "displayName": " Blend Factor", - "description": "How much to blend the detail layer into the base color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_baseColor_factor" - } - }, - { - "name": "enableNormals", - "displayName": "Enable Normal", - "description": "Enable detail normal map to be used for fine detail normal such as scratches and small dents", - "type": "Bool", - "defaultValue": false - }, - { - "name": "normalDetailStrength", - "displayName": " Factor", - "description": "Strength factor for scaling the Detail Normal", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_factor" - } - }, - { - "name": "normalDetailMap", - "displayName": " Texture", - "description": "Detailed Normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_texture" - } - }, - { - "name": "normalDetailFlipX", - "displayName": " Flip X Channel", - "description": "Flip Detail tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_flipX" - } - }, - { - "name": "normalDetailFlipY", - "displayName": " Flip Y Channel", - "description": "Flip Detail bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_flipY" - } - } - ], - "detailUV": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ] - } + ] }, "shaders": [ { @@ -1095,4 +1093,4 @@ "UV0": "Tiled", "UV1": "Unwrapped" } -} +} \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype index 6eb82b85ae..d6a5dad8cf 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype @@ -2,1013 +2,1010 @@ "description": "Material Type with properties used to define Standard PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.", "propertyLayout": { "version": 3, - "groups": [ + "propertySets": [ { "name": "baseColor", "displayName": "Base Color", - "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals." + "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals.", + "properties": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_baseColorFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Base color texture map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Base color map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMapUvIndex" + } + }, + { + "name": "textureBlendMode", + "displayName": "Texture Blend Mode", + "description": "Selects the equation to use when combining Color, Factor, and Texture.", + "type": "Enum", + "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], + "defaultValue": "Multiply", + "connection": { + "type": "ShaderOption", + "name": "o_baseColorTextureBlendMode" + } + } + ] }, { "name": "metallic", "displayName": "Metallic", - "description": "Properties for configuring whether the surface is metallic or not." + "description": "Properties for configuring whether the surface is metallic or not.", + "properties": [ + { + "name": "factor", + "displayName": "Factor", + "description": "This value is linear, black is non-metal and white means raw metal.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_metallicFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Metallic map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMapUvIndex" + } + } + ] }, { "name": "roughness", "displayName": "Roughness", - "description": "Properties for configuring how rough the surface appears." + "description": "Properties for configuring how rough the surface appears.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface roughness.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMapUvIndex" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "lowerBound", + "displayName": "Lower Bound", + "description": "The roughness value that corresponds to black in the texture.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessLowerBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "upperBound", + "displayName": "Upper Bound", + "description": "The roughness value that corresponds to white in the texture.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessUpperBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessFactor" + } + } + ] }, { "name": "specularF0", "displayName": "Specular Reflectance f0", - "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces." + "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces.", + "properties": [ + { + "name": "factor", + "displayName": "Factor", + "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Factor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface reflectance.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Map" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Specular reflection map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0MapUvIndex" + } + }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR + { + "name": "enableMultiScatterCompensation", + "displayName": "Multiscattering Compensation", + "description": "Whether to enable multiple scattering compensation.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_specularF0_enableMultiScatterCompensation" + } + } + ] }, { "name": "normal", "displayName": "Normal", - "description": "Properties related to configuring surface normal." + "description": "Properties related to configuring surface normal.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface normal direction.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_normalMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_normalMapUvIndex" + } + }, + { + "name": "flipX", + "displayName": "Flip X Channel", + "description": "Flip tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalX" + } + }, + { + "name": "flipY", + "displayName": "Flip Y Channel", + "description": "Flip bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalY" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_normalFactor" + } + } + ] }, { "name": "occlusion", "displayName": "Occlusion", - "description": "Properties for baked textures that represent geometric occlusion of light." + "description": "Properties for baked textures that represent geometric occlusion of light.", + "properties": [ + { + "name": "diffuseTextureMap", + "displayName": "Diffuse AO", + "description": "Texture for defining occlusion area for diffuse ambient lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMap" + } + }, + { + "name": "diffuseUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Diffuse AO map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "diffuseTextureMapUv", + "displayName": " UV", + "description": "Diffuse AO map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMapUvIndex" + } + }, + { + "name": "diffuseFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Diffuse AO", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionFactor" + } + }, + { + "name": "specularTextureMap", + "displayName": "Specular Cavity", + "description": "Texture for defining occlusion area for specular lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMap" + } + }, + { + "name": "specularUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Specular Cavity map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "specularTextureMapUv", + "displayName": " UV", + "description": "Specular Cavity map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMapUvIndex" + } + }, + { + "name": "specularFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Specular Cavity", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionFactor" + } + } + ] }, { "name": "emissive", "displayName": "Emissive", - "description": "Properties to add light emission, independent of other lights in the scene." + "description": "Properties to add light emission, independent of other lights in the scene.", + "properties": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable the emissive group", + "type": "Bool", + "defaultValue": false + }, + { + "name": "unit", + "displayName": "Units", + "description": "The photometric units of the Intensity property.", + "type": "Enum", + "enumValues": ["Ev100"], + "defaultValue": "Ev100" + }, + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_emissiveColor" + } + }, + { + "name": "intensity", + "displayName": "Intensity", + "description": "The amount of energy emitted.", + "type": "Float", + "defaultValue": 4, + "min": -10, + "max": 20, + "softMin": -6, + "softMax": 16 + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining emissive area.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Emissive map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMapUvIndex" + } + } + ] }, { "name": "clearCoat", "displayName": "Clear Coat", - "description": "Properties for configuring gloss clear coat" - }, + "description": "Properties for configuring gloss clear coat", + "properties": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable clear coat", + "type": "Bool", + "defaultValue": false + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the percentage of effect applied", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Strength factor texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Strength factor map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMapUvIndex" + } + }, + { + "name": "roughness", + "displayName": "Roughness", + "description": "Clear coat layer roughness", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughness" + } + }, + { + "name": "roughnessMap", + "displayName": " Roughness Map", + "description": "Texture for defining surface roughness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMap" + } + }, + { + "name": "useRoughnessMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the roughness value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "roughnessMapUv", + "displayName": " UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMapUvIndex" + } + }, + { + "name": "normalStrength", + "displayName": "Normal Strength", + "description": "Scales the impact of the clear coat normal map", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalStrength" + } + }, + { + "name": "normalMap", + "displayName": "Normal Map", + "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMap" + } + }, + { + "name": "useNormalMap", + "displayName": " Use Texture", + "description": "Whether to use the normal map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "normalMapUv", + "displayName": " UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMapUvIndex" + } + } + ] + }, { "name": "parallax", "displayName": "Displacement", - "description": "Properties for parallax effect produced by a height map." + "description": "Properties for parallax effect produced by a height map.", + "properties": [ + { + "name": "textureMap", + "displayName": "Height Map", + "description": "Displacement height map to create parallax effect.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_heightmap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the height map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Height map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_parallaxUvIndex" + } + }, + { + "name": "factor", + "displayName": "Height Map Scale", + "description": "The total height of the height map in local model units.", + "type": "Float", + "defaultValue": 0.05, + "min": 0.0, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapScale" + } + }, + { + "name": "offset", + "displayName": "Offset", + "description": "Adjusts the overall displacement amount in local model units.", + "type": "Float", + "defaultValue": 0.0, + "softMin": -0.1, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapOffset" + } + }, + { + "name": "algorithm", + "displayName": "Algorithm", + "description": "Select the algorithm to use for parallax mapping.", + "type": "Enum", + "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], + "defaultValue": "POM", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_algorithm" + } + }, + { + "name": "quality", + "displayName": "Quality", + "description": "Quality of parallax mapping.", + "type": "Enum", + "enumValues": [ "Low", "Medium", "High", "Ultra" ], + "defaultValue": "Low", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_quality" + } + }, + { + "name": "pdo", + "displayName": "Pixel Depth Offset", + "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_enablePixelDepthOffset" + } + }, + { + "name": "showClipping", + "displayName": "Show Clipping", + "description": "Highlight areas where the height map is clipped by the mesh surface.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_highlightClipping" + } + } + ] }, { "name": "opacity", "displayName": "Opacity", - "description": "Properties for configuring the materials transparency." + "description": "Properties for configuring the materials transparency.", + "properties": [ + { + "name": "mode", + "displayName": "Opacity Mode", + "description": "Indicates the general approach how transparency is to be applied.", + "type": "Enum", + "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], + "defaultValue": "Opaque", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_mode" + } + }, + { + "name": "alphaSource", + "displayName": "Alpha Source", + "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", + "type": "Enum", + "enumValues": [ "Packed", "Split", "None" ], + "defaultValue": "Packed", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_source" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface opacity.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMap" + } + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Opacity map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMapUvIndex" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Factor for cutout threshold and blending", + "type": "Float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.5, + "connection": { + "type": "ShaderInput", + "name": "m_opacityFactor" + } + }, + { + "name": "doubleSided", + "displayName": "Double-sided", + "description": "Whether to render back-faces or just front-faces.", + "type": "Bool" + }, + { + "name": "alphaAffectsSpecular", + "displayName": "Alpha affects specular", + "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", + "type": "float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacityAffectsSpecularFactor" + } + } + ] }, { "name": "uv", "displayName": "UVs", - "description": "Properties for configuring UV transforms." + "description": "Properties for configuring UV transforms.", + "properties": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in U.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ] }, { // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the StandardPBR shader "name": "irradiance", "displayName": "Irradiance", - "description": "Properties for configuring the irradiance used in global illumination." + "description": "Properties for configuring the irradiance used in global illumination.", + "properties": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ] + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0 + } + ] }, { "name": "general", "displayName": "General Settings", - "description": "General settings." + "description": "General settings.", + "properties": [ + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + }, + { + "name": "forwardPassIBLSpecular", + "displayName": "Forward Pass IBL Specular", + "description": "Whether to apply IBL specular in the forward pass.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_materialUseForwardPassIBLSpecular" + } + } + ] } - ], - "properties": { - "general": [ - { - "name": "applySpecularAA", - "displayName": "Apply Specular AA", - "description": "Whether to apply specular anti-aliasing in the shader.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_applySpecularAA" - } - }, - { - "name": "enableShadows", - "displayName": "Enable Shadows", - "description": "Whether to use the shadow maps.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableShadows" - } - }, - { - "name": "enableDirectionalLights", - "displayName": "Enable Directional Lights", - "description": "Whether to use directional lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableDirectionalLights" - } - }, - { - "name": "enablePunctualLights", - "displayName": "Enable Punctual Lights", - "description": "Whether to use punctual lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enablePunctualLights" - } - }, - { - "name": "enableAreaLights", - "displayName": "Enable Area Lights", - "description": "Whether to use area lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableAreaLights" - } - }, - { - "name": "enableIBL", - "displayName": "Enable IBL", - "description": "Whether to use Image Based Lighting (IBL).", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableIBL" - } - }, - { - "name": "forwardPassIBLSpecular", - "displayName": "Forward Pass IBL Specular", - "description": "Whether to apply IBL specular in the forward pass.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_materialUseForwardPassIBLSpecular" - } - } - ], - "baseColor": [ - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_baseColor" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_baseColorFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Base color texture map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Base color map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMapUvIndex" - } - }, - { - "name": "textureBlendMode", - "displayName": "Texture Blend Mode", - "description": "Selects the equation to use when combining Color, Factor, and Texture.", - "type": "Enum", - "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], - "defaultValue": "Multiply", - "connection": { - "type": "ShaderOption", - "name": "o_baseColorTextureBlendMode" - } - } - ], - "metallic": [ - { - "name": "factor", - "displayName": "Factor", - "description": "This value is linear, black is non-metal and white means raw metal.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_metallicFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Metallic map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMapUvIndex" - } - } - ], - "roughness": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface roughness.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMapUvIndex" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "lowerBound", - "displayName": "Lower Bound", - "description": "The roughness value that corresponds to black in the texture.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessLowerBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "upperBound", - "displayName": "Upper Bound", - "description": "The roughness value that corresponds to white in the texture.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessUpperBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "factor", - "displayName": "Factor", - "description": "Controls the roughness value", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessFactor" - } - } - ], - "specularF0": [ - { - "name": "factor", - "displayName": "Factor", - "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Factor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface reflectance.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Map" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Specular reflection map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0MapUvIndex" - } - }, - // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR - { - "name": "enableMultiScatterCompensation", - "displayName": "Multiscattering Compensation", - "description": "Whether to enable multiple scattering compensation.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_specularF0_enableMultiScatterCompensation" - } - } - ], - "clearCoat": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable clear coat", - "type": "Bool", - "defaultValue": false - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the percentage of effect applied", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Strength factor texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Strength factor map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMapUvIndex" - } - }, - { - "name": "roughness", - "displayName": "Roughness", - "description": "Clear coat layer roughness", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughness" - } - }, - { - "name": "roughnessMap", - "displayName": " Roughness Map", - "description": "Texture for defining surface roughness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMap" - } - }, - { - "name": "useRoughnessMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the roughness value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "roughnessMapUv", - "displayName": " UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMapUvIndex" - } - }, - { - "name": "normalStrength", - "displayName": "Normal Strength", - "description": "Scales the impact of the clear coat normal map", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalStrength" - } - }, - { - "name": "normalMap", - "displayName": "Normal Map", - "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMap" - } - }, - { - "name": "useNormalMap", - "displayName": " Use Texture", - "description": "Whether to use the normal map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "normalMapUv", - "displayName": " UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMapUvIndex" - } - } - ], - "normal": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface normal direction.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_normalMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just rely on vertex normals.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_normalMapUvIndex" - } - }, - { - "name": "flipX", - "displayName": "Flip X Channel", - "description": "Flip tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalX" - } - }, - { - "name": "flipY", - "displayName": "Flip Y Channel", - "description": "Flip bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalY" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the values", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_normalFactor" - } - } - ], - "opacity": [ - { - "name": "mode", - "displayName": "Opacity Mode", - "description": "Indicates the general approach how transparency is to be applied.", - "type": "Enum", - "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], - "defaultValue": "Opaque", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_mode" - } - }, - { - "name": "alphaSource", - "displayName": "Alpha Source", - "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", - "type": "Enum", - "enumValues": [ "Packed", "Split", "None" ], - "defaultValue": "Packed", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_source" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface opacity.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMap" - } - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Opacity map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMapUvIndex" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Factor for cutout threshold and blending", - "type": "Float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.5, - "connection": { - "type": "ShaderInput", - "name": "m_opacityFactor" - } - }, - { - "name": "doubleSided", - "displayName": "Double-sided", - "description": "Whether to render back-faces or just front-faces.", - "type": "Bool" - }, - { - "name": "alphaAffectsSpecular", - "displayName": "Alpha affects specular", - "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", - "type": "float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacityAffectsSpecularFactor" - } - } - ], - "uv": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in U.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ], - "occlusion": [ - { - "name": "diffuseTextureMap", - "displayName": "Diffuse AO", - "description": "Texture for defining occlusion area for diffuse ambient lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMap" - } - }, - { - "name": "diffuseUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Diffuse AO map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "diffuseTextureMapUv", - "displayName": " UV", - "description": "Diffuse AO map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMapUvIndex" - } - }, - { - "name": "diffuseFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Diffuse AO", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionFactor" - } - }, - { - "name": "specularTextureMap", - "displayName": "Specular Cavity", - "description": "Texture for defining occlusion area for specular lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMap" - } - }, - { - "name": "specularUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Specular Cavity map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "specularTextureMapUv", - "displayName": " UV", - "description": "Specular Cavity map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMapUvIndex" - } - }, - { - "name": "specularFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Specular Cavity", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionFactor" - } - } - ], - "emissive": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable the emissive group", - "type": "Bool", - "defaultValue": false - }, - { - "name": "unit", - "displayName": "Units", - "description": "The photometric units of the Intensity property.", - "type": "Enum", - "enumValues": ["Ev100"], - "defaultValue": "Ev100" - }, - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_emissiveColor" - } - }, - { - "name": "intensity", - "displayName": "Intensity", - "description": "The amount of energy emitted.", - "type": "Float", - "defaultValue": 4, - "min": -10, - "max": 20, - "softMin": -6, - "softMax": 16 - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining emissive area.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Emissive map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMapUvIndex" - } - } - ], - "parallax": [ - { - "name": "textureMap", - "displayName": "Height Map", - "description": "Displacement height map to create parallax effect.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_heightmap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the height map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Height map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_parallaxUvIndex" - } - }, - { - "name": "factor", - "displayName": "Height Map Scale", - "description": "The total height of the height map in local model units.", - "type": "Float", - "defaultValue": 0.05, - "min": 0.0, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapScale" - } - }, - { - "name": "offset", - "displayName": "Offset", - "description": "Adjusts the overall displacement amount in local model units.", - "type": "Float", - "defaultValue": 0.0, - "softMin": -0.1, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapOffset" - } - }, - { - "name": "algorithm", - "displayName": "Algorithm", - "description": "Select the algorithm to use for parallax mapping.", - "type": "Enum", - "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], - "defaultValue": "POM", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_algorithm" - } - }, - { - "name": "quality", - "displayName": "Quality", - "description": "Quality of parallax mapping.", - "type": "Enum", - "enumValues": [ "Low", "Medium", "High", "Ultra" ], - "defaultValue": "Low", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_quality" - } - }, - { - "name": "pdo", - "displayName": "Pixel Depth Offset", - "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_enablePixelDepthOffset" - } - }, - { - "name": "showClipping", - "displayName": "Show Clipping", - "description": "Highlight areas where the height map is clipped by the mesh surface.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_highlightClipping" - } - } - ], - "irradiance": [ - // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ] - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0 - } - ] - } + ] }, "shaders": [ { @@ -1194,4 +1191,4 @@ "UV0": "Tiled", "UV1": "Unwrapped" } -} +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick.materialtype b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick.materialtype index 00f11663f7..0d4d24d782 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick.materialtype +++ b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick.materialtype @@ -2,176 +2,174 @@ "description": "This is an example of a custom material type using Atom's PBR shading model: procedurally generated brick or tile.", "propertyLayout": { "version": 3, - "groups": [ + "propertySets": [ { "name": "shape", "displayName": "Shape", - "description": "Properties for configuring size, shape, and position of the bricks." + "description": "Properties for configuring size, shape, and position of the bricks.", + "properties": [ + { + "name": "brickWidth", + "displayName": "Brick Width", + "description": "The width of each brick.", + "type": "Float", + "defaultValue": 0.1, + "min": 0.0, + "softMax": 0.2, + "step": 0.001, + "connection": { + "type": "ShaderInput", + "name": "m_brickWidth" + } + }, + { + "name": "brickHeight", + "displayName": "Brick Height", + "description": "The height of each brick.", + "type": "Float", + "defaultValue": 0.05, + "min": 0.0, + "softMax": 0.2, + "step": 0.001, + "connection": { + "type": "ShaderInput", + "name": "m_brickHeight" + } + }, + { + "name": "brickOffset", + "displayName": "Offset", + "description": "The offset of each stack of bricks as a percentage of brick width.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_brickOffset" + } + }, + { + "name": "lineWidth", + "displayName": "Line Width", + "description": "The width of the grout lines.", + "type": "Float", + "defaultValue": 0.01, + "min": 0.0, + "softMax": 0.02, + "step": 0.0001, + "connection": { + "type": "ShaderInput", + "name": "m_lineWidth" + } + }, + { + "name": "lineDepth", + "displayName": "Line Depth", + "description": "The depth of the grout lines.", + "type": "Float", + "defaultValue": 0.01, + "min": 0.0, + "softMax": 0.02, + "connection": { + "type": "ShaderInput", + "name": "m_lineDepth" + } + } + ] }, { "name": "appearance", "displayName": "Appearance", - "description": "Properties for configuring the appearance of the bricks and grout lines." + "description": "Properties for configuring the appearance of the bricks and grout lines.", + "properties": [ + { + "name": "noiseTexture", + "type": "Image", + "defaultValue": "TestData/Textures/noise512.png", + "visibility": "Hidden", + "connection": { + "type": "ShaderInput", + "name": "m_noise" + } + }, + { + "name": "brickColor", + "displayName": "Brick Color", + "description": "The color of the bricks.", + "type": "Color", + "defaultValue": [1.0,1.0,1.0], + "connection": { + "type": "ShaderInput", + "name": "m_brickColor" + } + }, + { + "name": "brickColorNoise", + "displayName": "Brick Color Noise", + "description": "Scale the variation of brick color.", + "type": "Float", + "defaultValue": 0.25, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_brickNoiseFactor" + } + }, + { + "name": "lineColor", + "displayName": "Line Color", + "description": "The color of the grout lines.", + "type": "Color", + "defaultValue": [0.5,0.5,0.5], + "connection": { + "type": "ShaderInput", + "name": "m_lineColor" + } + }, + { + "name": "lineColorNoise", + "displayName": "Line Color Noise", + "description": "Scale the variation of grout line color.", + "type": "Float", + "defaultValue": 0.25, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_lineNoiseFactor" + } + }, + { + "name": "brickColorBleed", + "displayName": "Brick Color Bleed", + "description": "Distance into the grout line that the brick color will continue.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_brickColorBleed" + } + }, + { + "name": "ao", + "displayName": "Ambient Occlusion", + "description": "The strength of baked ambient occlusion in the grout lines.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_aoFactor" + } + } + ] } - ], - "properties": { - "shape": [ - { - "name": "brickWidth", - "displayName": "Brick Width", - "description": "The width of each brick.", - "type": "Float", - "defaultValue": 0.1, - "min": 0.0, - "softMax": 0.2, - "step": 0.001, - "connection": { - "type": "ShaderInput", - "name": "m_brickWidth" - } - }, - { - "name": "brickHeight", - "displayName": "Brick Height", - "description": "The height of each brick.", - "type": "Float", - "defaultValue": 0.05, - "min": 0.0, - "softMax": 0.2, - "step": 0.001, - "connection": { - "type": "ShaderInput", - "name": "m_brickHeight" - } - }, - { - "name": "brickOffset", - "displayName": "Offset", - "description": "The offset of each stack of bricks as a percentage of brick width.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_brickOffset" - } - }, - { - "name": "lineWidth", - "displayName": "Line Width", - "description": "The width of the grout lines.", - "type": "Float", - "defaultValue": 0.01, - "min": 0.0, - "softMax": 0.02, - "step": 0.0001, - "connection": { - "type": "ShaderInput", - "name": "m_lineWidth" - } - }, - { - "name": "lineDepth", - "displayName": "Line Depth", - "description": "The depth of the grout lines.", - "type": "Float", - "defaultValue": 0.01, - "min": 0.0, - "softMax": 0.02, - "connection": { - "type": "ShaderInput", - "name": "m_lineDepth" - } - } - ], - "appearance": [ - { - "name": "noiseTexture", - "type": "Image", - "defaultValue": "TestData/Textures/noise512.png", - "visibility": "Hidden", - "connection": { - "type": "ShaderInput", - "name": "m_noise" - } - }, - { - "name": "brickColor", - "displayName": "Brick Color", - "description": "The color of the bricks.", - "type": "Color", - "defaultValue": [1.0,1.0,1.0], - "connection": { - "type": "ShaderInput", - "name": "m_brickColor" - } - }, - { - "name": "brickColorNoise", - "displayName": "Brick Color Noise", - "description": "Scale the variation of brick color.", - "type": "Float", - "defaultValue": 0.25, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_brickNoiseFactor" - } - }, - { - "name": "lineColor", - "displayName": "Line Color", - "description": "The color of the grout lines.", - "type": "Color", - "defaultValue": [0.5,0.5,0.5], - "connection": { - "type": "ShaderInput", - "name": "m_lineColor" - } - }, - { - "name": "lineColorNoise", - "displayName": "Line Color Noise", - "description": "Scale the variation of grout line color.", - "type": "Float", - "defaultValue": 0.25, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_lineNoiseFactor" - } - }, - { - "name": "brickColorBleed", - "displayName": "Brick Color Bleed", - "description": "Distance into the grout line that the brick color will continue.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_brickColorBleed" - } - }, - { - "name": "ao", - "displayName": "Ambient Occlusion", - "description": "The strength of baked ambient occlusion in the grout lines.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_aoFactor" - } - } - ] - } + ] }, "shaders": [ { @@ -187,8 +185,5 @@ { "file": "Shaders/Depth/DepthPass.shader" } - ], - "functors": [ ] -} - +} \ No newline at end of file From b1c746968752a02a621220edf81c902cb3161ebd Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 1 Oct 2021 17:11:54 -0700 Subject: [PATCH 006/620] Renamed m_groups and m_properties to have "Old" in the name for clarity. Also fixed a potential uninitialized data bug in Conve. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../ConvertEmissiveUnitFunctorSourceData.h | 4 ++-- .../RPI.Edit/Material/MaterialTypeSourceData.h | 4 ++-- .../Material/MaterialTypeSourceData.cpp | 18 +++++++++--------- .../Material/MaterialTypeSourceDataTests.cpp | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/ConvertEmissiveUnitFunctorSourceData.h b/Gems/Atom/Feature/Common/Code/Source/Material/ConvertEmissiveUnitFunctorSourceData.h index 23219ce940..091351087f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/ConvertEmissiveUnitFunctorSourceData.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/ConvertEmissiveUnitFunctorSourceData.h @@ -44,8 +44,8 @@ namespace AZ AZStd::string m_shaderInputName; // The indices of photometric units in the dropdown list - uint32_t m_ev100Index; - uint32_t m_nitIndex; + uint32_t m_ev100Index = 0; + uint32_t m_nitIndex = 1; // Minimum and Maximum value for different photometric units AZ::Vector2 m_ev100MinMax; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index 1d918702ff..ec12384286 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -170,11 +170,11 @@ namespace AZ //! [Deprecated] Use m_propertySets instead //! List of groups that will contain the available properties - AZStd::vector m_groups; + AZStd::vector m_groupsOld; //! [Deprecated] Use m_propertySets instead //! Collection of all available user-facing properties - AZStd::map> m_properties; + AZStd::map> m_propertiesOld; AZStd::vector> m_propertySets; }; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index 816e9f4f8d..bddbf726e2 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -83,8 +83,8 @@ namespace AZ serializeContext->Class() ->Version(1) ->Field("version", &PropertyLayout::m_version) - ->Field("groups", &PropertyLayout::m_groups) //< Old, preserved for backward compatibility, replaced by propertySets - ->Field("properties", &PropertyLayout::m_properties) //< Old, preserved for backward compatibility, replaced by propertySets + ->Field("groups", &PropertyLayout::m_groupsOld) //< Deprecated, preserved for backward compatibility, replaced by propertySets + ->Field("properties", &PropertyLayout::m_propertiesOld) //< Deprecated, preserved for backward compatibility, replaced by propertySets ->Field("propertySets", &PropertyLayout::m_propertySets) ; @@ -397,8 +397,8 @@ namespace AZ { for (const auto& group : GetOldFormatGroupDefinitionsInDisplayOrder()) { - auto propertyListItr = m_propertyLayout.m_properties.find(group.m_name); - if (propertyListItr != m_propertyLayout.m_properties.end()) + auto propertyListItr = m_propertyLayout.m_propertiesOld.find(group.m_name); + if (propertyListItr != m_propertyLayout.m_propertiesOld.end()) { const auto& propertyList = propertyListItr->second; for (auto& propertyDefinition : propertyList) @@ -421,8 +421,8 @@ namespace AZ } } - m_propertyLayout.m_groups.clear(); - m_propertyLayout.m_properties.clear(); + m_propertyLayout.m_groupsOld.clear(); + m_propertyLayout.m_propertiesOld.clear(); return true; } @@ -451,11 +451,11 @@ namespace AZ AZStd::vector MaterialTypeSourceData::GetOldFormatGroupDefinitionsInDisplayOrder() const { AZStd::vector groupDefinitions; - groupDefinitions.reserve(m_propertyLayout.m_properties.size()); + groupDefinitions.reserve(m_propertyLayout.m_propertiesOld.size()); // Some groups are defined explicitly in the .materialtype file's "groups" section. This is the primary way groups are sorted in the UI. AZStd::unordered_set foundGroups; - for (const auto& groupDefinition : m_propertyLayout.m_groups) + for (const auto& groupDefinition : m_propertyLayout.m_groupsOld) { if (foundGroups.insert(groupDefinition.m_name).second) { @@ -468,7 +468,7 @@ namespace AZ } // Some groups are defined implicitly, in the "properties" section where a group name is used but not explicitly defined in the "groups" section. - for (const auto& propertyListPair : m_propertyLayout.m_properties) + for (const auto& propertyListPair : m_propertyLayout.m_propertiesOld) { const AZStd::string& groupName = propertyListPair.first; if (foundGroups.insert(groupName).second) diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp index 00523abbd8..e5394106fd 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp @@ -1781,15 +1781,15 @@ namespace UnitTest JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); // Before conversion to the new format, the data is in the old place - EXPECT_EQ(material.GetPropertyLayout().m_groups.size(), 2); - EXPECT_EQ(material.GetPropertyLayout().m_properties.size(), 2); + EXPECT_EQ(material.GetPropertyLayout().m_groupsOld.size(), 2); + EXPECT_EQ(material.GetPropertyLayout().m_propertiesOld.size(), 2); EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 0); material.ConvertToNewDataFormat(); // After conversion to the new format, the data is in the new place - EXPECT_EQ(material.GetPropertyLayout().m_groups.size(), 0); - EXPECT_EQ(material.GetPropertyLayout().m_properties.size(), 0); + EXPECT_EQ(material.GetPropertyLayout().m_groupsOld.size(), 0); + EXPECT_EQ(material.GetPropertyLayout().m_propertiesOld.size(), 0); EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 2); EXPECT_EQ(material.m_description, "This is a general description about the material"); From 1909d43dcc424c84452a7f8e70f350a0eec996e0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 17:57:45 -0800 Subject: [PATCH 007/620] initial version ported from an old implementation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 483 ++++++++++++++++++ .../Memory/AllocatorBenchmarks_Linux.cpp | 31 ++ .../Platform/Linux/platform_linux_files.cmake | 1 + .../Tests/Memory/AllocatorBenchmarks_Mac.cpp | 30 ++ .../Platform/Mac/platform_mac_files.cmake | 1 + .../Memory/AllocatorBenchmarks_Windows.cpp | 74 +++ .../Windows/platform_windows_files.cmake | 1 + .../AzCore/Tests/azcoretests_files.cmake | 1 + 8 files changed, 622 insertions(+) create mode 100644 Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp new file mode 100644 index 0000000000..2bac12fe83 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -0,0 +1,483 @@ +/* + * 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 + * + */ + +#if defined(HAVE_BENCHMARK) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes(); + size_t GetMemorySize(void* memory); + } + + static AZ::Debug::DrillerManager* s_drillerManager = nullptr; + + template + class TestAllocator : public TAllocator + { + public: + TestAllocator() + : TAllocator() + { + } + + static void SetUp() + { + AZ::AllocatorInstance::Create(); + + s_drillerManager = AZ::Debug::DrillerManager::Create(); + s_drillerManager->Register(aznew AZ::Debug::MemoryDriller); + } + + static void TearDown() + { + AZ::Debug::DrillerManager::Destroy(s_drillerManager); + s_drillerManager = nullptr; + + AZ::AllocatorInstance::Destroy(); + } + + typename TAllocator::pointer_type Allocate( + typename TAllocator::size_type byteSize, + typename TAllocator::size_type alignment, + int = 0, + const char* = nullptr, + const char* = nullptr, + int = 0, + unsigned int = 0) override + { + return AZ::AllocatorInstance::Get().Allocate(byteSize, alignment); + } + + void DeAllocate( + typename TAllocator::pointer_type ptr, + typename TAllocator::size_type byteSize = 0, + typename TAllocator::size_type = 0) override + { + AZ::AllocatorInstance::Get().DeAllocate(ptr, byteSize); + } + + typename TAllocator::pointer_type ReAllocate( + typename TAllocator::pointer_type ptr, + typename TAllocator::size_type newSize, + typename TAllocator::size_type newAlignment) override + { + return AZ::AllocatorInstance::Get().ReAllocate(ptr, newSize, newAlignment); + } + + typename TAllocator::size_type Resize(typename TAllocator::pointer_type ptr, typename TAllocator::size_type newSize) override + { + return AZ::AllocatorInstance::Get().Resize(ptr, newSize); + } + + void GarbageCollect() override + { + AZ::AllocatorInstance::Get().GarbageCollect(); + } + + typename TAllocator::size_type NumAllocatedBytes() const override + { + return AZ::AllocatorInstance::Get().NumAllocatedBytes() + + AZ::AllocatorInstance::Get().GetUnAllocatedMemory(); + } + }; +} + +namespace AZ +{ + AZ_TYPE_INFO_TEMPLATE(Benchmark::TestAllocator, "{ACE2D6E5-4EB8-4DD2-AE95-6BDFD0476801}", AZ_TYPE_INFO_CLASS); +} + +namespace Benchmark +{ + class TestRawMallocAllocator {}; + + template <> + class TestAllocator + : public TestRawMallocAllocator + { + public: + struct Descriptor {}; + + TestAllocator() + {} + + static void SetUp() + { + s_numAllocatedBytes = 0; + } + + static void TearDown() + {} + + void* Allocate( + size_t byteSize, + size_t alignment, + int = 0, + const char* = nullptr, + const char* = nullptr, + int = 0, + unsigned int = 0) + { + s_numAllocatedBytes += byteSize; + if (alignment) + { + return AZ_OS_MALLOC(byteSize, alignment); + } + else + { + return AZ_OS_MALLOC(byteSize, 1); + } + } + + static void DeAllocate(void* ptr, size_t = 0) + { + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + AZ_OS_FREE(ptr); + } + + static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) + { + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + AZ_OS_FREE(ptr); + + s_numAllocatedBytes += newSize; + if (newAlignment) + { + return AZ_OS_MALLOC(newSize, newAlignment); + } + else + { + return AZ_OS_MALLOC(newSize, 1); + } + } + + static size_t Resize(void* ptr, size_t newSize) + { + AZ_UNUSED(ptr); + AZ_UNUSED(newSize); + + return 0; + } + + static void GarbageCollect() + {} + + static size_t NumAllocatedBytes() + { + return s_numAllocatedBytes; + } + + private: + static size_t s_numAllocatedBytes; + }; + + size_t TestAllocator::s_numAllocatedBytes = 0; + + // Here we require to implement this to be able to configure a name for the allocator, otherswise the AllocatorManager crashes when trying to configure the overrides + class TestMallocSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(TestMallocSchemaAllocator, "{3E68224F-E676-402C-8276-CE4B49C05E89}"); + + TestMallocSchemaAllocator() + : AZ::SimpleSchemaAllocator("TestMallocSchemaAllocator", "") + {} + }; + + class TestHeapSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(TestHeapSchemaAllocator, "{456E6C30-AA84-488F-BE47-5C1E6AF636B7}"); + + TestHeapSchemaAllocator() + : AZ::SimpleSchemaAllocator("TestHeapSchemaAllocator", "") + {} + }; + + class TestHphaSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(TestHphaSchemaAllocator, "{6563AB4B-A68E-4499-8C98-D61D640D1F7F}"); + + TestHphaSchemaAllocator() + : AZ::SimpleSchemaAllocator("TestHphaSchemaAllocator", "") + {} + }; + + class TestSystemAllocator : public AZ::SystemAllocator + { + public: + AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); + + TestSystemAllocator() + : AZ::SystemAllocator() + {} + }; +} + +namespace AZ +{ + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{1065B446-4873-4B3E-9CB1-069E148D4DF6}"); + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{92CFDF86-02EE-4247-9809-884EE9F7BA18}"); + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{67DA01DF-9232-493A-B11C-6952FEDEB2A9}"); + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{47384CB4-6729-43A9-B0CE-402E3A7AEFB2}"); + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{096423BC-DC36-48D2-8E89-8F1D600F488A}"); +} + +namespace Benchmark +{ + // Allocated bytes reported by the allocator / actually requested bytes + static const char* s_counterAllocatorMemoryRatio = "Allocator_MemoryRatio"; + + // Allocated bytes reported by the process / actually requested bytes + static const char* s_counterProcessMemoryRatio = "Process_MemoryRatio"; + + enum AllocationSize + { + SMALL, + BIG, + MIXED, + COUNT + }; + + static const size_t s_kiloByte = 1024; + static const size_t s_megaByte = s_kiloByte * s_kiloByte; + using AllocationSizeArray = AZStd::array; + static const AZStd::array s_allocationSizes = { + /* SMALL */ AllocationSizeArray{ 2, 16, 20, 59, 100, 128, 160, 250, 300, 512 }, + /* BIG */ AllocationSizeArray{ 513, s_kiloByte, 2 * s_kiloByte, 4 * s_kiloByte, 10 * s_kiloByte, 64 * s_kiloByte, 128 * s_kiloByte, 200 * s_kiloByte, s_megaByte, 2 * s_megaByte }, + /* MIXED */ AllocationSizeArray{ 2, s_kiloByte, 59, 4 * s_kiloByte, 128, 200 * s_kiloByte, 250, s_megaByte, 512, 2 * s_megaByte } + }; + + template + class AllocatorBenchmarkFixture + : public ::benchmark::Fixture + { + protected: + using TestAllocatorType = TestAllocator; + + virtual void internalSetUp(const ::benchmark::State&) + { + TestAllocatorType::SetUp(); + } + + virtual void internalTearDown(const ::benchmark::State&) + { + TestAllocatorType::TearDown(); + } + + public: + void SetUp(const ::benchmark::State& state) override + { + internalSetUp(state); + } + void SetUp(::benchmark::State& state) override + { + internalSetUp(state); + } + + void TearDown(const ::benchmark::State& state) override + { + internalTearDown(state); + } + void TearDown(::benchmark::State& state) override + { + internalTearDown(state); + } + }; + + template + class AllocationBenchmarkFixture + : public AllocatorBenchmarkFixture + { + using TestAllocatorType = AllocatorBenchmarkFixture::TestAllocatorType; + + void internalSetUp(const ::benchmark::State& state) override + { + AllocatorBenchmarkFixture::SetUp(state); + + m_allocations.resize(state.range_x(), nullptr); + } + + void internalTearDown(const ::benchmark::State& state) override + { + m_allocations.clear(); + m_allocations.shrink_to_fit(); + + AllocatorBenchmarkFixture::TearDown(state); + } + + public: + void Benchmark(benchmark::State& state) + { + TestAllocatorType allocatorType; + + for (auto _ : state) + { + const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); + + const size_t numberOfAllocations = m_allocations.size(); + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + state.PauseTiming(); + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + + state.ResumeTiming(); + m_allocations[allocationIndex] = allocatorType.Allocate(allocationSize, 0); + } + + state.PauseTiming(); + state.counters[s_counterAllocatorMemoryRatio] = + benchmark::Counter(static_cast(allocatorType.NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( + static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), + benchmark::Counter::kDefaults); + + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + allocatorType.DeAllocate(m_allocations[allocationIndex], allocationSize); + m_allocations[allocationIndex] = nullptr; + } + allocatorType.GarbageCollect(); + + state.SetItemsProcessed(numberOfAllocations); + state.ResumeTiming(); + } + } + + private: + AZStd::vector m_allocations; + }; + + template + class DeAllocationBenchmarkFixture + : public AllocatorBenchmarkFixture + { + using TestAllocatorType = AllocatorBenchmarkFixture::TestAllocatorType; + + void internalSetUp(const ::benchmark::State& state) override + { + AllocatorBenchmarkFixture::SetUp(state); + + m_allocations.resize(state.range_x(), nullptr); + } + + void internalTearDown(const ::benchmark::State& state) override + { + m_allocations.clear(); + m_allocations.shrink_to_fit(); + + AllocatorBenchmarkFixture::TearDown(state); + } + public: + void Benchmark(benchmark::State& state) + { + TestAllocatorType allocatorType; + + for (auto _ : state) + { + state.PauseTiming(); + const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); + + const size_t numberOfAllocations = m_allocations.size(); + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + m_allocations[allocationIndex] = allocatorType.Allocate(allocationSize, 0); + } + + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + state.ResumeTiming(); + allocatorType.DeAllocate(m_allocations[allocationIndex], allocationSize); + state.PauseTiming(); + m_allocations[allocationIndex] = nullptr; + } + + state.counters[s_counterAllocatorMemoryRatio] = + benchmark::Counter(static_cast(allocatorType.NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( + static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), + benchmark::Counter::kDefaults); + + state.SetItemsProcessed(numberOfAllocations); + + allocatorType.GarbageCollect(); + + state.ResumeTiming(); + } + } + + private: + AZStd::vector m_allocations; + }; + + static void RunRanges(benchmark::internal::Benchmark* b) + { + for (int i = 0; i < 6; ++i) + { + b->Arg((1 << i) * 1000); + } + } + +#define BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME, ...) \ + BENCHMARK_TEMPLATE_DEFINE_F(FIXTURE, TESTNAME, __VA_ARGS__)(benchmark::State& state) { Benchmark(state); } \ + BENCHMARK_REGISTER_F(FIXTURE, TESTNAME) + +#define BM_REGISTER_SIZE_FIXTURES(FIXTURE, TESTNAME, ALLOCATORTYPE) \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_SMALL, ALLOCATORTYPE, SMALL)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_BIG, ALLOCATORTYPE, BIG)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); + +#define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ + namespace TESTNAME \ + { \ + BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE) \ + BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE) \ + } + + BM_REGISTER_ALLOCATOR(RawMallocAllocator, TestRawMallocAllocator); + BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, TestMallocSchemaAllocator); + BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); + BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, TestHphaSchemaAllocator); + BM_REGISTER_ALLOCATOR(SystemAllocator, TestSystemAllocator); + + //BM_REGISTER_SCHEMA(BestFitExternalMapSchema); // Requires to implement AZ::IAllocatorAllocate + //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating + +#undef BM_REGISTER_ALLOCATOR +#undef BM_REGISTER_SIZE_FIXTURES +#undef BM_REGISTER_TEMPLATE + +} // Benchmark + +#endif // HAVE_BENCHMARK diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp new file mode 100644 index 0000000000..49ecefda49 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp @@ -0,0 +1,31 @@ +/* + * 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 + * + */ + +#include +#include + +#include +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + struct rusage rusage; + getrusage(RUSAGE_SELF, &rusage); + return rusage.ru_maxrss * 1024L; + } + + size_t GetMemorySize(void* memory) + { + return memory ? _aligned_msize(memory, 1, 0) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake b/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake index 844b621e05..953dbb7791 100644 --- a/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake @@ -9,4 +9,5 @@ set(FILES Tests/UtilsTests_Linux.cpp ../Common/UnixLike/Tests/UtilsTests_UnixLike.cpp + Tests/Memory/AllocatorBenchmarks_Linux.cpp ) diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp new file mode 100644 index 0000000000..374d9f81f7 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp @@ -0,0 +1,30 @@ +/* + * 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 + * + */ + +#include +#include + +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + struct rusage rusage; + getrusage(RUSAGE_SELF, &rusage); + return rusage.ru_maxrss; + } + + size_t GetMemorySize(void* memory) + { + return memory ? _aligned_msize(memory, 1, 0) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake b/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake index 93d2daf2b8..14e39d47f4 100644 --- a/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake @@ -9,4 +9,5 @@ set(FILES ../Common/Apple/Tests/UtilsTests_Apple.cpp ../Common/UnixLike/Tests/UtilsTests_UnixLike.cpp + Tests/Memory/AllocatorBenchmarks_Mac.cpp ) diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp new file mode 100644 index 0000000000..9f4efd7a2c --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp @@ -0,0 +1,74 @@ +/* + * 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 + * + */ + +#include +#include + +#include +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + EmptyWorkingSet(GetCurrentProcess()); + + //PROCESS_MEMORY_COUNTERS_EX pmc; + //GetProcessMemoryInfo(GetCurrentProcess(), (PPROCESS_MEMORY_COUNTERS)&pmc, sizeof(pmc)); + //return pmc.PrivateUsage; + //return pmc.WorkingSetSize; + + //size_t memoryUsage = 0; + //HANDLE defaultProcessHeap = GetProcessHeap(); + //PROCESS_HEAP_ENTRY heapEntry; + //if (HeapLock(defaultProcessHeap) == FALSE) + //{ + // AZ_Error("Benchmark", false, "Could not lock process' heap, error: %d", GetLastError()); + // return memoryUsage; + //} + + //heapEntry.lpData = NULL; + //while (HeapWalk(defaultProcessHeap, &heapEntry) != FALSE) + //{ + // memoryUsage += heapEntry.cbData; + //} + + //DWORD lastError = GetLastError(); + //if (lastError != ERROR_NO_MORE_ITEMS) + //{ + // AZ_Error("Benchmark", false, "HeapWalk failed with LastError %d", lastError); + //} + + //if (HeapUnlock(defaultProcessHeap) == FALSE) + //{ + // AZ_Error("Benchmark", false, "Failed to unlock heap with LastError %d", GetLastError()); + //} + + //return memoryUsage; + + size_t memoryUsage = 0; + + MEMORY_BASIC_INFORMATION mbi = { 0 }; + unsigned char* pEndRegion = NULL; + while (sizeof(mbi) == VirtualQuery(pEndRegion, &mbi, sizeof(mbi))) { + pEndRegion += mbi.RegionSize; + if ((mbi.AllocationProtect & PAGE_READWRITE) && (mbi.State & MEM_COMMIT)) { + memoryUsage += mbi.RegionSize; + } + } + return memoryUsage; + } + + size_t GetMemorySize(void* memory) + { + return memory ? _aligned_msize(memory, 1, 0) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake b/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake index 0a96dad34e..97b12b28e6 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake @@ -9,6 +9,7 @@ set(FILES ../Common/WinAPI/Tests/UtilsTests_WinAPI.cpp Tests/IO/Streamer/StorageDriveTests_Windows.cpp + Tests/Memory/AllocatorBenchmarks_Windows.cpp Tests/Memory/OverrunDetectionAllocator_Windows.cpp Tests/Serialization_Windows.cpp ) diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index d39595c45e..6762e07d0a 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -170,6 +170,7 @@ set(FILES Math/Vector3Tests.cpp Math/Vector4PerformanceTests.cpp Math/Vector4Tests.cpp + Memory/AllocatorBenchmarks.cpp Memory/AllocatorManager.cpp Memory/HphaSchema.cpp Memory/HphaSchemaErrorDetection.cpp From 35c1751694ce245b2a033c195a83a094140ec1a0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 18:31:00 -0800 Subject: [PATCH 008/620] simplification of code Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 189 +++++++++--------- 1 file changed, 95 insertions(+), 94 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 2bac12fe83..af87584fc6 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -34,15 +34,15 @@ namespace Benchmark static AZ::Debug::DrillerManager* s_drillerManager = nullptr; + /// + /// Test allocator wrapper that redirects the calls to the passed TAllocator by using AZ::AllocatorInstance. + /// It also creates/destroys the TAllocator type and connects the driller (to reflect what happens at runtime) + /// + /// Allocator type to wrap template - class TestAllocator : public TAllocator + class TestAllocatorWrapper { public: - TestAllocator() - : TAllocator() - { - } - static void SetUp() { AZ::AllocatorInstance::Create(); @@ -59,89 +59,81 @@ namespace Benchmark AZ::AllocatorInstance::Destroy(); } - typename TAllocator::pointer_type Allocate( - typename TAllocator::size_type byteSize, - typename TAllocator::size_type alignment, - int = 0, - const char* = nullptr, - const char* = nullptr, - int = 0, - unsigned int = 0) override + static void* Allocate(size_t byteSize, size_t alignment) { return AZ::AllocatorInstance::Get().Allocate(byteSize, alignment); } - void DeAllocate( - typename TAllocator::pointer_type ptr, - typename TAllocator::size_type byteSize = 0, - typename TAllocator::size_type = 0) override + static void DeAllocate(void* ptr, size_t byteSize = 0) { AZ::AllocatorInstance::Get().DeAllocate(ptr, byteSize); } - typename TAllocator::pointer_type ReAllocate( - typename TAllocator::pointer_type ptr, - typename TAllocator::size_type newSize, - typename TAllocator::size_type newAlignment) override + static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) { return AZ::AllocatorInstance::Get().ReAllocate(ptr, newSize, newAlignment); } - typename TAllocator::size_type Resize(typename TAllocator::pointer_type ptr, typename TAllocator::size_type newSize) override + static size_t Resize(void* ptr, size_t newSize) { return AZ::AllocatorInstance::Get().Resize(ptr, newSize); } - void GarbageCollect() override + static void GarbageCollect() { AZ::AllocatorInstance::Get().GarbageCollect(); } - typename TAllocator::size_type NumAllocatedBytes() const override + static size_t NumAllocatedBytes() { return AZ::AllocatorInstance::Get().NumAllocatedBytes() + AZ::AllocatorInstance::Get().GetUnAllocatedMemory(); } }; -} -namespace AZ -{ - AZ_TYPE_INFO_TEMPLATE(Benchmark::TestAllocator, "{ACE2D6E5-4EB8-4DD2-AE95-6BDFD0476801}", AZ_TYPE_INFO_CLASS); -} - -namespace Benchmark -{ - class TestRawMallocAllocator {}; - - template <> - class TestAllocator - : public TestRawMallocAllocator + /// + /// Basic allocator used as a baseline. This allocator is the most basic allocation possible with the OS (AZ_OS_MALLOC). + /// MallocSchema cannot be used here because it has extra logic that we don't want to use as a baseline. + /// + class TestRawMallocAllocator + : public AZ::AllocatorBase + , public AZ::IAllocatorAllocate { public: + AZ_TYPE_INFO(TestMallocSchemaAllocator, "{08EB400A-D723-46C6-808E-D0844C8DE206}"); + struct Descriptor {}; - TestAllocator() - {} - - static void SetUp() + TestRawMallocAllocator() + : AllocatorBase(this, "TestRawMallocAllocator", "") { - s_numAllocatedBytes = 0; + m_numAllocatedBytes = 0; } - static void TearDown() - {} - - void* Allocate( - size_t byteSize, - size_t alignment, - int = 0, - const char* = nullptr, - const char* = nullptr, - int = 0, - unsigned int = 0) + bool Create(const Descriptor&) { - s_numAllocatedBytes += byteSize; + m_numAllocatedBytes = 0; + return true; + } + + // IAllocator + void Destroy() override + { + m_numAllocatedBytes = 0; + } + AZ::AllocatorDebugConfig GetDebugConfig() override + { + return AZ::AllocatorDebugConfig(); + } + AZ::IAllocatorAllocate* GetSchema() override + { + return nullptr; + } + + // IAllocatorAllocate + void* Allocate(size_t byteSize, size_t alignment, int = 0, const char* = 0, const char* = 0, int = 0, unsigned int = 0) override + { + m_numAllocatedBytes += byteSize; if (alignment) { return AZ_OS_MALLOC(byteSize, alignment); @@ -152,18 +144,18 @@ namespace Benchmark } } - static void DeAllocate(void* ptr, size_t = 0) + void DeAllocate(void* ptr, size_t = 0, size_type = 0) override { - s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + m_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); } - static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) + void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) override { - s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + m_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); - s_numAllocatedBytes += newSize; + m_numAllocatedBytes += newSize; if (newAlignment) { return AZ_OS_MALLOC(newSize, newAlignment); @@ -174,7 +166,7 @@ namespace Benchmark } } - static size_t Resize(void* ptr, size_t newSize) + size_t Resize(void* ptr, size_t newSize) override { AZ_UNUSED(ptr); AZ_UNUSED(newSize); @@ -182,20 +174,45 @@ namespace Benchmark return 0; } - static void GarbageCollect() - {} - - static size_t NumAllocatedBytes() + size_t AllocationSize(void* ptr) override { - return s_numAllocatedBytes; + return Platform::GetMemorySize(ptr); + } + + void GarbageCollect() override {} + + size_t NumAllocatedBytes() const override + { + return m_numAllocatedBytes; + } + + size_t Capacity() const override + { + return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused + } + + size_t GetMaxAllocationSize() const override + { + return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused + } + + size_t GetMaxContiguousAllocationSize() const override + { + return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused + } + size_t GetUnAllocatedMemory(bool = false) const override + { + return 0; // unused + } + IAllocatorAllocate* GetSubAllocator() override + { + return nullptr; // unused } private: - static size_t s_numAllocatedBytes; + size_t m_numAllocatedBytes; }; - size_t TestAllocator::s_numAllocatedBytes = 0; - // Here we require to implement this to be able to configure a name for the allocator, otherswise the AllocatorManager crashes when trying to configure the overrides class TestMallocSchemaAllocator : public AZ::SimpleSchemaAllocator { @@ -236,19 +253,7 @@ namespace Benchmark : AZ::SystemAllocator() {} }; -} -namespace AZ -{ - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{1065B446-4873-4B3E-9CB1-069E148D4DF6}"); - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{92CFDF86-02EE-4247-9809-884EE9F7BA18}"); - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{67DA01DF-9232-493A-B11C-6952FEDEB2A9}"); - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{47384CB4-6729-43A9-B0CE-402E3A7AEFB2}"); - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{096423BC-DC36-48D2-8E89-8F1D600F488A}"); -} - -namespace Benchmark -{ // Allocated bytes reported by the allocator / actually requested bytes static const char* s_counterAllocatorMemoryRatio = "Allocator_MemoryRatio"; @@ -277,7 +282,7 @@ namespace Benchmark : public ::benchmark::Fixture { protected: - using TestAllocatorType = TestAllocator; + using TestAllocatorType = TestAllocatorWrapper; virtual void internalSetUp(const ::benchmark::State&) { @@ -333,8 +338,6 @@ namespace Benchmark public: void Benchmark(benchmark::State& state) { - TestAllocatorType allocatorType; - for (auto _ : state) { const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); @@ -347,12 +350,12 @@ namespace Benchmark const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; state.ResumeTiming(); - m_allocations[allocationIndex] = allocatorType.Allocate(allocationSize, 0); + m_allocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); } state.PauseTiming(); state.counters[s_counterAllocatorMemoryRatio] = - benchmark::Counter(static_cast(allocatorType.NumAllocatedBytes()), benchmark::Counter::kDefaults); + benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); @@ -361,10 +364,10 @@ namespace Benchmark { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - allocatorType.DeAllocate(m_allocations[allocationIndex], allocationSize); + TestAllocatorType::DeAllocate(m_allocations[allocationIndex], allocationSize); m_allocations[allocationIndex] = nullptr; } - allocatorType.GarbageCollect(); + TestAllocatorType::GarbageCollect(); state.SetItemsProcessed(numberOfAllocations); state.ResumeTiming(); @@ -398,8 +401,6 @@ namespace Benchmark public: void Benchmark(benchmark::State& state) { - TestAllocatorType allocatorType; - for (auto _ : state) { state.PauseTiming(); @@ -410,7 +411,7 @@ namespace Benchmark { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - m_allocations[allocationIndex] = allocatorType.Allocate(allocationSize, 0); + m_allocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); } for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) @@ -418,20 +419,20 @@ namespace Benchmark const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; state.ResumeTiming(); - allocatorType.DeAllocate(m_allocations[allocationIndex], allocationSize); + TestAllocatorType::DeAllocate(m_allocations[allocationIndex], allocationSize); state.PauseTiming(); m_allocations[allocationIndex] = nullptr; } state.counters[s_counterAllocatorMemoryRatio] = - benchmark::Counter(static_cast(allocatorType.NumAllocatedBytes()), benchmark::Counter::kDefaults); + benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.SetItemsProcessed(numberOfAllocations); - allocatorType.GarbageCollect(); + TestAllocatorType::GarbageCollect(); state.ResumeTiming(); } From 3273b7621d10dc98d54864ef41b59284161f5c0d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 18:37:24 -0800 Subject: [PATCH 009/620] Fixes a recursive loop Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index af87584fc6..f27c92dfb2 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -322,7 +322,7 @@ namespace Benchmark void internalSetUp(const ::benchmark::State& state) override { - AllocatorBenchmarkFixture::SetUp(state); + AllocatorBenchmarkFixture::internalSetUp(state); m_allocations.resize(state.range_x(), nullptr); } @@ -332,7 +332,7 @@ namespace Benchmark m_allocations.clear(); m_allocations.shrink_to_fit(); - AllocatorBenchmarkFixture::TearDown(state); + AllocatorBenchmarkFixture::internalTearDown(state); } public: @@ -386,7 +386,7 @@ namespace Benchmark void internalSetUp(const ::benchmark::State& state) override { - AllocatorBenchmarkFixture::SetUp(state); + AllocatorBenchmarkFixture::internalSetUp(state); m_allocations.resize(state.range_x(), nullptr); } @@ -396,7 +396,7 @@ namespace Benchmark m_allocations.clear(); m_allocations.shrink_to_fit(); - AllocatorBenchmarkFixture::TearDown(state); + AllocatorBenchmarkFixture::internalTearDown(state); } public: void Benchmark(benchmark::State& state) From 160235e86f940a63dd7a06ccb12af39622a0eff8 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 29 Nov 2021 09:03:14 -0800 Subject: [PATCH 010/620] Removing commented code of different options for getting memory usage of a process Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Memory/AllocatorBenchmarks_Windows.cpp | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp index 9f4efd7a2c..c8532687e8 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp @@ -20,41 +20,7 @@ namespace Benchmark { EmptyWorkingSet(GetCurrentProcess()); - //PROCESS_MEMORY_COUNTERS_EX pmc; - //GetProcessMemoryInfo(GetCurrentProcess(), (PPROCESS_MEMORY_COUNTERS)&pmc, sizeof(pmc)); - //return pmc.PrivateUsage; - //return pmc.WorkingSetSize; - - //size_t memoryUsage = 0; - //HANDLE defaultProcessHeap = GetProcessHeap(); - //PROCESS_HEAP_ENTRY heapEntry; - //if (HeapLock(defaultProcessHeap) == FALSE) - //{ - // AZ_Error("Benchmark", false, "Could not lock process' heap, error: %d", GetLastError()); - // return memoryUsage; - //} - - //heapEntry.lpData = NULL; - //while (HeapWalk(defaultProcessHeap, &heapEntry) != FALSE) - //{ - // memoryUsage += heapEntry.cbData; - //} - - //DWORD lastError = GetLastError(); - //if (lastError != ERROR_NO_MORE_ITEMS) - //{ - // AZ_Error("Benchmark", false, "HeapWalk failed with LastError %d", lastError); - //} - - //if (HeapUnlock(defaultProcessHeap) == FALSE) - //{ - // AZ_Error("Benchmark", false, "Failed to unlock heap with LastError %d", GetLastError()); - //} - - //return memoryUsage; - size_t memoryUsage = 0; - MEMORY_BASIC_INFORMATION mbi = { 0 }; unsigned char* pEndRegion = NULL; while (sizeof(mbi) == VirtualQuery(pEndRegion, &mbi, sizeof(mbi))) { From febaebc386225a091dc785e72d6bd99a2b3de196 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 13:51:08 -0800 Subject: [PATCH 011/620] PR comment (NULL->nullptr) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp index c8532687e8..e9571a7e5b 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp @@ -22,7 +22,7 @@ namespace Benchmark size_t memoryUsage = 0; MEMORY_BASIC_INFORMATION mbi = { 0 }; - unsigned char* pEndRegion = NULL; + unsigned char* pEndRegion = nullptr; while (sizeof(mbi) == VirtualQuery(pEndRegion, &mbi, sizeof(mbi))) { pEndRegion += mbi.RegionSize; if ((mbi.AllocationProtect & PAGE_READWRITE) && (mbi.State & MEM_COMMIT)) { From 215cb9b52ffd0ee1f40325421f93d977754ed2ff Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 16:06:26 -0800 Subject: [PATCH 012/620] Adds mulit-threaded tests Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 82 +++++++++++-------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index f27c92dfb2..7cd7e7ce0a 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -284,14 +284,34 @@ namespace Benchmark protected: using TestAllocatorType = TestAllocatorWrapper; - virtual void internalSetUp(const ::benchmark::State&) + virtual void internalSetUp(const ::benchmark::State& state) { - TestAllocatorType::SetUp(); + if (state.thread_index == 0) // Only setup in the first thread + { + TestAllocatorType::SetUp(); + + m_allocations.resize(state.threads); + for (auto& perThreadAllocations : m_allocations) + { + perThreadAllocations.resize(state.range_x(), nullptr); + } + } } - virtual void internalTearDown(const ::benchmark::State&) + virtual void internalTearDown(const ::benchmark::State& state) { - TestAllocatorType::TearDown(); + if (state.thread_index == 0) // Only setup in the first thread + { + m_allocations.clear(); + m_allocations.shrink_to_fit(); + + TestAllocatorType::TearDown(); + } + } + + AZStd::vector& GetPerThreadAllocations(size_t threadIndex) + { + return m_allocations[threadIndex]; } public: @@ -312,26 +332,25 @@ namespace Benchmark { internalTearDown(state); } + + private: + AZStd::vector> m_allocations; }; template class AllocationBenchmarkFixture : public AllocatorBenchmarkFixture { - using TestAllocatorType = AllocatorBenchmarkFixture::TestAllocatorType; + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { AllocatorBenchmarkFixture::internalSetUp(state); - - m_allocations.resize(state.range_x(), nullptr); } void internalTearDown(const ::benchmark::State& state) override { - m_allocations.clear(); - m_allocations.shrink_to_fit(); - AllocatorBenchmarkFixture::internalTearDown(state); } @@ -340,17 +359,19 @@ namespace Benchmark { for (auto _ : state) { + state.PauseTiming(); const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); - const size_t numberOfAllocations = m_allocations.size(); + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); + const size_t numberOfAllocations = perThreadAllocations.size(); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { - state.PauseTiming(); const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; state.ResumeTiming(); - m_allocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + state.PauseTiming(); } state.PauseTiming(); @@ -364,8 +385,8 @@ namespace Benchmark { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - TestAllocatorType::DeAllocate(m_allocations[allocationIndex], allocationSize); - m_allocations[allocationIndex] = nullptr; + TestAllocatorType::DeAllocate(perThreadAllocations[allocationIndex], allocationSize); + perThreadAllocations[allocationIndex] = nullptr; } TestAllocatorType::GarbageCollect(); @@ -373,29 +394,22 @@ namespace Benchmark state.ResumeTiming(); } } - - private: - AZStd::vector m_allocations; }; template class DeAllocationBenchmarkFixture : public AllocatorBenchmarkFixture { - using TestAllocatorType = AllocatorBenchmarkFixture::TestAllocatorType; + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { AllocatorBenchmarkFixture::internalSetUp(state); - - m_allocations.resize(state.range_x(), nullptr); } void internalTearDown(const ::benchmark::State& state) override { - m_allocations.clear(); - m_allocations.shrink_to_fit(); - AllocatorBenchmarkFixture::internalTearDown(state); } public: @@ -404,14 +418,15 @@ namespace Benchmark for (auto _ : state) { state.PauseTiming(); + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); - const size_t numberOfAllocations = m_allocations.size(); + const size_t numberOfAllocations = perThreadAllocations.size(); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - m_allocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); } for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) @@ -419,9 +434,9 @@ namespace Benchmark const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; state.ResumeTiming(); - TestAllocatorType::DeAllocate(m_allocations[allocationIndex], allocationSize); + TestAllocatorType::DeAllocate(perThreadAllocations[allocationIndex], allocationSize); state.PauseTiming(); - m_allocations[allocationIndex] = nullptr; + perThreadAllocations[allocationIndex] = nullptr; } state.counters[s_counterAllocatorMemoryRatio] = @@ -437,9 +452,6 @@ namespace Benchmark state.ResumeTiming(); } } - - private: - AZStd::vector m_allocations; }; static void RunRanges(benchmark::internal::Benchmark* b) @@ -450,14 +462,20 @@ namespace Benchmark } } + // Test under and over-subscription of threads vs the amount of CPUs available + static const unsigned int MaxThreadRange = 2 * AZStd::thread::hardware_concurrency(); + #define BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME, ...) \ BENCHMARK_TEMPLATE_DEFINE_F(FIXTURE, TESTNAME, __VA_ARGS__)(benchmark::State& state) { Benchmark(state); } \ BENCHMARK_REGISTER_F(FIXTURE, TESTNAME) + // We test small/big/mixed allocations in single-threaded environments. For multi-threaded environments, we test mixed since + // the multi threaded fixture will run multiple passes (1, 2, 4, ... until 2*hardware_concurrency) #define BM_REGISTER_SIZE_FIXTURES(FIXTURE, TESTNAME, ALLOCATORTYPE) \ BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_SMALL, ALLOCATORTYPE, SMALL)->Apply(RunRanges); \ BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_BIG, ALLOCATORTYPE, BIG)->Apply(RunRanges); \ - BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(1, MaxThreadRange)->Apply(RunRanges); #define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ namespace TESTNAME \ From f062b563c89e88b1facf32c6660bdca6cfac9057 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 17:30:55 -0800 Subject: [PATCH 013/620] Improving runtime and making the whole duration manageable Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 44 +++++++--- .../AzCore/Tests/Memory/HphaSchema.cpp | 88 ------------------- 2 files changed, 31 insertions(+), 101 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 7cd7e7ce0a..c1fdd4ca32 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -364,21 +364,27 @@ namespace Benchmark AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); const size_t numberOfAllocations = perThreadAllocations.size(); + size_t totalAllocationSize = 0; for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + totalAllocationSize += allocationSize; state.ResumeTiming(); perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); state.PauseTiming(); } - state.PauseTiming(); - state.counters[s_counterAllocatorMemoryRatio] = - benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + // In allocation cases, s_counterAllocatorMemoryRatio is measuring how much over-allocation our allocators + // are doing to keep track of the memory and because of fragmentation/under-use of blocks. A ratio over 1 means + // that we are using more memory than requested. Ideally we would approximate to a ratio of 1. + state.counters[s_counterAllocatorMemoryRatio] = benchmark::Counter( + static_cast(TestAllocatorType::NumAllocatedBytes()) / static_cast(totalAllocationSize), + benchmark::Counter::kDefaults); + // s_counterProcessMemoryRatio is measuring the same ratio but using the OS to measure the used process memory state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( - static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), + static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline) / static_cast(totalAllocationSize), benchmark::Counter::kDefaults); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) @@ -391,7 +397,6 @@ namespace Benchmark TestAllocatorType::GarbageCollect(); state.SetItemsProcessed(numberOfAllocations); - state.ResumeTiming(); } } }; @@ -422,10 +427,12 @@ namespace Benchmark const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); const size_t numberOfAllocations = perThreadAllocations.size(); + size_t totalAllocationSize = 0; for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + totalAllocationSize += allocationSize; perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); } @@ -439,29 +446,40 @@ namespace Benchmark perThreadAllocations[allocationIndex] = nullptr; } - state.counters[s_counterAllocatorMemoryRatio] = - benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + // In deallocation cases, s_counterAllocatorMemoryRatio is measuring how much "left-over" memory our allocators + // have after deallocations happen. This is memory that is not returned to the operative system. A ratio of 1 means + // that no memory was returned to the OS. A ratio over 1 means that we are holding more memory than requested. A ratio + // lower than 1 means that we have returned some memory. + state.counters[s_counterAllocatorMemoryRatio] = benchmark::Counter( + static_cast(TestAllocatorType::NumAllocatedBytes()) / static_cast(totalAllocationSize), + benchmark::Counter::kDefaults); + // s_counterProcessMemoryRatio is measuring the same ratio but using the OS to measure the used process memory state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( - static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), + static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline) / static_cast(totalAllocationSize), benchmark::Counter::kDefaults); state.SetItemsProcessed(numberOfAllocations); TestAllocatorType::GarbageCollect(); - - state.ResumeTiming(); } } }; + // For non-threaded ranges, run 100, 400, 1600 amounts static void RunRanges(benchmark::internal::Benchmark* b) { - for (int i = 0; i < 6; ++i) + for (int i = 0; i < 6; i += 2) { - b->Arg((1 << i) * 1000); + b->Arg((1 << i) * 100); } } + // For threaded ranges, run just 200, multi-threaded will already multiply by thread + static void ThreadedRunRanges(benchmark::internal::Benchmark* b) + { + b->Arg(100); + } + // Test under and over-subscription of threads vs the amount of CPUs available static const unsigned int MaxThreadRange = 2 * AZStd::thread::hardware_concurrency(); @@ -475,7 +493,7 @@ namespace Benchmark BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_SMALL, ALLOCATORTYPE, SMALL)->Apply(RunRanges); \ BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_BIG, ALLOCATORTYPE, BIG)->Apply(RunRanges); \ BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); \ - BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(1, MaxThreadRange)->Apply(RunRanges); + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(2, MaxThreadRange)->Apply(ThreadedRunRanges); #define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ namespace TESTNAME \ diff --git a/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp b/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp index 85dd79931d..08b84416e6 100644 --- a/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp +++ b/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp @@ -10,10 +10,6 @@ #include #include -#if defined(HAVE_BENCHMARK) -#include -#endif // HAVE_BENCHMARK - class HphaSchema_TestAllocator : public AZ::SimpleSchemaAllocator { @@ -112,87 +108,3 @@ namespace UnitTest HphaSchemaTestFixture, ::testing::ValuesIn(s_mixedInstancesParameters)); } - - -#if defined(HAVE_BENCHMARK) -namespace Benchmark -{ - class HphaSchemaBenchmarkFixture - : public ::benchmark::Fixture - { - void internalSetUp() - { - AZ::AllocatorInstance::Create(); - } - - void internalTearDown() - { - AZ::AllocatorInstance::Destroy(); - } - - public: - void SetUp(const benchmark::State&) override - { - internalSetUp(); - } - void SetUp(benchmark::State&) override - { - internalSetUp(); - } - void TearDown(const benchmark::State&) override - { - internalTearDown(); - } - void TearDown(benchmark::State&) override - { - internalTearDown(); - } - - static void BM_Allocations(benchmark::State& state, const AllocationSizeArray& allocationArray) - { - AZStd::vector allocations; - while (state.KeepRunning()) - { - state.PauseTiming(); - const size_t allocationIndex = allocations.size(); - const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - - state.ResumeTiming(); - void* allocation = AZ::AllocatorInstance::Get().Allocate(allocationSize, 0); - - state.PauseTiming(); - allocations.emplace_back(allocation); - - state.ResumeTiming(); - } - - const size_t numberOfAllocations = allocations.size(); - state.SetItemsProcessed(numberOfAllocations); - - for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) - { - AZ::AllocatorInstance::Get().DeAllocate(allocations[allocationIndex], allocationArray[allocationIndex % allocationArray.size()]); - } - AZ::AllocatorInstance::Get().GarbageCollect(); - } - }; - - // Small allocations, these are allocations that are going to end up in buckets in the HphaSchema - BENCHMARK_F(HphaSchemaBenchmarkFixture, SmallAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_smallAllocationSizes); - } - - BENCHMARK_F(HphaSchemaBenchmarkFixture, BigAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_bigAllocationSizes); - } - - BENCHMARK_F(HphaSchemaBenchmarkFixture, MixedAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_mixedAllocationSizes); - } - - -} // Benchmark -#endif // HAVE_BENCHMARK From 0f5cb54a38d32abacc29f1bc23d58d6032384bb6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 18:11:08 -0800 Subject: [PATCH 014/620] Fixes Linux build Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/Tests/Memory/AllocatorBenchmarks.cpp | 10 +++------- .../Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp | 4 ++-- .../Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp | 5 +++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index c1fdd4ca32..dfaefd4c0f 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -248,10 +248,6 @@ namespace Benchmark { public: AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); - - TestSystemAllocator() - : AZ::SystemAllocator() - {} }; // Allocated bytes reported by the allocator / actually requested bytes @@ -293,7 +289,7 @@ namespace Benchmark m_allocations.resize(state.threads); for (auto& perThreadAllocations : m_allocations) { - perThreadAllocations.resize(state.range_x(), nullptr); + perThreadAllocations.resize(state.range(0), nullptr); } } } @@ -342,7 +338,7 @@ namespace Benchmark : public AllocatorBenchmarkFixture { using base = AllocatorBenchmarkFixture; - using TestAllocatorType = base::TestAllocatorType; + using TestAllocatorType = typename base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { @@ -406,7 +402,7 @@ namespace Benchmark : public AllocatorBenchmarkFixture { using base = AllocatorBenchmarkFixture; - using TestAllocatorType = base::TestAllocatorType; + using TestAllocatorType = typename base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp index 49ecefda49..636d5519d8 100644 --- a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include namespace Benchmark { @@ -25,7 +25,7 @@ namespace Benchmark size_t GetMemorySize(void* memory) { - return memory ? _aligned_msize(memory, 1, 0) : 0; + return memory ? malloc_usable_size(memory) : 0; } } } diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp index 374d9f81f7..303b7efbb4 100644 --- a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp @@ -9,7 +9,8 @@ #include #include -#include +#include +#include namespace Benchmark { @@ -24,7 +25,7 @@ namespace Benchmark size_t GetMemorySize(void* memory) { - return memory ? _aligned_msize(memory, 1, 0) : 0; + return memory ? malloc_usable_size(memory) : 0; } } } From fbd2d60fc1cfc91a49331b304abb797524ae0270 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 18:15:22 -0800 Subject: [PATCH 015/620] Fixes for mac Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp index 303b7efbb4..932252985a 100644 --- a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include namespace Benchmark @@ -25,7 +25,7 @@ namespace Benchmark size_t GetMemorySize(void* memory) { - return memory ? malloc_usable_size(memory) : 0; + return memory ? malloc_size(memory) : 0; } } } From 72f338a6897ff952ae0bfc564fc19fae072fbb1c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 2 Dec 2021 11:55:36 -0800 Subject: [PATCH 016/620] Fixes for HeapSchema to get a default block if none is passed Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp | 12 +----------- Code/Framework/AzCore/AzCore/Memory/HeapSchema.h | 14 ++++---------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp index aceafa1b28..1f0fc59a97 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp @@ -115,6 +115,7 @@ namespace AZ m_ownMemoryBlock[i] = false; } + AZ_Assert(m_desc.m_numMemoryBlocks > 0, "At least one memory block is required"); for (int i = 0; i < m_desc.m_numMemoryBlocks; ++i) { if (m_desc.m_memoryBlocks[i] == nullptr) // Allocate memory block if requested! @@ -131,17 +132,6 @@ namespace AZ m_capacity += m_desc.m_memoryBlocksByteSize[i]; } - - if (m_desc.m_numMemoryBlocks == 0) - { - // Create default memory space if we can to serve for default allocations - m_memSpaces[0] = AZDLMalloc::create_mspace(0, m_desc.m_isMultithreadAlloc); - if (m_memSpaces[0]) - { - AZDLMalloc::mspace_az_set_expandable(m_memSpaces[0], true); - m_capacity = Platform::GetHeapCapacity(); - } - } } HeapSchema::~HeapSchema() diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h index f72ae31057..3a7716a127 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h @@ -32,17 +32,11 @@ namespace AZ */ struct Descriptor { - Descriptor() - : m_numMemoryBlocks(0) - , m_isMultithreadAlloc(true) - {} - - static const int m_memoryBlockAlignment = 64 * 1024; static const int m_maxNumBlocks = 5; - int m_numMemoryBlocks; ///< Number of memory blocks to use. - void* m_memoryBlocks[m_maxNumBlocks]; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. - size_t m_memoryBlocksByteSize[m_maxNumBlocks]; ///< Sizes of different memory blocks, if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. - bool m_isMultithreadAlloc; ///< Set to true to enable multi threading safe allocation. + int m_numMemoryBlocks = 1; ///< Number of memory blocks to use. + void* m_memoryBlocks[m_maxNumBlocks] = {}; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. + size_t m_memoryBlocksByteSize[m_maxNumBlocks] = {4 * 1024}; ///< Sizes of different memory blocks, if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. + bool m_isMultithreadAlloc = true; ///< Set to true to enable multi threading safe allocation. }; HeapSchema(const Descriptor& desc); From cf9aab991104d0b59697b4826d25024add70f752 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 6 Dec 2021 18:34:52 -0800 Subject: [PATCH 017/620] Adds recording functionality (disabled) and a benchmark that can run recordings Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 81 +++++ .../Tests/Memory/AllocatorBenchmarks.cpp | 344 ++++++++++++------ 2 files changed, 309 insertions(+), 116 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index e450f12bcf..40ddff0fc3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -12,6 +12,49 @@ using namespace AZ; +#define RECORDING_ENABLED 0 + +#if RECORDING_ENABLED + +struct AllocatorOperation +{ + enum OperationType : unsigned int + { + ALLOCATE, + DEALLOCATE, + REALLOCATE, + RESIZE + }; + OperationType m_operationType : 2; + size_t m_size : 46; + size_t m_alignment : 16; + void* m_ptr; + void* m_newptr; // required for resize +}; +static constexpr size_t s_allocationOperationCount = 5 * 1024; +static AZStd::array s_operations = {}; +static uint64_t s_operationCounter = 0; +static AZStd::mutex s_operationsMutex; + +AllocatorOperation& GetNextAllocatorOperation() +{ + AZStd::scoped_lock lock(s_operationsMutex); + if (s_operationCounter == s_allocationOperationCount) + { + FILE* file = nullptr; + fopen_s(&file, "memoryrecordings.bin", "ab"); + if (file) + { + fwrite(&s_operations, sizeof(AllocatorOperation), s_allocationOperationCount, file); + fclose(file); + } + s_operationCounter = 0; + } + return s_operations[s_operationCounter++]; +} + +#endif + AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) : IAllocator(allocationSource), m_name(name), @@ -136,6 +179,16 @@ void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignme EBUS_EVENT(AZ::Debug::MemoryDrillerBus, RegisterAllocation, this, ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord); #endif } + +#if RECORDING_ENABLED + { + AllocatorOperation& op = GetNextAllocatorOperation(); + op.m_operationType = AllocatorOperation::ALLOCATE; + op.m_size = byteSize; + op.m_alignment = alignment; + op.m_ptr = ptr; + } +#endif } void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) @@ -148,6 +201,15 @@ void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t align EBUS_EVENT(AZ::Debug::MemoryDrillerBus, UnregisterAllocation, this, ptr, byteSize, alignment, info); #endif } +#if RECORDING_ENABLED + { + AllocatorOperation& op = GetNextAllocatorOperation(); + op.m_operationType = AllocatorOperation::DEALLOCATE; + op.m_size = byteSize; + op.m_alignment = alignment; + op.m_ptr = ptr; + } +#endif } void AllocatorBase::ProfileReallocationBegin(void* ptr, size_t newSize) @@ -174,6 +236,16 @@ void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSi EBUS_EVENT(AZ::Debug::MemoryDrillerBus, ReallocateAllocation, this, ptr, newPtr, newSize, newAlignment); #endif } +#if RECORDING_ENABLED + { + AllocatorOperation& op = GetNextAllocatorOperation(); + op.m_operationType = AllocatorOperation::REALLOCATE; + op.m_size = newSize; + op.m_alignment = newAlignment; + op.m_ptr = ptr; + op.m_newptr = newPtr; + } +#endif } void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) @@ -187,6 +259,15 @@ void AllocatorBase::ProfileResize(void* ptr, size_t newSize) { EBUS_EVENT(AZ::Debug::MemoryDrillerBus, ResizeAllocation, this, ptr, newSize); } +#if RECORDING_ENABLED + { + AllocatorOperation& op = GetNextAllocatorOperation(); + op.m_operationType = AllocatorOperation::RESIZE; + op.m_size = newSize; + op.m_alignment = 0; + op.m_ptr = ptr; + } +#endif } bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index dfaefd4c0f..76c3316009 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -32,7 +32,7 @@ namespace Benchmark size_t GetMemorySize(void* memory); } - static AZ::Debug::DrillerManager* s_drillerManager = nullptr; + //static AZ::Debug::DrillerManager* s_drillerManager = nullptr; /// /// Test allocator wrapper that redirects the calls to the passed TAllocator by using AZ::AllocatorInstance. @@ -47,14 +47,14 @@ namespace Benchmark { AZ::AllocatorInstance::Create(); - s_drillerManager = AZ::Debug::DrillerManager::Create(); - s_drillerManager->Register(aznew AZ::Debug::MemoryDriller); + /*s_drillerManager = AZ::Debug::DrillerManager::Create(); + s_drillerManager->Register(aznew AZ::Debug::MemoryDriller);*/ } static void TearDown() { - AZ::Debug::DrillerManager::Destroy(s_drillerManager); - s_drillerManager = nullptr; + /*AZ::Debug::DrillerManager::Destroy(s_drillerManager); + s_drillerManager = nullptr;*/ AZ::AllocatorInstance::Destroy(); } @@ -89,51 +89,41 @@ namespace Benchmark return AZ::AllocatorInstance::Get().NumAllocatedBytes() + AZ::AllocatorInstance::Get().GetUnAllocatedMemory(); } + + static size_t GetSize(void* ptr) + { + return AZ::AllocatorInstance::Get().AllocationSize(ptr); + } }; /// /// Basic allocator used as a baseline. This allocator is the most basic allocation possible with the OS (AZ_OS_MALLOC). /// MallocSchema cannot be used here because it has extra logic that we don't want to use as a baseline. /// - class TestRawMallocAllocator - : public AZ::AllocatorBase - , public AZ::IAllocatorAllocate + class TestRawMallocAllocator {}; + + template<> + class TestAllocatorWrapper { public: - AZ_TYPE_INFO(TestMallocSchemaAllocator, "{08EB400A-D723-46C6-808E-D0844C8DE206}"); - - struct Descriptor {}; - - TestRawMallocAllocator() - : AllocatorBase(this, "TestRawMallocAllocator", "") + TestAllocatorWrapper() { - m_numAllocatedBytes = 0; + s_numAllocatedBytes = 0; } - bool Create(const Descriptor&) + static void SetUp() { - m_numAllocatedBytes = 0; - return true; + s_numAllocatedBytes = 0; } - // IAllocator - void Destroy() override + static void TearDown() { - m_numAllocatedBytes = 0; - } - AZ::AllocatorDebugConfig GetDebugConfig() override - { - return AZ::AllocatorDebugConfig(); - } - AZ::IAllocatorAllocate* GetSchema() override - { - return nullptr; } // IAllocatorAllocate - void* Allocate(size_t byteSize, size_t alignment, int = 0, const char* = 0, const char* = 0, int = 0, unsigned int = 0) override + static void* Allocate(size_t byteSize, size_t alignment) { - m_numAllocatedBytes += byteSize; + s_numAllocatedBytes += byteSize; if (alignment) { return AZ_OS_MALLOC(byteSize, alignment); @@ -144,18 +134,18 @@ namespace Benchmark } } - void DeAllocate(void* ptr, size_t = 0, size_type = 0) override + static void DeAllocate(void* ptr, size_t = 0) { - m_numAllocatedBytes -= Platform::GetMemorySize(ptr); + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); } - void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) override + static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) { - m_numAllocatedBytes -= Platform::GetMemorySize(ptr); + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); - m_numAllocatedBytes += newSize; + s_numAllocatedBytes += newSize; if (newAlignment) { return AZ_OS_MALLOC(newSize, newAlignment); @@ -166,7 +156,7 @@ namespace Benchmark } } - size_t Resize(void* ptr, size_t newSize) override + static size_t Resize(void* ptr, size_t newSize) { AZ_UNUSED(ptr); AZ_UNUSED(newSize); @@ -174,45 +164,24 @@ namespace Benchmark return 0; } - size_t AllocationSize(void* ptr) override + static void GarbageCollect() {} + + static size_t NumAllocatedBytes() + { + return s_numAllocatedBytes; + } + + static size_t GetSize(void* ptr) { return Platform::GetMemorySize(ptr); } - void GarbageCollect() override {} - - size_t NumAllocatedBytes() const override - { - return m_numAllocatedBytes; - } - - size_t Capacity() const override - { - return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused - } - - size_t GetMaxAllocationSize() const override - { - return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused - } - - size_t GetMaxContiguousAllocationSize() const override - { - return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused - } - size_t GetUnAllocatedMemory(bool = false) const override - { - return 0; // unused - } - IAllocatorAllocate* GetSubAllocator() override - { - return nullptr; // unused - } - private: - size_t m_numAllocatedBytes; + static size_t s_numAllocatedBytes; }; + size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; + // Here we require to implement this to be able to configure a name for the allocator, otherswise the AllocatorManager crashes when trying to configure the overrides class TestMallocSchemaAllocator : public AZ::SimpleSchemaAllocator { @@ -250,11 +219,14 @@ namespace Benchmark AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); }; - // Allocated bytes reported by the allocator / actually requested bytes - static const char* s_counterAllocatorMemoryRatio = "Allocator_MemoryRatio"; + // Allocated bytes reported by the allocator + static const char* s_counterAllocatorMemory = "Allocator_Memory"; - // Allocated bytes reported by the process / actually requested bytes - static const char* s_counterProcessMemoryRatio = "Process_MemoryRatio"; + // Allocated bytes reported by the process + static const char* s_counterProcessMemory = "Process_Memory"; + + // Allocated bytes as counted by the benchmark + static const char* s_counterBenchmarkMemory = "Benchmark_Memory"; enum AllocationSize { @@ -340,16 +312,6 @@ namespace Benchmark using base = AllocatorBenchmarkFixture; using TestAllocatorType = typename base::TestAllocatorType; - void internalSetUp(const ::benchmark::State& state) override - { - AllocatorBenchmarkFixture::internalSetUp(state); - } - - void internalTearDown(const ::benchmark::State& state) override - { - AllocatorBenchmarkFixture::internalTearDown(state); - } - public: void Benchmark(benchmark::State& state) { @@ -372,16 +334,9 @@ namespace Benchmark state.PauseTiming(); } - // In allocation cases, s_counterAllocatorMemoryRatio is measuring how much over-allocation our allocators - // are doing to keep track of the memory and because of fragmentation/under-use of blocks. A ratio over 1 means - // that we are using more memory than requested. Ideally we would approximate to a ratio of 1. - state.counters[s_counterAllocatorMemoryRatio] = benchmark::Counter( - static_cast(TestAllocatorType::NumAllocatedBytes()) / static_cast(totalAllocationSize), - benchmark::Counter::kDefaults); - // s_counterProcessMemoryRatio is measuring the same ratio but using the OS to measure the used process memory - state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( - static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline) / static_cast(totalAllocationSize), - benchmark::Counter::kDefaults); + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { @@ -404,15 +359,6 @@ namespace Benchmark using base = AllocatorBenchmarkFixture; using TestAllocatorType = typename base::TestAllocatorType; - void internalSetUp(const ::benchmark::State& state) override - { - AllocatorBenchmarkFixture::internalSetUp(state); - } - - void internalTearDown(const ::benchmark::State& state) override - { - AllocatorBenchmarkFixture::internalTearDown(state); - } public: void Benchmark(benchmark::State& state) { @@ -442,17 +388,9 @@ namespace Benchmark perThreadAllocations[allocationIndex] = nullptr; } - // In deallocation cases, s_counterAllocatorMemoryRatio is measuring how much "left-over" memory our allocators - // have after deallocations happen. This is memory that is not returned to the operative system. A ratio of 1 means - // that no memory was returned to the OS. A ratio over 1 means that we are holding more memory than requested. A ratio - // lower than 1 means that we have returned some memory. - state.counters[s_counterAllocatorMemoryRatio] = benchmark::Counter( - static_cast(TestAllocatorType::NumAllocatedBytes()) / static_cast(totalAllocationSize), - benchmark::Counter::kDefaults); - // s_counterProcessMemoryRatio is measuring the same ratio but using the OS to measure the used process memory - state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( - static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline) / static_cast(totalAllocationSize), - benchmark::Counter::kDefaults); + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); state.SetItemsProcessed(numberOfAllocations); @@ -460,6 +398,175 @@ namespace Benchmark } } }; + + template + class RecordedAllocationBenchmarkFixture : public AllocatorBenchmarkFixture + { + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = typename base::TestAllocatorType; + + struct AllocatorOperation + { + enum OperationType : unsigned int + { + ALLOCATE, + DEALLOCATE, + REALLOCATE, + RESIZE + }; + OperationType m_operationType : 2; + size_t m_size : 46; + size_t m_alignment : 16; + void* m_ptr; + void* m_newptr; // required for resize + }; + + public: + void Benchmark(benchmark::State& state) + { + for (auto _ : state) + { + state.PauseTiming(); + + AZStd::unordered_map pointerRemapping; + AZStd::unordered_map allocationSize; + constexpr size_t allocationOperationCount = 5 * 1024; + AZStd::array m_operations = {}; + + FILE* file = nullptr; + fopen_s(&file, "memoryrecordings.bin", "rb"); + if (!file) + { + return; + } + size_t elementsRead = fread(&m_operations, sizeof(AllocatorOperation), allocationOperationCount, file); + size_t totalElementsRead = elementsRead; + const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); + size_t totalAllocationSize = 0; + + while (elementsRead > 0) + { + for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) + { + const AllocatorOperation& operation = m_operations[operationIndex]; + switch (operation.m_operationType) + { + case AllocatorOperation::ALLOCATE: + { + if (operation.m_ptr) + { + const auto it = pointerRemapping.emplace(operation.m_ptr, nullptr); + if (it.second) // otherwise already allocated + { + state.ResumeTiming(); + void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = ptr; + allocationSize[ptr] = operation.m_size; + } + else + { + //AZ_Warning("RecordedAllocationBenchmarkFixture", false, "Allocation on %p was already made", operation.m_ptr); + } + } + break; + } + case AllocatorOperation::DEALLOCATE: + { + if (operation.m_ptr) // some deallocate(nullptr) are recorded + { + const auto ptrIt = pointerRemapping.find(operation.m_ptr); + if (ptrIt != pointerRemapping.end()) + { + totalAllocationSize -= allocationSize[ptrIt->second]; + state.ResumeTiming(); + TestAllocatorType::DeAllocate(ptrIt->second, /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it + state.PauseTiming(); + pointerRemapping.erase(ptrIt); + } + } + else + { + // Just to account of the call of deallocate(nullptr); + // totalAllocationSize -= 0; // No real deallocation happened + state.ResumeTiming(); + TestAllocatorType::DeAllocate(operation.m_ptr, /*operation.m_size*/ 0); + state.PauseTiming(); + } + break; + } + case AllocatorOperation::REALLOCATE: + { + void* ptr = nullptr; + if (operation.m_ptr) + { + AZ_Assert(operation.m_newptr, "Need to consider other cases?"); + const auto ptrIt = pointerRemapping.find(operation.m_ptr); + AZ_Assert(ptrIt != pointerRemapping.end(), "Missing allocation for reallocation"); // In case the recording didnt catch something + ptr = ptrIt->second; + pointerRemapping.erase(ptrIt); + } + AZ_Assert(operation.m_newptr != nullptr, "Reallocation failed in the game"); + const auto it = pointerRemapping.emplace(operation.m_newptr, nullptr); + if (it.second) + { + totalAllocationSize -= allocationSize[ptr]; + state.ResumeTiming(); + void* newPtr = TestAllocatorType::ReAllocate(ptr, operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = newPtr; + allocationSize[newPtr] = operation.m_size; + } + else + { + totalAllocationSize -= allocationSize[ptr]; + state.ResumeTiming(); + TestAllocatorType::DeAllocate(ptr); + state.PauseTiming(); + } + break; + } + case AllocatorOperation::RESIZE: + { + const auto ptrIt = pointerRemapping.find(operation.m_ptr); + AZ_Assert(ptrIt != pointerRemapping.end(), "Missing allocation for resize"); // In case the recording didnt catch something + totalAllocationSize -= allocationSize[ptrIt->second]; + state.ResumeTiming(); + TestAllocatorType::Resize(ptrIt->second, operation.m_size); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + if (operation.m_size == 0) + { + pointerRemapping.erase(ptrIt); + } + break; + } + } + } + + elementsRead = fread(&m_operations, sizeof(AllocatorOperation), allocationOperationCount, file); + totalElementsRead += elementsRead; + } + fclose(file); + + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); + + state.SetItemsProcessed(totalElementsRead); + + // Deallocate the remainder (since we stopped the recording middle-game)(there are leaks as well) + for (const auto& pointerMapping : pointerRemapping) + { + TestAllocatorType::DeAllocate(pointerMapping.second); + } + pointerRemapping.clear(); + TestAllocatorType::GarbageCollect(); + } + } + }; // For non-threaded ranges, run 100, 400, 1600 amounts static void RunRanges(benchmark::internal::Benchmark* b) @@ -469,6 +576,10 @@ namespace Benchmark b->Arg((1 << i) * 100); } } + static void RecordedRunRanges(benchmark::internal::Benchmark* b) + { + b->Arg(1); + } // For threaded ranges, run just 200, multi-threaded will already multiply by thread static void ThreadedRunRanges(benchmark::internal::Benchmark* b) @@ -494,16 +605,17 @@ namespace Benchmark #define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ namespace TESTNAME \ { \ - BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE) \ - BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE) \ + BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ + BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ + BM_REGISTER_TEMPLATE(RecordedAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE)->Apply(RecordedRunRanges); \ } BM_REGISTER_ALLOCATOR(RawMallocAllocator, TestRawMallocAllocator); BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, TestMallocSchemaAllocator); - BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, TestHphaSchemaAllocator); BM_REGISTER_ALLOCATOR(SystemAllocator, TestSystemAllocator); + //BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator //BM_REGISTER_SCHEMA(BestFitExternalMapSchema); // Requires to implement AZ::IAllocatorAllocate //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating From 4b07665496f060459020f3f6c250807f26d0a80f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 6 Dec 2021 18:35:39 -0800 Subject: [PATCH 018/620] Removes Heap allocator from being possible to use as a SystemAllocator since it doesnt allow dynamic allocating (only works with pre-allocated blocks) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/SystemAllocator.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp index 8c84338fd0..9ce681ef2d 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp @@ -19,7 +19,6 @@ #define AZCORE_SYSTEM_ALLOCATOR_HPHA 1 #define AZCORE_SYSTEM_ALLOCATOR_MALLOC 2 -#define AZCORE_SYSTEM_ALLOCATOR_HEAP 3 #if !defined(AZCORE_SYSTEM_ALLOCATOR) // define the default @@ -30,8 +29,6 @@ #include #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC #include -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - #include #else #error "Invalid allocator selected for SystemAllocator" #endif @@ -46,8 +43,6 @@ static bool g_isSystemSchemaUsed = false; static AZStd::aligned_storage::value>::type g_systemSchema; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC static AZStd::aligned_storage::value>::type g_systemSchema; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - static AZStd::aligned_storage::value>::type g_systemSchema; #endif ////////////////////////////////////////////////////////////////////////// @@ -121,11 +116,6 @@ SystemAllocator::Create(const Descriptor& desc) heapDesc.m_systemChunkSize = desc.m_heap.m_systemChunkSize; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC MallocSchema::Descriptor heapDesc; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - HeapSchema::Descriptor heapDesc; - memcpy(heapDesc.m_memoryBlocks, desc.m_heap.m_memoryBlocks, sizeof(heapDesc.m_memoryBlocks)); - memcpy(heapDesc.m_memoryBlocksByteSize, desc.m_heap.m_memoryBlocksByteSize, sizeof(heapDesc.m_memoryBlocksByteSize)); - heapDesc.m_numMemoryBlocks = desc.m_heap.m_numMemoryBlocks; #endif if (&AllocatorInstance::Get() == this) // if we are the system allocator { @@ -135,8 +125,6 @@ SystemAllocator::Create(const Descriptor& desc) m_allocator = new(&g_systemSchema)HphaSchema(heapDesc); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC m_allocator = new(&g_systemSchema)MallocSchema(heapDesc); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = new(&g_systemSchema)HeapSchema(heapDesc); #endif g_isSystemSchemaUsed = true; isReady = true; @@ -150,8 +138,6 @@ SystemAllocator::Create(const Descriptor& desc) m_allocator = azcreate(HphaSchema, (heapDesc), SystemAllocator); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC m_allocator = azcreate(MallocSchema, (heapDesc), SystemAllocator); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = azcreate(HeapSchema, (heapDesc), SystemAllocator); #endif if (m_allocator == nullptr) { @@ -188,8 +174,6 @@ SystemAllocator::Destroy() static_cast(m_allocator)->~HphaSchema(); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC static_cast(m_allocator)->~MallocSchema(); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - static_cast(m_allocator)->~HeapSchema(); #endif g_isSystemSchemaUsed = false; } From f96a466212c1acc526e2a1e41e6849fe854e3a1d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 7 Dec 2021 17:58:49 -0800 Subject: [PATCH 019/620] WIP trying to use SystemAllocator instead of raw reads Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 193 ++++++++++++------ Code/Framework/AzCore/CMakeLists.txt | 5 + .../Memory/AllocatorBenchmarkRecordings.bin | 3 + .../Tests/Memory/AllocatorBenchmarks.cpp | 145 ++++--------- 4 files changed, 181 insertions(+), 165 deletions(-) create mode 100644 Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 7bba1b1d20..32ccd43f9a 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -11,47 +11,142 @@ using namespace AZ; -#define RECORDING_ENABLED 0 +#define RECORDING_ENABLED 1 #if RECORDING_ENABLED -struct AllocatorOperation -{ - enum OperationType : unsigned int - { - ALLOCATE, - DEALLOCATE, - REALLOCATE, - RESIZE - }; - OperationType m_operationType : 2; - size_t m_size : 46; - size_t m_alignment : 16; - void* m_ptr; - void* m_newptr; // required for resize -}; -static constexpr size_t s_allocationOperationCount = 5 * 1024; -static AZStd::array s_operations = {}; -static uint64_t s_operationCounter = 0; -static AZStd::mutex s_operationsMutex; +#include +#include +#include +#include -AllocatorOperation& GetNextAllocatorOperation() +namespace { - AZStd::scoped_lock lock(s_operationsMutex); - if (s_operationCounter == s_allocationOperationCount) + class DebugAllocator { - FILE* file = nullptr; - fopen_s(&file, "memoryrecordings.bin", "ab"); - if (file) + public: + typedef void* pointer_type; + typedef AZStd::size_t size_type; + typedef AZStd::ptrdiff_t difference_type; + typedef AZStd::false_type allow_memory_leaks; ///< Regular allocators should not leak. + + AZ_FORCE_INLINE pointer_type allocate(size_t byteSize, size_t alignment, int = 0) { - fwrite(&s_operations, sizeof(AllocatorOperation), s_allocationOperationCount, file); - fclose(file); + return AZ_OS_MALLOC(byteSize, alignment); } - s_operationCounter = 0; - } - return s_operations[s_operationCounter++]; -} + AZ_FORCE_INLINE size_type resize(pointer_type, size_type) + { + return 0; + } + AZ_FORCE_INLINE void deallocate(pointer_type ptr, size_type, size_type) + { + AZ_OS_FREE(ptr); + } + }; + struct AllocatorOperation + { + enum OperationType : unsigned int + { + ALLOCATE, + DEALLOCATE + }; + OperationType m_type: 1; + unsigned int m_size : 28; // Can represent up to 256Mb requests + unsigned int m_alignment : 7; // Can represent up to 128 alignment + unsigned int m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + }; + static AZStd::mutex s_operationsMutex = {}; + + static constexpr size_t s_maxNumberOfAllocationsToRecord = 16384; + static size_t s_numberOfAllocationsRecorded = 0; + static constexpr size_t s_allocationOperationCount = 5 * 1024; + static AZStd::array s_operations = {}; + static uint64_t s_operationCounter = 0; + + static unsigned int s_nextRecordId = 1; + using AllocatorOperationByAddress = AZStd::map, DebugAllocator>; + static AllocatorOperationByAddress s_allocatorOperationByAddress; + using AvailableRecordIds = AZStd::vector; + AvailableRecordIds s_availableRecordIds; + + void RecordAllocatorOperation(AllocatorOperation::OperationType type, void* ptr, size_t size = 0, size_t alignment = 0) + { + AZStd::scoped_lock lock(s_operationsMutex); + if (s_operationCounter == s_allocationOperationCount) + { + AZ::IO::SystemFile file; + file.Open("memoryrecordings.bin", AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND); + if (file.IsOpen()) + { + file.Write(&s_operations, sizeof(AllocatorOperation) * s_allocationOperationCount); + file.Close(); + } + s_operationCounter = 0; + } + AllocatorOperation& operation = s_operations[s_operationCounter++]; + operation.m_type = type; + if (type == AllocatorOperation::OperationType::ALLOCATE) + { + if (s_numberOfAllocationsRecorded > s_maxNumberOfAllocationsToRecord) + { + // reached limit of allocations, dont record anymore + --s_operationCounter; + return; + } + ++s_numberOfAllocationsRecorded; + operation.m_size = size; + operation.m_alignment = alignment; + unsigned int recordId = 0; + if (!s_availableRecordIds.empty()) + { + recordId = s_availableRecordIds.back(); + s_availableRecordIds.pop_back(); + } + else + { + recordId = s_nextRecordId; + ++s_nextRecordId; + } + operation.m_recordId = recordId; + auto it = s_allocatorOperationByAddress.emplace(ptr, operation); + if (!it.second) + { + // double alloc or resize, leave the current record and return the id + operation = it.first->second; + s_availableRecordIds.emplace_back(recordId); + } + } + else + { + if (ptr == nullptr) + { + // common scenario, just record the operation + operation.m_size = 0; + operation.m_alignment = 0; + operation.m_recordId = 0; // recordId = 0 will flag this case + } + else + { + auto it = s_allocatorOperationByAddress.find(ptr); + if (it != s_allocatorOperationByAddress.end()) + { + operation.m_size = it->second.m_size; + operation.m_alignment = it->second.m_alignment; + operation.m_recordId = it->second.m_recordId; + s_availableRecordIds.push_back(it->second.m_recordId); + s_allocatorOperationByAddress.erase(it); + } + else + { + // just dont record this operation + --s_operationCounter; + } + } + } + + } +} #endif AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) : @@ -188,13 +283,7 @@ void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignme } #if RECORDING_ENABLED - { - AllocatorOperation& op = GetNextAllocatorOperation(); - op.m_operationType = AllocatorOperation::ALLOCATE; - op.m_size = byteSize; - op.m_alignment = alignment; - op.m_ptr = ptr; - } + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, byteSize, alignment); #endif } @@ -209,13 +298,7 @@ void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t align } } #if RECORDING_ENABLED - { - AllocatorOperation& op = GetNextAllocatorOperation(); - op.m_operationType = AllocatorOperation::DEALLOCATE; - op.m_size = byteSize; - op.m_alignment = alignment; - op.m_ptr = ptr; - } + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr, byteSize, alignment); #endif } @@ -232,14 +315,8 @@ void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSi ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); } #if RECORDING_ENABLED - { - AllocatorOperation& op = GetNextAllocatorOperation(); - op.m_operationType = AllocatorOperation::REALLOCATE; - op.m_size = newSize; - op.m_alignment = newAlignment; - op.m_ptr = ptr; - op.m_newptr = newPtr; - } + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr); + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, newPtr, newSize, newAlignment); #endif } @@ -259,13 +336,7 @@ void AllocatorBase::ProfileResize(void* ptr, size_t newSize) } } #if RECORDING_ENABLED - { - AllocatorOperation& op = GetNextAllocatorOperation(); - op.m_operationType = AllocatorOperation::RESIZE; - op.m_size = newSize; - op.m_alignment = 0; - op.m_ptr = ptr; - } + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, newSize); #endif } diff --git a/Code/Framework/AzCore/CMakeLists.txt b/Code/Framework/AzCore/CMakeLists.txt index 96ed838ccc..838142f0df 100644 --- a/Code/Framework/AzCore/CMakeLists.txt +++ b/Code/Framework/AzCore/CMakeLists.txt @@ -146,6 +146,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PROPERTY COMPILE_DEFINITIONS VALUES AZCORETEST_DLL_NAME=\"$\" ) + ly_add_target_files( + TARGETS AzCore.Tests + FILES ${CMAKE_CURRENT_SOURCE_DIR}/Tests/Memory/AllocatorBenchmarkRecordings.bin + OUTPUT_SUBDIRECTORY Tests/AzCore/Memory + ) endif() diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin new file mode 100644 index 0000000000..2b587a2304 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0f148441ce120b303896618cec364b5afb6f8b911b4785ec6358cfe8467cf7a +size 368640 diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 76c3316009..f5a728018c 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -9,9 +9,8 @@ #if defined(HAVE_BENCHMARK) #include +#include #include -#include -#include #include #include #include @@ -21,6 +20,7 @@ #include #include #include +#include #include @@ -32,11 +32,9 @@ namespace Benchmark size_t GetMemorySize(void* memory); } - //static AZ::Debug::DrillerManager* s_drillerManager = nullptr; - /// /// Test allocator wrapper that redirects the calls to the passed TAllocator by using AZ::AllocatorInstance. - /// It also creates/destroys the TAllocator type and connects the driller (to reflect what happens at runtime) + /// It also creates/destroys the TAllocator type (to reflect what happens at runtime) /// /// Allocator type to wrap template @@ -46,16 +44,10 @@ namespace Benchmark static void SetUp() { AZ::AllocatorInstance::Create(); - - /*s_drillerManager = AZ::Debug::DrillerManager::Create(); - s_drillerManager->Register(aznew AZ::Debug::MemoryDriller);*/ } static void TearDown() { - /*AZ::Debug::DrillerManager::Destroy(s_drillerManager); - s_drillerManager = nullptr;*/ - AZ::AllocatorInstance::Destroy(); } @@ -410,15 +402,12 @@ namespace Benchmark enum OperationType : unsigned int { ALLOCATE, - DEALLOCATE, - REALLOCATE, - RESIZE + DEALLOCATE }; - OperationType m_operationType : 2; - size_t m_size : 46; - size_t m_alignment : 16; - void* m_ptr; - void* m_newptr; // required for resize + OperationType m_type : 1; + unsigned int m_size : 28; // Can represent up to 256Mb requests + unsigned int m_alignment : 7; // Can represent up to 128 alignment + unsigned int m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids }; public: @@ -428,18 +417,18 @@ namespace Benchmark { state.PauseTiming(); - AZStd::unordered_map pointerRemapping; - AZStd::unordered_map allocationSize; + AZStd::unordered_map pointerRemapping; constexpr size_t allocationOperationCount = 5 * 1024; AZStd::array m_operations = {}; - FILE* file = nullptr; - fopen_s(&file, "memoryrecordings.bin", "rb"); - if (!file) + AZ::IO::SystemFile file; + AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); + filePath += "/Tests/AzCore/Memory/AllocatorBenchmarkRecordings.bin"; + if (!file.Open(filePath.c_str(), AZ::IO::SystemFile::OpenMode::SF_OPEN_READ_ONLY)) { return; } - size_t elementsRead = fread(&m_operations, sizeof(AllocatorOperation), allocationOperationCount, file); + size_t elementsRead = file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations); size_t totalElementsRead = elementsRead; const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); size_t totalAllocationSize = 0; @@ -449,107 +438,54 @@ namespace Benchmark for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) { const AllocatorOperation& operation = m_operations[operationIndex]; - switch (operation.m_operationType) + if (operation.m_type == AllocatorOperation::ALLOCATE) { - case AllocatorOperation::ALLOCATE: - { - if (operation.m_ptr) + const auto it = pointerRemapping.emplace(operation.m_recordId, nullptr); + if (it.second) // otherwise already allocated { - const auto it = pointerRemapping.emplace(operation.m_ptr, nullptr); - if (it.second) // otherwise already allocated - { - state.ResumeTiming(); - void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); - state.PauseTiming(); - totalAllocationSize += operation.m_size; - it.first->second = ptr; - allocationSize[ptr] = operation.m_size; - } - else - { - //AZ_Warning("RecordedAllocationBenchmarkFixture", false, "Allocation on %p was already made", operation.m_ptr); - } + state.ResumeTiming(); + void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = ptr; } - break; - } - case AllocatorOperation::DEALLOCATE: - { - if (operation.m_ptr) // some deallocate(nullptr) are recorded + else { - const auto ptrIt = pointerRemapping.find(operation.m_ptr); + // Doing a resize, dont account for this memory change, this operation is rare and we dont have + // the size of the previous allocation + state.ResumeTiming(); + TestAllocatorType::Resize(it.first->second, operation.m_size); + state.PauseTiming(); + } + } + else // AllocatorOperation::DEALLOCATE: + { + if (operation.m_recordId) + { + const auto ptrIt = pointerRemapping.find(operation.m_recordId); if (ptrIt != pointerRemapping.end()) { - totalAllocationSize -= allocationSize[ptrIt->second]; + totalAllocationSize -= operation.m_size; state.ResumeTiming(); TestAllocatorType::DeAllocate(ptrIt->second, /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it state.PauseTiming(); pointerRemapping.erase(ptrIt); } } - else + else // deallocate(nullptr) are recorded { // Just to account of the call of deallocate(nullptr); - // totalAllocationSize -= 0; // No real deallocation happened state.ResumeTiming(); - TestAllocatorType::DeAllocate(operation.m_ptr, /*operation.m_size*/ 0); + TestAllocatorType::DeAllocate(nullptr, /*operation.m_size*/ 0); state.PauseTiming(); } - break; - } - case AllocatorOperation::REALLOCATE: - { - void* ptr = nullptr; - if (operation.m_ptr) - { - AZ_Assert(operation.m_newptr, "Need to consider other cases?"); - const auto ptrIt = pointerRemapping.find(operation.m_ptr); - AZ_Assert(ptrIt != pointerRemapping.end(), "Missing allocation for reallocation"); // In case the recording didnt catch something - ptr = ptrIt->second; - pointerRemapping.erase(ptrIt); - } - AZ_Assert(operation.m_newptr != nullptr, "Reallocation failed in the game"); - const auto it = pointerRemapping.emplace(operation.m_newptr, nullptr); - if (it.second) - { - totalAllocationSize -= allocationSize[ptr]; - state.ResumeTiming(); - void* newPtr = TestAllocatorType::ReAllocate(ptr, operation.m_size, operation.m_alignment); - state.PauseTiming(); - totalAllocationSize += operation.m_size; - it.first->second = newPtr; - allocationSize[newPtr] = operation.m_size; - } - else - { - totalAllocationSize -= allocationSize[ptr]; - state.ResumeTiming(); - TestAllocatorType::DeAllocate(ptr); - state.PauseTiming(); - } - break; - } - case AllocatorOperation::RESIZE: - { - const auto ptrIt = pointerRemapping.find(operation.m_ptr); - AZ_Assert(ptrIt != pointerRemapping.end(), "Missing allocation for resize"); // In case the recording didnt catch something - totalAllocationSize -= allocationSize[ptrIt->second]; - state.ResumeTiming(); - TestAllocatorType::Resize(ptrIt->second, operation.m_size); - state.PauseTiming(); - totalAllocationSize += operation.m_size; - if (operation.m_size == 0) - { - pointerRemapping.erase(ptrIt); - } - break; - } } } - elementsRead = fread(&m_operations, sizeof(AllocatorOperation), allocationOperationCount, file); + elementsRead = file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations); totalElementsRead += elementsRead; } - fclose(file); + file.Close(); state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); @@ -579,6 +515,7 @@ namespace Benchmark static void RecordedRunRanges(benchmark::internal::Benchmark* b) { b->Arg(1); + b->Iterations(100); } // For threaded ranges, run just 200, multi-threaded will already multiply by thread From 0d66278ef7c466e6457fc8f5cb99ac020022becd Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 8 Dec 2021 13:44:15 -0800 Subject: [PATCH 020/620] Makes the recorded benchmark more stable Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 23 ++- .../Memory/AllocatorBenchmarkRecordings.bin | 4 +- .../Tests/Memory/AllocatorBenchmarks.cpp | 186 +++++++++++------- 3 files changed, 135 insertions(+), 78 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 32ccd43f9a..48994c4eef 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -11,7 +11,7 @@ using namespace AZ; -#define RECORDING_ENABLED 1 +#define RECORDING_ENABLED 0 #if RECORDING_ENABLED @@ -44,18 +44,22 @@ namespace } }; - struct AllocatorOperation + #pragma pack(push, 1) + struct alignas(1) AllocatorOperation { - enum OperationType : unsigned int + enum OperationType : size_t { ALLOCATE, DEALLOCATE }; OperationType m_type: 1; - unsigned int m_size : 28; // Can represent up to 256Mb requests - unsigned int m_alignment : 7; // Can represent up to 128 alignment - unsigned int m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + size_t m_size : 28; // Can represent up to 256Mb requests + size_t m_alignment : 7; // Can represent up to 128 alignment + size_t m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids }; + #pragma pack(pop) + static_assert(sizeof(AllocatorOperation) == 8); + static AZStd::mutex s_operationsMutex = {}; static constexpr size_t s_maxNumberOfAllocationsToRecord = 16384; @@ -76,7 +80,12 @@ namespace if (s_operationCounter == s_allocationOperationCount) { AZ::IO::SystemFile file; - file.Open("memoryrecordings.bin", AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND); + int mode = AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND | AZ::IO::SystemFile::OpenMode::SF_OPEN_WRITE_ONLY; + if (!file.Exists("memoryrecordings.bin")) + { + mode |= AZ::IO::SystemFile::OpenMode::SF_OPEN_CREATE; + } + file.Open("memoryrecordings.bin", mode); if (file.IsOpen()) { file.Write(&s_operations, sizeof(AllocatorOperation) * s_allocationOperationCount); diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin index 2b587a2304..ec5de82e83 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d0f148441ce120b303896618cec364b5afb6f8b911b4785ec6358cfe8467cf7a -size 368640 +oid sha256:281ba03e79ecba90b313a0b17bdba87c57d76b504b6e38d579b5eabd995902cc +size 245760 diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index f5a728018c..aa1c7f21ab 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -390,115 +390,159 @@ namespace Benchmark } } }; - - template - class RecordedAllocationBenchmarkFixture : public AllocatorBenchmarkFixture - { - using base = AllocatorBenchmarkFixture; - using TestAllocatorType = typename base::TestAllocatorType; - struct AllocatorOperation + template + class RecordedAllocationBenchmarkFixture : public ::benchmark::Fixture + { + using TestAllocatorType = TestAllocatorWrapper; + + virtual void internalSetUp() { - enum OperationType : unsigned int + TestAllocatorType::SetUp(); + } + + void internalTearDown() + { + TestAllocatorType::TearDown(); + } + + #pragma pack(push, 1) + struct alignas(1) AllocatorOperation + { + enum OperationType : size_t { ALLOCATE, DEALLOCATE }; OperationType m_type : 1; - unsigned int m_size : 28; // Can represent up to 256Mb requests - unsigned int m_alignment : 7; // Can represent up to 128 alignment - unsigned int m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + size_t m_size : 28; // Can represent up to 256Mb requests + size_t m_alignment : 7; // Can represent up to 128 alignment + size_t m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids }; + #pragma pack(pop) + static_assert(sizeof(AllocatorOperation) == 8); public: + void SetUp(const ::benchmark::State&) override + { + internalSetUp(); + } + void SetUp(::benchmark::State&) override + { + internalSetUp(); + } + + void TearDown(const ::benchmark::State&) override + { + internalTearDown(); + } + void TearDown(::benchmark::State&) override + { + internalTearDown(); + } + void Benchmark(benchmark::State& state) { for (auto _ : state) { state.PauseTiming(); - AZStd::unordered_map pointerRemapping; + AZStd::unordered_map pointerRemapping; constexpr size_t allocationOperationCount = 5 * 1024; AZStd::array m_operations = {}; + [[maybe_unused]] const size_t operationSize = sizeof(AllocatorOperation); - AZ::IO::SystemFile file; - AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); - filePath += "/Tests/AzCore/Memory/AllocatorBenchmarkRecordings.bin"; - if (!file.Open(filePath.c_str(), AZ::IO::SystemFile::OpenMode::SF_OPEN_READ_ONLY)) - { - return; - } - size_t elementsRead = file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations); - size_t totalElementsRead = elementsRead; const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); size_t totalAllocationSize = 0; + size_t itemsProcessed = 0; - while (elementsRead > 0) + for (size_t i = 0; i < 100; ++i) // replay the recording, this way we can keep a smaller recording { - for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) + AZ::IO::SystemFile file; + AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); + filePath += "/Tests/AzCore/Memory/AllocatorBenchmarkRecordings.bin"; + if (!file.Open(filePath.c_str(), AZ::IO::SystemFile::OpenMode::SF_OPEN_READ_ONLY)) { - const AllocatorOperation& operation = m_operations[operationIndex]; - if (operation.m_type == AllocatorOperation::ALLOCATE) + return; + } + size_t elementsRead = + file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations) / sizeof(AllocatorOperation); + itemsProcessed += elementsRead; + + while (elementsRead > 0) + { + for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) { - const auto it = pointerRemapping.emplace(operation.m_recordId, nullptr); - if (it.second) // otherwise already allocated + const AllocatorOperation& operation = m_operations[operationIndex]; + if (operation.m_type == AllocatorOperation::ALLOCATE) { - state.ResumeTiming(); - void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); - state.PauseTiming(); - totalAllocationSize += operation.m_size; - it.first->second = ptr; - } - else - { - // Doing a resize, dont account for this memory change, this operation is rare and we dont have - // the size of the previous allocation - state.ResumeTiming(); - TestAllocatorType::Resize(it.first->second, operation.m_size); - state.PauseTiming(); - } - } - else // AllocatorOperation::DEALLOCATE: - { - if (operation.m_recordId) - { - const auto ptrIt = pointerRemapping.find(operation.m_recordId); - if (ptrIt != pointerRemapping.end()) + const auto it = pointerRemapping.emplace(operation.m_recordId, nullptr); + if (it.second) // otherwise already allocated { - totalAllocationSize -= operation.m_size; state.ResumeTiming(); - TestAllocatorType::DeAllocate(ptrIt->second, /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it + void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = ptr; + } + else + { + // Doing a resize, dont account for this memory change, this operation is rare and we dont have + // the size of the previous allocation + state.ResumeTiming(); + TestAllocatorType::Resize(it.first->second, operation.m_size); state.PauseTiming(); - pointerRemapping.erase(ptrIt); } } - else // deallocate(nullptr) are recorded + else // AllocatorOperation::DEALLOCATE: { - // Just to account of the call of deallocate(nullptr); - state.ResumeTiming(); - TestAllocatorType::DeAllocate(nullptr, /*operation.m_size*/ 0); - state.PauseTiming(); + if (operation.m_recordId) + { + const auto ptrIt = pointerRemapping.find(operation.m_recordId); + if (ptrIt != pointerRemapping.end()) + { + totalAllocationSize -= operation.m_size; + state.ResumeTiming(); + TestAllocatorType::DeAllocate( + ptrIt->second, + /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it + state.PauseTiming(); + pointerRemapping.erase(ptrIt); + } + } + else // deallocate(nullptr) are recorded + { + // Just to account of the call of deallocate(nullptr); + state.ResumeTiming(); + TestAllocatorType::DeAllocate(nullptr, /*operation.m_size*/ 0); + state.PauseTiming(); + } } } - } - elementsRead = file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations); - totalElementsRead += elementsRead; + elementsRead = + file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations) / sizeof(AllocatorOperation); + itemsProcessed += elementsRead; + } + file.Close(); + + // Deallocate the remainder (since we stopped the recording middle-game)(there are leaks as well) + for (const auto& pointerMapping : pointerRemapping) + { + state.ResumeTiming(); + TestAllocatorType::DeAllocate(pointerMapping.second); + state.PauseTiming(); + } + itemsProcessed += pointerRemapping.size(); + pointerRemapping.clear(); } - file.Close(); state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); - state.SetItemsProcessed(totalElementsRead); + state.SetItemsProcessed(itemsProcessed); - // Deallocate the remainder (since we stopped the recording middle-game)(there are leaks as well) - for (const auto& pointerMapping : pointerRemapping) - { - TestAllocatorType::DeAllocate(pointerMapping.second); - } - pointerRemapping.clear(); TestAllocatorType::GarbageCollect(); } } @@ -514,8 +558,7 @@ namespace Benchmark } static void RecordedRunRanges(benchmark::internal::Benchmark* b) { - b->Arg(1); - b->Iterations(100); + b->Iterations(1); } // For threaded ranges, run just 200, multi-threaded will already multiply by thread @@ -547,6 +590,11 @@ namespace Benchmark BM_REGISTER_TEMPLATE(RecordedAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE)->Apply(RecordedRunRanges); \ } + /// Warm up benchmark used to prepare the OS for allocations. Most OS keep allocations for a process somehow + /// reserved. So the first allocations run always get a bigger impact in a process. This warm up allocator runs + /// all the benchmarks and is just used for the the next allocators to report more consistent results. + BM_REGISTER_ALLOCATOR(WarmUpAllocator, TestRawMallocAllocator); + BM_REGISTER_ALLOCATOR(RawMallocAllocator, TestRawMallocAllocator); BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, TestMallocSchemaAllocator); BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, TestHphaSchemaAllocator); From b96be71c619000a580e964ff51d84c14aa4c2c0f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 8 Dec 2021 19:55:55 -0800 Subject: [PATCH 021/620] More stability changes, improvement on type usage within the benchmark, cleanup of unstable stats Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 93 +++++++------------ 1 file changed, 35 insertions(+), 58 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index aa1c7f21ab..5cf5176308 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -92,10 +92,10 @@ namespace Benchmark /// Basic allocator used as a baseline. This allocator is the most basic allocation possible with the OS (AZ_OS_MALLOC). /// MallocSchema cannot be used here because it has extra logic that we don't want to use as a baseline. /// - class TestRawMallocAllocator {}; + class RawMallocAllocator {}; template<> - class TestAllocatorWrapper + class TestAllocatorWrapper { public: TestAllocatorWrapper() @@ -113,17 +113,11 @@ namespace Benchmark } // IAllocatorAllocate - static void* Allocate(size_t byteSize, size_t alignment) + static void* Allocate(size_t byteSize, size_t) { s_numAllocatedBytes += byteSize; - if (alignment) - { - return AZ_OS_MALLOC(byteSize, alignment); - } - else - { - return AZ_OS_MALLOC(byteSize, 1); - } + // Don't pass an alignment since we wont be able to get the memory size without also passing the alignment + return AZ_OS_MALLOC(byteSize, 1); } static void DeAllocate(void* ptr, size_t = 0) @@ -132,20 +126,13 @@ namespace Benchmark AZ_OS_FREE(ptr); } - static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) + static void* ReAllocate(void* ptr, size_t newSize, size_t) { s_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); s_numAllocatedBytes += newSize; - if (newAlignment) - { - return AZ_OS_MALLOC(newSize, newAlignment); - } - else - { - return AZ_OS_MALLOC(newSize, 1); - } + return AZ_OS_MALLOC(newSize, 1); } static size_t Resize(void* ptr, size_t newSize) @@ -172,51 +159,47 @@ namespace Benchmark static size_t s_numAllocatedBytes; }; - size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; + size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; - // Here we require to implement this to be able to configure a name for the allocator, otherswise the AllocatorManager crashes when trying to configure the overrides - class TestMallocSchemaAllocator : public AZ::SimpleSchemaAllocator + // Some allocator are not fully declared, those we simply setup from the schema + class MallocSchemaAllocator : public AZ::SimpleSchemaAllocator { public: - AZ_TYPE_INFO(TestMallocSchemaAllocator, "{3E68224F-E676-402C-8276-CE4B49C05E89}"); + AZ_TYPE_INFO(MallocSchemaAllocator, "{3E68224F-E676-402C-8276-CE4B49C05E89}"); - TestMallocSchemaAllocator() - : AZ::SimpleSchemaAllocator("TestMallocSchemaAllocator", "") + MallocSchemaAllocator() + : AZ::SimpleSchemaAllocator("MallocSchemaAllocator", "") {} }; - class TestHeapSchemaAllocator : public AZ::SimpleSchemaAllocator + // We use both this HphaSchemaAllocator and the SystemAllocator configured with Hpha because the SystemAllocator + // has extra things + class HphaSchemaAllocator : public AZ::SimpleSchemaAllocator { public: - AZ_TYPE_INFO(TestHeapSchemaAllocator, "{456E6C30-AA84-488F-BE47-5C1E6AF636B7}"); + AZ_TYPE_INFO(HphaSchemaAllocator, "{6563AB4B-A68E-4499-8C98-D61D640D1F7F}"); - TestHeapSchemaAllocator() - : AZ::SimpleSchemaAllocator("TestHeapSchemaAllocator", "") - {} - }; - - class TestHphaSchemaAllocator : public AZ::SimpleSchemaAllocator - { - public: - AZ_TYPE_INFO(TestHphaSchemaAllocator, "{6563AB4B-A68E-4499-8C98-D61D640D1F7F}"); - - TestHphaSchemaAllocator() + HphaSchemaAllocator() : AZ::SimpleSchemaAllocator("TestHphaSchemaAllocator", "") {} }; + // For the SystemAllocator we inherit so we have a different stack. The SystemAllocator is used globally so we dont want + // to get that data affecting the benchmark class TestSystemAllocator : public AZ::SystemAllocator { public: AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); + + TestSystemAllocator() + : AZ::SystemAllocator() + { + } }; // Allocated bytes reported by the allocator static const char* s_counterAllocatorMemory = "Allocator_Memory"; - // Allocated bytes reported by the process - static const char* s_counterProcessMemory = "Process_Memory"; - // Allocated bytes as counted by the benchmark static const char* s_counterBenchmarkMemory = "Benchmark_Memory"; @@ -310,8 +293,7 @@ namespace Benchmark for (auto _ : state) { state.PauseTiming(); - const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); - + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); const size_t numberOfAllocations = perThreadAllocations.size(); size_t totalAllocationSize = 0; @@ -327,7 +309,6 @@ namespace Benchmark } state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); - state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) @@ -358,7 +339,6 @@ namespace Benchmark { state.PauseTiming(); AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); - const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); const size_t numberOfAllocations = perThreadAllocations.size(); size_t totalAllocationSize = 0; @@ -381,7 +361,6 @@ namespace Benchmark } state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); - state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); state.SetItemsProcessed(numberOfAllocations); @@ -452,11 +431,10 @@ namespace Benchmark AZStd::array m_operations = {}; [[maybe_unused]] const size_t operationSize = sizeof(AllocatorOperation); - const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); size_t totalAllocationSize = 0; size_t itemsProcessed = 0; - for (size_t i = 0; i < 100; ++i) // replay the recording, this way we can keep a smaller recording + for (size_t i = 0; i < 100; ++i) // play the recording multiple times to get a good stable sample, this way we can keep a smaller recording { AZ::IO::SystemFile file; AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); @@ -538,7 +516,6 @@ namespace Benchmark } state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); - state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); state.SetItemsProcessed(itemsProcessed); @@ -583,7 +560,7 @@ namespace Benchmark BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(2, MaxThreadRange)->Apply(ThreadedRunRanges); #define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ - namespace TESTNAME \ + namespace BM_##TESTNAME \ { \ BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ @@ -593,15 +570,15 @@ namespace Benchmark /// Warm up benchmark used to prepare the OS for allocations. Most OS keep allocations for a process somehow /// reserved. So the first allocations run always get a bigger impact in a process. This warm up allocator runs /// all the benchmarks and is just used for the the next allocators to report more consistent results. - BM_REGISTER_ALLOCATOR(WarmUpAllocator, TestRawMallocAllocator); + BM_REGISTER_ALLOCATOR(WarmUpAllocator, RawMallocAllocator); - BM_REGISTER_ALLOCATOR(RawMallocAllocator, TestRawMallocAllocator); - BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, TestMallocSchemaAllocator); - BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, TestHphaSchemaAllocator); + BM_REGISTER_ALLOCATOR(RawMallocAllocator, RawMallocAllocator); + BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, MallocSchemaAllocator); + BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, HphaSchemaAllocator); BM_REGISTER_ALLOCATOR(SystemAllocator, TestSystemAllocator); - + + //BM_REGISTER_ALLOCATOR(BestFitExternalMapAllocator, BestFitExternalMapAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator //BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator - //BM_REGISTER_SCHEMA(BestFitExternalMapSchema); // Requires to implement AZ::IAllocatorAllocate //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating #undef BM_REGISTER_ALLOCATOR From 947adc0248d9be1bac2565d1a67d081b0d1677c7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 9 Dec 2021 17:13:09 -0800 Subject: [PATCH 022/620] Removal of OverrideShim, AP seems to be crashing Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/Component/ComponentApplication.cpp | 38 +-- .../AzCore/Component/ComponentApplication.h | 8 +- .../AzCore/AzCore/Compression/Compression.h | 4 +- .../AzCore/AzCore/Compression/compression.cpp | 6 +- .../AzCore/Compression/zstd_compression.cpp | 6 +- .../AzCore/Compression/zstd_compression.h | 5 +- .../AzCore/AzCore/IO/CompressorZStd.h | 2 +- .../AzCore/AzCore/IO/IStreamerTypes.cpp | 2 +- .../AzCore/AzCore/IO/IStreamerTypes.h | 4 +- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 31 +- .../AzCore/AzCore/Memory/AllocatorBase.h | 9 +- .../AzCore/AzCore/Memory/AllocatorManager.cpp | 264 +----------------- .../AzCore/AzCore/Memory/AllocatorManager.h | 21 +- .../AzCore/Memory/AllocatorOverrideShim.cpp | 227 --------------- .../AzCore/Memory/AllocatorOverrideShim.h | 102 ------- .../Memory/BestFitExternalMapAllocator.cpp | 13 +- .../Memory/BestFitExternalMapAllocator.h | 7 +- .../Memory/BestFitExternalMapSchema.cpp | 20 +- .../AzCore/Memory/BestFitExternalMapSchema.h | 25 +- .../AzCore/AzCore/Memory/HeapSchema.cpp | 1 - .../AzCore/AzCore/Memory/HeapSchema.h | 5 +- .../AzCore/AzCore/Memory/HphaSchema.cpp | 2 +- .../AzCore/AzCore/Memory/HphaSchema.h | 5 +- .../AzCore/AzCore/Memory/IAllocator.cpp | 15 +- .../AzCore/AzCore/Memory/IAllocator.h | 65 +---- .../AzCore/AzCore/Memory/MallocSchema.cpp | 31 +- .../AzCore/AzCore/Memory/MallocSchema.h | 20 +- Code/Framework/AzCore/AzCore/Memory/Memory.h | 32 +-- .../AzCore/AzCore/Memory/OSAllocator.cpp | 1 - .../AzCore/AzCore/Memory/OSAllocator.h | 8 +- .../Memory/OverrunDetectionAllocator.cpp | 11 - .../AzCore/Memory/OverrunDetectionAllocator.h | 5 +- .../AzCore/AzCore/Memory/PoolAllocator.h | 2 +- .../AzCore/AzCore/Memory/PoolSchema.cpp | 25 +- .../AzCore/AzCore/Memory/PoolSchema.h | 8 +- .../AzCore/Memory/SimpleSchemaAllocator.h | 25 +- .../AzCore/AzCore/Memory/SystemAllocator.cpp | 40 ++- .../AzCore/AzCore/Memory/SystemAllocator.h | 24 +- .../AzCore/AzCore/Script/ScriptContext.cpp | 6 +- .../AzCore/AzCore/Script/ScriptContext.h | 2 +- .../AzCore/Serialization/AZStdContainers.inl | 4 +- .../AzCore/Serialization/SerializeContext.cpp | 2 +- .../AzCore/Serialization/SerializeContext.h | 18 +- .../Serialization/std/VariantReflection.inl | 4 +- .../AzCore/AzCore/azcore_files.cmake | 2 - Code/Framework/AzCore/Tests/AZStd/Hashed.cpp | 4 +- Code/Framework/AzCore/Tests/AZStd/Ordered.cpp | 4 +- Code/Framework/AzCore/Tests/Memory.cpp | 199 +++++++------ .../Tests/Memory/AllocatorBenchmarks.cpp | 2 +- .../AzCore/Tests/Memory/AllocatorManager.cpp | 85 +----- .../AzFramework/Archive/Archive.cpp | 2 +- .../AzFramework/Archive/IArchive.h | 2 +- .../AzFramework/Archive/ZipDirCache.cpp | 6 +- .../AzFramework/Archive/ZipDirCache.h | 4 +- .../AzFramework/Archive/ZipDirList.cpp | 2 +- .../AzFramework/Archive/ZipDirList.h | 4 +- .../AzFramework/Archive/ZipDirStructures.cpp | 8 +- Code/LauncherUnified/Launcher.h | 2 +- Code/Legacy/CryCommon/CryLegacyAllocator.h | 28 +- .../RHI/Code/Include/Atom/RHI/DrawPacket.h | 4 +- .../Code/Include/Atom/RHI/DrawPacketBuilder.h | 6 +- .../RHI/Code/Source/RHI/DrawPacketBuilder.cpp | 2 +- 62 files changed, 299 insertions(+), 1222 deletions(-) delete mode 100644 Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.cpp delete mode 100644 Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.h diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp index 693b2f1648..a760061215 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp @@ -152,8 +152,6 @@ namespace AZ m_reservedDebug = 0; m_recordingMode = Debug::AllocationRecords::RECORD_STACK_IF_NO_FILE_LINE; m_stackRecordLevels = 5; - m_useOverrunDetection = false; - m_useMalloc = false; } bool AppDescriptorConverter(SerializeContext& serialize, SerializeContext::DataElementNode& node) @@ -323,9 +321,6 @@ namespace AZ ->Field("blockSize", &Descriptor::m_memoryBlocksByteSize) ->Field("reservedOS", &Descriptor::m_reservedOS) ->Field("reservedDebug", &Descriptor::m_reservedDebug) - ->Field("useOverrunDetection", &Descriptor::m_useOverrunDetection) - ->Field("useMalloc", &Descriptor::m_useMalloc) - ->Field("allocatorRemappings", &Descriptor::m_allocatorRemappings) ->Field("modules", &Descriptor::m_modules) ; @@ -361,8 +356,6 @@ namespace AZ ->Attribute(Edit::Attributes::Step, &Descriptor::m_pageSize) ->DataElement(Edit::UIHandlers::SpinBox, &Descriptor::m_reservedOS, "OS reserved memory", "System memory reserved for OS (used only when 'Allocate all memory at startup' is true)") ->DataElement(Edit::UIHandlers::SpinBox, &Descriptor::m_reservedDebug, "Memory reserved for debugger", "System memory reserved for Debug allocator, like memory tracking (used only when 'Allocate all memory at startup' is true)") - ->DataElement(Edit::UIHandlers::CheckBox, &Descriptor::m_useOverrunDetection, "Use Overrun Detection", "Use the overrun detection memory manager (only available on some platforms, ignored in Release builds)") - ->DataElement(Edit::UIHandlers::CheckBox, &Descriptor::m_useMalloc, "Use Malloc", "Use malloc for memory allocations (for memory debugging only, ignored in Release builds)") ; } } @@ -879,7 +872,7 @@ namespace AZ AZ::AllocatorInstance::Create(desc); AZ::Debug::Trace::Instance().Init(); - AZ::Debug::AllocationRecords* records = AllocatorInstance::GetAllocator().GetRecords(); + AZ::Debug::AllocationRecords* records = AllocatorInstance::Get().GetRecords(); if (records) { records->SetMode(m_descriptor.m_recordingMode); @@ -891,35 +884,6 @@ namespace AZ m_isSystemAllocatorOwner = true; } - -#ifndef RELEASE - if (m_descriptor.m_useOverrunDetection) - { - OverrunDetectionSchema::Descriptor overrunDesc(false); - s_overrunDetectionSchema = Environment::CreateVariable(AzTypeInfo::Name(), overrunDesc); - OverrunDetectionSchema* schemaPtr = &s_overrunDetectionSchema.Get(); - - AZ::AllocatorManager::Instance().SetOverrideAllocatorSource(schemaPtr); - } - - if (m_descriptor.m_useMalloc) - { - AZ_Printf("Malloc", "WARNING: Malloc override is enabled. Registered allocators will use malloc instead of their normal allocation schemas."); - s_mallocSchema = Environment::CreateVariable(AzTypeInfo::Name()); - MallocSchema* schemaPtr = &s_mallocSchema.Get(); - - AZ::AllocatorManager::Instance().SetOverrideAllocatorSource(schemaPtr); - } -#endif - - AllocatorManager& allocatorManager = AZ::AllocatorManager::Instance(); - - for (const auto& remapping : m_descriptor.m_allocatorRemappings) - { - allocatorManager.AddAllocatorRemapping(remapping.m_from.c_str(), remapping.m_to.c_str()); - } - - allocatorManager.FinalizeConfiguration(); } void ComponentApplication::MergeSettingsToRegistry(SettingsRegistryInterface& registry) diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h index d53b8e1a4e..a28c58ac6b 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h @@ -142,10 +142,6 @@ namespace AZ AZ::u64 m_reservedDebug; //!< Reserved memory for Debugging (allocation,etc.). Used only when m_grabAllMemory is set to true. (default: 0) Debug::AllocationRecords::Mode m_recordingMode; //!< When to record stack traces (default: AZ::Debug::AllocationRecords::RECORD_STACK_IF_NO_FILE_LINE) AZ::u64 m_stackRecordLevels; //!< If stack recording is enabled, how many stack levels to record. (default: 5) - bool m_useOverrunDetection; //!< True to use the overrun detection memory management scheme. Only available on some platforms; greatly increases memory consumption. - bool m_useMalloc; //!< True to use malloc instead of the internal memory manager. Intended for debugging purposes only. - - AllocatorRemappings m_allocatorRemappings; //!< List of remappings of allocators to perform, so that they can alias each other. ModuleDescriptorList m_modules; //!< Dynamic modules used by the application. //!< These will be loaded on startup. @@ -159,7 +155,7 @@ namespace AZ //! If set, this allocator is used to allocate the temporary bootstrap memory, as well as the main \ref SystemAllocator heap. //! If it's left nullptr (default), the \ref OSAllocator will be used. - IAllocatorAllocate* m_allocator = nullptr; + IAllocator* m_allocator = nullptr; //! Callback to create AZ::Modules for the static libraries linked by this application. //! Leave null if the application uses no static AZ::Modules. @@ -372,7 +368,7 @@ namespace AZ bool m_isOSAllocatorOwner{ false }; bool m_ownsConsole{}; void* m_fixedMemoryBlock{ nullptr }; //!< Pointer to the memory block allocator, so we can free it OnDestroy. - IAllocatorAllocate* m_osAllocator{ nullptr }; + IAllocator* m_osAllocator{ nullptr }; EntitySetType m_entities; AZ::SettingsRegistryInterface::NotifyEventHandler m_projectPathChangedHandler; diff --git a/Code/Framework/AzCore/AzCore/Compression/Compression.h b/Code/Framework/AzCore/AzCore/Compression/Compression.h index 855dcf9a6a..105fb9dbe6 100644 --- a/Code/Framework/AzCore/AzCore/Compression/Compression.h +++ b/Code/Framework/AzCore/AzCore/Compression/Compression.h @@ -15,7 +15,7 @@ struct z_stream_s; namespace AZ { class IAllocator; - class IAllocatorAllocate; + class IAllocatorSchema; /** * The most well known and used compression algorithm. It gives the best compression ratios even on level 1, @@ -90,7 +90,7 @@ namespace AZ z_stream_s* m_strDeflate; z_stream_s* m_strInflate; - IAllocatorAllocate* m_workMemoryAllocator; + IAllocatorSchema* m_workMemoryAllocator; }; } diff --git a/Code/Framework/AzCore/AzCore/Compression/compression.cpp b/Code/Framework/AzCore/AzCore/Compression/compression.cpp index 8b6f270b00..b5b775ef5e 100644 --- a/Code/Framework/AzCore/AzCore/Compression/compression.cpp +++ b/Code/Framework/AzCore/AzCore/Compression/compression.cpp @@ -26,7 +26,7 @@ ZLib::ZLib(IAllocator* workMemAllocator) : m_strDeflate(nullptr) , m_strInflate(nullptr) { - m_workMemoryAllocator = workMemAllocator ? workMemAllocator->GetAllocationSource() : nullptr; + m_workMemoryAllocator = workMemAllocator->GetSchema(); if (!m_workMemoryAllocator) { m_workMemoryAllocator = &AllocatorInstance::Get(); @@ -55,7 +55,7 @@ ZLib::~ZLib() //========================================================================= void* ZLib::AllocateMem(void* userData, unsigned int items, unsigned int size) { - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); return allocator->Allocate(items * size, 4, 0, "ZLib", __FILE__, __LINE__); } @@ -65,7 +65,7 @@ void* ZLib::AllocateMem(void* userData, unsigned int items, unsigned int size) //========================================================================= void ZLib::FreeMem(void* userData, void* address) { - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); allocator->DeAllocate(address); } diff --git a/Code/Framework/AzCore/AzCore/Compression/zstd_compression.cpp b/Code/Framework/AzCore/AzCore/Compression/zstd_compression.cpp index ecab62d123..95576a275b 100644 --- a/Code/Framework/AzCore/AzCore/Compression/zstd_compression.cpp +++ b/Code/Framework/AzCore/AzCore/Compression/zstd_compression.cpp @@ -16,7 +16,7 @@ using namespace AZ; -ZStd::ZStd(IAllocatorAllocate* workMemAllocator) +ZStd::ZStd(IAllocator* workMemAllocator) { m_workMemoryAllocator = workMemAllocator; if (!m_workMemoryAllocator) @@ -41,13 +41,13 @@ ZStd::~ZStd() void* ZStd::AllocateMem(void* userData, size_t size) { - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); return allocator->Allocate(size, 4, 0, "ZStandard", __FILE__, __LINE__); } void ZStd::FreeMem(void* userData, void* address) { - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); allocator->DeAllocate(address); } diff --git a/Code/Framework/AzCore/AzCore/Compression/zstd_compression.h b/Code/Framework/AzCore/AzCore/Compression/zstd_compression.h index 3fe6677fff..70d8c37831 100644 --- a/Code/Framework/AzCore/AzCore/Compression/zstd_compression.h +++ b/Code/Framework/AzCore/AzCore/Compression/zstd_compression.h @@ -17,12 +17,11 @@ namespace AZ { class IAllocator; - class IAllocatorAllocate; class ZStd { public: - ZStd(IAllocatorAllocate* workMemAllocator = 0); + ZStd(IAllocator* workMemAllocator = 0); ~ZStd(); enum FlushType @@ -77,7 +76,7 @@ namespace AZ ZSTD_CStream* m_streamCompression; ZSTD_DStream* m_streamDecompression; - IAllocatorAllocate* m_workMemoryAllocator; + IAllocator* m_workMemoryAllocator; ZSTD_inBuffer m_inBuffer; ZSTD_outBuffer m_outBuffer; size_t m_nextBlockSize; diff --git a/Code/Framework/AzCore/AzCore/IO/CompressorZStd.h b/Code/Framework/AzCore/AzCore/IO/CompressorZStd.h index ed6b94fffa..9503f22665 100644 --- a/Code/Framework/AzCore/AzCore/IO/CompressorZStd.h +++ b/Code/Framework/AzCore/AzCore/IO/CompressorZStd.h @@ -48,7 +48,7 @@ namespace AZ public: AZ_CLASS_ALLOCATOR(CompressorZStdData, AZ::SystemAllocator, 0); - CompressorZStdData(IAllocatorAllocate* zstdMemAllocator = 0) + CompressorZStdData(IAllocator* zstdMemAllocator = 0) { m_zstd = zstdMemAllocator; } diff --git a/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.cpp b/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.cpp index 4c8272cfc8..4126d7457d 100644 --- a/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.cpp +++ b/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.cpp @@ -21,7 +21,7 @@ namespace AZ::IO::IStreamerTypes : m_allocator(AZ::AllocatorInstance::Get()) {} - DefaultRequestMemoryAllocator::DefaultRequestMemoryAllocator(AZ::IAllocatorAllocate& allocator) + DefaultRequestMemoryAllocator::DefaultRequestMemoryAllocator(AZ::IAllocator& allocator) : m_allocator(allocator) {} diff --git a/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.h b/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.h index 901fc5e594..2c4dc28518 100644 --- a/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.h +++ b/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.h @@ -137,7 +137,7 @@ namespace AZ::IO::IStreamerTypes public: //! DefaultRequestMemoryAllocator wraps around the AZ::SystemAllocator by default. DefaultRequestMemoryAllocator(); - explicit DefaultRequestMemoryAllocator(AZ::IAllocatorAllocate& allocator); + explicit DefaultRequestMemoryAllocator(AZ::IAllocator& allocator); ~DefaultRequestMemoryAllocator() override; void LockAllocator() override; @@ -151,7 +151,7 @@ namespace AZ::IO::IStreamerTypes private: AZStd::atomic_int m_lockCounter{ 0 }; AZStd::atomic_int m_allocationCounter{ 0 }; - AZ::IAllocatorAllocate& m_allocator; + AZ::IAllocator& m_allocator; }; // The following alignment functions are put here until they're available in AzCore's math library. diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 48994c4eef..4da9ab384f 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -158,10 +158,10 @@ namespace } #endif -AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) : - IAllocator(allocationSource), - m_name(name), - m_desc(desc) +AllocatorBase::AllocatorBase(IAllocatorSchema* allocationSchema, const char* name, const char* desc) + : IAllocator(allocationSchema) + , m_name(name) + , m_desc(desc) { } @@ -180,11 +180,6 @@ const char* AllocatorBase::GetDescription() const return m_desc; } -IAllocatorAllocate* AllocatorBase::GetSchema() -{ - return nullptr; -} - Debug::AllocationRecords* AllocatorBase::GetRecords() { return m_records; @@ -201,11 +196,6 @@ bool AllocatorBase::IsReady() const return m_isReady; } -bool AllocatorBase::CanBeOverridden() const -{ - return m_canBeOverridden; -} - void AllocatorBase::PostCreate() { if (m_registrationEnabled) @@ -266,11 +256,6 @@ bool AllocatorBase::IsProfilingActive() const return m_isProfilingActive; } -void AllocatorBase::DisableOverriding() -{ - m_canBeOverridden = false; -} - void AllocatorBase::DisableRegistration() { m_registrationEnabled = false; @@ -278,12 +263,12 @@ void AllocatorBase::DisableRegistration() void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) { -#if defined(AZ_HAS_VARIADIC_TEMPLATES) && defined(AZ_DEBUG_BUILD) - ++suppressStackRecord; // one more for the fact the ebus is a function -#endif // AZ_HAS_VARIADIC_TEMPLATES - if (m_isProfilingActive) { +#if defined(AZ_HAS_VARIADIC_TEMPLATES) && defined(AZ_DEBUG_BUILD) + ++suppressStackRecord; // one more for the fact the ebus is a function +#endif // AZ_HAS_VARIADIC_TEMPLATES + auto records = GetRecords(); if (records) { diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.h b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.h index 8f8a17e470..f2521087b3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.h +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.h @@ -22,7 +22,7 @@ namespace AZ class AllocatorBase : public IAllocator { protected: - AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc); + AllocatorBase(IAllocatorSchema* allocationSchema, const char* name, const char* desc); ~AllocatorBase(); public: @@ -32,11 +32,9 @@ namespace AZ //--------------------------------------------------------------------- const char* GetName() const override; const char* GetDescription() const override; - IAllocatorAllocate* GetSchema() override; Debug::AllocationRecords* GetRecords() final; void SetRecords(Debug::AllocationRecords* records) final; bool IsReady() const final; - bool CanBeOverridden() const final; void PostCreate() override; void PreDestroy() final; void SetLazilyCreated(bool lazy) final; @@ -68,10 +66,6 @@ namespace AZ return byteSize; } - /// Call to disallow this allocator from being overridden. - /// Only kernel-level allocators where it would be especially problematic for them to be overridden should do this. - void DisableOverriding(); - /// Call to disallow this allocator from being registered with the AllocatorManager. /// Only kernel-level allocators where it would be especially problematic for them to be registered with the AllocatorManager should do this. void DisableRegistration(); @@ -107,7 +101,6 @@ namespace AZ bool m_isLazilyCreated = false; bool m_isProfilingActive = false; bool m_isReady = false; - bool m_canBeOverridden = true; bool m_registrationEnabled = true; }; diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp index 70ac813972..758fa222fe 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp @@ -12,17 +12,12 @@ #include #include -#include #include #include #include #include -#if !defined(RELEASE) && !defined(AZCORE_MEMORY_ENABLE_OVERRIDES) -# define AZCORE_MEMORY_ENABLE_OVERRIDES -#endif - namespace AZ::Internal { struct AMStringHasher @@ -54,18 +49,6 @@ namespace AZ::Internal namespace AZ { -struct AllocatorManager::InternalData -{ - explicit InternalData(const AZStdIAllocator& alloc) - : m_allocatorMap(alloc) - , m_remappings(alloc) - , m_remappingsReverse(alloc) - {} - Internal::AllocatorNameMap m_allocatorMap; - Internal::AllocatorRemappings m_remappings; - Internal::AllocatorRemappings m_remappingsReverse; -}; - static EnvironmentVariable s_allocManager = nullptr; static AllocatorManager* s_allocManagerDebug = nullptr; // For easier viewing in crash dumps @@ -81,16 +64,6 @@ static Internal::PreEnvironmentAttachData& GetPreEnvironmentAttachData() void AllocatorManager::PreRegisterAllocator(IAllocator* allocator) { auto& data = GetPreEnvironmentAttachData(); - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - // All allocators must switch to an OverrideEnabledAllocationSource proxy if they are to support allocator overriding. - if (allocator->CanBeOverridden()) - { - auto shim = Internal::AllocatorOverrideShim::Create(allocator, &data.m_mallocSchema); - allocator->SetAllocationSource(shim); - } -#endif - { AZStd::lock_guard lock(data.m_mutex); AZ_Assert(data.m_unregisteredAllocatorCount < Internal::PreEnvironmentAttachData::MAX_UNREGISTERED_ALLOCATORS, "Too many allocators trying to register before environment attached!"); @@ -175,12 +148,9 @@ AllocatorManager::AllocatorManager() } ) { - m_overrideSource = nullptr; m_numAllocators = 0; m_isAllocatorLeaking = false; - m_configurationFinalized = false; m_defaultTrackingRecordMode = Debug::AllocationRecords::RECORD_NO_RECORDS; - m_data = new (m_mallocSchema->Allocate(sizeof(InternalData), AZStd::alignment_of::value, 0)) InternalData(AZStdIAllocator(m_mallocSchema.get())); } //========================================================================= @@ -210,10 +180,6 @@ AllocatorManager::RegisterAllocator(class IAllocator* alloc) alloc->SetProfilingActive(m_profilingRefcount.load() > 0); m_allocators[m_numAllocators++] = alloc; - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - ConfigureAllocatorOverrides(alloc); -#endif } //========================================================================= @@ -232,81 +198,12 @@ AllocatorManager::InternalDestroy() // Do not actually destroy the lazy allocator as it may have work to do during non-deterministic shutdown } - if (m_data) - { - m_data->~InternalData(); - m_mallocSchema->DeAllocate(m_data); - m_data = nullptr; - } - if (!m_isAllocatorLeaking) { AZ_Assert(m_numAllocators == 0, "There are still %d registered allocators!", m_numAllocators); } } -//========================================================================= -// ConfigureAllocatorOverrides -// [10/14/2018] -//========================================================================= -void -AllocatorManager::ConfigureAllocatorOverrides(IAllocator* alloc) -{ - auto record = m_data->m_allocatorMap.emplace(AZStd::piecewise_construct, AZStd::forward_as_tuple(alloc->GetName(), AZStdIAllocator(m_mallocSchema.get())), AZStd::forward_as_tuple(alloc)); - - // We only need to keep going if the allocator supports overrides. - if (!alloc->CanBeOverridden()) - { - return; - } - - if (!alloc->IsAllocationSourceChanged()) - { - // All allocators must switch to an OverrideEnabledAllocationSource proxy if they are to support allocator overriding. - auto overrideEnabled = Internal::AllocatorOverrideShim::Create(alloc, m_mallocSchema.get()); - alloc->SetAllocationSource(overrideEnabled); - } - - auto itr = m_data->m_remappings.find(record.first->first); - - if (itr != m_data->m_remappings.end()) - { - auto remapTo = m_data->m_allocatorMap.find(itr->second); - - if (remapTo != m_data->m_allocatorMap.end()) - { - static_cast(alloc->GetAllocationSource())->SetOverride(remapTo->second->GetOriginalAllocationSource()); - } - } - - itr = m_data->m_remappingsReverse.find(record.first->first); - - if (itr != m_data->m_remappingsReverse.end()) - { - auto remapFrom = m_data->m_allocatorMap.find(itr->second); - - if (remapFrom != m_data->m_allocatorMap.end()) - { - AZ_Assert(!m_configurationFinalized, "Allocators may only remap to allocators that have been created before configuration finalization"); - static_cast(remapFrom->second->GetAllocationSource())->SetOverride(alloc->GetOriginalAllocationSource()); - } - } - - if (m_overrideSource) - { - static_cast(alloc->GetAllocationSource())->SetOverride(m_overrideSource); - } - - if (m_configurationFinalized) - { - // We can get rid of the intermediary if configuration won't be changing any further. - // (The creation of it at the top of this function was superflous, but it made it easier to set things up going through a single code path.) - auto shim = static_cast(alloc->GetAllocationSource()); - alloc->SetAllocationSource(shim->GetOverride()); - Internal::AllocatorOverrideShim::Destroy(shim); - } -} - //========================================================================= // UnRegisterAllocator // [9/17/2009] @@ -365,7 +262,7 @@ AllocatorManager::GarbageCollect() for (int i = 0; i < m_numAllocators; ++i) { - m_allocators[i]->GetAllocationSource()->GarbageCollect(); + m_allocators[i]->GetSchema()->GarbageCollect(); } } @@ -414,94 +311,6 @@ AllocatorManager::SetTrackingMode(Debug::AllocationRecords::Mode mode) } } -//========================================================================= -// SetOverrideSchema -// [8/17/2018] -//========================================================================= -void -AllocatorManager::SetOverrideAllocatorSource(IAllocatorAllocate* source, bool overrideExistingAllocators) -{ - (void)source; - (void)overrideExistingAllocators; - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - AZ_Assert(!m_configurationFinalized, "You cannot set an allocator source after FinalizeConfiguration() has been called."); - m_overrideSource = source; - - if (overrideExistingAllocators) - { - AZStd::lock_guard lock(m_allocatorListMutex); - for (int i = 0; i < m_numAllocators; ++i) - { - if (m_allocators[i]->CanBeOverridden()) - { - auto shim = static_cast(m_allocators[i]->GetAllocationSource()); - shim->SetOverride(source); - } - } - } -#endif -} - -//========================================================================= -// AddAllocatorRemapping -// [8/27/2018] -//========================================================================= -void -AllocatorManager::AddAllocatorRemapping(const char* fromName, const char* toName) -{ - (void)fromName; - (void)toName; - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - AZ_Assert(!m_configurationFinalized, "You cannot set an allocator remapping after FinalizeConfiguration() has been called."); - m_data->m_remappings.emplace(AZStd::piecewise_construct, AZStd::forward_as_tuple(fromName, m_mallocSchema.get()), AZStd::forward_as_tuple(toName, m_mallocSchema.get())); - m_data->m_remappingsReverse.emplace(AZStd::piecewise_construct, AZStd::forward_as_tuple(toName, m_mallocSchema.get()), AZStd::forward_as_tuple(fromName, m_mallocSchema.get())); -#endif -} - -void -AllocatorManager::FinalizeConfiguration() -{ - if (m_configurationFinalized) - { - return; - } - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - { - AZStd::lock_guard lock(m_allocatorListMutex); - - for (int i = 0; i < m_numAllocators; ++i) - { - if (!m_allocators[i]->CanBeOverridden()) - { - continue; - } - - auto shim = static_cast(m_allocators[i]->GetAllocationSource()); - - if (!shim->IsOverridden()) - { - m_allocators[i]->ResetAllocationSource(); - Internal::AllocatorOverrideShim::Destroy(shim); - } - else if (!shim->HasOrphanedAllocations()) - { - m_allocators[i]->SetAllocationSource(shim->GetOverride()); - Internal::AllocatorOverrideShim::Destroy(shim); - } - else - { - shim->SetFinalizedConfiguration(); - } - } - } -#endif - - m_configurationFinalized = true; -} - void AllocatorManager::EnterProfilingMode() { @@ -545,27 +354,18 @@ AllocatorManager::DumpAllocators() size_t totalConsumedBytes = 0; memset(m_dumpInfo, 0, sizeof(m_dumpInfo)); - void* sourceList[m_maxNumAllocators]; AZ_Printf(TAG, "%d allocators active\n", m_numAllocators); AZ_Printf(TAG, "Index,Name,Used kb,Reserved kb,Consumed kb\n"); for (int i = 0; i < m_numAllocators; i++) { - auto allocator = m_allocators[i]; - auto source = allocator->GetAllocationSource(); + IAllocator* allocator = GetAllocator(i); const char* name = allocator->GetName(); - size_t usedBytes = source->NumAllocatedBytes(); - size_t reservedBytes = source->Capacity(); + size_t usedBytes = allocator->NumAllocatedBytes(); + size_t reservedBytes = allocator->Capacity(); size_t consumedBytes = reservedBytes; - // Very hacky and inefficient check to see if this allocator obtains its memory from another allocator - sourceList[i] = source; - if (AZStd::find(sourceList, sourceList + i, allocator->GetSchema()) != sourceList + i) - { - consumedBytes = 0; - } - totalUsedBytes += usedBytes; totalReservedBytes += reservedBytes; totalConsumedBytes += consumedBytes; @@ -585,61 +385,21 @@ void AllocatorManager::GetAllocatorStats(size_t& allocatedBytes, size_t& capacit AZStd::lock_guard lock(m_allocatorListMutex); const int allocatorCount = GetNumAllocators(); - AZStd::unordered_map existingAllocators; - AZStd::unordered_map sourcesToAllocators; // Build a mapping of original allocator sources to their allocators for (int i = 0; i < allocatorCount; ++i) { IAllocator* allocator = GetAllocator(i); - sourcesToAllocators.emplace(allocator->GetOriginalAllocationSource(), allocator); - } - - for (int i = 0; i < allocatorCount; ++i) - { - IAllocator* allocator = GetAllocator(i); - IAllocatorAllocate* source = allocator->GetAllocationSource(); - IAllocatorAllocate* originalSource = allocator->GetOriginalAllocationSource(); - IAllocatorAllocate* schema = allocator->GetSchema(); - IAllocator* alias = (source != originalSource) ? sourcesToAllocators[source] : nullptr; - - if (schema && !alias) - { - // Check to see if this allocator's source maps to another allocator - // Need to check both the schema and the allocator itself, as either one might be used as the alias depending on how it's implemented - AZStd::array checkAllocators = { { schema, allocator->GetAllocationSource() } }; - - for (IAllocatorAllocate* check : checkAllocators) - { - auto existing = existingAllocators.emplace(check, allocator); - - if (!existing.second) - { - alias = existing.first->second; - // Do not break out of the loop as we need to add to the map for all entries - } - } - } - - static const IAllocator* OS_ALLOCATOR = &AllocatorInstance::GetAllocator(); - size_t sourceAllocatedBytes = source->NumAllocatedBytes(); - size_t sourceCapacityBytes = source->Capacity(); - - if (allocator == OS_ALLOCATOR) - { - // Need to special case the OS allocator because its capacity is a made-up number. Better to just use the allocated amount, it will hopefully be small anyway. - sourceCapacityBytes = sourceAllocatedBytes; - } - + allocatedBytes += allocator->NumAllocatedBytes(); + capacityBytes += allocator->Capacity(); + if (outStats) { - outStats->emplace(outStats->end(), allocator->GetName(), alias ? alias->GetName() : allocator->GetDescription(), sourceAllocatedBytes, sourceCapacityBytes, alias != nullptr); - } - - if (!alias) - { - allocatedBytes += sourceAllocatedBytes; - capacityBytes += sourceCapacityBytes; + outStats->emplace(outStats->end(), + allocator->GetName(), + allocator->GetDescription(), + allocator->NumAllocatedBytes(), + allocator->Capacity()); } } } diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h index 14dec68ad1..0e8be07013 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h @@ -84,17 +84,6 @@ namespace AZ /// Especially for great code and engines... void SetAllocatorLeaking(bool allowLeaking) { m_isAllocatorLeaking = allowLeaking; } - /// Set an override allocator - /// All allocators registered with the AllocatorManager will automatically redirect to this allocator - /// if set. - void SetOverrideAllocatorSource(IAllocatorAllocate* source, bool overrideExistingAllocators = true); - - /// Retrieve the override schema - IAllocatorAllocate* GetOverrideAllocatorSource() const { return m_overrideSource; } - - void AddAllocatorRemapping(const char* fromName, const char* toName); - void FinalizeConfiguration(); - /// Enter or exit profiling mode; calls to Enter must be matched with calls to Exit void EnterProfilingMode(); void ExitProfilingMode(); @@ -113,19 +102,17 @@ namespace AZ struct AllocatorStats { - AllocatorStats(const char* name, const char* aliasOrDescription, size_t allocatedBytes, size_t capacityBytes, bool isAlias) + AllocatorStats(const char* name, const char* aliasOrDescription, size_t allocatedBytes, size_t capacityBytes) : m_name(name) , m_aliasOrDescription(aliasOrDescription) , m_allocatedBytes(allocatedBytes) , m_capacityBytes(capacityBytes) - , m_isAlias(isAlias) {} AZStd::string m_name; AZStd::string m_aliasOrDescription; size_t m_allocatedBytes; size_t m_capacityBytes; - bool m_isAlias; }; void GetAllocatorStats(size_t& usedBytes, size_t& reservedBytes, AZStd::vector* outStats = nullptr); @@ -157,7 +144,6 @@ namespace AZ private: void InternalDestroy(); - void ConfigureAllocatorOverrides(IAllocator* alloc); void DebugBreak(void* address, const Debug::AllocationInfo& info); AZ::MallocSchema* CreateMallocSchema(); @@ -172,14 +158,9 @@ namespace AZ MemoryBreak m_memoryBreak[MaxNumMemoryBreaks]; char m_activeBreaks; AZStd::mutex m_allocatorListMutex; - IAllocatorAllocate* m_overrideSource; DumpInfo m_dumpInfo[m_maxNumAllocators]; - struct InternalData; - - InternalData* m_data; - bool m_configurationFinalized; AZStd::atomic m_profilingRefcount; AZ::Debug::AllocationRecords::Mode m_defaultTrackingRecordMode; diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.cpp deleted file mode 100644 index e4928e83c5..0000000000 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.cpp +++ /dev/null @@ -1,227 +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 - * - */ - -#include - -namespace AZ::Internal -{ - AllocatorOverrideShim* AllocatorOverrideShim::Create(IAllocator* owningAllocator, IAllocatorAllocate* shimAllocationSource) - { - void* memory = shimAllocationSource->Allocate(sizeof(AllocatorOverrideShim), AZStd::alignment_of::value, 0); - auto result = new (memory) AllocatorOverrideShim(owningAllocator, shimAllocationSource); - return result; - } - - void AllocatorOverrideShim::Destroy(AllocatorOverrideShim* source) - { - auto shimAllocationSource = source->m_shimAllocationSource; - source->~AllocatorOverrideShim(); - shimAllocationSource->DeAllocate(source); - } - - AllocatorOverrideShim::AllocatorOverrideShim(IAllocator* owningAllocator, IAllocatorAllocate* shimAllocationSource) - : m_owningAllocator(owningAllocator) - , m_source(owningAllocator->GetOriginalAllocationSource()) - , m_overridingSource(owningAllocator->GetOriginalAllocationSource()) - , m_shimAllocationSource(shimAllocationSource) - , m_records(typename AllocationSet::hasher(), typename AllocationSet::key_eq(), StdAllocationSrc(shimAllocationSource)) - { - } - - void AllocatorOverrideShim::SetOverride(IAllocatorAllocate* source) - { - m_overridingSource = source; - } - - IAllocatorAllocate* AllocatorOverrideShim::GetOverride() const - { - return m_overridingSource; - } - - bool AllocatorOverrideShim::IsOverridden() const - { - return m_source != m_overridingSource; - } - - bool AllocatorOverrideShim::HasOrphanedAllocations() const - { - return !m_records.empty(); - } - - void AllocatorOverrideShim::SetFinalizedConfiguration() - { - m_finalizedConfiguration = true; - } - - typename AllocatorOverrideShim::pointer_type AllocatorOverrideShim::Allocate(size_type byteSize, size_type alignment, int flags, const char* name, const char* fileName, int lineNum, unsigned int suppressStackRecord) - { - pointer_type ptr = m_overridingSource->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord); - - if (!IsOverridden()) - { - lock_type lock(m_mutex); - m_records.insert(ptr); // Record in case we need to orphan this allocation later - } - - return ptr; - } - - void AllocatorOverrideShim::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) - { - IAllocatorAllocate* source = m_overridingSource; - bool destroy = false; - - { - lock_type lock(m_mutex); - - // Check to see if this came from a prior allocation source - if (m_records.erase(ptr) && IsOverridden()) - { - source = m_source; - - if (m_records.empty() && m_finalizedConfiguration) - { - // All orphaned records are gone; we are no longer needed - m_owningAllocator->SetAllocationSource(m_overridingSource); - destroy = true; // Must destroy outside the lock - } - } - } - - source->DeAllocate(ptr, byteSize, alignment); - - if (destroy) - { - Destroy(this); - } - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::Resize(pointer_type ptr, size_type newSize) - { - IAllocatorAllocate* source = m_overridingSource; - - if (IsOverridden()) - { - // Determine who owns the allocation - lock_type lock(m_mutex); - - if (m_records.count(ptr)) - { - source = m_source; - } - } - - size_t result = source->Resize(ptr, newSize); - - return result; - } - - typename AllocatorOverrideShim::pointer_type AllocatorOverrideShim::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) - { - pointer_type newPtr = nullptr; - bool useOverride = true; - bool destroy = false; - - if (IsOverridden()) - { - lock_type lock(m_mutex); - - if (m_records.erase(ptr)) - { - // An old allocation needs to be transferred to the new, overriding allocator. - useOverride = false; // We'll do the reallocation here - size_t oldSize = m_source->AllocationSize(ptr); - - if (newSize) - { - newPtr = m_overridingSource->Allocate(newSize, newAlignment, 0); - memcpy(newPtr, ptr, AZStd::min(newSize, oldSize)); - } - - m_source->DeAllocate(ptr, oldSize); - - if (m_records.empty() && m_finalizedConfiguration) - { - // All orphaned records are gone; we are no longer needed - m_owningAllocator->SetAllocationSource(m_overridingSource); - destroy = true; // Must destroy outside the lock - } - } - } - - if (useOverride) - { - // Default behavior, we weren't deleting an old allocation - newPtr = m_overridingSource->ReAllocate(ptr, newSize, newAlignment); - - if (!IsOverridden()) - { - // Still need to do bookkeeping if we haven't been overridden yet - lock_type lock(m_mutex); - m_records.erase(ptr); - m_records.insert(newPtr); - } - } - - if (destroy) - { - Destroy(this); - } - - return newPtr; - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::AllocationSize(pointer_type ptr) - { - IAllocatorAllocate* source = m_overridingSource; - - if (IsOverridden()) - { - // Determine who owns the allocation - lock_type lock(m_mutex); - - if (m_records.count(ptr)) - { - source = m_source; - } - } - - return source->AllocationSize(ptr); - } - - void AllocatorOverrideShim::GarbageCollect() - { - m_source->GarbageCollect(); - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::NumAllocatedBytes() const - { - return m_source->NumAllocatedBytes(); - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::Capacity() const - { - return m_source->Capacity(); - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::GetMaxAllocationSize() const - { - return m_source->GetMaxAllocationSize(); - } - - auto AllocatorOverrideShim::GetMaxContiguousAllocationSize() const -> size_type - { - return m_source->GetMaxContiguousAllocationSize(); - } - - IAllocatorAllocate* AllocatorOverrideShim::GetSubAllocator() - { - return m_source->GetSubAllocator(); - } - -} // namespace AZ::Internal diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.h b/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.h deleted file mode 100644 index 3b45b9953e..0000000000 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.h +++ /dev/null @@ -1,102 +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 - * - */ -#pragma once - -#include -#include -#include - -namespace AZ -{ - class AllocatorManager; - - namespace Internal - { - /** - * A shim schema that solves the problem of overriding lazily-created allocators especially, that perform allocations before the override happens. - * - * Any allocator that *might* be overridden at some point must have this shim installed as its allocation source. This is done automatically by - * the AllocationManager; you generally do not have to interact with this shim directly at all. - * - * The shim will keep track of any allocations that occur, and if the allocator gets overridden it will ensure that prior allocations are - * deallocated with the old schema rather than the new one. - * - * There is some performance cost to this intrusion, however, in most cases it's only temporary: - * * Once the application calls FinalizeConfiguration(), any non-overridden allocators will have their shims destroyed. - * * Any overridden allocators that do not have prior allocations will have their shims destroyed. - * * Any overridden allocator will automatically destroy its shim once the last of the prior allocations has been deallocated. - * - * Note that an allocator that gets overridden but has prior allocations that it never intends to deallocate (such as file-level statics that never - * get changed) will keep its shim indefinitely. This is an unfortunate cost but only affects those allocators if they are being overridden. - */ - class AllocatorOverrideShim - : public IAllocatorAllocate - { - friend AllocatorManager; - - public: - //--------------------------------------------------------------------- - // IAllocator implementation - //--------------------------------------------------------------------- - pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = nullptr, const char* fileName = nullptr, int lineNum = 0, unsigned int suppressStackRecord = 0) override; - void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; - size_type Resize(pointer_type ptr, size_type newSize) override; - pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override; - size_type AllocationSize(pointer_type ptr) override; - void GarbageCollect() override; - size_type NumAllocatedBytes() const override; - size_type Capacity() const override; - size_type GetMaxAllocationSize() const override; - size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override; - - private: - /// Creates a shim using a custom memory source - static AllocatorOverrideShim* Create(IAllocator* owningAllocator, IAllocatorAllocate* shimAllocationSource); - static void Destroy(AllocatorOverrideShim* source); - - AllocatorOverrideShim(IAllocator* owningAllocator, IAllocatorAllocate* shimAllocationSource); - - /// Overrides the shim's memory source with a different memory source. - void SetOverride(IAllocatorAllocate* source); - - /// Returns the override source. - IAllocatorAllocate* GetOverride() const; - - /// Returns true if the shim has an override source set on it. - bool IsOverridden() const; - - /// Returns true if there are orphaned allocations from before the shim had its override set. - bool HasOrphanedAllocations() const; - - /// Called by the AllocatorManager to signify that the configuration has been finalized by the application. - void SetFinalizedConfiguration(); - - private: - class StdAllocationSrc : public AZStdIAllocator - { - public: - StdAllocationSrc(IAllocatorAllocate* schema = nullptr) : AZStdIAllocator(schema) - { - } - }; - - typedef AZStd::mutex mutex_type; - typedef AZStd::lock_guard lock_type; - typedef AZStd::unordered_set, AZStd::equal_to, StdAllocationSrc> AllocationSet; - - IAllocator* m_owningAllocator; - IAllocatorAllocate* m_source; - IAllocatorAllocate* m_overridingSource; - IAllocatorAllocate* m_shimAllocationSource; - AllocationSet m_records; - mutex_type m_mutex; - bool m_finalizedConfiguration = false; - }; - } -} diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp index 30b0b78fe5..da960ce3f3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp @@ -20,8 +20,7 @@ using namespace AZ; // [1/28/2011] //========================================================================= BestFitExternalMapAllocator::BestFitExternalMapAllocator() - : AllocatorBase(this, "BestFitExternalMapAllocator", "Best fit allocator with external tracking storage!") - , m_schema(nullptr) + : AllocatorBase(nullptr, "BestFitExternalMapAllocator", "Best fit allocator with external tracking storage!") {} //========================================================================= @@ -186,13 +185,3 @@ auto BestFitExternalMapAllocator::GetMaxContiguousAllocationSize() const -> size { return m_schema->GetMaxContiguousAllocationSize(); } - -//========================================================================= -// GetSubAllocator -// [1/28/2011] -//========================================================================= -IAllocatorAllocate* -BestFitExternalMapAllocator::GetSubAllocator() -{ - return m_schema->GetSubAllocator(); -} diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h index 17425625b7..2cad404cd0 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h @@ -20,7 +20,6 @@ namespace AZ */ class BestFitExternalMapAllocator : public AllocatorBase - , public IAllocatorAllocate { public: AZ_TYPE_INFO(BestFitExternalMapAllocator, "{36266C8B-9A2C-4E3E-9812-3DB260868A2B}") @@ -38,7 +37,7 @@ namespace AZ static const int m_memoryBlockAlignment = 16; void* m_memoryBlock; ///< Pointer to memory to allocate from. Can be uncached. unsigned int m_memoryBlockByteSize; ///< Sizes if the memory block. - IAllocatorAllocate* m_mapAllocator; ///< Allocator for the free chunks map. If null the SystemAllocator will be used. + IAllocator* m_mapAllocator; ///< Allocator for the free chunks map. If null the SystemAllocator will be used. bool m_allocationRecords; ///< True if we want to track memory allocations, otherwise false. unsigned char m_stackRecordLevels; ///< If stack recording is enabled, how many stack levels to record. @@ -53,7 +52,7 @@ namespace AZ AllocatorDebugConfig GetDebugConfig() override; ////////////////////////////////////////////////////////////////////////// - // IAllocatorAllocate + // IAllocatorSchema pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; size_type Resize(pointer_type ptr, size_type newSize) override; @@ -64,7 +63,6 @@ namespace AZ size_type Capacity() const override; size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override; ////////////////////////////////////////////////////////////////////////// protected: @@ -72,7 +70,6 @@ namespace AZ BestFitExternalMapAllocator& operator=(const BestFitExternalMapAllocator&); Descriptor m_desc; - BestFitExternalMapSchema* m_schema; }; } diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp index 715ecd221e..75356e85f3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp @@ -30,6 +30,7 @@ BestFitExternalMapSchema::BestFitExternalMapSchema(const Descriptor& desc) //if( m_desc.m_memoryBlock == NULL) there is no point to automate this cause we need to flag this memory special, otherwise there is no point to use this allocator at all // m_desc.m_memoryBlock = azmalloc(SystemAllocator,m_desc.m_memoryBlockByteSize,16); m_freeChunksMap.insert(AZStd::make_pair(m_desc.m_memoryBlockByteSize, reinterpret_cast(m_desc.m_memoryBlock))); + } //========================================================================= @@ -37,7 +38,7 @@ BestFitExternalMapSchema::BestFitExternalMapSchema(const Descriptor& desc) // [1/28/2011] //========================================================================= BestFitExternalMapSchema::pointer_type -BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int flags) +BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int flags, const char*, const char*, int, unsigned int) { (void)flags; char* address = nullptr; @@ -91,8 +92,7 @@ BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int // DeAllocate // [1/28/2011] //========================================================================= -void -BestFitExternalMapSchema::DeAllocate(pointer_type ptr) +void BestFitExternalMapSchema::DeAllocate(pointer_type ptr, size_type, size_type) { if (ptr == nullptr) { @@ -122,6 +122,20 @@ BestFitExternalMapSchema::AllocationSize(pointer_type ptr) return 0; } +BestFitExternalMapSchema::size_type +BestFitExternalMapSchema::Resize(pointer_type, size_type) +{ + AZ_Assert(false, AZ_FUNCTION_SIGNATURE " unsupported"); + return 0; +} + +BestFitExternalMapSchema::pointer_type +BestFitExternalMapSchema::ReAllocate(pointer_type, size_type, size_type) +{ + AZ_Assert(false, AZ_FUNCTION_SIGNATURE " unsupported"); + return nullptr; +} + //========================================================================= // GetMaxAllocationSize // [1/28/2011] diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h index eaab614593..63e9027dd2 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h @@ -21,7 +21,7 @@ namespace AZ * External map allows us to use this allocator with uncached memory, * because the tracking node is stored outside the main chunk. */ - class BestFitExternalMapSchema + class BestFitExternalMapSchema : public IAllocatorSchema { public: typedef void* pointer_type; @@ -45,26 +45,27 @@ namespace AZ static const int m_memoryBlockAlignment = 16; void* m_memoryBlock; ///< Pointer to memory to allocate from. Can be uncached. unsigned int m_memoryBlockByteSize; ///< Sizes if the memory block. - IAllocatorAllocate* m_mapAllocator; ///< Allocator for the free chunks map. If null the SystemAllocator will be used. + IAllocator* m_mapAllocator; ///< Allocator for the free chunks map. If null the SystemAllocator will be used. }; BestFitExternalMapSchema(const Descriptor& desc); - pointer_type Allocate(size_type byteSize, size_type alignment, int flags); - void DeAllocate(pointer_type ptr); - size_type AllocationSize(pointer_type ptr); + pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; + void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; + size_type Resize(pointer_type ptr, size_type newSize) override; + pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override; + size_type AllocationSize(pointer_type ptr) override; - AZ_FORCE_INLINE size_type NumAllocatedBytes() const { return m_used; } - AZ_FORCE_INLINE size_type Capacity() const { return m_desc.m_memoryBlockByteSize; } - size_type GetMaxAllocationSize() const; - size_type GetMaxContiguousAllocationSize() const; - AZ_FORCE_INLINE IAllocatorAllocate* GetSubAllocator() const { return m_desc.m_mapAllocator; } + AZ_FORCE_INLINE size_type NumAllocatedBytes() const override { return m_used; } + AZ_FORCE_INLINE size_type Capacity() const override { return m_desc.m_memoryBlockByteSize; } + size_type GetMaxAllocationSize() const override; + size_type GetMaxContiguousAllocationSize() const override; /** - * Since we don't consolidate chucnks at free time (too expensive) we will do it as we need or when we can't + * Since we don't consolidate chunks at free time (too expensive) we will do it as we need or when we can't * allocate memory. This function is at least O(nlogn) where 'n' are the free chunks. */ - void GarbageCollect(); + void GarbageCollect() override; private: AZ_FORCE_INLINE size_type ChunckSize(pointer_type ptr); diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp index 1f0fc59a97..98ca1f87ed 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp @@ -107,7 +107,6 @@ namespace AZ m_used = 0; m_desc = desc; - m_subAllocator = nullptr; for (int i = 0; i < Descriptor::m_maxNumBlocks; ++i) { diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h index 3a7716a127..ea4a4ebdc6 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h @@ -17,7 +17,7 @@ namespace AZ * Internally uses use dlmalloc or version of it (nedmalloc, ptmalloc3). */ class HeapSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: typedef void* pointer_type; @@ -52,7 +52,6 @@ namespace AZ size_type Capacity() const override { return m_capacity; } size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override { return m_subAllocator; } void GarbageCollect() override {} private: @@ -62,7 +61,7 @@ namespace AZ Descriptor m_desc; size_type m_capacity; ///< Capacity in bytes. size_type m_used; ///< Number of bytes in use. - IAllocatorAllocate* m_subAllocator; + IAllocatorSchema* m_subAllocator; bool m_ownMemoryBlock[Descriptor::m_maxNumBlocks]; }; } diff --git a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp index 6e40ccd8cd..6891eb4248 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp @@ -1081,7 +1081,7 @@ namespace AZ { const size_t m_treePageAlignment; const size_t m_poolPageSize; bool m_isPoolAllocations; - IAllocatorAllocate* m_subAllocator; + IAllocatorSchema* m_subAllocator; #if !defined (USE_MUTEX_PER_BUCKET) mutable AZStd::mutex m_mutex; diff --git a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.h b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.h index 5ee0205196..27dbd321d2 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.h @@ -19,7 +19,7 @@ namespace AZ * Heap allocator schema, based on Dimitar Lazarov "High Performance Heap Allocator". */ class HphaSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: /** @@ -47,7 +47,7 @@ namespace AZ unsigned int m_isPoolAllocations : 1; ///< True to allow allocations from pools, otherwise false. size_t m_fixedMemoryBlockByteSize; ///< Memory block size, if 0 we use the OS memory allocation functions. void* m_fixedMemoryBlock; ///< Can be NULL if so the we will allocate memory from the subAllocator if m_memoryBlocksByteSize is != 0. - IAllocatorAllocate* m_subAllocator; ///< Allocator that m_memoryBlocks memory was allocated from or should be allocated (if NULL). + IAllocatorSchema* m_subAllocator; ///< Allocator that m_memoryBlocks memory was allocated from or should be allocated (if NULL). size_t m_systemChunkSize; ///< Size of chunk to request from the OS when more memory is needed (defaults to m_pageSize) size_t m_capacity; ///< Max size this allocator can grow to }; @@ -68,7 +68,6 @@ namespace AZ size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; size_type GetUnAllocatedMemory(bool isPrint = false) const override; - IAllocatorAllocate* GetSubAllocator() override { return m_desc.m_subAllocator; } /// Return unused memory to the OS (if we don't use fixed block). Don't call this unless you really need free memory, it is slow. void GarbageCollect() override; diff --git a/Code/Framework/AzCore/AzCore/Memory/IAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/IAllocator.cpp index 08c567bf84..2d561b45ef 100644 --- a/Code/Framework/AzCore/AzCore/Memory/IAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/IAllocator.cpp @@ -9,23 +9,12 @@ namespace AZ { - IAllocator::IAllocator(IAllocatorAllocate* allocationSource) - : m_allocationSource(allocationSource) - , m_originalAllocationSource(allocationSource) + IAllocator::IAllocator(IAllocatorSchema* schema) + : m_schema(schema) { } IAllocator::~IAllocator() { } - - void IAllocator::SetAllocationSource(IAllocatorAllocate* allocationSource) - { - m_allocationSource = allocationSource; - } - - void IAllocator::ResetAllocationSource() - { - m_allocationSource = m_originalAllocationSource; - } } diff --git a/Code/Framework/AzCore/AzCore/Memory/IAllocator.h b/Code/Framework/AzCore/AzCore/Memory/IAllocator.h index 532335e50b..319175f9ee 100644 --- a/Code/Framework/AzCore/AzCore/Memory/IAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/IAllocator.h @@ -28,17 +28,16 @@ namespace AZ class AllocatorManager; /** - * Allocator alloc/free basic interface. It is separate because it can be used - * for user provided allocators overrides + * Allocator schema interface */ - class IAllocatorAllocate + class IAllocatorSchema { public: typedef void* pointer_type; typedef size_t size_type; typedef ptrdiff_t difference_type; - virtual ~IAllocatorAllocate() {} + virtual ~IAllocatorSchema() {} virtual pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) = 0; virtual void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) = 0; @@ -70,8 +69,6 @@ namespace AZ * that will be reported. */ virtual size_type GetUnAllocatedMemory(bool isPrint = false) const { (void)isPrint; return 0; } - /// Returns a pointer to a sub-allocator or NULL. - virtual IAllocatorAllocate* GetSubAllocator() = 0; }; /** @@ -100,56 +97,19 @@ namespace AZ /** * Interface class for all allocators. */ - class IAllocator + class IAllocator : public IAllocatorSchema { public: - IAllocator(IAllocatorAllocate* allocationSource); + IAllocator(IAllocatorSchema* schema = nullptr); virtual ~IAllocator(); - // @{ Every system allocator is required to provide name this is how + // Every system allocator is required to provide name this is how // it will be registered with the allocator manager. virtual const char* GetName() const = 0; virtual const char* GetDescription() const = 0; - // @} - //--------------------------------------------------------------------- - // Code releating to the allocation source is made concrete within this - // interface as a performance optimization. - //--------------------------------------------------------------------- - - /// Returns the current allocation source, which may be used to perform memory allocations. - AZ_FORCE_INLINE IAllocatorAllocate* GetAllocationSource() const - { - return m_allocationSource; - } - - /// Returns the original allocation source. Generally only used for debugging purposes. - AZ_FORCE_INLINE IAllocatorAllocate* GetOriginalAllocationSource() const - { - return m_originalAllocationSource; - } - - /// Returns true if the allocation source has changed from its original value. - AZ_FORCE_INLINE bool IsAllocationSourceChanged() const - { - return m_allocationSource != m_originalAllocationSource; - } - - /// Sets the allocation source, effectively overriding the allocator. - /// Be very careful doing this, as existing allocations will be deallocated through the new source, - /// typically leading to unwanted effects (such as crashes). - void SetAllocationSource(IAllocatorAllocate* allocationSource); - - /// Restores the allocation source to its original value. - /// Be very careful doing this, as allocations that came from the new source will now be deallocated - /// through the original source, typically leading to unwanted effects (such as crashes). - void ResetAllocationSource(); - - //--------------------------------------------------------------------- - - /// Returns the schema, if the allocator uses one. Returns nullptr if the allocator does not use a schema. - /// This is mainly used when debugging to determine if allocators alias each other under the hood. - virtual IAllocatorAllocate* GetSchema() = 0; + /// Returns the schema + AZ_FORCE_INLINE IAllocatorSchema* GetSchema() const { return m_schema; }; /// Returns the debug configuration for this allocator. virtual AllocatorDebugConfig GetDebugConfig() = 0; @@ -163,11 +123,6 @@ namespace AZ /// Returns true if this allocator is ready to use. virtual bool IsReady() const = 0; - /// Returns true if this allocator can be overridden with a different source. - /// Almost all allocators should return true. There are very few minor exceptions, such as the OS Allocator, that are required for direct - /// interfacing with the kernel and must never be overridden under any circumstances. - virtual bool CanBeOverridden() const = 0; - /// Returns true if the allocator was lazily created. Exposed primarily for testing systems that need to verify the state of allocators. virtual bool IsLazilyCreated() const = 0; @@ -195,9 +150,7 @@ namespace AZ virtual void Destroy() = 0; protected: - // The allocation source is made a direct member of the interface as a performance optimization. - IAllocatorAllocate * m_allocationSource; - IAllocatorAllocate* m_originalAllocationSource; + IAllocatorSchema* m_schema; template friend class AllocatorStorage::StoragePolicyBase; diff --git a/Code/Framework/AzCore/AzCore/Memory/MallocSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/MallocSchema.cpp index 9aa31cd8b6..37fa277fab 100644 --- a/Code/Framework/AzCore/AzCore/Memory/MallocSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/MallocSchema.cpp @@ -22,31 +22,15 @@ namespace AZ::Internal namespace AZ { + static constexpr size_t DEFAULT_ALIGNMENT = sizeof(void*) * 2; // Default malloc alignment + //--------------------------------------------------------------------- // MallocSchema methods //--------------------------------------------------------------------- - MallocSchema::MallocSchema(const Descriptor& desc) + MallocSchema::MallocSchema(const Descriptor&) : m_bytesAllocated(0) { - if (desc.m_useAZMalloc) - { - static const int DEFAULT_ALIGNMENT = sizeof(void*) * 2; // Default malloc alignment - - m_mallocFn = [](size_t byteSize) - { - return AZ_OS_MALLOC(byteSize, DEFAULT_ALIGNMENT); - }; - m_freeFn = [](void* ptr) - { - AZ_OS_FREE(ptr); - }; - } - else - { - m_mallocFn = &malloc; - m_freeFn = &free; - } } MallocSchema::~MallocSchema() @@ -84,7 +68,7 @@ namespace AZ ((alignment > sizeof(double)) ? alignment : 0); // Malloc will align to a minimum boundary for native objects, so we only pad if aligning to a large value - void* data = (*m_mallocFn)(required); + void* data = AZ_OS_MALLOC(required, DEFAULT_ALIGNMENT); void* result = PointerAlignUp(reinterpret_cast(reinterpret_cast(data) + sizeof(Internal::Header)), alignment); Internal::Header* header = PointerAlignDown( (Internal::Header*)(reinterpret_cast(result) - sizeof(Internal::Header)), AZStd::alignment_of::value); @@ -112,7 +96,7 @@ namespace AZ void* freePtr = reinterpret_cast(reinterpret_cast(ptr) - static_cast(header->offset)); m_bytesAllocated -= header->size; - (*m_freeFn)(freePtr); + AZ_OS_FREE(freePtr); } MallocSchema::pointer_type MallocSchema::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) @@ -166,11 +150,6 @@ namespace AZ return AZ_CORE_MAX_ALLOCATOR_SIZE; } - IAllocatorAllocate* MallocSchema::GetSubAllocator() - { - return nullptr; - } - void MallocSchema::GarbageCollect() { } diff --git a/Code/Framework/AzCore/AzCore/Memory/MallocSchema.h b/Code/Framework/AzCore/AzCore/Memory/MallocSchema.h index 7a8c4a0366..02559fdb57 100644 --- a/Code/Framework/AzCore/AzCore/Memory/MallocSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/MallocSchema.h @@ -16,7 +16,7 @@ namespace AZ * Uses malloc internally. Mainly intended for debugging using host operating system features. */ class MallocSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: AZ_TYPE_INFO("MallocSchema", "{2A21D120-A42A-484C-997C-5735DCCA5FE9}"); @@ -25,21 +25,13 @@ namespace AZ typedef size_t size_type; typedef ptrdiff_t difference_type; - struct Descriptor - { - Descriptor(bool useAZMalloc = true) - : m_useAZMalloc(useAZMalloc) - { - } - - bool m_useAZMalloc; - }; + struct Descriptor {}; MallocSchema(const Descriptor& desc = Descriptor()); virtual ~MallocSchema(); //--------------------------------------------------------------------- - // IAllocatorAllocate + // IAllocatorSchema //--------------------------------------------------------------------- pointer_type Allocate(size_type byteSize, size_type alignment, int flags, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; @@ -51,15 +43,9 @@ namespace AZ size_type Capacity() const override; size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override; void GarbageCollect() override; private: - typedef void* (*MallocFn)(size_t); - typedef void (*FreeFn)(void*); - AZStd::atomic m_bytesAllocated; - MallocFn m_mallocFn; - FreeFn m_freeFn; }; } diff --git a/Code/Framework/AzCore/AzCore/Memory/Memory.h b/Code/Framework/AzCore/AzCore/Memory/Memory.h index 2e08ec1b15..2ecba6ebff 100644 --- a/Code/Framework/AzCore/AzCore/Memory/Memory.h +++ b/Code/Framework/AzCore/AzCore/Memory/Memory.h @@ -141,9 +141,9 @@ void* operator new[](std::size_t, const AZ::Internal::AllocatorDummy*); */ #define azfree(...) AZ_MACRO_SPECIALIZE(azfree_, AZ_VA_NUM_ARGS(__VA_ARGS__), (__VA_ARGS__)) -/// Returns allocation size, based on it's pointer \ref AZ::IAllocatorAllocate::AllocationSize. +/// Returns allocation size, based on it's pointer \ref AZ::IAllocatorSchema::AllocationSize. #define azallocsize(_Ptr, _Allocator) AZ::AllocatorInstance< _Allocator >::Get().AllocationSize(_Ptr) -/// Returns the new expanded size or 0 if NOT supported by the allocator \ref AZ::IAllocatorAllocate::Resize. +/// Returns the new expanded size or 0 if NOT supported by the allocator \ref AZ::IAllocatorSchema::Resize. #define azallocresize(_Ptr, _NewSize, _Allocator) AZ::AllocatorInstance< _Allocator >::Get().Resize(_Ptr, _NewSize) namespace AZ { @@ -734,12 +734,15 @@ namespace AZ public: typedef typename Allocator::Descriptor Descriptor; - AZ_FORCE_INLINE static IAllocatorAllocate& Get() + // Maintained for backwards compatibility, prefer to use Get() instead. + // Get was previously used to get the the schema, however, that bypases what the allocators are doing. + // If the schema is needed, call Get().GetSchema() + AZ_FORCE_INLINE static IAllocator& GetAllocator() { - return *GetAllocator().GetAllocationSource(); + return StoragePolicy::GetAllocator(); } - AZ_FORCE_INLINE static IAllocator& GetAllocator() + AZ_FORCE_INLINE static IAllocator& Get() { return StoragePolicy::GetAllocator(); } @@ -781,7 +784,7 @@ namespace AZ // structure of another allocator template class ChildAllocatorSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: // No descriptor is necessary, as the parent allocator is expected to already @@ -792,7 +795,7 @@ namespace AZ ChildAllocatorSchema(const Descriptor&) {} //--------------------------------------------------------------------- - // IAllocatorAllocate + // IAllocatorSchema //--------------------------------------------------------------------- pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override { @@ -848,11 +851,6 @@ namespace AZ { return AZ::AllocatorInstance::Get().GetUnAllocatedMemory(isPrint); } - - IAllocatorAllocate* GetSubAllocator() override - { - return AZ::AllocatorInstance::Get().GetSubAllocator(); - } }; /** @@ -873,7 +871,7 @@ namespace AZ { if (AllocatorInstance::IsReady()) { - m_name = AllocatorInstance::GetAllocator().GetName(); + m_name = AllocatorInstance::Get().GetName(); } else { @@ -932,7 +930,7 @@ namespace AZ typedef AZStd::ptrdiff_t difference_type; typedef AZStd::false_type allow_memory_leaks; ///< Regular allocators should not leak. - AZ_FORCE_INLINE AZStdIAllocator(IAllocatorAllocate* allocator, const char* name = "AZ::AZStdIAllocator") + AZ_FORCE_INLINE AZStdIAllocator(IAllocator* allocator, const char* name = "AZ::AZStdIAllocator") : m_allocator(allocator) , m_name(name) { @@ -965,7 +963,7 @@ namespace AZ AZ_FORCE_INLINE bool operator==(const AZStdIAllocator& rhs) const { return m_allocator == rhs.m_allocator; } AZ_FORCE_INLINE bool operator!=(const AZStdIAllocator& rhs) const { return m_allocator != rhs.m_allocator; } private: - IAllocatorAllocate* m_allocator; + IAllocator* m_allocator; const char* m_name; }; @@ -982,8 +980,8 @@ namespace AZ using size_type = AZStd::size_t; using difference_type = AZStd::ptrdiff_t; using allow_memory_leaks = AZStd::false_type; ///< Regular allocators should not leak. - using functor_type = IAllocatorAllocate&(*)(); ///< Function Pointer must return IAllocatorAllocate&. - ///< function pointers do not support covariant return types + using functor_type = IAllocator&(*)(); ///< Function Pointer must return IAllocator&. + ///< function pointers do not support covariant return types constexpr AZStdFunctorAllocator(functor_type allocatorFunctor, const char* name = "AZ::AZStdFunctorAllocator") : m_allocatorFunctor(allocatorFunctor) diff --git a/Code/Framework/AzCore/AzCore/Memory/OSAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/OSAllocator.cpp index 317df214d6..293cd92354 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OSAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/OSAllocator.cpp @@ -19,7 +19,6 @@ namespace AZ , m_custom(nullptr) , m_numAllocatedBytes(0) { - DisableOverriding(); } //========================================================================= diff --git a/Code/Framework/AzCore/AzCore/Memory/OSAllocator.h b/Code/Framework/AzCore/AzCore/Memory/OSAllocator.h index 3a8080483b..0bdf7d9fed 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OSAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/OSAllocator.h @@ -24,7 +24,6 @@ namespace AZ */ class OSAllocator : public AllocatorBase - , public IAllocatorAllocate { public: AZ_TYPE_INFO(OSAllocator, "{9F835EE3-F23C-454E-B4E3-011E2F3C8118}") @@ -39,7 +38,7 @@ namespace AZ { Descriptor() : m_custom(0) {} - IAllocatorAllocate* m_custom; ///< You can provide our own allocation scheme. If NULL a HeapScheme will be used with the provided Descriptor. + IAllocatorSchema* m_custom; ///< You can provide our own allocation scheme. If NULL a HeapScheme will be used with the provided Descriptor. }; bool Create(const Descriptor& desc); @@ -51,7 +50,7 @@ namespace AZ AllocatorDebugConfig GetDebugConfig() override; ////////////////////////////////////////////////////////////////////////// - // IAllocatorAllocate + // IAllocatorSchema pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; size_type Resize(pointer_type ptr, size_type newSize) override { return m_custom ? m_custom->Resize(ptr, newSize) : 0; } @@ -62,13 +61,12 @@ namespace AZ size_type Capacity() const override { return m_custom ? m_custom->Capacity() : AZ_CORE_MAX_ALLOCATOR_SIZE; } // custom size or unlimited size_type GetMaxAllocationSize() const override { return m_custom ? m_custom->GetMaxAllocationSize() : AZ_CORE_MAX_ALLOCATOR_SIZE; } // custom size or unlimited size_type GetMaxContiguousAllocationSize() const override { return m_custom ? m_custom->GetMaxContiguousAllocationSize() : AZ_CORE_MAX_ALLOCATOR_SIZE; } // custom size or unlimited - IAllocatorAllocate* GetSubAllocator() override { return m_custom ? m_custom : NULL; } protected: OSAllocator(const OSAllocator&); OSAllocator& operator=(const OSAllocator&); - IAllocatorAllocate* m_custom; + IAllocatorSchema* m_custom; size_type m_numAllocatedBytes; }; diff --git a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp index ed5e0febc2..096fbbac95 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp @@ -233,7 +233,6 @@ namespace AZ size_type Capacity() const; size_type GetMaxAllocationSize() const; size_type GetMaxContiguousAllocationSize() const; - IAllocatorAllocate* GetSubAllocator(); void GarbageCollect(); private: @@ -680,11 +679,6 @@ auto AZ::OverrunDetectionSchemaImpl::GetMaxContiguousAllocationSize() const -> s return 0; } -AZ::IAllocatorAllocate* AZ::OverrunDetectionSchemaImpl::GetSubAllocator() -{ - return nullptr; -} - void AZ::OverrunDetectionSchemaImpl::GarbageCollect() { } @@ -810,11 +804,6 @@ auto AZ::OverrunDetectionSchema::GetMaxContiguousAllocationSize() const -> size_ return m_impl->GetMaxContiguousAllocationSize(); } -AZ::IAllocatorAllocate* AZ::OverrunDetectionSchema::GetSubAllocator() -{ - return m_impl->GetSubAllocator(); -} - void AZ::OverrunDetectionSchema::GarbageCollect() { m_impl->GarbageCollect(); diff --git a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h index 9895a5f84f..073b54160b 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h @@ -27,7 +27,7 @@ namespace AZ * the requested memory, plus the trap page). On most platforms this is 8kb (4kb * 2 pages). */ class OverrunDetectionSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: AZ_TYPE_INFO("OverrunDetectionSchema", "{0DF781AC-1615-40AE-81F7-6CA5841E2914}"); @@ -75,7 +75,7 @@ namespace AZ virtual ~OverrunDetectionSchema(); //--------------------------------------------------------------------- - // IAllocatorAllocate + // IAllocatorSchema //--------------------------------------------------------------------- pointer_type Allocate(size_type byteSize, size_type alignment, int flags, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; @@ -87,7 +87,6 @@ namespace AZ size_type Capacity() const override; size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override; void GarbageCollect() override; private: diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h b/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h index a03f7b5b92..f55c6251bf 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h @@ -102,7 +102,7 @@ namespace AZ } ////////////////////////////////////////////////////////////////////////// - // IAllocatorAllocate + // IAllocatorSchema pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override { (void)ptr; diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp index 9167864450..60f4f34f1d 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp @@ -163,7 +163,7 @@ namespace AZ } using AllocatorType = PoolAllocation; - IAllocatorAllocate* m_pageAllocator; + IAllocatorSchema* m_pageAllocator; AllocatorType m_allocator; void* m_staticDataBlock; unsigned int m_numStaticPages; @@ -295,7 +295,7 @@ namespace AZ FreePagesType m_freePages; AZStd::vector m_threads; ///< Array with all separate thread data. Used to traverse end free elements. - IAllocatorAllocate* m_pageAllocator; + IAllocatorSchema* m_pageAllocator; void* m_staticDataBlock; size_t m_numStaticPages; size_t m_pageSize; @@ -732,17 +732,6 @@ PoolSchema::Capacity() const return m_impl->m_numStaticPages * m_impl->m_pageSize; } -//========================================================================= -// GetPageAllocator -// [11/17/2010] -//========================================================================= -IAllocatorAllocate* -PoolSchema::GetSubAllocator() -{ - return m_impl->m_pageAllocator; -} - - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // PollAllocator Implementation @@ -1090,16 +1079,6 @@ ThreadPoolSchema::Capacity() const return m_impl->m_numStaticPages * m_impl->m_pageSize; } -//========================================================================= -// GetPageAllocator -// [11/17/2010] -//========================================================================= -IAllocatorAllocate* -ThreadPoolSchema::GetSubAllocator() -{ - return m_impl->m_pageAllocator; -} - //========================================================================= // ThreadPoolSchemaImpl diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h index cfc5e3ea07..d9faf976b3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h @@ -22,7 +22,7 @@ namespace AZ * use ThreadPool Schema or do the sync yourself. */ class PoolSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: /** @@ -52,7 +52,7 @@ namespace AZ * this is the minimum number of pages we will have allocated at all times, otherwise the total number of pages supported. */ unsigned int m_numStaticPages; - IAllocatorAllocate* m_pageAllocator; ///< If you provide this interface we will use it for page allocations, otherwise SystemAllocator will be used. + IAllocatorSchema* m_pageAllocator; ///< If you provide this interface we will use it for page allocations, otherwise SystemAllocator will be used. }; PoolSchema(const Descriptor& desc = Descriptor()); @@ -73,7 +73,6 @@ namespace AZ size_type GetMaxContiguousAllocationSize() const override; size_type NumAllocatedBytes() const override; size_type Capacity() const override; - IAllocatorAllocate* GetSubAllocator() override; protected: PoolSchema(const PoolSchema&); @@ -90,7 +89,7 @@ namespace AZ * for each thread. So there will be some memory overhead, especially if you use fixed pool sizes. */ class ThreadPoolSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: // Functions for getting an instance of a ThreadPoolData when using thread local storage @@ -119,7 +118,6 @@ namespace AZ size_type GetMaxContiguousAllocationSize() const override; size_type NumAllocatedBytes() const override; size_type Capacity() const override; - IAllocatorAllocate* GetSubAllocator() override; protected: ThreadPoolSchema(const ThreadPoolSchema&); diff --git a/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h b/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h index 5fbc890203..76be66786e 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h @@ -22,17 +22,15 @@ namespace AZ template class SimpleSchemaAllocator : public AllocatorBase - , public IAllocatorAllocate { public: using Descriptor = DescriptorType; - using pointer_type = typename IAllocatorAllocate::pointer_type; - using size_type = typename IAllocatorAllocate::size_type; - using difference_type = typename IAllocatorAllocate::difference_type; + using pointer_type = typename Schema::pointer_type; + using size_type = typename Schema::size_type; + using difference_type = typename Schema::difference_type; SimpleSchemaAllocator(const char* name, const char* desc) - : AllocatorBase(this, name, desc) - , m_schema(nullptr) + : AllocatorBase(nullptr, name, desc) { } @@ -65,13 +63,8 @@ namespace AZ return AllocatorDebugConfig(); } - IAllocatorAllocate* GetSchema() override - { - return m_schema; - } - //--------------------------------------------------------------------- - // IAllocatorAllocate + // IAllocatorSchema //--------------------------------------------------------------------- pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = nullptr, const char* fileName = nullptr, int lineNum = 0, unsigned int suppressStackRecord = 0) override { @@ -188,14 +181,6 @@ namespace AZ { return m_schema->GetUnAllocatedMemory(isPrint); } - - IAllocatorAllocate* GetSubAllocator() override - { - return m_schema->GetSubAllocator(); - } - - protected: - IAllocatorAllocate* m_schema; private: typename AZStd::aligned_storage::value>::type m_schemaStorage; diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp index e56f4f045d..c403df0ed6 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp @@ -51,9 +51,8 @@ static bool g_isSystemSchemaUsed = false; // [9/2/2009] //========================================================================= SystemAllocator::SystemAllocator() - : AllocatorBase(this, "SystemAllocator", "Fundamental generic memory allocator") + : AllocatorBase(nullptr, "SystemAllocator", "Fundamental generic memory allocator") , m_isCustom(false) - , m_allocator(nullptr) , m_ownsOSAllocator(false) { } @@ -93,7 +92,7 @@ SystemAllocator::Create(const Descriptor& desc) if (desc.m_custom) { m_isCustom = true; - m_allocator = desc.m_custom; + m_schema = desc.m_custom; isReady = true; } else @@ -121,9 +120,9 @@ SystemAllocator::Create(const Descriptor& desc) AZ_Assert(!g_isSystemSchemaUsed, "AZ::SystemAllocator MUST be created first! It's the source of all allocations!"); #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - m_allocator = new(&g_systemSchema)HphaSchema(heapDesc); + m_schema = new (&g_systemSchema) HphaSchema(heapDesc); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - m_allocator = new(&g_systemSchema)MallocSchema(heapDesc); + m_schema = new (&g_systemSchema) MallocSchema(heapDesc); #endif g_isSystemSchemaUsed = true; isReady = true; @@ -134,11 +133,11 @@ SystemAllocator::Create(const Descriptor& desc) AZ_Assert(AllocatorInstance::IsReady(), "System allocator must be created before any other allocator! They allocate from it."); #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - m_allocator = azcreate(HphaSchema, (heapDesc), SystemAllocator); + m_schema = azcreate(HphaSchema, (heapDesc), SystemAllocator); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - m_allocator = azcreate(MallocSchema, (heapDesc), SystemAllocator); + m_schema = azcreate(MallocSchema, (heapDesc), SystemAllocator); #endif - if (m_allocator == nullptr) + if (m_schema == nullptr) { isReady = false; } @@ -167,18 +166,18 @@ SystemAllocator::Destroy() if (!m_isCustom) { - if ((void*)m_allocator == (void*)&g_systemSchema) + if ((void*)m_schema == (void*)&g_systemSchema) { #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - static_cast(m_allocator)->~HphaSchema(); + static_cast(m_schema)->~HphaSchema(); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - static_cast(m_allocator)->~MallocSchema(); + static_cast(m_schema)->~MallocSchema(); #endif g_isSystemSchemaUsed = false; } else { - azdestroy(m_allocator); + azdestroy(m_schema); } } @@ -198,11 +197,6 @@ AllocatorDebugConfig SystemAllocator::GetDebugConfig() .ExcludeFromDebugging(!m_desc.m_allocationRecords); } -IAllocatorAllocate* SystemAllocator::GetSchema() -{ - return m_allocator; -} - //========================================================================= // Allocate // [9/2/2009] @@ -218,14 +212,14 @@ SystemAllocator::Allocate(size_type byteSize, size_type alignment, int flags, co AZ_Assert((alignment & (alignment - 1)) == 0, "Alignment must be power of 2!"); byteSize = MemorySizeAdjustedUp(byteSize); - SystemAllocator::pointer_type address = m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); + SystemAllocator::pointer_type address = m_schema->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); if (address == nullptr) { // Free all memory we can and try again! AllocatorManager::Instance().GarbageCollect(); - address = m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); + address = m_schema->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); } if (address == nullptr) @@ -251,7 +245,7 @@ SystemAllocator::DeAllocate(pointer_type ptr, size_type byteSize, size_type alig byteSize = MemorySizeAdjustedUp(byteSize); AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); - m_allocator->DeAllocate(ptr, byteSize, alignment); + m_schema->DeAllocate(ptr, byteSize, alignment); } //========================================================================= @@ -265,7 +259,7 @@ SystemAllocator::ReAllocate(pointer_type ptr, size_type newSize, size_type newAl AZ_MEMORY_PROFILE(ProfileReallocationBegin(ptr, newSize)); AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); - pointer_type newAddress = m_allocator->ReAllocate(ptr, newSize, newAlignment); + pointer_type newAddress = m_schema->ReAllocate(ptr, newSize, newAlignment); AZ_PROFILE_MEMORY_ALLOC(MemoryReserved, newAddress, newSize, "SystemAllocator realloc"); AZ_MEMORY_PROFILE(ProfileReallocationEnd(ptr, newAddress, newSize, newAlignment)); @@ -280,7 +274,7 @@ SystemAllocator::size_type SystemAllocator::Resize(pointer_type ptr, size_type newSize) { newSize = MemorySizeAdjustedUp(newSize); - size_type resizedSize = m_allocator->Resize(ptr, newSize); + size_type resizedSize = m_schema->Resize(ptr, newSize); AZ_MEMORY_PROFILE(ProfileResize(ptr, resizedSize)); @@ -294,7 +288,7 @@ SystemAllocator::Resize(pointer_type ptr, size_type newSize) SystemAllocator::size_type SystemAllocator::AllocationSize(pointer_type ptr) { - size_type allocSize = MemorySizeAdjustedDown(m_allocator->AllocationSize(ptr)); + size_type allocSize = MemorySizeAdjustedDown(m_schema->AllocationSize(ptr)); return allocSize; } diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h index c02ada5843..0ea4251b8a 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h @@ -26,7 +26,6 @@ namespace AZ */ class SystemAllocator : public AllocatorBase - , public IAllocatorAllocate { public: AZ_TYPE_INFO(SystemAllocator, "{424C94D8-85CF-4E89-8CD6-AB5EC173E875}") @@ -39,7 +38,7 @@ namespace AZ * we will allocate system memory using system calls. You can * provide arenas (spaces) with pre-allocated memory, and use the * flag to specify which arena you want to allocate from. - * You are also allowed to supply IAllocatorAllocate, but if you do + * You are also allowed to supply IAllocatorSchema, but if you do * so you will need to take care of all allocations, we will not use * the default HeapSchema. * \ref HeapSchema::Descriptor @@ -51,7 +50,7 @@ namespace AZ , m_allocationRecords(true) , m_stackRecordLevels(5) {} - IAllocatorAllocate* m_custom; ///< You can provide our own allocation scheme. If NULL a HeapScheme will be used with the provided Descriptor. + IAllocatorSchema* m_custom; ///< You can provide our own allocation scheme. If NULL a HeapScheme will be used with the provided Descriptor. struct Heap { @@ -73,7 +72,7 @@ namespace AZ int m_numFixedMemoryBlocks; ///< Number of memory blocks to use. void* m_fixedMemoryBlocks[m_maxNumFixedBlocks]; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. size_t m_fixedMemoryBlocksByteSize[m_maxNumFixedBlocks]; ///< Sizes of different memory blocks (MUST be multiple of m_pageSize), if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. - IAllocatorAllocate* m_subAllocator; ///< Allocator that m_memoryBlocks memory was allocated from or should be allocated (if NULL). + IAllocatorSchema* m_subAllocator; ///< Allocator that m_memoryBlocks memory was allocated from or should be allocated (if NULL). size_t m_systemChunkSize; ///< Size of chunk to request from the OS when more memory is needed (defaults to m_pageSize) } m_heap; bool m_allocationRecords; ///< True if we want to track memory allocations, otherwise false. @@ -87,25 +86,23 @@ namespace AZ ////////////////////////////////////////////////////////////////////////// // IAllocator AllocatorDebugConfig GetDebugConfig() override; - IAllocatorAllocate* GetSchema() override; ////////////////////////////////////////////////////////////////////////// - // IAllocatorAllocate + // IAllocatorSchema pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override; size_type Resize(pointer_type ptr, size_type newSize) override; size_type AllocationSize(pointer_type ptr) override; - void GarbageCollect() override { m_allocator->GarbageCollect(); } + void GarbageCollect() override { GetSchema()->GarbageCollect(); } - size_type NumAllocatedBytes() const override { return m_allocator->NumAllocatedBytes(); } - size_type Capacity() const override { return m_allocator->Capacity(); } + size_type NumAllocatedBytes() const override { return GetSchema()->NumAllocatedBytes(); } + size_type Capacity() const override { return GetSchema()->Capacity(); } /// Keep in mind this operation will execute GarbageCollect to make sure it returns, max allocation. This function WILL be slow. - size_type GetMaxAllocationSize() const override { return m_allocator->GetMaxAllocationSize(); } - size_type GetMaxContiguousAllocationSize() const override { return m_allocator->GetMaxContiguousAllocationSize(); } - size_type GetUnAllocatedMemory(bool isPrint = false) const override { return m_allocator->GetUnAllocatedMemory(isPrint); } - IAllocatorAllocate* GetSubAllocator() override { return m_isCustom ? m_allocator : m_allocator->GetSubAllocator(); } + size_type GetMaxAllocationSize() const override { return GetSchema()->GetMaxAllocationSize(); } + size_type GetMaxContiguousAllocationSize() const override { return GetSchema()->GetMaxContiguousAllocationSize(); } + size_type GetUnAllocatedMemory(bool isPrint = false) const override { return GetSchema()->GetUnAllocatedMemory(isPrint); } ////////////////////////////////////////////////////////////////////////// @@ -115,7 +112,6 @@ namespace AZ Descriptor m_desc; bool m_isCustom; - IAllocatorAllocate* m_allocator; bool m_ownsOSAllocator; }; } diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp index 841387f14d..b6f42e79ec 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp @@ -1456,7 +1456,7 @@ using namespace AZ; static void* LuaMemoryHook(void* userData, void* ptr, size_t osize, size_t nsize) { (void)osize; - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); if (nsize == 0) { if (ptr) @@ -4274,7 +4274,7 @@ LUA_API const Node* lua_getDummyNode() AZ_CLASS_ALLOCATOR(ScriptContextImpl, AZ::SystemAllocator, 0); ////////////////////////////////////////////////////////////////////////// - ScriptContextImpl(ScriptContext* owner, IAllocatorAllocate* allocator, lua_State* nativeContext) + ScriptContextImpl(ScriptContext* owner, IAllocator* allocator, lua_State* nativeContext) : m_owner(owner) , m_context(nullptr) , m_debug(nullptr) @@ -5827,7 +5827,7 @@ LUA_API const Node* lua_getDummyNode() }; } // namespace AZ - ScriptContext::ScriptContext(ScriptContextId id, IAllocatorAllocate* allocator, lua_State* nativeContext) + ScriptContext::ScriptContext(ScriptContextId id, IAllocator* allocator, lua_State* nativeContext) { m_id = id; m_impl = aznew ScriptContextImpl(this, allocator, nativeContext); diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.h b/Code/Framework/AzCore/AzCore/Script/ScriptContext.h index bb63a9368d..8784bf7ca7 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.h @@ -822,7 +822,7 @@ namespace AZ CustomFromLua m_fromLua; }; - ScriptContext(ScriptContextId id = ScriptContextIds::DefaultScriptContextId, IAllocatorAllocate* allocator = nullptr, lua_State* nativeContext = nullptr); + ScriptContext(ScriptContextId id = ScriptContextIds::DefaultScriptContextId, IAllocator* allocator = nullptr, lua_State* nativeContext = nullptr); ~ScriptContext(); /// Bind LUA context (VM) a specific behaviorContext diff --git a/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl b/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl index a633af22da..c1ecd3634a 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl @@ -74,7 +74,7 @@ namespace AZ * But as the AZStdAssociativeContainer instance will not be accessed outside of the module it was * created within then this will return this .dll/.exe module allocator */ - classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocatorAllocate& { return GetCurrentSerializeContextModule().GetAllocator(); })); + classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocator& { return GetCurrentSerializeContextModule().GetAllocator(); })); // Flag the field with the EnumType attribute if we're an enumeration type aliased by RemoveEnum const bool isSpecializedEnum = AZStd::is_enum::value && !AzTypeInfo::Uuid().IsNull(); @@ -650,7 +650,7 @@ namespace AZ * But as the AZStdAssociativeContainer instance will not be accessed outside of the module it was * created within then this will return this .dll/.exe module allocator */ - m_classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocatorAllocate& { return GetCurrentSerializeContextModule().GetAllocator(); })); + m_classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocator& { return GetCurrentSerializeContextModule().GetAllocator(); })); m_classElement.m_attributes.emplace_back(AZ_CRC("KeyType", 0x15bc5303), CreateModuleAttribute(AZStd::move(uuid))); } diff --git a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp index ff0ad571f7..227ba3dc75 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp @@ -3245,7 +3245,7 @@ namespace AZ return genericClassInfoFoundIt != m_moduleLocalGenericClassInfos.end() ? genericClassInfoFoundIt->second : nullptr; } - AZ::IAllocatorAllocate& SerializeContext::PerModuleGenericClassInfo::GetAllocator() + AZ::IAllocator& SerializeContext::PerModuleGenericClassInfo::GetAllocator() { return m_moduleOSAllocator; } diff --git a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h index bf96bcdb9a..f8daa8c328 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h +++ b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h @@ -574,10 +574,10 @@ namespace AZ GenericClassInfo* m_genericClassInfo = nullptr; ///< Valid when the generic class is set. So you don't search for the actual type in the class register. Edit::ElementData* m_editData{}; ///< Pointer to edit data (generated by EditContext). AZStd::vector m_attributes{ - AZStdFunctorAllocator([]() -> IAllocatorAllocate& { return AZ::AllocatorInstance::Get(); }) + AZStdFunctorAllocator([]() -> IAllocator& { return AZ::AllocatorInstance::Get(); }) }; ///< Attributes attached to ClassElement. Lambda is required here as AZStdFunctorAllocator expects a function pointer - ///< that returns an IAllocatorAllocate& and the AZ::AllocatorInstance::Get returns an AZ::SystemAllocator& - /// which while it inherits from IAllocatorAllocate, does not work as function pointers do not support covariant return types + ///< that returns an IAllocator& and the AZ::AllocatorInstance::Get returns an AZ::SystemAllocator& + /// which while it inherits from IAllocator, does not work as function pointers do not support covariant return types AttributeOwnership m_attributeOwnership = AttributeOwnership::Parent; int m_flags{}; ///< }; @@ -639,12 +639,12 @@ namespace AZ DataPatchUpgradeHandler m_dataPatchUpgrader; ///< Attributes for this class type. Lambda is required here as AZStdFunctorAllocator expects a function pointer - ///< that returns an IAllocatorAllocate& and the AZ::AllocatorInstance::Get returns an AZ::SystemAllocator& - /// which while it inherits from IAllocatorAllocate, does not work as function pointers do not support covariant return types + ///< that returns an IAllocator& and the AZ::AllocatorInstance::Get returns an AZ::SystemAllocator& + /// which while it inherits from IAllocator, does not work as function pointers do not support covariant return types AZStd::vector m_attributes{AZStdFunctorAllocator(&GetSystemAllocator) }; private: - static IAllocatorAllocate& GetSystemAllocator() + static IAllocator& GetSystemAllocator() { return AZ::AllocatorInstance::Get(); } @@ -2483,7 +2483,7 @@ namespace AZ PerModuleGenericClassInfo(); ~PerModuleGenericClassInfo(); - AZ::IAllocatorAllocate& GetAllocator(); + AZ::IAllocator& GetAllocator(); void AddGenericClassInfo(AZ::GenericClassInfo* genericClassInfo); void RemoveGenericClassInfo(const AZ::TypeId& canonicalTypeId); @@ -2546,12 +2546,12 @@ namespace AZ template AttributePtr CreateModuleAttribute(T&& attrValue) { - IAllocatorAllocate& moduleAllocator = GetCurrentSerializeContextModule().GetAllocator(); + IAllocator& moduleAllocator = GetCurrentSerializeContextModule().GetAllocator(); void* rawMemory = moduleAllocator.Allocate(sizeof(ContainerType), alignof(ContainerType)); new (rawMemory) ContainerType{ AZStd::forward(attrValue) }; auto attributeDeleter = [](Attribute* attribute) { - IAllocatorAllocate& moduleAllocator = GetCurrentSerializeContextModule().GetAllocator(); + IAllocator& moduleAllocator = GetCurrentSerializeContextModule().GetAllocator(); attribute->~Attribute(); moduleAllocator.DeAllocate(attribute); }; diff --git a/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl b/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl index 06d4f76c80..2712baa859 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl @@ -32,7 +32,7 @@ namespace AZ * But as the AZStdAssociativeContainer instance will not be accessed outside of the module it was * created within then this will return this .dll/.exe module allocator */ - classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocatorAllocate& { return GetCurrentSerializeContextModule().GetAllocator(); })); + classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocator& { return GetCurrentSerializeContextModule().GetAllocator(); })); } template @@ -429,7 +429,7 @@ namespace AZ // the serialize context dll module allocator has to be used to manage the lifetime of the ClassData attributes within a module // If a module which reflects a variant is unloaded, then the dll module allocator will properly unreflect the variant type from the serialize context // for this particular module - AZStdFunctorAllocator dllAllocator([]() -> IAllocatorAllocate& { return GetCurrentSerializeContextModule().GetAllocator(); }); + AZStdFunctorAllocator dllAllocator([]() -> IAllocator& { return GetCurrentSerializeContextModule().GetAllocator(); }); m_classData.m_attributes.set_allocator(AZStd::move(dllAllocator)); // Create the ObjectStreamWriteOverrideCB in the current module diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index e8001f7215..b8ea9d3f39 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -362,8 +362,6 @@ set(FILES Memory/AllocatorBase.h Memory/AllocatorManager.cpp Memory/AllocatorManager.h - Memory/AllocatorOverrideShim.cpp - Memory/AllocatorOverrideShim.h Memory/AllocatorWrapper.h Memory/AllocatorScope.h Memory/BestFitExternalMapAllocator.cpp diff --git a/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp b/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp index c982868c4f..dd2597334d 100644 --- a/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp @@ -1400,7 +1400,7 @@ namespace UnitTest { using ContainerType = ContainerTemplate, AZStd::equal_to, AZ::AZStdIAllocator>; - static ContainerType Create(std::initializer_list intList, AZ::IAllocatorAllocate* allocatorInstance) + static ContainerType Create(std::initializer_list intList, AZ::IAllocator* allocatorInstance) { ContainerType allocatorSet(intList, AZStd::hash{}, AZStd::equal_to{}, AZ::AZStdIAllocator{ allocatorInstance }); return allocatorSet; @@ -1798,7 +1798,7 @@ namespace UnitTest { using ContainerType = ContainerTemplate, AZStd::equal_to, AZ::AZStdIAllocator>; - static ContainerType Create(std::initializer_list intList, AZ::IAllocatorAllocate* allocatorInstance) + static ContainerType Create(std::initializer_list intList, AZ::IAllocator* allocatorInstance) { ContainerType allocatorMap(intList, AZStd::hash{}, AZStd::equal_to{}, AZ::AZStdIAllocator{ allocatorInstance }); return allocatorMap; diff --git a/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp b/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp index 26838eeb63..3f3bc86ed6 100644 --- a/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp @@ -1082,7 +1082,7 @@ namespace UnitTest { using ContainerType = ContainerTemplate, AZ::AZStdIAllocator>; - static ContainerType Create(std::initializer_list intList, AZ::IAllocatorAllocate* allocatorInstance) + static ContainerType Create(std::initializer_list intList, AZ::IAllocator* allocatorInstance) { ContainerType allocatorSet(intList, AZStd::less{}, AZ::AZStdIAllocator{ allocatorInstance }); return allocatorSet; @@ -1503,7 +1503,7 @@ namespace UnitTest { using ContainerType = ContainerTemplate, AZ::AZStdIAllocator>; - static ContainerType Create(std::initializer_list intList, AZ::IAllocatorAllocate* allocatorInstance) + static ContainerType Create(std::initializer_list intList, AZ::IAllocator* allocatorInstance) { ContainerType allocatorMap(intList, AZStd::less{}, AZ::AZStdIAllocator{ allocatorInstance }); return allocatorMap; diff --git a/Code/Framework/AzCore/Tests/Memory.cpp b/Code/Framework/AzCore/Tests/Memory.cpp index 5287167c8b..0e0103d162 100644 --- a/Code/Framework/AzCore/Tests/Memory.cpp +++ b/Code/Framework/AzCore/Tests/Memory.cpp @@ -87,7 +87,7 @@ namespace UnitTest #endif void* addresses[numAllocations] = {nullptr}; - IAllocatorAllocate& sysAlloc = AllocatorInstance::Get(); + IAllocator& sysAllocator = AllocatorInstance::Get(); ////////////////////////////////////////////////////////////////////////// // Allocate @@ -96,19 +96,19 @@ namespace UnitTest { AZStd::size_t size = AZStd::GetMax(rand() % 256, 1); // supply all debug info, so we don't need to record the stack. - addresses[i] = sysAlloc.Allocate(size, 8, 0, "Test Alloc", __FILE__, __LINE__); + addresses[i] = sysAllocator.Allocate(size, 8, 0, "Test Alloc", __FILE__, __LINE__); memset(addresses[i], 1, size); totalAllocSize += size; } ////////////////////////////////////////////////////////////////////////// - EXPECT_GE(sysAlloc.NumAllocatedBytes(), totalAllocSize); + EXPECT_GE(sysAllocator.NumAllocatedBytes(), totalAllocSize); ////////////////////////////////////////////////////////////////////////// // Deallocate for (int i = numAllocations-1; i >=0; --i) { - sysAlloc.DeAllocate(addresses[i]); + sysAllocator.DeAllocate(addresses[i]); } ////////////////////////////////////////////////////////////////////////// } @@ -122,21 +122,21 @@ namespace UnitTest { AllocatorInstance::Create(); - IAllocatorAllocate& sysAlloc = AllocatorInstance::Get(); + IAllocator& sysAllocator = AllocatorInstance::Get(); for (int i = 0; i < 100; ++i) { - address[i] = sysAlloc.Allocate(1000, 32, 0); + address[i] = sysAllocator.Allocate(1000, 32, 0); EXPECT_NE(nullptr, address[i]); EXPECT_EQ(0, ((size_t)address[i] & 31)); // check alignment - EXPECT_GE(sysAlloc.AllocationSize(address[i]), 1000); // check allocation size + EXPECT_GE(sysAllocator.AllocationSize(address[i]), 1000); // check allocation size } - EXPECT_GE(sysAlloc.NumAllocatedBytes(), 100000); // we requested 100 * 1000 so we should have at least this much allocated + EXPECT_GE(sysAllocator.NumAllocatedBytes(), 100000); // we requested 100 * 1000 so we should have at least this much allocated for (int i = 0; i < 100; ++i) { - sysAlloc.DeAllocate(address[i]); + sysAllocator.DeAllocate(address[i]); } //////////////////////////////////////////////////////////////////////// @@ -168,18 +168,17 @@ namespace UnitTest SystemAllocator::Descriptor descriptor; descriptor.m_stackRecordLevels = 20; AllocatorInstance::Create(descriptor); - IAllocator& sysAllocator = AllocatorInstance::GetAllocator(); - IAllocatorAllocate& sysAlloc = *sysAllocator.GetAllocationSource(); + IAllocator& sysAllocator = AllocatorInstance::Get(); for (int i = 0; i < 100; ++i) { - address[i] = sysAlloc.Allocate(1000, 32, 0); + address[i] = sysAllocator.Allocate(1000, 32, 0); EXPECT_NE(nullptr, address[i]); EXPECT_EQ(0, ((size_t)address[i] & 31)); // check alignment - EXPECT_GE(sysAlloc.AllocationSize(address[i]), 1000); // check allocation size + EXPECT_GE(sysAllocator.AllocationSize(address[i]), 1000); // check allocation size } - EXPECT_TRUE(sysAlloc.NumAllocatedBytes() >= 100000); // we requested 100 * 1000 so we should have at least this much allocated + EXPECT_TRUE(sysAllocator.NumAllocatedBytes() >= 100000); // we requested 100 * 1000 so we should have at least this much allocated // If tracking and recording is enabled, we can verify that the alloc info is valid #if defined(AZ_DEBUG_BUILD) @@ -192,7 +191,7 @@ namespace UnitTest const Debug::AllocationInfo& ai = iter->second; EXPECT_EQ(32, ai.m_alignment); EXPECT_EQ(1000, ai.m_byteSize); - EXPECT_EQ(nullptr, ai.m_fileName); // We did not pass fileName or lineNum to sysAlloc.Allocate() + EXPECT_EQ(nullptr, ai.m_fileName); // We did not pass fileName or lineNum to sysAllocator.Allocate() EXPECT_EQ(0, ai.m_lineNum); // -- " -- # if defined(AZ_PLATFORM_WINDOWS) // if our hardware support stack traces make sure we have them, since we did not provide fileName,lineNum @@ -229,47 +228,47 @@ namespace UnitTest // Free all memory for (int i = 0; i < 100; ++i) { - sysAlloc.DeAllocate(address[i]); + sysAllocator.DeAllocate(address[i]); } - sysAlloc.GarbageCollect(); - EXPECT_LT(sysAlloc.NumAllocatedBytes(), 1024); // We freed everything from a memspace, we should have only a very minor chunk of data + sysAllocator.GarbageCollect(); + EXPECT_LT(sysAllocator.NumAllocatedBytes(), 1024); // We freed everything from a memspace, we should have only a very minor chunk of data ////////////////////////////////////////////////////////////////////////// // realloc test address[0] = nullptr; static const unsigned int checkValue = 0x0badbabe; // create tree (non pool) allocation (we usually pool < 256 bytes) - address[0] = sysAlloc.Allocate(2048, 16); + address[0] = sysAllocator.Allocate(2048, 16); *(unsigned*)(address[0]) = checkValue; // set check value - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 2048, 16); - address[0] = sysAlloc.ReAllocate(address[0], 1024, 16); // test tree big -> tree small + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 2048, 16); + address[0] = sysAllocator.ReAllocate(address[0], 1024, 16); // test tree big -> tree small EXPECT_EQ(checkValue, *(unsigned*)address[0]); - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 1024, 16); - address[0] = sysAlloc.ReAllocate(address[0], 4096, 16); // test tree small -> tree big - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 4096, 16); + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 1024, 16); + address[0] = sysAllocator.ReAllocate(address[0], 4096, 16); // test tree small -> tree big + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 4096, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 128, 16); // test tree -> pool, - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 128, 16); + address[0] = sysAllocator.ReAllocate(address[0], 128, 16); // test tree -> pool, + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 128, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 64, 16); // pool big -> pool small - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 64, 16); + address[0] = sysAllocator.ReAllocate(address[0], 64, 16); // pool big -> pool small + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 64, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 64, 16); // pool sanity check - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 64, 16); + address[0] = sysAllocator.ReAllocate(address[0], 64, 16); // pool sanity check + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 64, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 192, 16); // pool small -> pool big - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 192, 16); + address[0] = sysAllocator.ReAllocate(address[0], 192, 16); // pool small -> pool big + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 192, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 2048, 16); // pool -> tree - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 2048, 16); + address[0] = sysAllocator.ReAllocate(address[0], 2048, 16); // pool -> tree + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 2048, 16); ; EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 2048, 16); // tree sanity check - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 2048, 16); + address[0] = sysAllocator.ReAllocate(address[0], 2048, 16); // tree sanity check + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 2048, 16); ; EXPECT_EQ(checkValue, *(unsigned*)address[0]); - sysAlloc.DeAllocate(address[0], 2048, 16); + sysAllocator.DeAllocate(address[0], 2048, 16); // TODO realloc with different alignment tests ////////////////////////////////////////////////////////////////////////// @@ -340,8 +339,7 @@ namespace UnitTest void run() { - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); - IAllocator& poolAllocator = AllocatorInstance::GetAllocator(); + IAllocator& poolAllocator = AllocatorInstance::Get(); // 64 should be the max number of different pool sizes we can allocate. void* address[64]; ////////////////////////////////////////////////////////////////////////// @@ -352,12 +350,12 @@ namespace UnitTest int i = 0; for (int size = 8; size <= 256; ++i, size += 8) { - address[i] = poolAlloc.Allocate(size, 8); - EXPECT_GE(poolAlloc.AllocationSize(address[i]), (AZStd::size_t)size); + address[i] = poolAllocator.Allocate(size, 8); + EXPECT_GE(poolAllocator.AllocationSize(address[i]), (AZStd::size_t)size); memset(address[i], 1, size); } - EXPECT_GE(poolAlloc.NumAllocatedBytes(), 4126); + EXPECT_GE(poolAllocator.NumAllocatedBytes(), 4126); if (poolAllocator.GetRecords()) { @@ -369,11 +367,11 @@ namespace UnitTest for (i = 0; address[i] != nullptr; ++i) { - poolAlloc.DeAllocate(address[i]); + poolAllocator.DeAllocate(address[i]); } ////////////////////////////////////////////////////////////////////////// - EXPECT_EQ(0, poolAlloc.NumAllocatedBytes()); + EXPECT_EQ(0, poolAllocator.NumAllocatedBytes()); if (poolAllocator.GetRecords()) { @@ -393,13 +391,13 @@ namespace UnitTest memset(address, 0, AZ_ARRAY_SIZE(address)*sizeof(void*)); for (unsigned int j = 0; j < AZ_ARRAY_SIZE(address); ++j) { - address[j] = poolAlloc.Allocate(256, 8, 0, "Pool Alloc", "This File", 123); - EXPECT_GE(poolAlloc.AllocationSize(address[j]), 256); + address[j] = poolAllocator.Allocate(256, 8, 0, "Pool Alloc", "This File", 123); + EXPECT_GE(poolAllocator.AllocationSize(address[j]), 256); memset(address[j], 1, 256); } // AllocatorManager::Instance().ResetMemoryBreak(0); - EXPECT_GE(poolAlloc.NumAllocatedBytes(), AZ_ARRAY_SIZE(address)*256); + EXPECT_GE(poolAllocator.NumAllocatedBytes(), AZ_ARRAY_SIZE(address)*256); if (poolAllocator.GetRecords()) { @@ -411,11 +409,11 @@ namespace UnitTest for (unsigned int j = 0; j < AZ_ARRAY_SIZE(address); ++j) { - poolAlloc.DeAllocate(address[j]); + poolAllocator.DeAllocate(address[j]); } ////////////////////////////////////////////////////////////////////////// - EXPECT_EQ(0, poolAlloc.NumAllocatedBytes()); + EXPECT_EQ(0, poolAllocator.NumAllocatedBytes()); if (poolAllocator.GetRecords()) { @@ -541,14 +539,14 @@ namespace UnitTest #endif void* addresses[numAllocations] = {nullptr}; - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); ////////////////////////////////////////////////////////////////////////// // Allocate for (int i = 0; i < numAllocations; ++i) { AZStd::size_t size = AZStd::GetMax(1, ((i + 1) * 2) % 256); - addresses[i] = poolAlloc.Allocate(size, 8, 0, "Test Alloc", __FILE__, __LINE__); + addresses[i] = poolAllocator.Allocate(size, 8, 0, "Test Alloc", __FILE__, __LINE__); EXPECT_NE(addresses[i], nullptr); memset(addresses[i], 1, size); } @@ -558,7 +556,7 @@ namespace UnitTest // Deallocate for (int i = numAllocations-1; i >=0; --i) { - poolAlloc.DeAllocate(addresses[i]); + poolAllocator.DeAllocate(addresses[i]); } ////////////////////////////////////////////////////////////////////////// } @@ -568,12 +566,12 @@ namespace UnitTest */ void SharedAlloc() { - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); for (int i = 0; i < m_numSharedAlloc; ++i) { AZStd::size_t minSize = sizeof(AllocClass); AZStd::size_t size = AZStd::GetMax((AZStd::size_t)(rand() % 256), minSize); - AllocClass* ac = reinterpret_cast(poolAlloc.Allocate(size, AZStd::alignment_of::value, 0, "Shared Alloc", __FILE__, __LINE__)); + AllocClass* ac = reinterpret_cast(poolAllocator.Allocate(size, AZStd::alignment_of::value, 0, "Shared Alloc", __FILE__, __LINE__)); AZStd::lock_guard lock(m_mutex); m_sharedAlloc.push_back(*ac); } @@ -584,7 +582,7 @@ namespace UnitTest */ void SharedDeAlloc() { - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); AllocClass* ac; int isDone = 0; while (isDone!=2) @@ -594,7 +592,7 @@ namespace UnitTest { ac = &m_sharedAlloc.front(); m_sharedAlloc.pop_front(); - poolAlloc.DeAllocate(ac); + poolAllocator.DeAllocate(ac); } if (m_doneSharedAlloc) // once we know we don't add more elements, make one last check and exit. @@ -633,8 +631,7 @@ namespace UnitTest void run() { - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); - IAllocator& poolAllocator = AllocatorInstance::GetAllocator(); + IAllocator& poolAllocator = AllocatorInstance::Get(); // 64 should be the max number of different pool sizes we can allocate. void* address[64]; ////////////////////////////////////////////////////////////////////////// @@ -645,12 +642,12 @@ namespace UnitTest int j = 0; for (int size = 8; size <= 256; ++j, size += 8) { - address[j] = poolAlloc.Allocate(size, 8); - EXPECT_GE(poolAlloc.AllocationSize(address[j]), (AZStd::size_t)size); + address[j] = poolAllocator.Allocate(size, 8); + EXPECT_GE(poolAllocator.AllocationSize(address[j]), (AZStd::size_t)size); memset(address[j], 1, size); } - EXPECT_GE(poolAlloc.NumAllocatedBytes(), 4126); + EXPECT_GE(poolAllocator.NumAllocatedBytes(), 4126); if (poolAllocator.GetRecords()) { @@ -662,11 +659,11 @@ namespace UnitTest for (int i = 0; address[i] != nullptr; ++i) { - poolAlloc.DeAllocate(address[i]); + poolAllocator.DeAllocate(address[i]); } ////////////////////////////////////////////////////////////////////////// - EXPECT_EQ(0, poolAlloc.NumAllocatedBytes()); + EXPECT_EQ(0, poolAllocator.NumAllocatedBytes()); if (poolAllocator.GetRecords()) { @@ -681,12 +678,12 @@ namespace UnitTest memset(address, 0, AZ_ARRAY_SIZE(address)*sizeof(void*)); for (unsigned int i = 0; i < AZ_ARRAY_SIZE(address); ++i) { - address[i] = poolAlloc.Allocate(256, 8); - EXPECT_GE(poolAlloc.AllocationSize(address[i]), 256); + address[i] = poolAllocator.Allocate(256, 8); + EXPECT_GE(poolAllocator.AllocationSize(address[i]), 256); memset(address[i], 1, 256); } - EXPECT_GE(poolAlloc.NumAllocatedBytes(), AZ_ARRAY_SIZE(address)*256); + EXPECT_GE(poolAllocator.NumAllocatedBytes(), AZ_ARRAY_SIZE(address)*256); if (poolAllocator.GetRecords()) { @@ -698,11 +695,11 @@ namespace UnitTest for (unsigned int i = 0; i < AZ_ARRAY_SIZE(address); ++i) { - poolAlloc.DeAllocate(address[i]); + poolAllocator.DeAllocate(address[i]); } ////////////////////////////////////////////////////////////////////////// - EXPECT_EQ(0, poolAlloc.NumAllocatedBytes()); + EXPECT_EQ(0, poolAllocator.NumAllocatedBytes()); if (poolAllocator.GetRecords()) { @@ -820,7 +817,7 @@ namespace UnitTest desc.m_memoryBlock = azmalloc(desc.m_memoryBlockByteSize, desc.m_memoryBlockAlignment); AllocatorInstance::Create(desc); - IAllocatorAllocate& bfAlloc = AllocatorInstance::Get(); + IAllocator& bfAlloc = AllocatorInstance::Get(); EXPECT_EQ( desc.m_memoryBlockByteSize, bfAlloc.Capacity() ); EXPECT_EQ( 0, bfAlloc.NumAllocatedBytes() ); @@ -882,8 +879,8 @@ namespace UnitTest void run() { - IAllocator& sysAllocator = AllocatorInstance::GetAllocator(); - IAllocator& poolAllocator = AllocatorInstance::GetAllocator(); + IAllocator& sysAllocator = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); void* ptr = azmalloc(16*1024, 32, SystemAllocator); EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment @@ -1010,27 +1007,27 @@ namespace UnitTest void run() { - IAllocator& sysAlloc = AllocatorInstance::GetAllocator(); - IAllocator& poolAlloc = AllocatorInstance::GetAllocator(); + IAllocator& sysAllocator = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); MyClass* ptr = aznew MyClass(202); /// this should allocate memory from the pool allocator EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment EXPECT_EQ(202, ptr->m_data); // check value - if (poolAlloc.GetRecords()) + if (poolAllocator.GetRecords()) { - AZStd::lock_guard lock(*poolAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = poolAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*poolAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = poolAllocator.GetRecords()->GetMap(); Debug::AllocationRecordsType::const_iterator iter = records.find(ptr); EXPECT_TRUE(iter!=records.end()); // our allocation is in the list EXPECT_STREQ(iter->second.m_name, "MyClass"); } delete ptr; - if (poolAlloc.GetRecords()) + if (poolAllocator.GetRecords()) { - AZStd::lock_guard lock(*poolAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = poolAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*poolAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = poolAllocator.GetRecords()->GetMap(); EXPECT_TRUE(records.find(ptr)==records.end()); // our allocation is NOT in the list } @@ -1038,19 +1035,19 @@ namespace UnitTest ptr = azcreate(MyClass, (101), SystemAllocator); EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment EXPECT_EQ(101, ptr->m_data); // check value - if (sysAlloc.GetRecords()) + if (sysAllocator.GetRecords()) { - AZStd::lock_guard lock(*sysAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = sysAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*sysAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = sysAllocator.GetRecords()->GetMap(); Debug::AllocationRecordsType::const_iterator iter = records.find(ptr); EXPECT_TRUE(iter!=records.end()); // our allocation is in the list EXPECT_STREQ(iter->second.m_name, "MyClass"); } azdestroy(ptr, SystemAllocator); - if (sysAlloc.GetRecords()) + if (sysAllocator.GetRecords()) { - AZStd::lock_guard lock(*sysAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = sysAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*sysAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = sysAllocator.GetRecords()->GetMap(); EXPECT_TRUE(records.find(ptr)==records.end()); // our allocation is NOT in the list } @@ -1059,19 +1056,19 @@ namespace UnitTest ptr = azcreate(MyClass, (505), SystemAllocator, "MyClassNamed"); EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment EXPECT_EQ(505, ptr->m_data); // check value - if (sysAlloc.GetRecords()) + if (sysAllocator.GetRecords()) { - AZStd::lock_guard lock(*sysAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = sysAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*sysAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = sysAllocator.GetRecords()->GetMap(); Debug::AllocationRecordsType::const_iterator iter = records.find(ptr); EXPECT_TRUE(iter!=records.end()); // our allocation is in the list EXPECT_STREQ(iter->second.m_name, "MyClassNamed"); } azdestroy(ptr); // imply SystemAllocator - if (sysAlloc.GetRecords()) + if (sysAllocator.GetRecords()) { - AZStd::lock_guard lock(*sysAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = sysAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*sysAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = sysAllocator.GetRecords()->GetMap(); EXPECT_TRUE(records.find(ptr)==records.end()); // our allocation is NOT in the list } @@ -1080,20 +1077,20 @@ namespace UnitTest EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment EXPECT_EQ(303, ptr->m_data); // check value - if (poolAlloc.GetRecords()) + if (poolAllocator.GetRecords()) { - AZStd::lock_guard lock(*poolAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = poolAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*poolAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = poolAllocator.GetRecords()->GetMap(); Debug::AllocationRecordsType::const_iterator iter = records.find(ptr); EXPECT_TRUE(iter != records.end()); // our allocation is in the list EXPECT_STREQ(iter->second.m_name, "MyClass"); } delete ptr; - if (poolAlloc.GetRecords()) + if (poolAllocator.GetRecords()) { - AZStd::lock_guard lock(*poolAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = poolAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*poolAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = poolAllocator.GetRecords()->GetMap(); EXPECT_TRUE(records.find(ptr) == records.end()); // our allocation is NOT in the list } } @@ -1140,8 +1137,8 @@ namespace UnitTest return (size_t)1 << (size_t)(MAX_ALIGNMENT_LOG2 * r); } - class DebugSysAlloc - : public AZ::IAllocatorAllocate + class DebugSysAllocSchema + : public AZ::IAllocatorSchema { pointer_type Allocate(size_type byteSize, size_type alignment, int flags, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override { @@ -1176,8 +1173,6 @@ namespace UnitTest size_type GetMaxAllocationSize() const override { return 1 * 1024 * 1024 * 1024; } /// Returns max allocation size of a single contiguous allocation size_type GetMaxContiguousAllocationSize() const override { return 1 * 1024 * 1024 * 1024; } - /// Returns a pointer to a sub-allocator or NULL. - IAllocatorAllocate* GetSubAllocator() override { return NULL; } }; public: void SetUp() override @@ -2565,7 +2560,7 @@ namespace UnitTest printf("\n\t\t\t=======================\n"); printf("\t\t\tSchemas Benchmark Test!\n"); printf("\t\t\t=======================\n"); - DebugSysAlloc da; + DebugSysAllocSchema da; { HphaSchema::Descriptor hphaDesc; hphaDesc.m_fixedMemoryBlockByteSize = AZ_TRAIT_OS_HPHA_MEMORYBLOCKBYTESIZE; diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 5cf5176308..7870749d24 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -112,7 +112,6 @@ namespace Benchmark { } - // IAllocatorAllocate static void* Allocate(size_t byteSize, size_t) { s_numAllocatedBytes += byteSize; @@ -580,6 +579,7 @@ namespace Benchmark //BM_REGISTER_ALLOCATOR(BestFitExternalMapAllocator, BestFitExternalMapAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator //BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating + // BM_REGISTER_ALLOCATOR(OSAllocator, OSAllocator); // Requires special treatment to initialize since it will be already initialized, maybe creating a different instance? #undef BM_REGISTER_ALLOCATOR #undef BM_REGISTER_SIZE_FIXTURES diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorManager.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorManager.cpp index dc8ac033c1..bc758c1544 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorManager.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorManager.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include @@ -47,9 +46,6 @@ namespace UnitTest void RunTests() { - TestAllocatorShimWithDeallocateAfter(); - TestAllocatorShimRemovedAfterFinalization(); - TestAllocatorShimUsedForRealloc(); TearDownAllocatorManagerTest(); } @@ -64,7 +60,7 @@ namespace UnitTest EXPECT_EQ(m_manager->GetNumAllocators(), 0); AllocatorInstance::Create(); EXPECT_EQ(m_manager->GetNumAllocators(), 2); // SystemAllocator creates the OSAllocator if it doesn't exist - m_systemAllocator = &AllocatorInstance::GetAllocator(); + m_systemAllocator = &AllocatorInstance::Get(); } void TearDownAllocatorManagerTest() @@ -83,85 +79,6 @@ namespace UnitTest m_systemAllocator = nullptr; } - void TestAllocatorShimWithDeallocateAfter() - { - SetUpAllocatorManagerTest(); - - // Should begin with a shim installed. If this fails, check that AZCORE_MEMORY_ENABLE_OVERRIDES is enabled in AllocatorManager.cpp. - EXPECT_NE(m_systemAllocator->GetAllocationSource(), m_systemAllocator->GetOriginalAllocationSource()); - - const int testAllocBytes = TEST_ALLOC_BYTES; - - // Allocate from the shim, which should take from the allocator's original source - void* p = m_systemAllocator->GetAllocationSource()->Allocate(testAllocBytes, 0, 0); - EXPECT_NE(p, nullptr); - EXPECT_EQ(m_systemAllocator->GetOriginalAllocationSource()->NumAllocatedBytes(), testAllocBytes); - - // Add the override schema - m_manager->SetOverrideAllocatorSource(&m_mallocSchema); - - // Allocations should go through malloc schema instead of the allocator's regular schema - void* q = m_systemAllocator->GetAllocationSource()->Allocate(testAllocBytes, 0, 0); - EXPECT_NE(q, nullptr); - EXPECT_EQ(m_mallocSchema.NumAllocatedBytes(), testAllocBytes); - EXPECT_EQ(m_systemAllocator->GetOriginalAllocationSource()->NumAllocatedBytes(), testAllocBytes); - - // Finalize configuration, no more shims should be created after this point - m_manager->FinalizeConfiguration(); - - // Deallocating the original orphaned allocation from the SystemAllocator should remove the shim - EXPECT_NE(m_systemAllocator->GetAllocationSource(), &m_mallocSchema); - m_systemAllocator->GetAllocationSource()->DeAllocate(p); - EXPECT_EQ(m_systemAllocator->GetAllocationSource(), &m_mallocSchema); - - // Clean up - m_systemAllocator->GetAllocationSource()->DeAllocate(q); - } - - void TestAllocatorShimRemovedAfterFinalization() - { - SetUpAllocatorManagerTest(); - - // Should begin with a shim installed - EXPECT_NE(m_systemAllocator->GetAllocationSource(), m_systemAllocator->GetOriginalAllocationSource()); - - // Finalizing the configuration should remove the shim if it was unused - m_manager->FinalizeConfiguration(); - EXPECT_EQ(m_systemAllocator->GetAllocationSource(), m_systemAllocator->GetOriginalAllocationSource()); - } - - void TestAllocatorShimUsedForRealloc() - { - SetUpAllocatorManagerTest(); - - // Should begin with a shim installed - EXPECT_NE(m_systemAllocator->GetAllocationSource(), m_systemAllocator->GetOriginalAllocationSource()); - - const int testAllocBytes = TEST_ALLOC_BYTES; - - // Allocate from the shim, which should take from the allocator's original source - void* p = m_systemAllocator->GetAllocationSource()->Allocate(testAllocBytes, 0, 0); - EXPECT_NE(p, nullptr); - EXPECT_EQ(m_systemAllocator->GetOriginalAllocationSource()->NumAllocatedBytes(), testAllocBytes); - - // Add the override schema and finalize - m_manager->SetOverrideAllocatorSource(&m_mallocSchema); - m_manager->FinalizeConfiguration(); - - // Shim should still be present - EXPECT_NE(m_systemAllocator->GetAllocationSource(), &m_mallocSchema); - - // Reallocation should move allocation from the old source to the new source - EXPECT_EQ(m_mallocSchema.NumAllocatedBytes(), 0); - void* q = m_systemAllocator->GetAllocationSource()->ReAllocate(p, testAllocBytes * 2, 0); - EXPECT_NE(p, q); - EXPECT_EQ(m_mallocSchema.NumAllocatedBytes(), testAllocBytes * 2); - EXPECT_EQ(m_systemAllocator->GetOriginalAllocationSource()->NumAllocatedBytes(), 0); - - // Reallocation should also have removed the shim as it was no longer necessary - EXPECT_EQ(m_systemAllocator->GetAllocationSource(), &m_mallocSchema); - } - MallocSchema m_mallocSchema; AllocatorManager* m_manager = nullptr; IAllocator* m_systemAllocator = nullptr; diff --git a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp index 04802a8d0e..c2fba5c5a3 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp @@ -1975,7 +1975,7 @@ namespace AZ::IO AZ_Error("Archive", false, "OSAllocator is not ready. It cannot be used to allocate a MemoryBlock"); return {}; } - AZ::IAllocatorAllocate* allocator = &AZ::AllocatorInstance::Get(); + AZ::IAllocator* allocator = &AZ::AllocatorInstance::Get(); AZStd::intrusive_ptr memoryBlock{ new (allocator->Allocate(sizeof(AZ::IO::MemoryBlock), alignof(AZ::IO::MemoryBlock))) AZ::IO::MemoryBlock{AZ::IO::MemoryBlockDeleter{ &AZ::AllocatorInstance::Get() }} }; auto CreateFunc = [](size_t byteSize, size_t byteAlignment, const char* name) { diff --git a/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h b/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h index d7eaee6e24..0bbc5aaaab 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h +++ b/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h @@ -36,7 +36,7 @@ namespace AZ::IO struct MemoryBlockDeleter { void operator()(const AZStd::intrusive_refcount* ptr) const; - AZ::IAllocatorAllocate* m_allocator{}; + AZ::IAllocator* m_allocator{}; }; struct MemoryBlock : AZStd::intrusive_refcount diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.cpp b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.cpp index 13d5b0f723..05c773f056 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.cpp @@ -42,7 +42,7 @@ namespace AZ::IO::ZipDir AZ_Error("Archive", false, "OSAllocator is not ready. It cannot be used to allocate a MemoryBlock"); return {}; } - AZ::IAllocatorAllocate* allocator = &AZ::AllocatorInstance::Get(); + AZ::IAllocator* allocator = &AZ::AllocatorInstance::Get(); AZStd::intrusive_ptr memoryBlock{ new (allocator->Allocate(sizeof(AZ::IO::MemoryBlock), alignof(AZ::IO::MemoryBlock))) AZ::IO::MemoryBlock{AZ::IO::MemoryBlockDeleter{ &AZ::AllocatorInstance::Get() }} }; auto CreateFunc = [](size_t byteSize, size_t byteAlignment, const char* name) { @@ -142,14 +142,14 @@ namespace AZ::IO::ZipDir { } - Cache::Cache(AZ::IAllocatorAllocate* allocator) + Cache::Cache(AZ::IAllocator* allocator) : m_fileHandle(AZ::IO::InvalidHandle) , m_nFlags(0) , m_lCDROffset(0) , m_encryptedHeaders(ZipFile::HEADERS_NOT_ENCRYPTED) , m_allocator{ allocator } { - AZ_Assert(allocator, "IAllocatorAllocate object is required in order to allocated memory for the ZipDir Cache operations"); + AZ_Assert(allocator, "IAllocator object is required in order to allocated memory for the ZipDir Cache operations"); } void Cache::Close() diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.h b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.h index ae1e3dfa9c..c8b19ebf33 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.h +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.h @@ -40,7 +40,7 @@ namespace AZ::IO::ZipDir inline static constexpr int compressedBlockHeaderSizeInBytes = 4; //number of bytes we need in front of the compressed block to indicate which compressor was used Cache(); - explicit Cache(AZ::IAllocatorAllocate* allocator); + explicit Cache(AZ::IAllocator* allocator); ~Cache() { @@ -133,7 +133,7 @@ namespace AZ::IO::ZipDir friend class FileEntryTransactionAdd; FileEntryTree m_treeDir; AZ::IO::HandleType m_fileHandle; - AZ::IAllocatorAllocate* m_allocator; + AZ::IAllocator* m_allocator; AZ::IO::Path m_strFilePath; // String Pool for persistently storing paths as long as they reside in the cache diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.cpp b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.cpp index ab9c356d7f..9ad58443a0 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.cpp @@ -39,7 +39,7 @@ namespace AZ::IO::ZipDir { } - auto FileDataRecord::New(const FileRecord& rThat, AZ::IAllocatorAllocate* allocator) -> AZStd::intrusive_ptr + auto FileDataRecord::New(const FileRecord& rThat, AZ::IAllocator* allocator) -> AZStd::intrusive_ptr { auto fileDataRecordAlloc = reinterpret_cast(allocator->Allocate( sizeof(FileDataRecord) + rThat.pFileEntryBase->desc.lSizeCompressed, diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.h b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.h index 1183dbf384..2a4df44f2d 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.h +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.h @@ -28,7 +28,7 @@ namespace AZ::IO::ZipDir { void operator()(const AZStd::intrusive_refcount* ptr) const; - AZ::IAllocatorAllocate* m_allocator{}; + AZ::IAllocator* m_allocator{}; }; struct FileDataRecord : public FileRecord @@ -36,7 +36,7 @@ namespace AZ::IO::ZipDir { FileDataRecord(); - static auto New(const FileRecord& rThat, AZ::IAllocatorAllocate* allocator) ->AZStd::intrusive_ptr; + static auto New(const FileRecord& rThat, AZ::IAllocator* allocator) ->AZStd::intrusive_ptr; void* GetData() {return this + 1; } }; diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp index cea517decd..1ac0906c94 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp @@ -25,13 +25,13 @@ namespace AZ::IO::ZipDir::ZipDirStructuresInternal { static void* ZlibAlloc(void* userData, uint32_t item, uint32_t size) { - auto allocator = reinterpret_cast(userData); + auto allocator = reinterpret_cast(userData); return allocator->Allocate(item * size, alignof(uint8_t), 0, "ZLibAlloc"); } static void ZlibFree(void* userData, void* ptr) { - auto allocator = reinterpret_cast(userData); + auto allocator = reinterpret_cast(userData); allocator->DeAllocate(ptr); } @@ -296,7 +296,7 @@ namespace AZ::IO::ZipDir::ZipDirStructuresInternal return {}; } - AZ::IAllocatorAllocate* allocator = &AZ::AllocatorInstance::Get(); + AZ::IAllocator* allocator = &AZ::AllocatorInstance::Get(); AZStd::intrusive_ptr memoryBlock{ new (allocator->Allocate(sizeof(AZ::IO::MemoryBlock), alignof(AZ::IO::MemoryBlock))) AZ::IO::MemoryBlock{AZ::IO::MemoryBlockDeleter{ &AZ::AllocatorInstance::Get() }} }; auto CreateFunc = [](size_t byteSize, size_t byteAlignment, const char* name) { @@ -451,7 +451,7 @@ namespace AZ::IO::ZipDir if (GetDiskFreeSpaceA(drive.c_str(),nullptr, &bytesPerSector, nullptr, nullptr)) { m_nSectorSize = bytesPerSector; - AZ::IAllocatorAllocate& allocator = AZ::AllocatorInstance::Get(); + AZ::IAllocator& allocator = AZ::AllocatorInstance::Get(); if (m_pReadTarget) { allocator.DeAllocate(m_pReadTarget); diff --git a/Code/LauncherUnified/Launcher.h b/Code/LauncherUnified/Launcher.h index 7c4c09c19f..eb1cf6479e 100644 --- a/Code/LauncherUnified/Launcher.h +++ b/Code/LauncherUnified/Launcher.h @@ -62,7 +62,7 @@ namespace O3DELauncher ResourceLimitUpdater m_updateResourceLimits = nullptr; //!< callback for updating system resources, if necessary OnPostApplicationStart m_onPostAppStart = nullptr; //!< callback notifying the platform specific entry point that AzGameFramework::GameApplication::Start has been called - AZ::IAllocatorAllocate* m_allocator = nullptr; //!< Used to allocate the temporary bootstrap memory, as well as the main \ref SystemAllocator heap. If null, OSAllocator will be used + AZ::IAllocator* m_allocator = nullptr; //!< Used to allocate the temporary bootstrap memory, as well as the main \ref SystemAllocator heap. If null, OSAllocator will be used const char* m_appResourcesPath = "."; //!< Path to the device specific assets, default is equivalent to blank path in ParseEngineConfig const char* m_appWriteStoragePath = nullptr; //!< Path to writeable storage if different than assets path, used to override userPath and logPath diff --git a/Code/Legacy/CryCommon/CryLegacyAllocator.h b/Code/Legacy/CryCommon/CryLegacyAllocator.h index b0e1e29657..e96c2a9347 100644 --- a/Code/Legacy/CryCommon/CryLegacyAllocator.h +++ b/Code/Legacy/CryCommon/CryLegacyAllocator.h @@ -23,19 +23,9 @@ inline void* CryModuleMallocImpl(size_t size, const char* file, const int line) #define CryModuleFree(ptr) CryModuleFreeImpl(ptr, __FILE__, __LINE__) #define CryModuleMemalignFree(ptr) CryModuleFreeImpl(ptr, __FILE__, __LINE__) -inline void CryModuleFreeImpl(void* ptr, const char* file, const int line) +inline void CryModuleFreeImpl(void* ptr, const char*, const int) { - - AZ::IAllocator& allocator = AZ::AllocatorInstance::GetAllocator(); - - if (allocator.IsAllocationSourceChanged()) - { - allocator.GetAllocationSource()->DeAllocate(ptr); - } - else - { - static_cast(allocator).DeAllocate(ptr, file, line); - } + AZ::AllocatorInstance::Get().DeAllocate(ptr, 0, 0); } #define CryModuleMemalign(size, alignment) CryModuleMemalignImpl(size, alignment, __FILE__, __LINE__) @@ -79,17 +69,5 @@ inline void* CryModuleReallocAlignImpl(void* prev, size_t size, size_t alignment } #endif - AZ::IAllocator& allocator = AZ::AllocatorInstance::GetAllocator(); - void *ptr; - - if (allocator.IsAllocationSourceChanged()) - { - ptr = allocator.GetAllocationSource()->ReAllocate(prev, size, 0); - } - else - { - ptr = static_cast(allocator).ReAllocate(prev, size, 0, file, line); - } - - return ptr; + return AZ::AllocatorInstance::Get().ReAllocate(prev, size, 0); } diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacket.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacket.h index d66a3ea1bb..7995002a39 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacket.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacket.h @@ -13,7 +13,7 @@ namespace AZ { - class IAllocatorAllocate; + class IAllocator; namespace RHI { @@ -66,7 +66,7 @@ namespace AZ DrawPacket() = default; // The allocator used to release the memory when Release() is called. - IAllocatorAllocate* m_allocator = nullptr; + IAllocator* m_allocator = nullptr; // The bit-mask of all active filter tags. DrawListMask m_drawListMask = 0; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h index 021125312b..30e013d486 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h @@ -14,7 +14,7 @@ namespace AZ { - class IAllocatorAllocate; + class IAllocator; namespace RHI { @@ -50,7 +50,7 @@ namespace AZ // NOTE: This is configurable; just used to control the amount of memory held by the builder. static const size_t DrawItemCountMax = 16; - void Begin(IAllocatorAllocate* allocator); + void Begin(IAllocator* allocator); void SetDrawArguments(const DrawArguments& drawArguments); @@ -77,7 +77,7 @@ namespace AZ private: void ClearData(); - IAllocatorAllocate* m_allocator = nullptr; + IAllocator* m_allocator = nullptr; DrawArguments m_drawArguments; DrawListMask m_drawListMask = 0; DrawFilterMask m_drawFilterMask = DrawFilterMaskDefaultValue; diff --git a/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp b/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp index ebda9732df..ec9dd1a14f 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp @@ -18,7 +18,7 @@ namespace AZ { namespace RHI { - void DrawPacketBuilder::Begin(IAllocatorAllocate* allocator) + void DrawPacketBuilder::Begin(IAllocator* allocator) { m_allocator = allocator ? allocator : &AllocatorInstance::Get(); } From 5ff65be3145c43215c4a9e635316016919bdcbfa Mon Sep 17 00:00:00 2001 From: nemerle <96597+nemerle@users.noreply.github.com> Date: Sun, 12 Dec 2021 23:48:47 +0100 Subject: [PATCH 023/620] This reduces non-unity build time by ~2% and build size by ~0.5%. This PR is a 'clean' version of #6199 updated to latest development Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> --- Code/Editor/GameEngine.cpp | 1 + .../AtomCore/Instance/InstanceDatabase.h | 5 + .../AzCore/AzCore/Asset/AssetCommon.h | 2 +- .../AzCore/AzCore/Asset/AssetDataStream.cpp | 98 +++- .../AzCore/AzCore/Asset/AssetDataStream.h | 35 +- .../AzCore/AzCore/Asset/AssetManager.cpp | 1 + .../AzCore/AzCore/Asset/AssetManager.h | 1 - Code/Framework/AzCore/AzCore/IO/IStreamer.h | 6 +- .../AzCore/AzCore/IO/Streamer/BlockCache.cpp | 14 +- .../AzCore/AzCore/IO/Streamer/BlockCache.h | 8 +- .../AzCore/IO/Streamer/DedicatedCache.cpp | 20 +- .../AzCore/IO/Streamer/DedicatedCache.h | 23 +- .../AzCore/AzCore/IO/Streamer/FileRequest.cpp | 143 ++++-- .../AzCore/AzCore/IO/Streamer/FileRequest.h | 485 ++++++++++-------- .../IO/Streamer/FullFileDecompressor.cpp | 46 +- .../AzCore/IO/Streamer/FullFileDecompressor.h | 7 +- .../AzCore/IO/Streamer/ReadSplitter.cpp | 10 +- .../AzCore/AzCore/IO/Streamer/Scheduler.cpp | 50 +- .../AzCore/AzCore/IO/Streamer/Scheduler.h | 19 +- .../AzCore/IO/Streamer/StorageDrive.cpp | 42 +- .../AzCore/AzCore/IO/Streamer/StorageDrive.h | 8 +- .../AzCore/AzCore/IO/Streamer/Streamer.cpp | 7 +- .../AzCore/AzCore/IO/Streamer/Streamer.h | 8 +- .../AzCore/IO/Streamer/StreamerComponent.cpp | 3 +- .../AzCore/IO/Streamer/StreamerContext.cpp | 6 +- .../AzCore/IO/Streamer/StreamerContext.h | 15 +- .../IO/Streamer/StorageDrive_Windows.cpp | 52 +- .../AzCore/IO/Streamer/StorageDrive_Windows.h | 11 +- .../Tests/Asset/AssetDataStreamTests.cpp | 1 + .../IO/Streamer/StorageDriveTests_Windows.cpp | 26 +- .../AzCore/Tests/Streamer/BlockCacheTests.cpp | 16 +- .../Tests/Streamer/FullDecompressorTests.cpp | 2 +- .../AzCore/Tests/Streamer/IStreamerMock.h | 1 + .../Tests/Streamer/ReadSplitterTests.cpp | 10 +- .../AzCore/Tests/Streamer/SchedulerTests.cpp | 7 +- .../StreamStackEntryConformityTests.h | 1 + Code/Framework/AzCore/Tests/StreamerTests.cpp | 1 + .../Asset/AssetSystemComponent.cpp | 1 + .../AzFramework/IO/RemoteStorageDrive.cpp | 42 +- .../AzFramework/IO/RemoteStorageDrive.h | 11 +- .../Physics/Common/PhysicsSimulatedBody.cpp | 1 + .../Common/PhysicsSimulatedBodyAutomation.cpp | 1 + .../Common/PhysicsSimulatedBodyEvents.cpp | 1 + .../AzFramework/Physics/PhysicsScene.cpp | 1 + .../AzFramework/Physics/PhysicsSystem.cpp | 1 + .../AzFramework/Script/ScriptComponent.cpp | 1 + .../ToolsAssetCatalogComponent.h | 1 + .../Model/AssetCompleterModel.h | 5 +- .../AssetBuilder/AssetBuilderComponent.cpp | 1 + .../Shader/ShaderVariantAsyncLoader.h | 6 +- .../Shader/PrecompiledShaderAssetSourceData.h | 1 + .../RPI/Code/Source/RPI.Public/Culling.cpp | 24 +- .../Shader/Metrics/ShaderMetricsSystem.cpp | 4 +- .../Tests/Common/AssetManagerTestFixture.cpp | 2 + .../Atom/Utils/AssetCollectionAsyncLoader.h | 1 + .../Code/Source/AtomActorInstance.cpp | 2 + .../Code/Rendering/SharedBuffer.cpp | 2 + .../Code/Source/Engine/ATLEntities.cpp | 18 + .../Code/Source/Engine/ATLEntities.h | 14 +- .../Code/Source/Engine/FileCacheManager.cpp | 1 + .../Code/Tests/AudioSystemTest.cpp | 1 + .../Code/Tests/Mocks/FileCacheManagerMock.h | 5 + .../Code/EMotionFX/Source/ActorInstance.cpp | 2 + .../Code/Tests/TestAssetCode/SimpleActors.cpp | 2 + .../Asset/AssetSystemDebugComponent.cpp | 2 + .../Audio/AudioAreaEnvironmentComponent.cpp | 1 + .../ClothComponentMesh/ActorClothColliders.h | 1 + Gems/NvCloth/Code/Source/Utils/AssetHelper.h | 1 + .../Joints/JointsSubComponentModeAngleCone.h | 1 + .../Joints/JointsSubComponentModeSnap.h | 1 + .../Code/Source/ForceRegionComponent.cpp | 2 + .../Code/Source/Joint/PhysXJointUtils.cpp | 14 +- .../PhysX/Code/Source/Joint/PhysXJointUtils.h | 7 + Gems/PhysX/Code/Source/JointComponent.cpp | 11 +- Gems/PhysX/Code/Source/Material.cpp | 3 +- .../PhysXCharacters/API/CharacterUtils.cpp | 11 +- .../PhysXCharacters/API/RagdollNode.cpp | 11 +- .../Pipeline/HeightFieldAssetHandler.cpp | 3 +- .../Code/Source/Pipeline/StreamWrapper.h | 1 + Gems/PhysX/Code/Source/Scene/PhysXScene.cpp | 18 +- Gems/PhysX/Code/Source/System/PhysXSystem.cpp | 18 +- Gems/PhysX/Code/Tests/PhysXTestUtil.cpp | 1 + .../Code/Source/SystemComponent.cpp | 23 +- .../Editor/Assets/ScriptCanvasMemoryAsset.cpp | 9 +- .../Windows/Tools/UpgradeTool/FileSaver.cpp | 2 + .../Code/Source/ScriptEventsSystemComponent.h | 1 + .../WhiteBoxVertexTranslationModifier.h | 1 + 87 files changed, 882 insertions(+), 604 deletions(-) diff --git a/Code/Editor/GameEngine.cpp b/Code/Editor/GameEngine.cpp index db4c587f54..3753b5fa37 100644 --- a/Code/Editor/GameEngine.cpp +++ b/Code/Editor/GameEngine.cpp @@ -18,6 +18,7 @@ // AzCore #include #include +#include #include #include diff --git a/Code/Framework/AtomCore/AtomCore/Instance/InstanceDatabase.h b/Code/Framework/AtomCore/AtomCore/Instance/InstanceDatabase.h index 4b4ad572c2..de98ce97b9 100644 --- a/Code/Framework/AtomCore/AtomCore/Instance/InstanceDatabase.h +++ b/Code/Framework/AtomCore/AtomCore/Instance/InstanceDatabase.h @@ -17,6 +17,11 @@ #include #include +namespace AZStd +{ + class any; +} + namespace AZ { namespace Data diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h b/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h index e4d2c7612e..697ca81a49 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h +++ b/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include namespace AZ { diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp index 4794b04626..7c9593fe3d 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp +++ b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp @@ -7,11 +7,61 @@ */ #include +#include +#include +#include +#include +#include + +#include +#include namespace AZ::Data { + namespace Internal + { + struct AssetDataStreamPrivate + { + //! Optional data buffer that's been directly passed in through Open(), instead of reading data from a file. + AZStd::vector m_preloadedData; + //! The current active streamer read request - tracked in case we need to cancel it prematurely + AZ::IO::FileRequestPtr m_curReadRequest{ nullptr }; + + //! Synchronization for the read request, so that it's possible to block until completion. + AZStd::mutex m_readRequestMutex; + AZStd::condition_variable m_readRequestActive; + + void SetReadRequest(AZ::IO::FileRequestPtr&& req) + { + AZStd::scoped_lock lock(m_readRequestMutex); + // The read request finished, so stop tracking it. + m_curReadRequest = AZStd::move(req); + } + void BlockUntilReadComplete() + { + AZStd::unique_lock lock(m_readRequestMutex); + m_readRequestActive.wait( + lock, + [this] + { + return m_curReadRequest == nullptr; + }); + lock.unlock(); + } + void CancelRequest() + { + AZStd::scoped_lock lock(m_readRequestMutex); + if (m_curReadRequest) + { + auto streamer = Interface::Get(); + m_curReadRequest = streamer->Cancel(m_curReadRequest); + } + } + }; + } // namespace Internal AssetDataStream::AssetDataStream(AZ::IO::IStreamerTypes::RequestMemoryAllocator* bufferAllocator) : m_bufferAllocator(bufferAllocator ? bufferAllocator : &m_defaultAllocator) + , m_privateData(new Internal::AssetDataStreamPrivate) { ClearInternalStateData(); } @@ -22,6 +72,7 @@ namespace AZ::Data { Close(); } + delete m_privateData; } @@ -53,9 +104,9 @@ namespace AZ::Data OpenInternal(data.size(), "(mem buffer)"); // Directly take ownership of the provided buffer - m_preloadedData = AZStd::move(data); - m_buffer = m_preloadedData.data(); - m_loadedSize = m_preloadedData.size(); + m_privateData->m_preloadedData = AZStd::move(data); + m_buffer = m_privateData->m_preloadedData.data(); + m_loadedSize = m_privateData->m_preloadedData.size(); } void AssetDataStream::Open(const AZStd::string& filePath, size_t fileOffset, size_t assetSize, @@ -65,7 +116,7 @@ namespace AZ::Data AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(!m_isOpen, "Attempting to open the stream when it is already open."); - AZ_Assert(!m_curReadRequest, "Queueing an asset stream load while one is still in progress."); + AZ_Assert(!m_privateData->m_curReadRequest, "Queueing an asset stream load while one is still in progress."); AZ_Assert(!filePath.empty(), "AssetDataStream::Open called without a valid file name."); // Initialize the state variables and start tracking the overall load timings @@ -97,11 +148,8 @@ namespace AZ::Data "Buffer for %s was expected to be %zu bytes, but is %zu bytes.", m_filePath.c_str(), m_requestedAssetSize, m_loadedSize); - { - AZStd::scoped_lock lock(m_readRequestMutex); - // The read request finished, so stop tracking it. - m_curReadRequest = nullptr; - } + // The read request finished, so stop tracking it. + m_privateData->SetReadRequest(nullptr); // Call the load callback to start processing the loaded data. if (loadCallback) @@ -115,21 +163,22 @@ namespace AZ::Data } // Notify that the load is complete, in case anyone is using BlockUntilLoadComplete to block. - m_readRequestActive.notify_one(); + m_privateData->m_readRequestActive.notify_one(); }; // Queue the raw file load with the file streamer. auto streamer = AZ::Interface::Get(); - m_curReadRequest = streamer->Read( + m_privateData->m_curReadRequest = + streamer->Read( m_filePath, *m_bufferAllocator, m_requestedAssetSize, deadline, priority, m_fileOffset); m_curDeadline = deadline; m_curPriority = priority; - streamer->SetRequestCompleteCallback(m_curReadRequest, streamerCallback); + streamer->SetRequestCompleteCallback(m_privateData->m_curReadRequest, streamerCallback); - streamer->QueueRequest(m_curReadRequest); + streamer->QueueRequest(m_privateData->m_curReadRequest); } else { @@ -139,19 +188,19 @@ namespace AZ::Data loadCallback(AZ::IO::IStreamerTypes::RequestStatus::Completed); } - m_readRequestActive.notify_one(); + m_privateData->m_readRequestActive.notify_one(); } } void AssetDataStream::Reschedule(AZStd::chrono::milliseconds newDeadline, AZ::IO::IStreamerTypes::Priority newPriority) { - if (m_curReadRequest && (newDeadline < m_curDeadline || newPriority > m_curPriority)) + if (m_privateData->m_curReadRequest && (newDeadline < m_curDeadline || newPriority > m_curPriority)) { auto deadline = AZStd::GetMin(m_curDeadline, newDeadline); auto priority = AZStd::GetMax(m_curPriority, newPriority); auto streamer = Interface::Get(); - m_curReadRequest = streamer->RescheduleRequest(m_curReadRequest, deadline, priority); + m_privateData->m_curReadRequest = streamer->RescheduleRequest(m_privateData->m_curReadRequest, deadline, priority); m_curDeadline = deadline; m_curPriority = priority; } @@ -159,15 +208,13 @@ namespace AZ::Data void AssetDataStream::BlockUntilLoadComplete() { - AZStd::unique_lock lock(m_readRequestMutex); - m_readRequestActive.wait(lock, [this] { return m_curReadRequest == nullptr; }); - lock.unlock(); + m_privateData->BlockUntilReadComplete(); } void AssetDataStream::ClearInternalStateData() { // Clear all our internal state data. - m_preloadedData.resize(0); + m_privateData->m_preloadedData.resize(0); m_buffer = nullptr; m_loadedSize = 0; m_requestedAssetSize = 0; @@ -204,10 +251,10 @@ namespace AZ::Data void AssetDataStream::Close() { AZ_Assert(m_isOpen, "Attempting to close a stream that hasn't been opened."); - AZ_Assert(m_curReadRequest == nullptr, "Attempting to close a stream with a read request in flight."); + AZ_Assert(m_privateData->m_curReadRequest == nullptr, "Attempting to close a stream with a read request in flight."); // Destroy the asset buffer and unlock the allocator, so the allocator itself knows that it is no longer needed. - if (m_buffer != m_preloadedData.data()) + if (m_buffer != m_privateData->m_preloadedData.data()) { m_bufferAllocator->Release(m_buffer); } @@ -221,12 +268,7 @@ namespace AZ::Data void AssetDataStream::RequestCancel() { - AZStd::scoped_lock lock(m_readRequestMutex); - if (m_curReadRequest) - { - auto streamer = Interface::Get(); - m_curReadRequest = streamer->Cancel(m_curReadRequest); - } + m_privateData->CancelRequest(); } void AssetDataStream::Seek(AZ::IO::OffsetType bytes, AZ::IO::GenericStream::SeekMode mode) diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.h b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.h index 79822c8db2..f095e31562 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.h +++ b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.h @@ -9,17 +9,26 @@ #include #include -#include -#include -#include -#include -#include +#include + + +namespace AZStd +{ + template + class vector; +} namespace AZ::Data { + namespace Internal + { + struct AssetDataStreamPrivate; + } + class AssetDataStream : public AZ::IO::GenericStream { public: + using VectorDataSource = AZStd::vector; // The default Generic Stream APIs in this class will only allow for a single sequential pass // through the data, no seeking. Reads will block when pages aren't available yet, and // pages will be marked for recycling once reading has progressed beyond them. @@ -29,10 +38,10 @@ namespace AZ::Data ~AssetDataStream() override; // Open the AssetDataStream and make a copy of the provided memory buffer. - void Open(const AZStd::vector& data); + void Open(const VectorDataSource& data); // Open the AssetDataStream and directly take ownership of a pre-populated memory buffer. - void Open(AZStd::vector&& data); + void Open(VectorDataSource&& data); // Open the AssetDataStream and load it via file streaming using OnCompleteCallback = AZStd::function; @@ -91,6 +100,8 @@ namespace AZ::Data void ClearInternalStateData(); + Internal::AssetDataStreamPrivate* m_privateData; + //! The allocator to use for allocating / deallocating asset buffers AZ::IO::IStreamerTypes::RequestMemoryAllocator* m_bufferAllocator{ nullptr }; @@ -106,9 +117,6 @@ namespace AZ::Data //! The amount of data that's expected to be loaded. size_t m_requestedAssetSize{ 0 }; - //! Optional data buffer that's been directly passed in through Open(), instead of reading data from a file. - AZStd::vector m_preloadedData; - //! The buffer that will hold the raw data after it's loaded from the file. void* m_buffer{ nullptr }; @@ -119,19 +127,12 @@ namespace AZ::Data //! The current offset representing how far we've read into the buffer. size_t m_curOffset{ 0 }; - //! The current active streamer read request - tracked in case we need to cancel it prematurely - AZ::IO::FileRequestPtr m_curReadRequest{ nullptr }; - //! The current request deadline. Used to avoid requesting a reschedule to the same (current) deadline. AZStd::chrono::milliseconds m_curDeadline{ AZ::IO::IStreamerTypes::s_noDeadline }; //! The current request priority. Used to avoid requesting a reschedule to the same (current) priority. AZ::IO::IStreamerTypes::Priority m_curPriority{ AZ::IO::IStreamerTypes::s_priorityMedium }; - //! Synchronization for the read request, so that it's possible to block until completion. - AZStd::mutex m_readRequestMutex; - AZStd::condition_variable m_readRequestActive; - //! Track whether or not the stream is currently open bool m_isOpen{ false }; diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp index afe3330bd3..b4b1a0d81c 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp +++ b/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetManager.h b/Code/Framework/AzCore/AzCore/Asset/AssetManager.h index 9666d434c1..663de2c058 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetManager.h +++ b/Code/Framework/AzCore/AzCore/Asset/AssetManager.h @@ -12,7 +12,6 @@ #include #include #include -#include #include #include // used as allocator for most components #include diff --git a/Code/Framework/AzCore/AzCore/IO/IStreamer.h b/Code/Framework/AzCore/AzCore/IO/IStreamer.h index 438384e687..d59ee5007e 100644 --- a/Code/Framework/AzCore/AzCore/IO/IStreamer.h +++ b/Code/Framework/AzCore/AzCore/IO/IStreamer.h @@ -15,14 +15,18 @@ #include #include #include +#include // These Streamer includes need to be moved to Streamer internals/implementation, // and pull out only what we need for visibility at IStreamer.h interface declaration. #include -#include namespace AZ::IO { + class ExternalFileRequest; + class FileRequestHandle; + + using FileRequestPtr = AZStd::intrusive_ptr; /** * Data Streamer Interface */ diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp index 6c873f3050..ca38414eaa 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp @@ -137,18 +137,18 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { ReadFile(request, args); return; } else { - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { FlushCache(args.m_path); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FlushEntireCache(); } @@ -166,7 +166,7 @@ namespace AZ::IO { Section& delayed = m_delayedSections.front(); AZ_Assert(delayed.m_parent, "Delayed section doesn't have a reference to the original request."); - auto data = AZStd::get_if(&delayed.m_parent->GetCommand()); + auto data = AZStd::get_if(&delayed.m_parent->GetCommand()); AZ_Assert(data, "A request in the delayed queue of the BlockCache didn't have a parent with read data."); // This call can add the same section to the back of the queue if there's not // enough space. Because of this the entry needs to be removed from the delayed @@ -233,7 +233,7 @@ namespace AZ::IO } } - void BlockCache::ReadFile(FileRequest* request, FileRequest::ReadData& data) + void BlockCache::ReadFile(FileRequest* request, Requests::ReadData& data) { if (!m_next) { @@ -250,7 +250,7 @@ namespace AZ::IO m_numMetaDataRetrievalInProgress--; if (fileSizeRequest.GetStatus() == IStreamerTypes::RequestStatus::Completed) { - auto& requestInfo = AZStd::get(fileSizeRequest.GetCommand()); + auto& requestInfo = AZStd::get(fileSizeRequest.GetCommand()); if (requestInfo.m_found) { ContinueReadFile(request, requestInfo.m_fileSize); @@ -272,7 +272,7 @@ namespace AZ::IO Section main; Section epilog; - auto& data = AZStd::get(request->GetCommand()); + auto& data = AZStd::get(request->GetCommand()); if (!SplitRequest(prolog, main, epilog, data.m_path, fileLength, data.m_offset, data.m_size, reinterpret_cast(data.m_output))) diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.h b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.h index 90fb7ea193..68aa2da689 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.h @@ -21,6 +21,12 @@ namespace AZ::IO { + class RequestPath; + namespace Requests + { + struct ReadData; + } + struct BlockCacheConfig final : public IStreamerStackConfig { @@ -109,7 +115,7 @@ namespace AZ::IO using TimePoint = AZStd::chrono::system_clock::time_point; - void ReadFile(FileRequest* request, FileRequest::ReadData& data); + void ReadFile(FileRequest* request, Requests::ReadData& data); void ContinueReadFile(FileRequest* request, u64 fileLength); CacheResult ReadFromCache(FileRequest* request, Section& section, const RequestPath& filePath); CacheResult ReadFromCache(FileRequest* request, Section& section, u32 cacheBlock); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.cpp index b80a1ea724..f155d26eef 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.cpp @@ -101,12 +101,12 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { args.m_range = FileRange::CreateRangeForEntireFile(); m_context->PushPreparedRequest(request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { args.m_range = FileRange::CreateRangeForEntireFile(); m_context->PushPreparedRequest(request); @@ -125,28 +125,28 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { ReadFile(request, args); return; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { CreateDedicatedCache(request, args); return; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { DestroyDedicatedCache(request, args); return; } else { - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { FlushCache(args.m_path); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FlushEntireCache(); } @@ -200,7 +200,7 @@ namespace AZ::IO } } - void DedicatedCache::ReadFile(FileRequest* request, FileRequest::ReadData& data) + void DedicatedCache::ReadFile(FileRequest* request, Requests::ReadData& data) { size_t index = FindCache(data.m_path, data.m_offset); if (index == s_fileNotFound) @@ -255,7 +255,7 @@ namespace AZ::IO StreamStackEntry::CollectStatistics(statistics); } - void DedicatedCache::CreateDedicatedCache(FileRequest* request, FileRequest::CreateDedicatedCacheData& data) + void DedicatedCache::CreateDedicatedCache(FileRequest* request, Requests::CreateDedicatedCacheData& data) { size_t index = FindCache(data.m_path, data.m_range); if (index == s_fileNotFound) @@ -276,7 +276,7 @@ namespace AZ::IO m_context->MarkRequestAsCompleted(request); } - void DedicatedCache::DestroyDedicatedCache(FileRequest* request, FileRequest::DestroyDedicatedCacheData& data) + void DedicatedCache::DestroyDedicatedCache(FileRequest* request, Requests::DestroyDedicatedCacheData& data) { size_t index = FindCache(data.m_path, data.m_range); if (index != s_fileNotFound) diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.h b/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.h index 0ef2d879d3..a69dcdbd7f 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.h @@ -11,15 +11,21 @@ #include #include #include -#include #include +#include #include -#include #include +#include #include namespace AZ::IO { + namespace Requests + { + struct CreateDedicatedCacheData; + struct DestroyDedicatedCacheData; + } // namespace Requests + struct DedicatedCacheConfig final : public IStreamerStackConfig { @@ -56,16 +62,19 @@ namespace AZ::IO void UpdateStatus(Status& status) const override; - void UpdateCompletionEstimates(AZStd::chrono::system_clock::time_point now, AZStd::vector& internalPending, - StreamerContext::PreparedQueue::iterator pendingBegin, StreamerContext::PreparedQueue::iterator pendingEnd) override; + void UpdateCompletionEstimates( + AZStd::chrono::system_clock::time_point now, + AZStd::vector& internalPending, + StreamerContext::PreparedQueue::iterator pendingBegin, + StreamerContext::PreparedQueue::iterator pendingEnd) override; void CollectStatistics(AZStd::vector& statistics) const override; private: - void CreateDedicatedCache(FileRequest* request, FileRequest::CreateDedicatedCacheData& data); - void DestroyDedicatedCache(FileRequest* request, FileRequest::DestroyDedicatedCacheData& data); + void CreateDedicatedCache(FileRequest* request, Requests::CreateDedicatedCacheData& data); + void DestroyDedicatedCache(FileRequest* request, Requests::DestroyDedicatedCacheData& data); - void ReadFile(FileRequest* request, FileRequest::ReadData& data); + void ReadFile(FileRequest* request, AZ::IO::Requests::ReadData& data); size_t FindCache(const RequestPath& filename, FileRange range); size_t FindCache(const RequestPath& filename, u64 offset); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp index fc05b77b36..2f96d224e6 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp @@ -12,22 +12,30 @@ #include #include -namespace AZ::IO +// +// Command structures. +// + +namespace AZ::IO::Requests { - // - // Command structures. - // + ReadData::ReadData(void* output, u64 outputSize, const RequestPath& path, u64 offset, u64 size, bool sharedRead) + : m_path(path) + , m_output(output) + , m_outputSize(outputSize) + , m_offset(offset) + , m_size(size) + , m_sharedRead(sharedRead) + { + } - FileRequest::ExternalRequestData::ExternalRequestData(FileRequestPtr&& request) - : m_request(AZStd::move(request)) - {} - - FileRequest::RequestPathStoreData::RequestPathStoreData(RequestPath path) - : m_path(AZStd::move(path)) - {} - - FileRequest::ReadRequestData::ReadRequestData(RequestPath path, void* output, u64 outputSize, u64 offset, u64 size, - AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority) + ReadRequestData::ReadRequestData( + RequestPath path, + void* output, + u64 outputSize, + u64 offset, + u64 size, + AZStd::chrono::system_clock::time_point deadline, + IStreamerTypes::Priority priority) : m_path(AZStd::move(path)) , m_allocator(nullptr) , m_deadline(deadline) @@ -37,10 +45,16 @@ namespace AZ::IO , m_size(size) , m_priority(priority) , m_memoryType(IStreamerTypes::MemoryType::ReadWrite) // Only generic memory can be assigned externally. - {} + { + } - FileRequest::ReadRequestData::ReadRequestData(RequestPath path, IStreamerTypes::RequestMemoryAllocator* allocator, - u64 offset, u64 size, AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority) + ReadRequestData::ReadRequestData( + RequestPath path, + IStreamerTypes::RequestMemoryAllocator* allocator, + u64 offset, + u64 size, + AZStd::chrono::system_clock::time_point deadline, + IStreamerTypes::Priority priority) : m_path(AZStd::move(path)) , m_allocator(allocator) , m_deadline(deadline) @@ -50,9 +64,10 @@ namespace AZ::IO , m_size(size) , m_priority(priority) , m_memoryType(IStreamerTypes::MemoryType::ReadWrite) // Only generic memory can be assigned externally. - {} + { + } - FileRequest::ReadRequestData::~ReadRequestData() + ReadRequestData::~ReadRequestData() { if (m_allocator != nullptr) { @@ -64,65 +79,81 @@ namespace AZ::IO } } - FileRequest::ReadData::ReadData(void* output, u64 outputSize, const RequestPath& path, u64 offset, u64 size, bool sharedRead) - : m_output(output) - , m_outputSize(outputSize) - , m_path(path) - , m_offset(offset) - , m_size(size) - , m_sharedRead(sharedRead) - {} + CreateDedicatedCacheData::CreateDedicatedCacheData(RequestPath path, const FileRange& range) + : m_path(AZStd::move(path)) + , m_range(range) + { + } - FileRequest::CompressedReadData::CompressedReadData(CompressionInfo&& compressionInfo, void* output, u64 readOffset, u64 readSize) + DestroyDedicatedCacheData::DestroyDedicatedCacheData(RequestPath path, const FileRange& range) + : m_path(AZStd::move(path)) + , m_range(range) + { + } + + ExternalRequestData::ExternalRequestData(FileRequestPtr&& request) + : m_request(AZStd::move(request)) + { + } + + RequestPathStoreData::RequestPathStoreData(RequestPath path) + : m_path(AZStd::move(path)) + { + } + + CompressedReadData::CompressedReadData(CompressionInfo&& compressionInfo, void* output, u64 readOffset, u64 readSize) : m_compressionInfo(AZStd::move(compressionInfo)) , m_output(output) , m_readOffset(readOffset) , m_readSize(readSize) - {} + { + } - FileRequest::FileExistsCheckData::FileExistsCheckData(const RequestPath& path) + FileExistsCheckData::FileExistsCheckData(const RequestPath& path) : m_path(path) - {} + { + } - FileRequest::FileMetaDataRetrievalData::FileMetaDataRetrievalData(const RequestPath& path) + FileMetaDataRetrievalData::FileMetaDataRetrievalData(const RequestPath& path) : m_path(path) - {} + { + } - FileRequest::CancelData::CancelData(FileRequestPtr target) + CancelData::CancelData(FileRequestPtr target) : m_target(AZStd::move(target)) - {} + { + } - FileRequest::FlushData::FlushData(RequestPath path) + FlushData::FlushData(RequestPath path) : m_path(AZStd::move(path)) - {} + { + } - FileRequest::RescheduleData::RescheduleData(FileRequestPtr target, AZStd::chrono::system_clock::time_point newDeadline, + RescheduleData::RescheduleData( + FileRequestPtr target, + AZStd::chrono::system_clock::time_point newDeadline, IStreamerTypes::Priority newPriority) : m_target(AZStd::move(target)) , m_newDeadline(newDeadline) , m_newPriority(newPriority) - {} + { + } - FileRequest::CreateDedicatedCacheData::CreateDedicatedCacheData(RequestPath path, const FileRange& range) - : m_path(AZStd::move(path)) - , m_range(range) - {} - - FileRequest::DestroyDedicatedCacheData::DestroyDedicatedCacheData(RequestPath path, const FileRange& range) - : m_path(AZStd::move(path)) - , m_range(range) - {} - - FileRequest::ReportData::ReportData(ReportType reportType) + Requests::ReportData::ReportData(ReportType reportType) : m_reportType(reportType) - {} + { + } - FileRequest::CustomData::CustomData(AZStd::any data, bool failWhenUnhandled) + CustomData::CustomData(AZStd::any data, bool failWhenUnhandled) : m_data(AZStd::move(data)) , m_failWhenUnhandled(failWhenUnhandled) - {} - + { + } +} // namespace AZ::IO::Requests +namespace AZ::IO +{ + using namespace Requests; // // FileRequest // @@ -263,7 +294,7 @@ namespace AZ::IO SetOptionalParent(parent); } - void FileRequest::CreateReport(ReportData::ReportType reportType) + void FileRequest::CreateReport(Requests::ReportType reportType) { AZ_Assert(AZStd::holds_alternative(m_command), "Attempting to set FileRequest to 'Report', but another task was already assigned."); @@ -361,7 +392,7 @@ namespace AZ::IO "Request does not contain a valid command. It may have been reset already or was never assigned a command."); return true; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { return args.m_failWhenUnhandled; } diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.h b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.h index dd4dad2387..7f5874c95d 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.h @@ -27,7 +27,252 @@ namespace AZ::IO class ExternalFileRequest; using FileRequestPtr = AZStd::intrusive_ptr; +} // namespace AZ::IO +namespace AZ::IO::Requests +{ + //! Request to read data. This is a translated request and holds an absolute path and has been + //! resolved to the archive file if needed. + struct ReadData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + inline constexpr static bool s_failWhenUnhandled = true; + + ReadData(void* output, u64 outputSize, const RequestPath& path, u64 offset, u64 size, bool sharedRead); + + const RequestPath& m_path; //!< The path to the file that contains the requested data. + void* m_output; //!< Target output to write the read data to. + u64 m_outputSize; //!< Size of memory m_output points to. This needs to be at least as big as m_size, but can be bigger. + u64 m_offset; //!< The offset in bytes into the file. + u64 m_size; //!< The number of bytes to read from the file. + bool m_sharedRead; //!< True if other code will be reading from the file or the stack entry can exclusively lock. + }; + + //! Request to read data. This is an untranslated request and holds a relative path. The Scheduler + //! will translate this to the appropriate ReadData or CompressedReadData. + struct ReadRequestData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + inline constexpr static bool s_failWhenUnhandled = true; + + ReadRequestData( + RequestPath path, + void* output, + u64 outputSize, + u64 offset, + u64 size, + AZStd::chrono::system_clock::time_point deadline, + IStreamerTypes::Priority priority); + ReadRequestData( + RequestPath path, + IStreamerTypes::RequestMemoryAllocator* allocator, + u64 offset, + u64 size, + AZStd::chrono::system_clock::time_point deadline, + IStreamerTypes::Priority priority); + ~ReadRequestData(); + + RequestPath m_path; //!< Relative path to the target file. + IStreamerTypes::RequestMemoryAllocator* m_allocator; //!< Allocator used to manage the memory for this request. + AZStd::chrono::system_clock::time_point m_deadline; //!< Time by which this request should have been completed. + void* m_output; //!< The memory address assigned (during processing) to store the read data to. + u64 m_outputSize; //!< The memory size of the addressed used to store the read data. + u64 m_offset; //!< The offset in bytes into the file. + u64 m_size; //!< The number of bytes to read from the file. + IStreamerTypes::Priority m_priority; //!< Priority used for ordering requests. This is used when requests have the same deadline. + IStreamerTypes::MemoryType m_memoryType; //!< The type of memory provided by the allocator if used. + }; + + //! Creates a cache dedicated to a single file. This is best used for files where blocks are read from + //! periodically such as audio banks of video files. + struct CreateDedicatedCacheData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; + + CreateDedicatedCacheData(RequestPath path, const FileRange& range); + + RequestPath m_path; + FileRange m_range; + }; + + //! Destroys a cache dedicated to a single file that was previously created by CreateDedicatedCache + struct DestroyDedicatedCacheData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; + + DestroyDedicatedCacheData(RequestPath path, const FileRange& range); + + RequestPath m_path; + FileRange m_range; + }; + + enum class ReportType : int8_t + { + FileLocks + }; + + struct ReportData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityLow; + inline constexpr static bool s_failWhenUnhandled = false; + + explicit ReportData(ReportType reportType); + + ReportType m_reportType; + }; + + //! Stores a reference to the external request so it stays alive while the request is being processed. + //! This is needed because Streamer supports fire-and-forget requests since completion can be handled by + //! registering a callback. + struct ExternalRequestData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + inline constexpr static bool s_failWhenUnhandled = true; + + explicit ExternalRequestData(FileRequestPtr&& request); + + FileRequestPtr m_request; //!< The request that was send to Streamer. + }; + + //! Stores an instance of a RequestPath. To reduce copying instances of a RequestPath functions that + //! need a path take them by reference to the original request. In some cases a path originates from + //! within in the stack and temporary storage is needed. This struct allows for that temporary storage + //! so it can be safely referenced later. + struct RequestPathStoreData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + inline constexpr static bool s_failWhenUnhandled = true; + + explicit RequestPathStoreData(RequestPath path); + + RequestPath m_path; + }; + + //! Request to read and decompress data. + struct CompressedReadData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + inline constexpr static bool s_failWhenUnhandled = true; + + CompressedReadData(CompressionInfo&& compressionInfo, void* output, u64 readOffset, u64 readSize); + + CompressionInfo m_compressionInfo; + void* m_output; //!< Target output to write the read data to. + u64 m_readOffset; //!< The offset into the decompressed to start copying from. + u64 m_readSize; //!< Number of bytes to read from the decompressed file. + }; + + //! Holds the progress of an operation chain until this request is explicitly completed. + struct WaitData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + inline constexpr static bool s_failWhenUnhandled = true; + }; + + //! Checks to see if any node in the stack can find a file at the provided path. + struct FileExistsCheckData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; + + explicit FileExistsCheckData(const RequestPath& path); + + const RequestPath& m_path; + bool m_found{ false }; + }; + + //! Searches for a file in the stack and retrieves the meta data. This may be slower than a file exists + //! check. + struct FileMetaDataRetrievalData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; + + explicit FileMetaDataRetrievalData(const RequestPath& path); + + const RequestPath& m_path; + u64 m_fileSize{ 0 }; + bool m_found{ false }; + }; + + //! Cancels a request in the stream stack, if possible. + struct CancelData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHighest; + inline constexpr static bool s_failWhenUnhandled = false; + + explicit CancelData(FileRequestPtr target); + + FileRequestPtr m_target; //!< The request that will be canceled. + }; + + //! Updates the priority and deadline of a request that has not been queued yet. + struct RescheduleData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; + + RescheduleData(FileRequestPtr target, AZStd::chrono::system_clock::time_point newDeadline, IStreamerTypes::Priority newPriority); + + FileRequestPtr m_target; //!< The request that will be rescheduled. + AZStd::chrono::system_clock::time_point m_newDeadline; //!< The new deadline for the request. + IStreamerTypes::Priority m_newPriority; //!< The new priority for the request. + }; + + //! Flushes all references to the provided file in the streaming stack. + struct FlushData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; + + explicit FlushData(RequestPath path); + + RequestPath m_path; + }; + + //! Flushes all caches in the streaming stack. + struct FlushAllData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; + }; + + //! Data for a custom command. This can be used by nodes added extensions that need data that can't be stored + //! in the already provided data. + struct CustomData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + + CustomData(AZStd::any data, bool failWhenUnhandled); + + AZStd::any m_data; //!< The data for the custom request. + bool m_failWhenUnhandled; //!< Whether or not the request is marked as failed or success when no node process it. + }; + using CommandVariant = AZStd::variant< + AZStd::monostate, + ExternalRequestData, + RequestPathStoreData, + ReadRequestData, + ReadData, + CompressedReadData, + WaitData, + FileExistsCheckData, + FileMetaDataRetrievalData, + CancelData, + RescheduleData, + FlushData, + FlushAllData, + CreateDedicatedCacheData, + DestroyDedicatedCacheData, + ReportData, + CustomData>; + +} // namespace AZ::IO::Requests + +namespace AZ::IO +{ class FileRequest final { public: @@ -36,218 +281,7 @@ namespace AZ::IO friend class StreamerContext; friend class ExternalFileRequest; - //! Stores a reference to the external request so it stays alive while the request is being processed. - //! This is needed because Streamer supports fire-and-forget requests since completion can be handled by - //! registering a callback. - struct ExternalRequestData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - inline constexpr static bool s_failWhenUnhandled = true; - - explicit ExternalRequestData(FileRequestPtr&& request); - - FileRequestPtr m_request; //!< The request that was send to Streamer. - }; - - //! Stores an instance of a RequestPath. To reduce copying instances of a RequestPath functions that - //! need a path take them by reference to the original request. In some cases a path originates from - //! within in the stack and temporary storage is needed. This struct allows for that temporary storage - //! so it can be safely referenced later. - struct RequestPathStoreData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - inline constexpr static bool s_failWhenUnhandled = true; - - explicit RequestPathStoreData(RequestPath path); - - RequestPath m_path; - }; - - //! Request to read data. This is an untranslated request and holds a relative path. The Scheduler - //! will translate this to the appropriate ReadData or CompressedReadData. - struct ReadRequestData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - inline constexpr static bool s_failWhenUnhandled = true; - - ReadRequestData(RequestPath path, void* output, u64 outputSize, u64 offset, u64 size, - AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority); - ReadRequestData(RequestPath path, IStreamerTypes::RequestMemoryAllocator* allocator, u64 offset, u64 size, - AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority); - ~ReadRequestData(); - - RequestPath m_path; //!< Relative path to the target file. - IStreamerTypes::RequestMemoryAllocator* m_allocator; //!< Allocator used to manage the memory for this request. - AZStd::chrono::system_clock::time_point m_deadline; //!< Time by which this request should have been completed. - void* m_output; //!< The memory address assigned (during processing) to store the read data to. - u64 m_outputSize; //!< The memory size of the addressed used to store the read data. - u64 m_offset; //!< The offset in bytes into the file. - u64 m_size; //!< The number of bytes to read from the file. - IStreamerTypes::Priority m_priority; //!< Priority used for ordering requests. This is used when requests have the same deadline. - IStreamerTypes::MemoryType m_memoryType; //!< The type of memory provided by the allocator if used. - }; - - //! Request to read data. This is a translated request and holds an absolute path and has been - //! resolved to the archive file if needed. - struct ReadData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - inline constexpr static bool s_failWhenUnhandled = true; - - ReadData(void* output, u64 outputSize, const RequestPath& path, u64 offset, u64 size, bool sharedRead); - - const RequestPath& m_path; //!< The path to the file that contains the requested data. - void* m_output; //!< Target output to write the read data to. - u64 m_outputSize; //!< Size of memory m_output points to. This needs to be at least as big as m_size, but can be bigger. - u64 m_offset; //!< The offset in bytes into the file. - u64 m_size; //!< The number of bytes to read from the file. - bool m_sharedRead; //!< True if other code will be reading from the file or the stack entry can exclusively lock. - }; - - //! Request to read and decompress data. - struct CompressedReadData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - inline constexpr static bool s_failWhenUnhandled = true; - - CompressedReadData(CompressionInfo&& compressionInfo, void* output, u64 readOffset, u64 readSize); - - CompressionInfo m_compressionInfo; - void* m_output; //!< Target output to write the read data to. - u64 m_readOffset; //!< The offset into the decompressed to start copying from. - u64 m_readSize; //!< Number of bytes to read from the decompressed file. - }; - - //! Holds the progress of an operation chain until this request is explicitly completed. - struct WaitData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - inline constexpr static bool s_failWhenUnhandled = true; - }; - - //! Checks to see if any node in the stack can find a file at the provided path. - struct FileExistsCheckData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; - - explicit FileExistsCheckData(const RequestPath& path); - - const RequestPath& m_path; - bool m_found{ false }; - }; - - //! Searches for a file in the stack and retrieves the meta data. This may be slower than a file exists - //! check. - struct FileMetaDataRetrievalData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; - - explicit FileMetaDataRetrievalData(const RequestPath& path); - - const RequestPath& m_path; - u64 m_fileSize{ 0 }; - bool m_found{ false }; - }; - - //! Cancels a request in the stream stack, if possible. - struct CancelData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHighest; - inline constexpr static bool s_failWhenUnhandled = false; - - explicit CancelData(FileRequestPtr target); - - FileRequestPtr m_target; //!< The request that will be canceled. - }; - - //! Updates the priority and deadline of a request that has not been queued yet. - struct RescheduleData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; - - RescheduleData(FileRequestPtr target, AZStd::chrono::system_clock::time_point newDeadline, IStreamerTypes::Priority newPriority); - - FileRequestPtr m_target; //!< The request that will be rescheduled. - AZStd::chrono::system_clock::time_point m_newDeadline; //!< The new deadline for the request. - IStreamerTypes::Priority m_newPriority; //!< The new priority for the request. - }; - - //! Flushes all references to the provided file in the streaming stack. - struct FlushData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; - - explicit FlushData(RequestPath path); - - RequestPath m_path; - }; - - //! Flushes all caches in the streaming stack. - struct FlushAllData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; - }; - - //! Creates a cache dedicated to a single file. This is best used for files where blocks are read from - //! periodically such as audio banks of video files. - struct CreateDedicatedCacheData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; - - CreateDedicatedCacheData(RequestPath path, const FileRange& range); - - RequestPath m_path; - FileRange m_range; - }; - - //! Destroys a cache dedicated to a single file that was previously created by CreateDedicatedCache - struct DestroyDedicatedCacheData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; - - DestroyDedicatedCacheData(RequestPath path, const FileRange& range); - - RequestPath m_path; - FileRange m_range; - }; - - struct ReportData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityLow; - inline constexpr static bool s_failWhenUnhandled = false; - - enum class ReportType - { - FileLocks - }; - - explicit ReportData(ReportType reportType); - - ReportType m_reportType; - }; - - //! Data for a custom command. This can be used by nodes added extensions that need data that can't be stored - //! in the already provided data. - struct CustomData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - - CustomData(AZStd::any data, bool failWhenUnhandled); - - AZStd::any m_data; //!< The data for the custom request. - bool m_failWhenUnhandled; //!< Whether or not the request is marked as failed or success when no node process it. - }; - - using CommandVariant = AZStd::variant; + using CommandVariant = Requests::CommandVariant; using OnCompletionCallback = AZStd::function; AZ_CLASS_ALLOCATOR(FileRequest, SystemAllocator, 0); @@ -278,7 +312,7 @@ namespace AZ::IO void CreateFlushAll(); void CreateDedicatedCacheCreation(RequestPath path, const FileRange& range = {}, FileRequest* parent = nullptr); void CreateDedicatedCacheDestruction(RequestPath path, const FileRange& range = {}, FileRequest* parent = nullptr); - void CreateReport(ReportData::ReportType reportType); + void CreateReport(Requests::ReportType reportType); void CreateCustom(AZStd::any data, bool failWhenUnhandled = true, FileRequest* parent = nullptr); void SetCompletionCallback(OnCompletionCallback callback); @@ -325,8 +359,17 @@ namespace AZ::IO //! Command and parameters for the request. CommandVariant m_command; - //! Status of the request. - AZStd::atomic m_status{ IStreamerTypes::RequestStatus::Pending }; + //! Estimated time this request will complete. This is an estimation and depends on many + //! factors which can cause it to change drastically from moment to moment. + AZStd::chrono::system_clock::time_point m_estimatedCompletion; + + //! The file request that has a dependency on this one. This can be null if there are no + //! other request depending on this one to complete. + FileRequest* m_parent{ nullptr }; + + + //! Id assigned when the request is added to the pending queue. + size_t m_pendingId{ 0 }; //! Called once the request has completed. This will always be called from the Streamer thread //! and thread safety is the responsibility of called function. When assigning a lambda avoid @@ -336,16 +379,8 @@ namespace AZ::IO //! a longer running task is needed consider using a job to do the work. OnCompletionCallback m_onCompletion; - //! Estimated time this request will complete. This is an estimation and depends on many - //! factors which can cause it to change drastically from moment to moment. - AZStd::chrono::system_clock::time_point m_estimatedCompletion; - - //! The file request that has a dependency on this one. This can be null if there are no - //! other request depending on this one to complete. - FileRequest* m_parent{ nullptr }; - - //! Id assigned when the request is added to the pending queue. - size_t m_pendingId{ 0 }; + //! Status of the request. + AZStd::atomic m_status{ IStreamerTypes::RequestStatus::Pending }; //! The number of dependent file request that need to complete before this one is done. u16 m_dependencies{ 0 }; diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.cpp index 723a5d62c8..ac9344dd28 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.cpp @@ -91,12 +91,12 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { PrepareReadRequest(request, args); } - else if constexpr (AZStd::is_same_v || - AZStd::is_same_v) + else if constexpr (AZStd::is_same_v || + AZStd::is_same_v) { PrepareDedicatedCache(request, args.m_path); } @@ -114,11 +114,11 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { m_pendingReads.push_back(request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { m_pendingFileExistChecks.push_back(request); } @@ -203,7 +203,7 @@ namespace AZ::IO { FileRequest* compressedRequest = m_processingJobs[i].m_waitRequest->GetParent(); AZ_Assert(compressedRequest, "A wait request attached to FullFileDecompressor was completed but didn't have a parent compressed request."); - auto data = AZStd::get_if(&compressedRequest->GetCommand()); + auto data = AZStd::get_if(&compressedRequest->GetCommand()); AZ_Assert(data, "Compressed request in the decompression queue in FullFileDecompressor didn't contain compression read data."); size_t bytesToDecompress = data->m_compressionInfo.m_compressedSize; @@ -255,7 +255,7 @@ namespace AZ::IO // Calculate the amount of time it will take to decompress the data. FileRequest* compressedRequest = m_readRequests[i]->GetParent(); - auto data = AZStd::get_if(&compressedRequest->GetCommand()); + auto data = AZStd::get_if(&compressedRequest->GetCommand()); size_t bytesToDecompress = data->m_compressionInfo.m_compressedSize; auto decompressionDuration = AZStd::chrono::microseconds( @@ -290,7 +290,7 @@ namespace AZ::IO void FullFileDecompressor::EstimateCompressedReadRequest(FileRequest* request, AZStd::chrono::microseconds& cumulativeDelay, AZStd::chrono::microseconds decompressionDelay, double totalDecompressionDurationUs, double totalBytesDecompressed) const { - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); if (data) { AZStd::chrono::microseconds processingTime = decompressionDelay; @@ -343,7 +343,7 @@ namespace AZ::IO m_numRunningJobs == 0; } - void FullFileDecompressor::PrepareReadRequest(FileRequest* request, FileRequest::ReadRequestData& data) + void FullFileDecompressor::PrepareReadRequest(FileRequest* request, Requests::ReadRequestData &data) { CompressionInfo info; if (CompressionUtils::FindCompressionInfo(info, data.m_path.GetRelativePath())) @@ -359,7 +359,7 @@ namespace AZ::IO { FileRequest* pathStorageRequest = m_context->GetNewInternalRequest(); pathStorageRequest->CreateRequestPathStore(request, AZStd::move(info.m_archiveFilename)); - auto& pathStorage = AZStd::get(pathStorageRequest->GetCommand()); + auto& pathStorage = AZStd::get(pathStorageRequest->GetCommand()); nextRequest->CreateRead(pathStorageRequest, data.m_output, data.m_outputSize, pathStorage.m_path, info.m_offset + data.m_offset, data.m_size, info.m_isSharedPak); @@ -370,13 +370,13 @@ namespace AZ::IO auto callback = [this, nextRequest](const FileRequest& checkRequest) { AZ_PROFILE_FUNCTION(AzCore); - auto check = AZStd::get_if(&checkRequest.GetCommand()); + auto check = AZStd::get_if(&checkRequest.GetCommand()); AZ_Assert(check, "Callback in FullFileDecompressor::PrepareReadRequest expected FileExistsCheck but got another command."); if (check->m_found) { FileRequest* originalRequest = m_context->RejectRequest(nextRequest); - if (AZStd::holds_alternative(originalRequest->GetCommand())) + if (AZStd::holds_alternative(originalRequest->GetCommand())) { originalRequest = m_context->RejectRequest(originalRequest); } @@ -412,12 +412,12 @@ namespace AZ::IO AZStd::visit([request, &info, nextRequest](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { nextRequest->CreateDedicatedCacheCreation(AZStd::move(info.m_archiveFilename), FileRange::CreateRange(info.m_offset, info.m_compressedSize), request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { nextRequest->CreateDedicatedCacheDestruction(AZStd::move(info.m_archiveFilename), FileRange::CreateRange(info.m_offset, info.m_compressedSize), request); @@ -429,7 +429,7 @@ namespace AZ::IO auto callback = [this, nextRequest](const FileRequest& checkRequest) { AZ_PROFILE_FUNCTION(AzCore); - auto check = AZStd::get_if(&checkRequest.GetCommand()); + auto check = AZStd::get_if(&checkRequest.GetCommand()); AZ_Assert(check, "Callback in FullFileDecompressor::PrepareDedicatedCache expected FileExistsCheck but got another command."); if (check->m_found) @@ -461,7 +461,7 @@ namespace AZ::IO void FullFileDecompressor::FileExistsCheck(FileRequest* checkRequest) { - auto& fileCheckRequest = AZStd::get(checkRequest->GetCommand()); + auto& fileCheckRequest = AZStd::get(checkRequest->GetCommand()); CompressionInfo info; if (CompressionUtils::FindCompressionInfo(info, fileCheckRequest.m_path.GetRelativePath())) { @@ -487,7 +487,7 @@ namespace AZ::IO { if (m_readBufferStatus[i] == ReadBufferStatus::Unused) { - auto data = AZStd::get_if(&compressedReadRequest->GetCommand()); + auto data = AZStd::get_if(&compressedReadRequest->GetCommand()); AZ_Assert(data, "Compressed request that's starting a read in FullFileDecompressor didn't contain compression read data."); AZ_Assert(data->m_compressionInfo.m_decompressor, "FileRequest for FullFileDecompressor is missing a decompression callback."); @@ -549,7 +549,7 @@ namespace AZ::IO } else { - auto data = AZStd::get_if(&compressedRequest->GetCommand()); + auto data = AZStd::get_if(&compressedRequest->GetCommand()); AZ_Assert(data, "Compressed request in FullFileDecompressor that finished unsuccessfully didn't contain compression read data."); CompressionInfo& info = data->m_compressionInfo; size_t offsetAdjustment = info.m_offset - AZ_SIZE_ALIGN_DOWN(info.m_offset, aznumeric_cast(m_alignment)); @@ -591,7 +591,7 @@ namespace AZ::IO } FileRequest* waitRequest = m_readRequests[readSlot]; - AZ_Assert(AZStd::holds_alternative(waitRequest->GetCommand()), + AZ_Assert(AZStd::holds_alternative(waitRequest->GetCommand()), "File request waiting for decompression wasn't marked as being a wait operation."); FileRequest* compressedRequest = waitRequest->GetParent(); AZ_Assert(compressedRequest, "Read requests started by FullFileDecompressor is missing a parent request."); @@ -610,7 +610,7 @@ namespace AZ::IO m_readBuffers[readSlot] = nullptr; AZ::Job* decompressionJob; - auto data = AZStd::get_if(&compressedRequest->GetCommand()); + auto data = AZStd::get_if(&compressedRequest->GetCommand()); AZ_Assert(data, "Compressed request in FullFileDecompressor that's starting decompression didn't contain compression read data."); AZ_Assert(data->m_compressionInfo.m_decompressor, "FullFileDecompressor is queuing a decompression job but couldn't find a decompressor."); @@ -664,7 +664,7 @@ namespace AZ::IO FileRequest* compressedRequest = jobInfo.m_waitRequest->GetParent(); AZ_Assert(compressedRequest, "A wait request attached to FullFileDecompressor was completed but didn't have a parent compressed request."); - auto data = AZStd::get_if(&compressedRequest->GetCommand()); + auto data = AZStd::get_if(&compressedRequest->GetCommand()); AZ_Assert(data, "Compressed request in FullFileDecompressor that completed decompression didn't contain compression read data."); CompressionInfo& info = data->m_compressionInfo; size_t offsetAdjustment = info.m_offset - AZ_SIZE_ALIGN_DOWN(info.m_offset, aznumeric_cast(m_alignment)); @@ -694,7 +694,7 @@ namespace AZ::IO FileRequest* compressedRequest = info.m_waitRequest->GetParent(); AZ_Assert(compressedRequest, "A wait request attached to FullFileDecompressor was completed but didn't have a parent compressed request."); - auto request = AZStd::get_if(&compressedRequest->GetCommand()); + auto request = AZStd::get_if(&compressedRequest->GetCommand()); AZ_Assert(request, "Compressed request in FullFileDecompressor that's running full decompression didn't contain compression read data."); CompressionInfo& compressionInfo = request->m_compressionInfo; AZ_Assert(compressionInfo.m_decompressor, "Full decompressor job started, but there's no decompressor callback assigned."); @@ -719,7 +719,7 @@ namespace AZ::IO FileRequest* compressedRequest = info.m_waitRequest->GetParent(); AZ_Assert(compressedRequest, "A wait request attached to FullFileDecompressor was completed but didn't have a parent compressed request."); - auto request = AZStd::get_if(&compressedRequest->GetCommand()); + auto request = AZStd::get_if(&compressedRequest->GetCommand()); AZ_Assert(request, "Compressed request in FullFileDecompressor that's running partial decompression didn't contain compression read data."); CompressionInfo& compressionInfo = request->m_compressionInfo; AZ_Assert(compressionInfo.m_decompressor, "Partial decompressor job started, but there's no decompressor callback assigned."); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.h b/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.h index d9bd68f1a1..cb4226fd7c 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.h @@ -21,6 +21,11 @@ namespace AZ::IO { + namespace Requests + { + struct ReadRequestData; + } + struct FullFileDecompressorConfig final : public IStreamerStackConfig { @@ -87,7 +92,7 @@ namespace AZ::IO bool IsIdle() const; - void PrepareReadRequest(FileRequest* request, FileRequest::ReadRequestData& data); + void PrepareReadRequest(FileRequest* request, Requests::ReadRequestData& data); void PrepareDedicatedCache(FileRequest* request, const RequestPath& path); void FileExistsCheck(FileRequest* checkRequest); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/ReadSplitter.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/ReadSplitter.cpp index a952e31a93..282a1e15c9 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/ReadSplitter.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/ReadSplitter.cpp @@ -118,7 +118,7 @@ namespace AZ::IO return; } - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); if (data == nullptr) { StreamStackEntry::QueueRequest(request); @@ -156,7 +156,7 @@ namespace AZ::IO void ReadSplitter::QueueAlignedRead(FileRequest* request) { - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); AZ_Assert(data != nullptr, "Provided request to queue by the Read Splitter did not contain a read command."); if (data->m_size <= m_maxReadSize) @@ -187,7 +187,7 @@ namespace AZ::IO bool ReadSplitter::QueueAlignedRead(PendingRead& pending) { - auto data = AZStd::get_if(&pending.m_request->GetCommand()); + auto data = AZStd::get_if(&pending.m_request->GetCommand()); AZ_Assert(data != nullptr, "Provided request to queue by the Read Splitter did not contain a read command."); while (pending.m_readSize > 0) @@ -237,7 +237,7 @@ namespace AZ::IO void ReadSplitter::QueueBufferedRead(FileRequest* request) { - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); AZ_Assert(data != nullptr, "Provided request to queue by the Read Splitter did not contain a read command."); PendingRead pendingRead; @@ -262,7 +262,7 @@ namespace AZ::IO bool ReadSplitter::QueueBufferedRead(PendingRead& pending) { - auto data = AZStd::get_if(&pending.m_request->GetCommand()); + auto data = AZStd::get_if(&pending.m_request->GetCommand()); AZ_Assert(data != nullptr, "Provided request to queue by the Read Splitter did not contain a read command."); while (pending.m_readSize > 0) diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.cpp index fe1d5a5eda..65f72946b0 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.cpp @@ -6,9 +6,11 @@ * */ +#include + +#include #include #include -#include #include #include @@ -35,6 +37,10 @@ namespace AZ::IO m_threadData.m_streamStack = AZStd::move(streamStack); } + Scheduler::~Scheduler() + { + } + void Scheduler::Start(const AZStd::thread_desc& threadDesc) { if (!m_isRunning) @@ -222,10 +228,10 @@ namespace AZ::IO { using Command = AZStd::decay_t; if constexpr ( - AZStd::is_same_v || - AZStd::is_same_v) + AZStd::is_same_v || + AZStd::is_same_v) { - auto parentReadRequest = next->GetCommandFromChain(); + auto parentReadRequest = next->GetCommandFromChain(); AZ_Assert(parentReadRequest != nullptr, "The issued read request can't be found for the (compressed) read command."); size_t size = parentReadRequest->m_size; @@ -234,7 +240,7 @@ namespace AZ::IO AZ_Assert(parentReadRequest->m_allocator, "The read request was issued without a memory allocator or valid output address."); u64 recommendedSize = size; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { recommendedSize = m_recommendations.CalculateRecommendedMemorySize(size, parentReadRequest->m_offset); } @@ -249,12 +255,12 @@ namespace AZ::IO parentReadRequest->m_output = allocation.m_address; parentReadRequest->m_outputSize = allocation.m_size; parentReadRequest->m_memoryType = allocation.m_type; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { args.m_output = parentReadRequest->m_output; args.m_outputSize = allocation.m_size; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { args.m_output = parentReadRequest->m_output; } @@ -267,7 +273,7 @@ namespace AZ::IO } #endif - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { m_threadData.m_lastFilePath = args.m_path; m_threadData.m_lastFileOffset = args.m_offset + args.m_size; @@ -275,7 +281,7 @@ namespace AZ::IO m_processingSize += args.m_size; #endif } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { const CompressionInfo& info = args.m_compressionInfo; m_threadData.m_lastFilePath = info.m_archiveFilename; @@ -288,15 +294,15 @@ namespace AZ::IO "Streamer queued %zu: %s", next->GetCommand().index(), parentReadRequest->m_path.GetRelativePath()); m_threadData.m_streamStack->QueueRequest(next); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { return Thread_ProcessCancelRequest(next, args); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { return Thread_ProcessRescheduleRequest(next, args); } - else if constexpr (AZStd::is_same_v || AZStd::is_same_v) + else if constexpr (AZStd::is_same_v || AZStd::is_same_v) { AZ_PROFILE_INTERVAL_START_COLORED(AzCore, next, ProfilerColor, "Streamer queued %zu", next->GetCommand().index()); @@ -345,7 +351,7 @@ namespace AZ::IO #endif { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { if (args.m_output == nullptr && args.m_allocator != nullptr) { @@ -393,7 +399,7 @@ namespace AZ::IO } } - void Scheduler::Thread_ProcessCancelRequest(FileRequest* request, FileRequest::CancelData& data) + void Scheduler::Thread_ProcessCancelRequest(FileRequest* request, Requests::CancelData& data) { AZ_PROFILE_INTERVAL_START_COLORED(AzCore, request, ProfilerColor, "Streamer queued cancel"); auto& pending = m_context.GetPreparedRequests(); @@ -415,7 +421,7 @@ namespace AZ::IO m_threadData.m_streamStack->QueueRequest(request); } - void Scheduler::Thread_ProcessRescheduleRequest(FileRequest* request, FileRequest::RescheduleData& data) + void Scheduler::Thread_ProcessRescheduleRequest(FileRequest* request, Requests::RescheduleData& data) { AZ_PROFILE_INTERVAL_START_COLORED(AzCore, request, ProfilerColor, "Streamer queued reschedule"); auto& pendingRequests = m_context.GetPreparedRequests(); @@ -424,7 +430,7 @@ namespace AZ::IO if (pending->WorksOn(data.m_target)) { // Read requests are the only requests that use deadlines and dynamic priorities. - auto readRequest = pending->GetCommandFromChain(); + auto readRequest = pending->GetCommandFromChain(); if (readRequest) { readRequest->m_deadline = data.m_newDeadline; @@ -463,8 +469,8 @@ namespace AZ::IO // Order is the same for both requests, so prioritize the request that are at risk of missing // it's deadline. - const FileRequest::ReadRequestData* firstRead = first->GetCommandFromChain(); - const FileRequest::ReadRequestData* secondRead = second->GetCommandFromChain(); + const Requests::ReadRequestData* firstRead = first->GetCommandFromChain(); + const Requests::ReadRequestData* secondRead = second->GetCommandFromChain(); if (firstRead == nullptr || secondRead == nullptr) { @@ -496,11 +502,11 @@ namespace AZ::IO auto sameFile = [this](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { return m_threadData.m_lastFilePath == args.m_path; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { return m_threadData.m_lastFilePath == args.m_compressionInfo.m_archiveFilename; } @@ -517,11 +523,11 @@ namespace AZ::IO auto offset = [](auto&& args) -> s64 { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { return aznumeric_caster(args.m_offset); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { return aznumeric_caster(args.m_compressionInfo.m_offset); } diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.h b/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.h index 053a57d332..502002fd27 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.h @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include @@ -24,11 +25,19 @@ namespace AZ::IO { class FileRequest; + namespace Requests + { + struct CancelData; + struct RescheduleData; + } // namespace Requests + class Scheduler final { public: explicit Scheduler(AZStd::shared_ptr streamStack, u64 memoryAlignment = AZCORE_GLOBAL_NEW_ALIGNMENT, u64 sizeAlignment = 1, u64 granularity = 1_mib); + ~Scheduler(); + void Start(const AZStd::thread_desc& threadDesc); void Stop(); @@ -61,14 +70,14 @@ namespace AZ::IO bool Thread_ExecuteRequests(); bool Thread_PrepareRequests(AZStd::vector& outstandingRequests); void Thread_ProcessTillIdle(); - void Thread_ProcessCancelRequest(FileRequest* request, FileRequest::CancelData& data); - void Thread_ProcessRescheduleRequest(FileRequest* request, FileRequest::RescheduleData& data); + void Thread_ProcessCancelRequest(FileRequest* request, Requests::CancelData& data); + void Thread_ProcessRescheduleRequest(FileRequest* request, Requests::RescheduleData& data); enum class Order { - FirstRequest, //< The first request is the most important to process next. - SecondRequest, //< The second request is the most important to process next. - Equal //< Both requests are equally important. + FirstRequest, //!< The first request is the most important to process next. + SecondRequest, //!< The second request is the most important to process next. + Equal //!< Both requests are equally important. }; //! Determine which of the two provided requests is more important to process next. Order Thread_PrioritizeRequests(const FileRequest* first, const FileRequest* second) const; diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp index cfd191b68f..701eb563ec 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp @@ -60,9 +60,9 @@ namespace AZ::IO AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(request, "PrepareRequest was provided a null request."); - if (AZStd::holds_alternative(request->GetCommand())) + if (AZStd::holds_alternative(request->GetCommand())) { - auto& readRequest = AZStd::get(request->GetCommand()); + auto& readRequest = AZStd::get(request->GetCommand()); FileRequest* read = m_context->GetNewInternalRequest(); read->CreateRead(request, readRequest.m_output, readRequest.m_outputSize, readRequest.m_path, @@ -79,29 +79,29 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v || - AZStd::is_same_v || - AZStd::is_same_v) + if constexpr (AZStd::is_same_v || + AZStd::is_same_v || + AZStd::is_same_v) { m_pendingRequests.push_back(request); return; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { CancelRequest(request, args.m_target); return; } else { - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { FlushCache(args.m_path); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FlushEntireCache(); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { Report(args); } @@ -118,15 +118,15 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { ReadFile(request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FileExistsRequest(request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FileMetaDataRetrievalRequest(request); } @@ -199,25 +199,25 @@ namespace AZ::IO AZStd::visit([&](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { targetFile = &args.m_path; readSize = args.m_size; offset = args.m_offset; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { targetFile = &args.m_compressionInfo.m_archiveFilename; readSize = args.m_compressionInfo.m_compressedSize; offset = args.m_compressionInfo.m_offset; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { readSize = 0; AZStd::chrono::microseconds averageTime = m_getFileExistsTimeAverage.CalculateAverage(); startTime += averageTime; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { readSize = 0; AZStd::chrono::microseconds averageTime = m_getFileMetaDataTimeAverage.CalculateAverage(); @@ -254,7 +254,7 @@ namespace AZ::IO { AZ_PROFILE_FUNCTION(AzCore); - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); AZ_Assert(data, "FileRequest queued on StorageDrive to be read didn't contain read data."); SystemFile* file = nullptr; @@ -342,7 +342,7 @@ namespace AZ::IO AZ_PROFILE_FUNCTION(AzCore); TIMED_AVERAGE_WINDOW_SCOPE(m_getFileExistsTimeAverage); - auto& fileExists = AZStd::get(request->GetCommand()); + auto& fileExists = AZStd::get(request->GetCommand()); size_t cacheIndex = FindFileInCache(fileExists.m_path); if (cacheIndex != s_fileNotFound) { @@ -360,7 +360,7 @@ namespace AZ::IO AZ_PROFILE_FUNCTION(AzCore); TIMED_AVERAGE_WINDOW_SCOPE(m_getFileMetaDataTimeAverage); - auto& command = AZStd::get(request->GetCommand()); + auto& command = AZStd::get(request->GetCommand()); // If the file is already open, use the file handle which usually is cheaper than asking for the file by name. size_t cacheIndex = FindFileInCache(command.m_path); if (cacheIndex != s_fileNotFound) @@ -446,11 +446,11 @@ namespace AZ::IO } } - void StorageDrive::Report(const FileRequest::ReportData& data) const + void StorageDrive::Report(const Requests::ReportData& data) const { switch (data.m_reportType) { - case FileRequest::ReportData::ReportType::FileLocks: + case Requests::ReportType::FileLocks: for (u32 i = 0; i < m_fileHandles.size(); ++i) { if (m_fileHandles[i] != nullptr) diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.h b/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.h index d90b31eeec..25f3d7b353 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.h @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include @@ -16,6 +17,11 @@ #include #include +namespace AZ::IO::Requests +{ + struct ReportData; +} + namespace AZ::IO { struct StorageDriveConfig final : @@ -72,7 +78,7 @@ namespace AZ::IO void EstimateCompletionTimeForRequest(FileRequest* request, AZStd::chrono::system_clock::time_point& startTime, const RequestPath*& activeFile, u64& activeOffset) const; - void Report(const FileRequest::ReportData& data) const; + void Report(const Requests::ReportData& data) const; TimedAverageWindow m_fileOpenCloseTimeAverage; TimedAverageWindow m_getFileExistsTimeAverage; diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.cpp index e4976f7d1c..dfc156bbee 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -210,7 +211,7 @@ namespace AZ::IO IStreamerTypes::ClaimMemory claimMemory) const { AZ_Assert(request.m_request, "The request handle provided to Streamer::GetReadRequestResult is invalid."); - auto readRequest = AZStd::get_if(&request.m_request->GetCommand()); + auto readRequest = AZStd::get_if(&request.m_request->GetCommand()); if (readRequest != nullptr) { buffer = readRequest->m_output; @@ -281,14 +282,14 @@ namespace AZ::IO } } - FileRequestPtr Streamer::Report(FileRequest::ReportData::ReportType reportType) + FileRequestPtr Streamer::Report(Requests::ReportType reportType) { FileRequestPtr result = CreateRequest(); Report(result, reportType); return result; } - FileRequestPtr& Streamer::Report(FileRequestPtr& request, FileRequest::ReportData::ReportType reportType) + FileRequestPtr& Streamer::Report(FileRequestPtr& request, Requests::ReportType reportType) { request->m_request.CreateReport(reportType); return request; diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.h b/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.h index bb363a0c64..7e3dd1a742 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.h @@ -20,6 +20,10 @@ namespace AZStd struct thread_desc; } +namespace AZ::IO::Requests +{ + enum class ReportType : int8_t; +} namespace AZ::IO { @@ -185,9 +189,9 @@ namespace AZ::IO void RecordStatistics(); //! Tells AZ::IO::Streamer the report the information for the report to the output. - FileRequestPtr Report(FileRequest::ReportData::ReportType reportType); + FileRequestPtr Report(Requests::ReportType reportType); //! Tells AZ::IO::Streamer the report the information for the report to the output. - FileRequestPtr& Report(FileRequestPtr& request, FileRequest::ReportData::ReportType reportType); + FileRequestPtr& Report(FileRequestPtr& request, Requests::ReportType reportType); Streamer(const AZStd::thread_desc& threadDesc, AZStd::unique_ptr streamStack); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerComponent.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerComponent.cpp index 9a465021c2..25fdb9bdfb 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerComponent.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerComponent.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -207,7 +208,7 @@ namespace AZ { if (m_streamer) { - m_streamer->QueueRequest(m_streamer->Report(AZ::IO::FileRequest::ReportData::ReportType::FileLocks)); + m_streamer->QueueRequest(m_streamer->Report(AZ::IO::Requests::ReportType::FileLocks)); } } diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.cpp index 5cd483bc55..fc5d6468d8 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.cpp @@ -22,6 +22,10 @@ namespace AZ static constexpr char LatePredictionName[] = "Early completions"; static constexpr char MissedDeadlinesName[] = "Missed deadlines"; #endif // AZ_STREAMER_ADD_EXTRA_PROFILING_INFO + + StreamerContext::StreamerContext() + { + } StreamerContext::~StreamerContext() { for (FileRequest* entry : m_internalRecycleBin) @@ -204,7 +208,7 @@ namespace AZ m_latePredictionsPercentageStat.GetMostRecentSample()); } } - auto readRequest = AZStd::get_if(&top->GetCommand()); + auto readRequest = AZStd::get_if(&top->GetCommand()); if (readRequest != nullptr) { m_missedDeadlinePercentageStat.PushSample(now < readRequest->m_deadline ? 0.0 : 1.0); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.h b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.h index 356eb7ddac..f4caaffc70 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.h @@ -7,23 +7,28 @@ */ #pragma once -#include -#include #include #include #include -#include -#include -#include #include +#include +#include +#include +#include namespace AZ::IO { + class FileRequest; + class ExternalFileRequest; + + using FileRequestPtr = AZStd::intrusive_ptr; + class StreamerContext { public: using PreparedQueue = AZStd::deque; + StreamerContext(); ~StreamerContext(); //! Gets a new file request, either by creating a new instance or diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.cpp b/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.cpp index feb8bce111..708bacd7cd 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.cpp +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.cpp @@ -172,9 +172,9 @@ namespace AZ::IO AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(request, "PrepareRequest was provided a null request."); - if (AZStd::holds_alternative(request->GetCommand())) + if (AZStd::holds_alternative(request->GetCommand())) { - auto& readRequest = AZStd::get(request->GetCommand()); + auto& readRequest = AZStd::get(request->GetCommand()); if (IsServicedByThisDrive(readRequest.m_path.GetAbsolutePath())) { FileRequest* read = m_context->GetNewInternalRequest(); @@ -195,7 +195,7 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { if (IsServicedByThisDrive(args.m_path.GetAbsolutePath())) { @@ -203,8 +203,8 @@ namespace AZ::IO return; } } - else if constexpr (AZStd::is_same_v || - AZStd::is_same_v) + else if constexpr (AZStd::is_same_v || + AZStd::is_same_v) { if (IsServicedByThisDrive(args.m_path.GetAbsolutePath())) { @@ -212,7 +212,7 @@ namespace AZ::IO return; } } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { if (CancelRequest(request, args.m_target)) { @@ -221,15 +221,15 @@ namespace AZ::IO return; } } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FlushCache(args.m_path); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FlushEntireCache(); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { Report(args); } @@ -257,13 +257,13 @@ namespace AZ::IO hasWorked = AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { FileExistsRequest(request); m_pendingRequests.pop_front(); return true; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FileMetaDataRetrievalRequest(request); m_pendingRequests.pop_front(); @@ -308,7 +308,7 @@ namespace AZ::IO FileReadInformation& read = m_readSlots_readInfo[i]; u64 totalBytesRead = m_readSizeAverage.GetTotal(); double totalReadTimeUSec = aznumeric_caster(m_readTimeAverage.GetTotal().count()); - auto readCommand = AZStd::get_if(&read.m_request->GetCommand()); + auto readCommand = AZStd::get_if(&read.m_request->GetCommand()); AZ_Assert(readCommand, "Request currently reading doesn't contain a read command."); auto endTime = read.m_startTime + AZStd::chrono::microseconds(aznumeric_cast((readCommand->m_size * totalReadTimeUSec) / totalBytesRead)); earliestSlot = AZStd::min(earliestSlot, endTime); @@ -354,25 +354,25 @@ namespace AZ::IO AZStd::visit([&](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { targetFile = &args.m_path; readSize = args.m_size; offset = args.m_offset; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { targetFile = &args.m_compressionInfo.m_archiveFilename; readSize = args.m_compressionInfo.m_compressedSize; offset = args.m_compressionInfo.m_offset; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { readSize = 0; AZStd::chrono::microseconds getFileExistsTimeAverage = m_getFileExistsTimeAverage.CalculateAverage(); startTime += getFileExistsTimeAverage; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { readSize = 0; AZStd::chrono::microseconds getFileExistsTimeAverage = m_getFileMetaDataRetrievalTimeAverage.CalculateAverage(); @@ -411,15 +411,15 @@ namespace AZ::IO AZStd::visit([&, this](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v || - AZStd::is_same_v) + if constexpr (AZStd::is_same_v || + AZStd::is_same_v) { if (IsServicedByThisDrive(args.m_path.GetAbsolutePath())) { EstimateCompletionTimeForRequest(request, startTime, activeFile, activeOffset); } } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { if (IsServicedByThisDrive(args.m_compressionInfo.m_archiveFilename.GetAbsolutePath())) { @@ -435,7 +435,7 @@ namespace AZ::IO aznumeric_cast(m_pendingRequests.size()) - m_activeReads_Count; } - auto StorageDriveWin::OpenFile(HANDLE& fileHandle, size_t& cacheSlot, FileRequest* request, const FileRequest::ReadData& data) -> OpenFileResult + auto StorageDriveWin::OpenFile(HANDLE& fileHandle, size_t& cacheSlot, FileRequest* request, const Requests::ReadData& data) -> OpenFileResult { HANDLE file = INVALID_HANDLE_VALUE; @@ -553,7 +553,7 @@ namespace AZ::IO return false; } - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); AZ_Assert(data, "Read request in StorageDriveWin doesn't contain read data."); HANDLE file = INVALID_HANDLE_VALUE; @@ -780,7 +780,7 @@ namespace AZ::IO void StorageDriveWin::FileExistsRequest(FileRequest* request) { - auto& fileExists = AZStd::get(request->GetCommand()); + auto& fileExists = AZStd::get(request->GetCommand()); AZ_PROFILE_SCOPE(AzCore, "StorageDriveWin::FileExistsRequest %s : %s", m_name.c_str(), fileExists.m_path.GetRelativePath()); @@ -836,7 +836,7 @@ namespace AZ::IO void StorageDriveWin::FileMetaDataRetrievalRequest(FileRequest* request) { - auto& command = AZStd::get(request->GetCommand()); + auto& command = AZStd::get(request->GetCommand()); AZ_PROFILE_SCOPE(AzCore, "StorageDriveWin::FileMetaDataRetrievalRequest %s : %s", m_name.c_str(), command.m_path.GetRelativePath()); @@ -1005,7 +1005,7 @@ namespace AZ::IO FileReadInformation& fileReadInfo = m_readSlots_readInfo[readSlot]; - auto readCommand = AZStd::get_if(&fileReadInfo.m_request->GetCommand()); + auto readCommand = AZStd::get_if(&fileReadInfo.m_request->GetCommand()); AZ_Assert(readCommand != nullptr, "Request stored with the overlapped I/O call did not contain a read request."); if (fileReadInfo.m_sectorAlignedOutput && !encounteredError) @@ -1147,11 +1147,11 @@ namespace AZ::IO StreamStackEntry::CollectStatistics(statistics); } - void StorageDriveWin::Report(const FileRequest::ReportData& data) const + void StorageDriveWin::Report(const Requests::ReportData& data) const { switch (data.m_reportType) { - case FileRequest::ReportData::ReportType::FileLocks: + case Requests::ReportType::FileLocks: if (m_cachesInitialized) { for (u32 i = 0; i < m_maxFileHandles; ++i) diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.h b/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.h index c70eb7804d..5207d094ef 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.h +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.h @@ -9,6 +9,7 @@ #pragma once #include +#include #include #include #include @@ -19,6 +20,12 @@ #include #include +namespace AZ::IO::Requests +{ + struct ReadData; + struct ReportData; +} + namespace AZ::IO { class StorageDriveWin @@ -111,7 +118,7 @@ namespace AZ::IO CacheFull }; - OpenFileResult OpenFile(HANDLE& fileHandle, size_t& cacheSlot, FileRequest* request, const FileRequest::ReadData& data); + OpenFileResult OpenFile(HANDLE& fileHandle, size_t& cacheSlot, FileRequest* request, const Requests::ReadData& data); bool ReadRequest(FileRequest* request); bool ReadRequest(FileRequest* request, size_t readSlot); bool CancelRequest(FileRequest* cancelRequest, FileRequestPtr& target); @@ -137,7 +144,7 @@ namespace AZ::IO void FinalizeSingleRequest(FileReadStatus& status, size_t readSlot, DWORD numBytesTransferred, bool isCanceled, bool encounteredError); - void Report(const FileRequest::ReportData& data) const; + void Report(const Requests::ReportData& data) const; TimedAverageWindow m_fileOpenCloseTimeAverage; TimedAverageWindow m_getFileExistsTimeAverage; diff --git a/Code/Framework/AzCore/Tests/Asset/AssetDataStreamTests.cpp b/Code/Framework/AzCore/Tests/Asset/AssetDataStreamTests.cpp index 27903495f1..3846c6cf16 100644 --- a/Code/Framework/AzCore/Tests/Asset/AssetDataStreamTests.cpp +++ b/Code/Framework/AzCore/Tests/Asset/AssetDataStreamTests.cpp @@ -6,6 +6,7 @@ * */ #include +#include #include #include #include diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/IO/Streamer/StorageDriveTests_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/IO/Streamer/StorageDriveTests_Windows.cpp index e312e2058d..95b0626d7f 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/IO/Streamer/StorageDriveTests_Windows.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/IO/Streamer/StorageDriveTests_Windows.cpp @@ -406,7 +406,7 @@ namespace AZ::IO request->CreateFileMetaDataRetrieval(path); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileMetaData = AZStd::get(request.GetCommand()); + auto& fileMetaData = AZStd::get(request.GetCommand()); EXPECT_FALSE(fileMetaData.m_found); EXPECT_EQ(0, fileMetaData.m_fileSize); }); @@ -424,7 +424,7 @@ namespace AZ::IO request->SetCompletionCallback([](const FileRequest& request) { - auto& fileMetaData = AZStd::get(request.GetCommand()); + auto& fileMetaData = AZStd::get(request.GetCommand()); EXPECT_TRUE(fileMetaData.m_found); EXPECT_EQ(4_kib, fileMetaData.m_fileSize); }); @@ -442,7 +442,7 @@ namespace AZ::IO request->CreateFileMetaDataRetrieval(path); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileMetaData = AZStd::get(request.GetCommand()); + auto& fileMetaData = AZStd::get(request.GetCommand()); EXPECT_FALSE(fileMetaData.m_found); EXPECT_EQ(0, fileMetaData.m_fileSize); }); @@ -460,7 +460,7 @@ namespace AZ::IO request->SetCompletionCallback([](const FileRequest& request) { - auto& fileMetaData = AZStd::get(request.GetCommand()); + auto& fileMetaData = AZStd::get(request.GetCommand()); EXPECT_TRUE(fileMetaData.m_found); EXPECT_EQ(16_kib, fileMetaData.m_fileSize); }); @@ -484,7 +484,7 @@ namespace AZ::IO request->SetCompletionCallback([](const FileRequest& request) { - auto& fileMetaData = AZStd::get(request.GetCommand()); + auto& fileMetaData = AZStd::get(request.GetCommand()); EXPECT_TRUE(fileMetaData.m_found); EXPECT_EQ(4_kib, fileMetaData.m_fileSize); }); @@ -502,7 +502,7 @@ namespace AZ::IO request->CreateFileExistsCheck(invalidPath); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileExistsCheck = AZStd::get(request.GetCommand()); + auto& fileExistsCheck = AZStd::get(request.GetCommand()); EXPECT_EQ(AZ::IO::IStreamerTypes::RequestStatus::Completed, request.GetStatus()); EXPECT_FALSE(fileExistsCheck.m_found); }); @@ -519,7 +519,7 @@ namespace AZ::IO request->CreateFileExistsCheck(path); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileExistsCheck = AZStd::get(request.GetCommand()); + auto& fileExistsCheck = AZStd::get(request.GetCommand()); EXPECT_EQ(AZ::IO::IStreamerTypes::RequestStatus::Completed, request.GetStatus()); EXPECT_FALSE(fileExistsCheck.m_found); }); @@ -535,7 +535,7 @@ namespace AZ::IO request->CreateFileExistsCheck(m_dummyRequestPath); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileExistsCheck = AZStd::get(request.GetCommand()); + auto& fileExistsCheck = AZStd::get(request.GetCommand()); EXPECT_EQ(AZ::IO::IStreamerTypes::RequestStatus::Completed, request.GetStatus()); EXPECT_TRUE(fileExistsCheck.m_found); }); @@ -551,7 +551,7 @@ namespace AZ::IO request->CreateFileExistsCheck(m_dummyRequestPath); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileExistsCheck = AZStd::get(request.GetCommand()); + auto& fileExistsCheck = AZStd::get(request.GetCommand()); EXPECT_EQ(AZ::IO::IStreamerTypes::RequestStatus::Completed, request.GetStatus()); EXPECT_TRUE(fileExistsCheck.m_found); }); @@ -573,7 +573,7 @@ namespace AZ::IO request->CreateFileExistsCheck(m_dummyRequestPath); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileExistsCheck = AZStd::get(request.GetCommand()); + auto& fileExistsCheck = AZStd::get(request.GetCommand()); EXPECT_EQ(AZ::IO::IStreamerTypes::RequestStatus::Completed, request.GetStatus()); EXPECT_TRUE(fileExistsCheck.m_found); }); @@ -603,7 +603,7 @@ namespace AZ::IO AZ_POP_DISABLE_WARNING { EXPECT_EQ(request.GetStatus(), AZ::IO::IStreamerTypes::RequestStatus::Completed); - auto& readRequest = AZStd::get(request.GetCommand()); + auto& readRequest = AZStd::get(request.GetCommand()); EXPECT_EQ(readRequest.m_size, fileSize); EXPECT_STREQ(readRequest.m_path.GetAbsolutePath(), m_dummyFilepath.c_str()); }; @@ -648,7 +648,7 @@ namespace AZ::IO AZ_POP_DISABLE_WARNING { EXPECT_EQ(request.GetStatus(), AZ::IO::IStreamerTypes::RequestStatus::Completed); - auto& readRequest = AZStd::get(request.GetCommand()); + auto& readRequest = AZStd::get(request.GetCommand()); EXPECT_EQ(readRequest.m_size, unalignedSize); EXPECT_EQ(readRequest.m_offset, unalignedOffset); EXPECT_STREQ(readRequest.m_path.GetAbsolutePath(), m_dummyFilepath.c_str()); @@ -796,7 +796,7 @@ namespace AZ::IO AZ_POP_DISABLE_WARNING { EXPECT_EQ(request.GetStatus(), AZ::IO::IStreamerTypes::RequestStatus::Completed); - auto& readRequest = AZStd::get(request.GetCommand()); + auto& readRequest = AZStd::get(request.GetCommand()); EXPECT_EQ(readRequest.m_size, chunkSize); EXPECT_EQ(readRequest.m_offset, i * chunkSize); }; diff --git a/Code/Framework/AzCore/Tests/Streamer/BlockCacheTests.cpp b/Code/Framework/AzCore/Tests/Streamer/BlockCacheTests.cpp index 3a107da61d..d9d3623fbd 100644 --- a/Code/Framework/AzCore/Tests/Streamer/BlockCacheTests.cpp +++ b/Code/Framework/AzCore/Tests/Streamer/BlockCacheTests.cpp @@ -100,7 +100,7 @@ namespace AZ::IO void QueueReadRequest(FileRequest* request) { - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); if (data) { if (m_fakeFileFound) @@ -122,15 +122,15 @@ namespace AZ::IO m_context->MarkRequestAsCompleted(request); } else if ( - AZStd::holds_alternative(request->GetCommand()) || - AZStd::holds_alternative(request->GetCommand())) + AZStd::holds_alternative(request->GetCommand()) || + AZStd::holds_alternative(request->GetCommand())) { request->SetStatus(IStreamerTypes::RequestStatus::Completed); m_context->MarkRequestAsCompleted(request); } - else if (AZStd::holds_alternative(request->GetCommand())) + else if (AZStd::holds_alternative(request->GetCommand())) { - auto& data2 = AZStd::get(request->GetCommand()); + auto& data2 = AZStd::get(request->GetCommand()); data2.m_found = m_fakeFileFound; data2.m_fileSize = m_fakeFileLength; request->SetStatus(m_fakeFileFound ? IStreamerTypes::RequestStatus::Completed : IStreamerTypes::RequestStatus::Failed); @@ -158,16 +158,16 @@ namespace AZ::IO void QueueCanceledReadRequest(FileRequest* request) { - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); if (data) { ReadFile(data->m_output, data->m_path, data->m_offset, data->m_size); request->SetStatus(IStreamerTypes::RequestStatus::Canceled); m_context->MarkRequestAsCompleted(request); } - else if (AZStd::holds_alternative(request->GetCommand())) + else if (AZStd::holds_alternative(request->GetCommand())) { - auto& data2 = AZStd::get(request->GetCommand()); + auto& data2 = AZStd::get(request->GetCommand()); data2.m_found = true; data2.m_fileSize = m_fakeFileLength; request->SetStatus(IStreamerTypes::RequestStatus::Completed); diff --git a/Code/Framework/AzCore/Tests/Streamer/FullDecompressorTests.cpp b/Code/Framework/AzCore/Tests/Streamer/FullDecompressorTests.cpp index 9f2f0dbd6b..f465a0dafb 100644 --- a/Code/Framework/AzCore/Tests/Streamer/FullDecompressorTests.cpp +++ b/Code/Framework/AzCore/Tests/Streamer/FullDecompressorTests.cpp @@ -145,7 +145,7 @@ namespace AZ::IO void PrepareReadRequest(FileRequest* request) { - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); ASSERT_NE(nullptr, data); u64 size = data->m_size >> 2; diff --git a/Code/Framework/AzCore/Tests/Streamer/IStreamerMock.h b/Code/Framework/AzCore/Tests/Streamer/IStreamerMock.h index 7b784caffd..0059a25b93 100644 --- a/Code/Framework/AzCore/Tests/Streamer/IStreamerMock.h +++ b/Code/Framework/AzCore/Tests/Streamer/IStreamerMock.h @@ -9,6 +9,7 @@ #include #include +#include using namespace AZ::IO; diff --git a/Code/Framework/AzCore/Tests/Streamer/ReadSplitterTests.cpp b/Code/Framework/AzCore/Tests/Streamer/ReadSplitterTests.cpp index a68ce091b8..01fe2f6a12 100644 --- a/Code/Framework/AzCore/Tests/Streamer/ReadSplitterTests.cpp +++ b/Code/Framework/AzCore/Tests/Streamer/ReadSplitterTests.cpp @@ -155,7 +155,7 @@ namespace AZ::IO { EXPECT_EQ(subRequests[i]->GetParent(), readRequest); - FileRequest::ReadData* data = AZStd::get_if(&subRequests[i]->GetCommand()); + Requests::ReadData* data = AZStd::get_if(&subRequests[i]->GetCommand()); ASSERT_NE(nullptr, data); EXPECT_EQ(SplitSize, data->m_size); EXPECT_EQ(SplitSize * i, data->m_offset); @@ -210,7 +210,7 @@ namespace AZ::IO { EXPECT_EQ(subRequests[i]->GetParent(), readRequest); - FileRequest::ReadData* data = AZStd::get_if(&subRequests[i]->GetCommand()); + Requests::ReadData* data = AZStd::get_if(&subRequests[i]->GetCommand()); ASSERT_NE(nullptr, data); EXPECT_EQ(SplitSize, data->m_size); EXPECT_EQ(SplitSize * i, data->m_offset); @@ -230,7 +230,7 @@ namespace AZ::IO { EXPECT_EQ(subRequests[i]->GetParent(), readRequest); - FileRequest::ReadData* data = AZStd::get_if(&subRequests[i]->GetCommand()); + Requests::ReadData* data = AZStd::get_if(&subRequests[i]->GetCommand()); ASSERT_NE(nullptr, data); EXPECT_EQ(SplitSize, data->m_size); EXPECT_EQ(SplitSize * (batchSize + i), data->m_offset); @@ -265,7 +265,7 @@ namespace AZ::IO m_readSplitter->QueueRequest(readRequest); ASSERT_NE(nullptr, subRequest); - FileRequest::ReadData* data = AZStd::get_if(&subRequest->GetCommand()); + Requests::ReadData* data = AZStd::get_if(&subRequest->GetCommand()); EXPECT_NE(buffer, data->m_output); EXPECT_EQ(readSize, data->m_size); EXPECT_EQ(0, data->m_offset); @@ -311,7 +311,7 @@ namespace AZ::IO m_readSplitter->QueueRequest(readRequest); ASSERT_NE(nullptr, subRequest); - FileRequest::ReadData* data = AZStd::get_if(&subRequest->GetCommand()); + Requests::ReadData* data = AZStd::get_if(&subRequest->GetCommand()); EXPECT_NE(buffer, data->m_output); EXPECT_EQ(readSize + offsetAdjustment, data->m_size); EXPECT_EQ(0, data->m_offset); diff --git a/Code/Framework/AzCore/Tests/Streamer/SchedulerTests.cpp b/Code/Framework/AzCore/Tests/Streamer/SchedulerTests.cpp index 6c360b97de..d1484b7409 100644 --- a/Code/Framework/AzCore/Tests/Streamer/SchedulerTests.cpp +++ b/Code/Framework/AzCore/Tests/Streamer/SchedulerTests.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -86,7 +87,7 @@ namespace AZ::IO .WillOnce([this](FileRequest* request) { AZ_Assert(m_streamerContext, "AZ::IO::Streamer is not ready to process requests."); - auto readData = AZStd::get_if(&request->GetCommand()); + auto readData = AZStd::get_if(&request->GetCommand()); AZ_Assert(readData, "Test didn't pass in the correct request."); FileRequest* read = m_streamerContext->GetNewInternalRequest(); read->CreateRead(request, readData->m_output, readData->m_outputSize, readData->m_path, @@ -99,7 +100,7 @@ namespace AZ::IO .WillOnce([this](FileRequest* request) { AZ_Assert(m_streamerContext, "AZ::IO::Streamer is not ready to process requests."); - auto readData = AZStd::get_if(&request->GetCommand()); + auto readData = AZStd::get_if(&request->GetCommand()); AZ_Assert(readData, "Test didn't pass in the correct request."); auto output = reinterpret_cast(readData->m_output); AZ_Assert(output != nullptr, "Output buffer has not been set."); @@ -304,7 +305,7 @@ namespace AZ::IO EXPECT_CALL(*m_mock, QueueRequest(_)).Times(1) .WillOnce(Invoke([this](FileRequest* request) { - auto* read = request->GetCommandFromChain(); + auto* read = request->GetCommandFromChain(); ASSERT_NE(nullptr, read); EXPECT_LT(read->m_deadline, FileRequest::s_noDeadlineTime); EXPECT_EQ(read->m_priority, IStreamerTypes::s_priorityHighest); diff --git a/Code/Framework/AzCore/Tests/Streamer/StreamStackEntryConformityTests.h b/Code/Framework/AzCore/Tests/Streamer/StreamStackEntryConformityTests.h index 6cbec7ea8a..8a5805cccd 100644 --- a/Code/Framework/AzCore/Tests/Streamer/StreamStackEntryConformityTests.h +++ b/Code/Framework/AzCore/Tests/Streamer/StreamStackEntryConformityTests.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/Code/Framework/AzCore/Tests/StreamerTests.cpp b/Code/Framework/AzCore/Tests/StreamerTests.cpp index 78f9f9060f..937b6d29de 100644 --- a/Code/Framework/AzCore/Tests/StreamerTests.cpp +++ b/Code/Framework/AzCore/Tests/StreamerTests.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/Code/Framework/AzFramework/AzFramework/Asset/AssetSystemComponent.cpp b/Code/Framework/AzFramework/AzFramework/Asset/AssetSystemComponent.cpp index bb361e56de..35c23d119a 100644 --- a/Code/Framework/AzFramework/AzFramework/Asset/AssetSystemComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Asset/AssetSystemComponent.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp index 589c805871..23d275cb78 100644 --- a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp +++ b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp @@ -83,9 +83,9 @@ namespace AzFramework AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(request, "PrepareRequest was provided a null request."); - if (AZStd::holds_alternative(request->GetCommand())) + if (AZStd::holds_alternative(request->GetCommand())) { - auto& readRequest = AZStd::get(request->GetCommand()); + auto& readRequest = AZStd::get(request->GetCommand()); FileRequest* read = m_context->GetNewInternalRequest(); read->CreateRead(request, readRequest.m_output, readRequest.m_outputSize, readRequest.m_path, @@ -106,14 +106,14 @@ namespace AzFramework { using namespace AZ::IO; using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v || - AZStd::is_same_v || - AZStd::is_same_v) + if constexpr (AZStd::is_same_v || + AZStd::is_same_v || + AZStd::is_same_v) { m_pendingRequests.push_back(request); return; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { if (CancelRequest(request, args.m_target)) { @@ -124,15 +124,15 @@ namespace AzFramework } else { - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { FlushCache(args.m_path); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FlushEntireCache(); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { Report(args); } @@ -152,15 +152,15 @@ namespace AzFramework { using namespace AZ::IO; using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { ReadFile(request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FileExistsRequest(request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FileMetaDataRetrievalRequest(request); } @@ -232,23 +232,23 @@ namespace AzFramework { using namespace AZ::IO; using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { targetFile = &args.m_path; readSize = args.m_size; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { targetFile = &args.m_compressionInfo.m_archiveFilename; readSize = args.m_compressionInfo.m_compressedSize; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { readSize = 0; AZStd::chrono::microseconds averageTime = m_getFileExistsTimeAverage.CalculateAverage(); startTime += averageTime; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { readSize = 0; AZStd::chrono::microseconds averageTime = m_getFileMetaDataTimeAverage.CalculateAverage(); @@ -280,7 +280,7 @@ namespace AzFramework AZ_PROFILE_FUNCTION(AzCore); - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); AZ_Assert(data, "Request doing reading in the RemoteStorageDrive didn't contain read data."); HandleType file = InvalidHandle; @@ -397,7 +397,7 @@ namespace AzFramework TIMED_AVERAGE_WINDOW_SCOPE(m_getFileExistsTimeAverage); - auto& fileExists = AZStd::get(request->GetCommand()); + auto& fileExists = AZStd::get(request->GetCommand()); size_t cacheIndex = FindFileInCache(fileExists.m_path); if (cacheIndex != s_fileNotFound) { @@ -430,7 +430,7 @@ namespace AzFramework AZ::u64 fileSize = 0; bool found = false; - auto& command = AZStd::get(request->GetCommand()); + auto& command = AZStd::get(request->GetCommand()); // If the file is already open, use the file handle which usually is cheaper than asking for the file by name. size_t cacheIndex = FindFileInCache(command.m_path); if (cacheIndex != s_fileNotFound) @@ -526,13 +526,13 @@ namespace AzFramework StreamStackEntry::CollectStatistics(statistics); } - void RemoteStorageDrive::Report(const AZ::IO::FileRequest::ReportData& data) const + void RemoteStorageDrive::Report(const AZ::IO::Requests::ReportData& data) const { using namespace AZ::IO; switch (data.m_reportType) { - case FileRequest::ReportData::ReportType::FileLocks: + case Requests::ReportType::FileLocks: for (AZ::u32 i = 0; i < m_fileHandles.size(); ++i) { if (m_fileHandles[i] != InvalidHandle) diff --git a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.h b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.h index c3e28f2e55..de0b855dcc 100644 --- a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.h +++ b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.h @@ -16,6 +16,15 @@ #include #include +namespace AZ::IO +{ + class RequestPath; + namespace Requests + { + struct ReportData; + } +} + namespace AzFramework { struct RemoteStorageDriveConfig final : @@ -63,7 +72,7 @@ namespace AzFramework const AZ::IO::RequestPath*& activeFile) const; void FlushCache(const AZ::IO::RequestPath& filePath); void FlushEntireCache(); - void Report(const AZ::IO::FileRequest::ReportData& data) const; + void Report(const AZ::IO::Requests::ReportData& data) const; AZ::IO::RemoteFileIO m_fileIO; AZ::IO::TimedAverageWindow m_fileOpenCloseTimeAverage; diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.cpp index 168152f686..bb1270a387 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyAutomation.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyAutomation.cpp index e78ff49f2d..a86ef12216 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyAutomation.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyAutomation.cpp @@ -8,6 +8,7 @@ #include +#include #include #include diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyEvents.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyEvents.cpp index b51298a797..005ce291f6 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyEvents.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyEvents.cpp @@ -8,6 +8,7 @@ #include +#include #include #include #include diff --git a/Code/Framework/AzFramework/AzFramework/Physics/PhysicsScene.cpp b/Code/Framework/AzFramework/AzFramework/Physics/PhysicsScene.cpp index a5ebdd04c6..1937c50555 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/PhysicsScene.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/PhysicsScene.cpp @@ -9,6 +9,7 @@ #include #include +#include #include diff --git a/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.cpp b/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.cpp index 2ff4780c9e..a0bb2d9366 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.cpp @@ -8,6 +8,7 @@ #include +#include #include namespace AzPhysics diff --git a/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp b/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp index 79365f1ebe..b2c36bc1c8 100644 --- a/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/ToolsAssetCatalogComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/ToolsAssetCatalogComponent.h index a68b82468e..56a3e7005c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/ToolsAssetCatalogComponent.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/ToolsAssetCatalogComponent.h @@ -7,6 +7,7 @@ */ #pragma once +#include #include #include #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h index 4596d70657..34b3a0a0b6 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h @@ -10,12 +10,13 @@ #if !defined(Q_MOC_RUN) #include +#include #endif namespace AzToolsFramework { using namespace AzToolsFramework::AssetBrowser; - + //! Model storing all the files that can be suggested in the Asset Autocompleter for PropertyAssetCtrl class AssetCompleterModel : public QAbstractTableModel @@ -45,7 +46,7 @@ namespace AzToolsFramework void SetFetchEntryType(AssetBrowserEntry::AssetEntryType entryType); private: - struct AssetItem + struct AssetItem { AZStd::string m_displayName; AZStd::string m_path; diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp index 78244ab02c..78e71ab3f2 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h index 982de92739..838cdd2256 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h @@ -7,13 +7,15 @@ */ #pragma once -#include -#include #include #include #include #include +#include +#include +#include + namespace AZ { class ReflectContext; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h index ce5a4c8a7a..701b90ace9 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h @@ -10,6 +10,7 @@ #include #include +#include namespace AZ { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp index bd196a2e2b..b97ffecccd 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp @@ -267,7 +267,7 @@ namespace AZ return m_visScene->GetEntryCount(); } - + struct WorklistData { CullingDebugContext* m_debugCtx = nullptr; @@ -296,13 +296,13 @@ namespace AZ #endif return worklistData; } - + constexpr size_t WorkListCapacity = 5; using WorkListType = AZStd::fixed_vector; #if AZ_TRAIT_MASKED_OCCLUSION_CULLING_SUPPORTED static MaskedOcclusionCulling::CullingResult TestOcclusionCulling( - const AZStd::shared_ptr& worklistData, + const AZStd::shared_ptr& worklistData, AzFramework::VisibilityEntry* visibleEntry); #endif @@ -320,8 +320,8 @@ namespace AZ for (const AzFramework::IVisibilityScene::NodeData& nodeData : worklist) { //If a node is entirely contained within the frustum, then we can skip the fine grained culling. - bool nodeIsContainedInFrustum = - !worklistData->m_debugCtx->m_enableFrustumCulling || + bool nodeIsContainedInFrustum = + !worklistData->m_debugCtx->m_enableFrustumCulling || ShapeIntersection::Contains(worklistData->m_frustum, nodeData.m_bounds); #ifdef AZ_CULL_PROFILE_VERBOSE @@ -460,12 +460,14 @@ namespace AZ cullStats.m_numVisibleCullables += numVisibleCullables; ++cullStats.m_numJobs; } +#else + (void)numDrawPackets; // prevent unused variable warning->error #endif //AZ_CULL_DEBUG_ENABLED } #if AZ_TRAIT_MASKED_OCCLUSION_CULLING_SUPPORTED static MaskedOcclusionCulling::CullingResult TestOcclusionCulling( - const AZStd::shared_ptr& worklistData, + const AZStd::shared_ptr& worklistData, AzFramework::VisibilityEntry* visibleEntry) { if (!worklistData->m_maskedOcclusionCulling) @@ -527,9 +529,9 @@ namespace AZ #endif void CullingScene::ProcessCullablesCommon( - const Scene& scene [[maybe_unused]], - View& view, - AZ::Frustum& frustum [[maybe_unused]], + const Scene& scene [[maybe_unused]], + View& view, + AZ::Frustum& frustum [[maybe_unused]], void*& maskedOcclusionCulling [[maybe_unused]]) { AZ_PROFILE_SCOPE(RPI, "CullingScene::ProcessCullablesCommon() - %s", view.GetName().GetCStr()); @@ -898,7 +900,7 @@ namespace AZ { const Matrix4x4& worldToClip = viewPtr->GetWorldToClipMatrix(); Frustum frustum = Frustum::CreateFromMatrixColumnMajor(worldToClip, Frustum::ReverseDepth::True); - m_debugCtx.m_frozenFrustums.insert({ viewPtr.get(), frustum }); + m_debugCtx.m_frozenFrustums.insert({ viewPtr.get(), frustum }); } } } @@ -911,7 +913,7 @@ namespace AZ } void CullingScene::EndCulling() - { + { m_cullDataConcurrencyCheck.soft_unlock(); } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Metrics/ShaderMetricsSystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Metrics/ShaderMetricsSystem.cpp index e11624a921..460e671b4c 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Metrics/ShaderMetricsSystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Metrics/ShaderMetricsSystem.cpp @@ -11,13 +11,13 @@ #include +#include +#include #include #include #include - #include -#include namespace AZ { diff --git a/Gems/Atom/RPI/Code/Tests/Common/AssetManagerTestFixture.cpp b/Gems/Atom/RPI/Code/Tests/Common/AssetManagerTestFixture.cpp index fd19c6bcb8..83e8dbf085 100644 --- a/Gems/Atom/RPI/Code/Tests/Common/AssetManagerTestFixture.cpp +++ b/Gems/Atom/RPI/Code/Tests/Common/AssetManagerTestFixture.cpp @@ -7,6 +7,8 @@ */ #include "AssetManagerTestFixture.h" + +#include #include #include diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/AssetCollectionAsyncLoader.h b/Gems/Atom/Utils/Code/Include/Atom/Utils/AssetCollectionAsyncLoader.h index d1027daa36..b974b4443d 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/AssetCollectionAsyncLoader.h +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/AssetCollectionAsyncLoader.h @@ -9,6 +9,7 @@ #include #include +#include #include #include #include diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp index 58b3d8b56e..35ae1b1257 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp @@ -38,6 +38,8 @@ #include #include +#include + namespace AZ::Render { static constexpr uint32_t s_maxActiveWrinkleMasks = 16; diff --git a/Gems/AtomTressFX/Code/Rendering/SharedBuffer.cpp b/Gems/AtomTressFX/Code/Rendering/SharedBuffer.cpp index b31d9f8ae0..6f97613c89 100644 --- a/Gems/AtomTressFX/Code/Rendering/SharedBuffer.cpp +++ b/Gems/AtomTressFX/Code/Rendering/SharedBuffer.cpp @@ -16,6 +16,8 @@ #include #include +#include + namespace AZ::Render { //! Setting the constructor as private will create compile error to remind the developer to set diff --git a/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp b/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp index 2d95ddf4dd..ce17803531 100644 --- a/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp +++ b/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp @@ -8,6 +8,7 @@ #include +#include namespace Audio { @@ -285,5 +286,22 @@ namespace Audio return sResult; } + CATLAudioFileEntry::CATLAudioFileEntry(const char * const filePath, IATLAudioFileEntryData * const implData) + : m_filePath(filePath) + , m_fileSize(0) + , m_useCount(0) + , m_memoryBlockAlignment(AUDIO_MEMORY_ALIGNMENT) + , m_flags(eAFF_NOTFOUND) + , m_dataScope(eADS_ALL) + , m_memoryBlock(nullptr) + , m_implData(implData) + { + } + + CATLAudioFileEntry::~CATLAudioFileEntry() + { + + } + #endif // !AUDIO_RELEASE } // namespace Audio diff --git a/Gems/AudioSystem/Code/Source/Engine/ATLEntities.h b/Gems/AudioSystem/Code/Source/Engine/ATLEntities.h index f1ff74c370..4dfceeebfc 100644 --- a/Gems/AudioSystem/Code/Source/Engine/ATLEntities.h +++ b/Gems/AudioSystem/Code/Source/Engine/ATLEntities.h @@ -379,19 +379,9 @@ namespace Audio class CATLAudioFileEntry { public: - explicit CATLAudioFileEntry(const char* const filePath = nullptr, IATLAudioFileEntryData* const implData = nullptr) - : m_filePath(filePath) - , m_fileSize(0) - , m_useCount(0) - , m_memoryBlockAlignment(AUDIO_MEMORY_ALIGNMENT) - , m_flags(eAFF_NOTFOUND) - , m_dataScope(eADS_ALL) - , m_memoryBlock(nullptr) - , m_implData(implData) - { - } + explicit CATLAudioFileEntry(const char* const filePath = nullptr, IATLAudioFileEntryData* const implData = nullptr); - ~CATLAudioFileEntry() = default; + ~CATLAudioFileEntry(); AZStd::string m_filePath; size_t m_fileSize; diff --git a/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp b/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp index ffa94ad956..d1f2187942 100644 --- a/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp +++ b/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp b/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp index 14e9f74fd2..a197fee96b 100644 --- a/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp +++ b/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/Gems/AudioSystem/Code/Tests/Mocks/FileCacheManagerMock.h b/Gems/AudioSystem/Code/Tests/Mocks/FileCacheManagerMock.h index 06646216ae..1fb48bb3fb 100644 --- a/Gems/AudioSystem/Code/Tests/Mocks/FileCacheManagerMock.h +++ b/Gems/AudioSystem/Code/Tests/Mocks/FileCacheManagerMock.h @@ -13,6 +13,11 @@ #include #include +namespace AZ::IO +{ + class FileRequestHandle; +} + namespace Audio { class FileCacheManagerMock diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/ActorInstance.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/ActorInstance.cpp index c196f34716..bde1259c44 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/ActorInstance.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/ActorInstance.cpp @@ -34,6 +34,8 @@ #include #include +#include + namespace EMotionFX { AZ_CLASS_ALLOCATOR_IMPL(ActorInstance, ActorInstanceAllocator, 0) diff --git a/Gems/EMotionFX/Code/Tests/TestAssetCode/SimpleActors.cpp b/Gems/EMotionFX/Code/Tests/TestAssetCode/SimpleActors.cpp index 3e1dac41c2..e6415817cc 100644 --- a/Gems/EMotionFX/Code/Tests/TestAssetCode/SimpleActors.cpp +++ b/Gems/EMotionFX/Code/Tests/TestAssetCode/SimpleActors.cpp @@ -15,6 +15,8 @@ #include #include +#include + namespace EMotionFX { SimpleJointChainActor::SimpleJointChainActor(size_t jointCount, const char* name) diff --git a/Gems/LmbrCentral/Code/Source/Asset/AssetSystemDebugComponent.cpp b/Gems/LmbrCentral/Code/Source/Asset/AssetSystemDebugComponent.cpp index acd1bc8dae..91ba63ddd1 100644 --- a/Gems/LmbrCentral/Code/Source/Asset/AssetSystemDebugComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Asset/AssetSystemDebugComponent.cpp @@ -9,7 +9,9 @@ #include "AssetSystemDebugComponent.h" #include "ISystem.h" #include "IRenderAuxGeom.h" + #include "AzCore/Asset/AssetManager.h" +#include #include #include #include diff --git a/Gems/LmbrCentral/Code/Source/Audio/AudioAreaEnvironmentComponent.cpp b/Gems/LmbrCentral/Code/Source/Audio/AudioAreaEnvironmentComponent.cpp index 827e20b02b..3b14822076 100644 --- a/Gems/LmbrCentral/Code/Source/Audio/AudioAreaEnvironmentComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Audio/AudioAreaEnvironmentComponent.cpp @@ -8,6 +8,7 @@ #include "AudioAreaEnvironmentComponent.h" +#include #include #include #include diff --git a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.h b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.h index a400f742de..baac5b3776 100644 --- a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.h +++ b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.h @@ -10,6 +10,7 @@ #include #include +#include #include namespace NvCloth diff --git a/Gems/NvCloth/Code/Source/Utils/AssetHelper.h b/Gems/NvCloth/Code/Source/Utils/AssetHelper.h index e3e5a5e7ad..4a40fe26f0 100644 --- a/Gems/NvCloth/Code/Source/Utils/AssetHelper.h +++ b/Gems/NvCloth/Code/Source/Utils/AssetHelper.h @@ -10,6 +10,7 @@ #include #include +#include #include diff --git a/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeAngleCone.h b/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeAngleCone.h index 3f6d001112..11215ef29b 100644 --- a/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeAngleCone.h +++ b/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeAngleCone.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeSnap.h b/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeSnap.h index 843fffd4c8..c7a50c43f5 100644 --- a/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeSnap.h +++ b/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeSnap.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/Gems/PhysX/Code/Source/ForceRegionComponent.cpp b/Gems/PhysX/Code/Source/ForceRegionComponent.cpp index f8f5f1991e..eba902049d 100644 --- a/Gems/PhysX/Code/Source/ForceRegionComponent.cpp +++ b/Gems/PhysX/Code/Source/ForceRegionComponent.cpp @@ -9,6 +9,8 @@ #include #include +#include +#include #include #include #include diff --git a/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.cpp b/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.cpp index 975fec2181..c02324ed18 100644 --- a/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.cpp +++ b/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.cpp @@ -6,18 +6,22 @@ * */ -#include -#include -#include -#include +#include #include #include #include #include -#include #include +#include +#include +#include +#include +#include + + + namespace PhysX::Utils { struct PxJointActorData diff --git a/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.h b/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.h index da7b3dc4e2..d5aa082763 100644 --- a/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.h +++ b/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.h @@ -14,8 +14,15 @@ #include +#include + namespace PhysX { + struct D6JointLimitConfiguration; + struct FixedJointConfiguration; + struct BallJointConfiguration; + struct HingeJointConfiguration; + namespace JointConstants { // Setting joint limits to very small values can cause extreme stability problems, so clamp above a small diff --git a/Gems/PhysX/Code/Source/JointComponent.cpp b/Gems/PhysX/Code/Source/JointComponent.cpp index d5c04598a5..085fc34b12 100644 --- a/Gems/PhysX/Code/Source/JointComponent.cpp +++ b/Gems/PhysX/Code/Source/JointComponent.cpp @@ -5,17 +5,18 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ +#include +#include +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include #include -#include namespace PhysX { diff --git a/Gems/PhysX/Code/Source/Material.cpp b/Gems/PhysX/Code/Source/Material.cpp index be79728cc5..fa131b5159 100644 --- a/Gems/PhysX/Code/Source/Material.cpp +++ b/Gems/PhysX/Code/Source/Material.cpp @@ -7,9 +7,10 @@ */ #include "Material.h" +#include #include -#include #include +#include #include namespace PhysX diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp b/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp index f4cdd01889..fbadb8aa79 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp +++ b/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp @@ -5,13 +5,10 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ - #include + #include #include -#include -#include -#include #include #include #include @@ -20,6 +17,12 @@ #include #include +#include +#include +#include + +#include + namespace PhysX::Utils::Characters { AZ::Outcome GetNodeIndex(const Physics::RagdollConfiguration& configuration, const AZStd::string& nodeName) diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/API/RagdollNode.cpp b/Gems/PhysX/Code/Source/PhysXCharacters/API/RagdollNode.cpp index 34fe3d0295..3e240f3611 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/API/RagdollNode.cpp +++ b/Gems/PhysX/Code/Source/PhysXCharacters/API/RagdollNode.cpp @@ -5,16 +5,17 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ - -#include -#include -#include #include + #include #include #include - #include +#include +#include +#include +#include + namespace PhysX { diff --git a/Gems/PhysX/Code/Source/Pipeline/HeightFieldAssetHandler.cpp b/Gems/PhysX/Code/Source/Pipeline/HeightFieldAssetHandler.cpp index 2d05612d74..ece6acbd6f 100644 --- a/Gems/PhysX/Code/Source/Pipeline/HeightFieldAssetHandler.cpp +++ b/Gems/PhysX/Code/Source/Pipeline/HeightFieldAssetHandler.cpp @@ -6,15 +6,16 @@ * */ +#include #include #include +#include #include #include #include #include #include -#include #include #include diff --git a/Gems/PhysX/Code/Source/Pipeline/StreamWrapper.h b/Gems/PhysX/Code/Source/Pipeline/StreamWrapper.h index 15f9bfb36e..d987b7194c 100644 --- a/Gems/PhysX/Code/Source/Pipeline/StreamWrapper.h +++ b/Gems/PhysX/Code/Source/Pipeline/StreamWrapper.h @@ -10,6 +10,7 @@ #include #include +#include #include namespace PhysX diff --git a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp index dfac43b703..6c02697e90 100644 --- a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp +++ b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp @@ -7,14 +7,6 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include @@ -31,6 +23,16 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include + namespace PhysX { AZ_CLASS_ALLOCATOR_IMPL(PhysXScene, AZ::SystemAllocator, 0); diff --git a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp index 168adc8910..d7ce797b47 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp +++ b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp @@ -5,18 +5,20 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#include +#include + +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include - -#include +#include +#include +#include // only enable physx timestep warning when not running debug or in Release #if !defined(DEBUG) && !defined(RELEASE) diff --git a/Gems/PhysX/Code/Tests/PhysXTestUtil.cpp b/Gems/PhysX/Code/Tests/PhysXTestUtil.cpp index 2366f65e07..f79b7c8d34 100644 --- a/Gems/PhysX/Code/Tests/PhysXTestUtil.cpp +++ b/Gems/PhysX/Code/Tests/PhysXTestUtil.cpp @@ -9,6 +9,7 @@ #include "PhysXTestUtil.h" #include #include +#include namespace PhysX { diff --git a/Gems/PhysXDebug/Code/Source/SystemComponent.cpp b/Gems/PhysXDebug/Code/Source/SystemComponent.cpp index 65115f2790..746809a7ca 100644 --- a/Gems/PhysXDebug/Code/Source/SystemComponent.cpp +++ b/Gems/PhysXDebug/Code/Source/SystemComponent.cpp @@ -8,10 +8,7 @@ #include "SystemComponent.h" -#include -#include -#include -#include +#include #include #include @@ -19,20 +16,24 @@ #include #include +#include +#include +#include +#include + +#include #include #include #include #include #include -#include -#include -#include +#include +#include +#include +#include +#include -#include -#include - -#include namespace PhysXDebug { diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp index 439f9a8383..d9ec1de757 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp @@ -10,11 +10,14 @@ #include "ScriptCanvasMemoryAsset.h" #include "ScriptCanvasUndoHelper.h" -#include +#include +#include +#include #include -#include -#include #include +#include +#include +#include namespace ScriptCanvasEditor { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index 49a35eac8a..95b4fbb843 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/Gems/ScriptEvents/Code/Source/ScriptEventsSystemComponent.h b/Gems/ScriptEvents/Code/Source/ScriptEventsSystemComponent.h index 64a0e49bca..922bfb1dbc 100644 --- a/Gems/ScriptEvents/Code/Source/ScriptEventsSystemComponent.h +++ b/Gems/ScriptEvents/Code/Source/ScriptEventsSystemComponent.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/Gems/WhiteBox/Code/Source/Viewport/WhiteBoxVertexTranslationModifier.h b/Gems/WhiteBox/Code/Source/Viewport/WhiteBoxVertexTranslationModifier.h index a9565aedbe..d9bae70a31 100644 --- a/Gems/WhiteBox/Code/Source/Viewport/WhiteBoxVertexTranslationModifier.h +++ b/Gems/WhiteBox/Code/Source/Viewport/WhiteBoxVertexTranslationModifier.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include From 3bca63bb7187d640928505d1662c395afb9c4894 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Sat, 11 Dec 2021 15:50:37 -0600 Subject: [PATCH 024/620] Temporary fix for material component losing image overrides with prefabs The bug reported that overridden texture properties would be lost whenever an entity was created, destroyed, or a prefab was created. Initially, it seemed like there was a problem with the custom JSON serializer for material properties. Debugging proved this to be incorrect because all of the data was converted to JSON values in the serializer on multiple passes. At some point during prefab patching, the data for the asset properties is lost while other values like colors and floats serialize correctly. Converting the asset data values into asset IDs resolves the immediate problem for the material component but the underlying issue is still under investigation by the prefab team. This change is being posted for review in case the underlying issue cannot be resolved in time for the next release. Signed-off-by: Guthrie Adams Fixing unittests and moving texture conversion into material component controller Signed-off-by: Guthrie Adams --- .../Material/MaterialAssignmentSerializer.cpp | 24 ++++++++++---- .../Material/MaterialAssignmentSerializer.h | 18 +++++++--- .../Code/Source/Util/MaterialPropertyUtil.cpp | 12 ++++--- .../Material/MaterialComponentController.cpp | 33 +++++++++++++++++++ .../Material/MaterialComponentController.h | 5 +++ 5 files changed, 76 insertions(+), 16 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.cpp b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.cpp index b757e4bd7e..85dc26089f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.cpp @@ -16,7 +16,9 @@ namespace AZ AZ_CLASS_ALLOCATOR_IMPL(JsonMaterialAssignmentSerializer, AZ::SystemAllocator, 0); JsonSerializationResult::Result JsonMaterialAssignmentSerializer::Load( - void* outputValue, [[maybe_unused]] const Uuid& outputValueTypeId, const rapidjson::Value& inputValue, + void* outputValue, + [[maybe_unused]] const Uuid& outputValueTypeId, + const rapidjson::Value& inputValue, JsonDeserializerContext& context) { namespace JSR = JsonSerializationResult; @@ -62,6 +64,7 @@ namespace AZ LoadAny(propertyValue, inputPropertyPair.value, context, result) || LoadAny(propertyValue, inputPropertyPair.value, context, result) || LoadAny(propertyValue, inputPropertyPair.value, context, result) || + LoadAny>(propertyValue, inputPropertyPair.value, context, result) || LoadAny>(propertyValue, inputPropertyPair.value, context, result) || LoadAny>(propertyValue, inputPropertyPair.value, context, result)) { @@ -78,7 +81,10 @@ namespace AZ } JsonSerializationResult::Result JsonMaterialAssignmentSerializer::Store( - rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, [[maybe_unused]] const Uuid& valueTypeId, + rapidjson::Value& outputValue, + const void* inputValue, + const void* defaultValue, + [[maybe_unused]] const Uuid& valueTypeId, JsonSerializerContext& context) { namespace JSR = AZ::JsonSerializationResult; @@ -138,9 +144,9 @@ namespace AZ StoreAny(propertyValue, outputPropertyValue, context, result) || StoreAny(propertyValue, outputPropertyValue, context, result) || StoreAny(propertyValue, outputPropertyValue, context, result) || + StoreAny>(propertyValue, outputPropertyValue, context, result) || StoreAny>(propertyValue, outputPropertyValue, context, result) || - StoreAny>( - propertyValue, outputPropertyValue, context, result)) + StoreAny>(propertyValue, outputPropertyValue, context, result)) { outputPropertyValueContainer.AddMember( rapidjson::Value::StringRefType(propertyName.GetCStr()), outputPropertyValue, @@ -164,7 +170,9 @@ namespace AZ template bool JsonMaterialAssignmentSerializer::LoadAny( - AZStd::any& propertyValue, const rapidjson::Value& inputPropertyValue, AZ::JsonDeserializerContext& context, + AZStd::any& propertyValue, + const rapidjson::Value& inputPropertyValue, + AZ::JsonDeserializerContext& context, AZ::JsonSerializationResult::ResultCode& result) { if (inputPropertyValue.IsObject() && inputPropertyValue.HasMember("Value") && inputPropertyValue.HasMember("$type")) @@ -187,7 +195,9 @@ namespace AZ template bool JsonMaterialAssignmentSerializer::StoreAny( - const AZStd::any& propertyValue, rapidjson::Value& outputPropertyValue, AZ::JsonSerializerContext& context, + const AZStd::any& propertyValue, + rapidjson::Value& outputPropertyValue, + AZ::JsonSerializerContext& context, AZ::JsonSerializationResult::ResultCode& result) { if (propertyValue.is()) @@ -199,7 +209,7 @@ namespace AZ result.Combine(StoreTypeId(typeValue, azrtti_typeid(), context)); outputPropertyValue.AddMember("$type", typeValue, context.GetJsonAllocator()); - T value = AZStd::any_cast(propertyValue); + const T& value = AZStd::any_cast(propertyValue); result.Combine( ContinueStoringToJsonObjectField(outputPropertyValue, "Value", &value, nullptr, azrtti_typeid(), context)); return true; diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.h b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.h index e92d756639..069b4d4cdb 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.h @@ -25,21 +25,31 @@ namespace AZ AZ_CLASS_ALLOCATOR_DECL; JsonSerializationResult::Result Load( - void* outputValue, const Uuid& outputValueTypeId, const rapidjson::Value& inputValue, + void* outputValue, + const Uuid& outputValueTypeId, + const rapidjson::Value& inputValue, JsonDeserializerContext& context) override; JsonSerializationResult::Result Store( - rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, const Uuid& valueTypeId, + rapidjson::Value& outputValue, + const void* inputValue, + const void* defaultValue, + const Uuid& valueTypeId, JsonSerializerContext& context) override; private: template bool LoadAny( - AZStd::any& propertyValue, const rapidjson::Value& inputPropertyValue, AZ::JsonDeserializerContext& context, + AZStd::any& propertyValue, + const rapidjson::Value& inputPropertyValue, + AZ::JsonDeserializerContext& context, AZ::JsonSerializationResult::ResultCode& result); + template bool StoreAny( - const AZStd::any& propertyValue, rapidjson::Value& outputPropertyValue, AZ::JsonSerializerContext& context, + const AZStd::any& propertyValue, + rapidjson::Value& outputPropertyValue, + AZ::JsonSerializerContext& context, AZ::JsonSerializationResult::ResultCode& result); }; } // namespace Render diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/MaterialPropertyUtil.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/MaterialPropertyUtil.cpp index 3ffd8efa6e..2ad4522094 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/MaterialPropertyUtil.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/MaterialPropertyUtil.cpp @@ -33,11 +33,13 @@ namespace AtomToolsFramework { if (value.Is>()) { - const AZ::Data::Asset& imageAsset = value.GetValue>(); - return AZStd::any(AZ::Data::Asset( - imageAsset.GetId(), - azrtti_typeid(), - imageAsset.GetHint())); + const auto& imageAsset = value.GetValue>(); + return AZStd::any(AZ::Data::Asset(imageAsset.GetId(), azrtti_typeid(), imageAsset.GetHint())); + } + else if (value.Is>()) + { + const auto& image = value.GetValue>(); + return AZStd::any(AZ::Data::Asset(image->GetAssetId(), azrtti_typeid())); } return AZ::RPI::MaterialPropertyValue::ToAny(value); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.cpp index 0ccdae28de..996a575c69 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.cpp @@ -104,6 +104,7 @@ namespace AZ MaterialComponentController::MaterialComponentController(const MaterialComponentConfig& config) : m_configuration(config) { + ConvertAssetsForSerialization(); } void MaterialComponentController::Activate(EntityId entityId) @@ -135,6 +136,7 @@ namespace AZ void MaterialComponentController::SetConfiguration(const MaterialComponentConfig& config) { m_configuration = config; + ConvertAssetsForSerialization(); } const MaterialComponentConfig& MaterialComponentController::GetConfiguration() const @@ -338,6 +340,7 @@ namespace AZ // before LoadMaterials() is called [LYN-2249] auto temp = m_configuration.m_materials; m_configuration.m_materials = materials; + ConvertAssetsForSerialization(); LoadMaterials(); } @@ -489,6 +492,7 @@ namespace AZ auto& materialAssignment = m_configuration.m_materials[materialAssignmentId]; const bool wasEmpty = materialAssignment.m_propertyOverrides.empty(); materialAssignment.m_propertyOverrides[AZ::Name(propertyName)] = value; + ConvertAssetsForSerialization(); if (materialAssignment.RequiresLoading()) { @@ -586,6 +590,7 @@ namespace AZ auto& materialAssignment = m_configuration.m_materials[materialAssignmentId]; const bool wasEmpty = materialAssignment.m_propertyOverrides.empty(); materialAssignment.m_propertyOverrides = propertyOverrides; + ConvertAssetsForSerialization(); if (materialAssignment.RequiresLoading()) { @@ -667,5 +672,33 @@ namespace AZ TickBus::Handler::BusConnect(); } } + + void MaterialComponentController::ConvertAssetsForSerialization() + { + for (auto& materialAssignmentPair : m_configuration.m_materials) + { + MaterialAssignment& materialAssignment = materialAssignmentPair.second; + for (auto& propertyPair : materialAssignment.m_propertyOverrides) + { + auto& value = propertyPair.second; + if (value.is>()) + { + value = AZStd::any_cast>(value).GetId(); + } + else if (value.is>()) + { + value = AZStd::any_cast>(value).GetId(); + } + else if (value.is>()) + { + value = AZStd::any_cast>(value).GetId(); + } + else if (value.is>()) + { + value = AZStd::any_cast>(value)->GetAssetId(); + } + } + } + } } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.h index 74b1cfda4d..d3eaa4433d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.h @@ -99,6 +99,11 @@ namespace AZ //! Queue material instance recreation notifiucations until tick void QueueMaterialUpdateNotification(); + //! Converts property overrides storing image asset references into asset IDs. This addresses a problem where image property + //! overrides are lost during prefab serialization and patching. This suboptimal function will be removed once the underlying + //! problem is resolved. + void ConvertAssetsForSerialization(); + EntityId m_entityId; MaterialComponentConfig m_configuration; AZStd::unordered_set m_materialsWithDirtyProperties; From 8511f61fd3d6fdea6b1bc5e587313d022eb48ee8 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Mon, 13 Dec 2021 12:08:00 -0800 Subject: [PATCH 025/620] duplicating standardPBR files for BasePBR Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Materials/Types/BasePBR.materialtype | 1202 +++++++++++++++++ .../Materials/Types/BasePBR_Common.azsli | 95 ++ .../Materials/Types/BasePBR_ForwardPass.azsl | 362 +++++ .../Types/BasePBR_ForwardPass.shader | 54 + .../BasePBR_ForwardPass.shadervariantlist | 29 + .../Types/BasePBR_LowEndForward.azsl | 13 + .../Types/BasePBR_LowEndForward.shader | 59 + .../Materials/Types/BasePBR_ShaderEnable.lua | 82 ++ .../atom_feature_common_asset_files.cmake | 10 + 9 files changed, 1906 insertions(+) create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype new file mode 100644 index 0000000000..f324394309 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype @@ -0,0 +1,1202 @@ +{ + "description": "Material Type with properties used to define Standard PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.", + "version": 4, + "versionUpdates": [ + { + "toVersion": 4, + "actions": [ + {"op": "rename", "from": "opacity.doubleSided", "to": "general.doubleSided"} + ] + } + ], + "propertyLayout": { + "groups": [ + { + "name": "baseColor", + "displayName": "Base Color", + "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals." + }, + { + "name": "metallic", + "displayName": "Metallic", + "description": "Properties for configuring whether the surface is metallic or not." + }, + { + "name": "roughness", + "displayName": "Roughness", + "description": "Properties for configuring how rough the surface appears." + }, + { + "name": "specularF0", + "displayName": "Specular Reflectance f0", + "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces." + }, + { + "name": "normal", + "displayName": "Normal", + "description": "Properties related to configuring surface normal." + }, + { + "name": "occlusion", + "displayName": "Occlusion", + "description": "Properties for baked textures that represent geometric occlusion of light." + }, + { + "name": "emissive", + "displayName": "Emissive", + "description": "Properties to add light emission, independent of other lights in the scene." + }, + { + "name": "clearCoat", + "displayName": "Clear Coat", + "description": "Properties for configuring gloss clear coat" + }, + { + "name": "parallax", + "displayName": "Displacement", + "description": "Properties for parallax effect produced by a height map." + }, + { + "name": "opacity", + "displayName": "Opacity", + "description": "Properties for configuring the materials transparency." + }, + { + "name": "uv", + "displayName": "UVs", + "description": "Properties for configuring UV transforms." + }, + { + // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the StandardPBR shader + "name": "irradiance", + "displayName": "Irradiance", + "description": "Properties for configuring the irradiance used in global illumination." + }, + { + "name": "general", + "displayName": "General Settings", + "description": "General settings." + } + ], + "properties": { + "general": [ + { + "name": "doubleSided", + "displayName": "Double-sided", + "description": "Whether to render back-faces or just front-faces.", + "type": "Bool" + }, + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + }, + { + "name": "forwardPassIBLSpecular", + "displayName": "Forward Pass IBL Specular", + "description": "Whether to apply IBL specular in the forward pass.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_materialUseForwardPassIBLSpecular" + } + } + ], + "baseColor": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_baseColorFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Base color texture map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Base color map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMapUvIndex" + } + }, + { + "name": "textureBlendMode", + "displayName": "Texture Blend Mode", + "description": "Selects the equation to use when combining Color, Factor, and Texture.", + "type": "Enum", + "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], + "defaultValue": "Multiply", + "connection": { + "type": "ShaderOption", + "name": "o_baseColorTextureBlendMode" + } + } + ], + "metallic": [ + { + "name": "factor", + "displayName": "Factor", + "description": "This value is linear, black is non-metal and white means raw metal.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_metallicFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Metallic map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMapUvIndex" + } + } + ], + "roughness": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface roughness.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMapUvIndex" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "lowerBound", + "displayName": "Lower Bound", + "description": "The roughness value that corresponds to black in the texture.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessLowerBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "upperBound", + "displayName": "Upper Bound", + "description": "The roughness value that corresponds to white in the texture.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessUpperBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessFactor" + } + } + ], + "specularF0": [ + { + "name": "factor", + "displayName": "Factor", + "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Factor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface reflectance.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Map" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Specular reflection map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0MapUvIndex" + } + }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR + { + "name": "enableMultiScatterCompensation", + "displayName": "Multiscattering Compensation", + "description": "Whether to enable multiple scattering compensation.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_specularF0_enableMultiScatterCompensation" + } + } + ], + "clearCoat": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable clear coat", + "type": "Bool", + "defaultValue": false + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the percentage of effect applied", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Strength factor texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Strength factor map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMapUvIndex" + } + }, + { + "name": "roughness", + "displayName": "Roughness", + "description": "Clear coat layer roughness", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughness" + } + }, + { + "name": "roughnessMap", + "displayName": " Roughness Map", + "description": "Texture for defining surface roughness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMap" + } + }, + { + "name": "useRoughnessMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the roughness value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "roughnessMapUv", + "displayName": " UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMapUvIndex" + } + }, + { + "name": "normalStrength", + "displayName": "Normal Strength", + "description": "Scales the impact of the clear coat normal map", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalStrength" + } + }, + { + "name": "normalMap", + "displayName": "Normal Map", + "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMap" + } + }, + { + "name": "useNormalMap", + "displayName": " Use Texture", + "description": "Whether to use the normal map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "normalMapUv", + "displayName": " UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMapUvIndex" + } + } + ], + "normal": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface normal direction.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_normalMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_normalMapUvIndex" + } + }, + { + "name": "flipX", + "displayName": "Flip X Channel", + "description": "Flip tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalX" + } + }, + { + "name": "flipY", + "displayName": "Flip Y Channel", + "description": "Flip bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalY" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_normalFactor" + } + } + ], + "opacity": [ + { + "name": "mode", + "displayName": "Opacity Mode", + "description": "Indicates the general approach how transparency is to be applied.", + "type": "Enum", + "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], + "defaultValue": "Opaque", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_mode" + } + }, + { + "name": "alphaSource", + "displayName": "Alpha Source", + "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", + "type": "Enum", + "enumValues": [ "Packed", "Split", "None" ], + "defaultValue": "Packed", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_source" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface opacity.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMap" + } + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Opacity map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMapUvIndex" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Factor for cutout threshold and blending", + "type": "Float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.5, + "connection": { + "type": "ShaderInput", + "name": "m_opacityFactor" + } + }, + { + "name": "alphaAffectsSpecular", + "displayName": "Alpha affects specular", + "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", + "type": "float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacityAffectsSpecularFactor" + } + } + ], + "uv": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in U.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ], + "occlusion": [ + { + "name": "diffuseTextureMap", + "displayName": "Diffuse AO", + "description": "Texture for defining occlusion area for diffuse ambient lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMap" + } + }, + { + "name": "diffuseUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Diffuse AO map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "diffuseTextureMapUv", + "displayName": " UV", + "description": "Diffuse AO map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMapUvIndex" + } + }, + { + "name": "diffuseFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Diffuse AO", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionFactor" + } + }, + { + "name": "specularTextureMap", + "displayName": "Specular Cavity", + "description": "Texture for defining occlusion area for specular lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMap" + } + }, + { + "name": "specularUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Specular Cavity map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "specularTextureMapUv", + "displayName": " UV", + "description": "Specular Cavity map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMapUvIndex" + } + }, + { + "name": "specularFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Specular Cavity", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionFactor" + } + } + ], + "emissive": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable the emissive group", + "type": "Bool", + "defaultValue": false + }, + { + "name": "unit", + "displayName": "Units", + "description": "The photometric units of the Intensity property.", + "type": "Enum", + "enumValues": ["Ev100"], + "defaultValue": "Ev100" + }, + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_emissiveColor" + } + }, + { + "name": "intensity", + "displayName": "Intensity", + "description": "The amount of energy emitted.", + "type": "Float", + "defaultValue": 4, + "min": -10, + "max": 20, + "softMin": -6, + "softMax": 16 + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining emissive area.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Emissive map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMapUvIndex" + } + } + ], + "parallax": [ + { + "name": "textureMap", + "displayName": "Height Map", + "description": "Displacement height map to create parallax effect.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_heightmap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the height map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Height map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_parallaxUvIndex" + } + }, + { + "name": "factor", + "displayName": "Height Map Scale", + "description": "The total height of the height map in local model units.", + "type": "Float", + "defaultValue": 0.05, + "min": 0.0, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapScale" + } + }, + { + "name": "offset", + "displayName": "Offset", + "description": "Adjusts the overall displacement amount in local model units.", + "type": "Float", + "defaultValue": 0.0, + "softMin": -0.1, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapOffset" + } + }, + { + "name": "algorithm", + "displayName": "Algorithm", + "description": "Select the algorithm to use for parallax mapping.", + "type": "Enum", + "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], + "defaultValue": "POM", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_algorithm" + } + }, + { + "name": "quality", + "displayName": "Quality", + "description": "Quality of parallax mapping.", + "type": "Enum", + "enumValues": [ "Low", "Medium", "High", "Ultra" ], + "defaultValue": "Low", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_quality" + } + }, + { + "name": "pdo", + "displayName": "Pixel Depth Offset", + "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_enablePixelDepthOffset" + } + }, + { + "name": "showClipping", + "displayName": "Show Clipping", + "description": "Highlight areas where the height map is clipped by the mesh surface.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_highlightClipping" + } + } + ], + "irradiance": [ + // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ] + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0 + } + ] + } + }, + "shaders": [ + { + "file": "./StandardPBR_ForwardPass.shader", + "tag": "ForwardPass" + }, + { + "file": "./StandardPBR_ForwardPass_EDS.shader", + "tag": "ForwardPass_EDS" + }, + { + "file": "./StandardPBR_LowEndForward.shader", + "tag": "LowEndForward" + }, + { + "file": "./StandardPBR_LowEndForward_EDS.shader", + "tag": "LowEndForward_EDS" + }, + { + "file": "Shaders/Shadow/Shadowmap.shader", + "tag": "Shadowmap" + }, + { + "file": "./StandardPBR_Shadowmap_WithPS.shader", + "tag": "Shadowmap_WithPS" + }, + { + "file": "Shaders/Depth/DepthPass.shader", + "tag": "DepthPass" + }, + { + "file": "./StandardPBR_DepthPass_WithPS.shader", + "tag": "DepthPass_WithPS" + }, + { + "file": "Shaders/MotionVector/MeshMotionVector.shader", + "tag": "MeshMotionVector" + }, + // Used by the light culling system to produce accurate depth bounds for this object when it uses blended transparency + { + "file": "Shaders/Depth/DepthPassTransparentMin.shader", + "tag": "DepthPassTransparentMin" + }, + { + "file": "Shaders/Depth/DepthPassTransparentMax.shader", + "tag": "DepthPassTransparentMax" + } + ], + "functors": [ + { + // Maps 2D scale, offset, and rotate properties into a float3x3 transform matrix. + "type": "Transform2D", + "args": { + "transformOrder": [ "Rotate", "Translate", "Scale" ], + "centerProperty": "uv.center", + "scaleProperty": "uv.scale", + "scaleXProperty": "uv.tileU", + "scaleYProperty": "uv.tileV", + "translateXProperty": "uv.offsetU", + "translateYProperty": "uv.offsetV", + "rotateDegreesProperty": "uv.rotateDegrees", + "float3x3ShaderInput": "m_uvMatrix", + "float3x3InverseShaderInput": "m_uvMatrixInverse" + } + }, + { + // Convert emissive unit. + "type": "ConvertEmissiveUnit", + "args": { + "intensityProperty": "emissive.intensity", + "lightUnitProperty": "emissive.unit", + "shaderInput": "m_emissiveIntensity", + "ev100Index": 0, + "nitIndex" : 1, + "ev100MinMax": [-10, 20], + "nitMinMax": [0.001, 100000.0] + } + }, + { + "type": "UseTexture", + "args": { + "textureProperty": "baseColor.textureMap", + "useTextureProperty": "baseColor.useTexture", + "dependentProperties": ["baseColor.textureMapUv", "baseColor.textureBlendMode"], + "shaderOption": "o_baseColor_useTexture" + } + }, + { + "type": "UseTexture", + "args": { + "textureProperty": "specularF0.textureMap", + "useTextureProperty": "specularF0.useTexture", + "dependentProperties": ["specularF0.textureMapUv"], + "shaderOption": "o_specularF0_useTexture" + } + }, + { + "type": "UseTexture", + "args": { + "textureProperty": "normal.textureMap", + "useTextureProperty": "normal.useTexture", + "dependentProperties": ["normal.textureMapUv", "normal.factor", "normal.flipX", "normal.flipY"], + "shaderOption": "o_normal_useTexture" + } + }, + { + "type": "UseTexture", + "args": { + "textureProperty": "occlusion.diffuseTextureMap", + "useTextureProperty": "occlusion.diffuseUseTexture", + "dependentProperties": ["occlusion.diffuseTextureMapUv", "occlusion.diffuseFactor"], + "shaderOption": "o_diffuseOcclusion_useTexture" + } + }, + { + "type": "UseTexture", + "args": { + "textureProperty": "occlusion.specularTextureMap", + "useTextureProperty": "occlusion.specularUseTexture", + "dependentProperties": ["occlusion.specularTextureMapUv", "occlusion.specularFactor"], + "shaderOption": "o_specularOcclusion_useTexture" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_ClearCoatState.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_ClearCoatEnableFeature.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_EmissiveState.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_ParallaxState.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_Roughness.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_Metallic.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_HandleOpacityDoubleSided.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_HandleOpacityMode.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_ShaderEnable.lua" + } + } + ], + "uvNameMap": { + "UV0": "Tiled", + "UV1": "Unwrapped" + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli new file mode 100644 index 0000000000..0aebc11f1d --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli @@ -0,0 +1,95 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include "MaterialInputs/BaseColorInput.azsli" +#include "MaterialInputs/RoughnessInput.azsli" +#include "MaterialInputs/MetallicInput.azsli" +#include "MaterialInputs/SpecularInput.azsli" +#include "MaterialInputs/NormalInput.azsli" +#include "MaterialInputs/ClearCoatInput.azsli" +#include "MaterialInputs/OcclusionInput.azsli" +#include "MaterialInputs/EmissiveInput.azsli" +#include "MaterialInputs/ParallaxInput.azsli" +#include "MaterialInputs/UvSetCount.azsli" + +ShaderResourceGroup MaterialSrg : SRG_PerMaterial +{ + // Auto-generate material SRG fields for common inputs + COMMON_SRG_INPUTS_BASE_COLOR() + COMMON_SRG_INPUTS_ROUGHNESS() + COMMON_SRG_INPUTS_METALLIC() + COMMON_SRG_INPUTS_SPECULAR_F0() + COMMON_SRG_INPUTS_NORMAL() + COMMON_SRG_INPUTS_CLEAR_COAT() + COMMON_SRG_INPUTS_OCCLUSION() + COMMON_SRG_INPUTS_EMISSIVE() + COMMON_SRG_INPUTS_PARALLAX() + + uint m_parallaxUvIndex; + + float3x3 m_uvMatrix; + float4 m_pad1; // [GFX TODO][ATOM-14595] This is a workaround for a data stomping bug. Remove once it's fixed. + float3x3 m_uvMatrixInverse; + float4 m_pad2; // [GFX TODO][ATOM-14595] This is a workaround for a data stomping bug. Remove once it's fixed. + + float m_opacityFactor; + float m_opacityAffectsSpecularFactor; + Texture2D m_opacityMap; + uint m_opacityMapUvIndex; + + Sampler m_sampler + { + AddressU = Wrap; + AddressV = Wrap; + MinFilter = Linear; + MagFilter = Linear; + MipFilter = Linear; + MaxAnisotropy = 16; + }; + + Texture2D m_brdfMap; + + Sampler m_samplerBrdf + { + AddressU = Clamp; + AddressV = Clamp; + MinFilter = Linear; + MagFilter = Linear; + MipFilter = Linear; + }; +} + +// Callback function for ParallaxMapping.azsli +DepthResult GetDepth(float2 uv, float2 uv_ddx, float2 uv_ddy) +{ + return SampleDepthFromHeightmap(MaterialSrg::m_heightmap, MaterialSrg::m_sampler, uv, uv_ddx, uv_ddy); +} + + +COMMON_OPTIONS_PARALLAX() + +bool ShouldHandleParallax() +{ + // Parallax mapping's non uniform uv transformations break screen space subsurface scattering, disable it when subsurface scattering is enabled. + return !o_enableSubsurfaceScattering && o_parallax_feature_enabled && o_useHeightmap; +} + +bool ShouldHandleParallaxInDepthShaders() +{ + // The depth pass shaders need to calculate parallax when the result could affect the depth buffer, or when + // parallax could affect texel clipping. + return ShouldHandleParallax() && (o_parallax_enablePixelDepthOffset || o_opacity_mode == OpacityMode::Cutout); +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl new file mode 100644 index 0000000000..1d5e4ad9e3 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl @@ -0,0 +1,362 @@ +/* + * 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 + * + */ + +#include "Atom/Features/ShaderQualityOptions.azsli" + +#include "StandardPBR_Common.azsli" + +// SRGs +#include +#include + +// Pass Output +#include + +// Utility +#include +#include + +// Custom Surface & Lighting +#include + +// Decals +#include + + +// ---------- Material Parameters ---------- + +COMMON_OPTIONS_BASE_COLOR() +COMMON_OPTIONS_ROUGHNESS() +COMMON_OPTIONS_METALLIC() +COMMON_OPTIONS_SPECULAR_F0() +COMMON_OPTIONS_NORMAL() +COMMON_OPTIONS_CLEAR_COAT() +COMMON_OPTIONS_OCCLUSION() +COMMON_OPTIONS_EMISSIVE() +// Note COMMON_OPTIONS_PARALLAX is in StandardPBR_Common.azsli because it's needed by all StandardPBR shaders. + +// Alpha +#include "MaterialInputs/AlphaInput.azsli" + +// ---------- Vertex Shader ---------- + +struct VSInput +{ + // Base fields (required by the template azsli file)... + float3 m_position : POSITION; + float3 m_normal : NORMAL; + float4 m_tangent : TANGENT; + float3 m_bitangent : BITANGENT; + + // Extended fields (only referenced in this azsl file)... + float2 m_uv0 : UV0; + float2 m_uv1 : UV1; +}; + +struct VSOutput +{ + // Base fields (required by the template azsli file)... + // "centroid" is needed for SV_Depth to compile + linear centroid float4 m_position : SV_Position; + float3 m_normal: NORMAL; + float3 m_tangent : TANGENT; + float3 m_bitangent : BITANGENT; + float3 m_worldPosition : UV0; + float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV3; + + // Extended fields (only referenced in this azsl file)... + float2 m_uv[UvSetCount] : UV1; +}; + +#include + +VSOutput StandardPbr_ForwardPassVS(VSInput IN) +{ + VSOutput OUT; + + float3 worldPosition = mul(ObjectSrg::GetWorldMatrix(), float4(IN.m_position, 1.0)).xyz; + + // By design, only UV0 is allowed to apply transforms. + OUT.m_uv[0] = mul(MaterialSrg::m_uvMatrix, float3(IN.m_uv0, 1.0)).xy; + OUT.m_uv[1] = IN.m_uv1; + + // Shadow coords will be calculated in the pixel shader in this case + bool skipShadowCoords = ShouldHandleParallax() && o_parallax_enablePixelDepthOffset; + + VertexHelper(IN, OUT, worldPosition, skipShadowCoords); + + return OUT; +} + + +// ---------- Pixel Shader ---------- + +PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float depthNDC) +{ + const float3 vertexNormal = normalize(IN.m_normal); + + // ------- Tangents & Bitangets ------- + float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; + float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; + + if (ShouldHandleParallax() || o_normal_useTexture || (o_clearCoat_enabled && o_clearCoat_normal_useTexture)) + { + PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); + } + + // ------- Depth & Parallax ------- + + depthNDC = IN.m_position.z; + + bool displacementIsClipped = false; + + if(ShouldHandleParallax()) + { + + float3x3 uvMatrix = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); + float3x3 uvMatrixInverse = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrixInverse : CreateIdentity3x3(); + GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_heightmapScale, MaterialSrg::m_heightmapOffset, + ObjectSrg::GetWorldMatrix(), uvMatrix, uvMatrixInverse, + IN.m_uv[MaterialSrg::m_parallaxUvIndex], IN.m_worldPosition, depthNDC, IN.m_position.w, displacementIsClipped); + + // Adjust directional light shadow coordinates for parallax correction + if(o_parallax_enablePixelDepthOffset) + { + const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; + if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) + { + DirectionalLightShadow::GetShadowCoords(shadowIndex, IN.m_worldPosition, vertexNormal, IN.m_shadowCoords); + } + } + } + + Surface surface; + surface.position = IN.m_worldPosition.xyz; + + // ------- Alpha & Clip ------- + + float2 baseColorUv = IN.m_uv[MaterialSrg::m_baseColorMapUvIndex]; + float2 opacityUv = IN.m_uv[MaterialSrg::m_opacityMapUvIndex]; + float alpha = GetAlphaInputAndClip(MaterialSrg::m_baseColorMap, MaterialSrg::m_opacityMap, baseColorUv, opacityUv, MaterialSrg::m_sampler, MaterialSrg::m_opacityFactor, o_opacity_source); + + // ------- Normal ------- + + float2 normalUv = IN.m_uv[MaterialSrg::m_normalMapUvIndex]; + float3x3 uvMatrix = MaterialSrg::m_normalMapUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); // By design, only UV0 is allowed to apply transforms. + surface.vertexNormal = vertexNormal; + surface.normal = GetNormalInputWS(MaterialSrg::m_normalMap, MaterialSrg::m_sampler, normalUv, MaterialSrg::m_flipNormalX, MaterialSrg::m_flipNormalY, isFrontFace, IN.m_normal, + tangents[MaterialSrg::m_normalMapUvIndex], bitangents[MaterialSrg::m_normalMapUvIndex], uvMatrix, o_normal_useTexture, MaterialSrg::m_normalFactor); + + // ------- Base Color ------- + + float3 sampledColor = GetBaseColorInput(MaterialSrg::m_baseColorMap, MaterialSrg::m_sampler, baseColorUv, MaterialSrg::m_baseColor.rgb, o_baseColor_useTexture); + float3 baseColor = BlendBaseColor(sampledColor, MaterialSrg::m_baseColor.rgb, MaterialSrg::m_baseColorFactor, o_baseColorTextureBlendMode, o_baseColor_useTexture); + + if(o_parallax_highlightClipping && displacementIsClipped) + { + ApplyParallaxClippingHighlight(baseColor); + } + + // ------- Metallic ------- + + float2 metallicUv = IN.m_uv[MaterialSrg::m_metallicMapUvIndex]; + float metallic = GetMetallicInput(MaterialSrg::m_metallicMap, MaterialSrg::m_sampler, metallicUv, MaterialSrg::m_metallicFactor, o_metallic_useTexture); + + // ------- Specular ------- + + float2 specularUv = IN.m_uv[MaterialSrg::m_specularF0MapUvIndex]; + float specularF0Factor = GetSpecularInput(MaterialSrg::m_specularF0Map, MaterialSrg::m_sampler, specularUv, MaterialSrg::m_specularF0Factor, o_specularF0_useTexture); + + surface.SetAlbedoAndSpecularF0(baseColor, specularF0Factor, metallic); + + // ------- Roughness ------- + + float2 roughnessUv = IN.m_uv[MaterialSrg::m_roughnessMapUvIndex]; + surface.roughnessLinear = GetRoughnessInput(MaterialSrg::m_roughnessMap, MaterialSrg::m_sampler, roughnessUv, MaterialSrg::m_roughnessFactor, + MaterialSrg::m_roughnessLowerBound, MaterialSrg::m_roughnessUpperBound, o_roughness_useTexture); + surface.CalculateRoughnessA(); + + // ------- Lighting Data ------- + + LightingData lightingData; + + // Light iterator + lightingData.tileIterator.Init(IN.m_position, PassSrg::m_lightListRemapped, PassSrg::m_tileLightData); + lightingData.Init(surface.position, surface.normal, surface.roughnessLinear); + + // Directional light shadow coordinates + lightingData.shadowCoords = IN.m_shadowCoords; + + // ------- Emissive ------- + + float2 emissiveUv = IN.m_uv[MaterialSrg::m_emissiveMapUvIndex]; + lightingData.emissiveLighting = GetEmissiveInput(MaterialSrg::m_emissiveMap, MaterialSrg::m_sampler, emissiveUv, MaterialSrg::m_emissiveIntensity, MaterialSrg::m_emissiveColor.rgb, o_emissiveEnabled, o_emissive_useTexture); + + // ------- Occlusion ------- + + lightingData.diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_diffuseOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_diffuseOcclusionMapUvIndex], MaterialSrg::m_diffuseOcclusionFactor, o_diffuseOcclusion_useTexture); + lightingData.specularOcclusion = GetOcclusionInput(MaterialSrg::m_specularOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_specularOcclusionMapUvIndex], MaterialSrg::m_specularOcclusionFactor, o_specularOcclusion_useTexture); + + // ------- Clearcoat ------- + + // [GFX TODO][ATOM-14603]: Clean up the double uses of these clear coat flags + if(o_clearCoat_feature_enabled) + { + if(o_clearCoat_enabled) + { + float3x3 uvMatrix = MaterialSrg::m_clearCoatNormalMapUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); + GetClearCoatInputs(MaterialSrg::m_clearCoatInfluenceMap, IN.m_uv[MaterialSrg::m_clearCoatInfluenceMapUvIndex], MaterialSrg::m_clearCoatFactor, o_clearCoat_factor_useTexture, + MaterialSrg::m_clearCoatRoughnessMap, IN.m_uv[MaterialSrg::m_clearCoatRoughnessMapUvIndex], MaterialSrg::m_clearCoatRoughness, o_clearCoat_roughness_useTexture, + MaterialSrg::m_clearCoatNormalMap, IN.m_uv[MaterialSrg::m_clearCoatNormalMapUvIndex], IN.m_normal, o_clearCoat_normal_useTexture, MaterialSrg::m_clearCoatNormalStrength, + uvMatrix, tangents[MaterialSrg::m_clearCoatNormalMapUvIndex], bitangents[MaterialSrg::m_clearCoatNormalMapUvIndex], + MaterialSrg::m_sampler, isFrontFace, + surface.clearCoat.factor, surface.clearCoat.roughness, surface.clearCoat.normal); + } + + // manipulate base layer f0 if clear coat is enabled + // modify base layer's normal incidence reflectance + // for the derivation of the following equation please refer to: + // https://google.github.io/filament/Filament.md.html#materialsystem/clearcoatmodel/baselayermodification + float3 f0 = (1.0 - 5.0 * sqrt(surface.specularF0)) / (5.0 - sqrt(surface.specularF0)); + surface.specularF0 = lerp(surface.specularF0, f0 * f0, surface.clearCoat.factor); + } + + // Diffuse and Specular response (used in IBL calculations) + lightingData.specularResponse = FresnelSchlickWithRoughness(lightingData.NdotV, surface.specularF0, surface.roughnessLinear); + lightingData.diffuseResponse = 1.0 - lightingData.specularResponse; + + if(o_clearCoat_feature_enabled) + { + // Clear coat layer has fixed IOR = 1.5 and transparent => F0 = (1.5 - 1)^2 / (1.5 + 1)^2 = 0.04 + lightingData.diffuseResponse *= 1.0 - (FresnelSchlickWithRoughness(lightingData.NdotV, float3(0.04, 0.04, 0.04), surface.clearCoat.roughness) * surface.clearCoat.factor); + } + + // ------- Multiscatter ------- + + lightingData.CalculateMultiscatterCompensation(surface.specularF0, o_specularF0_enableMultiScatterCompensation); + + // ------- Lighting Calculation ------- + + // Apply Decals + ApplyDecals(lightingData.tileIterator, surface); + + // Apply Direct Lighting + ApplyDirectLighting(surface, lightingData); + + // Apply Image Based Lighting (IBL) + ApplyIBL(surface, lightingData); + + // Finalize Lighting + lightingData.FinalizeLighting(); + + PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); + + // ------- Opacity ------- + + if (o_opacity_mode == OpacityMode::Blended || o_opacity_mode == OpacityMode::TintedTransparent) + { + // Increase opacity at grazing angles for surfaces with a low m_opacityAffectsSpecularFactor. + // For m_opacityAffectsSpecularFactor values close to 0, that indicates a transparent surface + // like glass, so it becomes less transparent at grazing angles. For m_opacityAffectsSpecularFactor + // values close to 1.0, that indicates the absence of a surface entirely, so this effect should + // not apply. + float fresnelAlpha = FresnelSchlickWithRoughness(lightingData.NdotV, alpha, surface.roughnessLinear).x; + alpha = lerp(fresnelAlpha, alpha, MaterialSrg::m_opacityAffectsSpecularFactor); + } + + if (o_opacity_mode == OpacityMode::Blended) + { + // [GFX_TODO ATOM-13187] PbrLighting shouldn't be writing directly to render targets. It's confusing when + // specular is being added to diffuse just because we're calling render target 0 "diffuse". + + // For blended mode, we do (dest * alpha) + (source * 1.0). This allows the specular + // to be added on top of the diffuse, but then the diffuse must be pre-multiplied. + // It's done this way because surface transparency doesn't really change specular response (eg, glass). + + lightingOutput.m_diffuseColor.rgb *= lightingOutput.m_diffuseColor.w; // pre-multiply diffuse + + // Add specular. m_opacityAffectsSpecularFactor controls how much the alpha masks out specular contribution. + float3 specular = lightingOutput.m_specularColor.rgb; + specular = lerp(specular, specular * lightingOutput.m_diffuseColor.w, MaterialSrg::m_opacityAffectsSpecularFactor); + lightingOutput.m_diffuseColor.rgb += specular; + + lightingOutput.m_diffuseColor.w = alpha; + } + else if (o_opacity_mode == OpacityMode::TintedTransparent) + { + // See OpacityMode::Blended above for the basic method. TintedTransparent adds onto the above concept by supporting + // colored alpha. This is currently a very basic calculation that uses the baseColor as a multiplier with strength + // determined by the alpha. We'll modify this later to be more physically accurate and allow surface depth, + // absorption, and interior color to be specified. + // + // The technique uses dual source blending to allow two separate sources to be part of the blending equation + // even though ultimately only a single render target is being written to. m_diffuseColor is render target 0 and + // m_specularColor render target 1, and the blend mode is (dest * source1color) + (source * 1.0). + // + // This means that m_specularColor.rgb (source 1) is multiplied against the destination, then + // m_diffuseColor.rgb (source) is added to that, and the final result is stored in render target 0. + + lightingOutput.m_diffuseColor.rgb *= lightingOutput.m_diffuseColor.w; // pre-multiply diffuse + + // Add specular. m_opacityAffectsSpecularFactor controls how much the alpha masks out specular contribution. + float3 specular = lightingOutput.m_specularColor.rgb; + specular = lerp(specular, specular * lightingOutput.m_diffuseColor.w, MaterialSrg::m_opacityAffectsSpecularFactor); + lightingOutput.m_diffuseColor.rgb += specular; + + lightingOutput.m_specularColor.rgb = baseColor * (1.0 - alpha); + } + else + { + lightingOutput.m_diffuseColor.w = -1; // Disable subsurface scattering + } + + return lightingOutput; +} + +ForwardPassOutputWithDepth StandardPbr_ForwardPassPS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) +{ + ForwardPassOutputWithDepth OUT; + float depth; + + PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace, depth); + +#ifdef UNIFIED_FORWARD_OUTPUT + OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb; + OUT.m_color.a = lightingOutput.m_diffuseColor.a; + OUT.m_depth = depth; +#else + OUT.m_diffuseColor = lightingOutput.m_diffuseColor; + OUT.m_specularColor = lightingOutput.m_specularColor; + OUT.m_specularF0 = lightingOutput.m_specularF0; + OUT.m_albedo = lightingOutput.m_albedo; + OUT.m_normal = lightingOutput.m_normal; + OUT.m_depth = depth; +#endif + return OUT; +} + +[earlydepthstencil] +ForwardPassOutput StandardPbr_ForwardPassPS_EDS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) +{ + ForwardPassOutput OUT; + float depth; + + PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace, depth); + +#ifdef UNIFIED_FORWARD_OUTPUT + OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb; + OUT.m_color.a = lightingOutput.m_diffuseColor.a; +#else + OUT.m_diffuseColor = lightingOutput.m_diffuseColor; + OUT.m_specularColor = lightingOutput.m_specularColor; + OUT.m_specularF0 = lightingOutput.m_specularF0; + OUT.m_albedo = lightingOutput.m_albedo; + OUT.m_normal = lightingOutput.m_normal; +#endif + return OUT; +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader new file mode 100644 index 0000000000..d8df49f4b0 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader @@ -0,0 +1,54 @@ +{ + "Source" : "./StandardPBR_ForwardPass.azsl", + + "DepthStencilState" : + { + "Depth" : + { + "Enable" : true, + "CompareFunc" : "GreaterEqual" + }, + "Stencil" : + { + "Enable" : true, + "ReadMask" : "0x00", + "WriteMask" : "0xFF", + "FrontFace" : + { + "Func" : "Always", + "DepthFailOp" : "Keep", + "FailOp" : "Keep", + "PassOp" : "Replace" + }, + "BackFace" : + { + "Func" : "Always", + "DepthFailOp" : "Keep", + "FailOp" : "Keep", + "PassOp" : "Replace" + } + } + }, + + + "CompilerHints" : { + "DisableOptimizations" : false + }, + + "ProgramSettings": + { + "EntryPoints": + [ + { + "name": "StandardPbr_ForwardPassVS", + "type": "Vertex" + }, + { + "name": "StandardPbr_ForwardPassPS", + "type": "Fragment" + } + ] + }, + + "DrawList" : "forward" +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist new file mode 100644 index 0000000000..39f101aca9 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist @@ -0,0 +1,29 @@ +{ + "Shader" : "StandardPBR_ForwardPass.shader", + "Variants": [ + { + "StableId": 1, + "Options": { + "o_directional_shadow_filtering_method": "ShadowFilterMethod::None" + } + }, + { + "StableId": 2, + "Options": { + "o_directional_shadow_filtering_method": "ShadowFilterMethod::Pcf" + } + }, + { + "StableId": 3, + "Options": { + "o_directional_shadow_filtering_method": "ShadowFilterMethod::Esm" + } + }, + { + "StableId": 4, + "Options": { + "o_directional_shadow_filtering_method": "ShadowFilterMethod::EsmPcf" + } + } + ] +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl new file mode 100644 index 0000000000..02e9e93ba2 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl @@ -0,0 +1,13 @@ +/* + * 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 + * + */ + +// NOTE: This file is a temporary workaround until .shader files can #define macros for their .azsl files + +#define QUALITY_LOW_END 1 + +#include "StandardPBR_ForwardPass.azsl" diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader new file mode 100644 index 0000000000..44139608ca --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader @@ -0,0 +1,59 @@ +{ + // Note: "LowEnd" shaders are for supporting the low end pipeline + // These shaders can be safely added to materials without incurring additional runtime draw + // items as draw items for shaders are only created if the scene has a pass with a matching + // DrawListTag. If your pipeline doesn't have a "lowEndForward" DrawListTag, no draw items + // for this shader will be created. + + "Source" : "./StandardPBR_LowEndForward.azsl", + + "DepthStencilState" : + { + "Depth" : + { + "Enable" : true, + "CompareFunc" : "GreaterEqual" + }, + "Stencil" : + { + "Enable" : true, + "ReadMask" : "0x00", + "WriteMask" : "0xFF", + "FrontFace" : + { + "Func" : "Always", + "DepthFailOp" : "Keep", + "FailOp" : "Keep", + "PassOp" : "Replace" + }, + "BackFace" : + { + "Func" : "Always", + "DepthFailOp" : "Keep", + "FailOp" : "Keep", + "PassOp" : "Replace" + } + } + }, + + "CompilerHints" : { + "DisableOptimizations" : false + }, + + "ProgramSettings": + { + "EntryPoints": + [ + { + "name": "StandardPbr_ForwardPassVS", + "type": "Vertex" + }, + { + "name": "StandardPbr_ForwardPassPS", + "type": "Fragment" + } + ] + }, + + "DrawList" : "lowEndForward" +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua new file mode 100644 index 0000000000..7e19641c6b --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua @@ -0,0 +1,82 @@ +-------------------------------------------------------------------------------------- +-- +-- 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 +-- +-- +-- +---------------------------------------------------------------------------------------------------- + +function GetMaterialPropertyDependencies() + return {"opacity.mode", "parallax.textureMap", "parallax.useTexture", "parallax.pdo"} +end + +OpacityMode_Opaque = 0 +OpacityMode_Cutout = 1 +OpacityMode_Blended = 2 +OpacityMode_TintedTransparent = 3 + +function TryGetShaderByTag(context, shaderTag) + if context:HasShaderWithTag(shaderTag) then + return context:GetShaderByTag(shaderTag) + else + return nil + end +end + +function TrySetShaderEnabled(shader, enabled) + if shader then + shader:SetEnabled(enabled) + end +end + +function Process(context) + local opacityMode = context:GetMaterialPropertyValue_enum("opacity.mode") + local displacementMap = context:GetMaterialPropertyValue_Image("parallax.textureMap") + local useDisplacementMap = context:GetMaterialPropertyValue_bool("parallax.useTexture") + local parallaxEnabled = displacementMap ~= nil and useDisplacementMap + local parallaxPdoEnabled = context:GetMaterialPropertyValue_bool("parallax.pdo") + + local depthPass = context:GetShaderByTag("DepthPass") + local shadowMap = context:GetShaderByTag("Shadowmap") + local forwardPassEDS = context:GetShaderByTag("ForwardPass_EDS") + + local depthPassWithPS = context:GetShaderByTag("DepthPass_WithPS") + local shadowMapWithPS = context:GetShaderByTag("Shadowmap_WithPS") + local forwardPass = context:GetShaderByTag("ForwardPass") + + -- Use TryGetShaderByTag because these shaders only exist in StandardPBR but this script is also used for EnhancedPBR + local lowEndForwardEDS = TryGetShaderByTag(context, "LowEndForward_EDS") + local lowEndForward = TryGetShaderByTag(context, "LowEndForward") + + if parallaxEnabled and parallaxPdoEnabled then + depthPass:SetEnabled(false) + shadowMap:SetEnabled(false) + forwardPassEDS:SetEnabled(false) + + depthPassWithPS:SetEnabled(true) + shadowMapWithPS:SetEnabled(true) + forwardPass:SetEnabled(true) + + TrySetShaderEnabled(lowEndForwardEDS, false) + TrySetShaderEnabled(lowEndForward, true) + else + depthPass:SetEnabled(opacityMode == OpacityMode_Opaque) + shadowMap:SetEnabled(opacityMode == OpacityMode_Opaque) + forwardPassEDS:SetEnabled((opacityMode == OpacityMode_Opaque) or (opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) + + depthPassWithPS:SetEnabled(opacityMode == OpacityMode_Cutout) + shadowMapWithPS:SetEnabled(opacityMode == OpacityMode_Cutout) + forwardPass:SetEnabled(opacityMode == OpacityMode_Cutout) + + -- Only enable lowEndForwardEDS in Opaque mode, Transparent mode will be handled by forwardPassEDS. The transparent pass uses the "transparent" draw tag + -- for both standard and low end pipelines, so this keeps both shaders from rendering to the transparent draw list. + TrySetShaderEnabled(lowEndForwardEDS, opacityMode == OpacityMode_Opaque) + TrySetShaderEnabled(lowEndForward, opacityMode == OpacityMode_Cutout) + end + + context:GetShaderByTag("DepthPassTransparentMin"):SetEnabled((opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) + context:GetShaderByTag("DepthPassTransparentMax"):SetEnabled((opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) +end diff --git a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake index c4d198fef9..f595202218 100644 --- a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake +++ b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake @@ -10,6 +10,13 @@ set(FILES Materials/Special/ShadowCatcher.azsl Materials/Special/ShadowCatcher.materialtype Materials/Special/ShadowCatcher.shader + Materials/Types/BasePBR.materialtype + Materials/Types/BasePBR_Common.azsli + Materials/Types/BasePBR_ForwardPass.azsl + Materials/Types/BasePBR_ForwardPass.shader + Materials/Types/BasePBR_LowEndForward.azsl + Materials/Types/BasePBR_LowEndForward.shader + Materials/Types/BasePBR_ShaderEnable.lua Materials/Types/EnhancedPBR.materialtype Materials/Types/EnhancedPBR_Common.azsli Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl @@ -53,6 +60,7 @@ set(FILES Materials/Types/StandardPBR_LowEndForward.azsl Materials/Types/StandardPBR_LowEndForward.shader Materials/Types/StandardPBR_LowEndForward_EDS.shader + Materials/Types/StandardPBR_Metallic.lua Materials/Types/StandardPBR_ParallaxState.lua Materials/Types/StandardPBR_Roughness.lua Materials/Types/StandardPBR_ShaderEnable.lua @@ -129,6 +137,7 @@ set(FILES Passes/DownsampleMipChain.pass Passes/EnvironmentCubeMapDepthMSAA.pass Passes/EnvironmentCubeMapForwardMSAA.pass + Passes/EnvironmentCubeMapForwardSubsurfaceMSAA.pass Passes/EnvironmentCubeMapPipeline.pass Passes/EnvironmentCubeMapSkyBox.pass Passes/EsmShadowmaps.pass @@ -303,6 +312,7 @@ set(FILES ShaderLib/Atom/Features/ScreenSpace/ScreenSpaceUtil.azsli ShaderLib/Atom/Features/Shadow/BicubicPcfFilters.azsli ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli + ShaderLib/Atom/Features/Shadow/ESM.azsli ShaderLib/Atom/Features/Shadow/NormalOffsetShadows.azsli ShaderLib/Atom/Features/Shadow/ProjectedShadow.azsli ShaderLib/Atom/Features/Shadow/ReceiverPlaneDepthBias.azsli From 8fa99c47dbd573cd192065bd7682b92ebf90daa4 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Mon, 13 Dec 2021 12:51:34 -0800 Subject: [PATCH 026/620] Work in progress, current shader compilation error Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Materials/Presets/PBR/metal_gold.material | 2 +- .../Presets/PBR/metal_gold_matte.material | 2 +- .../Presets/PBR/metal_gold_polished.material | 2 +- .../Materials/Types/BasePBR.materialtype | 593 +----------------- .../Materials/Types/BasePBR_Common.azsli | 36 -- .../Materials/Types/BasePBR_ForwardPass.azsl | 192 +----- .../Types/BasePBR_ForwardPass.shader | 7 +- .../BasePBR_ForwardPass.shadervariantlist | 2 +- .../Types/BasePBR_LowEndForward.azsl | 2 +- .../Types/BasePBR_LowEndForward.shader | 6 +- .../Materials/Types/BasePBR_ShaderEnable.lua | 52 +- .../Atom/Features/LightCulling/NVLC.azsli | 4 +- 12 files changed, 40 insertions(+), 860 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material index 2638e76a74..f0fd265726 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material @@ -1,6 +1,6 @@ { "description": "", - "materialType": "Materials\\Types\\StandardPBR.materialtype", + "materialType": "Materials\\Types\\Temp\\BasePBR.materialtype", "parentMaterial": "", "propertyLayoutVersion": 3, "properties": { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material index fd21141048..53ba190084 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material @@ -1,6 +1,6 @@ { "description": "", - "materialType": "Materials\\Types\\StandardPBR.materialtype", + "materialType": "Materials\\Types\\Temp\\BasePBR.materialtype", "parentMaterial": "", "propertyLayoutVersion": 3, "properties": { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material index 5861c7b533..d200bddbc5 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material @@ -1,6 +1,6 @@ { "description": "", - "materialType": "Materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/Temp/BasePBR.materialtype", "parentMaterial": "", "propertyLayoutVersion": 3, "properties": { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype index f324394309..d4c79a05ef 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype @@ -1,14 +1,6 @@ { - "description": "Material Type with properties used to define Standard PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.", - "version": 4, - "versionUpdates": [ - { - "toVersion": 4, - "actions": [ - {"op": "rename", "from": "opacity.doubleSided", "to": "general.doubleSided"} - ] - } - ], + "description": "Material Type with properties used to define Base PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.", + "version": 0, "propertyLayout": { "groups": [ { @@ -36,38 +28,13 @@ "displayName": "Normal", "description": "Properties related to configuring surface normal." }, - { - "name": "occlusion", - "displayName": "Occlusion", - "description": "Properties for baked textures that represent geometric occlusion of light." - }, - { - "name": "emissive", - "displayName": "Emissive", - "description": "Properties to add light emission, independent of other lights in the scene." - }, - { - "name": "clearCoat", - "displayName": "Clear Coat", - "description": "Properties for configuring gloss clear coat" - }, - { - "name": "parallax", - "displayName": "Displacement", - "description": "Properties for parallax effect produced by a height map." - }, - { - "name": "opacity", - "displayName": "Opacity", - "description": "Properties for configuring the materials transparency." - }, { "name": "uv", "displayName": "UVs", "description": "Properties for configuring UV transforms." }, { - // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the StandardPBR shader + // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the BasePBR shader "name": "irradiance", "displayName": "Irradiance", "description": "Properties for configuring the irradiance used in global illumination." @@ -403,141 +370,6 @@ } } ], - "clearCoat": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable clear coat", - "type": "Bool", - "defaultValue": false - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the percentage of effect applied", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Strength factor texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Strength factor map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMapUvIndex" - } - }, - { - "name": "roughness", - "displayName": "Roughness", - "description": "Clear coat layer roughness", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughness" - } - }, - { - "name": "roughnessMap", - "displayName": " Roughness Map", - "description": "Texture for defining surface roughness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMap" - } - }, - { - "name": "useRoughnessMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the roughness value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "roughnessMapUv", - "displayName": " UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMapUvIndex" - } - }, - { - "name": "normalStrength", - "displayName": "Normal Strength", - "description": "Scales the impact of the clear coat normal map", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalStrength" - } - }, - { - "name": "normalMap", - "displayName": "Normal Map", - "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMap" - } - }, - { - "name": "useNormalMap", - "displayName": " Use Texture", - "description": "Whether to use the normal map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "normalMapUv", - "displayName": " UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMapUvIndex" - } - } - ], "normal": [ { "name": "textureMap", @@ -604,80 +436,6 @@ } } ], - "opacity": [ - { - "name": "mode", - "displayName": "Opacity Mode", - "description": "Indicates the general approach how transparency is to be applied.", - "type": "Enum", - "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], - "defaultValue": "Opaque", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_mode" - } - }, - { - "name": "alphaSource", - "displayName": "Alpha Source", - "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", - "type": "Enum", - "enumValues": [ "Packed", "Split", "None" ], - "defaultValue": "Packed", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_source" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface opacity.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMap" - } - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Opacity map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMapUvIndex" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Factor for cutout threshold and blending", - "type": "Float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.5, - "connection": { - "type": "ShaderInput", - "name": "m_opacityFactor" - } - }, - { - "name": "alphaAffectsSpecular", - "displayName": "Alpha affects specular", - "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", - "type": "float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacityAffectsSpecularFactor" - } - } - ], "uv": [ { "name": "center", @@ -740,263 +498,6 @@ "step": 0.1 } ], - "occlusion": [ - { - "name": "diffuseTextureMap", - "displayName": "Diffuse AO", - "description": "Texture for defining occlusion area for diffuse ambient lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMap" - } - }, - { - "name": "diffuseUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Diffuse AO map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "diffuseTextureMapUv", - "displayName": " UV", - "description": "Diffuse AO map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMapUvIndex" - } - }, - { - "name": "diffuseFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Diffuse AO", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionFactor" - } - }, - { - "name": "specularTextureMap", - "displayName": "Specular Cavity", - "description": "Texture for defining occlusion area for specular lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMap" - } - }, - { - "name": "specularUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Specular Cavity map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "specularTextureMapUv", - "displayName": " UV", - "description": "Specular Cavity map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMapUvIndex" - } - }, - { - "name": "specularFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Specular Cavity", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionFactor" - } - } - ], - "emissive": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable the emissive group", - "type": "Bool", - "defaultValue": false - }, - { - "name": "unit", - "displayName": "Units", - "description": "The photometric units of the Intensity property.", - "type": "Enum", - "enumValues": ["Ev100"], - "defaultValue": "Ev100" - }, - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_emissiveColor" - } - }, - { - "name": "intensity", - "displayName": "Intensity", - "description": "The amount of energy emitted.", - "type": "Float", - "defaultValue": 4, - "min": -10, - "max": 20, - "softMin": -6, - "softMax": 16 - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining emissive area.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Emissive map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMapUvIndex" - } - } - ], - "parallax": [ - { - "name": "textureMap", - "displayName": "Height Map", - "description": "Displacement height map to create parallax effect.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_heightmap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the height map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Height map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_parallaxUvIndex" - } - }, - { - "name": "factor", - "displayName": "Height Map Scale", - "description": "The total height of the height map in local model units.", - "type": "Float", - "defaultValue": 0.05, - "min": 0.0, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapScale" - } - }, - { - "name": "offset", - "displayName": "Offset", - "description": "Adjusts the overall displacement amount in local model units.", - "type": "Float", - "defaultValue": 0.0, - "softMin": -0.1, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapOffset" - } - }, - { - "name": "algorithm", - "displayName": "Algorithm", - "description": "Select the algorithm to use for parallax mapping.", - "type": "Enum", - "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], - "defaultValue": "POM", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_algorithm" - } - }, - { - "name": "quality", - "displayName": "Quality", - "description": "Quality of parallax mapping.", - "type": "Enum", - "enumValues": [ "Low", "Medium", "High", "Ultra" ], - "defaultValue": "Low", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_quality" - } - }, - { - "name": "pdo", - "displayName": "Pixel Depth Offset", - "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_enablePixelDepthOffset" - } - }, - { - "name": "showClipping", - "displayName": "Show Clipping", - "description": "Highlight areas where the height map is clipped by the mesh surface.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_highlightClipping" - } - } - ], "irradiance": [ // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader { @@ -1020,50 +521,25 @@ }, "shaders": [ { - "file": "./StandardPBR_ForwardPass.shader", - "tag": "ForwardPass" - }, - { - "file": "./StandardPBR_ForwardPass_EDS.shader", + "file": "./BasePBR_ForwardPass.shader", "tag": "ForwardPass_EDS" }, { - "file": "./StandardPBR_LowEndForward.shader", - "tag": "LowEndForward" - }, - { - "file": "./StandardPBR_LowEndForward_EDS.shader", + "file": "./BasePBR_LowEndForward.shader", "tag": "LowEndForward_EDS" }, { "file": "Shaders/Shadow/Shadowmap.shader", "tag": "Shadowmap" }, - { - "file": "./StandardPBR_Shadowmap_WithPS.shader", - "tag": "Shadowmap_WithPS" - }, { "file": "Shaders/Depth/DepthPass.shader", "tag": "DepthPass" }, - { - "file": "./StandardPBR_DepthPass_WithPS.shader", - "tag": "DepthPass_WithPS" - }, { "file": "Shaders/MotionVector/MeshMotionVector.shader", "tag": "MeshMotionVector" - }, - // Used by the light culling system to produce accurate depth bounds for this object when it uses blended transparency - { - "file": "Shaders/Depth/DepthPassTransparentMin.shader", - "tag": "DepthPassTransparentMin" - }, - { - "file": "Shaders/Depth/DepthPassTransparentMax.shader", - "tag": "DepthPassTransparentMax" - } + } ], "functors": [ { @@ -1082,19 +558,6 @@ "float3x3InverseShaderInput": "m_uvMatrixInverse" } }, - { - // Convert emissive unit. - "type": "ConvertEmissiveUnit", - "args": { - "intensityProperty": "emissive.intensity", - "lightUnitProperty": "emissive.unit", - "shaderInput": "m_emissiveIntensity", - "ev100Index": 0, - "nitIndex" : 1, - "ev100MinMax": [-10, 20], - "nitMinMax": [0.001, 100000.0] - } - }, { "type": "UseTexture", "args": { @@ -1122,48 +585,6 @@ "shaderOption": "o_normal_useTexture" } }, - { - "type": "UseTexture", - "args": { - "textureProperty": "occlusion.diffuseTextureMap", - "useTextureProperty": "occlusion.diffuseUseTexture", - "dependentProperties": ["occlusion.diffuseTextureMapUv", "occlusion.diffuseFactor"], - "shaderOption": "o_diffuseOcclusion_useTexture" - } - }, - { - "type": "UseTexture", - "args": { - "textureProperty": "occlusion.specularTextureMap", - "useTextureProperty": "occlusion.specularUseTexture", - "dependentProperties": ["occlusion.specularTextureMapUv", "occlusion.specularFactor"], - "shaderOption": "o_specularOcclusion_useTexture" - } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_ClearCoatState.lua" - } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_ClearCoatEnableFeature.lua" - } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_EmissiveState.lua" - } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_ParallaxState.lua" - } - }, { "type": "Lua", "args": { @@ -1191,7 +612,7 @@ { "type": "Lua", "args": { - "file": "StandardPBR_ShaderEnable.lua" + "file": "BasePBR_ShaderEnable.lua" } } ], diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli index 0aebc11f1d..dbec7458fc 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli @@ -19,10 +19,6 @@ #include "MaterialInputs/MetallicInput.azsli" #include "MaterialInputs/SpecularInput.azsli" #include "MaterialInputs/NormalInput.azsli" -#include "MaterialInputs/ClearCoatInput.azsli" -#include "MaterialInputs/OcclusionInput.azsli" -#include "MaterialInputs/EmissiveInput.azsli" -#include "MaterialInputs/ParallaxInput.azsli" #include "MaterialInputs/UvSetCount.azsli" ShaderResourceGroup MaterialSrg : SRG_PerMaterial @@ -33,23 +29,13 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial COMMON_SRG_INPUTS_METALLIC() COMMON_SRG_INPUTS_SPECULAR_F0() COMMON_SRG_INPUTS_NORMAL() - COMMON_SRG_INPUTS_CLEAR_COAT() - COMMON_SRG_INPUTS_OCCLUSION() - COMMON_SRG_INPUTS_EMISSIVE() - COMMON_SRG_INPUTS_PARALLAX() - uint m_parallaxUvIndex; float3x3 m_uvMatrix; float4 m_pad1; // [GFX TODO][ATOM-14595] This is a workaround for a data stomping bug. Remove once it's fixed. float3x3 m_uvMatrixInverse; float4 m_pad2; // [GFX TODO][ATOM-14595] This is a workaround for a data stomping bug. Remove once it's fixed. - float m_opacityFactor; - float m_opacityAffectsSpecularFactor; - Texture2D m_opacityMap; - uint m_opacityMapUvIndex; - Sampler m_sampler { AddressU = Wrap; @@ -71,25 +57,3 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial MipFilter = Linear; }; } - -// Callback function for ParallaxMapping.azsli -DepthResult GetDepth(float2 uv, float2 uv_ddx, float2 uv_ddy) -{ - return SampleDepthFromHeightmap(MaterialSrg::m_heightmap, MaterialSrg::m_sampler, uv, uv_ddx, uv_ddy); -} - - -COMMON_OPTIONS_PARALLAX() - -bool ShouldHandleParallax() -{ - // Parallax mapping's non uniform uv transformations break screen space subsurface scattering, disable it when subsurface scattering is enabled. - return !o_enableSubsurfaceScattering && o_parallax_feature_enabled && o_useHeightmap; -} - -bool ShouldHandleParallaxInDepthShaders() -{ - // The depth pass shaders need to calculate parallax when the result could affect the depth buffer, or when - // parallax could affect texel clipping. - return ShouldHandleParallax() && (o_parallax_enablePixelDepthOffset || o_opacity_mode == OpacityMode::Cutout); -} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl index 1d5e4ad9e3..1a4b386ef1 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl @@ -8,7 +8,7 @@ #include "Atom/Features/ShaderQualityOptions.azsli" -#include "StandardPBR_Common.azsli" +#include "BasePBR_Common.azsli" // SRGs #include @@ -19,7 +19,6 @@ // Utility #include -#include // Custom Surface & Lighting #include @@ -35,13 +34,6 @@ COMMON_OPTIONS_ROUGHNESS() COMMON_OPTIONS_METALLIC() COMMON_OPTIONS_SPECULAR_F0() COMMON_OPTIONS_NORMAL() -COMMON_OPTIONS_CLEAR_COAT() -COMMON_OPTIONS_OCCLUSION() -COMMON_OPTIONS_EMISSIVE() -// Note COMMON_OPTIONS_PARALLAX is in StandardPBR_Common.azsli because it's needed by all StandardPBR shaders. - -// Alpha -#include "MaterialInputs/AlphaInput.azsli" // ---------- Vertex Shader ---------- @@ -75,9 +67,9 @@ struct VSOutput #include -VSOutput StandardPbr_ForwardPassVS(VSInput IN) +VSOutput BasePbr_ForwardPassVS(VSInput IN) { - VSOutput OUT; + VSOutput OUT = (VSOutput)0; float3 worldPosition = mul(ObjectSrg::GetWorldMatrix(), float4(IN.m_position, 1.0)).xyz; @@ -85,8 +77,8 @@ VSOutput StandardPbr_ForwardPassVS(VSInput IN) OUT.m_uv[0] = mul(MaterialSrg::m_uvMatrix, float3(IN.m_uv0, 1.0)).xy; OUT.m_uv[1] = IN.m_uv1; - // Shadow coords will be calculated in the pixel shader in this case - bool skipShadowCoords = ShouldHandleParallax() && o_parallax_enablePixelDepthOffset; + // No parallax in BaseBPR, so do shadow coordinate calculations in vertex shader + bool skipShadowCoords = false; VertexHelper(IN, OUT, worldPosition, skipShadowCoords); @@ -96,7 +88,7 @@ VSOutput StandardPbr_ForwardPassVS(VSInput IN) // ---------- Pixel Shader ---------- -PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float depthNDC) +PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) { const float3 vertexNormal = normalize(IN.m_normal); @@ -104,46 +96,14 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; - if (ShouldHandleParallax() || o_normal_useTexture || (o_clearCoat_enabled && o_clearCoat_normal_useTexture)) + if (o_normal_useTexture) { PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); } - - // ------- Depth & Parallax ------- - - depthNDC = IN.m_position.z; - bool displacementIsClipped = false; - - if(ShouldHandleParallax()) - { - - float3x3 uvMatrix = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); - float3x3 uvMatrixInverse = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrixInverse : CreateIdentity3x3(); - GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_heightmapScale, MaterialSrg::m_heightmapOffset, - ObjectSrg::GetWorldMatrix(), uvMatrix, uvMatrixInverse, - IN.m_uv[MaterialSrg::m_parallaxUvIndex], IN.m_worldPosition, depthNDC, IN.m_position.w, displacementIsClipped); - - // Adjust directional light shadow coordinates for parallax correction - if(o_parallax_enablePixelDepthOffset) - { - const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; - if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) - { - DirectionalLightShadow::GetShadowCoords(shadowIndex, IN.m_worldPosition, vertexNormal, IN.m_shadowCoords); - } - } - } - - Surface surface; + Surface surface = (Surface)0; surface.position = IN.m_worldPosition.xyz; - // ------- Alpha & Clip ------- - - float2 baseColorUv = IN.m_uv[MaterialSrg::m_baseColorMapUvIndex]; - float2 opacityUv = IN.m_uv[MaterialSrg::m_opacityMapUvIndex]; - float alpha = GetAlphaInputAndClip(MaterialSrg::m_baseColorMap, MaterialSrg::m_opacityMap, baseColorUv, opacityUv, MaterialSrg::m_sampler, MaterialSrg::m_opacityFactor, o_opacity_source); - // ------- Normal ------- float2 normalUv = IN.m_uv[MaterialSrg::m_normalMapUvIndex]; @@ -154,14 +114,10 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // ------- Base Color ------- + float2 baseColorUv = IN.m_uv[MaterialSrg::m_baseColorMapUvIndex]; float3 sampledColor = GetBaseColorInput(MaterialSrg::m_baseColorMap, MaterialSrg::m_sampler, baseColorUv, MaterialSrg::m_baseColor.rgb, o_baseColor_useTexture); float3 baseColor = BlendBaseColor(sampledColor, MaterialSrg::m_baseColor.rgb, MaterialSrg::m_baseColorFactor, o_baseColorTextureBlendMode, o_baseColor_useTexture); - if(o_parallax_highlightClipping && displacementIsClipped) - { - ApplyParallaxClippingHighlight(baseColor); - } - // ------- Metallic ------- float2 metallicUv = IN.m_uv[MaterialSrg::m_metallicMapUvIndex]; @@ -183,7 +139,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // ------- Lighting Data ------- - LightingData lightingData; + LightingData lightingData = (LightingData)0; // Light iterator lightingData.tileIterator.Init(IN.m_position, PassSrg::m_lightListRemapped, PassSrg::m_tileLightData); @@ -191,51 +147,11 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // Directional light shadow coordinates lightingData.shadowCoords = IN.m_shadowCoords; - - // ------- Emissive ------- - - float2 emissiveUv = IN.m_uv[MaterialSrg::m_emissiveMapUvIndex]; - lightingData.emissiveLighting = GetEmissiveInput(MaterialSrg::m_emissiveMap, MaterialSrg::m_sampler, emissiveUv, MaterialSrg::m_emissiveIntensity, MaterialSrg::m_emissiveColor.rgb, o_emissiveEnabled, o_emissive_useTexture); - - // ------- Occlusion ------- - - lightingData.diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_diffuseOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_diffuseOcclusionMapUvIndex], MaterialSrg::m_diffuseOcclusionFactor, o_diffuseOcclusion_useTexture); - lightingData.specularOcclusion = GetOcclusionInput(MaterialSrg::m_specularOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_specularOcclusionMapUvIndex], MaterialSrg::m_specularOcclusionFactor, o_specularOcclusion_useTexture); - - // ------- Clearcoat ------- - - // [GFX TODO][ATOM-14603]: Clean up the double uses of these clear coat flags - if(o_clearCoat_feature_enabled) - { - if(o_clearCoat_enabled) - { - float3x3 uvMatrix = MaterialSrg::m_clearCoatNormalMapUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); - GetClearCoatInputs(MaterialSrg::m_clearCoatInfluenceMap, IN.m_uv[MaterialSrg::m_clearCoatInfluenceMapUvIndex], MaterialSrg::m_clearCoatFactor, o_clearCoat_factor_useTexture, - MaterialSrg::m_clearCoatRoughnessMap, IN.m_uv[MaterialSrg::m_clearCoatRoughnessMapUvIndex], MaterialSrg::m_clearCoatRoughness, o_clearCoat_roughness_useTexture, - MaterialSrg::m_clearCoatNormalMap, IN.m_uv[MaterialSrg::m_clearCoatNormalMapUvIndex], IN.m_normal, o_clearCoat_normal_useTexture, MaterialSrg::m_clearCoatNormalStrength, - uvMatrix, tangents[MaterialSrg::m_clearCoatNormalMapUvIndex], bitangents[MaterialSrg::m_clearCoatNormalMapUvIndex], - MaterialSrg::m_sampler, isFrontFace, - surface.clearCoat.factor, surface.clearCoat.roughness, surface.clearCoat.normal); - } - - // manipulate base layer f0 if clear coat is enabled - // modify base layer's normal incidence reflectance - // for the derivation of the following equation please refer to: - // https://google.github.io/filament/Filament.md.html#materialsystem/clearcoatmodel/baselayermodification - float3 f0 = (1.0 - 5.0 * sqrt(surface.specularF0)) / (5.0 - sqrt(surface.specularF0)); - surface.specularF0 = lerp(surface.specularF0, f0 * f0, surface.clearCoat.factor); - } // Diffuse and Specular response (used in IBL calculations) lightingData.specularResponse = FresnelSchlickWithRoughness(lightingData.NdotV, surface.specularF0, surface.roughnessLinear); lightingData.diffuseResponse = 1.0 - lightingData.specularResponse; - if(o_clearCoat_feature_enabled) - { - // Clear coat layer has fixed IOR = 1.5 and transparent => F0 = (1.5 - 1)^2 / (1.5 + 1)^2 = 0.04 - lightingData.diffuseResponse *= 1.0 - (FresnelSchlickWithRoughness(lightingData.NdotV, float3(0.04, 0.04, 0.04), surface.clearCoat.roughness) * surface.clearCoat.factor); - } - // ------- Multiscatter ------- lightingData.CalculateMultiscatterCompensation(surface.specularF0, o_specularF0_enableMultiScatterCompensation); @@ -254,99 +170,21 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // Finalize Lighting lightingData.FinalizeLighting(); + float alpha = 1.0f; PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); - // ------- Opacity ------- - - if (o_opacity_mode == OpacityMode::Blended || o_opacity_mode == OpacityMode::TintedTransparent) - { - // Increase opacity at grazing angles for surfaces with a low m_opacityAffectsSpecularFactor. - // For m_opacityAffectsSpecularFactor values close to 0, that indicates a transparent surface - // like glass, so it becomes less transparent at grazing angles. For m_opacityAffectsSpecularFactor - // values close to 1.0, that indicates the absence of a surface entirely, so this effect should - // not apply. - float fresnelAlpha = FresnelSchlickWithRoughness(lightingData.NdotV, alpha, surface.roughnessLinear).x; - alpha = lerp(fresnelAlpha, alpha, MaterialSrg::m_opacityAffectsSpecularFactor); - } - - if (o_opacity_mode == OpacityMode::Blended) - { - // [GFX_TODO ATOM-13187] PbrLighting shouldn't be writing directly to render targets. It's confusing when - // specular is being added to diffuse just because we're calling render target 0 "diffuse". - - // For blended mode, we do (dest * alpha) + (source * 1.0). This allows the specular - // to be added on top of the diffuse, but then the diffuse must be pre-multiplied. - // It's done this way because surface transparency doesn't really change specular response (eg, glass). - - lightingOutput.m_diffuseColor.rgb *= lightingOutput.m_diffuseColor.w; // pre-multiply diffuse - - // Add specular. m_opacityAffectsSpecularFactor controls how much the alpha masks out specular contribution. - float3 specular = lightingOutput.m_specularColor.rgb; - specular = lerp(specular, specular * lightingOutput.m_diffuseColor.w, MaterialSrg::m_opacityAffectsSpecularFactor); - lightingOutput.m_diffuseColor.rgb += specular; - - lightingOutput.m_diffuseColor.w = alpha; - } - else if (o_opacity_mode == OpacityMode::TintedTransparent) - { - // See OpacityMode::Blended above for the basic method. TintedTransparent adds onto the above concept by supporting - // colored alpha. This is currently a very basic calculation that uses the baseColor as a multiplier with strength - // determined by the alpha. We'll modify this later to be more physically accurate and allow surface depth, - // absorption, and interior color to be specified. - // - // The technique uses dual source blending to allow two separate sources to be part of the blending equation - // even though ultimately only a single render target is being written to. m_diffuseColor is render target 0 and - // m_specularColor render target 1, and the blend mode is (dest * source1color) + (source * 1.0). - // - // This means that m_specularColor.rgb (source 1) is multiplied against the destination, then - // m_diffuseColor.rgb (source) is added to that, and the final result is stored in render target 0. - - lightingOutput.m_diffuseColor.rgb *= lightingOutput.m_diffuseColor.w; // pre-multiply diffuse - - // Add specular. m_opacityAffectsSpecularFactor controls how much the alpha masks out specular contribution. - float3 specular = lightingOutput.m_specularColor.rgb; - specular = lerp(specular, specular * lightingOutput.m_diffuseColor.w, MaterialSrg::m_opacityAffectsSpecularFactor); - lightingOutput.m_diffuseColor.rgb += specular; - - lightingOutput.m_specularColor.rgb = baseColor * (1.0 - alpha); - } - else - { - lightingOutput.m_diffuseColor.w = -1; // Disable subsurface scattering - } + lightingOutput.m_diffuseColor.w = -1; // Disable subsurface scattering return lightingOutput; } -ForwardPassOutputWithDepth StandardPbr_ForwardPassPS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) -{ - ForwardPassOutputWithDepth OUT; - float depth; - - PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace, depth); - -#ifdef UNIFIED_FORWARD_OUTPUT - OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb; - OUT.m_color.a = lightingOutput.m_diffuseColor.a; - OUT.m_depth = depth; -#else - OUT.m_diffuseColor = lightingOutput.m_diffuseColor; - OUT.m_specularColor = lightingOutput.m_specularColor; - OUT.m_specularF0 = lightingOutput.m_specularF0; - OUT.m_albedo = lightingOutput.m_albedo; - OUT.m_normal = lightingOutput.m_normal; - OUT.m_depth = depth; -#endif - return OUT; -} [earlydepthstencil] -ForwardPassOutput StandardPbr_ForwardPassPS_EDS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) +ForwardPassOutput BasePbr_ForwardPassPS_EDS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) { ForwardPassOutput OUT; - float depth; - - PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace, depth); + PbrLightingOutput lightingOutput = (PbrLightingOutput)0; + lightingOutput = ForwardPassPS_Common(IN, isFrontFace); #ifdef UNIFIED_FORWARD_OUTPUT OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb; diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader index d8df49f4b0..377c0eae95 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader @@ -1,5 +1,5 @@ { - "Source" : "./StandardPBR_ForwardPass.azsl", + "Source" : "./BasePBR_ForwardPass.azsl", "DepthStencilState" : { @@ -30,7 +30,6 @@ } }, - "CompilerHints" : { "DisableOptimizations" : false }, @@ -40,11 +39,11 @@ "EntryPoints": [ { - "name": "StandardPbr_ForwardPassVS", + "name": "BasePbr_ForwardPassVS", "type": "Vertex" }, { - "name": "StandardPbr_ForwardPassPS", + "name": "BasePbr_ForwardPassPS_EDS", "type": "Fragment" } ] diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist index 39f101aca9..c817c793bd 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist @@ -1,5 +1,5 @@ { - "Shader" : "StandardPBR_ForwardPass.shader", + "Shader" : "BasePBR_ForwardPass.shader", "Variants": [ { "StableId": 1, diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl index 02e9e93ba2..d380045d88 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl @@ -10,4 +10,4 @@ #define QUALITY_LOW_END 1 -#include "StandardPBR_ForwardPass.azsl" +#include "BasePBR_ForwardPass.azsl" diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader index 44139608ca..005b001063 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader @@ -5,7 +5,7 @@ // DrawListTag. If your pipeline doesn't have a "lowEndForward" DrawListTag, no draw items // for this shader will be created. - "Source" : "./StandardPBR_LowEndForward.azsl", + "Source" : "./BasePBR_LowEndForward.azsl", "DepthStencilState" : { @@ -45,11 +45,11 @@ "EntryPoints": [ { - "name": "StandardPbr_ForwardPassVS", + "name": "BasePbr_ForwardPassVS", "type": "Vertex" }, { - "name": "StandardPbr_ForwardPassPS", + "name": "BasePbr_ForwardPassPS_EDS", "type": "Fragment" } ] diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua index 7e19641c6b..4a5fba58e8 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua @@ -9,15 +9,6 @@ -- ---------------------------------------------------------------------------------------------------- -function GetMaterialPropertyDependencies() - return {"opacity.mode", "parallax.textureMap", "parallax.useTexture", "parallax.pdo"} -end - -OpacityMode_Opaque = 0 -OpacityMode_Cutout = 1 -OpacityMode_Blended = 2 -OpacityMode_TintedTransparent = 3 - function TryGetShaderByTag(context, shaderTag) if context:HasShaderWithTag(shaderTag) then return context:GetShaderByTag(shaderTag) @@ -33,50 +24,17 @@ function TrySetShaderEnabled(shader, enabled) end function Process(context) - local opacityMode = context:GetMaterialPropertyValue_enum("opacity.mode") - local displacementMap = context:GetMaterialPropertyValue_Image("parallax.textureMap") - local useDisplacementMap = context:GetMaterialPropertyValue_bool("parallax.useTexture") - local parallaxEnabled = displacementMap ~= nil and useDisplacementMap - local parallaxPdoEnabled = context:GetMaterialPropertyValue_bool("parallax.pdo") local depthPass = context:GetShaderByTag("DepthPass") local shadowMap = context:GetShaderByTag("Shadowmap") local forwardPassEDS = context:GetShaderByTag("ForwardPass_EDS") - local depthPassWithPS = context:GetShaderByTag("DepthPass_WithPS") - local shadowMapWithPS = context:GetShaderByTag("Shadowmap_WithPS") - local forwardPass = context:GetShaderByTag("ForwardPass") - - -- Use TryGetShaderByTag because these shaders only exist in StandardPBR but this script is also used for EnhancedPBR + -- Use TryGetShaderByTag because these shaders only exist in BasePBR but this script is also used for EnhancedPBR local lowEndForwardEDS = TryGetShaderByTag(context, "LowEndForward_EDS") - local lowEndForward = TryGetShaderByTag(context, "LowEndForward") - - if parallaxEnabled and parallaxPdoEnabled then - depthPass:SetEnabled(false) - shadowMap:SetEnabled(false) - forwardPassEDS:SetEnabled(false) - - depthPassWithPS:SetEnabled(true) - shadowMapWithPS:SetEnabled(true) - forwardPass:SetEnabled(true) - TrySetShaderEnabled(lowEndForwardEDS, false) - TrySetShaderEnabled(lowEndForward, true) - else - depthPass:SetEnabled(opacityMode == OpacityMode_Opaque) - shadowMap:SetEnabled(opacityMode == OpacityMode_Opaque) - forwardPassEDS:SetEnabled((opacityMode == OpacityMode_Opaque) or (opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) - - depthPassWithPS:SetEnabled(opacityMode == OpacityMode_Cutout) - shadowMapWithPS:SetEnabled(opacityMode == OpacityMode_Cutout) - forwardPass:SetEnabled(opacityMode == OpacityMode_Cutout) + depthPass:SetEnabled(true); + shadowMap:SetEnabled(true); + forwardPassEDS:SetEnabled(true); - -- Only enable lowEndForwardEDS in Opaque mode, Transparent mode will be handled by forwardPassEDS. The transparent pass uses the "transparent" draw tag - -- for both standard and low end pipelines, so this keeps both shaders from rendering to the transparent draw list. - TrySetShaderEnabled(lowEndForwardEDS, opacityMode == OpacityMode_Opaque) - TrySetShaderEnabled(lowEndForward, opacityMode == OpacityMode_Cutout) - end - - context:GetShaderByTag("DepthPassTransparentMin"):SetEnabled((opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) - context:GetShaderByTag("DepthPassTransparentMax"):SetEnabled((opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) + TrySetShaderEnabled(lowEndForwardEDS, true) end diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/NVLC.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/NVLC.azsli index 60d5bf38f2..e9558b39ff 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/NVLC.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/NVLC.azsli @@ -72,7 +72,7 @@ struct TileLightData bool Light_IsInsideBin(uint package, uint bin) { - return (package & (1 << bin)) != 0; + return (package & (1u << bin)) != 0; } uint PackLightIndexWithBinMask(uint ind, uint bins) @@ -127,7 +127,7 @@ uint NVLC_GetBin(const float viewZ, const TileLightData data) const float zFarCoordSystemAdjusted = data.zFar * RH_COORD_SYSTEM_REVERSE; float f = saturate( (abs(viewZCoordSystemAdjusted) - zNearCoordSystemAdjusted) / (zFarCoordSystemAdjusted - zNearCoordSystemAdjusted) ); - float bin = min(f, 0.999999) * float(1 << data.logMaxBins); + float bin = min(f, 0.999999) * float(1u << data.logMaxBins); return uint(bin); } From fbd7b67e1126aeca6a21bd2eb52370a995d9d069 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:57:23 -0800 Subject: [PATCH 027/620] added some explicit use of float3 Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Assets/Materials/Types/BasePBR_ForwardPass.azsl | 2 +- .../Atom/Features/PBR/Lighting/LightingData.azsli | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl index 1a4b386ef1..8c8c9a589d 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl @@ -150,7 +150,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) // Diffuse and Specular response (used in IBL calculations) lightingData.specularResponse = FresnelSchlickWithRoughness(lightingData.NdotV, surface.specularF0, surface.roughnessLinear); - lightingData.diffuseResponse = 1.0 - lightingData.specularResponse; + lightingData.diffuseResponse = float3(1.0, 1.0, 1.0) - lightingData.specularResponse; // ------- Multiscatter ------- diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli index 878bed02d4..dbc348e54a 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli @@ -56,10 +56,10 @@ class LightingData void LightingData::Init(float3 positionWS, float3 normal, float roughnessLinear) { - diffuseLighting = 0; - specularLighting = 0; - translucentBackLighting = 0; - multiScatterCompensation = 1.0f; + diffuseLighting = float3(0.0, 0.0, 0.0); + specularLighting = float3(0.0, 0.0, 0.0); + translucentBackLighting = float3(0.0, 0.0, 0.0); + multiScatterCompensation = float3(1.0f, 1.0f, 1.0f); emissiveLighting = float3(0.0f, 0.0f, 0.0f); diffuseAmbientOcclusion = 1.0f; specularOcclusion = 1.0f; From 9825d6aba3ab83d85c93a9e9c6801944fa2d6494 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Mon, 29 Nov 2021 15:49:15 +0100 Subject: [PATCH 028/620] Thin transmission mode fix for directional lights Signed-off-by: Santi Paprika --- .../Common/Assets/Materials/Types/Skin.azsl | 10 +++++ .../Atom/Features/PBR/BackLighting.azsli | 43 +++++++++++-------- .../Features/PBR/Lighting/LightingData.azsli | 3 ++ .../PBR/Lights/DirectionalLight.azsli | 25 ++++++++--- 4 files changed, 56 insertions(+), 25 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl index 523353f8fa..091e0a5645 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl @@ -92,6 +92,7 @@ struct VSOutput float3 m_bitangent : BITANGENT; float3 m_worldPosition : UV0; float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV4; + float3 m_shrinkedShadowCoords[ViewSrg::MaxCascadeCount] : UV9; // Extended fields (only referenced in this azsl file)... float2 m_uv[UvSetCount] : UV1; @@ -137,6 +138,14 @@ VSOutput SkinVS(VSInput IN) VertexHelper(IN, OUT, worldPosition, false); + // Fetch shadow coords for shrinked world position (used in thin transmission materials) + const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; + DirectionalLightShadow::GetShadowCoords( + shadowIndex, + worldPosition - 0.005 * OUT.m_normal, + OUT.m_normal, + OUT.m_shrinkedShadowCoords); + return OUT; } @@ -336,6 +345,7 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) // Directional light shadow coordinates lightingData.shadowCoords = IN.m_shadowCoords; + lightingData.shrinkedShadowCoords = IN.m_shrinkedShadowCoords; // Diffuse and Specular response (used in IBL calculations) lightingData.specularResponse = FresnelSchlickWithRoughness(lightingData.NdotV, surface.specularF0, surface.roughnessLinear); diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index dfd5522f5c..70f49f0a66 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -16,24 +16,26 @@ #include // Analytical integation (approximation) of diffusion profile over radius, could be replaced by other pre integrated kernels -// such as sum of Gaussian +// such as sum of Gaussian (see T(s)) float3 TransmissionKernel(float t, float3 s) { float3 exponent = s * t; return 0.25 * (1.0 / exp(exponent) + 3.0 / exp(exponent / 3.0)); } -float ThinObjectFalloff(const float3 surfaceNormal, const float3 dirToLight) +// Analytical integation (approximation) of diffusion profile over radius, could be precomputed in a LUT +float3 T(float s) { - const float ndl = saturate(dot(-surfaceNormal, dirToLight)); - - // ndl works decently well but it can produce a harsh discontinuity in the area just before - // the shadow starts appearing on objects like cylinder and tubes. - // Smoothing out ndl does a decent enough job of removing this artifact. - return smoothstep(0, 1, ndl * ndl); + // dipoles and multipoles are approximated with sums of a small number of Gaussians with variable weights and variances + return float3(0.233, 0.455, 0.649) * exp(-s*s/0.0064) + + float3(0.1, 0.336, 0.344) * exp(-s*s/0.0484) + + float3(0.118, 0.198, 0.0) * exp(-s*s/0.187) + + float3(0.113, 0.007, 0.007) * exp(-s*s/0.567) + + float3(0.358, 0.004, 0.0) * exp(-s*s/1.99) + + float3(0.078, 0.0, 0.0) * exp(-s*s/7.41); } -float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightIntensity, float3 dirToLight, float shadowRatio) +float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightIntensity, float3 dirToLight, float transmissionDistance) { float3 result = float3(0.0, 0.0, 0.0); float thickness = 0.0; @@ -49,7 +51,7 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI // https://colinbarrebrisebois.com/2011/03/07/gdc-2011-approximating-translucency-for-a-fast-cheap-and-convincing-subsurface-scattering-look/ { - thickness = max(shadowRatio, surface.transmission.thickness); + thickness = max(transmissionDistance, surface.transmission.thickness); float transmittance = pow( saturate( dot( lightingData.dirToCamera, -normalize( dirToLight + surface.normal * transmissionParams.z ) ) ), transmissionParams.y ) * transmissionParams.w; float lamberAttenuation = exp(-thickness * transmissionParams.x) * saturate(1.0 - thickness); result = transmittance * lamberAttenuation * lightIntensity; @@ -57,18 +59,21 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI break; case TransmissionMode::ThinObject: - // Thin object mode, using thin-film assumption proposed by Jimenez J. et al, 2010, "Real-Time Realistic Skin Translucency" + // Thin object mode, based on Jimenez J. et al, 2010, "Real-Time Realistic Skin Translucency" // http://www.iryoku.com/translucency/downloads/Real-Time-Realistic-Skin-Translucency.pdf - - float litRatio = 1.0 - shadowRatio; - if (litRatio) + { - const float thickness = surface.transmission.thickness * transmissionParams.w; - const float3 invScattering = rcp(transmissionParams.xyz); - const float falloff = ThinObjectFalloff(surface.normal, dirToLight); - result = TransmissionKernel(thickness, invScattering) * falloff * lightIntensity * litRatio; - } + // Irradiance arround surface point. + // Begin the transmittance dot product slightly before it would with the regular dot(N,L) + float E = max(0.30 + dot(-surface.normal, dirToLight), 0.0); + // Transmission distance computed from shadowmaps modulated by editor-exposed parameters + float s = transmissionDistance * surface.transmission.thickness * (20 - transmissionParams.w) * 10; + + // Albedo at front (surface point) is used to approximate irradiance at the back of the object + // See observation 4 in [Jimenez J. et al, 2010] + result = T(s) * lightIntensity * surface.albedo * E; + } break; } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli index 878bed02d4..51bd421418 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli @@ -28,6 +28,9 @@ class LightingData // Direction light shadow coordinates float3 shadowCoords[ViewSrg::MaxCascadeCount]; + // Direction light shadow coordinates for shrinked positions + float3 shrinkedShadowCoords[ViewSrg::MaxCascadeCount]; + // Normalized direction from surface to camera float3 dirToCamera; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index 1eee53a24f..32654e0427 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -18,7 +18,9 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) // Shadowed check const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; float litRatio = 1.0f; + float transmissionDistance = 0.0f; float backShadowRatio = 0.0f; + if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) { litRatio = DirectionalLightShadow::GetVisibility( @@ -30,6 +32,12 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) if (o_transmission_mode == TransmissionMode::ThickObject) { backShadowRatio = DirectionalLightShadow::GetThickness(shadowIndex, lightingData.shadowCoords); + } + else if (o_transmission_mode == TransmissionMode::ThinObject) + { + // Use shrinked positions for thin object transmission to ensure they fall onto the object when querying + // the depth from the shadow map + transmissionDistance = DirectionalLightShadow::GetThickness(shadowIndex, lightingData.shrinkedShadowCoords); } } @@ -50,21 +58,26 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) // [GFX TODO][ATOM-2012] care of multiple directional light // Currently shadow check is done only for index == shadowIndex. float currentLitRatio = 1.0f; - float currentBackShadowRatio = 1.0f; + float currentTransmissionParameter = 1.0f; if (o_enableShadows) { - currentLitRatio = (index == shadowIndex) ? litRatio : 1.; - - currentBackShadowRatio = 1.0 - currentLitRatio; + bool activeLight = index == shadowIndex; + currentLitRatio = activeLight ? litRatio : 1.; if (o_transmission_mode == TransmissionMode::ThickObject) { - currentBackShadowRatio = (index == shadowIndex) ? backShadowRatio : 0.; + // Back shadow ratio (add contribution only if current directional light is the active one for shadows) + currentTransmissionParameter = activeLight ? backShadowRatio : 0.; + } + else if (o_transmission_mode == TransmissionMode::ThinObject) + { + // Transmission distance (add contribution only if current directional light is the active one for shadows) + currentTransmissionParameter = activeLight ? transmissionDistance : 9999.f; } } lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; lightingData.specularLighting += GetSpecularLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; - lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight, currentBackShadowRatio); + lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight, currentTransmissionParameter); } // Add debug coloring for directional light shadow From 1417488a2b2939affa14d0494b66c865bef907f9 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Mon, 29 Nov 2021 20:22:31 +0100 Subject: [PATCH 029/620] Increase scale range + expose shrink factor Signed-off-by: Santi Paprika --- .../Feature/Common/Assets/Materials/Types/Skin.azsl | 2 +- .../Common/Assets/Materials/Types/Skin.materialtype | 13 +++++++++++++ .../Common/Assets/Materials/Types/Skin_Common.azsli | 1 + .../ShaderLib/Atom/Features/PBR/BackLighting.azsli | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl index 091e0a5645..b672016c00 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl @@ -142,7 +142,7 @@ VSOutput SkinVS(VSInput IN) const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; DirectionalLightShadow::GetShadowCoords( shadowIndex, - worldPosition - 0.005 * OUT.m_normal, + worldPosition - MaterialSrg::m_shrinkFactor * OUT.m_normal, OUT.m_normal, OUT.m_shrinkedShadowCoords); diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index e2a05aa916..496d6286cc 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -637,6 +637,19 @@ "min": 0.0, "softMax": 20.0 }, + { + "name": "shrinkFactor", + "displayName": " Shrink Factor", + "description": "Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection", + "type": "float", + "defaultValue": 0.005, + "min": 0.0, + "softMax": 0.05, + "connection": { + "type": "ShaderInput", + "name": "m_shrinkFactor" + } + }, { "name": "transmissionScale", "displayName": " Scale", diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli index a94f203b23..406da8b70c 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli @@ -71,6 +71,7 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial float4 m_transmissionTintThickness; Texture2D m_transmissionThicknessMap; uint m_transmissionThicknessMapUvIndex; + float m_shrinkFactor; Texture2D m_wrinkle_baseColor_texture1; Texture2D m_wrinkle_baseColor_texture2; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index 70f49f0a66..559b8cac2e 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -68,7 +68,7 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI float E = max(0.30 + dot(-surface.normal, dirToLight), 0.0); // Transmission distance computed from shadowmaps modulated by editor-exposed parameters - float s = transmissionDistance * surface.transmission.thickness * (20 - transmissionParams.w) * 10; + float s = transmissionDistance * surface.transmission.thickness * (50 - transmissionParams.w) * 10; // Albedo at front (surface point) is used to approximate irradiance at the back of the object // See observation 4 in [Jimenez J. et al, 2010] From 85d206c0c8a86c7bae4df1f818fc3e71aee26ed2 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Tue, 30 Nov 2021 18:19:39 +0100 Subject: [PATCH 030/620] Support directional lights with disabled shadows Signed-off-by: Santi Paprika --- .../Atom/Features/PBR/Lights/DirectionalLight.azsli | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index 32654e0427..ccaedcd34a 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -58,7 +58,7 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) // [GFX TODO][ATOM-2012] care of multiple directional light // Currently shadow check is done only for index == shadowIndex. float currentLitRatio = 1.0f; - float currentTransmissionParameter = 1.0f; + float currentTransmissionParameter = (o_transmission_mode == TransmissionMode::ThickObject) ? 0.0f : 9999.0f; if (o_enableShadows) { bool activeLight = index == shadowIndex; @@ -66,12 +66,12 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) if (o_transmission_mode == TransmissionMode::ThickObject) { // Back shadow ratio (add contribution only if current directional light is the active one for shadows) - currentTransmissionParameter = activeLight ? backShadowRatio : 0.; + currentTransmissionParameter = activeLight ? backShadowRatio : 0.0f; } else if (o_transmission_mode == TransmissionMode::ThinObject) { // Transmission distance (add contribution only if current directional light is the active one for shadows) - currentTransmissionParameter = activeLight ? transmissionDistance : 9999.f; + currentTransmissionParameter = activeLight ? transmissionDistance : 9999.0f; } } From 9f8994823bd42636cef98e059bf73ea57ace0b79 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Tue, 30 Nov 2021 18:41:08 +0100 Subject: [PATCH 031/620] Fix naming for transmission distance parameter Signed-off-by: Santi Paprika --- .../Features/PBR/Lights/DirectionalLight.azsli | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index ccaedcd34a..0b0be82d72 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -19,7 +19,6 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; float litRatio = 1.0f; float transmissionDistance = 0.0f; - float backShadowRatio = 0.0f; if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) { @@ -31,7 +30,7 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) if (o_transmission_mode == TransmissionMode::ThickObject) { - backShadowRatio = DirectionalLightShadow::GetThickness(shadowIndex, lightingData.shadowCoords); + transmissionDistance = DirectionalLightShadow::GetThickness(shadowIndex, lightingData.shadowCoords); } else if (o_transmission_mode == TransmissionMode::ThinObject) { @@ -58,26 +57,21 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) // [GFX TODO][ATOM-2012] care of multiple directional light // Currently shadow check is done only for index == shadowIndex. float currentLitRatio = 1.0f; - float currentTransmissionParameter = (o_transmission_mode == TransmissionMode::ThickObject) ? 0.0f : 9999.0f; + float currentTransmissionDistance = (o_transmission_mode == TransmissionMode::ThickObject) ? 0.0f : 9999.0f; if (o_enableShadows) { bool activeLight = index == shadowIndex; currentLitRatio = activeLight ? litRatio : 1.; - if (o_transmission_mode == TransmissionMode::ThickObject) - { - // Back shadow ratio (add contribution only if current directional light is the active one for shadows) - currentTransmissionParameter = activeLight ? backShadowRatio : 0.0f; - } - else if (o_transmission_mode == TransmissionMode::ThinObject) + if (activeLight) { // Transmission distance (add contribution only if current directional light is the active one for shadows) - currentTransmissionParameter = activeLight ? transmissionDistance : 9999.0f; + currentTransmissionDistance = transmissionDistance; } } lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; lightingData.specularLighting += GetSpecularLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; - lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight, currentTransmissionParameter); + lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight, currentTransmissionDistance); } // Add debug coloring for directional light shadow From 348c3cc0f62268e74114e27f4cad913b64b2ddfd Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 2 Dec 2021 13:04:16 +0100 Subject: [PATCH 032/620] Expose angle offset below (N.L) Signed-off-by: Santi Paprika --- .../Common/Assets/Materials/Types/Skin.azsl | 3 +++ .../Assets/Materials/Types/Skin.materialtype | 15 ++++++++++++++- .../Assets/Materials/Types/Skin_Common.azsli | 1 + .../Atom/Features/PBR/BackLighting.azsli | 4 ++-- .../Atom/Features/PBR/Lighting/LightingData.azsli | 5 ++++- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl index b672016c00..2e861a61bb 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl @@ -351,6 +351,9 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) lightingData.specularResponse = FresnelSchlickWithRoughness(lightingData.NdotV, surface.specularF0, surface.roughnessLinear); lightingData.diffuseResponse = 1.0 - lightingData.specularResponse; + // Angle offset for subsurface scattering through thin objects + lightingData.angleOffset = MaterialSrg::m_angleOffset; + // ------- Occlusion ------- lightingData.diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_diffuseOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_diffuseOcclusionMapUvIndex], MaterialSrg::m_diffuseOcclusionFactor, o_diffuseOcclusion_useTexture); diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index 496d6286cc..39cbe21a18 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -650,6 +650,19 @@ "name": "m_shrinkFactor" } }, + { + "name": "angleOffset", + "displayName": " Angle Offset", + "description": "Angle to accept below (N . L = 0) in scattering through thin objects", + "type": "float", + "defaultValue": 0.1, + "min": -1.0, + "softMax": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_angleOffset" + } + }, { "name": "transmissionScale", "displayName": " Scale", @@ -657,7 +670,7 @@ "type": "float", "defaultValue": 3.0, "min": 0.0, - "softMax": 20.0 + "softMax": 100.0 } ], "wrinkleLayers": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli index 406da8b70c..1fa2039c72 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli @@ -72,6 +72,7 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial Texture2D m_transmissionThicknessMap; uint m_transmissionThicknessMapUvIndex; float m_shrinkFactor; + float m_angleOffset; Texture2D m_wrinkle_baseColor_texture1; Texture2D m_wrinkle_baseColor_texture2; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index 559b8cac2e..0e39739fcb 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -65,10 +65,10 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI { // Irradiance arround surface point. // Begin the transmittance dot product slightly before it would with the regular dot(N,L) - float E = max(0.30 + dot(-surface.normal, dirToLight), 0.0); + float E = saturate(lightingData.angleOffset + dot(-surface.normal, dirToLight)); // Transmission distance computed from shadowmaps modulated by editor-exposed parameters - float s = transmissionDistance * surface.transmission.thickness * (50 - transmissionParams.w) * 10; + float s = transmissionDistance * surface.transmission.thickness * (100 - transmissionParams.w) * 10; // Albedo at front (surface point) is used to approximate irradiance at the back of the object // See observation 4 in [Jimenez J. et al, 2010] diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli index 51bd421418..7ca8a797a8 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli @@ -28,9 +28,12 @@ class LightingData // Direction light shadow coordinates float3 shadowCoords[ViewSrg::MaxCascadeCount]; - // Direction light shadow coordinates for shrinked positions + // Direction light shadow coordinates for shrinked positions (used in scattering through thin objects) float3 shrinkedShadowCoords[ViewSrg::MaxCascadeCount]; + // Angle to accept below (N . L = 0) in scattering through thin objects + float angleOffset; + // Normalized direction from surface to camera float3 dirToCamera; From 2b99867225fdd21445af244ea6076526ccf6131a Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 2 Dec 2021 13:32:28 +0100 Subject: [PATCH 033/620] Add informative comments for directional light thin scattering Signed-off-by: Santi Paprika --- .../Atom/Features/PBR/Lights/DirectionalLight.azsli | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index 0b0be82d72..82bad459cf 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -18,6 +18,8 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) // Shadowed check const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; float litRatio = 1.0f; + + // Transmission distance inside object float transmissionDistance = 0.0f; if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) @@ -57,6 +59,9 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) // [GFX TODO][ATOM-2012] care of multiple directional light // Currently shadow check is done only for index == shadowIndex. float currentLitRatio = 1.0f; + + // Transmission distance from current light inside object (default non-influential values) + // o_transmission_mode == NONE is not taken into account because GetBackLighting already ignores this case float currentTransmissionDistance = (o_transmission_mode == TransmissionMode::ThickObject) ? 0.0f : 9999.0f; if (o_enableShadows) { From 97c36a71a26a92b98fa33fe42fa4edacc31cd155 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 2 Dec 2021 17:49:26 +0100 Subject: [PATCH 034/620] Move directional shadow coordinates computation to PS + Fix clamp values Signed-off-by: Santi Paprika --- .../Common/Assets/Materials/Types/Skin.azsl | 15 +++++---------- .../Atom/Features/PBR/BackLighting.azsli | 2 +- .../Atom/Features/PBR/Lighting/LightingData.azsli | 3 +++ .../Features/PBR/Lights/DirectionalLight.azsli | 8 ++++++++ 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl index 2e861a61bb..4908e736f4 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl @@ -92,7 +92,6 @@ struct VSOutput float3 m_bitangent : BITANGENT; float3 m_worldPosition : UV0; float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV4; - float3 m_shrinkedShadowCoords[ViewSrg::MaxCascadeCount] : UV9; // Extended fields (only referenced in this azsl file)... float2 m_uv[UvSetCount] : UV1; @@ -137,14 +136,6 @@ VSOutput SkinVS(VSInput IN) } VertexHelper(IN, OUT, worldPosition, false); - - // Fetch shadow coords for shrinked world position (used in thin transmission materials) - const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; - DirectionalLightShadow::GetShadowCoords( - shadowIndex, - worldPosition - MaterialSrg::m_shrinkFactor * OUT.m_normal, - OUT.m_normal, - OUT.m_shrinkedShadowCoords); return OUT; } @@ -345,15 +336,19 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) // Directional light shadow coordinates lightingData.shadowCoords = IN.m_shadowCoords; - lightingData.shrinkedShadowCoords = IN.m_shrinkedShadowCoords; // Diffuse and Specular response (used in IBL calculations) lightingData.specularResponse = FresnelSchlickWithRoughness(lightingData.NdotV, surface.specularF0, surface.roughnessLinear); lightingData.diffuseResponse = 1.0 - lightingData.specularResponse; + // ------- Thin Object Light Transmission ------- + // Angle offset for subsurface scattering through thin objects lightingData.angleOffset = MaterialSrg::m_angleOffset; + // Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection + lightingData.shrinkFactor = MaterialSrg::m_shrinkFactor; + // ------- Occlusion ------- lightingData.diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_diffuseOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_diffuseOcclusionMapUvIndex], MaterialSrg::m_diffuseOcclusionFactor, o_diffuseOcclusion_useTexture); diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index 0e39739fcb..cd2ce763e4 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -65,7 +65,7 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI { // Irradiance arround surface point. // Begin the transmittance dot product slightly before it would with the regular dot(N,L) - float E = saturate(lightingData.angleOffset + dot(-surface.normal, dirToLight)); + float E = max(lightingData.angleOffset + dot(-surface.normal, dirToLight),0.0); // Transmission distance computed from shadowmaps modulated by editor-exposed parameters float s = transmissionDistance * surface.transmission.thickness * (100 - transmissionParams.w) * 10; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli index 7ca8a797a8..8f3bca703e 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli @@ -33,6 +33,9 @@ class LightingData // Angle to accept below (N . L = 0) in scattering through thin objects float angleOffset; + + // Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection + float shrinkFactor; // Normalized direction from surface to camera float3 dirToCamera; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index 82bad459cf..d7fa77d701 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -29,6 +29,14 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) lightingData.shadowCoords, surface.vertexNormal, debugInfo); + + // Fetch shadow coords for shrinked world position (used in thin transmission materials) + float3 shrinkedShadowCoords[ViewSrg::MaxCascadeCount]; + DirectionalLightShadow::GetShadowCoords( + shadowIndex, + surface.position - lightingData.shrinkFactor * surface.normal, + surface.normal, + lightingData.shrinkedShadowCoords); if (o_transmission_mode == TransmissionMode::ThickObject) { From d1b19a51d5d078eb13f575591d92fdac9cc6b6a3 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 2 Dec 2021 18:36:55 +0100 Subject: [PATCH 035/620] Add point light thin transmission support Signed-off-by: Santi Paprika --- .../Atom/Features/PBR/Lights/PointLight.azsli | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli index 92f4065931..7f4cd46749 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli @@ -84,8 +84,9 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD // shadow float litRatio = 1.0; - // How much is back face shadowed, it's set to the reverse of litRatio to share the same default value with thickness, which should be 0 if no shadow map available - float backShadowRatio = 0.0; + // Transmission distance from current light inside object (default non-influential values) + // o_transmission_mode == NONE is not taken into account because GetBackLighting already ignores this case + float transmissionDistance = (o_transmission_mode == TransmissionMode::ThickObject) ? 0.0f : 9999.0f; if (o_enableShadows) { const float3 lightDir = normalize(light.m_position - surface.position); @@ -97,13 +98,13 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD lightDir, surface.vertexNormal); - // Use backShadowRatio to carry thickness from shadow map for thick mode - backShadowRatio = 1.0 - litRatio; if (o_transmission_mode == TransmissionMode::ThickObject) { - backShadowRatio = ProjectedShadow::GetThickness( - shadowIndex, - surface.position); + transmissionDistance = ProjectedShadow::GetThickness(shadowIndex, surface.position); + } + else if (o_transmission_mode == TransmissionMode::ThinObject) + { + transmissionDistance = ProjectedShadow::GetThickness(shadowIndex, surface.position - lightingData.shrinkFactor * surface.normal); } } @@ -111,7 +112,7 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, normalize(posToLight)) * litRatio; // Transmission contribution - lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), backShadowRatio); + lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), transmissionDistance); // Adjust the light direcion for specular based on bulb size From 1178bc142091a84687ba59e5a9489d82cdb32edf Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Fri, 3 Dec 2021 17:02:02 +0100 Subject: [PATCH 036/620] Add disk light support for thin object translucency Signed-off-by: Santi Paprika --- .../Atom/Features/PBR/Lights/DiskLight.azsli | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli index 63f671f021..7cc5a34453 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli @@ -77,8 +77,9 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat // shadow float litRatio = 1.0; - // How much is back face shadowed, it's set to the reverse of litRatio to share the same default value with thickness, which should be 0 if no shadow map available - float backShadowRatio = 0.0; + // Transmission distance from current light inside object (default non-influential values) + // o_transmission_mode == NONE is not taken into account because GetBackLighting already ignores this case + float transmissionDistance = (o_transmission_mode == TransmissionMode::ThickObject) ? 0.0f : 9999.0f; if (o_enableShadows) { litRatio = ProjectedShadow::GetVisibility( @@ -88,14 +89,14 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat -dirToConeTip, surface.vertexNormal); - // Use backShadowRatio to carry thickness from shadow map for thick mode - backShadowRatio = 1.0 - litRatio; if (o_transmission_mode == TransmissionMode::ThickObject) { - backShadowRatio = ProjectedShadow::GetThickness( - light.m_shadowIndex, - surface.position); + transmissionDistance = ProjectedShadow::GetThickness(light.m_shadowIndex, surface.position); } + else if (o_transmission_mode == TransmissionMode::ThinObject) + { + transmissionDistance = ProjectedShadow::GetThickness(light.m_shadowIndex, surface.position - lightingData.shrinkFactor * surface.normal); + } } if (useConeAngle && dotWithDirection < light.m_cosInnerConeAngle) // in penumbra @@ -113,7 +114,7 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, posToLightDir) * litRatio; // Transmission contribution - lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, posToLightDir, backShadowRatio); + lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, posToLightDir, transmissionDistance); // Adjust the light direction for specular based on disk size From d951cd332f80de55d18824e9a82b2efe90a4266a Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Fri, 3 Dec 2021 22:06:29 +0100 Subject: [PATCH 037/620] Consider default thickness value for quadlight fast approx mode Signed-off-by: Santi Paprika --- .../Atom/Features/PBR/Lights/QuadLight.azsli | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli index 63515339d8..a4ef25572d 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli @@ -148,13 +148,14 @@ void ApplyQuadLight(ViewSrg::QuadLight light, Surface surface, inout LightingDat GetDiffuseLighting(surface, lightingData, intensity, dirToLightCenter) ); + float nullTransmissionDistance = (o_transmission_mode == TransmissionMode::ThickObject) ? 0.0f : 9999.0f; lightingData.translucentBackLighting += ( - GetBackLighting(surface, lightingData, intensity, p0, 0.0) + - GetBackLighting(surface, lightingData, intensity, p1, 0.0) + - GetBackLighting(surface, lightingData, intensity, p2, 0.0) + - GetBackLighting(surface, lightingData, intensity, p3, 0.0) + - GetBackLighting(surface, lightingData, intensity, dirToLightCenter, 0.0) + GetBackLighting(surface, lightingData, intensity, p0, nullTransmissionDistance) + + GetBackLighting(surface, lightingData, intensity, p1, nullTransmissionDistance) + + GetBackLighting(surface, lightingData, intensity, p2, nullTransmissionDistance) + + GetBackLighting(surface, lightingData, intensity, p3, nullTransmissionDistance) + + GetBackLighting(surface, lightingData, intensity, dirToLightCenter, nullTransmissionDistance) ); // Calculate specular by choosing a single representative point on the light's surface based on the reflection ray From 6172bb003442ffb85b446a698d96f290669055b0 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Sat, 4 Dec 2021 09:59:16 +0100 Subject: [PATCH 038/620] Add EnhancedPBR support for thin object transmission Signed-off-by: Santi Paprika --- .../Materials/Types/EnhancedPBR.materialtype | 28 ++++++++++++++++++- .../Materials/Types/EnhancedPBR_Common.azsli | 2 ++ .../Types/EnhancedPBR_ForwardPass.azsl | 8 ++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index 5de756067a..a83721f0b1 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -1223,6 +1223,32 @@ "min": 0.0, "softMax": 20.0 }, + { + "name": "shrinkFactor", + "displayName": " Shrink Factor", + "description": "Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection", + "type": "float", + "defaultValue": 0.005, + "min": 0.0, + "softMax": 0.05, + "connection": { + "type": "ShaderInput", + "name": "m_shrinkFactor" + } + }, + { + "name": "angleOffset", + "displayName": " Angle Offset", + "description": "Angle to accept below (N . L = 0) in scattering through thin objects", + "type": "float", + "defaultValue": 0.1, + "min": -1.0, + "softMax": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_angleOffset" + } + }, { "name": "transmissionScale", "displayName": " Scale", @@ -1230,7 +1256,7 @@ "type": "float", "defaultValue": 3.0, "min": 0.0, - "softMax": 20.0 + "softMax": 100.0 } ], "detailLayerGroup": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli index 3c35ca65be..98f091cb12 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli @@ -100,6 +100,8 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial float4 m_transmissionTintThickness; Texture2D m_transmissionThicknessMap; uint m_transmissionThicknessMapUvIndex; + float m_shrinkFactor; + float m_angleOffset; } // Callback function for ParallaxMapping.azsli diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl index 0f9771e480..bc660979f6 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl @@ -275,6 +275,14 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float lightingData.diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_diffuseOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_diffuseOcclusionMapUvIndex], MaterialSrg::m_diffuseOcclusionFactor, o_diffuseOcclusion_useTexture); lightingData.specularOcclusion = GetOcclusionInput(MaterialSrg::m_specularOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_specularOcclusionMapUvIndex], MaterialSrg::m_specularOcclusionFactor, o_specularOcclusion_useTexture); + // ------- Thin Object Light Transmission ------- + + // Angle offset for subsurface scattering through thin objects + lightingData.angleOffset = MaterialSrg::m_angleOffset; + + // Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection + lightingData.shrinkFactor = MaterialSrg::m_shrinkFactor; + // ------- Clearcoat ------- // [GFX TODO][ATOM-14603]: Clean up the double uses of these clear coat flags From 7e78c260c1d80103764de83433df5e9c7a467da4 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Mon, 6 Dec 2021 12:38:30 +0100 Subject: [PATCH 039/620] Use generic diffusion profiles instead of skin-specific Signed-off-by: Santi Paprika --- .../ShaderLib/Atom/Features/PBR/BackLighting.azsli | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index cd2ce763e4..79a5041cf1 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -23,6 +23,7 @@ float3 TransmissionKernel(float t, float3 s) return 0.25 * (1.0 / exp(exponent) + 3.0 / exp(exponent / 3.0)); } +// [specific profile for SKIN (not used ATM)] // Analytical integation (approximation) of diffusion profile over radius, could be precomputed in a LUT float3 T(float s) { @@ -68,11 +69,15 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI float E = max(lightingData.angleOffset + dot(-surface.normal, dirToLight),0.0); // Transmission distance computed from shadowmaps modulated by editor-exposed parameters - float s = transmissionDistance * surface.transmission.thickness * (100 - transmissionParams.w) * 10; + float s = transmissionDistance * surface.transmission.thickness * (100 - transmissionParams.w); + + // Use scattering color to weight thin object transmission color + const float3 invScattering = rcp(transmissionParams.xyz); // Albedo at front (surface point) is used to approximate irradiance at the back of the object // See observation 4 in [Jimenez J. et al, 2010] - result = T(s) * lightIntensity * surface.albedo * E; + result = TransmissionKernel(s, invScattering) * lightIntensity * surface.albedo * E; + // result = T(s) * lightIntensity * surface.albedo * E; } break; } From 4a10b5ac62b999d385b99c755032863223b3cdf4 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Mon, 6 Dec 2021 17:17:17 +0100 Subject: [PATCH 040/620] Update T(s) function explanation (comment) Signed-off-by: Santi Paprika --- .../Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index 79a5041cf1..7c5e4732cd 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -23,7 +23,7 @@ float3 TransmissionKernel(float t, float3 s) return 0.25 * (1.0 / exp(exponent) + 3.0 / exp(exponent / 3.0)); } -// [specific profile for SKIN (not used ATM)] +// [specific profile for SKIN (not used ATM, replaced by TransmissionKernel)] // Analytical integation (approximation) of diffusion profile over radius, could be precomputed in a LUT float3 T(float s) { From 2e5df3f0181425f5eae7bd43d3cb80eadc69b8f6 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Wed, 8 Dec 2021 16:12:02 +0100 Subject: [PATCH 041/620] Avoid negative thickness values Signed-off-by: Santi Paprika --- .../Atom/Features/Shadow/DirectionalLightShadow.azsli | 5 ++++- .../ShaderLib/Atom/Features/Shadow/ProjectedShadow.azsli | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli index 59817af701..5405d2e914 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli @@ -154,7 +154,10 @@ float DirectionalLightShadow::GetThickness(uint lightIndex, float3 shadowCoords[ shadowCoord.y >= 0. && shadowCoord.y * size < size - PixelMargin && shadowCoord.z < (1. - DepthMargin)) { const float depthBufferValue = shadowmap.Sample(PassSrg::LinearSampler, float3(shadowCoord.xy, indexOfCascade)).r; - const float deltaDepth = abs(shadowCoord.z - depthBufferValue); + + // Normalized thickness (avoid negative values given by to precission or shrinking offsets) + const float deltaDepth = max(shadowCoord.z - depthBufferValue,0.0); + const float viewSpaceThickness = ViewSrg::m_directionalLightShadows[lightIndex].m_far_minus_near * deltaDepth; return viewSpaceThickness; } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/ProjectedShadow.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/ProjectedShadow.azsli index 98ec9ea8bc..5baacf4756 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/ProjectedShadow.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/ProjectedShadow.azsli @@ -274,8 +274,9 @@ float ProjectedShadow::GetThickness() float3(atlasPosition.xy * invAtlasSize, atlasPosition.z), /*LOD=*/0 ).r; - - const float viewSpaceThickness = abs(UnprojectDepth(m_shadowIndex, m_shadowPosition.z) - UnprojectDepth(m_shadowIndex, depthValue)); + + // Denormalized thickness (avoid negative values given by to precission or shrinking offsets) + const float viewSpaceThickness = max(UnprojectDepth(m_shadowIndex, depthValue) - UnprojectDepth(m_shadowIndex, m_shadowPosition.z), 0.0); return viewSpaceThickness; } From 8de5f8b9383b17483b1a0ce88678f6486c1ac5c7 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 9 Dec 2021 11:51:47 +0100 Subject: [PATCH 042/620] Use geometry normals instead of altered-by-maps normals Signed-off-by: Santi Paprika --- .../ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli | 2 +- .../Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli | 2 +- .../Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index d7fa77d701..0b48094bbf 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -34,7 +34,7 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) float3 shrinkedShadowCoords[ViewSrg::MaxCascadeCount]; DirectionalLightShadow::GetShadowCoords( shadowIndex, - surface.position - lightingData.shrinkFactor * surface.normal, + surface.position - lightingData.shrinkFactor * surface.vertexNormal, surface.normal, lightingData.shrinkedShadowCoords); diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli index 7cc5a34453..fbef38595d 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli @@ -95,7 +95,7 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat } else if (o_transmission_mode == TransmissionMode::ThinObject) { - transmissionDistance = ProjectedShadow::GetThickness(light.m_shadowIndex, surface.position - lightingData.shrinkFactor * surface.normal); + transmissionDistance = ProjectedShadow::GetThickness(light.m_shadowIndex, surface.position - lightingData.shrinkFactor * surface.vertexNormal); } } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli index 7f4cd46749..a7b6b822c9 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli @@ -104,7 +104,7 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD } else if (o_transmission_mode == TransmissionMode::ThinObject) { - transmissionDistance = ProjectedShadow::GetThickness(shadowIndex, surface.position - lightingData.shrinkFactor * surface.normal); + transmissionDistance = ProjectedShadow::GetThickness(shadowIndex, surface.position - lightingData.shrinkFactor * surface.vertexNormal); } } From 78aa73e3fd6540ebcb90366dc2c181f757d5c07f Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 9 Dec 2021 18:44:02 +0100 Subject: [PATCH 043/620] Remove thickness + refactor scale parameter influence Signed-off-by: Santi Paprika --- .../Assets/Materials/Types/EnhancedPBR.materialtype | 4 ++-- .../Common/Assets/Materials/Types/Skin.materialtype | 4 ++-- .../ShaderLib/Atom/Features/PBR/BackLighting.azsli | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index a83721f0b1..ef1d2539f6 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -1254,9 +1254,9 @@ "displayName": " Scale", "description": "Strength of transmission", "type": "float", - "defaultValue": 3.0, + "defaultValue": 0.01, "min": 0.0, - "softMax": 100.0 + "softMax": 1.0 } ], "detailLayerGroup": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index 39cbe21a18..33b07bb86b 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -668,9 +668,9 @@ "displayName": " Scale", "description": "Strength of transmission", "type": "float", - "defaultValue": 3.0, + "defaultValue": 0.01, "min": 0.0, - "softMax": 100.0 + "softMax": 1.0 } ], "wrinkleLayers": [ diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index 7c5e4732cd..a550180f9c 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -65,18 +65,18 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI { // Irradiance arround surface point. - // Begin the transmittance dot product slightly before it would with the regular dot(N,L) - float E = max(lightingData.angleOffset + dot(-surface.normal, dirToLight),0.0); + // Increase angle of influence (angle(N,L) -> angle(N,L) + acos(angleOffset)) to smoothen transition regions + float3 E = surface.albedo * max(lightingData.angleOffset + dot(-surface.normal, dirToLight),0.0); - // Transmission distance computed from shadowmaps modulated by editor-exposed parameters - float s = transmissionDistance * surface.transmission.thickness * (100 - transmissionParams.w); + // Transmission distance modulated by editor-exposed scale parameter + float s = transmissionDistance / (transmissionParams.w * transmissionParams.w); // Use scattering color to weight thin object transmission color const float3 invScattering = rcp(transmissionParams.xyz); // Albedo at front (surface point) is used to approximate irradiance at the back of the object // See observation 4 in [Jimenez J. et al, 2010] - result = TransmissionKernel(s, invScattering) * lightIntensity * surface.albedo * E; + result = TransmissionKernel(s, invScattering) * lightIntensity * E; // result = T(s) * lightIntensity * surface.albedo * E; } break; From 90bf2520be0a0c23d34590593e94f0907349b88c Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Fri, 10 Dec 2021 13:57:04 +0100 Subject: [PATCH 044/620] Add and expose distance attenuation to compensate low-res shadow maps Signed-off-by: Santi Paprika --- .../Materials/Types/EnhancedPBR.materialtype | 15 ++++++++++++++- .../Materials/Types/EnhancedPBR_Common.azsli | 1 + .../Materials/Types/EnhancedPBR_ForwardPass.azsl | 3 +++ .../Common/Assets/Materials/Types/Skin.azsl | 3 +++ .../Assets/Materials/Types/Skin.materialtype | 15 ++++++++++++++- .../Assets/Materials/Types/Skin_Common.azsli | 1 + .../Atom/Features/PBR/Lighting/LightingData.azsli | 3 +++ .../Features/PBR/Lights/DirectionalLight.azsli | 10 ++++++++-- .../Atom/Features/PBR/Lights/DiskLight.azsli | 7 ++++++- .../Atom/Features/PBR/Lights/PointLight.azsli | 8 +++++++- 10 files changed, 60 insertions(+), 6 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index ef1d2539f6..31f8bd3c32 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -1239,7 +1239,7 @@ { "name": "angleOffset", "displayName": " Angle Offset", - "description": "Angle to accept below (N . L = 0) in scattering through thin objects", + "description": "cosine of angle to extend below (N . L = 0) in scattering through thin objects", "type": "float", "defaultValue": 0.1, "min": -1.0, @@ -1249,6 +1249,19 @@ "name": "m_angleOffset" } }, + { + "name": "distanceAttenuation", + "displayName": " Distance Attenuation", + "description": "Attenuation applied to hide artifacts due to low-res shadow maps (e.g. objects far to the camera when using directional lights or objects far to the light when using sphere/disk lights", + "type": "float", + "defaultValue": 4.0, + "min": 0.0, + "softMax": 10.0, + "connection": { + "type": "ShaderInput", + "name": "m_distanceAttenuation" + } + }, { "name": "transmissionScale", "displayName": " Scale", diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli index 98f091cb12..7c791e1cd0 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli @@ -102,6 +102,7 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial uint m_transmissionThicknessMapUvIndex; float m_shrinkFactor; float m_angleOffset; + float m_distanceAttenuation; } // Callback function for ParallaxMapping.azsli diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl index bc660979f6..e35941c623 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl @@ -283,6 +283,9 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection lightingData.shrinkFactor = MaterialSrg::m_shrinkFactor; + // Attenuation applied to hide artifacts due to low-res shadow maps + lightingData.distanceAttenuation = MaterialSrg::m_distanceAttenuation; + // ------- Clearcoat ------- // [GFX TODO][ATOM-14603]: Clean up the double uses of these clear coat flags diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl index 4908e736f4..ca02d496c5 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl @@ -349,6 +349,9 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) // Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection lightingData.shrinkFactor = MaterialSrg::m_shrinkFactor; + // Attenuation applied to hide artifacts due to low-res shadow maps + lightingData.distanceAttenuation = MaterialSrg::m_distanceAttenuation; + // ------- Occlusion ------- lightingData.diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_diffuseOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_diffuseOcclusionMapUvIndex], MaterialSrg::m_diffuseOcclusionFactor, o_diffuseOcclusion_useTexture); diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index 33b07bb86b..fa190657c0 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -653,7 +653,7 @@ { "name": "angleOffset", "displayName": " Angle Offset", - "description": "Angle to accept below (N . L = 0) in scattering through thin objects", + "description": "cosine of angle to extend below (N . L = 0) in scattering through thin objects", "type": "float", "defaultValue": 0.1, "min": -1.0, @@ -663,6 +663,19 @@ "name": "m_angleOffset" } }, + { + "name": "distanceAttenuation", + "displayName": " Distance Attenuation", + "description": "Attenuation applied to hide artifacts due to low-res shadow maps (e.g. objects far to the camera when using directional lights or objects far to the light when using sphere/disk lights", + "type": "float", + "defaultValue": 4.0, + "min": 0.0, + "softMax": 10.0, + "connection": { + "type": "ShaderInput", + "name": "m_distanceAttenuation" + } + }, { "name": "transmissionScale", "displayName": " Scale", diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli index 1fa2039c72..2ec1e6e8dc 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli @@ -73,6 +73,7 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial uint m_transmissionThicknessMapUvIndex; float m_shrinkFactor; float m_angleOffset; + float m_distanceAttenuation; Texture2D m_wrinkle_baseColor_texture1; Texture2D m_wrinkle_baseColor_texture2; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli index 8f3bca703e..cc55c4796e 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli @@ -37,6 +37,9 @@ class LightingData // Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection float shrinkFactor; + // Attenuation applied to hide artifacts due to low-res shadow maps + float distanceAttenuation; + // Normalized direction from surface to camera float3 dirToCamera; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index 0b48094bbf..ffac82232f 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -18,7 +18,7 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) // Shadowed check const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; float litRatio = 1.0f; - + float camToSurfDist = distance(ViewSrg::m_worldPosition, surface.position); // Transmission distance inside object float transmissionDistance = 0.0f; @@ -84,7 +84,13 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; lightingData.specularLighting += GetSpecularLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; - lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight, currentTransmissionDistance); + + float3 backLighting = GetBackLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight, currentTransmissionDistance); + + // Attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) + float attenuation = 1.0 / pow(max(1.0, camToSurfDist/2.0), lightingData.distanceAttenuation + 1.0); + + lightingData.translucentBackLighting += backLighting * attenuation; } // Add debug coloring for directional light shadow diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli index fbef38595d..209a6af823 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli @@ -114,8 +114,13 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, posToLightDir) * litRatio; // Transmission contribution - lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, posToLightDir, transmissionDistance); + float3 backLighting = GetBackLighting(surface, lightingData, lightIntensity, posToLightDir, transmissionDistance); + // Attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) + float attenuation = 1.0 / pow(max(1.0, sqrt(distanceToLight2)), lightingData.distanceAttenuation + 1.0); + + lightingData.translucentBackLighting += backLighting * attenuation; + // Adjust the light direction for specular based on disk size // Calculate the reflection off the normal from the view direction diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli index a7b6b822c9..2eb815410d 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli @@ -67,6 +67,7 @@ uint ComputeShadowIndex(const ViewSrg::PointLight light, const Surface surface) void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingData lightingData) { float3 posToLight = light.m_position - surface.position; + float posToLightDist = length(posToLight); float d2 = dot(posToLight, posToLight); // light distance squared float falloff = d2 * light.m_invAttenuationRadiusSquared; @@ -112,7 +113,12 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, normalize(posToLight)) * litRatio; // Transmission contribution - lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), transmissionDistance); + float3 backLighting = GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), transmissionDistance); + + // Attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) + float attenuation = 1.0 / pow(max(1.0, posToLightDist), lightingData.distanceAttenuation + 1.0); + + lightingData.translucentBackLighting += backLighting * attenuation; // Adjust the light direcion for specular based on bulb size From 84829dd8eed1322cb6cc2570709af1e7d1b140b6 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Mon, 13 Dec 2021 10:47:03 +0100 Subject: [PATCH 045/620] Make scale parameter influence output instead of transmission distance Signed-off-by: Santi Paprika --- .../Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index a550180f9c..e729fcb363 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -69,15 +69,17 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI float3 E = surface.albedo * max(lightingData.angleOffset + dot(-surface.normal, dirToLight),0.0); // Transmission distance modulated by editor-exposed scale parameter - float s = transmissionDistance / (transmissionParams.w * transmissionParams.w); + float s = transmissionDistance * 100.0; // Use scattering color to weight thin object transmission color const float3 invScattering = rcp(transmissionParams.xyz); // Albedo at front (surface point) is used to approximate irradiance at the back of the object // See observation 4 in [Jimenez J. et al, 2010] - result = TransmissionKernel(s, invScattering) * lightIntensity * E; - // result = T(s) * lightIntensity * surface.albedo * E; + result = TransmissionKernel(s, invScattering) * lightIntensity * E * transmissionParams.w; + + // Alternative specific to skin translucency + // result = T(s) * lightIntensity * surface.albedo * E * transmissionParams.w; } break; } From c019fe8946269e581683c383966651a81c5f9d38 Mon Sep 17 00:00:00 2001 From: Mike Chang Date: Thu, 2 Dec 2021 17:05:42 -0800 Subject: [PATCH 046/620] Add conditional to pull O3DE_BUILD_VERSION through environment var (#6096) Signed-off-by: Mike Chang --- cmake/Version.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/Version.cmake b/cmake/Version.cmake index de93ebefef..c5504ec62a 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -16,3 +16,8 @@ if("$ENV{O3DE_VERSION}") # Overriding through environment set(LY_VERSION_STRING "$ENV{O3DE_VERSION}") endif() + +if("$ENV{O3DE_BUILD_VERSION}") + # Overriding through environment + set(LY_VERSION_BUILD_NUMBER "$ENV{O3DE_BUILD_VERSION}") +endif() From f44697fbf45b6288d9f2995cd43b2cef4927b9dc Mon Sep 17 00:00:00 2001 From: AMZN-Phil Date: Tue, 7 Dec 2021 14:05:05 -0800 Subject: [PATCH 047/620] Check whether env variables are defined Signed-off-by: AMZN-Phil --- cmake/Version.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Version.cmake b/cmake/Version.cmake index c5504ec62a..6fa32e9c73 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -12,12 +12,12 @@ set(LY_VERSION_STRING "0.0.0.0" CACHE STRING "Open 3D Engine's version") set(LY_VERSION_BUILD_NUMBER 0 CACHE STRING "Open 3D Engine's build number") set(LY_VERSION_ENGINE_NAME "o3de" CACHE STRING "Open 3D Engine's engine name") -if("$ENV{O3DE_VERSION}") +if(DEFINED ENV{O3DE_VERSION}) # Overriding through environment set(LY_VERSION_STRING "$ENV{O3DE_VERSION}") endif() -if("$ENV{O3DE_BUILD_VERSION}") +if(DEFINED ENV{O3DE_BUILD_VERSION}) # Overriding through environment set(LY_VERSION_BUILD_NUMBER "$ENV{O3DE_BUILD_VERSION}") endif() From 38c8d941564ae709a7839a25883807b723fa4657 Mon Sep 17 00:00:00 2001 From: AMZN-Phil Date: Tue, 7 Dec 2021 15:12:11 -0800 Subject: [PATCH 048/620] Use version check to allow for a defined empty string to fail and greater to check build number is a number greater than 0 Signed-off-by: AMZN-Phil --- cmake/Version.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Version.cmake b/cmake/Version.cmake index 6fa32e9c73..d15d5b9f86 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -12,12 +12,12 @@ set(LY_VERSION_STRING "0.0.0.0" CACHE STRING "Open 3D Engine's version") set(LY_VERSION_BUILD_NUMBER 0 CACHE STRING "Open 3D Engine's build number") set(LY_VERSION_ENGINE_NAME "o3de" CACHE STRING "Open 3D Engine's engine name") -if(DEFINED ENV{O3DE_VERSION}) +if("$ENV{O3DE_VERSION}" VERSION_GREATER "0.0.0.0") # Overriding through environment set(LY_VERSION_STRING "$ENV{O3DE_VERSION}") endif() -if(DEFINED ENV{O3DE_BUILD_VERSION}) +if("$ENV{O3DE_BUILD_VERSION}" GREATER 0) # Overriding through environment set(LY_VERSION_BUILD_NUMBER "$ENV{O3DE_BUILD_VERSION}") endif() From 82af1e6870ba7f8e705d5f0559591ce42fa57384 Mon Sep 17 00:00:00 2001 From: AMZN-Phil Date: Tue, 7 Dec 2021 17:10:26 -0800 Subject: [PATCH 049/620] Force a string check on the version numbers Signed-off-by: AMZN-Phil --- cmake/Version.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Version.cmake b/cmake/Version.cmake index d15d5b9f86..876c34f8c4 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -12,12 +12,12 @@ set(LY_VERSION_STRING "0.0.0.0" CACHE STRING "Open 3D Engine's version") set(LY_VERSION_BUILD_NUMBER 0 CACHE STRING "Open 3D Engine's build number") set(LY_VERSION_ENGINE_NAME "o3de" CACHE STRING "Open 3D Engine's engine name") -if("$ENV{O3DE_VERSION}" VERSION_GREATER "0.0.0.0") +if(NOT "$ENV{O3DE_VERSION}" STREQUAL "") # Overriding through environment set(LY_VERSION_STRING "$ENV{O3DE_VERSION}") endif() -if("$ENV{O3DE_BUILD_VERSION}" GREATER 0) +if(NOT "$ENV{O3DE_BUILD_VERSION}" STREQUAL "") # Overriding through environment set(LY_VERSION_BUILD_NUMBER "$ENV{O3DE_BUILD_VERSION}") endif() From a436ea7f9bccd98083318da91b7f877aed117589 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Wed, 15 Dec 2021 22:30:37 -0800 Subject: [PATCH 050/620] BasePbr working Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Materials/Presets/PBR/metal_gold.material | 4 +- .../Presets/PBR/metal_gold_matte.material | 4 +- .../Presets/PBR/metal_gold_polished.material | 4 +- .../Materials/Types/BasePBR.materialtype | 18 --------- .../Materials/Types/BasePBR_ForwardPass.azsl | 13 +++--- .../Materials/Types/BasePBR_ShaderEnable.lua | 40 ------------------- .../Types/StandardPBR_ForwardPass.shader | 1 - 7 files changed, 13 insertions(+), 71 deletions(-) delete mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material index f0fd265726..04aaccada4 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material @@ -1,8 +1,8 @@ { "description": "", - "materialType": "Materials\\Types\\Temp\\BasePBR.materialtype", + "materialType": "Materials\\Types\\BasePBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "propertyLayoutVersion": 0, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material index 53ba190084..80ddede2ec 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material @@ -1,8 +1,8 @@ { "description": "", - "materialType": "Materials\\Types\\Temp\\BasePBR.materialtype", + "materialType": "Materials\\Types\\BasePBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "propertyLayoutVersion": 0, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material index d200bddbc5..b9f34f4717 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material @@ -1,8 +1,8 @@ { "description": "", - "materialType": "Materials/Types/Temp/BasePBR.materialtype", + "materialType": "Materials/Types/BasePBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "propertyLayoutVersion": 0, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype index d4c79a05ef..5765537120 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype @@ -596,24 +596,6 @@ "args": { "file": "StandardPBR_Metallic.lua" } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_HandleOpacityDoubleSided.lua" - } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_HandleOpacityMode.lua" - } - }, - { - "type": "Lua", - "args": { - "file": "BasePBR_ShaderEnable.lua" - } } ], "uvNameMap": { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl index 8c8c9a589d..30a8666183 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl @@ -69,7 +69,7 @@ struct VSOutput VSOutput BasePbr_ForwardPassVS(VSInput IN) { - VSOutput OUT = (VSOutput)0; + VSOutput OUT; float3 worldPosition = mul(ObjectSrg::GetWorldMatrix(), float4(IN.m_position, 1.0)).xyz; @@ -101,7 +101,8 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); } - Surface surface = (Surface)0; + Surface surface; + surface.clearCoat.InitializeToZero(); surface.position = IN.m_worldPosition.xyz; // ------- Normal ------- @@ -139,7 +140,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) // ------- Lighting Data ------- - LightingData lightingData = (LightingData)0; + LightingData lightingData; // Light iterator lightingData.tileIterator.Init(IN.m_position, PassSrg::m_lightListRemapped, PassSrg::m_tileLightData); @@ -173,7 +174,8 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) float alpha = 1.0f; PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); - lightingOutput.m_diffuseColor.w = -1; // Disable subsurface scattering + // Disable subsurface scattering + lightingOutput.m_diffuseColor.w = -1; return lightingOutput; } @@ -183,8 +185,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) ForwardPassOutput BasePbr_ForwardPassPS_EDS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) { ForwardPassOutput OUT; - PbrLightingOutput lightingOutput = (PbrLightingOutput)0; - lightingOutput = ForwardPassPS_Common(IN, isFrontFace); + PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace); #ifdef UNIFIED_FORWARD_OUTPUT OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb; diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua deleted file mode 100644 index 4a5fba58e8..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua +++ /dev/null @@ -1,40 +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 --- --- --- ----------------------------------------------------------------------------------------------------- - -function TryGetShaderByTag(context, shaderTag) - if context:HasShaderWithTag(shaderTag) then - return context:GetShaderByTag(shaderTag) - else - return nil - end -end - -function TrySetShaderEnabled(shader, enabled) - if shader then - shader:SetEnabled(enabled) - end -end - -function Process(context) - - local depthPass = context:GetShaderByTag("DepthPass") - local shadowMap = context:GetShaderByTag("Shadowmap") - local forwardPassEDS = context:GetShaderByTag("ForwardPass_EDS") - - -- Use TryGetShaderByTag because these shaders only exist in BasePBR but this script is also used for EnhancedPBR - local lowEndForwardEDS = TryGetShaderByTag(context, "LowEndForward_EDS") - - depthPass:SetEnabled(true); - shadowMap:SetEnabled(true); - forwardPassEDS:SetEnabled(true); - - TrySetShaderEnabled(lowEndForwardEDS, true) -end diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shader index d8df49f4b0..7c7a19efc9 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shader +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shader @@ -30,7 +30,6 @@ } }, - "CompilerHints" : { "DisableOptimizations" : false }, From a839a8f761869cac43faba90e42e89628ac1e34d Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Thu, 16 Dec 2021 01:13:12 -0800 Subject: [PATCH 051/620] added defines in the shaders to turn off clear coat, transmission and area light types. Allows for thiner surface data and more control over features when authoring bespoke material shaders Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Materials/Types/BasePBR_ForwardPass.azsl | 3 +- .../StandardMultilayerPBR_ForwardPass.azsl | 3 +- .../Atom/Features/PBR/BackLighting.azsli | 7 +- .../Features/PBR/Lighting/BaseLighting.azsli | 83 +++++++++++++++++++ .../Features/PBR/Lighting/LightingData.azsli | 2 + .../PBR/Lighting/StandardLighting.azsli | 2 + .../Atom/Features/PBR/LightingOptions.azsli | 54 +++++++++++- .../Features/PBR/Lights/CapsuleLight.azsli | 7 ++ .../PBR/Lights/DirectionalLight.azsli | 4 + .../Atom/Features/PBR/Lights/DiskLight.azsli | 8 ++ .../Atom/Features/PBR/Lights/Ibl.azsli | 2 + .../PBR/Lights/LightTypesCommon.azsli | 3 - .../Atom/Features/PBR/Lights/Ltc.azsli | 4 + .../Atom/Features/PBR/Lights/PointLight.azsli | 8 ++ .../Features/PBR/Lights/PolygonLight.azsli | 2 + .../Atom/Features/PBR/Lights/QuadLight.azsli | 8 +- .../PBR/Surfaces/ClearCoatSurfaceData.azsli | 4 + .../PBR/Surfaces/StandardSurface.azsli | 7 +- .../Surfaces/TransmissionSurfaceData.azsli | 4 + .../Atom/Features/ShaderQualityOptions.azsli | 17 +++- .../Types/AutoBrick_ForwardPass.azsl | 5 +- .../Types/MinimalPBR_ForwardPass.azsl | 5 +- 22 files changed, 222 insertions(+), 20 deletions(-) create mode 100644 Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/BaseLighting.azsli diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl index 30a8666183..be0fcd7250 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl @@ -21,7 +21,7 @@ #include // Custom Surface & Lighting -#include +#include // Decals #include @@ -102,7 +102,6 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) } Surface surface; - surface.clearCoat.InitializeToZero(); surface.position = IN.m_worldPosition.xyz; // ------- Normal ------- diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl index 8f58c6dd33..bef07f0a00 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl @@ -428,7 +428,6 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float Surface surface; surface.position = IN.m_worldPosition; - surface.transmission.InitializeToZero(); // ------- Combine Normals --------- @@ -523,7 +522,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float ApplyIBL(surface, lightingData); // Finalize Lighting - lightingData.FinalizeLighting(0); + lightingData.FinalizeLighting(); const float alpha = 1.0; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index dfd5522f5c..d33780641d 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -36,6 +36,9 @@ float ThinObjectFalloff(const float3 surfaceNormal, const float3 dirToLight) float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightIntensity, float3 dirToLight, float shadowRatio) { float3 result = float3(0.0, 0.0, 0.0); + +#if ENABLE_TRANSMISSION + float thickness = 0.0; float4 transmissionParams = surface.transmission.transmissionParams; @@ -71,7 +74,9 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI break; } - + +#endif + return result; } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/BaseLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/BaseLighting.azsli new file mode 100644 index 0000000000..8bd645498c --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/BaseLighting.azsli @@ -0,0 +1,83 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#define ENABLE_CLEAR_COAT 0 +#define ENABLE_TRANSMISSION 0 +#define ENABLE_AREA_LIGHT_VALIDATION 0 + +// Include options first +#include + +// Then include custom surface and lighting data types +#include +#include + +#include +#include + +// Then define the Diffuse and Specular lighting functions +float3 GetDiffuseLighting(Surface surface, LightingData lightingData, float3 lightIntensity, float3 dirToLight) +{ + float3 diffuse = DiffuseLambertian(surface.albedo, surface.normal, dirToLight, lightingData.diffuseResponse); + diffuse *= lightIntensity; + return diffuse; +} + +float3 GetSpecularLighting(Surface surface, LightingData lightingData, const float3 lightIntensity, const float3 dirToLight) +{ + float3 specular = SpecularGGX(lightingData.dirToCamera, dirToLight, surface.normal, surface.specularF0, lightingData.NdotV, surface.roughnessA2, lightingData.multiScatterCompensation); + specular *= lightIntensity; + return specular; +} + + +// Then include everything else +#include +#include + + +struct PbrLightingOutput +{ + float4 m_diffuseColor; + float4 m_specularColor; + float4 m_albedo; + float4 m_specularF0; + float4 m_normal; +}; + + +PbrLightingOutput GetPbrLightingOutput(Surface surface, LightingData lightingData, float alpha) +{ + PbrLightingOutput lightingOutput; + + lightingOutput.m_diffuseColor = float4(lightingData.diffuseLighting, alpha); + lightingOutput.m_specularColor = float4(lightingData.specularLighting, 1.0); + + // albedo, specularF0, roughness, and normals for later passes (specular IBL, Diffuse GI, SSR, AO, etc) + lightingOutput.m_specularF0 = float4(surface.specularF0, surface.roughnessLinear); + lightingOutput.m_albedo.rgb = surface.albedo * lightingData.diffuseResponse * lightingData.diffuseAmbientOcclusion; + lightingOutput.m_albedo.a = lightingData.specularOcclusion; + lightingOutput.m_normal.rgb = EncodeNormalSignedOctahedron(surface.normal); + lightingOutput.m_normal.a = o_specularF0_enableMultiScatterCompensation ? 1.0f : 0.0f; + + return lightingOutput; +} + +PbrLightingOutput DebugOutput(float3 color) +{ + PbrLightingOutput output = (PbrLightingOutput)0; + + float3 defaultNormal = float3(0.0f, 0.0f, 1.0f); + + output.m_diffuseColor = float4(color.rgb, 1.0f); + output.m_normal.rgb = EncodeNormalSignedOctahedron(defaultNormal); + + return output; +} diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli index dbc348e54a..721c9e13cc 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli @@ -88,8 +88,10 @@ void LightingData::FinalizeLighting(float3 transmissionTint) FinalizeLighting(); // Transmitted light +#if ENABLE_TRANSMISSION if(o_transmission_mode != TransmissionMode::None) { diffuseLighting += translucentBackLighting * transmissionTint; } +#endif } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/StandardLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/StandardLighting.azsli index 773c86ff0f..ad3c9715d4 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/StandardLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/StandardLighting.azsli @@ -8,6 +8,8 @@ #pragma once +#define ENABLE_TRANSMISSION 0 + // Include options first #include diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/LightingOptions.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/LightingOptions.azsli index f807acc374..35d9bced0d 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/LightingOptions.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/LightingOptions.azsli @@ -8,6 +8,50 @@ #pragma once +// --- Light Defines --- + +#ifndef ENABLE_AREA_LIGHT_VALIDATION +#define ENABLE_AREA_LIGHT_VALIDATION 1 +#endif + +#ifndef ENABLE_AREA_LIGHTS +#define ENABLE_AREA_LIGHTS 1 +#endif + +#ifndef ENABLE_SPHERE_LIGHTS +#define ENABLE_SPHERE_LIGHTS ENABLE_AREA_LIGHTS +#endif + +#ifndef ENABLE_DISK_LIGHTS +#define ENABLE_DISK_LIGHTS ENABLE_AREA_LIGHTS +#endif + +#ifndef ENABLE_CAPSULE_LIGHTS +#define ENABLE_CAPSULE_LIGHTS ENABLE_AREA_LIGHTS +#endif + +#ifndef ENABLE_QUAD_LIGHTS +#define ENABLE_QUAD_LIGHTS ENABLE_AREA_LIGHTS +#endif + +#ifndef ENABLE_POLYGON_LTC_LIGHTS +#define ENABLE_POLYGON_LTC_LIGHTS ENABLE_AREA_LIGHTS +#endif + + +// --- Material defines --- + +#ifndef ENABLE_CLEAR_COAT +#define ENABLE_CLEAR_COAT 1 +#endif + +#ifndef ENABLE_TRANSMISSION +#define ENABLE_TRANSMISSION 1 +#endif + + +// --- Shader Options --- + option bool o_specularF0_enableMultiScatterCompensation = true; option bool o_enableShadows = true; option bool o_enableDirectionalLights = true; @@ -15,8 +59,14 @@ option bool o_enablePunctualLights = true; option bool o_enableAreaLights = true; option bool o_enableIBL = true; option bool o_enableSubsurfaceScattering = false; -option bool o_clearCoat_feature_enabled = false; -option enum class TransmissionMode {None, ThickObject, ThinObject} o_transmission_mode; option bool o_meshUseForwardPassIBLSpecular = false; option bool o_materialUseForwardPassIBLSpecular = false; +option bool o_area_light_validation = false; +#if ENABLE_CLEAR_COAT +option bool o_clearCoat_feature_enabled = false; +#endif + +#if ENABLE_TRANSMISSION +option enum class TransmissionMode {None, ThickObject, ThinObject} o_transmission_mode; +#endif diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli index e6b18df9b5..733ea2dbea 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli @@ -224,14 +224,21 @@ void ApplyCapsuleLights(Surface surface, inout LightingData lightingData) uint currLightIndex = lightingData.tileIterator.GetValue(); lightingData.tileIterator.LoadAdvance(); +#if ENABLE_CAPSULE_LIGHTS + ViewSrg::CapsuleLight light = ViewSrg::m_capsuleLights[currLightIndex]; + + #if ENABLE_AREA_LIGHT_VALIDATION if (o_area_light_validation) { ValidateCapsuleLight(light, surface, lightingData); } else + #endif { ApplyCapsuleLight(light, surface, lightingData); } + +#endif } } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index 1eee53a24f..7cf10f13a3 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -27,10 +27,12 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) surface.vertexNormal, debugInfo); +#if ENABLE_TRANSMISSION if (o_transmission_mode == TransmissionMode::ThickObject) { backShadowRatio = DirectionalLightShadow::GetThickness(shadowIndex, lightingData.shadowCoords); } +#endif } // Add the lighting contribution for each directional light @@ -56,10 +58,12 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) currentLitRatio = (index == shadowIndex) ? litRatio : 1.; currentBackShadowRatio = 1.0 - currentLitRatio; +#if ENABLE_TRANSMISSION if (o_transmission_mode == TransmissionMode::ThickObject) { currentBackShadowRatio = (index == shadowIndex) ? backShadowRatio : 0.; } +#endif } lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli index 63f671f021..79b377c568 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli @@ -90,12 +90,14 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat // Use backShadowRatio to carry thickness from shadow map for thick mode backShadowRatio = 1.0 - litRatio; +#if ENABLE_TRANSMISSION if (o_transmission_mode == TransmissionMode::ThickObject) { backShadowRatio = ProjectedShadow::GetThickness( light.m_shadowIndex, surface.position); } +#endif } if (useConeAngle && dotWithDirection < light.m_cosInnerConeAngle) // in penumbra @@ -209,15 +211,21 @@ void ApplyDiskLights(Surface surface, inout LightingData lightingData) uint currLightIndex = lightingData.tileIterator.GetValue(); lightingData.tileIterator.LoadAdvance(); +#if ENABLE_DISK_LIGHTS + ViewSrg::DiskLight light = ViewSrg::m_diskLights[currLightIndex]; + #if ENABLE_AREA_LIGHT_VALIDATION if (o_area_light_validation) { ValidateDiskLight(light, surface, lightingData); } else + #endif { ApplyDiskLight(light, surface, lightingData); } + +#endif } } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ibl.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ibl.azsli index abc2d3d3bd..e813993794 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ibl.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ibl.azsli @@ -98,6 +98,7 @@ void ApplyIBL(Surface surface, inout LightingData lightingData) float3 iblSpecular = GetIblSpecular(surface.position, surface.normal, surface.specularF0, surface.roughnessLinear, lightingData.dirToCamera, lightingData.brdf); iblSpecular *= lightingData.multiScatterCompensation; +#if ENABLE_CLEAR_COAT if (o_clearCoat_feature_enabled && surface.clearCoat.factor > 0.0f) { float clearCoatNdotV = saturate(dot(surface.clearCoat.normal, lightingData.dirToCamera)); @@ -115,6 +116,7 @@ void ApplyIBL(Surface surface, inout LightingData lightingData) float3 clearCoatResponse = FresnelSchlickWithRoughness(clearCoatNdotV, clearCoatSpecularF0, surface.clearCoat.roughness) * surface.clearCoat.factor; iblSpecular = iblSpecular * (1.0 - clearCoatResponse) * (1.0 - clearCoatResponse) + clearCoatIblSpecular; } +#endif float exposure = ObjectSrg::m_reflectionProbeData.m_useReflectionProbe ? pow(2.0, ObjectSrg::m_reflectionProbeData.m_exposure) : globalIblExposure; lightingData.specularLighting += (iblSpecular * exposure); diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli index f0169e29b8..16adbba280 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli @@ -13,9 +13,6 @@ #include #include -option bool o_area_light_validation = false; - - //! Adjust the intensity of specular light based on the radius of the light source and roughness of the surface to approximate energy conservation. float GetIntensityAdjustedByRadiusAndRoughness(float roughnessA, float radius, float distance2) { diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ltc.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ltc.azsli index 531eb6e885..0f542870a8 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ltc.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ltc.azsli @@ -403,6 +403,7 @@ void LtcQuadEvaluate( float2 schlick = ltcAmpMatrix.Sample(PassSrg::LinearSampler, ltcCoords).xy; float3 specularRgb = specular * (schlick.x * surface.specularF0 + (1.0 - surface.specularF0) * schlick.y); +#if ENABLE_CLEAR_COAT if(o_clearCoat_feature_enabled) { int vertexCountCc = LtcQuadTransformAndClip(surface.clearCoat.normal, lightingData.dirToCamera, p, polygon); @@ -422,6 +423,7 @@ void LtcQuadEvaluate( specularRgb = (specularRgb * (1.0 - F)) + (clearCoatSpecular * F); } } +#endif diffuseOut = diffuse; specularOut = specularRgb; @@ -620,6 +622,7 @@ void LtcPolygonEvaluate( float2 schlick = ltcAmpMatrix.Sample(PassSrg::LinearSampler, ltcCoords).xy; float3 specularRgb = specular * ((schlick.x * surface.specularF0) + (1.0 - surface.specularF0) * schlick.y); +#if ENABLE_CLEAR_COAT if(o_clearCoat_feature_enabled) { // Rotate ltc matrix @@ -660,6 +663,7 @@ void LtcPolygonEvaluate( specularRgb = (specularRgb * (1.0 - F)) + (specularCc * F); } } +#endif diffuseOut = diffuse; specularRgbOut = specularRgb; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli index 92f4065931..883d86af48 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli @@ -99,12 +99,14 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD // Use backShadowRatio to carry thickness from shadow map for thick mode backShadowRatio = 1.0 - litRatio; +#if ENABLE_TRANSMISSION if (o_transmission_mode == TransmissionMode::ThickObject) { backShadowRatio = ProjectedShadow::GetThickness( shadowIndex, surface.position); } +#endif } // Diffuse contribution @@ -177,15 +179,21 @@ void ApplyPointLights(Surface surface, inout LightingData lightingData) uint currLightIndex = lightingData.tileIterator.GetValue(); lightingData.tileIterator.LoadAdvance(); +#if ENABLE_SPHERE_LIGHTS + ViewSrg::PointLight light = ViewSrg::m_pointLights[currLightIndex]; + #if ENABLE_AREA_LIGHT_VALIDATION if (o_area_light_validation) { ValidatePointLight(light, surface, lightingData); } else + #endif { ApplyPointLight(light, surface, lightingData); } + +#endif } } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PolygonLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PolygonLight.azsli index 07fe6d4f00..e4e25e351b 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PolygonLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PolygonLight.azsli @@ -68,10 +68,12 @@ void ApplyPoylgonLight(ViewSrg::PolygonLight light, Surface surface, inout Light void ApplyPolygonLights(Surface surface, inout LightingData lightingData) { +#if ENABLE_POLYGON_LTC_LIGHTS for (uint currLightIndex = 0; currLightIndex < ViewSrg::m_polygonLightCount; ++currLightIndex) { ViewSrg::PolygonLight light = ViewSrg::m_polygonLights[currLightIndex]; ApplyPoylgonLight(light, surface, lightingData); } +#endif } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli index 63515339d8..a705e663c2 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli @@ -245,16 +245,22 @@ void ApplyQuadLights(Surface surface, inout LightingData lightingData) { uint currLightIndex = lightingData.tileIterator.GetValue(); lightingData.tileIterator.LoadAdvance(); - + +#if ENABLE_QUAD_LIGHTS + ViewSrg::QuadLight light = ViewSrg::m_quadLights[currLightIndex]; + #if ENABLE_AREA_LIGHT_VALIDATION if (o_area_light_validation) { ValidateQuadLight(light, surface, lightingData); } else + #endif { ApplyQuadLight(light, surface, lightingData); } + +#endif } } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/ClearCoatSurfaceData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/ClearCoatSurfaceData.azsli index ff8d4c0a25..6e30f55af4 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/ClearCoatSurfaceData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/ClearCoatSurfaceData.azsli @@ -8,6 +8,8 @@ #pragma once +#if ENABLE_CLEAR_COAT + class ClearCoatSurfaceData { float factor; //!< clear coat strength factor @@ -23,3 +25,5 @@ void ClearCoatSurfaceData::InitializeToZero() roughness = 0.0f; normal = float3(0.0f, 0.0f, 0.0f); } + +#endif diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli index 084943bf38..ab43717919 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli @@ -15,8 +15,14 @@ class Surface { + +#if ENABLE_CLEAR_COAT ClearCoatSurfaceData clearCoat; +#endif + +#if ENABLE_TRANSMISSION TransmissionSurfaceData transmission; // This is not actually used for Standard PBR, but must be present for common lighting code to compile +#endif // ------- BasePbrSurfaceData ------- @@ -37,7 +43,6 @@ class Surface //! Sets albedo and specularF0 using metallic workflow void SetAlbedoAndSpecularF0(float3 baseColor, float specularF0Factor, float metallic); - }; // Specular Anti-Aliasing technique from this paper: diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/TransmissionSurfaceData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/TransmissionSurfaceData.azsli index 9b575de3ec..dda62d85e5 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/TransmissionSurfaceData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/TransmissionSurfaceData.azsli @@ -8,6 +8,8 @@ #pragma once +#if ENABLE_TRANSMISSION + class TransmissionSurfaceData { float3 tint; @@ -23,3 +25,5 @@ void TransmissionSurfaceData::InitializeToZero() thickness = 0.0f; transmissionParams = float4(0.0f, 0.0f, 0.0f, 0.0f); } + +#endif diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ShaderQualityOptions.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ShaderQualityOptions.azsli index 32cd30b97e..430e095bf4 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ShaderQualityOptions.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ShaderQualityOptions.azsli @@ -13,10 +13,23 @@ #ifdef QUALITY_LOW_END // Unifies the forward output into a single lighting buffer instead of splitting it into a GBuffer + #ifndef UNIFIED_FORWARD_OUTPUT #define UNIFIED_FORWARD_OUTPUT 1 - + #endif + // Forces IBL lighting to be executed in the forward pass instead of subsequent refleciton passes + #ifndef FORCE_IBL_IN_FORWARD_PASS #define FORCE_IBL_IN_FORWARD_PASS 1 + #endif + + // Forces removal of area light validation code + #ifndef ENABLE_AREA_LIGHT_VALIDATION + #define ENABLE_AREA_LIGHT_VALIDATION 0 + #endif + + // Uncomment to disable all area light calcuation + // #ifndef ENABLE_AREA_LIGHTS + // #define ENABLE_AREA_LIGHTS 0 + // #endif #endif - diff --git a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl index 2dbba46d8b..585c6283c2 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl +++ b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl @@ -179,9 +179,8 @@ ForwardPassOutput AutoBrick_ForwardPassPS(VSOutput IN) const float specularF0Factor = 0.5f; surface.SetAlbedoAndSpecularF0(baseColor, specularF0Factor, metallic); - // Clear Coat, Transmission + // Clear Coat surface.clearCoat.InitializeToZero(); - surface.transmission.InitializeToZero(); // ------- LightingData ------- @@ -213,7 +212,7 @@ ForwardPassOutput AutoBrick_ForwardPassPS(VSOutput IN) ApplyIBL(surface, lightingData); // Finalize Lighting - lightingData.FinalizeLighting(surface.transmission.tint); + lightingData.FinalizeLighting(); PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); diff --git a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl index 2f6f038e4b..b544a26366 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl +++ b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl @@ -71,9 +71,8 @@ ForwardPassOutput MinimalPBR_MainPassPS(VSOutput IN) const float specularF0Factor = 0.5f; surface.SetAlbedoAndSpecularF0(MinimalPBRSrg::m_baseColor, specularF0Factor, MinimalPBRSrg::m_metallic); - // Clear Coat, Transmission + // Clear Coat surface.clearCoat.InitializeToZero(); - surface.transmission.InitializeToZero(); // ------- LightingData ------- @@ -104,7 +103,7 @@ ForwardPassOutput MinimalPBR_MainPassPS(VSOutput IN) ApplyIBL(surface, lightingData); // Finalize Lighting - lightingData.FinalizeLighting(surface.transmission.tint); + lightingData.FinalizeLighting(); PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); From 31714810cc8cc48a4afe370e9390736aa7a8c1d5 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Thu, 16 Dec 2021 09:06:09 -0800 Subject: [PATCH 052/620] updating asset cmake file Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Feature/Common/Assets/atom_feature_common_asset_files.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake index f595202218..2849cf9415 100644 --- a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake +++ b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake @@ -16,7 +16,6 @@ set(FILES Materials/Types/BasePBR_ForwardPass.shader Materials/Types/BasePBR_LowEndForward.azsl Materials/Types/BasePBR_LowEndForward.shader - Materials/Types/BasePBR_ShaderEnable.lua Materials/Types/EnhancedPBR.materialtype Materials/Types/EnhancedPBR_Common.azsli Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl @@ -264,6 +263,7 @@ set(FILES ShaderLib/Atom/Features/PBR/Hammersley.azsli ShaderLib/Atom/Features/PBR/LightingOptions.azsli ShaderLib/Atom/Features/PBR/LightingUtils.azsli + ShaderLib/Atom/Features/PBR/Lighting/BaseLighting.azsli ShaderLib/Atom/Features/PBR/Lighting/DualSpecularLighting.azsli ShaderLib/Atom/Features/PBR/Lighting/EnhancedLighting.azsli ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli From d108fe4804071e1f22612e897021d6653f6bea53 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 16 Dec 2021 18:31:19 -0800 Subject: [PATCH 053/620] Addresses PR comments Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 345 +++++++++--------- .../AzCore/Memory/BestFitExternalMapSchema.h | 2 +- .../AzCore/AzCore/Memory/IAllocator.h | 4 +- Code/Framework/AzCore/AzCore/Memory/Memory.h | 2 +- .../Tests/Memory/AllocatorBenchmarks.cpp | 4 +- 5 files changed, 181 insertions(+), 176 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 4da9ab384f..e877739e29 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -9,11 +9,10 @@ #include #include -using namespace AZ; +// Only used to create recordings of memory operations to use for memory benchmarks +#define O3DE_RECORDING_ENABLED 0 -#define RECORDING_ENABLED 0 - -#if RECORDING_ENABLED +#if O3DE_RECORDING_ENABLED #include #include @@ -25,10 +24,10 @@ namespace class DebugAllocator { public: - typedef void* pointer_type; - typedef AZStd::size_t size_type; - typedef AZStd::ptrdiff_t difference_type; - typedef AZStd::false_type allow_memory_leaks; ///< Regular allocators should not leak. + using pointer_type = void*; + using size_type = AZStd::size_t; + using difference_type = AZStd::ptrdiff_t; + using allow_memory_leaks = AZStd::false_type; ///< Regular allocators should not leak. AZ_FORCE_INLINE pointer_type allocate(size_t byteSize, size_t alignment, int = 0) { @@ -64,7 +63,7 @@ namespace static constexpr size_t s_maxNumberOfAllocationsToRecord = 16384; static size_t s_numberOfAllocationsRecorded = 0; - static constexpr size_t s_allocationOperationCount = 5 * 1024; + static constexpr size_t s_allocationOperationCount = 8 * 1024; static AZStd::array s_operations = {}; static uint64_t s_operationCounter = 0; @@ -76,11 +75,12 @@ namespace void RecordAllocatorOperation(AllocatorOperation::OperationType type, void* ptr, size_t size = 0, size_t alignment = 0) { - AZStd::scoped_lock lock(s_operationsMutex); + AZStd::scoped_lock lock(s_operationsMutex); if (s_operationCounter == s_allocationOperationCount) { AZ::IO::SystemFile file; int mode = AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND | AZ::IO::SystemFile::OpenMode::SF_OPEN_WRITE_ONLY; + // memoryrecordings.bin is being output to the current working directory if (!file.Exists("memoryrecordings.bin")) { mode |= AZ::IO::SystemFile::OpenMode::SF_OPEN_CREATE; @@ -158,188 +158,195 @@ namespace } #endif -AllocatorBase::AllocatorBase(IAllocatorSchema* allocationSchema, const char* name, const char* desc) - : IAllocator(allocationSchema) - , m_name(name) - , m_desc(desc) +namespace AZ { -} - -AllocatorBase::~AllocatorBase() -{ - AZ_Assert(!m_isReady, "Allocator %s (%s) is being destructed without first having gone through proper calls to PreDestroy() and Destroy(). Use AllocatorInstance<> for global allocators or AllocatorWrapper<> for local allocators.", m_name, m_desc); -} - -const char* AllocatorBase::GetName() const -{ - return m_name; -} - -const char* AllocatorBase::GetDescription() const -{ - return m_desc; -} - -Debug::AllocationRecords* AllocatorBase::GetRecords() -{ - return m_records; -} - -void AllocatorBase::SetRecords(Debug::AllocationRecords* records) -{ - m_records = records; - m_memoryGuardSize = records ? records->MemoryGuardSize() : 0; -} - -bool AllocatorBase::IsReady() const -{ - return m_isReady; -} - -void AllocatorBase::PostCreate() -{ - if (m_registrationEnabled) + AllocatorBase::AllocatorBase(IAllocatorSchema* allocationSchema, const char* name, const char* desc) + : IAllocator(allocationSchema) + , m_name(name) + , m_desc(desc) { - if (AZ::Environment::IsReady()) + } + + AllocatorBase::~AllocatorBase() + { + AZ_Assert( + !m_isReady, + "Allocator %s (%s) is being destructed without first having gone through proper calls to PreDestroy() and Destroy(). Use " + "AllocatorInstance<> for global allocators or AllocatorWrapper<> for local allocators.", + m_name, m_desc); + } + + const char* AllocatorBase::GetName() const + { + return m_name; + } + + const char* AllocatorBase::GetDescription() const + { + return m_desc; + } + + Debug::AllocationRecords* AllocatorBase::GetRecords() + { + return m_records; + } + + void AllocatorBase::SetRecords(Debug::AllocationRecords* records) + { + m_records = records; + m_memoryGuardSize = records ? records->MemoryGuardSize() : 0; + } + + bool AllocatorBase::IsReady() const + { + return m_isReady; + } + + void AllocatorBase::PostCreate() + { + if (m_registrationEnabled) { - AllocatorManager::Instance().RegisterAllocator(this); + if (AZ::Environment::IsReady()) + { + AllocatorManager::Instance().RegisterAllocator(this); + } + else + { + AllocatorManager::PreRegisterAllocator(this); + } } - else + + const auto debugConfig = GetDebugConfig(); + if (!debugConfig.m_excludeFromDebugging) { - AllocatorManager::PreRegisterAllocator(this); + SetRecords(aznew Debug::AllocationRecords( + (unsigned char)debugConfig.m_stackRecordLevels, debugConfig.m_usesMemoryGuards, debugConfig.m_marksUnallocatedMemory, + GetName())); } + + m_isReady = true; } - const auto debugConfig = GetDebugConfig(); - if (!debugConfig.m_excludeFromDebugging) + void AllocatorBase::PreDestroy() { - SetRecords(aznew Debug::AllocationRecords((unsigned char)debugConfig.m_stackRecordLevels, debugConfig.m_usesMemoryGuards, debugConfig.m_marksUnallocatedMemory, GetName())); - } - - m_isReady = true; -} - -void AllocatorBase::PreDestroy() -{ - Debug::AllocationRecords* allocatorRecords = GetRecords(); - if(allocatorRecords) - { - delete allocatorRecords; - SetRecords(nullptr); - } - - if (m_registrationEnabled && AZ::AllocatorManager::IsReady()) - { - AllocatorManager::Instance().UnRegisterAllocator(this); - } - - m_isReady = false; -} - -void AllocatorBase::SetLazilyCreated(bool lazy) -{ - m_isLazilyCreated = lazy; -} - -bool AllocatorBase::IsLazilyCreated() const -{ - return m_isLazilyCreated; -} - -void AllocatorBase::SetProfilingActive(bool active) -{ - m_isProfilingActive = active; -} - -bool AllocatorBase::IsProfilingActive() const -{ - return m_isProfilingActive; -} - -void AllocatorBase::DisableRegistration() -{ - m_registrationEnabled = false; -} - -void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) -{ - if (m_isProfilingActive) - { -#if defined(AZ_HAS_VARIADIC_TEMPLATES) && defined(AZ_DEBUG_BUILD) - ++suppressStackRecord; // one more for the fact the ebus is a function -#endif // AZ_HAS_VARIADIC_TEMPLATES - - auto records = GetRecords(); - if (records) + Debug::AllocationRecords* allocatorRecords = GetRecords(); + if (allocatorRecords) { - records->RegisterAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1); + delete allocatorRecords; + SetRecords(nullptr); } + + if (m_registrationEnabled && AZ::AllocatorManager::IsReady()) + { + AllocatorManager::Instance().UnRegisterAllocator(this); + } + + m_isReady = false; } -#if RECORDING_ENABLED - RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, byteSize, alignment); + void AllocatorBase::SetLazilyCreated(bool lazy) + { + m_isLazilyCreated = lazy; + } + + bool AllocatorBase::IsLazilyCreated() const + { + return m_isLazilyCreated; + } + + void AllocatorBase::SetProfilingActive(bool active) + { + m_isProfilingActive = active; + } + + bool AllocatorBase::IsProfilingActive() const + { + return m_isProfilingActive; + } + + void AllocatorBase::DisableRegistration() + { + m_registrationEnabled = false; + } + + void AllocatorBase::ProfileAllocation( + void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) + { + if (m_isProfilingActive) + { + auto records = GetRecords(); + if (records) + { + records->RegisterAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1); + } + } + +#if O3DE_RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, byteSize, alignment); #endif -} + } -void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) -{ - if (m_isProfilingActive) + void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) { - auto records = GetRecords(); - if (records) + if (m_isProfilingActive) { - records->UnregisterAllocation(ptr, byteSize, alignment, info); + auto records = GetRecords(); + if (records) + { + records->UnregisterAllocation(ptr, byteSize, alignment, info); + } } - } -#if RECORDING_ENABLED - RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr, byteSize, alignment); +#if O3DE_RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr, byteSize, alignment); #endif -} - -void AllocatorBase::ProfileReallocationBegin([[maybe_unused]] void* ptr, [[maybe_unused]] size_t newSize) -{ -} - -void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) -{ - if (m_isProfilingActive) - { - Debug::AllocationInfo info; - ProfileDeallocation(ptr, 0, 0, &info); - ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); } -#if RECORDING_ENABLED - RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr); - RecordAllocatorOperation(AllocatorOperation::ALLOCATE, newPtr, newSize, newAlignment); -#endif -} -void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) -{ - ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment); -} - -void AllocatorBase::ProfileResize(void* ptr, size_t newSize) -{ - if (newSize && m_isProfilingActive) + void AllocatorBase::ProfileReallocationBegin([[maybe_unused]] void* ptr, [[maybe_unused]] size_t newSize) { - auto records = GetRecords(); - if (records) + } + + void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) + { + if (m_isProfilingActive) { - records->ResizeAllocation(ptr, newSize); + Debug::AllocationInfo info; + ProfileDeallocation(ptr, 0, 0, &info); + ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); } - } -#if RECORDING_ENABLED - RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, newSize); +#if O3DE_RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr); + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, newPtr, newSize, newAlignment); #endif -} - -bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) -{ - if (AllocatorManager::IsReady() && AllocatorManager::Instance().m_outOfMemoryListener) - { - AllocatorManager::Instance().m_outOfMemoryListener(this, byteSize, alignment, flags, name, fileName, lineNum); - return true; } - return false; -} + + void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) + { + ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment); + } + + void AllocatorBase::ProfileResize(void* ptr, size_t newSize) + { + if (newSize && m_isProfilingActive) + { + auto records = GetRecords(); + if (records) + { + records->ResizeAllocation(ptr, newSize); + } + } +#if O3DE_RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, newSize); +#endif + } + + bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) + { + if (AllocatorManager::IsReady() && AllocatorManager::Instance().m_outOfMemoryListener) + { + AllocatorManager::Instance().m_outOfMemoryListener(this, byteSize, alignment, flags, name, fileName, lineNum); + return true; + } + return false; + } + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h index 63e9027dd2..21ce34eb80 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h @@ -50,7 +50,7 @@ namespace AZ BestFitExternalMapSchema(const Descriptor& desc); - pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; + pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = nullptr, const char* fileName = nullptr, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; size_type Resize(pointer_type ptr, size_type newSize) override; pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override; diff --git a/Code/Framework/AzCore/AzCore/Memory/IAllocator.h b/Code/Framework/AzCore/AzCore/Memory/IAllocator.h index 319175f9ee..4612b27249 100644 --- a/Code/Framework/AzCore/AzCore/Memory/IAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/IAllocator.h @@ -37,9 +37,9 @@ namespace AZ typedef size_t size_type; typedef ptrdiff_t difference_type; - virtual ~IAllocatorSchema() {} + virtual ~IAllocatorSchema() = default; - virtual pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) = 0; + virtual pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = nullptr, const char* fileName = nullptr, int lineNum = 0, unsigned int suppressStackRecord = 0) = 0; virtual void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) = 0; /// Resize an allocated memory block. Returns the new adjusted size (as close as possible or equal to the requested one) or 0 (if you don't support resize at all). virtual size_type Resize(pointer_type ptr, size_type newSize) = 0; diff --git a/Code/Framework/AzCore/AzCore/Memory/Memory.h b/Code/Framework/AzCore/AzCore/Memory/Memory.h index 2ecba6ebff..c87c9cd303 100644 --- a/Code/Framework/AzCore/AzCore/Memory/Memory.h +++ b/Code/Framework/AzCore/AzCore/Memory/Memory.h @@ -735,7 +735,7 @@ namespace AZ typedef typename Allocator::Descriptor Descriptor; // Maintained for backwards compatibility, prefer to use Get() instead. - // Get was previously used to get the the schema, however, that bypases what the allocators are doing. + // Get was previously used to get the the schema, however, that bypasses what the allocators are doing. // If the schema is needed, call Get().GetSchema() AZ_FORCE_INLINE static IAllocator& GetAllocator() { diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 7870749d24..0599038006 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -155,11 +155,9 @@ namespace Benchmark } private: - static size_t s_numAllocatedBytes; + inline static size_t s_numAllocatedBytes = 0; }; - size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; - // Some allocator are not fully declared, those we simply setup from the schema class MallocSchemaAllocator : public AZ::SimpleSchemaAllocator { From 2d45ecb616a504d1fa4135dea04e5adfa19775b4 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 23 Dec 2021 11:33:36 +0100 Subject: [PATCH 054/620] Fix nits (https://github.com/o3de/o3de/pull/6428#discussion_r774251316 , https://github.com/o3de/o3de/pull/6428#discussion_r774252019) Signed-off-by: Santi Paprika --- Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl | 2 +- .../Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl index ca02d496c5..8a041a93f1 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl @@ -136,7 +136,7 @@ VSOutput SkinVS(VSInput IN) } VertexHelper(IN, OUT, worldPosition, false); - + return OUT; } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index e729fcb363..b35e17b160 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -65,7 +65,7 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI { // Irradiance arround surface point. - // Increase angle of influence (angle(N,L) -> angle(N,L) + acos(angleOffset)) to smoothen transition regions + // Increase angle of influence (angle(N,L) -> angle(N,L) + acos(angleOffset)) to smooth transition regions float3 E = surface.albedo * max(lightingData.angleOffset + dot(-surface.normal, dirToLight),0.0); // Transmission distance modulated by editor-exposed scale parameter From c700b95c8d4aed5605b28c901a49a7287725e9cb Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 23 Dec 2021 15:33:00 +0100 Subject: [PATCH 055/620] Avoid mode-specific transmission distance initialization (potential fix for https://github.com/o3de/o3de/pull/6428#discussion_r774259781) Signed-off-by: Santi Paprika --- .../PBR/Lights/DirectionalLight.azsli | 20 +++--- .../Atom/Features/PBR/Lights/DiskLight.azsli | 61 ++++++++++--------- .../Atom/Features/PBR/Lights/PointLight.azsli | 25 ++++---- 3 files changed, 53 insertions(+), 53 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index ffac82232f..d2aeb4b5f8 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -19,7 +19,8 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; float litRatio = 1.0f; float camToSurfDist = distance(ViewSrg::m_worldPosition, surface.position); - // Transmission distance inside object + + // Distance travelled by the light inside the object float transmissionDistance = 0.0f; if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) @@ -69,28 +70,25 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) float currentLitRatio = 1.0f; // Transmission distance from current light inside object (default non-influential values) - // o_transmission_mode == NONE is not taken into account because GetBackLighting already ignores this case - float currentTransmissionDistance = (o_transmission_mode == TransmissionMode::ThickObject) ? 0.0f : 9999.0f; if (o_enableShadows) { bool activeLight = index == shadowIndex; + + // Add contribution only if current directional light is the active one for shadows currentLitRatio = activeLight ? litRatio : 1.; if (activeLight) { - // Transmission distance (add contribution only if current directional light is the active one for shadows) - currentTransmissionDistance = transmissionDistance; + float3 backLighting = GetBackLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight, transmissionDistance); + + // Attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) + float attenuation = 1.0 / pow(max(1.0, camToSurfDist/2.0), lightingData.distanceAttenuation + 1.0); + lightingData.translucentBackLighting += backLighting * attenuation; } } lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; lightingData.specularLighting += GetSpecularLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; - float3 backLighting = GetBackLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight, currentTransmissionDistance); - - // Attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) - float attenuation = 1.0 / pow(max(1.0, camToSurfDist/2.0), lightingData.distanceAttenuation + 1.0); - - lightingData.translucentBackLighting += backLighting * attenuation; } // Add debug coloring for directional light shadow diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli index 209a6af823..9d4e503df6 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli @@ -76,28 +76,6 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat // shadow float litRatio = 1.0; - - // Transmission distance from current light inside object (default non-influential values) - // o_transmission_mode == NONE is not taken into account because GetBackLighting already ignores this case - float transmissionDistance = (o_transmission_mode == TransmissionMode::ThickObject) ? 0.0f : 9999.0f; - if (o_enableShadows) - { - litRatio = ProjectedShadow::GetVisibility( - light.m_shadowIndex, - light.m_position, - surface.position, - -dirToConeTip, - surface.vertexNormal); - - if (o_transmission_mode == TransmissionMode::ThickObject) - { - transmissionDistance = ProjectedShadow::GetThickness(light.m_shadowIndex, surface.position); - } - else if (o_transmission_mode == TransmissionMode::ThinObject) - { - transmissionDistance = ProjectedShadow::GetThickness(light.m_shadowIndex, surface.position - lightingData.shrinkFactor * surface.vertexNormal); - } - } if (useConeAngle && dotWithDirection < light.m_cosInnerConeAngle) // in penumbra { @@ -110,17 +88,40 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat lightIntensity *= penumbraMask; } + if (o_enableShadows) + { + litRatio = ProjectedShadow::GetVisibility( + light.m_shadowIndex, + light.m_position, + surface.position, + -dirToConeTip, + surface.vertexNormal); + + // Distance travelled by the light inside the object + float transmissionDistance = 0.0f; + + // o_transmission_mode == NONE is not taken into account because GetBackLighting already ignores this case + if (o_transmission_mode == TransmissionMode::ThickObject) + { + transmissionDistance = ProjectedShadow::GetThickness(light.m_shadowIndex, surface.position); + } + else if (o_transmission_mode == TransmissionMode::ThinObject) + { + transmissionDistance = ProjectedShadow::GetThickness(light.m_shadowIndex, surface.position - lightingData.shrinkFactor * surface.vertexNormal); + } + + // Attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) + float attenuation = 1.0 / pow(max(1.0, sqrt(distanceToLight2)), lightingData.distanceAttenuation + 1.0); + + // Transmission contribution + float3 backLighting = GetBackLighting(surface, lightingData, lightIntensity, posToLightDir, transmissionDistance); + + lightingData.translucentBackLighting += backLighting * attenuation; + } + // Diffuse contribution lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, posToLightDir) * litRatio; - // Transmission contribution - float3 backLighting = GetBackLighting(surface, lightingData, lightIntensity, posToLightDir, transmissionDistance); - - // Attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) - float attenuation = 1.0 / pow(max(1.0, sqrt(distanceToLight2)), lightingData.distanceAttenuation + 1.0); - - lightingData.translucentBackLighting += backLighting * attenuation; - // Adjust the light direction for specular based on disk size // Calculate the reflection off the normal from the view direction diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli index 2eb815410d..e2297fd3d3 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli @@ -85,9 +85,6 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD // shadow float litRatio = 1.0; - // Transmission distance from current light inside object (default non-influential values) - // o_transmission_mode == NONE is not taken into account because GetBackLighting already ignores this case - float transmissionDistance = (o_transmission_mode == TransmissionMode::ThickObject) ? 0.0f : 9999.0f; if (o_enableShadows) { const float3 lightDir = normalize(light.m_position - surface.position); @@ -99,6 +96,10 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD lightDir, surface.vertexNormal); + // Distance travelled by the light inside the object + float transmissionDistance = 0.0f; + + // o_transmission_mode == NONE is not taken into account because GetBackLighting already ignores this case if (o_transmission_mode == TransmissionMode::ThickObject) { transmissionDistance = ProjectedShadow::GetThickness(shadowIndex, surface.position); @@ -106,20 +107,20 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD else if (o_transmission_mode == TransmissionMode::ThinObject) { transmissionDistance = ProjectedShadow::GetThickness(shadowIndex, surface.position - lightingData.shrinkFactor * surface.vertexNormal); - } + } + + // Transmission contribution + float3 backLighting = GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), transmissionDistance); + + // Attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) + float attenuation = 1.0 / pow(max(1.0, posToLightDist), lightingData.distanceAttenuation + 1.0); + + lightingData.translucentBackLighting += backLighting * attenuation; } // Diffuse contribution lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, normalize(posToLight)) * litRatio; - // Transmission contribution - float3 backLighting = GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), transmissionDistance); - - // Attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) - float attenuation = 1.0 / pow(max(1.0, posToLightDist), lightingData.distanceAttenuation + 1.0); - - lightingData.translucentBackLighting += backLighting * attenuation; - // Adjust the light direcion for specular based on bulb size // Calculate the reflection off the normal from the view direction From 14683bf3eff17aa5c4eeed09fa5237c616cf45db Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 23 Dec 2021 15:47:00 +0100 Subject: [PATCH 056/620] Fix nits (remove residual comment) Signed-off-by: Santi Paprika --- .../ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli | 2 -- 1 file changed, 2 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index d2aeb4b5f8..da4901cf8e 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -69,7 +69,6 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) // Currently shadow check is done only for index == shadowIndex. float currentLitRatio = 1.0f; - // Transmission distance from current light inside object (default non-influential values) if (o_enableShadows) { bool activeLight = index == shadowIndex; @@ -88,7 +87,6 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; lightingData.specularLighting += GetSpecularLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; - } // Add debug coloring for directional light shadow From 038c71a660bedf0c3ddde707e913dbcc4d09db19 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 23 Dec 2021 17:55:27 +0100 Subject: [PATCH 057/620] Move mode-specific behavior into GetBackLighting (improvement on https://github.com/o3de/o3de/pull/6428#discussion_r774259781 and https://github.com/o3de/o3de/pull/6428/commits/c700b95c8d4aed5605b28c901a49a7287725e9cb) Signed-off-by: Santi Paprika --- .../Atom/Features/PBR/BackLighting.azsli | 8 +++++- .../PBR/Lights/DirectionalLight.azsli | 25 ++++++++----------- .../Atom/Features/PBR/Lights/DiskLight.azsli | 17 ++++++------- .../Atom/Features/PBR/Lights/PointLight.azsli | 19 ++++++-------- .../Atom/Features/PBR/Lights/QuadLight.azsli | 11 ++++---- 5 files changed, 39 insertions(+), 41 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index b35e17b160..2f4680bc9d 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -64,11 +64,17 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI // http://www.iryoku.com/translucency/downloads/Real-Time-Realistic-Skin-Translucency.pdf { + // transmissionDistance < 0.0f means shadows are not enabled --> avoid unnecessary computation + if (transmissionDistance < 0.0f) + { + break; + } + // Irradiance arround surface point. // Increase angle of influence (angle(N,L) -> angle(N,L) + acos(angleOffset)) to smooth transition regions float3 E = surface.albedo * max(lightingData.angleOffset + dot(-surface.normal, dirToLight),0.0); - // Transmission distance modulated by editor-exposed scale parameter + // Transmission distance modulated by hardcoded constant (could be exposed as a weight of scattering distance for transmission) float s = transmissionDistance * 100.0; // Use scattering color to weight thin object transmission color diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index da4901cf8e..a34411c332 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -20,8 +20,8 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) float litRatio = 1.0f; float camToSurfDist = distance(ViewSrg::m_worldPosition, surface.position); - // Distance travelled by the light inside the object - float transmissionDistance = 0.0f; + // Distance travelled by the light inside the object. If not redefined, it will take mode-specific null behaviors (see GetBackLighting()) + float transmissionDistance = -1.0f; if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) { @@ -68,22 +68,19 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) // [GFX TODO][ATOM-2012] care of multiple directional light // Currently shadow check is done only for index == shadowIndex. float currentLitRatio = 1.0f; + float currentTransmissionDistance = -1.0f; - if (o_enableShadows) + if (o_enableShadows && index == shadowIndex) { - bool activeLight = index == shadowIndex; - // Add contribution only if current directional light is the active one for shadows - currentLitRatio = activeLight ? litRatio : 1.; - if (activeLight) - { - float3 backLighting = GetBackLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight, transmissionDistance); - - // Attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) - float attenuation = 1.0 / pow(max(1.0, camToSurfDist/2.0), lightingData.distanceAttenuation + 1.0); - lightingData.translucentBackLighting += backLighting * attenuation; - } + currentLitRatio = litRatio; + currentTransmissionDistance = transmissionDistance; } + + // Transmission contribution with attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) + float3 backLighting = GetBackLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight, currentTransmissionDistance); + float attenuation = 1.0 / pow(max(1.0, camToSurfDist/2.0), lightingData.distanceAttenuation + 1.0); + lightingData.translucentBackLighting += backLighting * attenuation; lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; lightingData.specularLighting += GetSpecularLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli index 9d4e503df6..cc0e33ff5b 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli @@ -88,6 +88,9 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat lightIntensity *= penumbraMask; } + // Distance travelled by the light inside the object. If not redefined, it will take mode-specific null behaviors (see GetBackLighting()) + float transmissionDistance = -1.0f; + if (o_enableShadows) { litRatio = ProjectedShadow::GetVisibility( @@ -97,8 +100,6 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat -dirToConeTip, surface.vertexNormal); - // Distance travelled by the light inside the object - float transmissionDistance = 0.0f; // o_transmission_mode == NONE is not taken into account because GetBackLighting already ignores this case if (o_transmission_mode == TransmissionMode::ThickObject) @@ -110,18 +111,16 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat transmissionDistance = ProjectedShadow::GetThickness(light.m_shadowIndex, surface.position - lightingData.shrinkFactor * surface.vertexNormal); } - // Attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) - float attenuation = 1.0 / pow(max(1.0, sqrt(distanceToLight2)), lightingData.distanceAttenuation + 1.0); - - // Transmission contribution - float3 backLighting = GetBackLighting(surface, lightingData, lightIntensity, posToLightDir, transmissionDistance); - - lightingData.translucentBackLighting += backLighting * attenuation; } // Diffuse contribution lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, posToLightDir) * litRatio; + // Transmission contribution with attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) + float3 backLighting = GetBackLighting(surface, lightingData, lightIntensity, posToLightDir, transmissionDistance); + float attenuation = 1.0 / pow(max(1.0, sqrt(distanceToLight2)), lightingData.distanceAttenuation + 1.0); + lightingData.translucentBackLighting += backLighting * attenuation; + // Adjust the light direction for specular based on disk size // Calculate the reflection off the normal from the view direction diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli index e2297fd3d3..664c3693fb 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli @@ -85,6 +85,9 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD // shadow float litRatio = 1.0; + // Distance travelled by the light inside the object. If not redefined, it will take mode-specific null behaviors (see GetBackLighting()) + float transmissionDistance = -1.0f; + if (o_enableShadows) { const float3 lightDir = normalize(light.m_position - surface.position); @@ -95,9 +98,6 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD surface.position, lightDir, surface.vertexNormal); - - // Distance travelled by the light inside the object - float transmissionDistance = 0.0f; // o_transmission_mode == NONE is not taken into account because GetBackLighting already ignores this case if (o_transmission_mode == TransmissionMode::ThickObject) @@ -108,19 +108,16 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD { transmissionDistance = ProjectedShadow::GetThickness(shadowIndex, surface.position - lightingData.shrinkFactor * surface.vertexNormal); } - - // Transmission contribution - float3 backLighting = GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), transmissionDistance); - - // Attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) - float attenuation = 1.0 / pow(max(1.0, posToLightDist), lightingData.distanceAttenuation + 1.0); - - lightingData.translucentBackLighting += backLighting * attenuation; } // Diffuse contribution lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, normalize(posToLight)) * litRatio; + // Transmission contribution with attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) + float3 backLighting = GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), transmissionDistance); + float attenuation = 1.0 / pow(max(1.0, posToLightDist), lightingData.distanceAttenuation + 1.0); + lightingData.translucentBackLighting += backLighting * attenuation; + // Adjust the light direcion for specular based on bulb size // Calculate the reflection off the normal from the view direction diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli index a4ef25572d..b4cdbeb847 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli @@ -148,14 +148,13 @@ void ApplyQuadLight(ViewSrg::QuadLight light, Surface surface, inout LightingDat GetDiffuseLighting(surface, lightingData, intensity, dirToLightCenter) ); - float nullTransmissionDistance = (o_transmission_mode == TransmissionMode::ThickObject) ? 0.0f : 9999.0f; lightingData.translucentBackLighting += ( - GetBackLighting(surface, lightingData, intensity, p0, nullTransmissionDistance) + - GetBackLighting(surface, lightingData, intensity, p1, nullTransmissionDistance) + - GetBackLighting(surface, lightingData, intensity, p2, nullTransmissionDistance) + - GetBackLighting(surface, lightingData, intensity, p3, nullTransmissionDistance) + - GetBackLighting(surface, lightingData, intensity, dirToLightCenter, nullTransmissionDistance) + GetBackLighting(surface, lightingData, intensity, p0, -1.0f) + + GetBackLighting(surface, lightingData, intensity, p1, -1.0f) + + GetBackLighting(surface, lightingData, intensity, p2, -1.0f) + + GetBackLighting(surface, lightingData, intensity, p3, -1.0f) + + GetBackLighting(surface, lightingData, intensity, dirToLightCenter, -1.0f) ); // Calculate specular by choosing a single representative point on the light's surface based on the reflection ray From 6e3ada487e14ab43dae08161b1099ccb099c338b Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 23 Dec 2021 18:21:18 +0100 Subject: [PATCH 058/620] Move penumbra computation back to original place. Signed-off-by: Santi Paprika --- .../Atom/Features/PBR/Lights/DiskLight.azsli | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli index cc0e33ff5b..3acd74ab03 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli @@ -77,16 +77,6 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat // shadow float litRatio = 1.0; - if (useConeAngle && dotWithDirection < light.m_cosInnerConeAngle) // in penumbra - { - // Normalize into 0.0 - 1.0 space. - float penumbraMask = (dotWithDirection - light.m_cosOuterConeAngle) / (light.m_cosInnerConeAngle - light.m_cosOuterConeAngle); - - // Apply smoothstep - penumbraMask = penumbraMask * penumbraMask * (3.0 - 2.0 * penumbraMask); - - lightIntensity *= penumbraMask; - } // Distance travelled by the light inside the object. If not redefined, it will take mode-specific null behaviors (see GetBackLighting()) float transmissionDistance = -1.0f; @@ -110,7 +100,17 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat { transmissionDistance = ProjectedShadow::GetThickness(light.m_shadowIndex, surface.position - lightingData.shrinkFactor * surface.vertexNormal); } + } + if (useConeAngle && dotWithDirection < light.m_cosInnerConeAngle) // in penumbra + { + // Normalize into 0.0 - 1.0 space. + float penumbraMask = (dotWithDirection - light.m_cosOuterConeAngle) / (light.m_cosInnerConeAngle - light.m_cosOuterConeAngle); + + // Apply smoothstep + penumbraMask = penumbraMask * penumbraMask * (3.0 - 2.0 * penumbraMask); + + lightIntensity *= penumbraMask; } // Diffuse contribution From eda405f5f1d3ca785f61ea9ae1f4b9fb3ea54c0a Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 23 Dec 2021 19:49:47 +0100 Subject: [PATCH 059/620] Move attenuation computation into GetBackLighting (https://github.com/o3de/o3de/pull/6428#discussion_r774259148) Signed-off-by: Santi Paprika --- .../ShaderLib/Atom/Features/PBR/BackLighting.azsli | 5 ++++- .../Atom/Features/PBR/Lights/CapsuleLight.azsli | 2 +- .../Atom/Features/PBR/Lights/DirectionalLight.azsli | 6 ++---- .../ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli | 6 ++---- .../Atom/Features/PBR/Lights/LightTypesCommon.azsli | 2 +- .../Atom/Features/PBR/Lights/PointLight.azsli | 6 ++---- .../ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli | 10 +++++----- 7 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index 2f4680bc9d..adb2dea927 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -36,7 +36,7 @@ float3 T(float s) float3(0.078, 0.0, 0.0) * exp(-s*s/7.41); } -float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightIntensity, float3 dirToLight, float transmissionDistance) +float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightIntensity, float3 dirToLight, float transmissionDistance, float attenuationDistance) { float3 result = float3(0.0, 0.0, 0.0); float thickness = 0.0; @@ -86,6 +86,9 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI // Alternative specific to skin translucency // result = T(s) * lightIntensity * surface.albedo * E * transmissionParams.w; + + // Distance attenuation applied to hide artifacts due to low-res projected areas onto shadowmaps (might need some work in the future) + result *= 1.0 / pow(max(1.0, sqrt(attenuationDistance)), lightingData.distanceAttenuation + 1.0); } break; } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli index e6b18df9b5..bb4be45e5a 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli @@ -136,7 +136,7 @@ void ApplyCapsuleLight(ViewSrg::CapsuleLight light, Surface surface, inout Light float3 posToLight = closestIntersectionPoint - surface.position; // Tranmission contribution - lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), 0.0); + lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), -1.0f, 0.0f); // Calculate the offset from the nearest point on the reflection vector to the nearest point on the capsule light float3 posToClosestPointAlongReflection = dot(posToLight, reflectionDir) * reflectionDir; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index a34411c332..e3f3f1135a 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -77,10 +77,8 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) currentTransmissionDistance = transmissionDistance; } - // Transmission contribution with attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) - float3 backLighting = GetBackLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight, currentTransmissionDistance); - float attenuation = 1.0 / pow(max(1.0, camToSurfDist/2.0), lightingData.distanceAttenuation + 1.0); - lightingData.translucentBackLighting += backLighting * attenuation; + // Transmission contribution + lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight, currentTransmissionDistance, camToSurfDist/2.0); lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; lightingData.specularLighting += GetSpecularLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli index 3acd74ab03..a98b99452b 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli @@ -116,10 +116,8 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat // Diffuse contribution lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, posToLightDir) * litRatio; - // Transmission contribution with attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) - float3 backLighting = GetBackLighting(surface, lightingData, lightIntensity, posToLightDir, transmissionDistance); - float attenuation = 1.0 / pow(max(1.0, sqrt(distanceToLight2)), lightingData.distanceAttenuation + 1.0); - lightingData.translucentBackLighting += backLighting * attenuation; + // Transmission contribution + lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, posToLightDir, transmissionDistance, distanceToLight2); // Adjust the light direction for specular based on disk size diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli index f0169e29b8..dee0d63c79 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli @@ -49,6 +49,6 @@ void AddSampleContribution( float3 intensityRgb = float3(intensity, intensity, intensity); diffuseAcc += GetDiffuseLighting(surface, lightingData, intensityRgb, posToLightSampleDir); - translucentAcc += GetBackLighting(surface, lightingData, intensityRgb, posToLightSampleDir, 0.0); + translucentAcc += GetBackLighting(surface, lightingData, intensityRgb, posToLightSampleDir, -1.0f, 0.0f); specularAcc += GetSpecularLighting(surface, lightingData, intensityRgb, posToLightSampleDir); } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli index 664c3693fb..ecec0af004 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli @@ -113,10 +113,8 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD // Diffuse contribution lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, normalize(posToLight)) * litRatio; - // Transmission contribution with attenuation applied to hide artifacts due to low-res shadow maps (might need some work in the future) - float3 backLighting = GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), transmissionDistance); - float attenuation = 1.0 / pow(max(1.0, posToLightDist), lightingData.distanceAttenuation + 1.0); - lightingData.translucentBackLighting += backLighting * attenuation; + // Transmission contribution + lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), transmissionDistance, posToLightDist); // Adjust the light direcion for specular based on bulb size diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli index b4cdbeb847..f5e148f771 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli @@ -150,11 +150,11 @@ void ApplyQuadLight(ViewSrg::QuadLight light, Surface surface, inout LightingDat lightingData.translucentBackLighting += ( - GetBackLighting(surface, lightingData, intensity, p0, -1.0f) + - GetBackLighting(surface, lightingData, intensity, p1, -1.0f) + - GetBackLighting(surface, lightingData, intensity, p2, -1.0f) + - GetBackLighting(surface, lightingData, intensity, p3, -1.0f) + - GetBackLighting(surface, lightingData, intensity, dirToLightCenter, -1.0f) + GetBackLighting(surface, lightingData, intensity, p0, -1.0f, 0.0f) + + GetBackLighting(surface, lightingData, intensity, p1, -1.0f, 0.0f) + + GetBackLighting(surface, lightingData, intensity, p2, -1.0f, 0.0f) + + GetBackLighting(surface, lightingData, intensity, p3, -1.0f, 0.0f) + + GetBackLighting(surface, lightingData, intensity, dirToLightCenter, -1.0f, 0.0f) ); // Calculate specular by choosing a single representative point on the light's surface based on the reflection ray From 46abff309336e54ff19507ef8f32c3a883f2df28 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 23 Dec 2021 20:29:42 +0100 Subject: [PATCH 060/620] Rename 'angleOffset' to 'transmissionNdLBias' (https://github.com/o3de/o3de/pull/6428#discussion_r774253626) Signed-off-by: Santi Paprika --- .../Common/Assets/Materials/Types/EnhancedPBR.materialtype | 6 +++--- .../Common/Assets/Materials/Types/EnhancedPBR_Common.azsli | 2 +- .../Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl | 2 +- Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl | 2 +- .../Feature/Common/Assets/Materials/Types/Skin.materialtype | 6 +++--- .../Feature/Common/Assets/Materials/Types/Skin_Common.azsli | 2 +- .../Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli | 4 ++-- .../ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index 31f8bd3c32..77caf42834 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -1237,8 +1237,8 @@ } }, { - "name": "angleOffset", - "displayName": " Angle Offset", + "name": "transmissionAngleBias", + "displayName": " Angle Bias", "description": "cosine of angle to extend below (N . L = 0) in scattering through thin objects", "type": "float", "defaultValue": 0.1, @@ -1246,7 +1246,7 @@ "softMax": 1.0, "connection": { "type": "ShaderInput", - "name": "m_angleOffset" + "name": "m_transmissionNdLBias" } }, { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli index 7c791e1cd0..c15b49dc7d 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli @@ -101,7 +101,7 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial Texture2D m_transmissionThicknessMap; uint m_transmissionThicknessMapUvIndex; float m_shrinkFactor; - float m_angleOffset; + float m_transmissionNdLBias; float m_distanceAttenuation; } diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl index e35941c623..5e02da679e 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl @@ -278,7 +278,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // ------- Thin Object Light Transmission ------- // Angle offset for subsurface scattering through thin objects - lightingData.angleOffset = MaterialSrg::m_angleOffset; + lightingData.transmissionNdLBias = MaterialSrg::m_transmissionNdLBias; // Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection lightingData.shrinkFactor = MaterialSrg::m_shrinkFactor; diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl index 8a041a93f1..faa16b205a 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl @@ -344,7 +344,7 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) // ------- Thin Object Light Transmission ------- // Angle offset for subsurface scattering through thin objects - lightingData.angleOffset = MaterialSrg::m_angleOffset; + lightingData.transmissionNdLBias = MaterialSrg::m_transmissionNdLBias; // Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection lightingData.shrinkFactor = MaterialSrg::m_shrinkFactor; diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index fa190657c0..d42f62d0ac 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -651,8 +651,8 @@ } }, { - "name": "angleOffset", - "displayName": " Angle Offset", + "name": "transmissionAngleBias", + "displayName": " Angle Bias", "description": "cosine of angle to extend below (N . L = 0) in scattering through thin objects", "type": "float", "defaultValue": 0.1, @@ -660,7 +660,7 @@ "softMax": 1.0, "connection": { "type": "ShaderInput", - "name": "m_angleOffset" + "name": "m_transmissionNdLBias" } }, { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli index 2ec1e6e8dc..630291c260 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli @@ -72,7 +72,7 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial Texture2D m_transmissionThicknessMap; uint m_transmissionThicknessMapUvIndex; float m_shrinkFactor; - float m_angleOffset; + float m_transmissionNdLBias; float m_distanceAttenuation; Texture2D m_wrinkle_baseColor_texture1; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index adb2dea927..0506f08db1 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -71,8 +71,8 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI } // Irradiance arround surface point. - // Increase angle of influence (angle(N,L) -> angle(N,L) + acos(angleOffset)) to smooth transition regions - float3 E = surface.albedo * max(lightingData.angleOffset + dot(-surface.normal, dirToLight),0.0); + // Increase angle of influence (angle(N,L) -> angle(N,L) + acos(transmissionNdLBias)) to smooth transition regions + float3 E = surface.albedo * max(lightingData.transmissionNdLBias + dot(-surface.normal, dirToLight),0.0); // Transmission distance modulated by hardcoded constant (could be exposed as a weight of scattering distance for transmission) float s = transmissionDistance * 100.0; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli index cc55c4796e..7e7af6be96 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli @@ -31,8 +31,8 @@ class LightingData // Direction light shadow coordinates for shrinked positions (used in scattering through thin objects) float3 shrinkedShadowCoords[ViewSrg::MaxCascadeCount]; - // Angle to accept below (N . L = 0) in scattering through thin objects - float angleOffset; + // (N . L) to accept below (N . L = 0) in scattering through thin objects + float transmissionNdLBias; // Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection float shrinkFactor; From 6dbb8e1794f763302226dce41ff91e99b3b7e875 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 23 Dec 2021 21:02:02 +0100 Subject: [PATCH 061/620] Use local shrinked shadow coords (https://github.com/o3de/o3de/pull/6428#discussion_r774255818) Signed-off-by: Santi Paprika --- .../ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli | 3 --- .../ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli index 7e7af6be96..a1278b8126 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli @@ -28,9 +28,6 @@ class LightingData // Direction light shadow coordinates float3 shadowCoords[ViewSrg::MaxCascadeCount]; - // Direction light shadow coordinates for shrinked positions (used in scattering through thin objects) - float3 shrinkedShadowCoords[ViewSrg::MaxCascadeCount]; - // (N . L) to accept below (N . L = 0) in scattering through thin objects float transmissionNdLBias; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index e3f3f1135a..e6de9e57c3 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -37,7 +37,7 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) shadowIndex, surface.position - lightingData.shrinkFactor * surface.vertexNormal, surface.normal, - lightingData.shrinkedShadowCoords); + shrinkedShadowCoords); if (o_transmission_mode == TransmissionMode::ThickObject) { @@ -47,7 +47,7 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) { // Use shrinked positions for thin object transmission to ensure they fall onto the object when querying // the depth from the shadow map - transmissionDistance = DirectionalLightShadow::GetThickness(shadowIndex, lightingData.shrinkedShadowCoords); + transmissionDistance = DirectionalLightShadow::GetThickness(shadowIndex, shrinkedShadowCoords); } } From 60ec8c3cfb5d9a1110a96977bdc3318739b3f1e0 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 23 Dec 2021 21:17:17 +0100 Subject: [PATCH 062/620] Alias shadowCoords memory instead of using local variable (https://github.com/o3de/o3de/pull/6428#discussion_r774255818 cont'd) Signed-off-by: Santi Paprika --- .../Features/PBR/Lights/DirectionalLight.azsli | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index e6de9e57c3..507b226682 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -31,23 +31,21 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) surface.vertexNormal, debugInfo); - // Fetch shadow coords for shrinked world position (used in thin transmission materials) - float3 shrinkedShadowCoords[ViewSrg::MaxCascadeCount]; - DirectionalLightShadow::GetShadowCoords( - shadowIndex, - surface.position - lightingData.shrinkFactor * surface.vertexNormal, - surface.normal, - shrinkedShadowCoords); - if (o_transmission_mode == TransmissionMode::ThickObject) { transmissionDistance = DirectionalLightShadow::GetThickness(shadowIndex, lightingData.shadowCoords); } else if (o_transmission_mode == TransmissionMode::ThinObject) { - // Use shrinked positions for thin object transmission to ensure they fall onto the object when querying + // Fetch and use shrinked positions for thin object transmission to ensure they fall onto the object when querying + DirectionalLightShadow::GetShadowCoords( + shadowIndex, + surface.position - lightingData.shrinkFactor * surface.vertexNormal, + surface.normal, + lightingData.shadowCoords); + // the depth from the shadow map - transmissionDistance = DirectionalLightShadow::GetThickness(shadowIndex, shrinkedShadowCoords); + transmissionDistance = DirectionalLightShadow::GetThickness(shadowIndex, lightingData.shadowCoords); } } From 7052b99671027ceb36174d95e275d935eeb5be42 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Tue, 4 Jan 2022 09:49:15 +0100 Subject: [PATCH 063/620] Add reference for skin-specific profiles (https://github.com/o3de/o3de/pull/6428/files#r776068153) Signed-off-by: Santi Paprika --- .../Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index 0506f08db1..eec90a1da9 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -25,6 +25,7 @@ float3 TransmissionKernel(float t, float3 s) // [specific profile for SKIN (not used ATM, replaced by TransmissionKernel)] // Analytical integation (approximation) of diffusion profile over radius, could be precomputed in a LUT +// From d'Eon and Luebke (https://developer.nvidia.com/gpugems/gpugems3/part-iii-rendering/chapter-14-advanced-techniques-realistic-real-time-skin, section 14.4.7) float3 T(float s) { // dipoles and multipoles are approximated with sums of a small number of Gaussians with variable weights and variances From c814be22fd65eacf47ea11d969acc8994780c2eb Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Tue, 4 Jan 2022 10:34:05 +0100 Subject: [PATCH 064/620] Saturate (NdL + bias) to preserve energy (https://github.com/o3de/o3de/pull/6428#discussion_r774253478, https://github.com/o3de/o3de/pull/6428#discussion_r776069110) Signed-off-by: Santi Paprika --- .../Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index eec90a1da9..dd40b94414 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -73,7 +73,7 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI // Irradiance arround surface point. // Increase angle of influence (angle(N,L) -> angle(N,L) + acos(transmissionNdLBias)) to smooth transition regions - float3 E = surface.albedo * max(lightingData.transmissionNdLBias + dot(-surface.normal, dirToLight),0.0); + float3 E = surface.albedo * saturate(lightingData.transmissionNdLBias + dot(-surface.normal, dirToLight)); // Transmission distance modulated by hardcoded constant (could be exposed as a weight of scattering distance for transmission) float s = transmissionDistance * 100.0; From 69df812941fedec065e23e1965fc646f66a50624 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Tue, 4 Jan 2022 12:23:02 +0100 Subject: [PATCH 065/620] Add explanations for default constant parameters + define as separate const variables (https://github.com/o3de/o3de/pull/6428#discussion_r776073076, https://github.com/o3de/o3de/pull/6428#discussion_r776072881, https://github.com/o3de/o3de/pull/6428#discussion_r776069391) Signed-off-by: Santi Paprika --- .../Atom/Features/PBR/BackLighting.azsli | 5 +++-- .../Features/PBR/Lights/CapsuleLight.azsli | 11 +++++++++-- .../Features/PBR/Lights/DirectionalLight.azsli | 4 +++- .../Atom/Features/PBR/Lights/DiskLight.azsli | 5 +++-- .../Features/PBR/Lights/LightTypesCommon.azsli | 12 +++++++++++- .../Atom/Features/PBR/Lights/PointLight.azsli | 4 +++- .../Atom/Features/PBR/Lights/QuadLight.azsli | 18 +++++++++++++----- 7 files changed, 45 insertions(+), 14 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index dd40b94414..87dd42fd28 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -75,8 +75,9 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI // Increase angle of influence (angle(N,L) -> angle(N,L) + acos(transmissionNdLBias)) to smooth transition regions float3 E = surface.albedo * saturate(lightingData.transmissionNdLBias + dot(-surface.normal, dirToLight)); - // Transmission distance modulated by hardcoded constant (could be exposed as a weight of scattering distance for transmission) - float s = transmissionDistance * 100.0; + // Transmission distance modulated by hardcoded constant C (could be exposed as a weight of scattering distance for transmission) + const float C = 100.0f; + float s = transmissionDistance * C; // Use scattering color to weight thin object transmission color const float3 invScattering = rcp(transmissionParams.xyz); diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli index bb4be45e5a..1921159c03 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli @@ -135,8 +135,15 @@ void ApplyCapsuleLight(ViewSrg::CapsuleLight light, Surface surface, inout Light float3 closestIntersectionPoint = startPoint + closestT * startToEnd; float3 posToLight = closestIntersectionPoint - surface.position; - // Tranmission contribution - lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), -1.0f, 0.0f); + // Transmission contribution + // We cannot compute the actual transmission distance so we want to: + // - If transmission mode is thick object -> use transmission thickness parameter instead + // - If transmission mode is thin object -> ignore back lighting + // To detect and apply this behavior in the GetBackLighting function, we need to use a negative transmissionDistance + const float transmissionDistance = -1.0f; + // If the transmissionDistance is ignored then the attenuation distance (only used on thin objects) does not have any influence + const float attenuationDistance = 0.0f; + lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, normalize(posToLight), transmissionDistance, attenuationDistance); // Calculate the offset from the nearest point on the reflection vector to the nearest point on the capsule light float3 posToClosestPointAlongReflection = dot(posToLight, reflectionDir) * reflectionDir; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index 507b226682..92b90b16ea 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -20,7 +20,9 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) float litRatio = 1.0f; float camToSurfDist = distance(ViewSrg::m_worldPosition, surface.position); - // Distance travelled by the light inside the object. If not redefined, it will take mode-specific null behaviors (see GetBackLighting()) + // Distance travelled by the light inside the object. If not redefined to a non-negative value, it will take the following behavior: + // - If transmission mode is thick object -> use transmission thickness parameter instead + // - If transmission mode is thin object -> ignore back lighting float transmissionDistance = -1.0f; if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli index a98b99452b..4f05caa912 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli @@ -77,8 +77,9 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat // shadow float litRatio = 1.0; - - // Distance travelled by the light inside the object. If not redefined, it will take mode-specific null behaviors (see GetBackLighting()) + // Distance travelled by the light inside the object. If not redefined to a non-negative value, it will take the following behavior: + // - If transmission mode is thick object -> use transmission thickness parameter instead + // - If transmission mode is thin object -> ignore back lighting float transmissionDistance = -1.0f; if (o_enableShadows) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli index dee0d63c79..6718c6f385 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli @@ -49,6 +49,16 @@ void AddSampleContribution( float3 intensityRgb = float3(intensity, intensity, intensity); diffuseAcc += GetDiffuseLighting(surface, lightingData, intensityRgb, posToLightSampleDir); - translucentAcc += GetBackLighting(surface, lightingData, intensityRgb, posToLightSampleDir, -1.0f, 0.0f); + + // Transmission contribution + // We cannot compute the actual transmission distance so we want to: + // - If transmission mode is thick object -> use transmission thickness parameter instead + // - If transmission mode is thin object -> ignore back lighting + // To detect and apply this behavior in the GetBackLighting function, we need to use a negative transmissionDistance + const float transmissionDistance = -1.0f; + // If the transmissionDistance is ignored then the attenuation distance (only used on thin objects) does not have any influence + const float attenuationDistance = 0.0f; + translucentAcc += GetBackLighting(surface, lightingData, intensityRgb, posToLightSampleDir, transmissionDistance, attenuationDistance); + specularAcc += GetSpecularLighting(surface, lightingData, intensityRgb, posToLightSampleDir); } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli index ecec0af004..02ae82d0f9 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli @@ -85,7 +85,9 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD // shadow float litRatio = 1.0; - // Distance travelled by the light inside the object. If not redefined, it will take mode-specific null behaviors (see GetBackLighting()) + // Distance travelled by the light inside the object. If not redefined to a non-negative value, it will take the following behavior: + // - If transmission mode is thick object -> use transmission thickness parameter instead + // - If transmission mode is thin object -> ignore back lighting float transmissionDistance = -1.0f; if (o_enableShadows) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli index f5e148f771..e6ac886fb6 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli @@ -148,13 +148,21 @@ void ApplyQuadLight(ViewSrg::QuadLight light, Surface surface, inout LightingDat GetDiffuseLighting(surface, lightingData, intensity, dirToLightCenter) ); + // Transmission contribution + // We cannot compute the actual transmission distance so we want to: + // - If transmission mode is thick object -> use transmission thickness parameter instead + // - If transmission mode is thin object -> ignore back lighting + // To detect and apply this behavior in the GetBackLighting function, we need to use a negative transmissionDistance + const float transmissionDistance = -1.0f; + // If the transmissionDistance is ignored then the attenuation distance (only used on thin objects) does not have any influence + const float attenuationDistance = 0.0f; lightingData.translucentBackLighting += ( - GetBackLighting(surface, lightingData, intensity, p0, -1.0f, 0.0f) + - GetBackLighting(surface, lightingData, intensity, p1, -1.0f, 0.0f) + - GetBackLighting(surface, lightingData, intensity, p2, -1.0f, 0.0f) + - GetBackLighting(surface, lightingData, intensity, p3, -1.0f, 0.0f) + - GetBackLighting(surface, lightingData, intensity, dirToLightCenter, -1.0f, 0.0f) + GetBackLighting(surface, lightingData, intensity, p0, transmissionDistance, attenuationDistance) + + GetBackLighting(surface, lightingData, intensity, p1, transmissionDistance, attenuationDistance) + + GetBackLighting(surface, lightingData, intensity, p2, transmissionDistance, attenuationDistance) + + GetBackLighting(surface, lightingData, intensity, p3, transmissionDistance, attenuationDistance) + + GetBackLighting(surface, lightingData, intensity, dirToLightCenter, transmissionDistance, attenuationDistance) ); // Calculate specular by choosing a single representative point on the light's surface based on the reflection ray From 41e8e5dc89ccf7ce6ca710e07653074c6c64d39b Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Tue, 4 Jan 2022 12:37:20 +0100 Subject: [PATCH 066/620] Add nit empty space Signed-off-by: Santi Paprika --- .../ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index 92b90b16ea..81fd8deb74 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -32,7 +32,7 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) lightingData.shadowCoords, surface.vertexNormal, debugInfo); - + if (o_transmission_mode == TransmissionMode::ThickObject) { transmissionDistance = DirectionalLightShadow::GetThickness(shadowIndex, lightingData.shadowCoords); From 0bae6d062fe65390d371d059e843ed9ec47caa99 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Tue, 4 Jan 2022 14:58:49 +0100 Subject: [PATCH 067/620] Remove pows and sqrts from attenuation computation + readjust attenuation parameter bounds (https://github.com/o3de/o3de/pull/6428#discussion_r776071926, https://github.com/o3de/o3de/pull/6428#discussion_r776066792) Signed-off-by: Santi Paprika --- .../Common/Assets/Materials/Types/EnhancedPBR.materialtype | 4 ++-- .../Feature/Common/Assets/Materials/Types/Skin.materialtype | 4 ++-- .../Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index 77caf42834..f1d8952bb2 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -1254,9 +1254,9 @@ "displayName": " Distance Attenuation", "description": "Attenuation applied to hide artifacts due to low-res shadow maps (e.g. objects far to the camera when using directional lights or objects far to the light when using sphere/disk lights", "type": "float", - "defaultValue": 4.0, + "defaultValue": 0.5, "min": 0.0, - "softMax": 10.0, + "softMax": 4.0, "connection": { "type": "ShaderInput", "name": "m_distanceAttenuation" diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index d42f62d0ac..59d8be914e 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -668,9 +668,9 @@ "displayName": " Distance Attenuation", "description": "Attenuation applied to hide artifacts due to low-res shadow maps (e.g. objects far to the camera when using directional lights or objects far to the light when using sphere/disk lights", "type": "float", - "defaultValue": 4.0, + "defaultValue": 0.5, "min": 0.0, - "softMax": 10.0, + "softMax": 4.0, "connection": { "type": "ShaderInput", "name": "m_distanceAttenuation" diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index 87dd42fd28..47ec914815 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -90,7 +90,7 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI // result = T(s) * lightIntensity * surface.albedo * E * transmissionParams.w; // Distance attenuation applied to hide artifacts due to low-res projected areas onto shadowmaps (might need some work in the future) - result *= 1.0 / pow(max(1.0, sqrt(attenuationDistance)), lightingData.distanceAttenuation + 1.0); + result /= max(1.0, attenuationDistance * attenuationDistance * lightingData.distanceAttenuation); } break; } From 6643b4b53cb209e57904c5ff6b51e08d481c98eb Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Mon, 6 Dec 2021 08:48:24 +0800 Subject: [PATCH 068/620] Fix: LOD stops animation Signed-off-by: T.J. McGrath-Daly --- .../SkinnedMeshFeatureProcessor.cpp | 65 ++++++++++++------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp index 37b18291dc..8cd20b77d5 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp @@ -204,35 +204,56 @@ namespace AZ // do the enumeration for each view, keep track of the lowest lod for each entry, // and submit the appropriate dispatch item - //the [1][1] element of a perspective projection matrix stores cot(FovY/2) (equal to 2*nearPlaneDistance/nearPlaneHeight), - //which is used to determine the (vertical) projected size in screen space - const float yScale = viewToClip.GetElement(1, 1); - const bool isPerspective = viewToClip.GetElement(3, 3) == 0.f; - const Vector3 cameraPos = view->GetViewToWorldMatrix().GetTranslation(); - - const Vector3 pos = cullable.m_cullData.m_boundingSphere.GetCenter(); - - const float approxScreenPercentage = RPI::ModelLodUtils::ApproxScreenPercentage( - pos, cullable.m_lodData.m_lodSelectionRadius, cameraPos, yScale, isPerspective); - - for (size_t lodIndex = 0; lodIndex < cullable.m_lodData.m_lods.size(); ++lodIndex) + switch (cullable.m_lodData.m_lodConfiguration.m_lodType) { - const RPI::Cullable::LodData::Lod& lod = cullable.m_lodData.m_lods[lodIndex]; - - //Note that this supports overlapping lod ranges (to support cross-fading lods, for example) - if (approxScreenPercentage >= lod.m_screenCoverageMin && approxScreenPercentage <= lod.m_screenCoverageMax) + case RPI::Cullable::LodType::SpecificLod: + { + AZStd::lock_guard lock(m_dispatchItemMutex); + auto lodIndex = cullable.m_lodData.m_lodConfiguration.m_lodOverride; + m_skinningDispatches.insert(&renderProxy.m_dispatchItemsByLod[lodIndex]->GetRHIDispatchItem()); + for (size_t morphTargetIndex = 0; morphTargetIndex < renderProxy.m_morphTargetDispatchItemsByLod[lodIndex].size(); morphTargetIndex++) { - AZStd::lock_guard lock(m_dispatchItemMutex); - m_skinningDispatches.insert(&renderProxy.m_dispatchItemsByLod[lodIndex]->GetRHIDispatchItem()); - for (size_t morphTargetIndex = 0; morphTargetIndex < renderProxy.m_morphTargetDispatchItemsByLod[lodIndex].size(); morphTargetIndex++) + const MorphTargetDispatchItem* dispatchItem = renderProxy.m_morphTargetDispatchItemsByLod[lodIndex][morphTargetIndex].get(); + if (dispatchItem && dispatchItem->GetWeight() > AZ::Constants::FloatEpsilon) { - const MorphTargetDispatchItem* dispatchItem = renderProxy.m_morphTargetDispatchItemsByLod[lodIndex][morphTargetIndex].get(); - if (dispatchItem && dispatchItem->GetWeight() > AZ::Constants::FloatEpsilon) + m_morphTargetDispatches.insert(&dispatchItem->GetRHIDispatchItem()); + } + } + } + break; + case RPI::Cullable::LodType::ScreenCoverage: + default: + //the [1][1] element of a perspective projection matrix stores cot(FovY/2) (equal to 2*nearPlaneDistance/nearPlaneHeight), + //which is used to determine the (vertical) projected size in screen space + const float yScale = viewToClip.GetElement(1, 1); + const bool isPerspective = viewToClip.GetElement(3, 3) == 0.f; + const Vector3 cameraPos = view->GetViewToWorldMatrix().GetTranslation(); + + const Vector3 pos = cullable.m_cullData.m_boundingSphere.GetCenter(); + + const float approxScreenPercentage = RPI::ModelLodUtils::ApproxScreenPercentage( + pos, cullable.m_lodData.m_lodSelectionRadius, cameraPos, yScale, isPerspective); + + for (size_t lodIndex = 0; lodIndex < cullable.m_lodData.m_lods.size(); ++lodIndex) + { + const RPI::Cullable::LodData::Lod& lod = cullable.m_lodData.m_lods[lodIndex]; + + //Note that this supports overlapping lod ranges (to support cross-fading lods, for example) + if (approxScreenPercentage >= lod.m_screenCoverageMin && approxScreenPercentage <= lod.m_screenCoverageMax) + { + AZStd::lock_guard lock(m_dispatchItemMutex); + m_skinningDispatches.insert(&renderProxy.m_dispatchItemsByLod[lodIndex]->GetRHIDispatchItem()); + for (size_t morphTargetIndex = 0; morphTargetIndex < renderProxy.m_morphTargetDispatchItemsByLod[lodIndex].size(); morphTargetIndex++) { - m_morphTargetDispatches.insert(&dispatchItem->GetRHIDispatchItem()); + const MorphTargetDispatchItem* dispatchItem = renderProxy.m_morphTargetDispatchItemsByLod[lodIndex][morphTargetIndex].get(); + if (dispatchItem && dispatchItem->GetWeight() > AZ::Constants::FloatEpsilon) + { + m_morphTargetDispatches.insert(&dispatchItem->GetRHIDispatchItem()); + } } } } + break; } } } From c580499b6fd5e4a7e5c91390677fe9e656adbe17 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Wed, 5 Jan 2022 09:03:35 +0100 Subject: [PATCH 069/620] Fix nit typo in comment Signed-off-by: Santi Paprika --- .../ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli index 5405d2e914..d6fdc012b4 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli @@ -155,7 +155,7 @@ float DirectionalLightShadow::GetThickness(uint lightIndex, float3 shadowCoords[ { const float depthBufferValue = shadowmap.Sample(PassSrg::LinearSampler, float3(shadowCoord.xy, indexOfCascade)).r; - // Normalized thickness (avoid negative values given by to precission or shrinking offsets) + // Normalized thickness (avoid negative values given by precission errors or shrinking offsets) const float deltaDepth = max(shadowCoord.z - depthBufferValue,0.0); const float viewSpaceThickness = ViewSrg::m_directionalLightShadows[lightIndex].m_far_minus_near * deltaDepth; From 8770118b904f73ad27d0a5ceb71c067e4f5ecb9b Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Wed, 5 Jan 2022 09:06:06 +0100 Subject: [PATCH 070/620] Fix nit typo in comment v2 Signed-off-by: Santi Paprika --- .../ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli index d6fdc012b4..f59b3cf5c8 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli @@ -155,7 +155,7 @@ float DirectionalLightShadow::GetThickness(uint lightIndex, float3 shadowCoords[ { const float depthBufferValue = shadowmap.Sample(PassSrg::LinearSampler, float3(shadowCoord.xy, indexOfCascade)).r; - // Normalized thickness (avoid negative values given by precission errors or shrinking offsets) + // Normalized thickness (avoid negative values given by precision errors or shrinking offsets) const float deltaDepth = max(shadowCoord.z - depthBufferValue,0.0); const float viewSpaceThickness = ViewSrg::m_directionalLightShadows[lightIndex].m_far_minus_near * deltaDepth; From af6af93dffe2764ccf5160436e64931775cc18ce Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:23:32 -0800 Subject: [PATCH 071/620] Fixes Linux builds Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp | 4 ++-- Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp index 9561d1019c..5029e6349f 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp @@ -133,13 +133,13 @@ namespace AZ BestFitExternalMapSchema::size_type BestFitExternalMapSchema::Resize(pointer_type, size_type) { - AZ_Assert(false, AZ_FUNCTION_SIGNATURE " unsupported"); + AZ_Assert(false, "%s unsupported", AZ_FUNCTION_SIGNATURE); return 0; } BestFitExternalMapSchema::pointer_type BestFitExternalMapSchema::ReAllocate(pointer_type, size_type, size_type) { - AZ_Assert(false, AZ_FUNCTION_SIGNATURE " unsupported"); + AZ_Assert(false, "%s unsupported", AZ_FUNCTION_SIGNATURE); return nullptr; } diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 0599038006..e027b03a49 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include From 7af3bef84c7170b0d91f812a30a476ffb37a4107 Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Fri, 15 Oct 2021 15:15:26 +0800 Subject: [PATCH 072/620] Model drag causes crash Signed-off-by: T.J. McGrath-Daly --- Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp index 861271fdb3..0c05da6981 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp @@ -434,6 +434,17 @@ namespace EMotionFX m_morphSetups.resize(numLODs); AZStd::fill(begin(m_morphSetups), AZStd::next(begin(m_morphSetups), numLODs), nullptr); } + else + { + if (m_morphSetups.size() < numLODs) + { + AZ::u32 num = m_morphSetups.empty() ? 0 : (AZ::u32)m_morphSetups.size(); + for (AZ::u32 i = num; i < numLODs; ++i) + { + m_morphSetups.push_back(nullptr); + } + } + } } // removes all node meshes and stacks From 5231cb9b53b86d442effdbbfd46292b3f20732d5 Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Fri, 15 Oct 2021 10:58:31 +0800 Subject: [PATCH 073/620] Shortcut keys issue Signed-off-by: T.J. McGrath-Daly --- .../Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp index b75fb71060..952b3134b6 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp @@ -532,7 +532,7 @@ namespace EMStudio QAction* characterLayoutAction = new QAction( "Character", this); - characterLayoutAction->setShortcut(Qt::Key_1 | Qt::AltModifier); + characterLayoutAction->setShortcut(Qt::Key_3 | Qt::AltModifier); m_shortcutManager->RegisterKeyboardShortcut(characterLayoutAction, layoutGroupName, false); connect(characterLayoutAction, &QAction::triggered, [this]{ m_applicationMode->setCurrentIndex(2); }); addAction(characterLayoutAction); From 90f710b8c2564547293487a53af0b474572a8481 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Sun, 31 Oct 2021 09:48:06 -0700 Subject: [PATCH 074/620] feat: add cursor wrapped mode Signed-off-by: Michael Pollind --- Code/Editor/EditorViewportSettings.cpp | 11 ++ Code/Editor/EditorViewportSettings.h | 3 + .../test_ModularViewportCameraController.cpp | 4 +- .../Input/QtEventToAzInputMapper.cpp | 109 ++++++++++++++---- .../Input/QtEventToAzInputMapper.h | 19 ++- .../Source/Viewport/RenderViewportWidget.cpp | 4 +- 6 files changed, 122 insertions(+), 28 deletions(-) diff --git a/Code/Editor/EditorViewportSettings.cpp b/Code/Editor/EditorViewportSettings.cpp index e06b9696e1..5711d1c3d3 100644 --- a/Code/Editor/EditorViewportSettings.cpp +++ b/Code/Editor/EditorViewportSettings.cpp @@ -23,6 +23,7 @@ namespace SandboxEditor constexpr AZStd::string_view AngleSizeSetting = "/Amazon/Preferences/Editor/AngleSize"; constexpr AZStd::string_view ShowGridSetting = "/Amazon/Preferences/Editor/ShowGrid"; constexpr AZStd::string_view StickySelectSetting = "/Amazon/Preferences/Editor/StickySelect"; + constexpr AZStd::string_view ManipulatorMouseWrapSetting = "/Amazon/Preferences/Editor/Manipulator/MouseWrapping"; constexpr AZStd::string_view ManipulatorLineBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/LineBoundWidth"; constexpr AZStd::string_view ManipulatorCircleBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/CircleBoundWidth"; constexpr AZStd::string_view CameraTranslateSpeedSetting = "/Amazon/Preferences/Editor/Camera/TranslateSpeed"; @@ -186,6 +187,16 @@ namespace SandboxEditor AzToolsFramework::SetRegistry(ManipulatorLineBoundWidthSetting, lineBoundWidth); } + bool ManipulatorMouseWrap() + { + return aznumeric_cast(GetRegistry(ManipulatorMouseWrapSetting, false)); + } + + void SetManipulatorMouseWrap(bool wrapping) + { + SetRegistry(ManipulatorMouseWrapSetting, wrapping); + } + float ManipulatorCircleBoundWidth() { return aznumeric_cast(AzToolsFramework::GetRegistry(ManipulatorCircleBoundWidthSetting, 0.1)); diff --git a/Code/Editor/EditorViewportSettings.h b/Code/Editor/EditorViewportSettings.h index fe1253ed0c..975feff307 100644 --- a/Code/Editor/EditorViewportSettings.h +++ b/Code/Editor/EditorViewportSettings.h @@ -57,6 +57,9 @@ namespace SandboxEditor SANDBOX_API float ManipulatorLineBoundWidth(); SANDBOX_API void SetManipulatorLineBoundWidth(float lineBoundWidth); + SANDBOX_API bool ManipulatorMouseWrap(); + SANDBOX_API void SetManipulatorMouseWrap(bool wrapping); + SANDBOX_API float ManipulatorCircleBoundWidth(); SANDBOX_API void SetManipulatorCircleBoundWidth(float circleBoundWidth); diff --git a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp index 67d89ad967..f2ee3c79aa 100644 --- a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp +++ b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp @@ -47,12 +47,12 @@ namespace UnitTest void ViewportMouseCursorRequestImpl::BeginCursorCapture() { - m_inputChannelMapper->SetCursorCaptureEnabled(true); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_CAPTURED); } void ViewportMouseCursorRequestImpl::EndCursorCapture() { - m_inputChannelMapper->SetCursorCaptureEnabled(false); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_NONE); } bool ViewportMouseCursorRequestImpl::IsMouseOver() const diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp index 066bdc1654..0b6df58c1a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp @@ -241,22 +241,39 @@ namespace AzToolsFramework } } + + void QtEventToAzInputMapper::SetCursorMode(QtEventToAzInputMapper::CursorInputMode mode) + { + if(mode != m_cursorMode) + { + m_cursorMode = mode; + switch(m_cursorMode) + { + case CURSOR_MODE_CAPTURED: + qApp->setOverrideCursor(Qt::BlankCursor); + m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::ConstrainedAndHidden); + break; + case CURSOR_MODE_WRAPPED: + qApp->restoreOverrideCursor(); + m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); + break; + case CURSOR_MODE_NONE: + qApp->restoreOverrideCursor(); + m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); + break; + } + } + } + void QtEventToAzInputMapper::SetCursorCaptureEnabled(bool enabled) { - if (m_capturingCursor != enabled) + if (enabled) { - m_capturingCursor = enabled; - - if (m_capturingCursor) - { - m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::ConstrainedAndHidden); - qApp->setOverrideCursor(Qt::BlankCursor); - } - else - { - m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); - qApp->restoreOverrideCursor(); - } + SetCursorMode(CURSOR_MODE_CAPTURED); + } + else + { + SetCursorMode(CURSOR_MODE_NONE); } } @@ -436,25 +453,73 @@ namespace AzToolsFramework return QPoint{ denormalizedX, denormalizedY }; } + void wrapCursorX(const QRect& rect, QPoint& point) { + if (rect.left() < point.x()) + { + point.setX(rect.right() - 1); + } + else if (rect.right() > point.x()) + { + point.setX(rect.left() + 1); + } + } + + void wrapCursorY(const QRect& rect, QPoint& point) { + if (rect.top() < point.y()) + { + point.setY(rect.bottom() - 1); + } + else if (rect.bottom() > point.y()) + { + point.setY(rect.top() + 1); + } + } + + void QtEventToAzInputMapper::HandleMouseMoveEvent(const QPoint& globalCursorPosition) { const QPoint cursorDelta = globalCursorPosition - m_previousGlobalCursorPosition; + QScreen* screen = m_sourceWidget->screen(); + const QRect widgetRect(m_sourceWidget->mapToGlobal(QPoint(0,0)), m_sourceWidget->size()); m_mouseDevice->m_cursorPositionData2D->m_normalizedPosition = WidgetPositionToNormalizedPosition(m_sourceWidget->mapFromGlobal(globalCursorPosition)); m_mouseDevice->m_cursorPositionData2D->m_normalizedPositionDelta = WidgetPositionToNormalizedPosition(cursorDelta); - ProcessPendingMouseEvents(cursorDelta); + switch(m_cursorMode) + { + case CURSOR_MODE_CAPTURED: + AzQtComponents::SetCursorPos(m_previousGlobalCursorPosition); + break; + case CURSOR_MODE_WRAPPED_X: + QPoint screenPos(globalCursorPosition); + wrapCursorX(widgetRect, screenPos); + QCursor::setPos(screen, screenPos); + QPoint screenDelta = globalCursorPosition - screenPos; + m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; + break; + case CURSOR_MODE_WRAPPED_Y: + QPoint screenPos(globalCursorPosition); + wrapCursorY(widgetRect, screenPos); + QCursor::setPos(screen, screenPos); + QPoint screenDelta = globalCursorPosition - screenPos; + m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; + break; + case CURSOR_MODE_WRAPPED: + QPoint screenPos(globalCursorPosition); + wrapCursorX(widgetRect, screenPos); + wrapCursorY(widgetRect, screenPos); + QCursor::setPos(screen, screenPos); + QPoint screenDelta = globalCursorPosition - screenPos; + m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; + break; + default: + m_previousGlobalCursorPosition = globalCursorPosition; + break; + - if (m_capturingCursor) - { - // Reset our cursor position to the previous point - AzQtComponents::SetCursorPos(m_previousGlobalCursorPosition); - } - else - { - m_previousGlobalCursorPosition = globalCursorPosition; } + ProcessPendingMouseEvents(cursorDelta); } void QtEventToAzInputMapper::HandleKeyEvent(QKeyEvent* keyEvent) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h index 373945d445..7ba4e21bd4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h @@ -41,6 +41,17 @@ namespace AzToolsFramework Q_OBJECT public: + enum CursorInputMode { + CURSOR_MODE_NONE, + CURSOR_MODE_CAPTURED, //< Sets whether or not the cursor should be constrained to the source widget and invisible. + //< Internally, this will reset the cursor position after each move event to ensure movement + //< events don't allow the cursor to escape. This can be used for typical camera controls + //< like a dolly or rotation, where mouse movement is important but cursor location is not. + CURSOR_MODE_WRAPPED, //< Flags whether the curser is going to wrap around the soruce widget. + CURSOR_MODE_WRAPPED_X, + CURSOR_MODE_WRAPPED_Y + }; + QtEventToAzInputMapper(QWidget* sourceWidget, int syntheticDeviceId = 0); ~QtEventToAzInputMapper() = default; @@ -56,8 +67,12 @@ namespace AzToolsFramework //! Internally, this will reset the cursor position after each move event to ensure movement //! events don't allow the cursor to escape. This can be used for typical camera controls //! like a dolly or rotation, where mouse movement is important but cursor location is not. + //! @deprecated Use #SetCursorMode() void SetCursorCaptureEnabled(bool enabled); + //! Set the cursor mode. + void SetCursorMode(QtEventToAzInputMapper::CursorInputMode mode); + void SetOverrideCursor(ViewportInteraction::CursorStyleOverride cursorStyleOverride); void ClearOverrideCursor(); @@ -176,8 +191,8 @@ namespace AzToolsFramework QWidget* m_sourceWidget; // Flags whether or not Qt events should currently be processed. bool m_enabled = true; - // Flags whether or not the cursor is being constrained to the source widget (for invisible mouse movement). - bool m_capturingCursor = false; + // Controls the cursor behavior. + QtEventToAzInputMapper::CursorInputMode m_cursorMode = CURSOR_MODE_NONE; // Flags whether the cursor has been overridden. bool m_overrideCursor = false; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp index 505ff70122..cbede827e2 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp @@ -331,12 +331,12 @@ namespace AtomToolsFramework void RenderViewportWidget::BeginCursorCapture() { - m_inputChannelMapper->SetCursorCaptureEnabled(true); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_CAPTURED); } void RenderViewportWidget::EndCursorCapture() { - m_inputChannelMapper->SetCursorCaptureEnabled(false); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_NONE); } void RenderViewportWidget::SetOverrideCursor(AzToolsFramework::ViewportInteraction::CursorStyleOverride cursorStyleOverride) From fa809a76ca3804e95377c0776a40cf4004da90c8 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Mon, 13 Dec 2021 07:28:28 -0800 Subject: [PATCH 075/620] chore: address changes - updated checkstyle - update enum CursorInputMode - minor refeactor to QtEventToAzInputMapper Signed-off-by: Michael Pollind --- Code/Editor/EditorViewportSettings.cpp | 10 +- Code/Editor/EditorViewportSettings.h | 4 +- .../test_ModularViewportCameraController.cpp | 4 +- .../Input/QtEventToAzInputMapper.cpp | 116 +++++++++--------- .../Input/QtEventToAzInputMapper.h | 14 +-- .../Source/Viewport/RenderViewportWidget.cpp | 4 +- 6 files changed, 74 insertions(+), 78 deletions(-) diff --git a/Code/Editor/EditorViewportSettings.cpp b/Code/Editor/EditorViewportSettings.cpp index 5711d1c3d3..883eb91863 100644 --- a/Code/Editor/EditorViewportSettings.cpp +++ b/Code/Editor/EditorViewportSettings.cpp @@ -23,7 +23,7 @@ namespace SandboxEditor constexpr AZStd::string_view AngleSizeSetting = "/Amazon/Preferences/Editor/AngleSize"; constexpr AZStd::string_view ShowGridSetting = "/Amazon/Preferences/Editor/ShowGrid"; constexpr AZStd::string_view StickySelectSetting = "/Amazon/Preferences/Editor/StickySelect"; - constexpr AZStd::string_view ManipulatorMouseWrapSetting = "/Amazon/Preferences/Editor/Manipulator/MouseWrapping"; + constexpr AZStd::string_view ViewportMouseWrapSetting = "/Amazon/Preferences/Editor/Manipulator/MouseWrapping"; constexpr AZStd::string_view ManipulatorLineBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/LineBoundWidth"; constexpr AZStd::string_view ManipulatorCircleBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/CircleBoundWidth"; constexpr AZStd::string_view CameraTranslateSpeedSetting = "/Amazon/Preferences/Editor/Camera/TranslateSpeed"; @@ -187,14 +187,14 @@ namespace SandboxEditor AzToolsFramework::SetRegistry(ManipulatorLineBoundWidthSetting, lineBoundWidth); } - bool ManipulatorMouseWrap() + bool ViewportMouseWrapSetting() { - return aznumeric_cast(GetRegistry(ManipulatorMouseWrapSetting, false)); + return aznumeric_cast(GetRegistry(ViewportMouseWrapSetting, false)); } - void SetManipulatorMouseWrap(bool wrapping) + void SetViewportMouseWrapSetting(bool wrapping) { - SetRegistry(ManipulatorMouseWrapSetting, wrapping); + SetRegistry(ViewportMouseWrapSetting, wrapping); } float ManipulatorCircleBoundWidth() diff --git a/Code/Editor/EditorViewportSettings.h b/Code/Editor/EditorViewportSettings.h index 975feff307..a27187bc55 100644 --- a/Code/Editor/EditorViewportSettings.h +++ b/Code/Editor/EditorViewportSettings.h @@ -57,8 +57,8 @@ namespace SandboxEditor SANDBOX_API float ManipulatorLineBoundWidth(); SANDBOX_API void SetManipulatorLineBoundWidth(float lineBoundWidth); - SANDBOX_API bool ManipulatorMouseWrap(); - SANDBOX_API void SetManipulatorMouseWrap(bool wrapping); + SANDBOX_API bool ViewportMouseWrapSetting(); + SANDBOX_API void SetViewportMouseWrapSetting(bool wrapping); SANDBOX_API float ManipulatorCircleBoundWidth(); SANDBOX_API void SetManipulatorCircleBoundWidth(float circleBoundWidth); diff --git a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp index f2ee3c79aa..9bfd9d396e 100644 --- a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp +++ b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp @@ -47,12 +47,12 @@ namespace UnitTest void ViewportMouseCursorRequestImpl::BeginCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_CAPTURED); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeCaptured); } void ViewportMouseCursorRequestImpl::EndCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_NONE); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeNone); } bool ViewportMouseCursorRequestImpl::IsMouseOver() const diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp index 0b6df58c1a..77f297b98c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp @@ -241,40 +241,32 @@ namespace AzToolsFramework } } - - void QtEventToAzInputMapper::SetCursorMode(QtEventToAzInputMapper::CursorInputMode mode) + void QtEventToAzInputMapper::SetCursorMode(QtEventToAzInputMapper::CursorInputMode mode) { - if(mode != m_cursorMode) + if (mode != m_cursorMode) { m_cursorMode = mode; - switch(m_cursorMode) + switch (m_cursorMode) { - case CURSOR_MODE_CAPTURED: - qApp->setOverrideCursor(Qt::BlankCursor); - m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::ConstrainedAndHidden); - break; - case CURSOR_MODE_WRAPPED: - qApp->restoreOverrideCursor(); - m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); - break; - case CURSOR_MODE_NONE: - qApp->restoreOverrideCursor(); - m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); - break; + case CursorInputMode::CursorModeCaptured: + qApp->setOverrideCursor(Qt::BlankCursor); + m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::ConstrainedAndHidden); + break; + case CursorInputMode::CursorModeWrapped: + qApp->restoreOverrideCursor(); + m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); + break; + case CursorInputMode::CursorModeNone: + qApp->restoreOverrideCursor(); + m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); + break; } } } void QtEventToAzInputMapper::SetCursorCaptureEnabled(bool enabled) { - if (enabled) - { - SetCursorMode(CURSOR_MODE_CAPTURED); - } - else - { - SetCursorMode(CURSOR_MODE_NONE); - } + SetCursorMode(enabled ? CursorInputMode::CursorModeCaptured : CursorInputMode::CursorModeNone); } bool QtEventToAzInputMapper::eventFilter(QObject* object, QEvent* event) @@ -453,71 +445,75 @@ namespace AzToolsFramework return QPoint{ denormalizedX, denormalizedY }; } - void wrapCursorX(const QRect& rect, QPoint& point) { - if (rect.left() < point.x()) + void wrapCursorX(const QRect& rect, QPoint& point) + { + if (rect.left() < point.x()) { point.setX(rect.right() - 1); } - else if (rect.right() > point.x()) + else if (rect.right() > point.x()) { point.setX(rect.left() + 1); } } - void wrapCursorY(const QRect& rect, QPoint& point) { - if (rect.top() < point.y()) + void wrapCursorY(const QRect& rect, QPoint& point) + { + if (rect.top() < point.y()) { point.setY(rect.bottom() - 1); } - else if (rect.bottom() > point.y()) + else if (rect.bottom() > point.y()) { point.setY(rect.top() + 1); } } - void QtEventToAzInputMapper::HandleMouseMoveEvent(const QPoint& globalCursorPosition) { const QPoint cursorDelta = globalCursorPosition - m_previousGlobalCursorPosition; QScreen* screen = m_sourceWidget->screen(); - const QRect widgetRect(m_sourceWidget->mapToGlobal(QPoint(0,0)), m_sourceWidget->size()); + const QRect widgetRect(m_sourceWidget->mapToGlobal(QPoint(0, 0)), m_sourceWidget->size()); m_mouseDevice->m_cursorPositionData2D->m_normalizedPosition = WidgetPositionToNormalizedPosition(m_sourceWidget->mapFromGlobal(globalCursorPosition)); m_mouseDevice->m_cursorPositionData2D->m_normalizedPositionDelta = WidgetPositionToNormalizedPosition(cursorDelta); - switch(m_cursorMode) + switch (m_cursorMode) { - case CURSOR_MODE_CAPTURED: - AzQtComponents::SetCursorPos(m_previousGlobalCursorPosition); - break; - case CURSOR_MODE_WRAPPED_X: + case CursorInputMode::CursorModeCaptured: + AzQtComponents::SetCursorPos(m_previousGlobalCursorPosition); + break; + case CursorInputMode::CursorModeWrappedX: + case CursorInputMode::CursorModeWrappedY: + case CursorInputMode::CursorModeWrapped: + { QPoint screenPos(globalCursorPosition); - wrapCursorX(widgetRect, screenPos); + switch (m_cursorMode) + { + case CursorInputMode::CursorModeWrappedX: + wrapCursorX(widgetRect, screenPos); + break; + case CursorInputMode::CursorModeWrappedY: + wrapCursorY(widgetRect, screenPos); + break; + case CursorInputMode::CursorModeWrapped: + wrapCursorX(widgetRect, screenPos); + wrapCursorY(widgetRect, screenPos); + break; + default: + // this should never happen + AZ_Assert(false, "Invalid Curosr Mode: %i.", m_cursorMode); + break; + } QCursor::setPos(screen, screenPos); - QPoint screenDelta = globalCursorPosition - screenPos; + const QPoint screenDelta = globalCursorPosition - screenPos; m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; - break; - case CURSOR_MODE_WRAPPED_Y: - QPoint screenPos(globalCursorPosition); - wrapCursorY(widgetRect, screenPos); - QCursor::setPos(screen, screenPos); - QPoint screenDelta = globalCursorPosition - screenPos; - m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; - break; - case CURSOR_MODE_WRAPPED: - QPoint screenPos(globalCursorPosition); - wrapCursorX(widgetRect, screenPos); - wrapCursorY(widgetRect, screenPos); - QCursor::setPos(screen, screenPos); - QPoint screenDelta = globalCursorPosition - screenPos; - m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; - break; - default: - m_previousGlobalCursorPosition = globalCursorPosition; - break; - - + } + break; + default: + AZ_Assert(false, "Invalid Curosr Mode: %i.", m_cursorMode); + break; } ProcessPendingMouseEvents(cursorDelta); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h index 7ba4e21bd4..a6d9fdd753 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h @@ -41,15 +41,15 @@ namespace AzToolsFramework Q_OBJECT public: - enum CursorInputMode { - CURSOR_MODE_NONE, - CURSOR_MODE_CAPTURED, //< Sets whether or not the cursor should be constrained to the source widget and invisible. + enum class CursorInputMode { + CursorModeNone, + CursorModeCaptured, //< Sets whether or not the cursor should be constrained to the source widget and invisible. //< Internally, this will reset the cursor position after each move event to ensure movement //< events don't allow the cursor to escape. This can be used for typical camera controls //< like a dolly or rotation, where mouse movement is important but cursor location is not. - CURSOR_MODE_WRAPPED, //< Flags whether the curser is going to wrap around the soruce widget. - CURSOR_MODE_WRAPPED_X, - CURSOR_MODE_WRAPPED_Y + CursorModeWrapped, //< Flags whether the curser is going to wrap around the soruce widget. + CursorModeWrappedX, + CursorModeWrappedY }; QtEventToAzInputMapper(QWidget* sourceWidget, int syntheticDeviceId = 0); @@ -192,7 +192,7 @@ namespace AzToolsFramework // Flags whether or not Qt events should currently be processed. bool m_enabled = true; // Controls the cursor behavior. - QtEventToAzInputMapper::CursorInputMode m_cursorMode = CURSOR_MODE_NONE; + QtEventToAzInputMapper::CursorInputMode m_cursorMode = CursorInputMode::CursorModeNone; // Flags whether the cursor has been overridden. bool m_overrideCursor = false; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp index cbede827e2..ef23560d57 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp @@ -331,12 +331,12 @@ namespace AtomToolsFramework void RenderViewportWidget::BeginCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_CAPTURED); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeCaptured); } void RenderViewportWidget::EndCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_NONE); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeNone); } void RenderViewportWidget::SetOverrideCursor(AzToolsFramework::ViewportInteraction::CursorStyleOverride cursorStyleOverride) From 3a6f877a9f79157424d5a86d05f9f1b7a98d1585 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Tue, 14 Dec 2021 23:05:13 -0800 Subject: [PATCH 076/620] chore: add first test Signed-off-by: Michael Pollind --- .../Input/QtEventToAzInputMapper.cpp | 8 ++--- .../Input/QtEventToAzInputMapperTests.cpp | 32 +++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp index 77f297b98c..7852a4a5d5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp @@ -447,11 +447,11 @@ namespace AzToolsFramework void wrapCursorX(const QRect& rect, QPoint& point) { - if (rect.left() < point.x()) + if (point.x() < rect.left()) { point.setX(rect.right() - 1); } - else if (rect.right() > point.x()) + else if (point.x() > rect.right()) { point.setX(rect.left() + 1); } @@ -459,11 +459,11 @@ namespace AzToolsFramework void wrapCursorY(const QRect& rect, QPoint& point) { - if (rect.top() < point.y()) + if (point.y() < rect.top()) { point.setY(rect.bottom() - 1); } - else if (rect.bottom() > point.y()) + else if (point.y() > rect.bottom()) { point.setY(rect.top() + 1); } diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index 4c813a4bdd..e645c365e2 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -44,6 +44,10 @@ namespace UnitTest QObject::connect(m_inputChannelMapper.get(), &AzToolsFramework::QtEventToAzInputMapper::InputChannelUpdated, m_rootWidget.get(), [this]([[maybe_unused]] const AzFramework::InputChannel* inputChannel, QEvent* event) { + if(event == nullptr) { + return; + } + const QEvent::Type eventType = event->type(); if (eventType == QEvent::Type::MouseButtonPress || @@ -512,4 +516,32 @@ namespace UnitTest return info.param.m_az.GetName(); } ); + + TEST_F(QtEventToAzInputMapperFixture, MouseWrapMouseViewportQtEventToAzInputMapperFixture) + { + AzFramework::InputChannelNotificationBus::Handler::BusConnect(); + m_captureAzEvents = false; + + + const auto startPos = QPoint(WidgetSize.width() - 2, WidgetSize.height() / 2); + MouseMove(m_rootWidget.get(), startPos, QPoint(0,0)); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorInputMode::CursorModeWrappedX); + + const auto deltaPos = QPoint(200.0f, 0); + const auto expectedPosition = m_rootWidget->mapToGlobal(QPoint(200, WidgetSize.height() / 2)); + const int iterations = 50; + + for(float i = 0; i < iterations; i++) { + MouseMove(m_rootWidget.get(), m_rootWidget->mapFromGlobal(QCursor::pos()), (deltaPos / iterations)); + } + + QPointF endPosition = QCursor::pos(); + EXPECT_NEAR(endPosition.x(), expectedPosition.x(), 5.0f); + EXPECT_NEAR(endPosition.y(), expectedPosition.y(), 5.0f); + + // cleanup + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorInputMode::CursorModeNone); + AzFramework::InputChannelNotificationBus::Handler::BusDisconnect(); + } + } // namespace UnitTest From 9e91c1872670c73cd1f3de98de616675ce9da8a5 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 15 Dec 2021 13:32:24 -0800 Subject: [PATCH 077/620] chore: address changes add test cases Signed-off-by: Michael Pollind --- Code/Editor/EditorViewportSettings.cpp | 2 +- .../Input/QtEventToAzInputMapper.cpp | 14 +- .../Input/QtEventToAzInputMapper.h | 26 +-- .../Input/QtEventToAzInputMapperTests.cpp | 151 +++++++++++++++--- 4 files changed, 153 insertions(+), 40 deletions(-) diff --git a/Code/Editor/EditorViewportSettings.cpp b/Code/Editor/EditorViewportSettings.cpp index 883eb91863..7108beca5a 100644 --- a/Code/Editor/EditorViewportSettings.cpp +++ b/Code/Editor/EditorViewportSettings.cpp @@ -189,7 +189,7 @@ namespace SandboxEditor bool ViewportMouseWrapSetting() { - return aznumeric_cast(GetRegistry(ViewportMouseWrapSetting, false)); + return GetRegistry(ViewportMouseWrapSetting, false); } void SetViewportMouseWrapSetting(bool wrapping) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp index 7852a4a5d5..edd45a7200 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp @@ -241,7 +241,7 @@ namespace AzToolsFramework } } - void QtEventToAzInputMapper::SetCursorMode(QtEventToAzInputMapper::CursorInputMode mode) + void QtEventToAzInputMapper::SetCursorMode(AzToolsFramework::CursorInputMode mode) { if (mode != m_cursorMode) { @@ -445,7 +445,7 @@ namespace AzToolsFramework return QPoint{ denormalizedX, denormalizedY }; } - void wrapCursorX(const QRect& rect, QPoint& point) + void WrapCursorX(const QRect& rect, QPoint& point) { if (point.x() < rect.left()) { @@ -457,7 +457,7 @@ namespace AzToolsFramework } } - void wrapCursorY(const QRect& rect, QPoint& point) + void WrapCursorY(const QRect& rect, QPoint& point) { if (point.y() < rect.top()) { @@ -492,14 +492,14 @@ namespace AzToolsFramework switch (m_cursorMode) { case CursorInputMode::CursorModeWrappedX: - wrapCursorX(widgetRect, screenPos); + WrapCursorX(widgetRect, screenPos); break; case CursorInputMode::CursorModeWrappedY: - wrapCursorY(widgetRect, screenPos); + WrapCursorY(widgetRect, screenPos); break; case CursorInputMode::CursorModeWrapped: - wrapCursorX(widgetRect, screenPos); - wrapCursorY(widgetRect, screenPos); + WrapCursorX(widgetRect, screenPos); + WrapCursorY(widgetRect, screenPos); break; default: // this should never happen diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h index a6d9fdd753..b84ac99c74 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h @@ -32,6 +32,17 @@ class QWheelEvent; namespace AzToolsFramework { + enum class CursorInputMode { + CursorModeNone, + CursorModeCaptured, //!< Sets whether or not the cursor should be constrained to the source widget and invisible. + //!< Internally, this will reset the cursor position after each move event to ensure movement + //!< events don't allow the cursor to escape. This can be used for typical camera controls + //!< like a dolly or rotation, where mouse movement is important but cursor location is not. + CursorModeWrapped, //!< Flags whether the curser is going to wrap around the soruce widget. + CursorModeWrappedX, + CursorModeWrappedY + }; + //! Maps events from the Qt input system to synthetic InputChannels in AzFramework //! that can be used by AzFramework::ViewportControllers. class QtEventToAzInputMapper final @@ -41,17 +52,6 @@ namespace AzToolsFramework Q_OBJECT public: - enum class CursorInputMode { - CursorModeNone, - CursorModeCaptured, //< Sets whether or not the cursor should be constrained to the source widget and invisible. - //< Internally, this will reset the cursor position after each move event to ensure movement - //< events don't allow the cursor to escape. This can be used for typical camera controls - //< like a dolly or rotation, where mouse movement is important but cursor location is not. - CursorModeWrapped, //< Flags whether the curser is going to wrap around the soruce widget. - CursorModeWrappedX, - CursorModeWrappedY - }; - QtEventToAzInputMapper(QWidget* sourceWidget, int syntheticDeviceId = 0); ~QtEventToAzInputMapper() = default; @@ -71,7 +71,7 @@ namespace AzToolsFramework void SetCursorCaptureEnabled(bool enabled); //! Set the cursor mode. - void SetCursorMode(QtEventToAzInputMapper::CursorInputMode mode); + void SetCursorMode(AzToolsFramework::CursorInputMode mode); void SetOverrideCursor(ViewportInteraction::CursorStyleOverride cursorStyleOverride); void ClearOverrideCursor(); @@ -192,7 +192,7 @@ namespace AzToolsFramework // Flags whether or not Qt events should currently be processed. bool m_enabled = true; // Controls the cursor behavior. - QtEventToAzInputMapper::CursorInputMode m_cursorMode = CursorInputMode::CursorModeNone; + AzToolsFramework::CursorInputMode m_cursorMode = AzToolsFramework::CursorInputMode::CursorModeNone; // Flags whether the cursor has been overridden. bool m_overrideCursor = false; diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index e645c365e2..9af445850c 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -44,10 +44,10 @@ namespace UnitTest QObject::connect(m_inputChannelMapper.get(), &AzToolsFramework::QtEventToAzInputMapper::InputChannelUpdated, m_rootWidget.get(), [this]([[maybe_unused]] const AzFramework::InputChannel* inputChannel, QEvent* event) { - if(event == nullptr) { + if(event == nullptr) + { return; } - const QEvent::Type eventType = event->type(); if (eventType == QEvent::Type::MouseButtonPress || @@ -517,31 +517,144 @@ namespace UnitTest } ); - TEST_F(QtEventToAzInputMapperFixture, MouseWrapMouseViewportQtEventToAzInputMapperFixture) + struct MouseMoveParam { + AzToolsFramework::CursorInputMode mode; + int iterations; + QPoint startPos; + QPoint deltaPos; + QPoint expectedPos; + const char* name; + }; + + class MoveMoveWrapParamQtEventToAzInputMapperFixture + : public QtEventToAzInputMapperFixture + , public ::testing::WithParamInterface + { + }; + + TEST_P(MoveMoveWrapParamQtEventToAzInputMapperFixture, MouseMove_NoAzHandlers_VerifyMouseMovmentViewport) + { + // setup + const MouseMoveParam mouseMoveParam = GetParam(); + AzFramework::InputChannelNotificationBus::Handler::BusConnect(); m_captureAzEvents = false; + m_inputChannelMapper->SetCursorMode(mouseMoveParam.mode); + m_rootWidget->move(100, 100); - - const auto startPos = QPoint(WidgetSize.width() - 2, WidgetSize.height() / 2); - MouseMove(m_rootWidget.get(), startPos, QPoint(0,0)); - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorInputMode::CursorModeWrappedX); - const auto deltaPos = QPoint(200.0f, 0); - const auto expectedPosition = m_rootWidget->mapToGlobal(QPoint(200, WidgetSize.height() / 2)); - const int iterations = 50; - - for(float i = 0; i < iterations; i++) { - MouseMove(m_rootWidget.get(), m_rootWidget->mapFromGlobal(QCursor::pos()), (deltaPos / iterations)); + MouseMove(m_rootWidget.get(), mouseMoveParam.startPos, QPoint(0,0)); + for(float i = 0; i < mouseMoveParam.iterations; i++) { + MouseMove(m_rootWidget.get(), m_rootWidget->mapFromGlobal(QCursor::pos()), (mouseMoveParam.deltaPos / mouseMoveParam.iterations)); } - - QPointF endPosition = QCursor::pos(); - EXPECT_NEAR(endPosition.x(), expectedPosition.x(), 5.0f); - EXPECT_NEAR(endPosition.y(), expectedPosition.y(), 5.0f); - + + QPointF endPosition = m_rootWidget->mapFromGlobal(QCursor::pos()); + EXPECT_NEAR(endPosition.x(), mouseMoveParam.expectedPos.x(), 1.0f); + EXPECT_NEAR(endPosition.y(), mouseMoveParam.expectedPos.y(), 1.0f); + // cleanup - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorInputMode::CursorModeNone); + m_rootWidget->move(0, 0); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::CursorInputMode::CursorModeNone); AzFramework::InputChannelNotificationBus::Handler::BusDisconnect(); } + INSTANTIATE_TEST_CASE_P(All, MoveMoveWrapParamQtEventToAzInputMapperFixture, + testing::Values( + // verify CursorModeWrappedX wrapping + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedX, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(40, 0), + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + "CursorModeWrappedX_Test_Right" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedX, + 40, + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(-40, 0), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + "CursorModeWrappedX_Test_Left" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedX, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20.0f), + QPoint(0, -40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, -20.0f), + "CursorModeWrappedX_Test_Top" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedX, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), + QPoint(0, 40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() + 20), + "CursorModeWrappedX_Test_Bottom" + }, + + // verify CursorModeWrappedY wrapping + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedY, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(40, 0), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() + 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + "CursorModeWrappedY_Test_Right" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedY, + 40, + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(-40, 0), + QPoint(-20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + "CursorModeWrappedY_Test_Left" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedY, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20.0f), + QPoint(0, -40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20.0f), + "CursorModeWrappedY_Test_Top" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedY, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), + QPoint(0, 40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20), + "CursorModeWrappedY_Test_Bottom" + }, + + // verify CursorModeWrapped wrapping + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrapped, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(40, 0), + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + "CursorModeWrapped_Test_Right" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrapped, + 40, + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(-40, 0), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + "CursorModeWrapped_Test_Left" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrapped, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20.0f), + QPoint(0, -40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20.0f), + "CursorModeWrapped_Test_Top" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrapped, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), + QPoint(0, 40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20), + "CursorModeWrapped_Test_Bottom" + } + ), + [](const ::testing::TestParamInfo& info) + { + return info.param.name; + } + ); + } // namespace UnitTest From 1654ff052041567778624fd7078164533bc37f42 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Thu, 16 Dec 2021 22:37:31 -0800 Subject: [PATCH 078/620] chore: correct test case MouseMove_NoAzHandlers_VerifyMouseMovementViewport Signed-off-by: Michael Pollind --- .../Input/QtEventToAzInputMapper.cpp | 3 ++ .../Input/QtEventToAzInputMapper.h | 4 +- .../Input/QtEventToAzInputMapperTests.cpp | 43 ++++++++++++++++--- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp index edd45a7200..b660e87b56 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp @@ -511,6 +511,9 @@ namespace AzToolsFramework m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; } break; + case CursorInputMode::CursorModeNone: + m_previousGlobalCursorPosition = globalCursorPosition; + break; default: AZ_Assert(false, "Invalid Curosr Mode: %i.", m_cursorMode); break; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h index b84ac99c74..67ef195363 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h @@ -39,8 +39,8 @@ namespace AzToolsFramework //!< events don't allow the cursor to escape. This can be used for typical camera controls //!< like a dolly or rotation, where mouse movement is important but cursor location is not. CursorModeWrapped, //!< Flags whether the curser is going to wrap around the soruce widget. - CursorModeWrappedX, - CursorModeWrappedY + CursorModeWrappedX, //!< Flags whether the curser is going to wrap around the soruce widget only on the left and right side. + CursorModeWrappedY //!< Flags whether the curser is going to wrap around the soruce widget only on the top and bottom side. }; //! Maps events from the Qt input system to synthetic InputChannels in AzFramework diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index 9af445850c..0282812be7 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -533,23 +533,38 @@ namespace UnitTest { }; - TEST_P(MoveMoveWrapParamQtEventToAzInputMapperFixture, MouseMove_NoAzHandlers_VerifyMouseMovmentViewport) + TEST_P(MoveMoveWrapParamQtEventToAzInputMapperFixture, MouseMove_NoAzHandlers_VerifyMouseMovementViewport) { + //TODO: mouseMove is bugged mapToGlobal is called twice + auto mouseMoveFix = [](QWidget* wid, QPoint globalPos, QPoint deltaPos) + { + QPoint globalPosition = globalPos + deltaPos; + QPoint localPosition = wid->mapFromGlobal(globalPosition); + QTest::mouseMove(wid, localPosition); + QMouseEvent mouseMoveEvent(QEvent::MouseMove, localPosition, globalPosition, Qt::NoButton, Qt::NoButton, Qt::NoModifier); + QApplication::sendEvent(wid, &mouseMoveEvent); + }; + // setup const MouseMoveParam mouseMoveParam = GetParam(); AzFramework::InputChannelNotificationBus::Handler::BusConnect(); m_captureAzEvents = false; - m_inputChannelMapper->SetCursorMode(mouseMoveParam.mode); + m_rootWidget->move(100, 100); + mouseMoveFix(m_rootWidget.get(), m_rootWidget->mapToGlobal(mouseMoveParam.startPos), QPoint(0, 0)); + // given + m_inputChannelMapper->SetCursorMode(mouseMoveParam.mode); - MouseMove(m_rootWidget.get(), mouseMoveParam.startPos, QPoint(0,0)); - for(float i = 0; i < mouseMoveParam.iterations; i++) { - MouseMove(m_rootWidget.get(), m_rootWidget->mapFromGlobal(QCursor::pos()), (mouseMoveParam.deltaPos / mouseMoveParam.iterations)); + mouseMoveFix(m_rootWidget.get(), m_rootWidget->mapToGlobal(mouseMoveParam.startPos), QPoint(0, 0)); + for (float i = 0; i < mouseMoveParam.iterations; i++) + { + mouseMoveFix(m_rootWidget.get(), QCursor::pos(), (mouseMoveParam.deltaPos / mouseMoveParam.iterations)); } - QPointF endPosition = m_rootWidget->mapFromGlobal(QCursor::pos()); + // validate + QPoint endPosition = m_rootWidget->mapFromGlobal(QCursor::pos()); EXPECT_NEAR(endPosition.x(), mouseMoveParam.expectedPos.x(), 1.0f); EXPECT_NEAR(endPosition.y(), mouseMoveParam.expectedPos.y(), 1.0f); @@ -649,6 +664,22 @@ namespace UnitTest QPoint(0, 40), QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20), "CursorModeWrapped_Test_Bottom" + }, + // verify CursorModeCaptured + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeCaptured, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() / 2.0f), + QPoint(0, 40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() / 2.0f), + "CursorModeCaptured" + }, + // verify CursorModeNone + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeNone, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() / 2.0f), + QPoint(40.0f, 0), + QPoint((QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f) + 40.0f, (QtEventToAzInputMapperFixture::WidgetSize.height() / 2.0f)), + "CursorModeNone" } ), [](const ::testing::TestParamInfo& info) From 95c0c83642b2496f96418745b6c245ee50cf87b9 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Sat, 18 Dec 2021 18:29:39 -0800 Subject: [PATCH 079/620] chore: remove unused setting and fixed compiling errors Signed-off-by: Michael Pollind --- Code/Editor/EditorViewportSettings.cpp | 11 ----------- Code/Editor/EditorViewportSettings.h | 3 --- .../Tests/test_ModularViewportCameraController.cpp | 4 ++-- .../Code/Source/Viewport/RenderViewportWidget.cpp | 4 ++-- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/Code/Editor/EditorViewportSettings.cpp b/Code/Editor/EditorViewportSettings.cpp index 7108beca5a..e06b9696e1 100644 --- a/Code/Editor/EditorViewportSettings.cpp +++ b/Code/Editor/EditorViewportSettings.cpp @@ -23,7 +23,6 @@ namespace SandboxEditor constexpr AZStd::string_view AngleSizeSetting = "/Amazon/Preferences/Editor/AngleSize"; constexpr AZStd::string_view ShowGridSetting = "/Amazon/Preferences/Editor/ShowGrid"; constexpr AZStd::string_view StickySelectSetting = "/Amazon/Preferences/Editor/StickySelect"; - constexpr AZStd::string_view ViewportMouseWrapSetting = "/Amazon/Preferences/Editor/Manipulator/MouseWrapping"; constexpr AZStd::string_view ManipulatorLineBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/LineBoundWidth"; constexpr AZStd::string_view ManipulatorCircleBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/CircleBoundWidth"; constexpr AZStd::string_view CameraTranslateSpeedSetting = "/Amazon/Preferences/Editor/Camera/TranslateSpeed"; @@ -187,16 +186,6 @@ namespace SandboxEditor AzToolsFramework::SetRegistry(ManipulatorLineBoundWidthSetting, lineBoundWidth); } - bool ViewportMouseWrapSetting() - { - return GetRegistry(ViewportMouseWrapSetting, false); - } - - void SetViewportMouseWrapSetting(bool wrapping) - { - SetRegistry(ViewportMouseWrapSetting, wrapping); - } - float ManipulatorCircleBoundWidth() { return aznumeric_cast(AzToolsFramework::GetRegistry(ManipulatorCircleBoundWidthSetting, 0.1)); diff --git a/Code/Editor/EditorViewportSettings.h b/Code/Editor/EditorViewportSettings.h index a27187bc55..fe1253ed0c 100644 --- a/Code/Editor/EditorViewportSettings.h +++ b/Code/Editor/EditorViewportSettings.h @@ -57,9 +57,6 @@ namespace SandboxEditor SANDBOX_API float ManipulatorLineBoundWidth(); SANDBOX_API void SetManipulatorLineBoundWidth(float lineBoundWidth); - SANDBOX_API bool ViewportMouseWrapSetting(); - SANDBOX_API void SetViewportMouseWrapSetting(bool wrapping); - SANDBOX_API float ManipulatorCircleBoundWidth(); SANDBOX_API void SetManipulatorCircleBoundWidth(float circleBoundWidth); diff --git a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp index 9bfd9d396e..5009c626e2 100644 --- a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp +++ b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp @@ -47,12 +47,12 @@ namespace UnitTest void ViewportMouseCursorRequestImpl::BeginCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeCaptured); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::CursorInputMode::CursorModeCaptured); } void ViewportMouseCursorRequestImpl::EndCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeNone); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::CursorInputMode::CursorModeNone); } bool ViewportMouseCursorRequestImpl::IsMouseOver() const diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp index ef23560d57..d6871a8795 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp @@ -331,12 +331,12 @@ namespace AtomToolsFramework void RenderViewportWidget::BeginCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeCaptured); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::CursorInputMode::CursorModeCaptured); } void RenderViewportWidget::EndCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeNone); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::CursorInputMode::CursorModeNone); } void RenderViewportWidget::SetOverrideCursor(AzToolsFramework::ViewportInteraction::CursorStyleOverride cursorStyleOverride) From ed39c784c304c0cf9a374b297f3521f7f0787fc2 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Sun, 19 Dec 2021 18:22:14 -0800 Subject: [PATCH 080/620] chore: add accumulated test for mouse position Signed-off-by: Michael Pollind --- .../Tests/Input/QtEventToAzInputMapperTests.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index 0282812be7..5047c19044 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -100,6 +100,11 @@ namespace UnitTest m_azChannelEvents.push_back(AzEventInfo(inputChannel)); hasBeenConsumed = m_captureAzEvents; } + else if (inputChannelId == AzFramework::InputDeviceMouse::SystemCursorPosition) + { + m_azCursorPositions.push_back(*inputChannel.GetCustomData()); + hasBeenConsumed = m_captureAzEvents; + } } else if (AzFramework::InputDeviceKeyboard::IsKeyboardDevice(inputDeviceId)) { @@ -165,6 +170,7 @@ namespace UnitTest AZStd::vector m_signalEvents; AZStd::vector m_azChannelEvents; AZStd::vector m_azTextEvents; + AZStd::vector m_azCursorPositions; bool m_captureAzEvents{ false }; bool m_captureTextEvents{ false }; @@ -549,13 +555,14 @@ namespace UnitTest const MouseMoveParam mouseMoveParam = GetParam(); AzFramework::InputChannelNotificationBus::Handler::BusConnect(); - m_captureAzEvents = false; + m_captureAzEvents = true; m_rootWidget->move(100, 100); mouseMoveFix(m_rootWidget.get(), m_rootWidget->mapToGlobal(mouseMoveParam.startPos), QPoint(0, 0)); // given m_inputChannelMapper->SetCursorMode(mouseMoveParam.mode); + m_azCursorPositions.clear(); mouseMoveFix(m_rootWidget.get(), m_rootWidget->mapToGlobal(mouseMoveParam.startPos), QPoint(0, 0)); for (float i = 0; i < mouseMoveParam.iterations; i++) @@ -563,11 +570,19 @@ namespace UnitTest mouseMoveFix(m_rootWidget.get(), QCursor::pos(), (mouseMoveParam.deltaPos / mouseMoveParam.iterations)); } + AZ::Vector2 accumalatedPosition(0.0f,0.0f); + for(const auto& pos: m_azCursorPositions) { + accumalatedPosition += (pos.m_normalizedPositionDelta * AZ::Vector2(WidgetSize.width(), WidgetSize.height())); + } + // validate QPoint endPosition = m_rootWidget->mapFromGlobal(QCursor::pos()); EXPECT_NEAR(endPosition.x(), mouseMoveParam.expectedPos.x(), 1.0f); EXPECT_NEAR(endPosition.y(), mouseMoveParam.expectedPos.y(), 1.0f); + EXPECT_NEAR(accumalatedPosition.GetX(), mouseMoveParam.deltaPos.x(), 1.0f); + EXPECT_NEAR(accumalatedPosition.GetY(), mouseMoveParam.deltaPos.y(), 1.0f); + // cleanup m_rootWidget->move(0, 0); m_inputChannelMapper->SetCursorMode(AzToolsFramework::CursorInputMode::CursorModeNone); From 8510bdbfa756100b98a0db6f6f726c03e067f5dc Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 7 Jan 2022 14:27:43 -0600 Subject: [PATCH 081/620] (Draft) WIP adding pixel retrieval API to StreamingImageAsset Signed-off-by: Chris Galvan --- .../Code/Source/Processing/Utils.cpp | 4 + .../RPI.Reflect/Image/StreamingImageAsset.h | 4 + .../RPI.Reflect/Image/StreamingImageAsset.cpp | 129 ++++++++++++++++++ Gems/GradientSignal/Code/CMakeLists.txt | 1 + .../Components/ImageGradientComponent.h | 4 + .../Code/Include/GradientSignal/ImageAsset.h | 3 +- .../GradientSignal/Code/Source/ImageAsset.cpp | 28 ++-- 7 files changed, 157 insertions(+), 16 deletions(-) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp index 20e1b18e77..44539ad33c 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp @@ -242,6 +242,10 @@ namespace ImageProcessingAtom } } + // Should we actually put the GetSubImagePixelValue API in this Utils file instead, since it already has + // some conversion logic, and has the helper method for retrieving an entire image (LoadImageFromImageAsset) + // whereas this is a helper for retrieving a specific pixel from the image? + IImageObjectPtr LoadImageFromImageAsset(const AZ::Data::Asset& imageAsset) { if (!imageAsset.IsReady()) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index 73af8370cb..1db2a63b1c 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -85,6 +85,10 @@ namespace AZ //! Get image data for specified mip and slice. It may return empty array if its mipchain assets are not loaded AZStd::array_view GetSubImageData(uint32_t mip, uint32_t slice); + //! Get image pixel value for specified mip and slice + template + T GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex = 0); + //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 59f359e474..f1d9b1782b 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -13,6 +13,95 @@ namespace AZ { + namespace Internal + { + template + float RetrieveFloatValue(const AZ::u8* mem, size_t index) + { + AZ_Assert(false, "Unsupported pixel format"); + } + + template + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + { + AZ_Assert(false, "Unsupported pixel format"); + } + + template <> + float RetrieveFloatValue([[maybe_unused]] const AZ::u8* mem, [[maybe_unused]] size_t index) + { + return 0.0f; + } + + template <> + AZ::u32 RetrieveUintValue([[maybe_unused]] const AZ::u8* mem, [[maybe_unused]] size_t index) + { + return 0; + } + + template <> + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + + template <> + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + { + // 16 bits per channel + auto actualMem = reinterpret_cast(mem); + actualMem += index; + + return *actualMem / static_cast(std::numeric_limits::max()); + } + + template <> + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + { + // 32 bits per channel + auto actualMem = reinterpret_cast(mem); + actualMem += index; + + return *actualMem / static_cast(std::numeric_limits::max()); + } + + template <> + float RetrieveFloatValue(const AZ::u8* mem, size_t index) + { + // 32 bits per channel + auto actualMem = reinterpret_cast(mem); + actualMem += index; + + return *actualMem; + } + + float RetrieveFloatValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) + { + switch (format) + { + case AZ::RHI::Format::R32_FLOAT: + return RetrieveFloatValue(mem, index); + default: + return RetrieveFloatValue(mem, index); + } + } + + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) + { + switch (format) + { + case AZ::RHI::Format::R8_UNORM: + return RetrieveUintValue(mem, index); + case AZ::RHI::Format::R16_UNORM: + return RetrieveUintValue(mem, index); + case AZ::RHI::Format::R32_UINT: + return RetrieveUintValue(mem, index); + default: + return RetrieveUintValue(mem, index); + } + } + } + namespace RPI { const char* StreamingImageAsset::DisplayName = "StreamingImage"; @@ -124,5 +213,45 @@ namespace AZ return mipChainAsset->GetSubImageData(mip - mipChain.m_mipOffset, slice); } + + template<> + float StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + size_t index = (y * width) + x; + + return Internal::RetrieveFloatValue(imageData.data(), index, imageDescriptor.m_format); + } + + return 0.0f; + } + + template<> + AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + size_t index = (y * width) + x; + + return Internal::RetrieveUintValue(imageData.data(), index, imageDescriptor.m_format); + } + + return 0; + } } } diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index 657a88db47..fda04ceb82 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -21,6 +21,7 @@ ly_add_target( AZ::AzCore AZ::AtomCore AZ::AzFramework + Gem::Atom_RPI.Public Gem::SurfaceData Gem::ImageProcessingAtom.Headers Gem::LmbrCentral diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index 8214436f83..bbb22a061d 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -10,6 +10,9 @@ #include #include + +#include + #include #include #include @@ -33,6 +36,7 @@ namespace GradientSignal AZ_RTTI(ImageGradientConfig, "{1BDB5DA4-A4A8-452B-BE6D-6BD451D4E7CD}", AZ::ComponentConfig); static void Reflect(AZ::ReflectContext* context); AZ::Data::Asset m_imageAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; + AZ::Data::Asset m_streamingImageAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; float m_tilingX = 1.0f; float m_tilingY = 1.0f; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h index 4ffab0b4b4..811d74082d 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace AZ { @@ -61,6 +62,6 @@ namespace GradientSignal } }; - float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue); + float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue); } // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index 7e73dc32d6..afa233e5cb 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -20,6 +20,7 @@ namespace { + // Could (should) move these RetrieveValue helper methods over to where our new API lives template float RetrieveValue(const AZ::u8* mem, size_t index) { @@ -151,17 +152,17 @@ namespace GradientSignal return true; } - float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) + float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) { if (imageAsset.IsReady()) { - const auto& image = imageAsset.Get(); - AZStd::size_t imageSize = image->m_imageWidth * image->m_imageHeight * - static_cast(image->m_bytesPerPixel); + const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + auto height = imageDescriptor.m_size.m_height; - if (image->m_imageWidth > 0 && - image->m_imageHeight > 0 && - image->m_imageData.size() == imageSize) + if (width > 0 + && height > 0 + ) { // When "rasterizing" from uvs, a range of 0-1 has slightly different meanings depending on the sampler state. // For repeating states (Unbounded/None, Repeat), a uv value of 1 should wrap around back to our 0th pixel. @@ -184,8 +185,8 @@ namespace GradientSignal // A 16x16 pixel image and tilingX = tilingY = 1 maps the uv range of 0-1 to 0-16 pixels. // A 16x16 pixel image and tilingX = tilingY = 1.5 maps the uv range of 0-1 to 0-24 pixels. - const AZ::Vector3 tiledDimensions((image->m_imageWidth * tilingX), - (image->m_imageHeight * tilingY), + const AZ::Vector3 tiledDimensions((width * tilingX), + (height * tilingY), 0.0f); // Convert from uv space back to pixel space @@ -194,13 +195,10 @@ namespace GradientSignal // UVs outside the 0-1 range are treated as infinitely tiling, so that we behave the same as the // other gradient generators. As mentioned above, if clamping is desired, we expect it to be applied // outside of this function. - size_t x = static_cast(pixelLookup.GetX()) % image->m_imageWidth; - size_t y = static_cast(pixelLookup.GetY()) % image->m_imageHeight; + uint32_t x = static_cast(pixelLookup.GetX()) % width; + uint32_t y = static_cast(pixelLookup.GetY()) % height; - // Flip the y because images are stored in reverse of our world axes - size_t index = ((image->m_imageHeight - 1) - y) * image->m_imageWidth + x; - - return RetrieveValue(image->m_imageData.data(), index, image->m_imageFormat); + return imageAsset->GetSubImagePixelValue(0, 0, x, y, 0); } } From 832c525f67a0ea24ad004066c0d556c8c449a9af Mon Sep 17 00:00:00 2001 From: nemerle <96597+nemerle@users.noreply.github.com> Date: Sat, 8 Jan 2022 23:22:04 +0100 Subject: [PATCH 082/620] Fix missing include file Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> --- .../Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h index 838cdd2256..60417adf36 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h @@ -15,6 +15,7 @@ #include #include #include +#include namespace AZ { From c65a903c7dc8ae5ce441df130f26e735534dd6bd Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Sat, 8 Jan 2022 21:01:29 -0800 Subject: [PATCH 083/620] chore: fix unit test Signed-off-by: Michael Pollind --- .../Input/QtEventToAzInputMapperTests.cpp | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index 5047c19044..d7ab896462 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -541,15 +541,6 @@ namespace UnitTest TEST_P(MoveMoveWrapParamQtEventToAzInputMapperFixture, MouseMove_NoAzHandlers_VerifyMouseMovementViewport) { - //TODO: mouseMove is bugged mapToGlobal is called twice - auto mouseMoveFix = [](QWidget* wid, QPoint globalPos, QPoint deltaPos) - { - QPoint globalPosition = globalPos + deltaPos; - QPoint localPosition = wid->mapFromGlobal(globalPosition); - QTest::mouseMove(wid, localPosition); - QMouseEvent mouseMoveEvent(QEvent::MouseMove, localPosition, globalPosition, Qt::NoButton, Qt::NoButton, Qt::NoModifier); - QApplication::sendEvent(wid, &mouseMoveEvent); - }; // setup const MouseMoveParam mouseMoveParam = GetParam(); @@ -558,30 +549,29 @@ namespace UnitTest m_captureAzEvents = true; m_rootWidget->move(100, 100); - mouseMoveFix(m_rootWidget.get(), m_rootWidget->mapToGlobal(mouseMoveParam.startPos), QPoint(0, 0)); + QScreen* screen = m_rootWidget->screen(); + MouseMove(m_rootWidget.get(), mouseMoveParam.startPos, QPoint(0, 0)); // given m_inputChannelMapper->SetCursorMode(mouseMoveParam.mode); m_azCursorPositions.clear(); - - mouseMoveFix(m_rootWidget.get(), m_rootWidget->mapToGlobal(mouseMoveParam.startPos), QPoint(0, 0)); for (float i = 0; i < mouseMoveParam.iterations; i++) { - mouseMoveFix(m_rootWidget.get(), QCursor::pos(), (mouseMoveParam.deltaPos / mouseMoveParam.iterations)); + MouseMove(m_rootWidget.get(), m_rootWidget->mapFromGlobal(QCursor::pos(screen)), (mouseMoveParam.deltaPos / mouseMoveParam.iterations)); } - AZ::Vector2 accumalatedPosition(0.0f,0.0f); + AZ::Vector2 accumulatedPosition(0.0f,0.0f); for(const auto& pos: m_azCursorPositions) { - accumalatedPosition += (pos.m_normalizedPositionDelta * AZ::Vector2(WidgetSize.width(), WidgetSize.height())); + accumulatedPosition += (pos.m_normalizedPositionDelta * AZ::Vector2(WidgetSize.width(), WidgetSize.height())); } // validate - QPoint endPosition = m_rootWidget->mapFromGlobal(QCursor::pos()); + const QPoint endPosition = m_rootWidget->mapFromGlobal(QCursor::pos(screen)); EXPECT_NEAR(endPosition.x(), mouseMoveParam.expectedPos.x(), 1.0f); EXPECT_NEAR(endPosition.y(), mouseMoveParam.expectedPos.y(), 1.0f); - EXPECT_NEAR(accumalatedPosition.GetX(), mouseMoveParam.deltaPos.x(), 1.0f); - EXPECT_NEAR(accumalatedPosition.GetY(), mouseMoveParam.deltaPos.y(), 1.0f); + EXPECT_NEAR(accumulatedPosition.GetX(), mouseMoveParam.deltaPos.x(), 1.0f); + EXPECT_NEAR(accumulatedPosition.GetY(), mouseMoveParam.deltaPos.y(), 1.0f); // cleanup m_rootWidget->move(0, 0); From d0bb222ce6115f308f920089e31b15fbcca4df8d Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Mon, 10 Jan 2022 18:19:39 +0100 Subject: [PATCH 084/620] Refactor thin transmission factor variable packing and visibility + use thickness to modulate transmission distance Signed-off-by: Santi Paprika --- .../Materials/Types/EnhancedPBR.materialtype | 29 ++++++----------- .../Materials/Types/EnhancedPBR_Common.azsli | 5 +-- .../Types/EnhancedPBR_ForwardPass.azsl | 11 ++++--- .../Types/EnhancedPBR_SubsurfaceState.lua | 31 +++++++++++++------ .../Common/Assets/Materials/Types/Skin.azsl | 11 ++++--- .../Assets/Materials/Types/Skin.materialtype | 29 ++++++----------- .../Assets/Materials/Types/Skin_Common.azsli | 5 +-- .../Atom/Features/PBR/BackLighting.azsli | 10 +++--- .../Surfaces/TransmissionSurfaceData.azsli | 4 ++- ...SubsurfaceTransmissionParameterFunctor.cpp | 10 +++++- .../SubsurfaceTransmissionParameterFunctor.h | 3 ++ ...TransmissionParameterFunctorSourceData.cpp | 12 ++++++- ...ceTransmissionParameterFunctorSourceData.h | 3 ++ 13 files changed, 89 insertions(+), 74 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index 3fe3569a50..9186efd385 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -1154,7 +1154,7 @@ { "name": "thickness", "displayName": " Thickness", - "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", + "description": "In thick transmission mode: Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel\n\nIn thin transmission mode: This value modulates the distance traversed by light inside an object.", "type": "float", "defaultValue": 0.5, "min": 0.0, @@ -1230,24 +1230,16 @@ "type": "float", "defaultValue": 0.005, "min": 0.0, - "softMax": 0.05, - "connection": { - "type": "ShaderInput", - "name": "m_shrinkFactor" - } + "softMax": 0.05 }, { - "name": "transmissionAngleBias", + "name": "transmissionNdLBias", "displayName": " Angle Bias", "description": "cosine of angle to extend below (N . L = 0) in scattering through thin objects", "type": "float", "defaultValue": 0.1, "min": -1.0, - "softMax": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_transmissionNdLBias" - } + "softMax": 1.0 }, { "name": "distanceAttenuation", @@ -1256,20 +1248,16 @@ "type": "float", "defaultValue": 0.5, "min": 0.0, - "softMax": 4.0, - "connection": { - "type": "ShaderInput", - "name": "m_distanceAttenuation" - } + "softMax": 4.0 }, { "name": "transmissionScale", "displayName": " Scale", "description": "Strength of transmission", "type": "float", - "defaultValue": 0.01, + "defaultValue": 1.0, "min": 0.0, - "softMax": 1.0 + "softMax": 5.0 } ], "detailLayerGroup": [ @@ -1594,6 +1582,9 @@ "power": "subsurfaceScattering.transmissionPower", "distortion": "subsurfaceScattering.transmissionDistortion", "attenuation": "subsurfaceScattering.transmissionAttenuation", + "shrinkFactor": "subsurfaceScattering.shrinkFactor", + "transmissionNdLBias": "subsurfaceScattering.transmissionNdLBias", + "distanceAttenuation": "subsurfaceScattering.distanceAttenuation", "tintColor": "subsurfaceScattering.transmissionTint", "thickness": "subsurfaceScattering.thickness", "enabled": "subsurfaceScattering.enableSubsurfaceScattering", diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli index c15b49dc7d..786b0db4d7 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli @@ -93,16 +93,13 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial // Elements of m_transmissionParams: // Thick object mode: (attenuation coefficient, power, distortion, scale) - // Thin object mode: (float3 scatter distance, scale) + // Thin object mode: (shrinkFactor, transmissionNdLBias, distanceAttenuation, scale) float4 m_transmissionParams; // (float3 TintColor, thickness) float4 m_transmissionTintThickness; Texture2D m_transmissionThicknessMap; uint m_transmissionThicknessMapUvIndex; - float m_shrinkFactor; - float m_transmissionNdLBias; - float m_distanceAttenuation; } // Callback function for ParallaxMapping.azsli diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl index 5e02da679e..600617aa6f 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl @@ -243,6 +243,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float surface.transmission.tint = transmissionTintThickness.rgb; surface.transmission.thickness = transmissionTintThickness.w; surface.transmission.transmissionParams = MaterialSrg::m_transmissionParams; + surface.transmission.scatterDistance = MaterialSrg::m_scatterDistance; // ------- Anisotropy ------- @@ -277,14 +278,14 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // ------- Thin Object Light Transmission ------- - // Angle offset for subsurface scattering through thin objects - lightingData.transmissionNdLBias = MaterialSrg::m_transmissionNdLBias; - // Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection - lightingData.shrinkFactor = MaterialSrg::m_shrinkFactor; + lightingData.shrinkFactor = surface.transmission.transmissionParams.x; + + // Angle offset for subsurface scattering through thin objects + lightingData.transmissionNdLBias = surface.transmission.transmissionParams.y; // Attenuation applied to hide artifacts due to low-res shadow maps - lightingData.distanceAttenuation = MaterialSrg::m_distanceAttenuation; + lightingData.distanceAttenuation = surface.transmission.transmissionParams.z; // ------- Clearcoat ------- diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_SubsurfaceState.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_SubsurfaceState.lua index e705d7867a..1f1979e3a9 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_SubsurfaceState.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_SubsurfaceState.lua @@ -92,23 +92,34 @@ function ProcessEditor(context) -- Update visibility for transmission... - local transmissionEnabled = TransmissionMode_None ~= context:GetMaterialPropertyValue_enum("subsurfaceScattering.transmissionMode") - - local commonTrasmissionVisibility - if(transmissionEnabled) then + local thickTransmissionEnabled = TransmissionMode_ThickObject == context:GetMaterialPropertyValue_enum("subsurfaceScattering.transmissionMode") + local thinTransmissionEnabled = TransmissionMode_ThinObject == context:GetMaterialPropertyValue_enum("subsurfaceScattering.transmissionMode") + + local commonTrasmissionVisibility = MaterialPropertyVisibility_Hidden + local thickTransmissionVisibility = MaterialPropertyVisibility_Hidden + local thinTransmissionVisibility = MaterialPropertyVisibility_Hidden + if (thickTransmissionEnabled or thinTransmissionEnabled) then commonTrasmissionVisibility = MaterialPropertyVisibility_Enabled - else - commonTrasmissionVisibility = MaterialPropertyVisibility_Hidden + + if(thickTransmissionEnabled) then + thickTransmissionVisibility = MaterialPropertyVisibility_Enabled + else -- thin transmission enabled + thinTransmissionVisibility = MaterialPropertyVisibility_Enabled + end end context:SetMaterialPropertyVisibility("subsurfaceScattering.thickness", commonTrasmissionVisibility) context:SetMaterialPropertyVisibility("subsurfaceScattering.thicknessMap", commonTrasmissionVisibility) context:SetMaterialPropertyVisibility("subsurfaceScattering.transmissionTint", commonTrasmissionVisibility) - context:SetMaterialPropertyVisibility("subsurfaceScattering.transmissionPower", commonTrasmissionVisibility) - context:SetMaterialPropertyVisibility("subsurfaceScattering.transmissionDistortion", commonTrasmissionVisibility) - context:SetMaterialPropertyVisibility("subsurfaceScattering.transmissionAttenuation", commonTrasmissionVisibility) + context:SetMaterialPropertyVisibility("subsurfaceScattering.transmissionPower", thickTransmissionVisibility) + context:SetMaterialPropertyVisibility("subsurfaceScattering.transmissionDistortion", thickTransmissionVisibility) + context:SetMaterialPropertyVisibility("subsurfaceScattering.transmissionAttenuation", thickTransmissionVisibility) + context:SetMaterialPropertyVisibility("subsurfaceScattering.shrinkFactor", thinTransmissionVisibility) + context:SetMaterialPropertyVisibility("subsurfaceScattering.transmissionNdLBias", thinTransmissionVisibility) + context:SetMaterialPropertyVisibility("subsurfaceScattering.distanceAttenuation", thinTransmissionVisibility) context:SetMaterialPropertyVisibility("subsurfaceScattering.transmissionScale", commonTrasmissionVisibility) - UpdateTextureDependentPropertyVisibility(context, transmissionEnabled, "subsurfaceScattering.thicknessMap", "subsurfaceScattering.useThicknessMap", "subsurfaceScattering.thicknessMapUv") + + UpdateTextureDependentPropertyVisibility(context, thickTransmissionEnabled or thinTransmissionEnabled, "subsurfaceScattering.thicknessMap", "subsurfaceScattering.useThicknessMap", "subsurfaceScattering.thicknessMapUv") end diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl index faa16b205a..7ec26d8342 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl @@ -325,6 +325,7 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) surface.transmission.tint = transmissionTintThickness.rgb; surface.transmission.thickness = transmissionTintThickness.w; surface.transmission.transmissionParams = MaterialSrg::m_transmissionParams; + surface.transmission.scatterDistance = MaterialSrg::m_scatterDistance; // ------- Lighting Data ------- @@ -343,14 +344,14 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) // ------- Thin Object Light Transmission ------- - // Angle offset for subsurface scattering through thin objects - lightingData.transmissionNdLBias = MaterialSrg::m_transmissionNdLBias; - // Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection - lightingData.shrinkFactor = MaterialSrg::m_shrinkFactor; + lightingData.shrinkFactor = surface.transmission.transmissionParams.x; + + // Angle offset for subsurface scattering through thin objects + lightingData.transmissionNdLBias = surface.transmission.transmissionParams.y; // Attenuation applied to hide artifacts due to low-res shadow maps - lightingData.distanceAttenuation = MaterialSrg::m_distanceAttenuation; + lightingData.distanceAttenuation = surface.transmission.transmissionParams.z; // ------- Occlusion ------- diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index baa48a5c44..13d2a09a2f 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -568,7 +568,7 @@ { "name": "thickness", "displayName": " Thickness", - "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", + "description": "In thick transmission mode: Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel\n\nIn thin transmission mode: This value modulates the distance traversed by light inside an object.", "type": "float", "defaultValue": 0.5, "min": 0.0, @@ -644,24 +644,16 @@ "type": "float", "defaultValue": 0.005, "min": 0.0, - "softMax": 0.05, - "connection": { - "type": "ShaderInput", - "name": "m_shrinkFactor" - } + "softMax": 0.05 }, { - "name": "transmissionAngleBias", + "name": "transmissionNdLBias", "displayName": " Angle Bias", "description": "cosine of angle to extend below (N . L = 0) in scattering through thin objects", "type": "float", "defaultValue": 0.1, "min": -1.0, - "softMax": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_transmissionNdLBias" - } + "softMax": 1.0 }, { "name": "distanceAttenuation", @@ -670,20 +662,16 @@ "type": "float", "defaultValue": 0.5, "min": 0.0, - "softMax": 4.0, - "connection": { - "type": "ShaderInput", - "name": "m_distanceAttenuation" - } + "softMax": 4.0 }, { "name": "transmissionScale", "displayName": " Scale", "description": "Strength of transmission", "type": "float", - "defaultValue": 0.01, + "defaultValue": 1.0, "min": 0.0, - "softMax": 1.0 + "softMax": 5.0 } ], "wrinkleLayers": [ @@ -1050,6 +1038,9 @@ "power": "subsurfaceScattering.transmissionPower", "distortion": "subsurfaceScattering.transmissionDistortion", "attenuation": "subsurfaceScattering.transmissionAttenuation", + "shrinkFactor": "subsurfaceScattering.shrinkFactor", + "transmissionNdLBias": "subsurfaceScattering.transmissionNdLBias", + "distanceAttenuation": "subsurfaceScattering.distanceAttenuation", "tintColor": "subsurfaceScattering.transmissionTint", "thickness": "subsurfaceScattering.thickness", "enabled": "subsurfaceScattering.enableSubsurfaceScattering", diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli index 630291c260..cf3bd14d8a 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_Common.azsli @@ -64,16 +64,13 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial // Elements of m_transmissionParams: // Thick object mode: (attenuation coefficient, power, distortion, scale) - // Thin object mode: (float3 scatter distance, scale) + // Thin object mode: (shrinkFactor, transmissionNdLBias, distanceAttenuation, scale) float4 m_transmissionParams; // (float3 TintColor, thickness) float4 m_transmissionTintThickness; Texture2D m_transmissionThicknessMap; uint m_transmissionThicknessMapUvIndex; - float m_shrinkFactor; - float m_transmissionNdLBias; - float m_distanceAttenuation; Texture2D m_wrinkle_baseColor_texture1; Texture2D m_wrinkle_baseColor_texture2; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index 47ec914815..863315c28c 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -75,19 +75,19 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI // Increase angle of influence (angle(N,L) -> angle(N,L) + acos(transmissionNdLBias)) to smooth transition regions float3 E = surface.albedo * saturate(lightingData.transmissionNdLBias + dot(-surface.normal, dirToLight)); - // Transmission distance modulated by hardcoded constant C (could be exposed as a weight of scattering distance for transmission) - const float C = 100.0f; - float s = transmissionDistance * C; + // Transmission distance modulated by hardcoded constant C and the thickness exposed parameter (in this case modulating the distance traversed by the light inside the object) + const float C = 300.0f; + float s = transmissionDistance * C * surface.transmission.thickness; // Use scattering color to weight thin object transmission color - const float3 invScattering = rcp(transmissionParams.xyz); + const float3 invScattering = rcp(max(surface.transmission.scatterDistance, float(0.00001))); // Albedo at front (surface point) is used to approximate irradiance at the back of the object // See observation 4 in [Jimenez J. et al, 2010] result = TransmissionKernel(s, invScattering) * lightIntensity * E * transmissionParams.w; // Alternative specific to skin translucency - // result = T(s) * lightIntensity * surface.albedo * E * transmissionParams.w; + // result = T(s) * lightIntensity * E * transmissionParams.w; // Distance attenuation applied to hide artifacts due to low-res projected areas onto shadowmaps (might need some work in the future) result /= max(1.0, attenuationDistance * attenuationDistance * lightingData.distanceAttenuation); diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/TransmissionSurfaceData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/TransmissionSurfaceData.azsli index 9b575de3ec..38916199b9 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/TransmissionSurfaceData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/TransmissionSurfaceData.azsli @@ -12,7 +12,8 @@ class TransmissionSurfaceData { float3 tint; float thickness; //!< pre baked local thickness, used for transmission - float4 transmissionParams; //!< parameters: thick mode->(attenuation coefficient, power, distortion, scale), thin mode: (float3 scatter distance, scale) + float4 transmissionParams; //!< parameters: thick mode->(attenuation coefficient, power, distortion, scale), thin mode: (shrinkFactor, transmissionNdLBias, distanceAttenuation, scale) + float3 scatterDistance; //!< scatter distance (same as in MaterialSrg) > void InitializeToZero(); }; @@ -22,4 +23,5 @@ void TransmissionSurfaceData::InitializeToZero() tint = float3(0.0f, 0.0f, 0.0f); thickness = 0.0f; transmissionParams = float4(0.0f, 0.0f, 0.0f, 0.0f); + scatterDistance = float3(0.0f, 0.0f, 0.0f); } diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctor.cpp b/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctor.cpp index 8c42160fff..b5d38e25fc 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctor.cpp @@ -26,6 +26,9 @@ namespace AZ ->Field("m_power", &SubsurfaceTransmissionParameterFunctor::m_power) ->Field("m_distortion", &SubsurfaceTransmissionParameterFunctor::m_distortion) ->Field("m_attenuation", &SubsurfaceTransmissionParameterFunctor::m_attenuation) + ->Field("m_shrinkFactor", &SubsurfaceTransmissionParameterFunctor::m_shrinkFactor) + ->Field("m_transmissionNdLBias", &SubsurfaceTransmissionParameterFunctor::m_transmissionNdLBias) + ->Field("m_distanceAttenuation", &SubsurfaceTransmissionParameterFunctor::m_distanceAttenuation) ->Field("m_tintColor", &SubsurfaceTransmissionParameterFunctor::m_tintColor) ->Field("m_thickness", &SubsurfaceTransmissionParameterFunctor::m_thickness) ->Field("m_enabled", &SubsurfaceTransmissionParameterFunctor::m_enabled) @@ -50,6 +53,9 @@ namespace AZ auto power = context.GetMaterialPropertyValue(m_power); auto distortion = context.GetMaterialPropertyValue(m_distortion); auto attenuation = context.GetMaterialPropertyValue(m_attenuation); + auto shrinkFactor = context.GetMaterialPropertyValue(m_shrinkFactor); + auto transmissionNdLBias = context.GetMaterialPropertyValue(m_transmissionNdLBias); + auto distanceAttenuation = context.GetMaterialPropertyValue(m_distanceAttenuation); auto tintColor = context.GetMaterialPropertyValue(m_tintColor); auto thickness = context.GetMaterialPropertyValue(m_thickness); auto scatterDistanceColor = context.GetMaterialPropertyValue(m_scatterDistanceColor); @@ -67,7 +73,9 @@ namespace AZ } else { - transmissionParams.Set(scatterDistance); + transmissionParams.SetX(shrinkFactor); + transmissionParams.SetY(transmissionNdLBias); + transmissionParams.SetZ(distanceAttenuation); transmissionParams.SetW(scale); } diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctor.h b/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctor.h index e412687947..17096e71a5 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctor.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctor.h @@ -37,6 +37,9 @@ namespace AZ RPI::MaterialPropertyIndex m_power; RPI::MaterialPropertyIndex m_distortion; RPI::MaterialPropertyIndex m_attenuation; + RPI::MaterialPropertyIndex m_shrinkFactor; + RPI::MaterialPropertyIndex m_transmissionNdLBias; + RPI::MaterialPropertyIndex m_distanceAttenuation; RPI::MaterialPropertyIndex m_tintColor; RPI::MaterialPropertyIndex m_thickness; RPI::MaterialPropertyIndex m_enabled; diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.cpp b/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.cpp index a8ba40fb7f..140dfe8c6b 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.cpp @@ -25,6 +25,9 @@ namespace AZ ->Field("power", &SubsurfaceTransmissionParameterFunctorSourceData::m_power) ->Field("distortion", &SubsurfaceTransmissionParameterFunctorSourceData::m_distortion) ->Field("attenuation", &SubsurfaceTransmissionParameterFunctorSourceData::m_attenuation) + ->Field("shrinkFactor", &SubsurfaceTransmissionParameterFunctorSourceData::m_shrinkFactor) + ->Field("transmissionNdLBias", &SubsurfaceTransmissionParameterFunctorSourceData::m_transmissionNdLBias) + ->Field("distanceAttenuation", &SubsurfaceTransmissionParameterFunctorSourceData::m_distanceAttenuation) ->Field("tintColor", &SubsurfaceTransmissionParameterFunctorSourceData::m_tintColor) ->Field("thickness", &SubsurfaceTransmissionParameterFunctorSourceData::m_thickness) ->Field("enabled", &SubsurfaceTransmissionParameterFunctorSourceData::m_enabled) @@ -48,6 +51,9 @@ namespace AZ functor->m_power = context.FindMaterialPropertyIndex(Name{ m_power }); functor->m_distortion = context.FindMaterialPropertyIndex(Name{ m_distortion }); functor->m_attenuation = context.FindMaterialPropertyIndex(Name{ m_attenuation }); + functor->m_shrinkFactor = context.FindMaterialPropertyIndex(Name{ m_shrinkFactor }); + functor->m_transmissionNdLBias = context.FindMaterialPropertyIndex(Name{ m_transmissionNdLBias }); + functor->m_distanceAttenuation = context.FindMaterialPropertyIndex(Name{ m_distanceAttenuation }); functor->m_tintColor = context.FindMaterialPropertyIndex(Name{ m_tintColor }); functor->m_thickness = context.FindMaterialPropertyIndex(Name{ m_thickness }); functor->m_enabled = context.FindMaterialPropertyIndex(Name{ m_enabled }); @@ -56,7 +62,8 @@ namespace AZ if (functor->m_mode.IsNull() || functor->m_scale.IsNull() || functor->m_power.IsNull() || functor->m_distortion.IsNull() || functor->m_tintColor.IsNull() || functor->m_thickness.IsNull() || functor->m_enabled.IsNull() || functor->m_attenuation.IsNull() || functor->m_scatterDistanceColor.IsNull() || - functor->m_scatterDistanceIntensity.IsNull()) + functor->m_scatterDistanceIntensity.IsNull() || functor->m_shrinkFactor.IsNull() || functor->m_transmissionNdLBias.IsNull() || + functor->m_distanceAttenuation.IsNull()) { return Failure(); } @@ -66,6 +73,9 @@ namespace AZ AddMaterialPropertyDependency(functor, functor->m_power); AddMaterialPropertyDependency(functor, functor->m_distortion); AddMaterialPropertyDependency(functor, functor->m_attenuation); + AddMaterialPropertyDependency(functor, functor->m_shrinkFactor); + AddMaterialPropertyDependency(functor, functor->m_transmissionNdLBias); + AddMaterialPropertyDependency(functor, functor->m_distanceAttenuation); AddMaterialPropertyDependency(functor, functor->m_tintColor); AddMaterialPropertyDependency(functor, functor->m_thickness); AddMaterialPropertyDependency(functor, functor->m_enabled); diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.h b/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.h index 9d074551c3..8d058243fa 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.h @@ -36,6 +36,9 @@ namespace AZ AZStd::string m_power; //!< material property for thick transmission power AZStd::string m_distortion; //!< material property for thick transmission distortion towards surface normal AZStd::string m_attenuation; //!< material property for thick transmission volume absorption + AZStd::string m_shrinkFactor; //!< material property for thin transmission position shrink factor towards surface normal + AZStd::string m_transmissionNdLBias; //!< material property for thin transmission bias of the NdL value + AZStd::string m_distanceAttenuation; //!< material property for thin transmission attenuation with distance AZStd::string m_tintColor; //!< material property for transmission tint AZStd::string m_thickness; //!< material property for normalized object thickness AZStd::string m_enabled; //!< material property for subsurface scattering feature switch (enabled or disabled) From 3cac520280a586e38292f6906947b143ac9147e7 Mon Sep 17 00:00:00 2001 From: nemerle <96597+nemerle@users.noreply.github.com> Date: Tue, 11 Jan 2022 00:47:00 +0100 Subject: [PATCH 085/620] Fix non-unity windows build Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> --- Code/Framework/AzCore/Tests/TestCatalog.h | 1 + Gems/Blast/Code/Include/Blast/BlastSystemBus.h | 1 + Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp | 1 + .../Code/Source/Components/TerrainPhysicsColliderComponent.cpp | 2 ++ 4 files changed, 5 insertions(+) diff --git a/Code/Framework/AzCore/Tests/TestCatalog.h b/Code/Framework/AzCore/Tests/TestCatalog.h index 9a1fb9b5e6..bbcd952f78 100644 --- a/Code/Framework/AzCore/Tests/TestCatalog.h +++ b/Code/Framework/AzCore/Tests/TestCatalog.h @@ -11,6 +11,7 @@ #include #include #include +#include namespace UnitTest { diff --git a/Gems/Blast/Code/Include/Blast/BlastSystemBus.h b/Gems/Blast/Code/Include/Blast/BlastSystemBus.h index 95ffd75057..bda684181a 100644 --- a/Gems/Blast/Code/Include/Blast/BlastSystemBus.h +++ b/Gems/Blast/Code/Include/Blast/BlastSystemBus.h @@ -8,6 +8,7 @@ #pragma once #include +#include #include #include diff --git a/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp b/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp index 56c785b310..70e7c28bac 100644 --- a/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp +++ b/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index 8c2c0e80b6..fccbedd8fa 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -6,12 +6,14 @@ * */ + #include #include #include #include #include +#include #include #include #include From 7b6ce50fe87c8306bc6b3ab1b65e4ddbdaf463be Mon Sep 17 00:00:00 2001 From: nemerle <96597+nemerle@users.noreply.github.com> Date: Tue, 11 Jan 2022 00:52:21 +0100 Subject: [PATCH 086/620] Remove un-needed `Requests` namespace use Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp index 90014578ea..13c01b2efc 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp @@ -139,7 +139,7 @@ namespace AZ::IO::Requests { } - Requests::ReportData::ReportData(ReportType reportType) + ReportData::ReportData(ReportType reportType) : m_reportType(reportType) { } From 708eabe5de5205dbfb4fa016c40f6cc7e7f23d12 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 11 Jan 2022 10:32:03 -0600 Subject: [PATCH 087/620] Removed comment question Signed-off-by: Chris Galvan --- .../ImageProcessingAtom/Code/Source/Processing/Utils.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp index 44539ad33c..20e1b18e77 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp @@ -242,10 +242,6 @@ namespace ImageProcessingAtom } } - // Should we actually put the GetSubImagePixelValue API in this Utils file instead, since it already has - // some conversion logic, and has the helper method for retrieving an entire image (LoadImageFromImageAsset) - // whereas this is a helper for retrieving a specific pixel from the image? - IImageObjectPtr LoadImageFromImageAsset(const AZ::Data::Asset& imageAsset) { if (!imageAsset.IsReady()) From 16bad281aeeda76b8d097c486f0154767fe5f635 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 11 Jan 2022 10:40:59 -0600 Subject: [PATCH 088/620] Changed GetSubImagePixelValue parameter order so x,y are first Signed-off-by: Chris Galvan --- .../Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h | 2 +- .../RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 4 ++-- Gems/GradientSignal/Code/Source/ImageAsset.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index 1db2a63b1c..bdb68601a9 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -87,7 +87,7 @@ namespace AZ //! Get image pixel value for specified mip and slice template - T GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex = 0); + T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index f1d9b1782b..37f0e04116 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -215,7 +215,7 @@ namespace AZ } template<> - float StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -235,7 +235,7 @@ namespace AZ } template<> - AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index afa233e5cb..e88a574768 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -198,7 +198,7 @@ namespace GradientSignal uint32_t x = static_cast(pixelLookup.GetX()) % width; uint32_t y = static_cast(pixelLookup.GetY()) % height; - return imageAsset->GetSubImagePixelValue(0, 0, x, y, 0); + return imageAsset->GetSubImagePixelValue(x, y); } } From 5dc97e7e4b5e9272f4940628833315007a060c8b Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Tue, 11 Jan 2022 16:34:22 -0800 Subject: [PATCH 089/620] Fix Prefab instance assets not preloading PrefabCatchmentProcessor::ProcessPrefab was no longer updating the ProcessedObjectStore's referenced object list, this change exposes the referenced asset list in the new PrefabDocument API and uses them to update the referenced asset list. Signed-off-by: Nicholas Van Sickle --- .../Prefab/Spawnable/PrefabCatchmentProcessor.cpp | 1 + .../Prefab/Spawnable/PrefabDocument.cpp | 12 +++++++++++- .../Prefab/Spawnable/PrefabDocument.h | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp index 40cd52cac8..a5ca034c36 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp @@ -64,6 +64,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZStd::move(uniqueName), context.GetSourceUuid(), AZStd::move(serializer)); AZ_Assert(spawnable, "Failed to create a new spawnable."); + object.GetReferencedAssets() = prefab.GetReferencedAssets(); Instance& instance = prefab.GetInstance(); // Resolve entity aliases that store PrefabDOM information to use the spawnable instead. This is done before the entities are // moved from the instance as they'd otherwise can't be found. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp index 04fdea30d2..230c2226cd 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp @@ -124,12 +124,22 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils return *m_instance; } + AZStd::vector>& PrefabDocument::GetReferencedAssets() + { + return m_referencedAssets; + } + + const AZStd::vector>& PrefabDocument::GetReferencedAssets() const + { + return m_referencedAssets; + } + bool PrefabDocument::ConstructInstanceFromPrefabDom(const PrefabDom& prefab) { using namespace AzToolsFramework::Prefab; m_instance->Reset(); - if (PrefabDomUtils::LoadInstanceFromPrefabDom(*m_instance, prefab, PrefabDomUtils::LoadFlags::AssignRandomEntityId)) + if (PrefabDomUtils::LoadInstanceFromPrefabDom(*m_instance, prefab, m_referencedAssets, PrefabDomUtils::LoadFlags::AssignRandomEntityId)) { return true; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h index 215daf7f71..661dba5edf 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h @@ -53,12 +53,16 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AzToolsFramework::Prefab::Instance& GetInstance(); const AzToolsFramework::Prefab::Instance& GetInstance() const; + AZStd::vector>& GetReferencedAssets(); + const AZStd::vector>& GetReferencedAssets() const; + private: bool ConstructInstanceFromPrefabDom(const PrefabDom& prefab); mutable PrefabDom m_dom; AZStd::unique_ptr m_instance; AZStd::string m_name; + AZStd::vector> m_referencedAssets; mutable bool m_isDirty{ false }; }; } // namespace AzToolsFramework::Prefab::PrefabConversionUtils From 2e19b703ef00e4f1bc94a904901c83f2e6fa3e3e Mon Sep 17 00:00:00 2001 From: nemerle <96597+nemerle@users.noreply.github.com> Date: Wed, 12 Jan 2022 01:37:02 +0100 Subject: [PATCH 090/620] fix release build Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> --- Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp b/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp index 45a95a71d7..f799e8e69f 100644 --- a/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp +++ b/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp @@ -286,7 +286,9 @@ namespace Audio return sResult; } - CATLAudioFileEntry::CATLAudioFileEntry(const char * const filePath, IATLAudioFileEntryData * const implData) + +#endif // !AUDIO_RELEASE + CATLAudioFileEntry::CATLAudioFileEntry(const char* const filePath, IATLAudioFileEntryData* const implData) : m_filePath(filePath) , m_fileSize(0) , m_useCount(0) @@ -299,6 +301,4 @@ namespace Audio } CATLAudioFileEntry::~CATLAudioFileEntry() = default; - -#endif // !AUDIO_RELEASE } // namespace Audio From 010e8a5df1a1c10f42de01f25d071a68cdcdb381 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 12 Jan 2022 12:28:52 -0600 Subject: [PATCH 091/620] Reverted changes to image gradient asset (will put in separate PR) Signed-off-by: Chris Galvan --- Gems/GradientSignal/Code/CMakeLists.txt | 1 - .../Components/ImageGradientComponent.h | 3 -- .../Code/Include/GradientSignal/ImageAsset.h | 3 +- .../GradientSignal/Code/Source/ImageAsset.cpp | 28 ++++++++++--------- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index 08d6c82926..d4cf666630 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -21,7 +21,6 @@ ly_add_target( AZ::AzCore AZ::AtomCore AZ::AzFramework - Gem::Atom_RPI.Public Gem::SurfaceData Gem::ImageProcessingAtom.Headers Gem::LmbrCentral diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index bbb22a061d..85aa33137b 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -11,8 +11,6 @@ #include #include -#include - #include #include #include @@ -36,7 +34,6 @@ namespace GradientSignal AZ_RTTI(ImageGradientConfig, "{1BDB5DA4-A4A8-452B-BE6D-6BD451D4E7CD}", AZ::ComponentConfig); static void Reflect(AZ::ReflectContext* context); AZ::Data::Asset m_imageAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; - AZ::Data::Asset m_streamingImageAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; float m_tilingX = 1.0f; float m_tilingY = 1.0f; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h index 811d74082d..4ffab0b4b4 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h @@ -12,7 +12,6 @@ #include #include #include -#include namespace AZ { @@ -62,6 +61,6 @@ namespace GradientSignal } }; - float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue); + float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue); } // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index e88a574768..95d32fced1 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -20,7 +20,6 @@ namespace { - // Could (should) move these RetrieveValue helper methods over to where our new API lives template float RetrieveValue(const AZ::u8* mem, size_t index) { @@ -152,17 +151,17 @@ namespace GradientSignal return true; } - float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) + float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) { if (imageAsset.IsReady()) { - const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - auto height = imageDescriptor.m_size.m_height; + const auto& image = imageAsset.Get(); + AZStd::size_t imageSize = image->m_imageWidth * image->m_imageHeight * + static_cast(image->m_bytesPerPixel); - if (width > 0 - && height > 0 - ) + if (image->m_imageWidth > 0 && + image->m_imageHeight > 0 && + image->m_imageData.size() == imageSize) { // When "rasterizing" from uvs, a range of 0-1 has slightly different meanings depending on the sampler state. // For repeating states (Unbounded/None, Repeat), a uv value of 1 should wrap around back to our 0th pixel. @@ -185,8 +184,8 @@ namespace GradientSignal // A 16x16 pixel image and tilingX = tilingY = 1 maps the uv range of 0-1 to 0-16 pixels. // A 16x16 pixel image and tilingX = tilingY = 1.5 maps the uv range of 0-1 to 0-24 pixels. - const AZ::Vector3 tiledDimensions((width * tilingX), - (height * tilingY), + const AZ::Vector3 tiledDimensions((image->m_imageWidth * tilingX), + (image->m_imageHeight * tilingY), 0.0f); // Convert from uv space back to pixel space @@ -195,10 +194,13 @@ namespace GradientSignal // UVs outside the 0-1 range are treated as infinitely tiling, so that we behave the same as the // other gradient generators. As mentioned above, if clamping is desired, we expect it to be applied // outside of this function. - uint32_t x = static_cast(pixelLookup.GetX()) % width; - uint32_t y = static_cast(pixelLookup.GetY()) % height; + size_t x = static_cast(pixelLookup.GetX()) % image->m_imageWidth; + size_t y = static_cast(pixelLookup.GetY()) % image->m_imageHeight; - return imageAsset->GetSubImagePixelValue(x, y); + // Flip the y because images are stored in reverse of our world axes + size_t index = ((image->m_imageHeight - 1) - y) * image->m_imageWidth + x; + + return RetrieveValue(image->m_imageData.data(), index, image->m_imageFormat); } } From 830c55dd7c3e0597bbba2479143ef44b45508b9a Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 12 Jan 2022 12:30:48 -0600 Subject: [PATCH 092/620] Reverted two other small changes I missed Signed-off-by: Chris Galvan --- .../Include/GradientSignal/Components/ImageGradientComponent.h | 1 - Gems/GradientSignal/Code/Source/ImageAsset.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index 85aa33137b..8214436f83 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -10,7 +10,6 @@ #include #include - #include #include #include diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index 95d32fced1..7e73dc32d6 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -184,7 +184,7 @@ namespace GradientSignal // A 16x16 pixel image and tilingX = tilingY = 1 maps the uv range of 0-1 to 0-16 pixels. // A 16x16 pixel image and tilingX = tilingY = 1.5 maps the uv range of 0-1 to 0-24 pixels. - const AZ::Vector3 tiledDimensions((image->m_imageWidth * tilingX), + const AZ::Vector3 tiledDimensions((image->m_imageWidth * tilingX), (image->m_imageHeight * tilingY), 0.0f); From b772d7b3e8abd15acaf1db40d5a79357927f014d Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 11:10:34 -0800 Subject: [PATCH 093/620] Removing multiplayer script canvas translation files from the scriptcanvas gem; these will eventually move into AutomatedTesting project once repopulated (if needed). Signed-off-by: Gene Walters --- ...orityToAutonomousNoParamsNotifyEvent.names | 50 -- .../AuthorityToAutonomousNotifyEvent.names | 56 --- ...AuthorityToClientNoParamsNotifyEvent.names | 50 -- .../AuthorityToClientNotifyEvent.names | 56 --- ...nomousToAuthorityNoParamsNotifyEvent.names | 50 -- .../AutonomousToAuthorityNotifyEvent.names | 56 --- .../ServerToAuthorityNoParamNotifyEvent.names | 50 -- .../ServerToAuthorityNotifyEvent.names | 56 --- .../Classes/NetworkTestPlayerComponent.names | 438 ------------------ ...tworkTestPlayerComponentNetworkInput.names | 129 ------ 10 files changed, 991 deletions(-) delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names deleted file mode 100644 index 216212ca4a..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names +++ /dev/null @@ -1,50 +0,0 @@ -{ - "entries": [ - { - "base": "AuthorityToAutonomousNoParams Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Authority To Autonomous No Params Notify Event" - }, - "slots": [ - { - "base": "AuthorityToAutonomousNoParams Notify Event", - "details": { - "name": "AuthorityToAutonomousNoParams Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names deleted file mode 100644 index 50c0ec6013..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names +++ /dev/null @@ -1,56 +0,0 @@ -{ - "entries": [ - { - "base": "AuthorityToAutonomous Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Authority To Autonomous Notify Event" - }, - "slots": [ - { - "base": "someFloat", - "details": { - "name": "someFloat" - } - }, - { - "base": "AuthorityToAutonomous Notify Event", - "details": { - "name": "AuthorityToAutonomous Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names deleted file mode 100644 index bf5b975d63..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names +++ /dev/null @@ -1,50 +0,0 @@ -{ - "entries": [ - { - "base": "AuthorityToClientNoParams Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Authority To Client No Params Notify Event" - }, - "slots": [ - { - "base": "AuthorityToClientNoParams Notify Event", - "details": { - "name": "AuthorityToClientNoParams Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names deleted file mode 100644 index d3ba2e9299..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names +++ /dev/null @@ -1,56 +0,0 @@ -{ - "entries": [ - { - "base": "AuthorityToClient Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Authority To Client Notify Event" - }, - "slots": [ - { - "base": "someFloat", - "details": { - "name": "someFloat" - } - }, - { - "base": "AuthorityToClient Notify Event", - "details": { - "name": "AuthorityToClient Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names deleted file mode 100644 index ba5f7aec0c..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names +++ /dev/null @@ -1,50 +0,0 @@ -{ - "entries": [ - { - "base": "AutonomousToAuthorityNoParams Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Autonomous To Authority No Params Notify Event" - }, - "slots": [ - { - "base": "AutonomousToAuthorityNoParams Notify Event", - "details": { - "name": "AutonomousToAuthorityNoParams Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names deleted file mode 100644 index 73566d177e..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names +++ /dev/null @@ -1,56 +0,0 @@ -{ - "entries": [ - { - "base": "AutonomousToAuthority Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Autonomous To Authority Notify Event" - }, - "slots": [ - { - "base": "someFloat", - "details": { - "name": "someFloat" - } - }, - { - "base": "AutonomousToAuthority Notify Event", - "details": { - "name": "AutonomousToAuthority Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names deleted file mode 100644 index b6694211cd..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names +++ /dev/null @@ -1,50 +0,0 @@ -{ - "entries": [ - { - "base": "ServerToAuthorityNoParam Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Server To Authority No Param Notify Event" - }, - "slots": [ - { - "base": "ServerToAuthorityNoParam Notify Event", - "details": { - "name": "ServerToAuthorityNoParam Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names deleted file mode 100644 index 71ab303260..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names +++ /dev/null @@ -1,56 +0,0 @@ -{ - "entries": [ - { - "base": "ServerToAuthority Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Server To Authority Notify Event" - }, - "slots": [ - { - "base": "someFloat", - "details": { - "name": "someFloat" - } - }, - { - "base": "ServerToAuthority Notify Event", - "details": { - "name": "ServerToAuthority Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponent.names deleted file mode 100644 index 22636e0453..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponent.names +++ /dev/null @@ -1,438 +0,0 @@ -{ - "entries": [ - { - "base": "NetworkTestPlayerComponent", - "context": "BehaviorClass", - "variant": "", - "details": { - "name": "Network Test Player Component" - }, - "methods": [ - { - "base": "AutonomousToAuthority", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Autonomous To Authority" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Autonomous To Authority is invoked" - }, - "details": { - "name": "Autonomous To Authority" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "float" - } - } - ] - }, - { - "base": "ServerToAuthority", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Server To Authority" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Server To Authority is invoked" - }, - "details": { - "name": "Server To Authority" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "float" - } - } - ] - }, - { - "base": "AutonomousToAuthorityByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Autonomous To Authority By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Autonomous To Authority By Entity Id is invoked" - }, - "details": { - "name": "Autonomous To Authority By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "some Float" - } - } - ] - }, - { - "base": "ServerToAuthorityByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Server To Authority By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Server To Authority By Entity Id is invoked" - }, - "details": { - "name": "Server To Authority By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "some Float" - } - } - ] - }, - { - "base": "AutonomousToAuthorityNoParams", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Autonomous To Authority No Params" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Autonomous To Authority No Params is invoked" - }, - "details": { - "name": "Autonomous To Authority No Params" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - } - ] - }, - { - "base": "AuthorityToAutonomous", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Autonomous" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Autonomous is invoked" - }, - "details": { - "name": "Authority To Autonomous" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "float" - } - } - ] - }, - { - "base": "AuthorityToClientNoParams", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Client No Params" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Client No Params is invoked" - }, - "details": { - "name": "Authority To Client No Params" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - } - ] - }, - { - "base": "AuthorityToClientByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Client By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Client By Entity Id is invoked" - }, - "details": { - "name": "Authority To Client By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "some Float" - } - } - ] - }, - { - "base": "AuthorityToClient", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Client" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Client is invoked" - }, - "details": { - "name": "Authority To Client" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "float" - } - } - ] - }, - { - "base": "AuthorityToAutonomousNoParams", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Autonomous No Params" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Autonomous No Params is invoked" - }, - "details": { - "name": "Authority To Autonomous No Params" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - } - ] - }, - { - "base": "ServerToAuthorityNoParamByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Server To Authority No Param By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Server To Authority No Param By Entity Id is invoked" - }, - "details": { - "name": "Server To Authority No Param By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - } - ] - }, - { - "base": "AuthorityToClientNoParamsByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Client No Params By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Client No Params By Entity Id is invoked" - }, - "details": { - "name": "Authority To Client No Params By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - } - ] - }, - { - "base": "AuthorityToAutonomousByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Autonomous By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Autonomous By Entity Id is invoked" - }, - "details": { - "name": "Authority To Autonomous By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "some Float" - } - } - ] - }, - { - "base": "AutonomousToAuthorityNoParamsByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Autonomous To Authority No Params By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Autonomous To Authority No Params By Entity Id is invoked" - }, - "details": { - "name": "Autonomous To Authority No Params By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - } - ] - }, - { - "base": "AuthorityToAutonomousNoParamsByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Autonomous No Params By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Autonomous No Params By Entity Id is invoked" - }, - "details": { - "name": "Authority To Autonomous No Params By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - } - ] - }, - { - "base": "ServerToAuthorityNoParam", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Server To Authority No Param" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Server To Authority No Param is invoked" - }, - "details": { - "name": "Server To Authority No Param" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names b/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names deleted file mode 100644 index d8c016db0f..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names +++ /dev/null @@ -1,129 +0,0 @@ -{ - "entries": [ - { - "base": "NetworkTestPlayerComponentNetworkInput", - "context": "BehaviorClass", - "variant": "", - "details": { - "name": "Network Test Player Component Network Input" - }, - "methods": [ - { - "base": "CreateFromValues", - "context": "NetworkTestPlayerComponentNetworkInput", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Create From Values" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Create From Values is invoked" - }, - "details": { - "name": "Create From Values" - }, - "params": [ - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "left Right" - } - } - ], - "results": [ - { - "typeid": "{12A1776B-61F6-4E5F-356A-AD718A62051F}", - "details": { - "name": "Network Test Player Component Network Input" - } - } - ] - }, - { - "base": "GetFwdBack", - "details": { - "name": "Get Fwd Back" - }, - "params": [ - { - "typeid": "{12A1776B-61F6-4E5F-356A-AD718A62051F}", - "details": { - "name": "Network Test Player Component Network Input" - } - } - ], - "results": [ - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "Fwd Back" - } - } - ] - }, - { - "base": "SetFwdBack", - "details": { - "name": "Set Fwd Back" - }, - "params": [ - { - "typeid": "{12A1776B-61F6-4E5F-356A-AD718A62051F}", - "details": { - "name": "Network Test Player Component Network Input" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "Fwd Back" - } - } - ] - }, - { - "base": "GetLeftRight", - "details": { - "name": "Get Left Right" - }, - "params": [ - { - "typeid": "{12A1776B-61F6-4E5F-356A-AD718A62051F}", - "details": { - "name": "Network Test Player Component Network Input" - } - } - ], - "results": [ - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "Left Right" - } - } - ] - }, - { - "base": "SetLeftRight", - "details": { - "name": "Set Left Right" - }, - "params": [ - { - "typeid": "{12A1776B-61F6-4E5F-356A-AD718A62051F}", - "details": { - "name": "Network Test Player Component Network Input" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "Left Right" - } - } - ] - } - ] - } - ] -} \ No newline at end of file From 561ff40c8154c335ad435086923a20aefa66a2d5 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 11:13:10 -0800 Subject: [PATCH 094/620] Creating a new multiplayer component which we'll assign to a networked level entity (as opposed to a network player). Signed-off-by: Gene Walters --- ...workTestLevelEntityComponent.AutoComponent.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml new file mode 100644 index 0000000000..2fd196a2f6 --- /dev/null +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml @@ -0,0 +1,15 @@ + + + + + + + + + From ee3196d64a9d31929951ad60134b22dbe4b1db02 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 11:31:45 -0800 Subject: [PATCH 095/620] Removed an RPC that's now being used inside the NetLevelEntity autocomponent Signed-off-by: Gene Walters --- .../Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml index 251d2b25af..b4dd35d741 100644 --- a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml @@ -29,8 +29,6 @@ - - From 3b84049a1d12409d0cfa7bffcd5a059cc592915f Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 12:18:06 -0800 Subject: [PATCH 096/620] Adding NetworkTestLevelEntityComponent to cmake for compilation Signed-off-by: Gene Walters --- AutomatedTesting/Gem/Code/automatedtesting_files.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/AutomatedTesting/Gem/Code/automatedtesting_files.cmake b/AutomatedTesting/Gem/Code/automatedtesting_files.cmake index eb619104a4..1f6dbbd772 100644 --- a/AutomatedTesting/Gem/Code/automatedtesting_files.cmake +++ b/AutomatedTesting/Gem/Code/automatedtesting_files.cmake @@ -12,4 +12,5 @@ set(FILES Source/AutomatedTestingSystemComponent.cpp Source/AutomatedTestingSystemComponent.h Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml + Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml ) From 4e811d5af8383844889ed45f903b8650319c0d08 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 12:19:59 -0800 Subject: [PATCH 097/620] Small update: adding the component type to a warning in order to help debug what component is failing Signed-off-by: Gene Walters --- Code/Framework/AzCore/AzCore/Component/Component.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Component/Component.cpp b/Code/Framework/AzCore/AzCore/Component/Component.cpp index c9829c6dd8..c11e4ef69f 100644 --- a/Code/Framework/AzCore/AzCore/Component/Component.cpp +++ b/Code/Framework/AzCore/AzCore/Component/Component.cpp @@ -49,7 +49,7 @@ namespace AZ return m_entity->GetId(); } - AZ_Warning("System", false, "Can't get component %p entity ID as it is not attached to an entity yet!", this); + AZ_Warning("System", false, "Can't get component (type: %s, addr: %p) entity ID as it is not attached to an entity yet!", RTTI_GetTypeName(), this); return EntityId(); } @@ -60,7 +60,7 @@ namespace AZ return NamedEntityId(m_entity->GetId(), m_entity->GetName()); } - AZ_Warning("System", false, "Can't get component %p entity ID as it is not attached to an entity yet!", this); + AZ_Warning("System", false, "Can't get component (type: %s, addr: %p) entity ID as it is not attached to an entity yet!", RTTI_GetTypeName(), this); return NamedEntityId(); } From a635e935e3893ad974e92a52fe4c71a115f1a325 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 12:20:46 -0800 Subject: [PATCH 098/620] minor typo fix on code warning Signed-off-by: Gene Walters --- Code/Framework/AzCore/AzCore/Component/Entity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/Component/Entity.cpp b/Code/Framework/AzCore/AzCore/Component/Entity.cpp index c5cda98f2c..db9ead93ad 100644 --- a/Code/Framework/AzCore/AzCore/Component/Entity.cpp +++ b/Code/Framework/AzCore/AzCore/Component/Entity.cpp @@ -230,7 +230,7 @@ namespace AZ EBUS_EVENT_ID(m_id, EntityBus, OnEntityDeactivated, m_id); EBUS_EVENT(EntitySystemBus, OnEntityDeactivated, m_id); - AZ_Assert(m_state == State::Active, "Component should be in Active state to br Deactivated!"); + AZ_Assert(m_state == State::Active, "Component should be in Active state to be Deactivated!"); SetState(State::Deactivating); for (ComponentArrayType::reverse_iterator it = m_components.rbegin(); it != m_components.rend(); ++it) From 49a0c78013391ca62424560a05a59434ff30c8f9 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 12:33:28 -0800 Subject: [PATCH 099/620] Check if transform component is attached to an entity before sending out notifications that rely upon having an entity; this stops runtime warnings when calling GetEntityId() Signed-off-by: Gene Walters --- .../Components/TransformComponent.cpp | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp index 809f664a10..e4e0ea08b2 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp @@ -585,21 +585,25 @@ namespace AzFramework EBUS_EVENT_PTR(m_notificationBus, AZ::TransformNotificationBus, OnParentChanged, oldParent, parentId); m_parentChangedEvent.Signal(oldParent, parentId); - if (oldParent != parentId) // Don't send removal notification while activating. + // Check if we're attached to an entity; the following notifications rely upon having a valid entity id + if (m_entity != nullptr) { - EBUS_EVENT_ID(oldParent, AZ::TransformNotificationBus, OnChildRemoved, GetEntityId()); - auto oldParentTransform = AZ::TransformBus::FindFirstHandler(oldParent); - if (oldParentTransform) + if (oldParent != parentId) // Don't send removal notification while activating. { - oldParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Removed, GetEntityId()); + EBUS_EVENT_ID(oldParent, AZ::TransformNotificationBus, OnChildRemoved, GetEntityId()); + auto oldParentTransform = AZ::TransformBus::FindFirstHandler(oldParent); + if (oldParentTransform) + { + oldParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Removed, GetEntityId()); + } } - } - EBUS_EVENT_ID(parentId, AZ::TransformNotificationBus, OnChildAdded, GetEntityId()); - auto newParentTransform = AZ::TransformBus::FindFirstHandler(parentId); - if (newParentTransform) - { - newParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Added, GetEntityId()); + EBUS_EVENT_ID(parentId, AZ::TransformNotificationBus, OnChildAdded, GetEntityId()); + auto newParentTransform = AZ::TransformBus::FindFirstHandler(parentId); + if (newParentTransform) + { + newParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Added, GetEntityId()); + } } } From ffde76208154d9e6c20f44f1d151eff82e763e9e Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 12:43:39 -0800 Subject: [PATCH 100/620] Minor comment tweak, and code readability Signed-off-by: Gene Walters --- .../Code/Source/Editor/MultiplayerEditorConnection.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index c8c1ed15bd..3ae4eb6444 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -100,8 +100,8 @@ namespace Multiplayer { // Editor Server Init is intended for non-release targets m_byteStream.Write(packet.GetAssetData().GetSize(), reinterpret_cast(packet.ModifyAssetData().GetBuffer())); - - // In case if this is the last update, process the byteStream buffer. Otherwise more packets are expected + + // If this is the last update then process the byteStream buffer. Otherwise more packets are expected if (packet.GetLastUpdate()) { // This is the last expected packet @@ -150,9 +150,8 @@ namespace Multiplayer AZ::Interface::Get()->BuildSpawnablesList(); // Load the level via the root spawnable that was registered - const AZ::CVarFixedString loadLevelString = "LoadLevel Root.spawnable"; const auto console = AZ::Interface::Get(); - console->PerformCommand(loadLevelString.c_str()); + console->PerformCommand("LoadLevel Root.spawnable"); // Setup the normal multiplayer connection AZ::Interface::Get()->InitializeMultiplayer(MultiplayerAgentType::DedicatedServer); From fabb2b186c4d3f0b9cd2aa49a1233977fa796e12 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 12 Jan 2022 20:52:57 -0800 Subject: [PATCH 101/620] chore: disable mouse move test Signed-off-by: Michael Pollind --- .../Tests/Input/QtEventToAzInputMapperTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index d7ab896462..31193f6f05 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -539,7 +539,7 @@ namespace UnitTest { }; - TEST_P(MoveMoveWrapParamQtEventToAzInputMapperFixture, MouseMove_NoAzHandlers_VerifyMouseMovementViewport) + TEST_P(MoveMoveWrapParamQtEventToAzInputMapperFixture, DISABLED_MouseMove_NoAzHandlers_VerifyMouseMovementViewport) { // setup From 1ed81ae973df283765def13b6f86cdbf5ec6ee52 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 13 Jan 2022 10:27:19 -0600 Subject: [PATCH 102/620] Added API for retrieving region of streaming image asset pixel values Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.h | 5 +- .../RPI.Reflect/Image/StreamingImageAsset.cpp | 50 +++++++++++++++---- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index bdb68601a9..e934ac8bcf 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -85,10 +85,13 @@ namespace AZ //! Get image data for specified mip and slice. It may return empty array if its mipchain assets are not loaded AZStd::array_view GetSubImageData(uint32_t mip, uint32_t slice); - //! Get image pixel value for specified mip and slice + //! Get single image pixel value for specified mip and slice template T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + //! Retrieve a region of image pixel values (float) for specified mip and slice + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 37f0e04116..e005fb7f9e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -18,13 +18,19 @@ namespace AZ template float RetrieveFloatValue(const AZ::u8* mem, size_t index) { - AZ_Assert(false, "Unsupported pixel format"); + static_assert(false, "Unsupported pixel format"); } template AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) { - AZ_Assert(false, "Unsupported pixel format"); + static_assert(false, "Unsupported pixel format"); + } + + template + AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index) + { + static_assert(false, "Unsupported pixel format"); } template <> @@ -217,18 +223,14 @@ namespace AZ template<> float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - // TODO: Use the component index - (void)componentIndex; + AZStd::vector values; + auto position = AZStd::make_pair(x, y); - auto imageData = GetSubImageData(mip, slice); + GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); - if (!imageData.empty()) + if (values.size() == 1) { - const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - size_t index = (y * width) + x; - - return Internal::RetrieveFloatValue(imageData.data(), index, imageDescriptor.m_format); + return values[0]; } return 0.0f; @@ -253,5 +255,31 @@ namespace AZ return 0; } + + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + + size_t outValuesIndex = 0; + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + { + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + size_t imageDataIndex = (y * width) + x; + + auto& outValue = const_cast(outValues[outValuesIndex++]); + outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + } + } + } + } } } From 2048d8c05c7e34d6ad5823640ab29ed4a5498449 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 13 Jan 2022 11:38:16 -0600 Subject: [PATCH 103/620] Added region-based APIs for uint and int Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.h | 9 ++ .../RPI.Reflect/Image/StreamingImageAsset.cpp | 125 ++++++++++++++---- 2 files changed, 109 insertions(+), 25 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index e934ac8bcf..f4dc891ff2 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -92,6 +92,12 @@ namespace AZ //! Retrieve a region of image pixel values (float) for specified mip and slice void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + //! Retrieve a region of image pixel values (uint) for specified mip and slice + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + + //! Retrieve a region of image pixel values (int) for specified mip and slice + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; @@ -134,6 +140,9 @@ namespace AZ uint32_t m_totalImageDataSize = 0; StreamingImageFlags m_flags = StreamingImageFlags::None; + + template + T GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); }; } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index e005fb7f9e..e21dd1f2c5 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -45,6 +45,12 @@ namespace AZ return 0; } + template <> + AZ::s32 RetrieveIntValue([[maybe_unused]] const AZ::u8* mem, [[maybe_unused]] size_t index) + { + return 0; + } + template <> AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) { @@ -56,19 +62,27 @@ namespace AZ { // 16 bits per channel auto actualMem = reinterpret_cast(mem); - actualMem += index; - return *actualMem / static_cast(std::numeric_limits::max()); + return actualMem[index] / static_cast(std::numeric_limits::max()); } template <> - AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index) + { + // 16 bits per channel + auto actualMem = reinterpret_cast(mem); + + return actualMem[index] / static_cast(std::numeric_limits::max()); + } + + template <> + float RetrieveFloatValue(const AZ::u8* mem, size_t index) { // 32 bits per channel - auto actualMem = reinterpret_cast(mem); + auto actualMem = reinterpret_cast(mem); actualMem += index; - return *actualMem / static_cast(std::numeric_limits::max()); + return *actualMem; } template <> @@ -85,6 +99,8 @@ namespace AZ { switch (format) { + case AZ::RHI::Format::R32_UINT: + return RetrieveFloatValue(mem, index); case AZ::RHI::Format::R32_FLOAT: return RetrieveFloatValue(mem, index); default: @@ -100,12 +116,21 @@ namespace AZ return RetrieveUintValue(mem, index); case AZ::RHI::Format::R16_UNORM: return RetrieveUintValue(mem, index); - case AZ::RHI::Format::R32_UINT: - return RetrieveUintValue(mem, index); default: return RetrieveUintValue(mem, index); } } + + AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) + { + switch (format) + { + case AZ::RHI::Format::R16_SINT: + return RetrieveIntValue(mem, index); + default: + return RetrieveIntValue(mem, index); + } + } } namespace RPI @@ -220,10 +245,10 @@ namespace AZ return mipChainAsset->GetSubImageData(mip - mipChain.m_mipOffset, slice); } - template<> - float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + template + T StreamingImageAsset::GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - AZStd::vector values; + AZStd::vector values; auto position = AZStd::make_pair(x, y); GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); @@ -233,27 +258,25 @@ namespace AZ return values[0]; } - return 0.0f; + return aznumeric_cast(0); + } + + template<> + float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); } template<> AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - // TODO: Use the component index - (void)componentIndex; + return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); + } - auto imageData = GetSubImageData(mip, slice); - - if (!imageData.empty()) - { - const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - size_t index = (y * width) + x; - - return Internal::RetrieveUintValue(imageData.data(), index, imageDescriptor.m_format); - } - - return 0; + template<> + AZ::s32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); } void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) @@ -281,5 +304,57 @@ namespace AZ } } } + + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + + size_t outValuesIndex = 0; + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + { + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + size_t imageDataIndex = (y * width) + x; + + auto& outValue = const_cast(outValues[outValuesIndex++]); + outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + } + } + } + } + + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + + size_t outValuesIndex = 0; + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + { + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + size_t imageDataIndex = (y * width) + x; + + auto& outValue = const_cast(outValues[outValuesIndex++]); + outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + } + } + } + } } } From 56837f48d9c75e3f5e0a8b3e7fa560b0e71287f7 Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Fri, 14 Jan 2022 16:29:00 +0000 Subject: [PATCH 104/620] Remove error state when user attempts to save empty script event. Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- .../Code/Include/ScriptEvents/ScriptEventDefinition.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventDefinition.cpp b/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventDefinition.cpp index e6c40cf789..3a6a411611 100644 --- a/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventDefinition.cpp +++ b/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventDefinition.cpp @@ -131,10 +131,7 @@ namespace ScriptEvents return AZ::Failure(AZStd::string::format("%s, invalid name specified, event name must only have alpha numeric characters, may not start with a number and may not have white space", name.c_str())); } - if (m_methods.empty()) - { - return AZ::Failure(AZStd::string::format("Script Events (%s) must provide at least one event otherwise they are unusable, be sure to add an event before saving.", name.c_str())); - } + AZ_Warning("Script Events", !m_methods.empty(), AZStd::string::format("Script Events (%s) must provide at least one event, otherwise they are unusable.", name.c_str()).c_str()); // Validate each method AZStd::string methodName; From c8e5bcc901c989c12c3e485df9427d0546d8d7ac Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 14 Jan 2022 12:01:32 -0800 Subject: [PATCH 105/620] Dont allow spawning netbound entities by default, we first need to initialize multiplayer and know our network agent type (dedicated-server/client-server/client). This will stop the editor playmode (which doesn't init multiplayer until it connects to the server) from spawning netbound entities Signed-off-by: Gene Walters --- Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h index dd2e7956ca..47238cc729 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h @@ -184,7 +184,7 @@ namespace Multiplayer double m_serverSendAccumulator = 0.0; float m_renderBlendFactor = 0.0f; float m_tickFactor = 0.0f; - bool m_spawnNetboundEntities = true; + bool m_spawnNetboundEntities = false; #if !defined(AZ_RELEASE_BUILD) MultiplayerEditorConnection m_editorConnectionListener; From e4bd28f636d9421bb1807bac8c1586afa26afe37 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 14 Jan 2022 13:48:37 -0800 Subject: [PATCH 106/620] Update NetworkSpawnableLibrary to only hold onto network.spawnables (instead of all spawnables) Signed-off-by: Gene Walters --- .../Source/NetworkEntity/NetworkSpawnableLibrary.cpp | 4 ++-- .../Code/Source/NetworkEntity/NetworkSpawnableLibrary.h | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp index f60778dbb4..7fb7bfdc39 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include namespace Multiplayer @@ -42,7 +41,8 @@ namespace Multiplayer auto enumerateCallback = [this](const AZ::Data::AssetId id, const AZ::Data::AssetInfo& info) { - if (info.m_assetType == AZ::AzTypeInfo::Uuid()) + if (info.m_assetType == AZ::AzTypeInfo::Uuid() && + info.m_relativePath.ends_with(".network.spawnable")) { ProcessSpawnableAsset(info.m_relativePath, id); } diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h index 0fc3ae07cc..db22ccf9de 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h @@ -22,13 +22,16 @@ namespace Multiplayer NetworkSpawnableLibrary(); ~NetworkSpawnableLibrary(); - - /// INetworkSpawnableLibrary overrides. + + //! INetworkSpawnableLibrary overrides. + //! @{ + // Iterates over all assets (on-disk and in-memory) and stores any spawnables that are "network.spawnables" + // This allows us to look up network spawnable assets by name or id for later use void BuildSpawnablesList() override; void ProcessSpawnableAsset(const AZStd::string& relativePath, AZ::Data::AssetId id) override; AZ::Name GetSpawnableNameFromAssetId(AZ::Data::AssetId assetId) override; AZ::Data::AssetId GetAssetIdByName(AZ::Name name) override; - + //! @} private: AZStd::unordered_map m_spawnables; From 786d6b5f85e7c1f5bf1f9ce8d24a0571c8d06ba1 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 18 Jan 2022 10:22:31 -0800 Subject: [PATCH 107/620] minor code readability tweak Signed-off-by: Gene Walters --- .../Code/Source/NetworkEntity/NetworkEntityManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp index fa524d464a..0a6aeea8a8 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp @@ -542,7 +542,7 @@ namespace Multiplayer optionalArgs.m_preInsertionCallback = [netSpawnableName, rootTransform = transform] (AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableEntityContainerView entities) { - bool shouldUpdateTransform = (rootTransform.IsClose(AZ::Transform::Identity()) == false); + const bool shouldUpdateTransform = !rootTransform.IsClose(AZ::Transform::Identity()); for (uint32_t netEntityIndex = 0, entitiesSize = aznumeric_cast(entities.size()); netEntityIndex < entitiesSize; ++netEntityIndex) From 798f6ea5bbda00574531de8fce30b277cb42c727 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 18 Jan 2022 15:41:37 -0600 Subject: [PATCH 108/620] Added support for additional formats Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.cpp | 109 ++++++++---------- 1 file changed, 51 insertions(+), 58 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index e21dd1f2c5..4e664ad3e2 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -51,58 +51,29 @@ namespace AZ return 0; } - template <> - AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) - { - return mem[index] / static_cast(std::numeric_limits::max()); - } - - template <> - AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) - { - // 16 bits per channel - auto actualMem = reinterpret_cast(mem); - - return actualMem[index] / static_cast(std::numeric_limits::max()); - } - - template <> - AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index) - { - // 16 bits per channel - auto actualMem = reinterpret_cast(mem); - - return actualMem[index] / static_cast(std::numeric_limits::max()); - } - - template <> - float RetrieveFloatValue(const AZ::u8* mem, size_t index) - { - // 32 bits per channel - auto actualMem = reinterpret_cast(mem); - actualMem += index; - - return *actualMem; - } - - template <> - float RetrieveFloatValue(const AZ::u8* mem, size_t index) - { - // 32 bits per channel - auto actualMem = reinterpret_cast(mem); - actualMem += index; - - return *actualMem; - } - float RetrieveFloatValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) { switch (format) { - case AZ::RHI::Format::R32_UINT: - return RetrieveFloatValue(mem, index); + case AZ::RHI::Format::R8_UNORM: + case AZ::RHI::Format::R8_SNORM: + case AZ::RHI::Format::A8_UNORM: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R16_FLOAT: + case AZ::RHI::Format::D16_UNORM: + case AZ::RHI::Format::R16_UNORM: + case AZ::RHI::Format::R16_SNORM: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::D32_FLOAT: case AZ::RHI::Format::R32_FLOAT: - return RetrieveFloatValue(mem, index); + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index]; + } default: return RetrieveFloatValue(mem, index); } @@ -112,10 +83,20 @@ namespace AZ { switch (format) { - case AZ::RHI::Format::R8_UNORM: - return RetrieveUintValue(mem, index); - case AZ::RHI::Format::R16_UNORM: - return RetrieveUintValue(mem, index); + case AZ::RHI::Format::R8_UINT: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R16_UINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R32_UINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index]; + } default: return RetrieveUintValue(mem, index); } @@ -125,8 +106,20 @@ namespace AZ { switch (format) { + case AZ::RHI::Format::R8_SINT: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } case AZ::RHI::Format::R16_SINT: - return RetrieveIntValue(mem, index); + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R32_SINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index]; + } default: return RetrieveIntValue(mem, index); } @@ -292,9 +285,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { size_t imageDataIndex = (y * width) + x; @@ -318,9 +311,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { size_t imageDataIndex = (y * width) + x; @@ -344,9 +337,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { size_t imageDataIndex = (y * width) + x; From 948d72e079eba67ca2b12e21e987ab2a373eab92 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 18 Jan 2022 16:22:25 -0600 Subject: [PATCH 109/620] Fixed logic error for iterating through the image data by region Signed-off-by: Chris Galvan --- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 4e664ad3e2..d9aa2f1c23 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -285,9 +285,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { size_t imageDataIndex = (y * width) + x; @@ -311,9 +311,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { size_t imageDataIndex = (y * width) + x; @@ -337,9 +337,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { size_t imageDataIndex = (y * width) + x; From c262696056811660aa3e55cb6a83136232fb12fb Mon Sep 17 00:00:00 2001 From: abrmich Date: Tue, 18 Jan 2022 16:13:28 -0800 Subject: [PATCH 110/620] Move remaining two LyShine headers to the gem Signed-off-by: abrmich --- Code/Legacy/CryCommon/crycommon_files.cmake | 2 -- Code/Legacy/CrySystem/System.cpp | 3 --- Code/Legacy/CrySystem/XConsole.cpp | 5 ----- .../FontBuilderWorker/FontBuilderWorker.cpp | 4 ++-- .../Code/Tests/Builders/CopyDependencyBuilderTest.cpp | 2 -- .../LyShine/Code/Include}/LyShine/Bus/UiCursorBus.h | 0 .../LyShine/Code/Include}/LyShine/UiAssetTypes.h | 0 Gems/LyShine/Code/lyshine_static_files.cmake | 2 ++ 8 files changed, 4 insertions(+), 14 deletions(-) rename {Code/Legacy/CryCommon => Gems/LyShine/Code/Include}/LyShine/Bus/UiCursorBus.h (100%) rename {Code/Legacy/CryCommon => Gems/LyShine/Code/Include}/LyShine/UiAssetTypes.h (100%) diff --git a/Code/Legacy/CryCommon/crycommon_files.cmake b/Code/Legacy/CryCommon/crycommon_files.cmake index a4d87c207a..479f0ec879 100644 --- a/Code/Legacy/CryCommon/crycommon_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_files.cmake @@ -100,8 +100,6 @@ set(FILES platform_impl.cpp Win32specific.h Win64specific.h - LyShine/UiAssetTypes.h - LyShine/Bus/UiCursorBus.h Maestro/Bus/EditorSequenceAgentComponentBus.h Maestro/Bus/EditorSequenceBus.h Maestro/Bus/EditorSequenceComponentBus.h diff --git a/Code/Legacy/CrySystem/System.cpp b/Code/Legacy/CrySystem/System.cpp index 7cf066f72e..0439b69efc 100644 --- a/Code/Legacy/CrySystem/System.cpp +++ b/Code/Legacy/CrySystem/System.cpp @@ -134,7 +134,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) #include -#include #include #include @@ -1374,7 +1373,6 @@ bool CSystem::HandleMessage([[maybe_unused]] HWND hWnd, UINT uMsg, WPARAM wParam // Fall through intended case WM_ENTERMENULOOP: { - UiCursorBus::Broadcast(&UiCursorInterface::IncrementVisibleCounter); return true; } case WM_CAPTURECHANGED: @@ -1392,7 +1390,6 @@ bool CSystem::HandleMessage([[maybe_unused]] HWND hWnd, UINT uMsg, WPARAM wParam // Fall through intended case WM_EXITMENULOOP: { - UiCursorBus::Broadcast(&UiCursorInterface::DecrementVisibleCounter); return (uMsg != WM_CAPTURECHANGED); } case WM_SYSKEYUP: diff --git a/Code/Legacy/CrySystem/XConsole.cpp b/Code/Legacy/CrySystem/XConsole.cpp index df82e34abe..e74b1e7c56 100644 --- a/Code/Legacy/CrySystem/XConsole.cpp +++ b/Code/Legacy/CrySystem/XConsole.cpp @@ -29,7 +29,6 @@ #include #include -#include //#define DEFENCE_CVAR_HASH_LOGGING // s should point to a buffer at least 65 chars long @@ -749,8 +748,6 @@ void CXConsole::ShowConsole(bool show, const int iRequestScrollMax) if (show && !m_bConsoleActive) { - UiCursorBus::Broadcast(&UiCursorBus::Events::IncrementVisibleCounter); - AzFramework::InputSystemCursorRequestBus::EventResult(m_previousSystemCursorState, AzFramework::InputDeviceMouse::Id, &AzFramework::InputSystemCursorRequests::GetSystemCursorState); @@ -760,8 +757,6 @@ void CXConsole::ShowConsole(bool show, const int iRequestScrollMax) } else if (!show && m_bConsoleActive) { - UiCursorBus::Broadcast(&UiCursorBus::Events::DecrementVisibleCounter); - AzFramework::InputSystemCursorRequestBus::Event(AzFramework::InputDeviceMouse::Id, &AzFramework::InputSystemCursorRequests::SetSystemCursorState, m_previousSystemCursorState); diff --git a/Gems/LmbrCentral/Code/Source/Builders/CopyDependencyBuilder/FontBuilderWorker/FontBuilderWorker.cpp b/Gems/LmbrCentral/Code/Source/Builders/CopyDependencyBuilder/FontBuilderWorker/FontBuilderWorker.cpp index 3fe399d05d..ccaa1700f9 100644 --- a/Gems/LmbrCentral/Code/Source/Builders/CopyDependencyBuilder/FontBuilderWorker/FontBuilderWorker.cpp +++ b/Gems/LmbrCentral/Code/Source/Builders/CopyDependencyBuilder/FontBuilderWorker/FontBuilderWorker.cpp @@ -9,7 +9,6 @@ #include "FontBuilderWorker.h" #include -#include #include #include @@ -52,7 +51,8 @@ namespace CopyDependencyBuilder if (fileExtension == "font" || fileExtension == "fontfamily") { - return azrtti_typeid(); + static AZ::Data::AssetType fontAssetType("{57767D37-0EBE-43BE-8F60-AB36D2056EF8}"); // form UiAssetTypes.h in the LyShine gem + return fontAssetType; } return AZ::Data::AssetType::CreateNull(); diff --git a/Gems/LmbrCentral/Code/Tests/Builders/CopyDependencyBuilderTest.cpp b/Gems/LmbrCentral/Code/Tests/Builders/CopyDependencyBuilderTest.cpp index 8b697f35f2..7767e4f239 100644 --- a/Gems/LmbrCentral/Code/Tests/Builders/CopyDependencyBuilderTest.cpp +++ b/Gems/LmbrCentral/Code/Tests/Builders/CopyDependencyBuilderTest.cpp @@ -19,8 +19,6 @@ #include #include -#include - #include #include #include diff --git a/Code/Legacy/CryCommon/LyShine/Bus/UiCursorBus.h b/Gems/LyShine/Code/Include/LyShine/Bus/UiCursorBus.h similarity index 100% rename from Code/Legacy/CryCommon/LyShine/Bus/UiCursorBus.h rename to Gems/LyShine/Code/Include/LyShine/Bus/UiCursorBus.h diff --git a/Code/Legacy/CryCommon/LyShine/UiAssetTypes.h b/Gems/LyShine/Code/Include/LyShine/UiAssetTypes.h similarity index 100% rename from Code/Legacy/CryCommon/LyShine/UiAssetTypes.h rename to Gems/LyShine/Code/Include/LyShine/UiAssetTypes.h diff --git a/Gems/LyShine/Code/lyshine_static_files.cmake b/Gems/LyShine/Code/lyshine_static_files.cmake index 925658e756..c1515f5978 100644 --- a/Gems/LyShine/Code/lyshine_static_files.cmake +++ b/Gems/LyShine/Code/lyshine_static_files.cmake @@ -11,6 +11,7 @@ set(FILES Include/LyShine/IRenderGraph.h Include/LyShine/ISprite.h Include/LyShine/ILyShine.h + Include/LyShine/UiAssetTypes.h Include/LyShine/UiBase.h Include/LyShine/UiLayoutCellBase.h Include/LyShine/UiSerializeHelpers.h @@ -26,6 +27,7 @@ set(FILES Include/LyShine/Bus/UiCanvasManagerBus.h Include/LyShine/Bus/UiCanvasUpdateNotificationBus.h Include/LyShine/Bus/UiCheckboxBus.h + Include/LyShine/Bus/UiCursorBus.h Include/LyShine/Bus/UiDraggableBus.h Include/LyShine/Bus/UiDropdownBus.h Include/LyShine/Bus/UiDropdownOptionBus.h From c2b1cd1be2152718c5e1b7ae74f9b887232a4cd0 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 19 Jan 2022 09:56:54 -0600 Subject: [PATCH 111/620] Fixed bug when retrieving single pixel value Signed-off-by: Chris Galvan --- .../RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index d9aa2f1c23..80fabc9230 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -242,6 +242,8 @@ namespace AZ T StreamingImageAsset::GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { AZStd::vector values; + values.resize(1); + auto position = AZStd::make_pair(x, y); GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); From b6b8b464d0e2ad9f5edb4b568fe5ff2c1f5f7689 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 19 Jan 2022 16:53:59 -0600 Subject: [PATCH 112/620] Use AZStd::array instead of AZStd::vector when retrieving a single pixel Signed-off-by: Chris Galvan --- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 80fabc9230..3d810c4c8f 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -241,19 +241,12 @@ namespace AZ template T StreamingImageAsset::GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - AZStd::vector values; - values.resize(1); + AZStd::array values = { aznumeric_cast(0) }; auto position = AZStd::make_pair(x, y); - GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); - if (values.size() == 1) - { - return values[0]; - } - - return aznumeric_cast(0); + return values[0]; } template<> From 66f0f1cf5a03c1196ef029f95cac99f58970d471 Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:55:05 -0800 Subject: [PATCH 113/620] Duplicate engine detection and help in Project Manager (#6984) Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- .../ProjectManager/Source/Application.cpp | 86 ++++++++ .../Tools/ProjectManager/Source/Application.h | 1 + Code/Tools/ProjectManager/Source/EngineInfo.h | 5 +- .../Source/EngineSettingsScreen.cpp | 5 +- .../Source/GemRepo/GemRepoScreen.cpp | 19 +- .../ProjectManager/Source/ProjectUtils.cpp | 19 ++ .../ProjectManager/Source/ProjectUtils.h | 9 + .../ProjectManager/Source/PythonBindings.cpp | 185 ++++++++++-------- .../ProjectManager/Source/PythonBindings.h | 12 +- .../Source/PythonBindingsInterface.h | 24 ++- scripts/o3de/o3de/engine_properties.py | 5 + scripts/o3de/o3de/manifest.py | 108 +++++----- 12 files changed, 324 insertions(+), 154 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/Application.cpp b/Code/Tools/ProjectManager/Source/Application.cpp index 29e0df3c3a..08a812999f 100644 --- a/Code/Tools/ProjectManager/Source/Application.cpp +++ b/Code/Tools/ProjectManager/Source/Application.cpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace O3DE::ProjectManager { @@ -111,6 +112,11 @@ namespace O3DE::ProjectManager } } + if (!RegisterEngine(interactive)) + { + return false; + } + const AZ::CommandLine* commandLine = GetCommandLine(); AZ_Assert(commandLine, "Failed to get command line"); @@ -165,6 +171,86 @@ namespace O3DE::ProjectManager return m_entity != nullptr; } + bool Application::RegisterEngine(bool interactive) + { + // get this engine's info + auto engineInfoOutcome = m_pythonBindings->GetEngineInfo(); + if (!engineInfoOutcome) + { + if (interactive) + { + QMessageBox::critical(nullptr, + QObject::tr("Failed to get engine info"), + QObject::tr("A valid engine.json could not be found or loaded. " + "Please verify a valid engine.json file exists in %1") + .arg(GetEngineRoot())); + } + + AZ_Error("Project Manager", false, "Failed to get engine info"); + return false; + } + + EngineInfo engineInfo = engineInfoOutcome.GetValue(); + if (engineInfo.m_registered) + { + return true; + } + + bool forceRegistration = false; + + // check if an engine with this name is already registered + auto existingEngineResult = m_pythonBindings->GetEngineInfo(engineInfo.m_name); + if (existingEngineResult) + { + if (!interactive) + { + AZ_Error("Project Manager", false, "An engine with the name %s is already registered with the path %s", + engineInfo.m_name.toUtf8().constData(), engineInfo.m_path.toUtf8().constData()); + return false; + } + + // get the updated engine name unless the user wants to cancel + bool okPressed = false; + const EngineInfo& otherEngineInfo = existingEngineResult.GetValue(); + + engineInfo.m_name = QInputDialog::getText(nullptr, + QObject::tr("Engine '%1' already registered").arg(engineInfo.m_name), + QObject::tr("An engine named '%1' is already registered.

" + "Current path
%2

" + "New path
%3

" + "Press 'OK' to force registration, or provide a new engine name below.
" + "Alternatively, press `Cancel` to close the Project Manager and resolve the issue manually.") + .arg(engineInfo.m_name, otherEngineInfo.m_path, engineInfo.m_path), + QLineEdit::Normal, + engineInfo.m_name, + &okPressed); + + if (!okPressed) + { + // user elected not to change the name or force registration + return false; + } + + forceRegistration = true; + } + + auto registerOutcome = m_pythonBindings->SetEngineInfo(engineInfo, forceRegistration); + if (!registerOutcome) + { + if (interactive) + { + ProjectUtils::DisplayDetailedError(QObject::tr("Failed to register engine"), registerOutcome); + } + + AZ_Error("Project Manager", false, "Failed to register engine %s : %s", + engineInfo.m_path.toUtf8().constData(), registerOutcome.GetError().first.c_str()); + + return false; + } + + return true; + } + void Application::TearDown() { if (m_entity) diff --git a/Code/Tools/ProjectManager/Source/Application.h b/Code/Tools/ProjectManager/Source/Application.h index ad55694b18..8f633b28c4 100644 --- a/Code/Tools/ProjectManager/Source/Application.h +++ b/Code/Tools/ProjectManager/Source/Application.h @@ -34,6 +34,7 @@ namespace O3DE::ProjectManager private: bool InitLog(const char* logName); + bool RegisterEngine(bool interactive); AZStd::unique_ptr m_pythonBindings; QSharedPointer m_app; diff --git a/Code/Tools/ProjectManager/Source/EngineInfo.h b/Code/Tools/ProjectManager/Source/EngineInfo.h index 5fd3faf2ea..c28aede030 100644 --- a/Code/Tools/ProjectManager/Source/EngineInfo.h +++ b/Code/Tools/ProjectManager/Source/EngineInfo.h @@ -25,13 +25,16 @@ namespace O3DE::ProjectManager QString m_name; QString m_thirdPartyPath; - // from o3de_manifest.json QString m_path; + + // from o3de_manifest.json QString m_defaultProjectsFolder; QString m_defaultGemsFolder; QString m_defaultTemplatesFolder; QString m_defaultRestrictedFolder; + bool m_registered = false; + bool IsValid() const; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/EngineSettingsScreen.cpp b/Code/Tools/ProjectManager/Source/EngineSettingsScreen.cpp index c7df00f423..26f5b8ae11 100644 --- a/Code/Tools/ProjectManager/Source/EngineSettingsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/EngineSettingsScreen.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -114,10 +115,10 @@ namespace O3DE::ProjectManager engineInfo.m_defaultGemsFolder = m_defaultGems->lineEdit()->text(); engineInfo.m_defaultTemplatesFolder = m_defaultProjectTemplates->lineEdit()->text(); - bool result = PythonBindingsInterface::Get()->SetEngineInfo(engineInfo); + auto result = PythonBindingsInterface::Get()->SetEngineInfo(engineInfo); if (!result) { - QMessageBox::critical(this, tr("Engine Settings"), tr("Failed to save engine settings.")); + ProjectUtils::DisplayDetailedError(tr("Failed to save engine settings"), result, this); } } else diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp index f62c30c280..843538d9da 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -92,8 +93,7 @@ namespace O3DE::ProjectManager return; } - AZ::Outcome < void, - AZStd::pair> addGemRepoResult = PythonBindingsInterface::Get()->AddGemRepo(repoUri); + auto addGemRepoResult = PythonBindingsInterface::Get()->AddGemRepo(repoUri); if (addGemRepoResult.IsSuccess()) { Reinit(); @@ -102,20 +102,7 @@ namespace O3DE::ProjectManager else { QString failureMessage = tr("Failed to add gem repo: %1.").arg(repoUri); - if (!addGemRepoResult.GetError().second.empty()) - { - QMessageBox addRepoError; - addRepoError.setIcon(QMessageBox::Critical); - addRepoError.setWindowTitle(failureMessage); - addRepoError.setText(addGemRepoResult.GetError().first.c_str()); - addRepoError.setDetailedText(addGemRepoResult.GetError().second.c_str()); - addRepoError.exec(); - } - else - { - QMessageBox::critical(this, failureMessage, addGemRepoResult.GetError().first.c_str()); - } - + ProjectUtils::DisplayDetailedError(failureMessage, addGemRepoResult, this); AZ_Error("Project Manager", false, failureMessage.toUtf8()); } } diff --git a/Code/Tools/ProjectManager/Source/ProjectUtils.cpp b/Code/Tools/ProjectManager/Source/ProjectUtils.cpp index b7748d8aa2..209140a004 100644 --- a/Code/Tools/ProjectManager/Source/ProjectUtils.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectUtils.cpp @@ -659,5 +659,24 @@ namespace O3DE::ProjectManager return AZ::Success(QString(projectBuildPath.c_str())); } + void DisplayDetailedError(const QString& title, const AZ::Outcome>& outcome, QWidget* parent) + { + const AZStd::string& generalError = outcome.GetError().first; + const AZStd::string& detailedError = outcome.GetError().second; + + if (!detailedError.empty()) + { + QMessageBox errorDialog(parent); + errorDialog.setIcon(QMessageBox::Critical); + errorDialog.setWindowTitle(title); + errorDialog.setText(generalError.c_str()); + errorDialog.setDetailedText(detailedError.c_str()); + errorDialog.exec(); + } + else + { + QMessageBox::critical(parent, title, generalError.c_str()); + } + } } // namespace ProjectUtils } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectUtils.h b/Code/Tools/ProjectManager/Source/ProjectUtils.h index 713803c20b..8602ffa692 100644 --- a/Code/Tools/ProjectManager/Source/ProjectUtils.h +++ b/Code/Tools/ProjectManager/Source/ProjectUtils.h @@ -98,5 +98,14 @@ namespace O3DE::ProjectManager */ AZ::IO::FixedMaxPath GetEditorExecutablePath(const AZ::IO::PathView& projectPath); + + /** + * Display a dialog with general and detailed sections for the given AZ::Outcome + * @param title Dialog title + * @param outcome The AZ::Outcome with general and detailed error messages + * @param parent Optional QWidget parent + */ + void DisplayDetailedError(const QString& title, const AZ::Outcome>& outcome, QWidget* parent = nullptr); + } // namespace ProjectUtils } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index 12f97e6d2e..00ece7396d 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -312,6 +312,7 @@ namespace O3DE::ProjectManager m_register = pybind11::module::import("o3de.register"); m_manifest = pybind11::module::import("o3de.manifest"); m_engineTemplate = pybind11::module::import("o3de.engine_template"); + m_engineProperties = pybind11::module::import("o3de.engine_properties"); m_enableGemProject = pybind11::module::import("o3de.enable_gem"); m_disableGemProject = pybind11::module::import("o3de.disable_gem"); m_editProjectProperties = pybind11::module::import("o3de.project_properties"); @@ -319,9 +320,6 @@ namespace O3DE::ProjectManager m_repo = pybind11::module::import("o3de.repo"); m_pathlib = pybind11::module::import("pathlib"); - // make sure the engine is registered - RegisterThisEngine(); - m_pythonStarted = !PyErr_Occurred(); return m_pythonStarted; } @@ -346,36 +344,6 @@ namespace O3DE::ProjectManager return !PyErr_Occurred(); } - bool PythonBindings::RegisterThisEngine() - { - bool registrationResult = true; // already registered is considered successful - bool pythonResult = ExecuteWithLock( - [&] - { - // check current engine path against all other registered engines - // to see if we are already registered - auto allEngines = m_manifest.attr("get_engines")(); - if (pybind11::isinstance(allEngines)) - { - for (auto engine : allEngines) - { - AZ::IO::FixedMaxPath enginePath(Py_To_String(engine)); - if (enginePath.Compare(m_enginePath) == 0) - { - return; - } - } - } - - auto result = m_register.attr("register")(QString_To_Py_Path(QString(m_enginePath.c_str()))); - registrationResult = (result.cast() == 0); - }); - - bool finalResult = (registrationResult && pythonResult); - AZ_Assert(finalResult, "Registration of this engine failed!"); - return finalResult; - } - AZ::Outcome PythonBindings::ExecuteWithLockErrorHandling(AZStd::function executionCallback) { if (!Py_IsInitialized()) @@ -407,16 +375,22 @@ namespace O3DE::ProjectManager return ExecuteWithLockErrorHandling(executionCallback).IsSuccess(); } - AZ::Outcome PythonBindings::GetEngineInfo() + EngineInfo PythonBindings::EngineInfoFromPath(pybind11::handle enginePath) { EngineInfo engineInfo; - bool result = ExecuteWithLock([&] { - auto enginePath = m_manifest.attr("get_this_engine_path")(); + try + { + auto engineData = m_manifest.attr("get_engine_json_data")(pybind11::none(), enginePath); + if (pybind11::isinstance(engineData)) + { + engineInfo.m_version = Py_To_String_Optional(engineData, "O3DEVersion", "0.0.0.0"); + engineInfo.m_name = Py_To_String_Optional(engineData, "engine_name", "O3DE"); + engineInfo.m_path = Py_To_String(enginePath); + } auto o3deData = m_manifest.attr("load_o3de_manifest")(); if (pybind11::isinstance(o3deData)) { - engineInfo.m_path = Py_To_String(enginePath); auto defaultGemsFolder = m_manifest.attr("get_o3de_gems_folder")(); engineInfo.m_defaultGemsFolder = Py_To_String_Optional(o3deData, "default_gems_folder", Py_To_String(defaultGemsFolder)); @@ -433,19 +407,59 @@ namespace O3DE::ProjectManager engineInfo.m_thirdPartyPath = Py_To_String_Optional(o3deData, "default_third_party_folder", Py_To_String(defaultThirdPartyFolder)); } - auto engineData = m_manifest.attr("get_engine_json_data")(pybind11::none(), enginePath); - if (pybind11::isinstance(engineData)) + // check if engine path is registered + auto allEngines = m_manifest.attr("get_engines")(); + if (pybind11::isinstance(allEngines)) { - try + const AZ::IO::FixedMaxPath enginePathFixed(Py_To_String(enginePath)); + for (auto engine : allEngines) { - engineInfo.m_version = Py_To_String_Optional(engineData, "O3DEVersion", "0.0.0.0"); - engineInfo.m_name = Py_To_String_Optional(engineData, "engine_name", "O3DE"); - } - catch ([[maybe_unused]] const std::exception& e) - { - AZ_Warning("PythonBindings", false, "Failed to get EngineInfo from %s", Py_To_String(enginePath)); + AZ::IO::FixedMaxPath otherEnginePath(Py_To_String(engine)); + if (otherEnginePath.Compare(enginePathFixed) == 0) + { + engineInfo.m_registered = true; + break; + } } } + } + catch ([[maybe_unused]] const std::exception& e) + { + AZ_Warning("PythonBindings", false, "Failed to get EngineInfo from %s", Py_To_String(enginePath)); + } + return engineInfo; + } + + AZ::Outcome PythonBindings::GetEngineInfo() + { + EngineInfo engineInfo; + + bool result = ExecuteWithLock([&] { + auto enginePath = m_manifest.attr("get_this_engine_path")(); + engineInfo = EngineInfoFromPath(enginePath); + }); + + if (!result || !engineInfo.IsValid()) + { + return AZ::Failure(); + } + else + { + return AZ::Success(AZStd::move(engineInfo)); + } + } + + AZ::Outcome PythonBindings::GetEngineInfo(const QString& engineName) + { + EngineInfo engineInfo; + bool result = ExecuteWithLock([&] { + auto enginePathResult = m_manifest.attr("get_registered")(QString_To_Py_String(engineName)); + + // if a valid registered object is not found None is returned + if (!pybind11::isinstance(enginePathResult)) + { + engineInfo = EngineInfoFromPath(enginePathResult); + } }); if (!result || !engineInfo.IsValid()) @@ -458,10 +472,32 @@ namespace O3DE::ProjectManager } } - bool PythonBindings::SetEngineInfo(const EngineInfo& engineInfo) + IPythonBindings::DetailedOutcome PythonBindings::SetEngineInfo(const EngineInfo& engineInfo, bool force) { - bool result = ExecuteWithLock([&] { - auto registrationResult = m_register.attr("register")( + bool registrationSuccess = false; + bool pythonSuccess = ExecuteWithLock([&] { + + EngineInfo currentEngine = EngineInfoFromPath(QString_To_Py_Path(engineInfo.m_path)); + + // be kind to source control and avoid needlessly updating engine.json + if (currentEngine.IsValid() && + (currentEngine.m_name.compare(engineInfo.m_name) != 0 || currentEngine.m_version.compare(engineInfo.m_version) != 0)) + { + auto enginePropsResult = m_engineProperties.attr("edit_engine_props")( + QString_To_Py_Path(engineInfo.m_path), + pybind11::none(), // existing engine_name + QString_To_Py_String(engineInfo.m_name), + QString_To_Py_String(engineInfo.m_version) + ); + + if (enginePropsResult.cast() != 0) + { + // do not proceed with registration + return; + } + } + + auto result = m_register.attr("register")( QString_To_Py_Path(engineInfo.m_path), pybind11::none(), // project_path pybind11::none(), // gem_path @@ -474,16 +510,22 @@ namespace O3DE::ProjectManager QString_To_Py_Path(engineInfo.m_defaultGemsFolder), QString_To_Py_Path(engineInfo.m_defaultTemplatesFolder), pybind11::none(), // default_restricted_folder - QString_To_Py_Path(engineInfo.m_thirdPartyPath) - ); + QString_To_Py_Path(engineInfo.m_thirdPartyPath), + pybind11::none(), // external_subdir_engine_path + pybind11::none(), // external_subdir_project_path + false, // remove + force + ); - if (registrationResult.cast() != 0) - { - result = false; - } + registrationSuccess = result.cast() == 0; }); - return result; + if (pythonSuccess && registrationSuccess) + { + return AZ::Success(); + } + + return AZ::Failure(GetErrorPair()); } AZ::Outcome PythonBindings::GetGemInfo(const QString& path, const QString& projectPath) @@ -1064,7 +1106,7 @@ namespace O3DE::ProjectManager return result && refreshResult; } - AZ::Outcome> PythonBindings::AddGemRepo(const QString& repoUri) + IPythonBindings::DetailedOutcome PythonBindings::AddGemRepo(const QString& repoUri) { bool registrationResult = false; bool result = ExecuteWithLock( @@ -1080,7 +1122,7 @@ namespace O3DE::ProjectManager if (!result || !registrationResult) { - return AZ::Failure>(GetSimpleDetailedErrorPair()); + return AZ::Failure(GetErrorPair()); } return AZ::Success(); @@ -1170,13 +1212,10 @@ namespace O3DE::ProjectManager return gemRepoInfo; } -//#define MOCK_GEM_REPO_INFO true - AZ::Outcome, AZStd::string> PythonBindings::GetAllGemRepoInfos() { QVector gemRepos; -#ifndef MOCK_GEM_REPO_INFO auto result = ExecuteWithLockErrorHandling( [&] { @@ -1189,18 +1228,6 @@ namespace O3DE::ProjectManager { return AZ::Failure(result.GetError().c_str()); } -#else - GemRepoInfo mockJohnRepo("JohnCreates", "John Smith", QDateTime(QDate(2021, 8, 31), QTime(11, 57)), true); - mockJohnRepo.m_summary = "John's Summary. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sollicitudin dapibus urna"; - mockJohnRepo.m_repoUri = "https://github.com/o3de/o3de"; - mockJohnRepo.m_additionalInfo = "John's additional info. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sollicitu."; - gemRepos.push_back(mockJohnRepo); - - GemRepoInfo mockJaneRepo("JanesGems", "Jane Doe", QDateTime(QDate(2021, 9, 10), QTime(18, 23)), false); - mockJaneRepo.m_summary = "Jane's Summary."; - mockJaneRepo.m_repoUri = "https://github.com/o3de/o3de.org"; - gemRepos.push_back(mockJaneRepo); -#endif // MOCK_GEM_REPO_INFO std::sort(gemRepos.begin(), gemRepos.end()); return AZ::Success(AZStd::move(gemRepos)); @@ -1261,7 +1288,7 @@ namespace O3DE::ProjectManager return AZ::Success(AZStd::move(gemInfos)); } - AZ::Outcome> PythonBindings::DownloadGem( + IPythonBindings::DetailedOutcome PythonBindings::DownloadGem( const QString& gemName, std::function gemProgressCallback, bool force) { // This process is currently limited to download a single gem at a time. @@ -1290,12 +1317,12 @@ namespace O3DE::ProjectManager if (!result.IsSuccess()) { - AZStd::pair pythonRunError(result.GetError(), result.GetError()); - return AZ::Failure>(AZStd::move(pythonRunError)); + IPythonBindings::ErrorPair pythonRunError(result.GetError(), result.GetError()); + return AZ::Failure(AZStd::move(pythonRunError)); } else if (!downloadSucceeded) { - return AZ::Failure>(GetSimpleDetailedErrorPair()); + return AZ::Failure(GetErrorPair()); } return AZ::Success(); @@ -1322,13 +1349,13 @@ namespace O3DE::ProjectManager return result && updateAvaliableResult; } - AZStd::pair PythonBindings::GetSimpleDetailedErrorPair() + IPythonBindings::ErrorPair PythonBindings::GetErrorPair() { AZStd::string detailedString = m_pythonErrorStrings.size() == 1 ? "" : AZStd::accumulate(m_pythonErrorStrings.begin(), m_pythonErrorStrings.end(), AZStd::string("")); - return AZStd::pair(m_pythonErrorStrings.front(), detailedString); + return IPythonBindings::ErrorPair(m_pythonErrorStrings.front(), detailedString); } void PythonBindings::AddErrorString(AZStd::string errorString) diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.h b/Code/Tools/ProjectManager/Source/PythonBindings.h index 48841b6565..e2a8109128 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.h +++ b/Code/Tools/ProjectManager/Source/PythonBindings.h @@ -35,7 +35,8 @@ namespace O3DE::ProjectManager // Engine AZ::Outcome GetEngineInfo() override; - bool SetEngineInfo(const EngineInfo& engineInfo) override; + AZ::Outcome GetEngineInfo(const QString& engineName) override; + DetailedOutcome SetEngineInfo(const EngineInfo& engineInfo, bool force = false) override; // Gem AZ::Outcome GetGemInfo(const QString& path, const QString& projectPath = {}) override; @@ -62,12 +63,12 @@ namespace O3DE::ProjectManager // Gem Repos AZ::Outcome RefreshGemRepo(const QString& repoUri) override; bool RefreshAllGemRepos() override; - AZ::Outcome> AddGemRepo(const QString& repoUri) override; + DetailedOutcome AddGemRepo(const QString& repoUri) override; bool RemoveGemRepo(const QString& repoUri) override; AZ::Outcome, AZStd::string> GetAllGemRepoInfos() override; AZ::Outcome, AZStd::string> GetGemInfosForRepo(const QString& repoUri) override; AZ::Outcome, AZStd::string> GetGemInfosForAllRepos() override; - AZ::Outcome> DownloadGem( + DetailedOutcome DownloadGem( const QString& gemName, std::function gemProgressCallback, bool force = false) override; void CancelDownload() override; bool IsGemUpdateAvaliable(const QString& gemName, const QString& lastUpdated) override; @@ -80,14 +81,14 @@ namespace O3DE::ProjectManager AZ::Outcome ExecuteWithLockErrorHandling(AZStd::function executionCallback); bool ExecuteWithLock(AZStd::function executionCallback); + EngineInfo EngineInfoFromPath(pybind11::handle enginePath); GemInfo GemInfoFromPath(pybind11::handle path, pybind11::handle pyProjectPath); GemRepoInfo GetGemRepoInfo(pybind11::handle repoUri); ProjectInfo ProjectInfoFromPath(pybind11::handle path); ProjectTemplateInfo ProjectTemplateInfoFromPath(pybind11::handle path, pybind11::handle pyProjectPath); AZ::Outcome GemRegistration(const QString& gemPath, const QString& projectPath, bool remove = false); - bool RegisterThisEngine(); bool StopPython(); - AZStd::pair GetSimpleDetailedErrorPair(); + IPythonBindings::ErrorPair GetErrorPair(); bool m_pythonStarted = false; @@ -96,6 +97,7 @@ namespace O3DE::ProjectManager AZStd::recursive_mutex m_lock; pybind11::handle m_engineTemplate; + pybind11::handle m_engineProperties; pybind11::handle m_cmake; pybind11::handle m_register; pybind11::handle m_manifest; diff --git a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h index c7c8af2ce1..a42ff310c3 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h +++ b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h @@ -31,6 +31,10 @@ namespace O3DE::ProjectManager IPythonBindings() = default; virtual ~IPythonBindings() = default; + //! First string in pair is general error, second is detailed + using ErrorPair = AZStd::pair; + using DetailedOutcome = AZ::Outcome; + /** * Get whether Python was started or not. All Python functionality will fail if Python * failed to start. @@ -49,17 +53,25 @@ namespace O3DE::ProjectManager // Engine /** - * Get info about the engine + * Get info about the current engine * @return an outcome with EngineInfo on success */ virtual AZ::Outcome GetEngineInfo() = 0; /** - * Set info about the engine - * @param engineInfo an EngineInfo object + * Get info about an engine by name + * @param engineName The name of the engine to get info about + * @return an outcome with EngineInfo on success */ - virtual bool SetEngineInfo(const EngineInfo& engineInfo) = 0; + virtual AZ::Outcome GetEngineInfo(const QString& engineName) = 0; + /** + * Set info about the engine + * @param force True to force registration even if an engine with the same name is already registered + * @param engineInfo an EngineInfo object + * @return a detailed error outcome on failure. + */ + virtual DetailedOutcome SetEngineInfo(const EngineInfo& engineInfo, bool force = false) = 0; // Gems @@ -202,7 +214,7 @@ namespace O3DE::ProjectManager * @param repoUri the absolute filesystem path or url to the gem repo. * @return an outcome with a pair of string error and detailed messages on failure. */ - virtual AZ::Outcome> AddGemRepo(const QString& repoUri) = 0; + virtual DetailedOutcome AddGemRepo(const QString& repoUri) = 0; /** * Unregisters this gem repo with the current engine. @@ -237,7 +249,7 @@ namespace O3DE::ProjectManager * @param force should we forcibly overwrite the old version of the gem. * @return an outcome with a pair of string error and detailed messages on failure. */ - virtual AZ::Outcome> DownloadGem( + virtual DetailedOutcome DownloadGem( const QString& gemName, std::function gemProgressCallback, bool force = false) = 0; /** diff --git a/scripts/o3de/o3de/engine_properties.py b/scripts/o3de/o3de/engine_properties.py index 92930dbb1c..56cb71f258 100644 --- a/scripts/o3de/o3de/engine_properties.py +++ b/scripts/o3de/o3de/engine_properties.py @@ -25,6 +25,11 @@ def edit_engine_props(engine_path: pathlib.Path = None, if not engine_path and not engine_name: logger.error(f'Either a engine path or a engine name must be supplied to lookup engine.json') return 1 + + if not new_name and not new_version: + logger.error('A new engine name or new version, or both must be supplied.') + return 1 + if not engine_path: engine_path = manifest.get_registered(engine_name=engine_name) diff --git a/scripts/o3de/o3de/manifest.py b/scripts/o3de/o3de/manifest.py index e46b819a7c..c06a4d12fc 100644 --- a/scripts/o3de/o3de/manifest.py +++ b/scripts/o3de/o3de/manifest.py @@ -599,75 +599,93 @@ def get_registered(engine_name: str = None, engine_path = pathlib.Path(engine).resolve() engine_json = engine_path / 'engine.json' - with engine_json.open('r') as f: - try: - engine_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{engine_json} failed to load: {str(e)}') - else: - this_engines_name = engine_json_data['engine_name'] - if this_engines_name == engine_name: - return engine_path + if not pathlib.Path(engine_json).is_file(): + logger.warning(f'{engine_json} does not exist') + else: + with engine_json.open('r') as f: + try: + engine_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{engine_json} failed to load: {str(e)}') + else: + this_engines_name = engine_json_data['engine_name'] + if this_engines_name == engine_name: + return engine_path + engines_path = json_data.get('engines_path', {}) + if engine_name in engines_path: + return pathlib.Path(engines_path[engine_name]).resolve() elif isinstance(project_name, str): projects = get_all_projects() for project_path in projects: project_path = pathlib.Path(project_path).resolve() project_json = project_path / 'project.json' - with project_json.open('r') as f: - try: - project_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{project_json} failed to load: {str(e)}') - else: - this_projects_name = project_json_data['project_name'] - if this_projects_name == project_name: - return project_path + if not pathlib.Path(project_json).is_file(): + logger.warning(f'{project_json} does not exist') + else: + with project_json.open('r') as f: + try: + project_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{project_json} failed to load: {str(e)}') + else: + this_projects_name = project_json_data['project_name'] + if this_projects_name == project_name: + return project_path elif isinstance(gem_name, str): gems = get_all_gems(project_path) for gem_path in gems: gem_path = pathlib.Path(gem_path).resolve() gem_json = gem_path / 'gem.json' - with gem_json.open('r') as f: - try: - gem_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{gem_json} failed to load: {str(e)}') - else: - this_gems_name = gem_json_data['gem_name'] - if this_gems_name == gem_name: - return gem_path + if not pathlib.Path(gem_json).is_file(): + logger.warning(f'{gem_json} does not exist') + else: + with gem_json.open('r') as f: + try: + gem_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{gem_json} failed to load: {str(e)}') + else: + this_gems_name = gem_json_data['gem_name'] + if this_gems_name == gem_name: + return gem_path elif isinstance(template_name, str): templates = get_all_templates(project_path) for template_path in templates: template_path = pathlib.Path(template_path).resolve() template_json = template_path / 'template.json' - with template_json.open('r') as f: - try: - template_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{template_path} failed to load: {str(e)}') - else: - this_templates_name = template_json_data['template_name'] - if this_templates_name == template_name: - return template_path + if not pathlib.Path(template_json).is_file(): + logger.warning(f'{template_json} does not exist') + else: + with template_json.open('r') as f: + try: + template_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{template_path} failed to load: {str(e)}') + else: + this_templates_name = template_json_data['template_name'] + if this_templates_name == template_name: + return template_path elif isinstance(restricted_name, str): restricted = get_all_restricted(project_path) for restricted_path in restricted: restricted_path = pathlib.Path(restricted_path).resolve() restricted_json = restricted_path / 'restricted.json' - with restricted_json.open('r') as f: - try: - restricted_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{restricted_json} failed to load: {str(e)}') - else: - this_restricted_name = restricted_json_data['restricted_name'] - if this_restricted_name == restricted_name: - return restricted_path + if not pathlib.Path(restricted_json).is_file(): + logger.warning(f'{restricted_json} does not exist') + else: + with restricted_json.open('r') as f: + try: + restricted_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{restricted_json} failed to load: {str(e)}') + else: + this_restricted_name = restricted_json_data['restricted_name'] + if this_restricted_name == restricted_name: + return restricted_path elif isinstance(default_folder, str): if default_folder == 'engines': From b3d996ea230ce78293eef87959cebd349d84e6d2 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 20 Jan 2022 08:32:02 -0800 Subject: [PATCH 114/620] Adding automated test to ensure scripts attached to net-level-entities are started on the server Signed-off-by: Gene Walters --- ...TestLevelEntityComponent.AutoComponent.xml | 15 + ...tworkTestPlayerComponent.AutoComponent.xml | 2 - .../Gem/Code/automatedtesting_files.cmake | 1 + .../Multiplayer/TestSuite_Sandbox.py | 4 + .../Multiplayer_SimpleNetworkLevelEntity.py | 79 +++ .../SimpleNetworkLevelEntity/Player.prefab | 151 +++++ .../SimpleNetworkLevelEntity.prefab | 580 ++++++++++++++++++ .../SimpleNetworkLevelEntity.scriptcanvas | 228 +++++++ .../SimpleNetworkLevelEntity/tags.txt | 12 + 9 files changed, 1070 insertions(+), 2 deletions(-) create mode 100644 AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml create mode 100644 AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py create mode 100644 AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/Player.prefab create mode 100644 AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.prefab create mode 100644 AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.scriptcanvas create mode 100644 AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/tags.txt diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml new file mode 100644 index 0000000000..2fd196a2f6 --- /dev/null +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml index 251d2b25af..b4dd35d741 100644 --- a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml @@ -29,8 +29,6 @@
- - diff --git a/AutomatedTesting/Gem/Code/automatedtesting_files.cmake b/AutomatedTesting/Gem/Code/automatedtesting_files.cmake index eb619104a4..1f6dbbd772 100644 --- a/AutomatedTesting/Gem/Code/automatedtesting_files.cmake +++ b/AutomatedTesting/Gem/Code/automatedtesting_files.cmake @@ -12,4 +12,5 @@ set(FILES Source/AutomatedTestingSystemComponent.cpp Source/AutomatedTestingSystemComponent.h Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml + Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml ) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py index 8c5f33993d..56c2608762 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py @@ -35,3 +35,7 @@ class TestAutomation(TestAutomationBase): def test_Multiplayer_AutoComponent_RPC(self, request, workspace, editor, launcher_platform): from .tests import Multiplayer_AutoComponent_RPC as test_module self._run_prefab_test(request, workspace, editor, test_module) + + def test_Multiplayer_SimpleNetworkLevelEntity(self, request, workspace, editor, launcher_platform): + from .tests import Multiplayer_SimpleNetworkLevelEntity as test_module + self._run_prefab_test(request, workspace, editor, test_module) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py new file mode 100644 index 0000000000..da332f9085 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py @@ -0,0 +1,79 @@ +""" +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 +""" + + +# Test Case Title : Check that level entities with network bindings are properly replicated. +# Note: This test should be ran on a fresh editor run; some bugs with spawnables occur only on the first editor play-mode. + + +# fmt: off +class TestSuccessFailTuples(): + enter_game_mode = ("Entered game mode", "Failed to enter game mode") + exit_game_mode = ("Exited game mode", "Couldn't exit game mode") + find_network_player = ("Found network player", "Couldn't find network player") +# fmt: on + + +def Multiplayer_SimpleNetworkLevelEntity(): + r""" + Summary: + Runs a test to make sure that network entities in a level function and are replicated to clients as expecte + + Level Description: + - Static + 1. NetLevelEntity. This is a networked entity which has a script attached to ensure it's replicated. + + + Expected Outcome: + We should see logs stating that the net-sync'd level entity exists on both server and client. + + :return: + """ + import azlmbr.legacy.general as general + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import Tracer + + from editor_python_test_tools.utils import TestHelper as helper + from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole + + level_name = "SimpleNetworkLevelEntity" + player_prefab_name = "Player" + player_prefab_path = f"levels/multiplayer/{level_name}/{player_prefab_name}.network.spawnable" + + helper.init_idle() + + # 1) Open Level + helper.open_level("Multiplayer", level_name) + + with Tracer() as section_tracer: + # 2) Enter game mode + helper.multiplayer_enter_game_mode(TestSuccessFailTuples.enter_game_mode, player_prefab_path.lower()) + + # 3) Make sure the network player was spawned + player_id = general.find_game_entity(player_prefab_name) + Report.critical_result(TestSuccessFailTuples.find_network_player, player_id.IsValid()) + + # 4) Check the editor logs for network spawnable errors + ATTEMPTING_INVALID_NETSPAWN_WAIT_TIME_SECONDS = 1.0 # The editor will try to net-spawn its networked level entity before it's even a client. Make sure this doesn't happen. + helper.fail_if_log_line_found('NetworkEntityManager', "RequestNetSpawnableInstantiation: Requested spawnable Root.network.spawnable doesn't exist in the NetworkSpawnableLibrary. Please make sure it is a network spawnable", section_tracer.errors, ATTEMPTING_INVALID_NETSPAWN_WAIT_TIME_SECONDS) + + # 5) Ensure the script graph attached to the level entity is running on both client and server + SCRIPTGRAPH_ENABLED_WAIT_TIME_SECONDS = 0.25 + # Check Server + helper.succeed_if_log_line_found('EditorServer', "Script: SimpleNetworkLevelEntity: On Graph Start", section_tracer.prints, SCRIPTGRAPH_ENABLED_WAIT_TIME_SECONDS) + # Check Editor/Client (Uncomment once script asset preload is working properly LYN-9136) + # helper.succeed_if_log_line_found('Script', "SimpleNetworkLevelEntity: On Graph Start", section_tracer.prints, SCRIPTGRAPH_ENABLED_WAIT_TIME_SECONDS) # Client + + + # Exit game mode + helper.exit_game_mode(TestSuccessFailTuples.exit_game_mode) + + + +if __name__ == "__main__": + from editor_python_test_tools.utils import Report + Report.start_test(Multiplayer_SimpleNetworkLevelEntity) diff --git a/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/Player.prefab b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/Player.prefab new file mode 100644 index 0000000000..975319a516 --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/Player.prefab @@ -0,0 +1,151 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "Player", + "Components": { + "Component_[10626669441604518614]": { + "$type": "EditorPrefabComponent", + "Id": 10626669441604518614 + }, + "Component_[15284109105474306026]": { + "$type": "EditorVisibilityComponent", + "Id": 15284109105474306026 + }, + "Component_[1884250773831675865]": { + "$type": "SelectionComponent", + "Id": 1884250773831675865 + }, + "Component_[3027124663594865592]": { + "$type": "EditorInspectorComponent", + "Id": 3027124663594865592 + }, + "Component_[3314300526416851038]": { + "$type": "EditorEntitySortComponent", + "Id": 3314300526416851038, + "Child Entity Order": [ + "Entity_[1340484004600]" + ] + }, + "Component_[5583377204116393478]": { + "$type": "EditorEntityIconComponent", + "Id": 5583377204116393478 + }, + "Component_[5897955848881060165]": { + "$type": "EditorLockComponent", + "Id": 5897955848881060165 + }, + "Component_[6405389103180201977]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6405389103180201977, + "Parent Entity": "" + }, + "Component_[7695912346724202125]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 7695912346724202125 + }, + "Component_[775363990560391238]": { + "$type": "EditorOnlyEntityComponent", + "Id": 775363990560391238 + }, + "Component_[904355854135646057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 904355854135646057 + } + } + }, + "Entities": { + "Entity_[1340484004600]": { + "Id": "Entity_[1340484004600]", + "Name": "Player", + "Components": { + "Component_[12294726333564087591]": { + "$type": "SelectionComponent", + "Id": 12294726333564087591 + }, + "Component_[13587084088242540786]": { + "$type": "EditorInspectorComponent", + "Id": 13587084088242540786, + "ComponentOrderEntryArray": [ + { + "ComponentId": 6819443882832501114 + }, + { + "ComponentId": 4337571454344109612, + "SortIndex": 1 + }, + { + "ComponentId": 16457408099527309065, + "SortIndex": 2 + }, + { + "ComponentId": 5577505593558922067, + "SortIndex": 3 + } + ] + }, + "Component_[14335168881008289852]": { + "$type": "EditorEntitySortComponent", + "Id": 14335168881008289852 + }, + "Component_[16308902899170829847]": { + "$type": "EditorVisibilityComponent", + "Id": 16308902899170829847 + }, + "Component_[16457408099527309065]": { + "$type": "GenericComponentWrapper", + "Id": 16457408099527309065, + "m_template": { + "$type": "Multiplayer::NetworkTransformComponent" + } + }, + "Component_[16541569566865026527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 16541569566865026527 + }, + "Component_[2002761223483048905]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2002761223483048905 + }, + "Component_[4337571454344109612]": { + "$type": "GenericComponentWrapper", + "Id": 4337571454344109612, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[477591477979440744]": { + "$type": "EditorLockComponent", + "Id": 477591477979440744 + }, + "Component_[5577505593558922067]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5577505593558922067, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{6DE0E9A8-A1C7-5D0F-9407-4E627C1F223C}", + "subId": 284780167 + }, + "assetHint": "models/sphere.azmodel" + } + } + } + }, + "Component_[5828214869455694702]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5828214869455694702 + }, + "Component_[6819443882832501114]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6819443882832501114, + "Parent Entity": "ContainerEntity" + }, + "Component_[8838623765985560328]": { + "$type": "EditorEntityIconComponent", + "Id": 8838623765985560328 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.prefab b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.prefab new file mode 100644 index 0000000000..abe458246a --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.prefab @@ -0,0 +1,580 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[806656324666]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 9021008456353177945 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[806656324666]": { + "Id": "Entity_[806656324666]", + "Name": "NetEntity", + "Components": { + "Component_[10272449525230713408]": { + "$type": "EditorScriptCanvasComponent", + "Id": 10272449525230713408, + "m_name": "SimpleNetworkLevelEntity.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{C8F17F94-1225-5FFB-A89F-7C5546FF9DD2}", + "path": "C:/prj/o3de/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.scriptcanvas" + } + }, + "sourceHandle": { + "id": "{C8F17F94-1225-5FFB-A89F-7C5546FF9DD2}", + "path": "C:/prj/o3de/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.scriptcanvas" + } + }, + "Component_[12604265186664827718]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 12604265186664827718 + }, + "Component_[12971088454284742740]": { + "$type": "EditorInspectorComponent", + "Id": 12971088454284742740 + }, + "Component_[13637345797899267673]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13637345797899267673 + }, + "Component_[14691827217729577086]": { + "$type": "EditorVisibilityComponent", + "Id": 14691827217729577086 + }, + "Component_[17587769654029626028]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 17587769654029626028, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{6DE0E9A8-A1C7-5D0F-9407-4E627C1F223C}", + "subId": 284780167 + }, + "assetHint": "models/sphere.azmodel" + } + } + } + }, + "Component_[3583806849894952953]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3583806849894952953 + }, + "Component_[3992057042487734240]": { + "$type": "EditorLockComponent", + "Id": 3992057042487734240 + }, + "Component_[4205899043279271481]": { + "$type": "GenericComponentWrapper", + "Id": 4205899043279271481, + "m_template": { + "$type": "Multiplayer::NetworkTransformComponent" + } + }, + "Component_[4416976521140638764]": { + "$type": "EditorEntityIconComponent", + "Id": 4416976521140638764 + }, + "Component_[4951162661196722987]": { + "$type": "EditorEntitySortComponent", + "Id": 4951162661196722987 + }, + "Component_[57491843687005111]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 57491843687005111, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + -0.010266244411468506, + 0.09999752044677734, + 0.4922151565551758 + ] + } + }, + "Component_[7427201282284088219]": { + "$type": "SelectionComponent", + "Id": 7427201282284088219 + }, + "Component_[9767802049284917261]": { + "$type": "GenericComponentWrapper", + "Id": 9767802049284917261, + "m_template": { + "$type": "NetBindComponent" + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.scriptcanvas new file mode 100644 index 0000000000..7f41ed9af2 --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.scriptcanvas @@ -0,0 +1,228 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 5227099818161821361 + }, + "Name": "Script Canvas Graph", + "Components": { + "Component_[14745706451564425001]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 14745706451564425001 + }, + "Component_[6188351434280490877]": { + "$type": "EditorGraph", + "Id": 6188351434280490877, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 1181151842701 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[11204048151736284490]": { + "$type": "Print", + "Id": 11204048151736284490, + "Slots": [ + { + "id": { + "m_id": "{A417FF98-493E-4DE6-AD3A-E7A1848661E4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{38BC2AB1-7654-407E-9903-4B5D77EDB6F3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "SimpleNetworkLevelEntity: On Graph Start\n", + "m_unresolvedString": [ + "SimpleNetworkLevelEntity: On Graph Start\n" + ] + } + } + }, + { + "Id": { + "id": 811784655245 + }, + "Name": "SC-Node(Start)", + "Components": { + "Component_[2986280341871382503]": { + "$type": "Start", + "Id": 2986280341871382503, + "Slots": [ + { + "id": { + "m_id": "{61FBEFC6-23BA-4A53-89BF-D0D0E834608C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled when the entity that owns this graph is fully activated.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ] + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 2521181639053 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[16295428600276205051]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16295428600276205051, + "sourceEndpoint": { + "nodeId": { + "id": 811784655245 + }, + "slotId": { + "m_id": "{61FBEFC6-23BA-4A53-89BF-D0D0E834608C}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 1181151842701 + }, + "slotId": { + "m_id": "{A417FF98-493E-4DE6-AD3A-E7A1848661E4}" + } + } + } + } + } + ] + }, + "m_assetType": "{00000000-0000-0000-D033-B2489A010000}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1, + "_fileVersion": 1 + }, + "GraphCanvasData": [ + { + "Key": { + "id": 811784655245 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 340.0, + 180.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{6045F7F7-02B0-442A-96C7-A0CBCEFF7275}" + } + } + } + }, + { + "Key": { + "id": 1181151842701 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 580.0, + 180.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{589F773E-D82A-4EDD-AEBD-3ADC07FC67CE}" + } + } + } + }, + { + "Key": { + "id": 5227099818161821361 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 4199610336680704683, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/tags.txt b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 From 0bd2083c48335127bc27ac34af2e1741f72a1efd Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 20 Jan 2022 10:35:22 -0600 Subject: [PATCH 115/620] Replaced array_view usage with span Signed-off-by: Chris Galvan --- .../Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h | 7 ++++--- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index f4dc891ff2..93d0392e38 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace AZ { @@ -90,13 +91,13 @@ namespace AZ T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (float) for specified mip and slice - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (uint) for specified mip and slice - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (int) for specified mip and slice - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 3d810c4c8f..099f9c3df9 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -244,7 +244,8 @@ namespace AZ AZStd::array values = { aznumeric_cast(0) }; auto position = AZStd::make_pair(x, y); - GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); + AZStd::span valueSpan(values.begin(), values.size()); + GetSubImagePixelValues(position, position, valueSpan, componentIndex, mip, slice); return values[0]; } @@ -267,7 +268,7 @@ namespace AZ return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -293,7 +294,7 @@ namespace AZ } } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -319,7 +320,7 @@ namespace AZ } } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; From 3c879d59676d513da30b40df9fb8c3abeab0f2e6 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 20 Jan 2022 08:45:35 -0800 Subject: [PATCH 116/620] fix pytest typos Signed-off-by: Gene Walters --- .../Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py index da332f9085..aadf12d7e3 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py @@ -21,11 +21,11 @@ class TestSuccessFailTuples(): def Multiplayer_SimpleNetworkLevelEntity(): r""" Summary: - Runs a test to make sure that network entities in a level function and are replicated to clients as expecte + Test to make sure that network entities in a level function and are replicated to clients as expected Level Description: - Static - 1. NetLevelEntity. This is a networked entity which has a script attached to ensure it's replicated. + 1. NetLevelEntity. This is a networked entity which has a script attached which prints logs to ensure it's replicated. Expected Outcome: From c31e3c020898816b1a2eee355af202e7c952c56c Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Thu, 20 Jan 2022 19:36:33 +0000 Subject: [PATCH 117/620] LYN-7640 Terrain Physics Materials hooked up all the way down to PhysX Signed-off-by: Sergey Pereslavtsev --- .../EditorHeightfieldColliderComponent.cpp | 3 + .../Source/HeightfieldColliderComponent.cpp | 4 + Gems/PhysX/Code/Source/Utils.cpp | 132 ++++++----- Gems/PhysX/Code/Source/Utils.h | 7 + ...ditorHeightfieldColliderComponentTests.cpp | 208 ++++++++++++++++-- Gems/PhysX/Code/Tests/EditorTestUtilities.cpp | 18 ++ Gems/PhysX/Code/Tests/EditorTestUtilities.h | 3 + 7 files changed, 302 insertions(+), 73 deletions(-) diff --git a/Gems/PhysX/Code/Source/EditorHeightfieldColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorHeightfieldColliderComponent.cpp index fb0a38fa18..c6def5f0ab 100644 --- a/Gems/PhysX/Code/Source/EditorHeightfieldColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorHeightfieldColliderComponent.cpp @@ -189,6 +189,9 @@ namespace PhysX configuration.m_entityId = GetEntityId(); configuration.m_debugName = GetEntity()->GetName(); + // Update material selection from the mapping + Utils::SetMaterialsFromHeightfieldProvider(GetEntityId(), m_colliderConfig.m_materialSelection); + AzPhysics::ShapeColliderPairList colliderShapePairs; colliderShapePairs.emplace_back(AZStd::make_shared(m_colliderConfig), m_shapeConfig); configuration.m_colliderAndShapeData = colliderShapePairs; diff --git a/Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp b/Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp index c1fa09f21f..b219253b6f 100644 --- a/Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp @@ -140,6 +140,10 @@ namespace PhysX Physics::HeightfieldShapeConfiguration& configuration = static_cast(*m_shapeConfig.second); configuration = Utils::CreateHeightfieldShapeConfiguration(GetEntityId()); + + // Update material selection from the mapping + Physics::ColliderConfiguration* colliderConfig = m_shapeConfig.first.get(); + Utils::SetMaterialsFromHeightfieldProvider(GetEntityId(), colliderConfig->m_materialSelection); } void HeightfieldColliderComponent::RefreshHeightfield() diff --git a/Gems/PhysX/Code/Source/Utils.cpp b/Gems/PhysX/Code/Source/Utils.cpp index fecea57d9c..a988f6791c 100644 --- a/Gems/PhysX/Code/Source/Utils.cpp +++ b/Gems/PhysX/Code/Source/Utils.cpp @@ -66,6 +66,67 @@ namespace PhysX } } + AZStd::pair GetPhysXMaterialIndicesFromHeightfieldSamples( + const AZStd::vector& samples, + const int32_t row, const int32_t col, + const int32_t numRows, const int32_t numCols) + { + + uint8_t materialIndex0 = 0; + uint8_t materialIndex1 = 0; + + const bool lastRowIndex = (row == (numRows - 1)); + const bool lastColumnIndex = (col == (numCols - 1)); + + // In PhysX, the material indices refer to the quad down and to the right of the sample. + // If we're in the last row or last column, there aren't any quads down or to the right, + // so just clear these out. + + if (!lastRowIndex && !lastColumnIndex) + { + auto GetIndex = [numCols](int32_t row, int32_t col) + { + return (row * numCols) + col; + }; + + // Our source data is providing one material index per vertex, but PhysX wants one material index + // per triangle. The heuristic that we'll go with for selecting the material index is to choose + // the material for the vertex that's not on the diagonal of each triangle. + // Ex: A *---* B + // | / | For this, we'll use A for index0 and D for index1. + // C *---* D + // + // Ex: A *---* B + // | \ | For this, we'll use C for index0 and B for index1. + // C *---* D + // + // This is a pretty arbitrary choice, so the heuristic might need to be revisited over time if this + // causes incorrect or unpredictable physics material mappings. + + const Physics::HeightMaterialPoint& currentSample = samples[GetIndex(row, col)]; + + switch (currentSample.m_quadMeshType) + { + case Physics::QuadMeshType::SubdivideUpperLeftToBottomRight: + materialIndex0 = samples[GetIndex(row + 1, col)].m_materialIndex; + materialIndex1 = samples[GetIndex(row, col + 1)].m_materialIndex; + break; + case Physics::QuadMeshType::SubdivideBottomLeftToUpperRight: + materialIndex0 = currentSample.m_materialIndex; + materialIndex1 = samples[GetIndex(row + 1, col + 1)].m_materialIndex; + break; + case Physics::QuadMeshType::Hole: + materialIndex0 = physx::PxHeightFieldMaterial::eHOLE; + materialIndex1 = physx::PxHeightFieldMaterial::eHOLE; + break; + default: + AZ_Assert(false, "Unhandled case in GetPhysXMaterialIndicesFromHeightfieldSamples"); + break; + } + } + return { materialIndex0, materialIndex1 }; + } + void CreatePxGeometryFromHeightfield( Physics::HeightfieldShapeConfiguration& heightfieldConfig, physx::PxGeometryHolder& pxGeometry) { @@ -116,12 +177,8 @@ namespace PhysX for (int32_t row = 0; row < numRows; row++) { - const bool lastRowIndex = (row == (numRows - 1)); - for (int32_t col = 0; col < numCols; col++) { - const bool lastColumnIndex = (col == (numCols - 1)); - auto GetIndex = [numCols](int32_t row, int32_t col) { return (row * numCols) + col; @@ -134,52 +191,15 @@ namespace PhysX AZ_Assert(currentSample.m_materialIndex < physxMaximumMaterialIndex, "MaterialIndex must be less than 128"); currentPhysxSample.height = azlossy_cast( AZ::GetClamp(currentSample.m_height, minHeightBounds, maxHeightBounds) * scaleFactor); - if (lastRowIndex || lastColumnIndex) - { - // In PhysX, the material indices refer to the quad down and to the right of the sample. - // If we're in the last row or last column, there aren't any quads down or to the right, - // so just clear these out. - currentPhysxSample.materialIndex0 = 0; - currentPhysxSample.materialIndex1 = 0; - } - else - { - // Our source data is providing one material index per vertex, but PhysX wants one material index - // per triangle. The heuristic that we'll go with for selecting the material index is to choose - // the material for the vertex that's not on the diagonal of each triangle. - // Ex: A *---* B - // | / | For this, we'll use A for index0 and D for index1. - // C *---* D - // - // Ex: A *---* B - // | \ | For this, we'll use C for index0 and B for index1. - // C *---* D - // - // This is a pretty arbitrary choice, so the heuristic might need to be revisited over time if this - // causes incorrect or unpredictable physics material mappings. - switch (currentSample.m_quadMeshType) - { - case Physics::QuadMeshType::SubdivideUpperLeftToBottomRight: - currentPhysxSample.materialIndex0 = samples[GetIndex(row + 1, col)].m_materialIndex; - currentPhysxSample.materialIndex1 = samples[GetIndex(row, col + 1)].m_materialIndex; - // Set the tesselation flag to say that we need to go from UL to BR - currentPhysxSample.materialIndex0.setBit(); - break; - case Physics::QuadMeshType::SubdivideBottomLeftToUpperRight: - currentPhysxSample.materialIndex0 = currentSample.m_materialIndex; - currentPhysxSample.materialIndex1 = samples[GetIndex(row + 1, col + 1)].m_materialIndex; - break; - case Physics::QuadMeshType::Hole: - currentPhysxSample.materialIndex0 = physx::PxHeightFieldMaterial::eHOLE; - currentPhysxSample.materialIndex1 = physx::PxHeightFieldMaterial::eHOLE; - break; - default: - AZ_Warning("PhysX Heightfield", false, "Unhandled case in CreatePxGeometryFromConfig"); - currentPhysxSample.materialIndex0 = 0; - currentPhysxSample.materialIndex1 = 0; - break; - } + auto [materialIndex0, materialIndex1] = GetPhysXMaterialIndicesFromHeightfieldSamples(samples, row, col, numRows, numCols); + currentPhysxSample.materialIndex0 = materialIndex0; + currentPhysxSample.materialIndex1 = materialIndex1; + + if (currentSample.m_quadMeshType == Physics::QuadMeshType::SubdivideUpperLeftToBottomRight) + { + // Set the tesselation flag to say that we need to go from UL to BR + currentPhysxSample.setTessFlag(); } } } @@ -1562,6 +1582,20 @@ namespace PhysX return configuration; } + + void SetMaterialsFromHeightfieldProvider(const AZ::EntityId& heightfieldProviderId, Physics::MaterialSelection& materialSelection) + { + AZStd::vector materialList; + Physics::HeightfieldProviderRequestsBus::EventResult( + materialList, heightfieldProviderId, &Physics::HeightfieldProviderRequestsBus::Events::GetMaterialList); + + materialSelection.SetMaterialSlots(Physics::MaterialSelection::SlotsArray(materialList.size(), "")); + + for (int i = 0; i < materialList.size(); ++i) + { + materialSelection.SetMaterialId(materialList[i], i); + } + } } // namespace Utils namespace ReflectionUtils diff --git a/Gems/PhysX/Code/Source/Utils.h b/Gems/PhysX/Code/Source/Utils.h index 525db03315..5244926aa2 100644 --- a/Gems/PhysX/Code/Source/Utils.h +++ b/Gems/PhysX/Code/Source/Utils.h @@ -188,8 +188,15 @@ namespace PhysX //! Returns defaultValue if the input is infinite or NaN, otherwise returns the input unchanged. const AZ::Vector3& Sanitize(const AZ::Vector3& input, const AZ::Vector3& defaultValue = AZ::Vector3::CreateZero()); + AZStd::pair GetPhysXMaterialIndicesFromHeightfieldSamples( + const AZStd::vector& samples, + const int32_t row, const int32_t col, + const int32_t numRows, const int32_t numCols); + Physics::HeightfieldShapeConfiguration CreateHeightfieldShapeConfiguration(AZ::EntityId entityId); + void SetMaterialsFromHeightfieldProvider(const AZ::EntityId& heightfieldProviderId, Physics::MaterialSelection& materialSelection); + namespace Geometry { using PointList = AZStd::vector; diff --git a/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp b/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp index ef112d8623..9bdc63e60d 100644 --- a/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp +++ b/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp @@ -19,6 +19,7 @@ #include #include #include +#include using ::testing::NiceMock; using ::testing::Return; @@ -27,18 +28,28 @@ namespace PhysXEditorTests { AZStd::vector GetSamples() { - AZStd::vector samples{ { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 2.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 1.5f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 1.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 1.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 0.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight } }; + AZStd::vector samples{ { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 0 }, + { 2.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 1 }, + { 1.5f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 2 }, + { 1.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 0 }, + { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 1 }, + { 1.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 2 }, + { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 0 }, + { 0.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 1 }, + { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 2 } }; return samples; } + AZStd::vector GetMaterialList() + { + AZStd::vector materials{ + {Physics::MaterialId::FromUUID("{EC976D51-2C26-4C1E-BBF2-75BAAAFA162C}")}, + {Physics::MaterialId::FromUUID("{B9836F51-A235-4781-95E3-A6302BEE9EFF}")}, + {Physics::MaterialId::FromUUID("{7E060707-BB03-47EB-B046-4503C7145B6E}")} + }; + return materials; + } + EntityPtr SetupHeightfieldComponent() { // create an editor entity with a shape collider component and a box shape component @@ -78,6 +89,7 @@ namespace PhysXEditorTests x = -3.0f; y = 3.0f; }); + ON_CALL(mockShapeRequests, GetMaterialList).WillByDefault(Return(GetMaterialList())); } EntityPtr TestCreateActiveGameEntityFromEditorEntity(AZ::Entity* editorEntity) @@ -89,6 +101,89 @@ namespace PhysXEditorTests return gameEntity; } + class PhysXEditorHeightfieldFixture : public PhysXEditorFixture + { + public: + void SetUp() override + { + PhysXEditorFixture::SetUp(); + PopulateDefaultMaterialLibrary(); + + m_editorEntity = SetupHeightfieldComponent(); + m_editorMockShapeRequests = AZStd::make_unique>(m_editorEntity->GetId()); + SetupMockMethods(*m_editorMockShapeRequests.get()); + m_editorEntity->Activate(); + + m_gameEntity = TestCreateActiveGameEntityFromEditorEntity(m_editorEntity.get()); + m_gameMockShapeRequests = AZStd::make_unique>(m_gameEntity->GetId()); + SetupMockMethods(*m_gameMockShapeRequests.get()); + m_gameEntity->Activate(); + } + + void TearDown() override + { + CleanupHeightfieldComponent(); + + m_editorEntity = nullptr; + m_gameEntity = nullptr; + m_editorMockShapeRequests = nullptr; + m_gameMockShapeRequests = nullptr; + + PhysXEditorFixture::TearDown(); + } + + void PopulateDefaultMaterialLibrary() + { + AZ::Data::AssetId assetId = AZ::Data::AssetId(AZ::Uuid::Create()); + + // Create an asset out of our Script Event + Physics::MaterialLibraryAsset* matLibAsset = aznew Physics::MaterialLibraryAsset; + { + AZStd::vector matIds = GetMaterialList(); + + for (Physics::MaterialId matId : matIds) + { + Physics::MaterialFromAssetConfiguration matConfig; + matConfig.m_id = matId; + matConfig.m_configuration.m_surfaceType = matId.GetUuid().ToString(); + matLibAsset->AddMaterialData(matConfig); + } + } + + // Note: There is no interface to simply update material library asset. It has to go via updating the entire configuration which causes assets reloading. + // It makes sense as a safety mechanism in the Editor but makes it harder to write tests. + // Hence have to work around it via const_cast here to be able to simply set the generated asset into configuration. + AzPhysics::SystemConfiguration* sysConfig = const_cast(AZ::Interface::Get()->GetConfiguration()); + + AZ::Data::Asset assetData(assetId, matLibAsset, AZ::Data::AssetLoadBehavior::Default); + sysConfig->m_materialLibraryAsset = assetData; + } + + Physics::Material* GetMaterialFromRaycast(float x, float y) + { + AzPhysics::RayCastRequest request; + request.m_start = AZ::Vector3(x, y, 5.0f); + request.m_direction = AZ::Vector3(0.0f, 0.0f, -1.0f); + request.m_distance = 10.0f; + + //query the scene + auto* sceneInterface = AZ::Interface::Get(); + AzPhysics::SceneQueryHits result = sceneInterface->QueryScene(m_defaultSceneHandle, &request); + EXPECT_EQ(result.m_hits.size(), 1); + + if (result) + { + return result.m_hits[0].m_material; + } + + return nullptr; + }; + + EntityPtr m_editorEntity; + EntityPtr m_gameEntity; + AZStd::unique_ptr> m_editorMockShapeRequests; + AZStd::unique_ptr> m_gameMockShapeRequests; + }; TEST_F(PhysXEditorFixture, EditorHeightfieldColliderComponentDependenciesSatisfiedEntityIsValid) { @@ -149,21 +244,13 @@ namespace PhysXEditorTests CleanupHeightfieldComponent(); } - TEST_F(PhysXEditorFixture, EditorHeightfieldColliderComponentHeightfieldColliderWithAABoxCorrectRuntimeGeometry) + TEST_F(PhysXEditorHeightfieldFixture, EditorHeightfieldColliderComponentHeightfieldColliderWithAABoxCorrectRuntimeGeometry) { - EntityPtr editorEntity = SetupHeightfieldComponent(); - NiceMock mockShapeRequests(editorEntity->GetId()); - SetupMockMethods(mockShapeRequests); - editorEntity->Activate(); - - EntityPtr gameEntity = TestCreateActiveGameEntityFromEditorEntity(editorEntity.get()); - NiceMock mockShapeRequests2(gameEntity->GetId()); - SetupMockMethods(mockShapeRequests2); - gameEntity->Activate(); + AZ::EntityId gameEntityId = m_gameEntity->GetId(); AzPhysics::SimulatedBody* staticBody = nullptr; AzPhysics::SimulatedBodyComponentRequestsBus::EventResult( - staticBody, gameEntity->GetId(), &AzPhysics::SimulatedBodyComponentRequests::GetSimulatedBody); + staticBody, gameEntityId, &AzPhysics::SimulatedBodyComponentRequests::GetSimulatedBody); const auto* pxRigidStatic = static_cast(staticBody->GetNativePointer()); PHYSX_SCENE_READ_LOCK(pxRigidStatic->getScene()); @@ -183,7 +270,7 @@ namespace PhysXEditorTests int32_t numRows{ 0 }; int32_t numColumns{ 0 }; Physics::HeightfieldProviderRequestsBus::Event( - gameEntity->GetId(), &Physics::HeightfieldProviderRequestsBus::Events::GetHeightfieldGridSize, numColumns, numRows); + gameEntityId, &Physics::HeightfieldProviderRequestsBus::Events::GetHeightfieldGridSize, numColumns, numRows); EXPECT_EQ(numColumns, heightfield->getNbColumns()); EXPECT_EQ(numRows, heightfield->getNbRows()); @@ -194,12 +281,12 @@ namespace PhysXEditorTests float minHeightBounds{ 0.0f }; float maxHeightBounds{ 0.0f }; Physics::HeightfieldProviderRequestsBus::Event( - gameEntity->GetId(), &Physics::HeightfieldProviderRequestsBus::Events::GetHeightfieldHeightBounds, minHeightBounds, + gameEntityId, &Physics::HeightfieldProviderRequestsBus::Events::GetHeightfieldHeightBounds, minHeightBounds, maxHeightBounds); AZStd::vector samples; Physics::HeightfieldProviderRequestsBus::EventResult( - samples, gameEntity->GetId(), &Physics::HeightfieldProviderRequestsBus::Events::GetHeightsAndMaterials); + samples, gameEntityId, &Physics::HeightfieldProviderRequestsBus::Events::GetHeightsAndMaterials); const float halfBounds{ (maxHeightBounds - minHeightBounds) / 2.0f }; const float scaleFactor = (maxHeightBounds <= minHeightBounds) ? 1.0f : AZStd::numeric_limits::max() / halfBounds; @@ -208,7 +295,80 @@ namespace PhysXEditorTests EXPECT_EQ(samplePhysX.height, azlossy_cast(samplePhysics.m_height * scaleFactor)); } } - CleanupHeightfieldComponent(); + } + + TEST_F(PhysXEditorHeightfieldFixture, EditorHeightfieldColliderComponentHeightfieldColliderCorrectMaterials) + { + AZ::EntityId gameEntityId = m_gameEntity->GetId(); + + int32_t numRows{ 0 }; + int32_t numColumns{ 0 }; + Physics::HeightfieldProviderRequestsBus::Event( + gameEntityId, &Physics::HeightfieldProviderRequestsBus::Events::GetHeightfieldGridSize, numColumns, numRows); + + EXPECT_EQ(numRows, 3); + EXPECT_EQ(numColumns, 3); + + AZStd::vector samples; + Physics::HeightfieldProviderRequestsBus::EventResult( + samples, gameEntityId, &Physics::HeightfieldProviderRequestsBus::Events::GetHeightsAndMaterials); + + AzPhysics::SimulatedBody* staticBody = nullptr; + AzPhysics::SimulatedBodyComponentRequestsBus::EventResult( + staticBody, gameEntityId, &AzPhysics::SimulatedBodyComponentRequests::GetSimulatedBody); + + const auto* pxRigidStatic = static_cast(staticBody->GetNativePointer()); + PHYSX_SCENE_READ_LOCK(pxRigidStatic->getScene()); + + physx::PxShape* shape = nullptr; + pxRigidStatic->getShapes(&shape, 1, 0); + + physx::PxHeightFieldGeometry heightfieldGeometry; + shape->getHeightFieldGeometry(heightfieldGeometry); + + physx::PxHeightField* heightfield = heightfieldGeometry.heightField; + + AZStd::vector physicsSurfaceTypes; + for (Physics::MaterialId materialId : GetMaterialList()) + { + physicsSurfaceTypes.emplace_back(materialId.GetUuid().ToString()); + } + + // PhysX Heightfield cooking doesn't map 1-1 sample material indices to triangle material indices + // Hence hardcoding the expected material indices in the test + const int physicsMaterialsValidationDataIndex[] = {0, 2, 1, 1}; + + for (int sampleRow = 0; sampleRow < numRows; ++sampleRow) + { + for (int sampleColumn = 0; sampleColumn < numColumns; ++sampleColumn) + { + physx::PxHeightFieldSample samplePhysX = heightfield->getSample(sampleRow, sampleColumn); + Physics::HeightMaterialPoint samplePhysics = samples[sampleRow * numColumns + sampleColumn]; + + auto [materialIndex0, materialIndex1] = PhysX::Utils::GetPhysXMaterialIndicesFromHeightfieldSamples(samples, sampleRow, sampleColumn, numRows, numColumns); + EXPECT_EQ(samplePhysX.materialIndex0, materialIndex0); + EXPECT_EQ(samplePhysX.materialIndex1, materialIndex1); + + if (sampleRow != numRows - 1 && sampleColumn != numColumns - 1) + { + const float x_offset = -0.25f; + const float y_offset = 0.75f; + const float secondRayOffset = 0.5f; + + float rayX = x_offset + sampleColumn; + float rayY = y_offset + sampleRow; + + Physics::Material* mat1 = GetMaterialFromRaycast(rayX, rayY); + EXPECT_NE(mat1, nullptr); + + Physics::Material* mat2 = GetMaterialFromRaycast(rayX + secondRayOffset, rayY + secondRayOffset); + EXPECT_NE(mat2, nullptr); + + AZStd::string expectedMaterialName = physicsSurfaceTypes[physicsMaterialsValidationDataIndex[sampleRow * 2 + sampleColumn]]; + EXPECT_EQ(mat1->GetSurfaceTypeName(), expectedMaterialName); + } + } + } } } // namespace PhysXEditorTests diff --git a/Gems/PhysX/Code/Tests/EditorTestUtilities.cpp b/Gems/PhysX/Code/Tests/EditorTestUtilities.cpp index fa794c58a5..272d9157b2 100644 --- a/Gems/PhysX/Code/Tests/EditorTestUtilities.cpp +++ b/Gems/PhysX/Code/Tests/EditorTestUtilities.cpp @@ -70,6 +70,24 @@ namespace PhysXEditorTests } } + void PhysXEditorFixture::ConnectToPVD() + { + auto* debug = AZ::Interface::Get(); + if (debug) + { + debug->ConnectToPvd(); + } + } + + void PhysXEditorFixture::DisconnectFromPVD() + { + auto* debug = AZ::Interface::Get(); + if (debug) + { + debug->DisconnectFromPvd(); + } + } + // DefaultWorldBus AzPhysics::SceneHandle PhysXEditorFixture::GetDefaultSceneHandle() const { diff --git a/Gems/PhysX/Code/Tests/EditorTestUtilities.h b/Gems/PhysX/Code/Tests/EditorTestUtilities.h index 9dfe40f366..26566f724a 100644 --- a/Gems/PhysX/Code/Tests/EditorTestUtilities.h +++ b/Gems/PhysX/Code/Tests/EditorTestUtilities.h @@ -48,6 +48,9 @@ namespace PhysXEditorTests void SetUp() override; void TearDown() override; + void ConnectToPVD(); + void DisconnectFromPVD(); + // DefaultWorldBus AzPhysics::SceneHandle GetDefaultSceneHandle() const override; From cc50a18fe997eeccc342d63f913942581d2fc9ae Mon Sep 17 00:00:00 2001 From: greerdv Date: Thu, 20 Jan 2022 11:38:22 +0000 Subject: [PATCH 118/620] add support for quad shapes in shape collider component Signed-off-by: greerdv --- .../Source/EditorShapeColliderComponent.cpp | 133 +++++++++++++++++- .../Source/EditorShapeColliderComponent.h | 11 ++ .../Code/Source/ShapeColliderComponent.h | 1 + 3 files changed, 144 insertions(+), 1 deletion(-) diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp index 59b659a0bf..f61b2fce74 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -64,6 +65,17 @@ namespace PhysX return AZ::Edit::PropertyVisibility::Hide; } + AZ::Crc32 EditorShapeColliderComponent::SingleSidedVisibility() + { + if ((m_shapeType == ShapeType::QuadSingleSided || m_shapeType == ShapeType::QuadDoubleSided) + && GetEntity()->FindComponent() == nullptr) + { + return AZ::Edit::PropertyVisibility::Show; + } + + return AZ::Edit::PropertyVisibility::Hide; + } + void EditorShapeColliderComponent::Reflect(AZ::ReflectContext* context) { if (auto serializeContext = azrtti_cast(context)) @@ -74,6 +86,7 @@ namespace PhysX ->Field("DebugDrawSettings", &EditorShapeColliderComponent::m_colliderDebugDraw) ->Field("ShapeConfigs", &EditorShapeColliderComponent::m_shapeConfigs) ->Field("SubdivisionCount", &EditorShapeColliderComponent::m_subdivisionCount) + ->Field("SingleSided", &EditorShapeColliderComponent::m_singleSided) ; if (auto editContext = serializeContext->GetEditContext()) @@ -100,6 +113,10 @@ namespace PhysX ->Attribute(AZ::Edit::Attributes::Max, Utils::MaxFrustumSubdivisions) ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorShapeColliderComponent::OnSubdivisionCountChange) ->Attribute(AZ::Edit::Attributes::Visibility, &EditorShapeColliderComponent::SubdivisionCountVisibility) + ->DataElement(AZ::Edit::UIHandlers::Default, &EditorShapeColliderComponent::m_singleSided, "Single sided", + "If enabled, planar shapes will only collide from one direction (not valid for shapes attached to dynamic rigid bodies)") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorShapeColliderComponent::OnSingleSidedChange) + ->Attribute(AZ::Edit::Attributes::Visibility, &EditorShapeColliderComponent::SingleSidedVisibility) ; } } @@ -126,7 +143,6 @@ namespace PhysX incompatible.push_back(AZ_CRC_CE("AxisAlignedBoxShapeService")); incompatible.push_back(AZ_CRC_CE("CompoundShapeService")); incompatible.push_back(AZ_CRC_CE("DiskShapeService")); - incompatible.push_back(AZ_CRC_CE("QuadShapeService")); incompatible.push_back(AZ_CRC_CE("TubeShapeService")); incompatible.push_back(AZ_CRC_CE("ReferenceShapeService")); } @@ -206,6 +222,12 @@ namespace PhysX break; } + case ShapeType::QuadSingleSided: + case ShapeType::QuadDoubleSided: + { + // a quad shape has no interior, just return an empty vector of sample points + break; + } default: AZ_WarningOnce("PhysX Shape Collider Component", false, "Unsupported shape type in UpdateCachedSamplePoints"); break; @@ -331,6 +353,11 @@ namespace PhysX UpdateCylinderConfig(uniformScale); } + else if (shapeCrc == ShapeConstants::Quad) + { + UpdateQuadConfig(overallScale); + } + else { m_shapeType = !shapeCrc ? ShapeType::None : ShapeType::Unsupported; @@ -354,6 +381,60 @@ namespace PhysX m_geometryCache.m_boxDimensions = scale * boxDimensions; } + void EditorShapeColliderComponent::UpdateQuadConfig(const AZ::Vector3& scale) + { + LmbrCentral::QuadShapeConfig quadShapeConfig; + LmbrCentral::QuadShapeComponentRequestBus::EventResult(quadShapeConfig, GetEntityId(), + &LmbrCentral::QuadShapeComponentRequests::GetQuadConfiguration); + + const float minDimension = 1e-3f; // used to prevent the dimensions being 0 in any direction + const float xDim = AZ::GetMax(minDimension, quadShapeConfig.m_width); + const float yDim = AZ::GetMax(minDimension, quadShapeConfig.m_height); + + if (m_singleSided) + { + AZStd::vector cookedData; + + constexpr AZ::u32 vertexCount = 4; + const AZ::Vector3 vertices[vertexCount] = + { + AZ::Vector3(-0.5f * xDim, -0.5f * yDim, 0.0f), + AZ::Vector3(-0.5f * xDim, 0.5f * yDim, 0.0f), + AZ::Vector3(0.5f * xDim, 0.5f * yDim, 0.0f), + AZ::Vector3(0.5f * xDim, -0.5f * yDim, 0.0f), + }; + + constexpr AZ::u32 indexCount = 6; + const AZ::u32 indices[indexCount] = + { + 0, 1, 2, + 0, 2, 3 + }; + + bool cookingResult = false; + Physics::SystemRequestBus::BroadcastResult(cookingResult, &Physics::SystemRequests::CookTriangleMeshToMemory, + vertices, vertexCount, indices, indexCount, cookedData); + + Physics::CookedMeshShapeConfiguration shapeConfig; + shapeConfig.SetCookedMeshData(cookedData.data(), cookedData.size(), + Physics::CookedMeshShapeConfiguration::MeshType::TriangleMesh); + shapeConfig.m_scale = scale; + + SetShapeConfig(ShapeType::QuadSingleSided, shapeConfig); + } + + else + { + // it's not possible to create a perfectly 2d convex in PhysX, so the best we can do is a very thin box + const float zDim = AZ::GetMax(minDimension, 1e-3f * AZ::GetMin(xDim, yDim)); + const AZ::Vector3 boxDimensions(xDim, yDim, zDim); + + SetShapeConfig(ShapeType::QuadDoubleSided, Physics::BoxShapeConfiguration(boxDimensions)); + + m_shapeConfigs.back()->m_scale = scale; + } + } + void EditorShapeColliderComponent::UpdateCapsuleConfig(const AZ::Vector3& scale) { LmbrCentral::CapsuleShapeConfig lmbrCentralCapsuleShapeConfig; @@ -425,6 +506,12 @@ namespace PhysX } } + void EditorShapeColliderComponent::OnSingleSidedChange() + { + UpdateShapeConfigs(); + CreateStaticEditorCollider(); + } + AZ::u32 EditorShapeColliderComponent::OnSubdivisionCountChange() { const AZ::Vector3 uniformScale = Utils::GetUniformScale(GetEntityId()); @@ -615,6 +702,8 @@ namespace PhysX m_editorSceneHandle = m_sceneInterface->GetSceneHandle(AzPhysics::EditorPhysicsSceneName); } + UpdateTriggerSettings(); + UpdateSingleSidedSettings(); UpdateShapeConfigs(); // Debug drawing @@ -767,6 +856,7 @@ namespace PhysX if (changeReason == LmbrCentral::ShapeComponentNotifications::ShapeChangeReasons::ShapeChanged) { UpdateShapeConfigs(); + UpdateTriggerSettings(); CreateStaticEditorCollider(); Physics::ColliderComponentEventBus::Event(GetEntityId(), &Physics::ColliderComponentEvents::OnColliderChanged); @@ -849,4 +939,45 @@ namespace PhysX { return m_colliderConfig.m_isTrigger; } + + void EditorShapeColliderComponent::UpdateTriggerSettings() + { + if (m_shapeType == ShapeType::QuadSingleSided || m_shapeType == ShapeType::QuadDoubleSided) + { + if (!m_previousIsTrigger.has_value()) + { + m_previousIsTrigger = m_colliderConfig.m_isTrigger; + } + m_colliderConfig.SetPropertyVisibility(Physics::ColliderConfiguration::PropertyVisibility::IsTrigger, false); + } + else + { + if (m_previousIsTrigger.has_value()) + { + m_colliderConfig.m_isTrigger = m_previousIsTrigger.value(); + m_previousIsTrigger.reset(); + } + m_colliderConfig.SetPropertyVisibility(Physics::ColliderConfiguration::PropertyVisibility::IsTrigger, true); + } + } + + void EditorShapeColliderComponent::UpdateSingleSidedSettings() + { + if (GetEntity()->FindComponent()) + { + if (!m_previousSingleSided.has_value()) + { + m_previousSingleSided = m_singleSided; + } + m_singleSided = false; + } + else + { + if (m_previousSingleSided.has_value()) + { + m_singleSided = m_previousSingleSided.value(); + m_previousSingleSided.reset(); + } + } + } } // namespace PhysX diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h index 3422d4959f..0f5350b781 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h @@ -41,6 +41,8 @@ namespace PhysX Sphere, PolygonPrism, Cylinder, + QuadDoubleSided, + QuadSingleSided, Unsupported }; @@ -89,6 +91,7 @@ namespace PhysX AZ::u32 OnConfigurationChanged(); void UpdateShapeConfigs(); void UpdateBoxConfig(const AZ::Vector3& scale); + void UpdateQuadConfig(const AZ::Vector3& scale); void UpdateCapsuleConfig(const AZ::Vector3& scale); void UpdateSphereConfig(const AZ::Vector3& scale); void UpdateCylinderConfig(const AZ::Vector3& scale); @@ -103,6 +106,8 @@ namespace PhysX AZ::u32 OnSubdivisionCountChange(); AZ::Crc32 SubdivisionCountVisibility(); + void OnSingleSidedChange(); + AZ::Crc32 SingleSidedVisibility(); // AZ::Component void Activate() override; @@ -137,6 +142,9 @@ namespace PhysX AZ::Aabb GetColliderShapeAabb() override; bool IsTrigger() override; + void UpdateTriggerSettings(); + void UpdateSingleSidedSettings(); + Physics::ColliderConfiguration m_colliderConfig; //!< Stores collision layers, whether the collider is a trigger, etc. DebugDraw::Collider m_colliderDebugDraw; //!< Handles drawing the collider based on global and local AzPhysics::SceneInterface* m_sceneInterface = nullptr; @@ -151,6 +159,9 @@ namespace PhysX //! @note 16 is the number of subdivisions in the debug cylinder that is loaded as a mesh (not generated procedurally) AZ::u8 m_subdivisionCount = 16; mutable GeometryCache m_geometryCache; //!< Cached data for generating sample points inside the attached shape. + AZStd::optional m_previousIsTrigger; //!< Stores the previous trigger setting if the shape is changed to one which does not support triggers. + bool m_singleSided = false; //!< Used for 2d shapes like quad which may be treated as either single or doubled sided. + AZStd::optional m_previousSingleSided; //!< Stores the previous single sided setting when unable to support single-sided shapes (such as when used with a dynamic rigid body). AzPhysics::SystemEvents::OnConfigurationChangedEvent::Handler m_physXConfigChangedHandler; AzPhysics::SystemEvents::OnMaterialLibraryChangedEvent::Handler m_onMaterialLibraryChangedEventHandler; diff --git a/Gems/PhysX/Code/Source/ShapeColliderComponent.h b/Gems/PhysX/Code/Source/ShapeColliderComponent.h index 2065f17dcf..cfc51f08ed 100644 --- a/Gems/PhysX/Code/Source/ShapeColliderComponent.h +++ b/Gems/PhysX/Code/Source/ShapeColliderComponent.h @@ -30,6 +30,7 @@ namespace PhysX static const AZ::Crc32 Sphere = AZ_CRC("Sphere", 0x55f96687); static const AZ::Crc32 PolygonPrism = AZ_CRC("PolygonPrism", 0xd6b50036); static const AZ::Crc32 Cylinder = AZ_CRC("Cylinder", 0x9b045bea); + static const AZ::Crc32 Quad = AZ_CRC("QuadShape", 0x40d75e14); } // namespace ShapeConstants /// Component that provides a collider based on geometry from a shape component. From a8eb5be2e6f3952ce1fdff147104dd1e1e049d7a Mon Sep 17 00:00:00 2001 From: greerdv Date: Thu, 20 Jan 2022 13:24:01 +0000 Subject: [PATCH 119/620] fix order of triangle indices for single-sided quad collider Signed-off-by: greerdv --- Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp index f61b2fce74..b935ff2536 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp @@ -407,8 +407,8 @@ namespace PhysX constexpr AZ::u32 indexCount = 6; const AZ::u32 indices[indexCount] = { - 0, 1, 2, - 0, 2, 3 + 0, 2, 1, + 0, 3, 2 }; bool cookingResult = false; From f61011f5ac8382c7db145538f873933a64e76b51 Mon Sep 17 00:00:00 2001 From: greerdv Date: Thu, 20 Jan 2022 18:14:33 +0000 Subject: [PATCH 120/620] add editor side tests for quad colliders Signed-off-by: greerdv --- .../Source/EditorShapeColliderComponent.cpp | 3 +- .../Tests/ShapeColliderComponentTests.cpp | 150 +++++++++++++++++- 2 files changed, 148 insertions(+), 5 deletions(-) diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp index b935ff2536..bdf70fc227 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp @@ -702,9 +702,9 @@ namespace PhysX m_editorSceneHandle = m_sceneInterface->GetSceneHandle(AzPhysics::EditorPhysicsSceneName); } - UpdateTriggerSettings(); UpdateSingleSidedSettings(); UpdateShapeConfigs(); + UpdateTriggerSettings(); // Debug drawing m_colliderDebugDraw.Connect(GetEntityId()); @@ -947,6 +947,7 @@ namespace PhysX if (!m_previousIsTrigger.has_value()) { m_previousIsTrigger = m_colliderConfig.m_isTrigger; + m_colliderConfig.m_isTrigger = false; } m_colliderConfig.SetPropertyVisibility(Physics::ColliderConfiguration::PropertyVisibility::IsTrigger, false); } diff --git a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp index 06ba4f3e9c..21d381a259 100644 --- a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp +++ b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -452,21 +453,55 @@ namespace PhysXEditorTests EXPECT_TRUE(aabb.GetMin().IsClose(translation - 0.5f * scale * boxDimensions)); } - void SetTrigger(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent, bool isTrigger) + void SetBoolValueOnComponent(AZ::Component* component, AZ::Crc32 name, bool value) { AZ::SerializeContext* serializeContext = nullptr; AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); AzToolsFramework::InstanceDataHierarchy instanceDataHierarchy; - instanceDataHierarchy.AddRootInstance(editorShapeColliderComponent); + instanceDataHierarchy.AddRootInstance(component); instanceDataHierarchy.Build(serializeContext, AZ::SerializeContext::ENUM_ACCESS_FOR_WRITE); AzToolsFramework::InstanceDataHierarchy::InstanceDataNode* instanceNode = - instanceDataHierarchy.FindNodeByPartialAddress({ AZ_CRC("Trigger", 0x1a6b0f5d) }); + instanceDataHierarchy.FindNodeByPartialAddress({ name }); if (instanceNode) { - instanceNode->Write(isTrigger); + instanceNode->Write(value); } } + void SetTrigger(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent, bool isTrigger) + { + SetBoolValueOnComponent(editorShapeColliderComponent, AZ_CRC("Trigger", 0x1a6b0f5d), isTrigger); + } + + bool GetBoolValueFromComponent(AZ::Component* component, AZ::Crc32 name) + { + AZ::SerializeContext* serializeContext = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); + AzToolsFramework::InstanceDataHierarchy instanceDataHierarchy; + instanceDataHierarchy.AddRootInstance(component); + instanceDataHierarchy.Build(serializeContext, AZ::SerializeContext::ENUM_ACCESS_FOR_READ); + AzToolsFramework::InstanceDataHierarchy::InstanceDataNode* instanceNode = + instanceDataHierarchy.FindNodeByPartialAddress({ name }); + bool value = false; + instanceNode->Read(value); + return value; + } + + bool IsTrigger(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent) + { + return GetBoolValueFromComponent(editorShapeColliderComponent, AZ_CRC("Trigger")); + } + + void SetSingleSided(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent, bool singleSided) + { + SetBoolValueOnComponent(editorShapeColliderComponent, AZ_CRC("SingleSided"), singleSided); + } + + bool IsSingleSided(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent) + { + return GetBoolValueFromComponent(editorShapeColliderComponent, AZ_CRC("SingleSided")); + } + EntityPtr CreateRigidBox(const AZ::Vector3& boxDimensions, const AZ::Vector3& position) { EntityPtr rigidBodyEditorEntity = CreateInactiveEditorEntity("RigidBodyEditorEntity"); @@ -566,4 +601,111 @@ namespace PhysXEditorTests EXPECT_THAT(aabb.GetMin(), UnitTest::IsClose(-0.5f * boxDimensions * parentScale)); } + class PhysXEditorParamBoolFixture + : public ::testing::WithParamInterface + , public PhysXEditorFixture + { + }; + + TEST_P(PhysXEditorParamBoolFixture, EditorShapeColliderComponent_ShapeColliderWithQuadShapeNonUniformlyScalesCorrectly) + { + // test both single and double-sided quad colliders + bool singleSided = GetParam(); + + EntityPtr editorEntity = CreateInactiveEditorEntity("QuadEntity"); + editorEntity->CreateComponent(LmbrCentral::EditorQuadShapeComponentTypeId); + auto* shapeColliderComponent = editorEntity->CreateComponent(); + SetSingleSided(shapeColliderComponent, singleSided); + editorEntity->CreateComponent(); + const auto entityId = editorEntity->GetId(); + + editorEntity->Activate(); + + LmbrCentral::QuadShapeComponentRequestBus::Event(entityId, &LmbrCentral::QuadShapeComponentRequests::SetQuadWidth, 1.2f); + LmbrCentral::QuadShapeComponentRequestBus::Event(entityId, &LmbrCentral::QuadShapeComponentRequests::SetQuadHeight, 0.8f); + + // update the transform scale and non-uniform scale + AZ::TransformBus::Event(entityId, &AZ::TransformBus::Events::SetLocalUniformScale, 3.0f); + AZ::NonUniformScaleRequestBus::Event(entityId, &AZ::NonUniformScaleRequests::SetScale, AZ::Vector3(1.5f, 0.5f, 1.0f)); + + // make a game entity and check that its AABB is as expected + EntityPtr gameEntity = CreateActiveGameEntityFromEditorEntity(editorEntity.get()); + AZ::Aabb aabb = gameEntity->FindComponent()->GetAabb(); + + EXPECT_NEAR(aabb.GetMin().GetX(), -2.7f, 1e-3f); + EXPECT_NEAR(aabb.GetMin().GetY(), -0.6f, 1e-3f); + EXPECT_NEAR(aabb.GetMax().GetX(), 2.7f, 1e-3f); + EXPECT_NEAR(aabb.GetMax().GetY(), 0.6f, 1e-3f); + EXPECT_TRUE(true); + } + + TEST_P(PhysXEditorParamBoolFixture, EditorShapeColliderComponent_TriggerSettingIsRememberedWhenSwitchingToQuadAndBack) + { + bool initialTriggerSetting = GetParam(); + + // create an editor entity with a box component (which does support trigger) + EntityPtr editorEntity = CreateInactiveEditorEntity("QuadEntity"); + auto* boxShapeComponent = editorEntity->CreateComponent(LmbrCentral::EditorBoxShapeComponentTypeId); + auto* shapeColliderComponent = editorEntity->CreateComponent(); + SetTrigger(shapeColliderComponent, initialTriggerSetting); + editorEntity->Activate(); + + // the trigger setting should be what it was set to + EXPECT_EQ(IsTrigger(shapeColliderComponent), initialTriggerSetting); + + // deactivate the entity and swap the box for a quad (which does not support trigger) + editorEntity->Deactivate(); + editorEntity->RemoveComponent(boxShapeComponent); + auto* quadShapeComponent = editorEntity->CreateComponent(LmbrCentral::EditorQuadShapeComponentTypeId); + editorEntity->Activate(); + + // the trigger setting should now be false, because quad shape does not support triggers + EXPECT_FALSE(IsTrigger(shapeColliderComponent)); + + // swap back to a box shape + editorEntity->Deactivate(); + editorEntity->RemoveComponent(quadShapeComponent); + editorEntity->AddComponent(boxShapeComponent); + editorEntity->Activate(); + + // the original trigger setting should have been remembered + EXPECT_EQ(IsTrigger(shapeColliderComponent), initialTriggerSetting); + + // the quad shape component is no longer attached to the entity so won't be automatically cleared up + delete quadShapeComponent; + } + + TEST_P(PhysXEditorParamBoolFixture, EditorShapeColliderComponent_SingleSidedSettingIsRememberedWhenAddingAndRemovingRigidBody) + { + bool initialSingleSidedSetting = GetParam(); + + // create an editor entity without a rigid body (that means both single-sided and double-sided quads are valid) + EntityPtr editorEntity = CreateInactiveEditorEntity("QuadEntity"); + editorEntity->CreateComponent(LmbrCentral::EditorQuadShapeComponentTypeId); + auto* shapeColliderComponent = editorEntity->CreateComponent(); + SetSingleSided(shapeColliderComponent, initialSingleSidedSetting); + editorEntity->Activate(); + + // verify that the single sided setting matches the initial value + EXPECT_EQ(IsSingleSided(shapeColliderComponent), initialSingleSidedSetting); + + // add an editor rigid body component (this should mean single-sided quads are not supported) + editorEntity->Deactivate(); + auto rigidBodyComponent = editorEntity->CreateComponent(); + editorEntity->Activate(); + + EXPECT_FALSE(IsSingleSided(shapeColliderComponent)); + + // remove the editor rigid body component (the previous single-sided setting should be restored) + editorEntity->Deactivate(); + editorEntity->RemoveComponent(rigidBodyComponent); + editorEntity->Activate(); + + EXPECT_EQ(IsSingleSided(shapeColliderComponent), initialSingleSidedSetting); + + // the rigid body component is no longer attached to the entity so won't be automatically cleared up + delete rigidBodyComponent; + } + + INSTANTIATE_TEST_CASE_P(PhysXEditorTests, PhysXEditorParamBoolFixture, ::testing::Bool()); } // namespace PhysXEditorTests From 6a700e6b955d784b814cf7d39aa1ed65244236fa Mon Sep 17 00:00:00 2001 From: greerdv Date: Thu, 20 Jan 2022 19:10:56 +0000 Subject: [PATCH 121/620] add test for runtime behaviour of single sided quad collider Signed-off-by: greerdv --- .../Tests/ShapeColliderComponentTests.cpp | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp index 21d381a259..c164e5de63 100644 --- a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp +++ b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp @@ -707,5 +707,39 @@ namespace PhysXEditorTests delete rigidBodyComponent; } - INSTANTIATE_TEST_CASE_P(PhysXEditorTests, PhysXEditorParamBoolFixture, ::testing::Bool()); + INSTANTIATE_TEST_CASE_P(PhysXEditorTest, PhysXEditorParamBoolFixture, ::testing::Bool()); + + TEST_F(PhysXEditorFixture, EditorShapeColliderComponent_SingleSidedQuadDoesNotCollideFromBelow) + { + // create an editor entity without a rigid body (that means both single-sided and double-sided quads are valid), positioned at the origin + EntityPtr editorQuadEntity = CreateInactiveEditorEntity("QuadEntity"); + editorQuadEntity->CreateComponent(LmbrCentral::EditorQuadShapeComponentTypeId); + auto* shapeColliderComponent = editorQuadEntity->CreateComponent(); + SetSingleSided(shapeColliderComponent, true); + editorQuadEntity->Activate(); + LmbrCentral::QuadShapeComponentRequestBus::Event(editorQuadEntity->GetId(), &LmbrCentral::QuadShapeComponentRequests::SetQuadHeight, 10.0f); + LmbrCentral::QuadShapeComponentRequestBus::Event(editorQuadEntity->GetId(), &LmbrCentral::QuadShapeComponentRequests::SetQuadWidth, 10.0f); + + // add a second entity with a box collider and a rigid body, positioned below the quad + EntityPtr editorBoxEntity = CreateInactiveEditorEntity("BoxEntity"); + editorBoxEntity->CreateComponent(LmbrCentral::BoxShapeComponentTypeId); + editorBoxEntity->CreateComponent(); + editorBoxEntity->CreateComponent(); + editorBoxEntity->Activate(); + AZ::TransformBus::Event(editorBoxEntity->GetId(), &AZ::TransformBus::Events::SetWorldTranslation, -AZ::Vector3::CreateAxisZ()); + + EntityPtr gameQuadEntity = CreateActiveGameEntityFromEditorEntity(editorQuadEntity.get()); + EntityPtr gameBoxEntity = CreateActiveGameEntityFromEditorEntity(editorBoxEntity.get()); + + // give the box enough upward velocity to rise above the level of the quad and simulate + Physics::RigidBodyRequestBus::Event(gameBoxEntity->GetId(), &Physics::RigidBodyRequests::SetLinearVelocity, AZ::Vector3::CreateAxisZ(6.0f)); + PhysX::TestUtils::UpdateScene(m_defaultScene, AzPhysics::SystemConfiguration::DefaultFixedTimestep, 200); + + // the box should travel through the base of the quad because it has no collision from that direction + // and land on the top surface of the quad, which does have collision + float finalHeight = 0.0f; + AZ::TransformBus::EventResult(finalHeight, gameBoxEntity->GetId(), &AZ::TransformBus::Events::GetWorldZ); + + EXPECT_GT(finalHeight, 0.0f); + } } // namespace PhysXEditorTests From cdcf8defd03dbabbbd2d9538ed81eae068faf08a Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 20 Jan 2022 13:53:51 -0600 Subject: [PATCH 122/620] Added special case support for R8_SNORM, R16_SNORM, and R16_FLOAT Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.cpp | 103 +++++++++++++++++- 1 file changed, 100 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 099f9c3df9..aaf232d4f0 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -15,6 +15,84 @@ namespace AZ { namespace Internal { + // The original implementation was from cryhalf's CryConvertFloatToHalf and CryConvertHalfToFloat function + // Will be replaced with centralized half float API + struct SHalf + { + explicit SHalf(float floatValue) + { + AZ::u32 Result; + + AZ::u32 intValue = ((AZ::u32*)(&floatValue))[0]; + AZ::u32 Sign = (intValue & 0x80000000U) >> 16U; + intValue = intValue & 0x7FFFFFFFU; + + if (intValue > 0x47FFEFFFU) + { + // The number is too large to be represented as a half. Saturate to infinity. + Result = 0x7FFFU; + } + else + { + if (intValue < 0x38800000U) + { + // The number is too small to be represented as a normalized half. + // Convert it to a denormalized value. + AZ::u32 Shift = 113U - (intValue >> 23U); + intValue = (0x800000U | (intValue & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized half. + intValue += 0xC8000000U; + } + + Result = ((intValue + 0x0FFFU + ((intValue >> 13U) & 1U)) >> 13U) & 0x7FFFU; + } + h = static_cast(Result | Sign); + } + + operator float() const + { + AZ::u32 Mantissa; + AZ::u32 Exponent; + AZ::u32 Result; + + Mantissa = h & 0x03FF; + + if ((h & 0x7C00) != 0) // The value is normalized + { + Exponent = ((h >> 10) & 0x1F); + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x0400) == 0); + + Mantissa &= 0x03FF; + } + else // The value is zero + { + Exponent = static_cast(-112); + } + + Result = ((h & 0x8000) << 16) | // Sign + ((Exponent + 112) << 23) | // Exponent + (Mantissa << 13); // Mantissa + + return *(float*)&Result; + } + + private: + AZ::u16 h; + }; + template float RetrieveFloatValue(const AZ::u8* mem, size_t index) { @@ -51,23 +129,42 @@ namespace AZ return 0; } + float ScaleValue(float value, float origMin, float origMax, float scaledMin, float scaledMax) + { + return ((value - origMin) / (origMax - origMin)) * (scaledMax - scaledMin) + scaledMin; + } + float RetrieveFloatValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) { switch (format) { case AZ::RHI::Format::R8_UNORM: - case AZ::RHI::Format::R8_SNORM: case AZ::RHI::Format::A8_UNORM: { return mem[index] / static_cast(std::numeric_limits::max()); } - case AZ::RHI::Format::R16_FLOAT: + case AZ::RHI::Format::R8_SNORM: + { + // Scale the value from AZ::s8 min/max to -1 to 1 + auto actualMem = reinterpret_cast(mem); + return ScaleValue(actualMem[index], std::numeric_limits::min(), std::numeric_limits::max(), -1, 1); + } case AZ::RHI::Format::D16_UNORM: case AZ::RHI::Format::R16_UNORM: - case AZ::RHI::Format::R16_SNORM: { return mem[index] / static_cast(std::numeric_limits::max()); } + case AZ::RHI::Format::R16_SNORM: + { + // Scale the value from AZ::s16 min/max to -1 to 1 + auto actualMem = reinterpret_cast(mem); + return ScaleValue(actualMem[index], std::numeric_limits::min(), std::numeric_limits::max(), -1, 1); + } + case AZ::RHI::Format::R16_FLOAT: + { + auto actualMem = reinterpret_cast(mem); + return SHalf(actualMem[index]); + } case AZ::RHI::Format::D32_FLOAT: case AZ::RHI::Format::R32_FLOAT: { From 6fde1389bf6536d1196517c5df3686d4f5ef7078 Mon Sep 17 00:00:00 2001 From: Neil Widmaier Date: Thu, 20 Jan 2022 13:35:08 -0800 Subject: [PATCH 123/620] adding editor level load automation script Signed-off-by: Neil Widmaier --- .../Atom/tests/hydra_Atom_LevelLoadTest.py | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_Atom_LevelLoadTest.py diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_Atom_LevelLoadTest.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_Atom_LevelLoadTest.py new file mode 100644 index 0000000000..77886e2123 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_Atom_LevelLoadTest.py @@ -0,0 +1,85 @@ +""" +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 +""" + + +def Atom_LevelLoadTest(): + """ + Summary: + Loads all graphics levels within the AutomatedTesting project in editor. For each level this script will verify that + the level loads, and can enter/exit gameplay without crashing the editor. + + Test setup: + - Store all available levels in a list. + - Set up a for loop to run all checks for each level. + + Expected Behavior: + Test verifies that each level loads, enters/exits game mode, and reports success for all test actions. + + Test Steps for each level: + 1) Create tuple with level load success and failure messages + 2) Open the level using the python test tools command + 3) Verify level is loaded using a separate command, and report success/failure + 4) Create tuple with success and failure messages for entering gameplay + 5) Enter gameplay and report result + 6) Create tuple with success and failure messages for exiting gameplay + 7) Exit Gameplay and report result + + :return: None + """ + + import azlmbr.legacy.general as general + + from editor_python_test_tools.utils import Report, Tracer, TestHelper + + level_list = ["hermanubis", "hermanubis_high", "macbeth_shaderballs", "PbrMaterialChart", "ShadowTest", "Sponza"] + + with Tracer() as error_tracer: + # + + for level in level_list: + + # 1. Create tuple with level load success and failure messages + level_check_tupple = (f"loaded {level}", f"failed to load {level}") + + # 2. Open the level using the python test tools command + TestHelper.init_idle() + TestHelper.open_level("graphics", level) + + # 3. Verify level is loaded using a separate command, and report success/failure + load_success = general.get_current_level_name() + Report.info(load_success) + if load_success == level: + level_match = True + else: + level_match = False + Report.info(level_match) + Report.result(level_check_tupple, level_match) + + # 4. Create tuple with success and failure messages for entering gameplay + Enter_game_mode_tupple = (f"{level} entered gameplay successfully ", f"{level} failed to enter gameplay") + + # 5. Enter gameplay and report result + TestHelper.enter_game_mode(Enter_game_mode_tupple) + + # 6. Create tuple with success and failure messages for exiting gameplay + Exit_game_mode_tupple = (f"{level} exited gameplay successfully ", f"{level} failed to exit gameplay") + + # 7. Exit Gameplay and report result + TestHelper.exit_game_mode(Exit_game_mode_tupple) + + + # 11. Look for errors or asserts. + TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0) + for error_info in error_tracer.errors: + Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}") + for assert_info in error_tracer.asserts: + Report.info(f"Assert: {assert_info.filename} {assert_info.function} | {assert_info.message}") + + +if __name__ == "__main__": + from editor_python_test_tools.utils import Report + Report.start_test(Atom_LevelLoadTest) From 4a7e00f12534e2f4cbc2a5fc119d9166c4a06c3c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 20 Jan 2022 14:02:57 -0800 Subject: [PATCH 124/620] Removes call to DisableOverride which was removed with the OverrideShim Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index d1d3c1745d..ec0a5fb267 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -51,7 +51,6 @@ namespace AZ::Dom ValueAllocator() : Base("DomValueAllocator", "Allocator for AZ::Dom::Value") { - DisableOverriding(); } }; From 3977edb21ec25cba410e86bc03535a8b9df768af Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Wed, 19 Jan 2022 15:48:57 -0600 Subject: [PATCH 125/620] Atom Tools: Removing unnecessary modules, components, and dead code from SMC Looking toward creating a bare bones template for a standalone application, simplifying and removing any boilerplate wherever possible. SMC followed patterns established by material editor, subdividing everything into multiple modules, which required manually adding static modules, implementing system components with little to no functionality, and a bunch of unnecessary files for such a simple application. This change deletes unnecessary boilerplate code, moving everything into a single module, making the application class responsible for reflecting classes and buses. Signed-off-by: Guthrie Adams --- .../Application/AtomToolsApplication.cpp | 1 + .../Code/CMakeLists.txt | 45 +--- .../ShaderManagementConsoleDocumentModule.h | 28 --- .../ShaderManagementConsoleWindowModule.h | 28 --- .../ShaderManagementConsoleDocument.h | 2 +- .../ShaderManagementConsoleDocumentModule.cpp | 30 --- ...haderManagementConsoleDocumentRequestBus.h | 0 ...nagementConsoleDocumentSystemComponent.cpp | 86 ------- ...ManagementConsoleDocumentSystemComponent.h | 41 ---- .../ShaderManagementConsole_Traits_Linux.h | 2 - .../Mac/ShaderManagementConsole_Traits_Mac.h | 2 - .../ShaderManagementConsole_Traits_Windows.h | 2 - .../ShaderManagementConsoleApplication.cpp | 219 ++++++++++++++++-- .../ShaderManagementConsoleApplication.h | 29 ++- .../ShaderManagementConsoleRequestBus.h | 0 .../ShaderManagementConsoleBrowserWidget.cpp | 201 ---------------- .../Window/ShaderManagementConsoleWindow.cpp | 17 +- .../Window/ShaderManagementConsoleWindow.h | 4 +- ...ShaderManagementConsoleWindowComponent.cpp | 206 ---------------- .../ShaderManagementConsoleWindowComponent.h | 76 ------ .../ShaderManagementConsoleWindowModule.cpp | 38 --- .../ShaderManagementConsoleToolBar.cpp | 32 --- .../ToolBar/ShaderManagementConsoleToolBar.h | 31 --- .../Code/shadermanagementconsole_files.cmake | 11 + ...hadermanagementconsoledocument_files.cmake | 17 -- .../shadermanagementconsolewindow_files.cmake | 22 -- 26 files changed, 259 insertions(+), 911 deletions(-) delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Document/ShaderManagementConsoleDocumentModule.h delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Window/ShaderManagementConsoleWindowModule.h delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentModule.cpp rename Gems/Atom/Tools/ShaderManagementConsole/Code/{Include/Atom => Source}/Document/ShaderManagementConsoleDocumentRequestBus.h (100%) delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentSystemComponent.cpp delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentSystemComponent.h rename Gems/Atom/Tools/ShaderManagementConsole/Code/{Include/Atom/Core => Source}/ShaderManagementConsoleRequestBus.h (100%) delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleBrowserWidget.cpp delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowComponent.cpp delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowComponent.h delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowModule.cpp delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ToolBar/ShaderManagementConsoleToolBar.cpp delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ToolBar/ShaderManagementConsoleToolBar.h delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsoledocument_files.cmake delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsolewindow_files.cmake diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp index 7b6be61050..150b06cabd 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp @@ -157,6 +157,7 @@ namespace AtomToolsFramework components.insert( components.end(), { + azrtti_typeid(), azrtti_typeid(), azrtti_typeid(), azrtti_typeid(), diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt b/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt index c5ceab5360..3c5de1cc1b 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt @@ -19,48 +19,10 @@ if(NOT PAL_TRAIT_ATOM_SHADER_MANAGEMENT_CONSOLE_APPLICATION_SUPPORTED) endif() ly_add_target( - NAME ShaderManagementConsole.Document STATIC - NAMESPACE Gem - FILES_CMAKE - shadermanagementconsoledocument_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - . - Source - PUBLIC - Include - BUILD_DEPENDENCIES - PUBLIC - Gem::AtomToolsFramework.Static - Gem::AtomToolsFramework.Editor - Gem::Atom_RPI.Edit - Gem::Atom_RPI.Public - Gem::Atom_RHI.Reflect -) - -ly_add_target( - NAME ShaderManagementConsole.Window STATIC + NAME ShaderManagementConsole EXECUTABLE NAMESPACE Gem AUTOMOC AUTORCC - FILES_CMAKE - shadermanagementconsolewindow_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - . - Source - PUBLIC - Include - BUILD_DEPENDENCIES - PUBLIC - Gem::AtomToolsFramework.Static - Gem::AtomToolsFramework.Editor - Gem::Atom_RPI.Public -) - -ly_add_target( - NAME ShaderManagementConsole EXECUTABLE - NAMESPACE Gem FILES_CMAKE shadermanagementconsole_files.cmake ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake @@ -77,8 +39,9 @@ ly_add_target( PRIVATE Gem::AtomToolsFramework.Static Gem::AtomToolsFramework.Editor - Gem::ShaderManagementConsole.Window - Gem::ShaderManagementConsole.Document + Gem::Atom_RPI.Edit + Gem::Atom_RPI.Public + Gem::Atom_RHI.Reflect RUNTIME_DEPENDENCIES Gem::AtomToolsFramework.Editor Gem::EditorPythonBindings.Editor diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Document/ShaderManagementConsoleDocumentModule.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Document/ShaderManagementConsoleDocumentModule.h deleted file mode 100644 index dd5cc01506..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Document/ShaderManagementConsoleDocumentModule.h +++ /dev/null @@ -1,28 +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 - * - */ - -#pragma once - -#include - -namespace ShaderManagementConsole -{ - //! Entry point for Shader Management Console Document library. - class ShaderManagementConsoleDocumentModule - : public AZ::Module - { - public: - AZ_RTTI(ShaderManagementConsoleDocumentModule, "{81D7A170-9284-4DE9-8D92-B6B94E8A2BDF}", AZ::Module); - AZ_CLASS_ALLOCATOR(ShaderManagementConsoleDocumentModule, AZ::SystemAllocator, 0); - - ShaderManagementConsoleDocumentModule(); - - //! Add required SystemComponents to the SystemEntity. - AZ::ComponentTypeList GetRequiredSystemComponents() const override; - }; -} diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Window/ShaderManagementConsoleWindowModule.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Window/ShaderManagementConsoleWindowModule.h deleted file mode 100644 index ff365ee98c..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Window/ShaderManagementConsoleWindowModule.h +++ /dev/null @@ -1,28 +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 - * - */ - -#pragma once - -#include - -namespace ShaderManagementConsole -{ - //! Entry point for Shader Management Console Window library. - class ShaderManagementConsoleWindowModule - : public AZ::Module - { - public: - AZ_RTTI(ShaderManagementConsoleWindowModule, "{57D6239C-AE03-4ED8-9125-35C5B1625503}", AZ::Module); - AZ_CLASS_ALLOCATOR(ShaderManagementConsoleWindowModule, AZ::SystemAllocator, 0); - - ShaderManagementConsoleWindowModule(); - - //! Add required SystemComponents to the SystemEntity. - AZ::ComponentTypeList GetRequiredSystemComponents() const override; - }; -} diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h index eb7d6b87a0..bd51616f7a 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h @@ -7,12 +7,12 @@ */ #pragma once -#include #include #include #include #include #include +#include namespace ShaderManagementConsole { diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentModule.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentModule.cpp deleted file mode 100644 index a9415fd85b..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentModule.cpp +++ /dev/null @@ -1,30 +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 - * - */ - -#include -#include -#include - -namespace ShaderManagementConsole -{ - ShaderManagementConsoleDocumentModule::ShaderManagementConsoleDocumentModule() - { - // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here. - m_descriptors.insert(m_descriptors.end(), { - ShaderManagementConsoleDocumentSystemComponent::CreateDescriptor(), - }); - } - - AZ::ComponentTypeList ShaderManagementConsoleDocumentModule::GetRequiredSystemComponents() const - { - return AZ::ComponentTypeList{ - azrtti_typeid(), - azrtti_typeid(), - }; - } -} diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Document/ShaderManagementConsoleDocumentRequestBus.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentRequestBus.h similarity index 100% rename from Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Document/ShaderManagementConsoleDocumentRequestBus.h rename to Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentRequestBus.h diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentSystemComponent.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentSystemComponent.cpp deleted file mode 100644 index 55b800067a..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentSystemComponent.cpp +++ /dev/null @@ -1,86 +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 - * - */ - -#include -#include -#include -#include -#include -#include -#include - -namespace ShaderManagementConsole -{ - void ShaderManagementConsoleDocumentSystemComponent::Reflect(AZ::ReflectContext* context) - { - if (AZ::SerializeContext* serialize = azrtti_cast(context)) - { - serialize->Class() - ->Version(0); - - if (AZ::EditContext* ec = serialize->GetEditContext()) - { - ec->Class("ShaderManagementConsoleDocumentSystemComponent", "Manages documents") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("System")) - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ; - } - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) - { - behaviorContext->EBus("ShaderManagementConsoleDocumentRequestBus") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common) - ->Attribute(AZ::Script::Attributes::Category, "Editor") - ->Attribute(AZ::Script::Attributes::Module, "shadermanagementconsole") - ->Event("GetShaderOptionCount", &ShaderManagementConsoleDocumentRequestBus::Events::GetShaderOptionCount) - ->Event("GetShaderOptionDescriptor", &ShaderManagementConsoleDocumentRequestBus::Events::GetShaderOptionDescriptor) - ->Event("GetShaderVariantCount", &ShaderManagementConsoleDocumentRequestBus::Events::GetShaderVariantCount) - ->Event("GetShaderVariantInfo", &ShaderManagementConsoleDocumentRequestBus::Events::GetShaderVariantInfo) - ; - } - } - - void ShaderManagementConsoleDocumentSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) - { - required.push_back(AZ_CRC_CE("AtomToolsDocumentSystemService")); - required.push_back(AZ_CRC_CE("AssetProcessorToolsConnection")); - required.push_back(AZ_CRC_CE("AssetDatabaseService")); - required.push_back(AZ_CRC_CE("PropertyManagerService")); - required.push_back(AZ_CRC_CE("RPISystem")); - } - - void ShaderManagementConsoleDocumentSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) - { - provided.push_back(AZ_CRC_CE("ShaderManagementConsoleDocumentSystemService")); - } - - void ShaderManagementConsoleDocumentSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) - { - incompatible.push_back(AZ_CRC_CE("ShaderManagementConsoleDocumentSystemService")); - } - - void ShaderManagementConsoleDocumentSystemComponent::Init() - { - } - - void ShaderManagementConsoleDocumentSystemComponent::Activate() - { - AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast( - &AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Handler::RegisterDocumentType, - []() - { - return aznew ShaderManagementConsoleDocument(); - }); - } - - void ShaderManagementConsoleDocumentSystemComponent::Deactivate() - { - } -} diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentSystemComponent.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentSystemComponent.h deleted file mode 100644 index 1ee825f6de..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentSystemComponent.h +++ /dev/null @@ -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 - * - */ - -#pragma once - -#include - -namespace ShaderManagementConsole -{ - //! ShaderManagementConsoleDocumentSystemComponent - class ShaderManagementConsoleDocumentSystemComponent - : public AZ::Component - { - public: - AZ_COMPONENT(ShaderManagementConsoleDocumentSystemComponent, "{1610159D-59DC-48B1-B2D1-FCE7AFD3B012}"); - - ShaderManagementConsoleDocumentSystemComponent() = default; - ~ShaderManagementConsoleDocumentSystemComponent() = default; - ShaderManagementConsoleDocumentSystemComponent(const ShaderManagementConsoleDocumentSystemComponent&) = delete; - ShaderManagementConsoleDocumentSystemComponent& operator =(const ShaderManagementConsoleDocumentSystemComponent&) = delete; - - static void Reflect(AZ::ReflectContext* context); - - static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); - static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); - static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); - - private: - //////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation - void Init() override; - void Activate() override; - void Deactivate() override; - //////////////////////////////////////////////////////////////////////// - }; -} diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Linux/ShaderManagementConsole_Traits_Linux.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Linux/ShaderManagementConsole_Traits_Linux.h index 2897402f04..c4cb36c3c3 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Linux/ShaderManagementConsole_Traits_Linux.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Linux/ShaderManagementConsole_Traits_Linux.h @@ -7,5 +7,3 @@ */ #pragma once -#define AZ_TRAIT_SHADER_MANAGEMENT_CONSOLE_EXT "" - diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Mac/ShaderManagementConsole_Traits_Mac.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Mac/ShaderManagementConsole_Traits_Mac.h index 627cce90c9..c4cb36c3c3 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Mac/ShaderManagementConsole_Traits_Mac.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Mac/ShaderManagementConsole_Traits_Mac.h @@ -7,5 +7,3 @@ */ #pragma once -#define AZ_TRAIT_SHADER_MANAGEMENT_CONSOLE_EXT ".app" - diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/ShaderManagementConsole_Traits_Windows.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/ShaderManagementConsole_Traits_Windows.h index 4bd905f929..c4cb36c3c3 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/ShaderManagementConsole_Traits_Windows.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/ShaderManagementConsole_Traits_Windows.h @@ -7,5 +7,3 @@ */ #pragma once -#define AZ_TRAIT_SHADER_MANAGEMENT_CONSOLE_EXT ".exe" - diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.cpp index a242716b52..ba8038319b 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.cpp +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.cpp @@ -6,21 +6,90 @@ * */ -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include #include +#include #include +AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT +#include +#include +#include +AZ_POP_DISABLE_WARNING + +void InitShaderManagementConsoleResources() +{ + // Must register qt resources from other modules + Q_INIT_RESOURCE(ShaderManagementConsole); + Q_INIT_RESOURCE(InspectorWidget); + Q_INIT_RESOURCE(AtomToolsAssetBrowser); +} + namespace ShaderManagementConsole { - //! This function returns the build system target name of "ShaderManagementConsole" - AZStd::string ShaderManagementConsoleApplication::GetBuildTargetName() const + ShaderManagementConsoleApplication::ShaderManagementConsoleApplication(int* argc, char*** argv) + : Base(argc, argv) { -#if !defined(LY_CMAKE_TARGET) -#error "LY_CMAKE_TARGET must be defined in order to add this source file to a CMake executable target" -#endif - return AZStd::string_view{ LY_CMAKE_TARGET }; + InitShaderManagementConsoleResources(); + + QApplication::setApplicationName("O3DE Shader Management Console"); + + // The settings registry has been created at this point, so add the CMake target + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddBuildSystemTargetSpecialization( + *AZ::SettingsRegistry::Get(), GetBuildTargetName()); + + ShaderManagementConsoleRequestBus::Handler::BusConnect(); + AzToolsFramework::EditorWindowRequestBus::Handler::BusConnect(); + AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusConnect(); + } + + ShaderManagementConsoleApplication::~ShaderManagementConsoleApplication() + { + ShaderManagementConsoleRequestBus::Handler::BusDisconnect(); + AzToolsFramework::EditorWindowRequestBus::Handler::BusDisconnect(); + AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusDisconnect(); + m_window.reset(); + } + + void ShaderManagementConsoleApplication::Reflect(AZ::ReflectContext* context) + { + Base::Reflect(context); + + if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) + { + behaviorContext->EBus("ShaderManagementConsoleRequestBus") + ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation) + ->Attribute(AZ::Script::Attributes::Category, "Editor") + ->Attribute(AZ::Script::Attributes::Module, "shadermanagementconsole") + ->Event("GetSourceAssetInfo", &ShaderManagementConsoleRequestBus::Events::GetSourceAssetInfo) + ->Event("FindMaterialAssetsUsingShader", &ShaderManagementConsoleRequestBus::Events::FindMaterialAssetsUsingShader ) + ->Event("GetMaterialInstanceShaderItems", &ShaderManagementConsoleRequestBus::Events::GetMaterialInstanceShaderItems) + ; + + behaviorContext->EBus("ShaderManagementConsoleDocumentRequestBus") + ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common) + ->Attribute(AZ::Script::Attributes::Category, "Editor") + ->Attribute(AZ::Script::Attributes::Module, "shadermanagementconsole") + ->Event("GetShaderOptionCount", &ShaderManagementConsoleDocumentRequestBus::Events::GetShaderOptionCount) + ->Event("GetShaderOptionDescriptor", &ShaderManagementConsoleDocumentRequestBus::Events::GetShaderOptionDescriptor) + ->Event("GetShaderVariantCount", &ShaderManagementConsoleDocumentRequestBus::Events::GetShaderVariantCount) + ->Event("GetShaderVariantInfo", &ShaderManagementConsoleDocumentRequestBus::Events::GetShaderVariantInfo) + ; + } } const char* ShaderManagementConsoleApplication::GetCurrentConfigurationName() const @@ -34,25 +103,139 @@ namespace ShaderManagementConsole #endif } - ShaderManagementConsoleApplication::ShaderManagementConsoleApplication(int* argc, char*** argv) - : Base(argc, argv) + void ShaderManagementConsoleApplication::StartCommon(AZ::Entity* systemEntity) { - QApplication::setApplicationName("O3DE Shader Management Console"); + Base::StartCommon(systemEntity); - // The settings registry has been created at this point, so add the CMake target - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddBuildSystemTargetSpecialization( - *AZ::SettingsRegistry::Get(), GetBuildTargetName()); + AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Handler::RegisterDocumentType, + []() { return aznew ShaderManagementConsoleDocument(); }); } - void ShaderManagementConsoleApplication::CreateStaticModules(AZStd::vector& outModules) + AZStd::string ShaderManagementConsoleApplication::GetBuildTargetName() const { - Base::CreateStaticModules(outModules); - outModules.push_back(aznew ShaderManagementConsoleDocumentModule); - outModules.push_back(aznew ShaderManagementConsoleWindowModule); +#if !defined(LY_CMAKE_TARGET) +#error "LY_CMAKE_TARGET must be defined in order to add this source file to a CMake executable target" +#endif + //! Returns the build system target name of "ShaderManagementConsole" + return AZStd::string_view{ LY_CMAKE_TARGET }; } AZStd::vector ShaderManagementConsoleApplication::GetCriticalAssetFilters() const { return AZStd::vector({ "passes/", "config/" }); } + + QWidget* ShaderManagementConsoleApplication::GetAppMainWindow() + { + return m_window.get(); + } + + void ShaderManagementConsoleApplication::CreateMainWindow() + { + m_assetBrowserInteractions.reset(aznew ShaderManagementConsoleBrowserInteractions); + m_window.reset(aznew ShaderManagementConsoleWindow); + m_window->show(); + } + + void ShaderManagementConsoleApplication::DestroyMainWindow() + { + m_window.reset(); + } + + AZ::Data::AssetInfo ShaderManagementConsoleApplication::GetSourceAssetInfo(const AZStd::string& sourceAssetFileName) + { + bool result = false; + AZ::Data::AssetInfo assetInfo; + AZStd::string watchFolder; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult( + result, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourcePath, sourceAssetFileName.c_str(), assetInfo, + watchFolder); + AZ_Error(nullptr, result, "Failed to get the asset info for the file: %s.", sourceAssetFileName.c_str()); + + return assetInfo; + } + + AZStd::vector ShaderManagementConsoleApplication::FindMaterialAssetsUsingShader(const AZStd::string& shaderFilePath) + { + // Collect the material types referencing the shader + AZStd::vector materialTypeSources; + + AzToolsFramework::AssetDatabase::AssetDatabaseConnection assetDatabaseConnection; + assetDatabaseConnection.OpenDatabase(); + + assetDatabaseConnection.QuerySourceDependencyByDependsOnSource( + shaderFilePath.c_str(), nullptr, AzToolsFramework::AssetDatabase::SourceFileDependencyEntry::DEP_Any, + [&](AzToolsFramework::AssetDatabase::SourceFileDependencyEntry& sourceFileDependencyEntry) + { + AZStd::string assetExtension; + if (AzFramework::StringFunc::Path::GetExtension(sourceFileDependencyEntry.m_source.c_str(), assetExtension, false)) + { + if (assetExtension == "materialtype") + { + materialTypeSources.push_back(sourceFileDependencyEntry.m_source); + } + } + return true; + }); + + AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer productDependencies; + for (const auto& materialTypeSource : materialTypeSources) + { + bool result = false; + AZ::Data::AssetInfo materialTypeSourceAssetInfo; + AZStd::string watchFolder; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult( + result, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourcePath, materialTypeSource.c_str(), + materialTypeSourceAssetInfo, watchFolder); + + assetDatabaseConnection.QueryDirectReverseProductDependenciesBySourceGuidSubId( + materialTypeSourceAssetInfo.m_assetId.m_guid, materialTypeSourceAssetInfo.m_assetId.m_subId, + [&](AzToolsFramework::AssetDatabase::ProductDatabaseEntry& entry) + { + AZStd::string assetExtension; + if (AzFramework::StringFunc::Path::GetExtension(entry.m_productName.c_str(), assetExtension, false)) + { + if (assetExtension == "azmaterial") + { + productDependencies.push_back(entry); + } + } + return true; + }); + } + + AZStd::vector results; + results.reserve(productDependencies.size()); + for (auto product : productDependencies) + { + assetDatabaseConnection.QueryCombinedByProductID( + product.m_productID, + [&](AzToolsFramework::AssetDatabase::CombinedDatabaseEntry& combined) + { + results.push_back({ combined.m_sourceGuid, combined.m_subID }); + return false; + }, + nullptr); + } + return results; + } + + AZStd::vector ShaderManagementConsoleApplication::GetMaterialInstanceShaderItems( + const AZ::Data::AssetId& assetId) + { + auto materialAsset = AZ::RPI::AssetUtils::LoadAssetById(assetId, AZ::RPI::AssetUtils::TraceLevel::Error); + + auto materialInstance = AZ::RPI::Material::Create(materialAsset); + AZ_Error( + nullptr, materialAsset, "Failed to get a material instance from product asset id: %s", + assetId.ToString().c_str()); + + if (materialInstance != nullptr) + { + return AZStd::vector( + materialInstance->GetShaderCollection().begin(), materialInstance->GetShaderCollection().end()); + } + return AZStd::vector(); + } } // namespace ShaderManagementConsole diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.h index 6b0365e6bd..3bb62d0756 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.h @@ -8,12 +8,21 @@ #pragma once +#include #include +#include +#include +#include +#include +#include namespace ShaderManagementConsole { class ShaderManagementConsoleApplication : public AtomToolsFramework::AtomToolsDocumentApplication + , private ShaderManagementConsoleRequestBus::Handler + , private AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler + , private AzToolsFramework::EditorWindowRequestBus::Handler { public: AZ_TYPE_INFO(ShaderManagementConsole::ShaderManagementConsoleApplication, "{A31B1AEB-4DA3-49CD-884A-CC998FF7546F}"); @@ -21,13 +30,31 @@ namespace ShaderManagementConsole using Base = AtomToolsFramework::AtomToolsDocumentApplication; ShaderManagementConsoleApplication(int* argc, char*** argv); + ~ShaderManagementConsoleApplication(); // AzFramework::Application overrides... - void CreateStaticModules(AZStd::vector& outModules) override; + void Reflect(AZ::ReflectContext* context) override; const char* GetCurrentConfigurationName() const override; + void StartCommon(AZ::Entity* systemEntity) override; // AtomToolsFramework::AtomToolsApplication overrides... AZStd::string GetBuildTargetName() const override; AZStd::vector GetCriticalAssetFilters() const override; + + // AzToolsFramework::EditorWindowRequests::Bus::Handler + QWidget* GetAppMainWindow() override; + + // AtomToolsMainWindowFactoryRequestBus::Handler overrides... + void CreateMainWindow() override; + void DestroyMainWindow() override; + + // ShaderManagementConsoleRequestBus::Handler overrides... + AZ::Data::AssetInfo GetSourceAssetInfo(const AZStd::string& sourceAssetFileName) override; + AZStd::vector FindMaterialAssetsUsingShader(const AZStd::string& shaderFilePath) override; + AZStd::vector GetMaterialInstanceShaderItems(const AZ::Data::AssetId& assetId) override; + + private: + AZStd::unique_ptr m_window; + AZStd::unique_ptr m_assetBrowserInteractions; }; } // namespace ShaderManagementConsole diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Core/ShaderManagementConsoleRequestBus.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleRequestBus.h similarity index 100% rename from Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Core/ShaderManagementConsoleRequestBus.h rename to Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleRequestBus.h diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleBrowserWidget.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleBrowserWidget.cpp deleted file mode 100644 index eb863a195a..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleBrowserWidget.cpp +++ /dev/null @@ -1,201 +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 - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT -#include -#include -#include -AZ_POP_DISABLE_WARNING - -namespace ShaderManagementConsole -{ - ShaderManagementConsoleBrowserWidget::ShaderManagementConsoleBrowserWidget(QWidget* parent) - : QWidget(parent) - , m_ui(new Ui::ShaderManagementConsoleBrowserWidget) - { - using namespace AzToolsFramework::AssetBrowser; - - m_ui->setupUi(this); - - m_ui->m_searchWidget->Setup(true, true); - m_ui->m_searchWidget->SetFilterState("", AZ::RPI::ShaderAsset::Group, true); - m_ui->m_searchWidget->setMinimumSize(QSize(150, 0)); - - // Get the asset browser model - AssetBrowserModel* assetBrowserModel = nullptr; - AssetBrowserComponentRequestBus::BroadcastResult(assetBrowserModel, &AssetBrowserComponentRequests::GetAssetBrowserModel); - AZ_Assert(assetBrowserModel, "Failed to get file browser model"); - - // Hook up the data set to the tree view - m_filterModel = aznew AssetBrowserFilterModel(this); - m_filterModel->setSourceModel(assetBrowserModel); - m_filterModel->SetFilter(CreateFilter()); - - m_ui->m_assetBrowserTreeViewWidget->setModel(m_filterModel); - m_ui->m_assetBrowserTreeViewWidget->SetShowSourceControlIcons(true); - m_ui->m_assetBrowserTreeViewWidget->setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection); - - // Maintains the tree expansion state between runs - m_ui->m_assetBrowserTreeViewWidget->SetName("AssetBrowserTreeView_main"); - - connect(m_ui->m_searchWidget->GetFilter().data(), &AssetBrowserEntryFilter::updatedSignal, m_filterModel, &AssetBrowserFilterModel::filterUpdatedSlot); - connect(m_filterModel, &AssetBrowserFilterModel::filterChanged, this, [this]() - { - const bool hasFilter = !m_ui->m_searchWidget->GetFilterString().isEmpty(); - constexpr bool selectFirstFilteredIndex = true; - m_ui->m_assetBrowserTreeViewWidget->UpdateAfterFilter(hasFilter, selectFirstFilteredIndex); - }); - connect(m_ui->m_assetBrowserTreeViewWidget, &AssetBrowserTreeView::activated, this, &ShaderManagementConsoleBrowserWidget::OpenSelectedEntries); - connect(m_ui->m_assetBrowserTreeViewWidget, &AssetBrowserTreeView::selectionChangedSignal, [this]() { - const auto& selectedAssets = m_ui->m_assetBrowserTreeViewWidget->GetSelectedAssets(); - if (!selectedAssets.empty()) - { - m_ui->m_previewerFrame->Display(selectedAssets.front()); - } - else - { - m_ui->m_previewerFrame->Clear(); - } - }); - - AssetBrowserModelNotificationBus::Handler::BusConnect(); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler::BusConnect(); - } - - ShaderManagementConsoleBrowserWidget::~ShaderManagementConsoleBrowserWidget() - { - // Maintains the tree expansion state between runs - m_ui->m_assetBrowserTreeViewWidget->SaveState(); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler::BusDisconnect(); - AssetBrowserModelNotificationBus::Handler::BusDisconnect(); - } - - AzToolsFramework::AssetBrowser::FilterConstType ShaderManagementConsoleBrowserWidget::CreateFilter() const - { - using namespace AzToolsFramework::AssetBrowser; - - QSharedPointer sourceFilter(new EntryTypeFilter); - sourceFilter->SetEntryType(AssetBrowserEntry::AssetEntryType::Source); - - QSharedPointer folderFilter(new EntryTypeFilter); - folderFilter->SetEntryType(AssetBrowserEntry::AssetEntryType::Folder); - - QSharedPointer sourceOrFolderFilter(new CompositeFilter(CompositeFilter::LogicOperatorType::OR)); - sourceOrFolderFilter->AddFilter(sourceFilter); - sourceOrFolderFilter->AddFilter(folderFilter); - - QSharedPointer finalFilter(new CompositeFilter(CompositeFilter::LogicOperatorType::AND)); - finalFilter->AddFilter(sourceOrFolderFilter); - finalFilter->AddFilter(m_ui->m_searchWidget->GetFilter()); - - return finalFilter; - } - - void ShaderManagementConsoleBrowserWidget::OpenSelectedEntries() - { - const AZStd::vector entries = m_ui->m_assetBrowserTreeViewWidget->GetSelectedAssets(); - - const int multiSelectPromptThreshold = 10; - if (entries.size() >= multiSelectPromptThreshold) - { - if (QMessageBox::question( - QApplication::activeWindow(), - QString("Attemptng to open %1 files").arg(entries.size()), - "Would you like to open anyway?", - QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) - { - return; - } - } - - for (const AssetBrowserEntry* entry : entries) - { - const SourceAssetBrowserEntry* sourceEntry = azrtti_cast(entry); - if (!sourceEntry) - { - const ProductAssetBrowserEntry* productEntry = azrtti_cast(entry); - if (productEntry) - { - sourceEntry = azrtti_cast(productEntry->GetParent()); - } - } - - if (sourceEntry) - { - if (AzFramework::StringFunc::Path::IsExtension(sourceEntry->GetFullPath().c_str(), AZ::RPI::ShaderVariantListSourceData::Extension)) - { - AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Events::OpenDocument, sourceEntry->GetFullPath()); - } - else - { - QDesktopServices::openUrl(QUrl::fromLocalFile(sourceEntry->GetFullPath().c_str())); - } - } - } - } - - void ShaderManagementConsoleBrowserWidget::EntryAdded(const AssetBrowserEntry* entry) - { - if (m_pathToSelect.empty()) - { - return; - } - - const SourceAssetBrowserEntry* sourceEntry = azrtti_cast(entry); - if (!sourceEntry) - { - const ProductAssetBrowserEntry* productEntry = azrtti_cast(entry); - if (productEntry) - { - sourceEntry = azrtti_cast(productEntry->GetParent()); - } - } - - if (sourceEntry) - { - AZStd::string sourcePath = sourceEntry->GetFullPath(); - AzFramework::StringFunc::Path::Normalize(sourcePath); - if (m_pathToSelect == sourcePath) - { - m_ui->m_assetBrowserTreeViewWidget->SelectFileAtPath(m_pathToSelect); - m_pathToSelect.clear(); - } - } - } - - void ShaderManagementConsoleBrowserWidget::OnDocumentOpened(const AZ::Uuid& documentId) - { - AZStd::string absolutePath; - AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult(absolutePath, documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetAbsolutePath); - if (!absolutePath.empty()) - { - m_pathToSelect = absolutePath; - AzFramework::StringFunc::Path::Normalize(m_pathToSelect); - m_ui->m_assetBrowserTreeViewWidget->SelectFileAtPath(m_pathToSelect); - } - } - -} // namespace ShaderManagementConsole - -#include diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp index 8e8e047e83..f4672d670e 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp @@ -6,15 +6,17 @@ * */ -#include #include #include #include #include +#include #include +#include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT #include +#include #include #include #include @@ -39,10 +41,6 @@ namespace ShaderManagementConsole setObjectName("ShaderManagementConsoleWindow"); - m_toolBar = new ShaderManagementConsoleToolBar(this); - m_toolBar->setObjectName("ToolBar"); - addToolBar(m_toolBar); - m_assetBrowser->SetFilterState("", AZ::RPI::ShaderAsset::Group, true); m_assetBrowser->SetOpenHandler([](const AZStd::string& absolutePath) { if (AzFramework::StringFunc::Path::IsExtension(absolutePath.c_str(), AZ::RPI::ShaderVariantListSourceData::Extension)) @@ -63,10 +61,19 @@ namespace ShaderManagementConsole m_actionNew->setEnabled(false); m_actionSaveAsChild->setVisible(false); m_actionSaveAsChild->setEnabled(false); + m_actionSaveAll->setVisible(false); + m_actionSaveAll->setEnabled(false); OnDocumentOpened(AZ::Uuid::CreateNull()); } + bool ShaderManagementConsoleWindow::GetOpenDocumentParams(AZStd::string& openPath) + { + openPath = QFileDialog::getOpenFileName( + this, tr("Open Document"), AZ::Utils::GetProjectPath().c_str(), tr("Files (*.%1)").arg(AZ::RPI::ShaderVariantListSourceData::Extension)).toUtf8().constData(); + return !openPath.empty(); + } + QWidget* ShaderManagementConsoleWindow::CreateDocumentTabView(const AZ::Uuid& documentId) { AZStd::unordered_set optionNames; diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.h index 1c7479e526..d5dd04c434 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.h @@ -14,7 +14,6 @@ #include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT -#include #include AZ_POP_DISABLE_WARNING #endif @@ -36,8 +35,7 @@ namespace ShaderManagementConsole ~ShaderManagementConsoleWindow() = default; protected: + bool GetOpenDocumentParams(AZStd::string& openPath) override; QWidget* CreateDocumentTabView(const AZ::Uuid& documentId) override; - - ShaderManagementConsoleToolBar* m_toolBar = {}; }; } // namespace ShaderManagementConsole diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowComponent.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowComponent.cpp deleted file mode 100644 index a59712d572..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowComponent.cpp +++ /dev/null @@ -1,206 +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 - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT -#include -#include -#include -AZ_POP_DISABLE_WARNING - -namespace ShaderManagementConsole -{ - void ShaderManagementConsoleWindowComponent::Reflect(AZ::ReflectContext* context) - { - if (AZ::SerializeContext* serialize = azrtti_cast(context)) - { - serialize->Class() - ->Version(0); - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) - { - behaviorContext->EBus("ShaderManagementConsoleRequestBus") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation) - ->Attribute(AZ::Script::Attributes::Category, "Editor") - ->Attribute(AZ::Script::Attributes::Module, "shadermanagementconsole") - ->Event("GetSourceAssetInfo", &ShaderManagementConsoleRequestBus::Events::GetSourceAssetInfo) - ->Event("FindMaterialAssetsUsingShader", &ShaderManagementConsoleRequestBus::Events::FindMaterialAssetsUsingShader ) - ->Event("GetMaterialInstanceShaderItems", &ShaderManagementConsoleRequestBus::Events::GetMaterialInstanceShaderItems) - ; - } - } - - void ShaderManagementConsoleWindowComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) - { - required.push_back(AZ_CRC_CE("AssetBrowserService")); - required.push_back(AZ_CRC_CE("PropertyManagerService")); - required.push_back(AZ_CRC_CE("SourceControlService")); - required.push_back(AZ_CRC_CE("AtomToolsMainWindowSystemService")); - } - - void ShaderManagementConsoleWindowComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) - { - provided.push_back(AZ_CRC_CE("ShaderManagementConsoleWindowService")); - } - - void ShaderManagementConsoleWindowComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) - { - incompatible.push_back(AZ_CRC_CE("ShaderManagementConsoleWindowService")); - } - - void ShaderManagementConsoleWindowComponent::Init() - { - } - - void ShaderManagementConsoleWindowComponent::Activate() - { - AzToolsFramework::EditorWindowRequestBus::Handler::BusConnect(); - AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusConnect(); - ShaderManagementConsoleRequestBus::Handler::BusConnect(); - AzToolsFramework::SourceControlConnectionRequestBus::Broadcast(&AzToolsFramework::SourceControlConnectionRequests::EnableSourceControl, true); - } - - void ShaderManagementConsoleWindowComponent::Deactivate() - { - ShaderManagementConsoleRequestBus::Handler::BusDisconnect(); - AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusDisconnect(); - AzToolsFramework::EditorWindowRequestBus::Handler::BusDisconnect(); - - m_window.reset(); - } - - QWidget* ShaderManagementConsoleWindowComponent::GetAppMainWindow() - { - return m_window.get(); - } - - void ShaderManagementConsoleWindowComponent::CreateMainWindow() - { - m_assetBrowserInteractions.reset(aznew ShaderManagementConsoleBrowserInteractions); - - m_window.reset(aznew ShaderManagementConsoleWindow); - m_window->show(); - } - - void ShaderManagementConsoleWindowComponent::DestroyMainWindow() - { - m_window.reset(); - } - - AZ::Data::AssetInfo ShaderManagementConsoleWindowComponent::GetSourceAssetInfo(const AZStd::string& sourceAssetFileName) - { - bool result = false; - AZ::Data::AssetInfo assetInfo; - AZStd::string watchFolder; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult( - result, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourcePath, sourceAssetFileName.c_str(), assetInfo, - watchFolder); - AZ_Error(nullptr, result, "Failed to get the asset info for the file: %s.", sourceAssetFileName.c_str()); - - return assetInfo; - } - - AZStd::vector ShaderManagementConsoleWindowComponent::FindMaterialAssetsUsingShader(const AZStd::string& shaderFilePath) - { - // Collect the material types referencing the shader - AZStd::vector materialTypeSources; - - AzToolsFramework::AssetDatabase::AssetDatabaseConnection assetDatabaseConnection; - assetDatabaseConnection.OpenDatabase(); - - assetDatabaseConnection.QuerySourceDependencyByDependsOnSource( - shaderFilePath.c_str(), - nullptr, - AzToolsFramework::AssetDatabase::SourceFileDependencyEntry::DEP_Any, - [&](AzToolsFramework::AssetDatabase::SourceFileDependencyEntry& sourceFileDependencyEntry) { - AZStd::string assetExtension; - if (AzFramework::StringFunc::Path::GetExtension(sourceFileDependencyEntry.m_source.c_str(), assetExtension, false)) - { - if (assetExtension == "materialtype") - { - materialTypeSources.push_back(sourceFileDependencyEntry.m_source); - } - } - return true; - }); - - AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer productDependencies; - for (const auto& materialTypeSource : materialTypeSources) - { - bool result = false; - AZ::Data::AssetInfo materialTypeSourceAssetInfo; - AZStd::string watchFolder; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult( - result, - &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourcePath, - materialTypeSource.c_str(), - materialTypeSourceAssetInfo, - watchFolder - ); - - assetDatabaseConnection.QueryDirectReverseProductDependenciesBySourceGuidSubId( - materialTypeSourceAssetInfo.m_assetId.m_guid, - materialTypeSourceAssetInfo.m_assetId.m_subId, - [&](AzToolsFramework::AssetDatabase::ProductDatabaseEntry& entry) { - AZStd::string assetExtension; - if (AzFramework::StringFunc::Path::GetExtension(entry.m_productName.c_str(), assetExtension, false)) - { - if (assetExtension == "azmaterial") - { - productDependencies.push_back(entry); - } - } - return true; - }); - } - - AZStd::vector results; - results.reserve(productDependencies.size()); - for (auto product : productDependencies) - { - assetDatabaseConnection.QueryCombinedByProductID( - product.m_productID, - [&](AzToolsFramework::AssetDatabase::CombinedDatabaseEntry& combined) { - results.push_back({combined.m_sourceGuid, combined.m_subID}); - return false; - }, - nullptr - ); - } - return results; - } - - AZStd::vector ShaderManagementConsoleWindowComponent::GetMaterialInstanceShaderItems(const AZ::Data::AssetId& assetId) - { - auto materialAsset = AZ::RPI::AssetUtils::LoadAssetById(assetId, AZ::RPI::AssetUtils::TraceLevel::Error); - - auto materialInstance = AZ::RPI::Material::Create(materialAsset); - AZ_Error(nullptr, materialAsset, "Failed to get a material instance from product asset id: %s", assetId.ToString().c_str()); - - if (materialInstance != nullptr) - { - return AZStd::vector(materialInstance->GetShaderCollection().begin(), materialInstance->GetShaderCollection().end()); - } - return AZStd::vector(); - } -} diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowComponent.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowComponent.h deleted file mode 100644 index aab0f7ce37..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowComponent.h +++ /dev/null @@ -1,76 +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 - * - */ - -#pragma once - -#include -#include -#include - -#include -#include - -#include -#include - -namespace ShaderManagementConsole -{ - //! ShaderManagementConsoleWindowComponent is the entry point for the Shader Management Console gem user interface, and is mainly - //! used for initialization and registration of other classes, including ShaderManagementConsoleWindow. - class ShaderManagementConsoleWindowComponent - : public AZ::Component - , private AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler - , private ShaderManagementConsoleRequestBus::Handler - , private AzToolsFramework::EditorWindowRequestBus::Handler - { - public: - AZ_COMPONENT(ShaderManagementConsoleWindowComponent, "{03976F19-3C74-49FE-A15F-7D3CADBA616C}"); - - static void Reflect(AZ::ReflectContext* context); - - static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); - static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); - static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); - - private: - // Temporary structure when generating shader variants. - struct ShaderVariantListInfo - { - AZStd::string m_materialFileName; - AZStd::vector m_shaderItems; - }; - - ////////////////////////////////////////////////////////////////////////// - // AzToolsFramework::EditorWindowRequests::Bus::Handler - QWidget* GetAppMainWindow() override; - ////////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////// - // AtomToolsMainWindowFactoryRequestBus::Handler overrides... - void CreateMainWindow() override; - void DestroyMainWindow() override; - //////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////// - // ShaderManagementConsoleRequestBus::Handler overrides... - AZ::Data::AssetInfo GetSourceAssetInfo(const AZStd::string& sourceAssetFileName) override; - AZStd::vector FindMaterialAssetsUsingShader(const AZStd::string& shaderFilePath) override; - AZStd::vector GetMaterialInstanceShaderItems(const AZ::Data::AssetId& assetId) override; - //////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation - void Init() override; - void Activate() override; - void Deactivate() override; - //////////////////////////////////////////////////////////////////////// - - AZStd::unique_ptr m_window; - AZStd::unique_ptr m_assetBrowserInteractions; - }; -} diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowModule.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowModule.cpp deleted file mode 100644 index a13b873aee..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowModule.cpp +++ /dev/null @@ -1,38 +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 - * - */ - -#include -#include - -void InitShaderManagementConsoleResources() -{ - // Must register qt resources from other modules - Q_INIT_RESOURCE(ShaderManagementConsole); - Q_INIT_RESOURCE(InspectorWidget); - Q_INIT_RESOURCE(AtomToolsAssetBrowser); -} - -namespace ShaderManagementConsole -{ - ShaderManagementConsoleWindowModule::ShaderManagementConsoleWindowModule() - { - InitShaderManagementConsoleResources(); - - // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here. - m_descriptors.insert(m_descriptors.end(), { - ShaderManagementConsoleWindowComponent::CreateDescriptor(), - }); - } - - AZ::ComponentTypeList ShaderManagementConsoleWindowModule::GetRequiredSystemComponents() const - { - return AZ::ComponentTypeList{ - azrtti_typeid(), - }; - } -} // namespace ShaderManagementConsole diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ToolBar/ShaderManagementConsoleToolBar.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ToolBar/ShaderManagementConsoleToolBar.cpp deleted file mode 100644 index 5699713240..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ToolBar/ShaderManagementConsoleToolBar.cpp +++ /dev/null @@ -1,32 +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 - * - */ - -#include -#include - -AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT -#include -#include -#include -#include -AZ_POP_DISABLE_WARNING - -namespace ShaderManagementConsole -{ - ShaderManagementConsoleToolBar::ShaderManagementConsoleToolBar(QWidget* parent) - : QToolBar(parent) - { - AzQtComponents::ToolBar::addMainToolBarStyle(this); - } - - ShaderManagementConsoleToolBar::~ShaderManagementConsoleToolBar() - { - } -} // namespace ShaderManagementConsole - -#include diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ToolBar/ShaderManagementConsoleToolBar.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ToolBar/ShaderManagementConsoleToolBar.h deleted file mode 100644 index c4d300d4e0..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ToolBar/ShaderManagementConsoleToolBar.h +++ /dev/null @@ -1,31 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace ShaderManagementConsole -{ - class ModelComboBox; - class LightingPresetComboBox; - - class ShaderManagementConsoleToolBar - : public QToolBar - { - Q_OBJECT - public: - - ShaderManagementConsoleToolBar(QWidget* parent = 0); - ~ShaderManagementConsoleToolBar(); - - private: - }; -} // namespace ShaderManagementConsole diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsole_files.cmake b/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsole_files.cmake index e832ba2784..dac14b7f16 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsole_files.cmake +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsole_files.cmake @@ -7,8 +7,19 @@ # set(FILES + Source/Document/ShaderManagementConsoleDocumentRequestBus.h + Source/Document/ShaderManagementConsoleDocument.cpp + Source/Document/ShaderManagementConsoleDocument.h + + Source/Window/ShaderManagementConsoleBrowserInteractions.h + Source/Window/ShaderManagementConsoleBrowserInteractions.cpp + Source/Window/ShaderManagementConsoleWindow.h + Source/Window/ShaderManagementConsoleWindow.cpp + Source/Window/ShaderManagementConsole.qrc + Source/main.cpp Source/ShaderManagementConsoleApplication.cpp Source/ShaderManagementConsoleApplication.h + Source/ShaderManagementConsoleRequestBus.h ../Scripts/GenerateShaderVariantListForMaterials.py ) diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsoledocument_files.cmake b/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsoledocument_files.cmake deleted file mode 100644 index 220d2895ac..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsoledocument_files.cmake +++ /dev/null @@ -1,17 +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 -# -# - -set(FILES - Include/Atom/Document/ShaderManagementConsoleDocumentModule.h - Include/Atom/Document/ShaderManagementConsoleDocumentRequestBus.h - Source/Document/ShaderManagementConsoleDocument.cpp - Source/Document/ShaderManagementConsoleDocument.h - Source/Document/ShaderManagementConsoleDocumentModule.cpp - Source/Document/ShaderManagementConsoleDocumentSystemComponent.cpp - Source/Document/ShaderManagementConsoleDocumentSystemComponent.h -) diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsolewindow_files.cmake b/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsolewindow_files.cmake deleted file mode 100644 index fb5cc0dad6..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsolewindow_files.cmake +++ /dev/null @@ -1,22 +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 -# -# - -set(FILES - Include/Atom/Window/ShaderManagementConsoleWindowModule.h - Include/Atom/Core/ShaderManagementConsoleRequestBus.h - Source/Window/ShaderManagementConsoleBrowserInteractions.h - Source/Window/ShaderManagementConsoleBrowserInteractions.cpp - Source/Window/ShaderManagementConsoleWindow.h - Source/Window/ShaderManagementConsoleWindow.cpp - Source/Window/ShaderManagementConsoleWindowModule.cpp - Source/Window/ShaderManagementConsole.qrc - Source/Window/ShaderManagementConsoleWindowComponent.h - Source/Window/ShaderManagementConsoleWindowComponent.cpp - Source/Window/ToolBar/ShaderManagementConsoleToolBar.h - Source/Window/ToolBar/ShaderManagementConsoleToolBar.cpp -) From c090ad6a5697f1ee58b08f744825d4d2d2fbb796 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 20 Jan 2022 16:10:42 -0600 Subject: [PATCH 126/620] Account for the pixel size when computing the image data index Signed-off-by: Chris Galvan --- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index aaf232d4f0..e2268dbdd8 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -376,13 +376,14 @@ namespace AZ { const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); auto width = imageDescriptor.m_size.m_width; + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); size_t outValuesIndex = 0; for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - size_t imageDataIndex = (y * width) + x; + size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); auto& outValue = const_cast(outValues[outValuesIndex++]); outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); @@ -402,13 +403,14 @@ namespace AZ { const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); auto width = imageDescriptor.m_size.m_width; + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); size_t outValuesIndex = 0; for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - size_t imageDataIndex = (y * width) + x; + size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); auto& outValue = const_cast(outValues[outValuesIndex++]); outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); @@ -428,13 +430,14 @@ namespace AZ { const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); auto width = imageDescriptor.m_size.m_width; + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); size_t outValuesIndex = 0; for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - size_t imageDataIndex = (y * width) + x; + size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); auto& outValue = const_cast(outValues[outValuesIndex++]); outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); From dac77605d923159ddde84d56ed331a14e10b532c Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Thu, 20 Jan 2022 16:29:11 -0600 Subject: [PATCH 127/620] Atom Tools: removing unused traits for ME executable extension Signed-off-by: Guthrie Adams --- .../Code/Source/Platform/Linux/MaterialEditor_Traits_Linux.h | 3 --- .../Code/Source/Platform/Mac/MaterialEditor_Traits_Mac.h | 3 --- .../Source/Platform/Windows/MaterialEditor_Traits_Windows.h | 3 --- 3 files changed, 9 deletions(-) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Traits_Linux.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Traits_Linux.h index 368b681b4c..03320d1dd8 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Traits_Linux.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Linux/MaterialEditor_Traits_Linux.h @@ -6,6 +6,3 @@ * */ #pragma once - -#define AZ_TRAIT_MATERIALEDITOR_EXT "" - diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Mac/MaterialEditor_Traits_Mac.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Mac/MaterialEditor_Traits_Mac.h index 2f46a3a12f..03320d1dd8 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Mac/MaterialEditor_Traits_Mac.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Mac/MaterialEditor_Traits_Mac.h @@ -6,6 +6,3 @@ * */ #pragma once - -#define AZ_TRAIT_MATERIALEDITOR_EXT ".app" - diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/MaterialEditor_Traits_Windows.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/MaterialEditor_Traits_Windows.h index 2f016a2488..03320d1dd8 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/MaterialEditor_Traits_Windows.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/MaterialEditor_Traits_Windows.h @@ -6,6 +6,3 @@ * */ #pragma once - -#define AZ_TRAIT_MATERIALEDITOR_EXT ".exe" - From 6be0543fc16b9c5c019aac9bb256cd8ea7772f67 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 14:02:26 -0800 Subject: [PATCH 128/620] Adds script to brute-force detect unused files Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 102 +++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 scripts/cleanup/unusued_compilation.py diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py new file mode 100644 index 0000000000..25fa4ca3ce --- /dev/null +++ b/scripts/cleanup/unusued_compilation.py @@ -0,0 +1,102 @@ +# +# 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 +# +# + +import argparse +import os +import shutil +import sys +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../build')) +import ci_build + +EXTENSIONS_OF_INTEREST = ('.c', '.cc', '.cpp', '.cxx', '.h', '.hpp', '.hxx', '.inl') +EXCLUSIONS = ('AZ_DECLARE_MODULE_CLASS') + +def create_filelist(path): + filelist = set() + for input_file in path: + if os.path.isdir(input_file): + for dp, dn, filenames in os.walk(input_file): + if 'build\\windows_vs2019' in dp: + continue + for f in filenames: + extension = os.path.splitext(f)[1] + extension_lower = extension.lower() + if extension_lower in EXTENSIONS_OF_INTEREST: + filelist.add(os.path.join(dp, f)) + else: + extension = os.path.splitext(input_file)[1] + extension_lower = extension.lower() + if extension_lower in EXTENSIONS_OF_INTEREST: + filelist.add(os.path.join(os.getcwd(), input_file)) + else: + print(f'Error, file {input_file} does not have an extension of interest') + sys.exit(1) + return filelist + +def is_excluded(file): + normalized_file = os.path.normpath(file) + if '\\Platform\\' in normalized_file and not '\\Windows\\' in normalized_file: + return True + return False + +def filter_from_processed(filelist, filter_file_path): + if not os.path.exists(filter_file_path): + return # nothing to filter + + with open(filter_file_path, 'r') as filter_file: + try: + processed_files = [s.strip() for s in filter_file.readlines()] + except UnicodeDecodeError as err: + print('Error reading file {}, err: {}'.format(filter_file_path, err)) + sys.exit(1) + filelist -= set(processed_files) + filelist = [f for f in filelist if not is_excluded(f)] + +def cleanup_unused_compilation(path): + # 1. Create a list of all h/cpp files (consider multiple extensions) + filelist = create_filelist(path) + # 2. Remove files from "processed" list. This is needed because the process is a bruteforce approach and + # can take a while. If something is found in the middle, we want to be able to continue instead of + # starting over. Removing the "unusued_compilation_processed.txt" will start over. + filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') + filter_from_processed(filelist, filter_file_path) + # 3. For each file + total_files = len(filelist) + current_files = 1 + for file in filelist: + print(f"[{current_files}/{total_files}] Trying {file}") + # b. create backup + shutil.copy(file, file + '.bak') + # c. set the file contents as empty + with open(file, 'w') as source_file: + source_file.write('') + # d. build + ret = ci_build.build('build_config.json', 'Windows', 'profile_vs2019') + # e.1 if build succeeds, leave the file empty (leave backup) + # e.2 if build fails, restore backup + if ret != 0: + shutil.copy(file + '.bak', file) + print(f"\t[FAILED] restoring") + else: + print(f"\t[SUCCEED]") + # f. delete backup + os.remove(file + '.bak') + # add file to processed-list + with open(filter_file_path, 'a') as filter_file: + filter_file.write(file) + filter_file.write('\n') + current_files += 1 + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='This script finds C++ files that do not affect compilation (and therefore can be potentially removed)', + formatter_class=argparse.RawTextHelpFormatter) + parser.add_argument('file_or_dir', type=str, nargs='+', default=os.getcwd(), + help='list of files or directories to search within for files to consider') + args = parser.parse_args() + ret = cleanup_unused_compilation(args.file_or_dir) + sys.exit(ret) From 7c77f211846762d1312f4f100e3324ca7d021692 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 15:45:57 -0800 Subject: [PATCH 129/620] =?UTF-8?q?=EF=BB=BFremoves=20BaseLibrary/Item/Man?= =?UTF-8?q?ager=20unused=20code=20from=20Code/Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/ErrorRecorder.h | 2 +- Code/Editor/IEditor.h | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Code/Editor/ErrorRecorder.h b/Code/Editor/ErrorRecorder.h index beacc3f0e5..9a0bad7d91 100644 --- a/Code/Editor/ErrorRecorder.h +++ b/Code/Editor/ErrorRecorder.h @@ -14,7 +14,7 @@ #define CRYINCLUDE_EDITOR_CORE_ERRORRECORDER_H #pragma once -#include "Include/EditorCoreAPI.h" +#include ////////////////////////////////////////////////////////////////////////// //! Automatic class to record and display error. diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index 90f1b63f55..df7d8d8dd3 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -326,12 +326,7 @@ enum MouseCallbackFlags //! Types of database items enum EDataBaseItemType { - EDB_TYPE_MATERIAL, - EDB_TYPE_PARTICLE, - EDB_TYPE_MUSIC, - EDB_TYPE_EAXPRESET, - EDB_TYPE_SOUNDMOOD, - EDB_TYPE_FLARE + EDB_TYPE_UNUSED }; enum EEditorPathName From 412cf851a01d6aa50ea694c6bbb6806cbe3ac109 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:02:28 -0800 Subject: [PATCH 130/620] =?UTF-8?q?=EF=BB=BFRemoves=20DataBaseItem/Library?= =?UTF-8?q?/Manager=20from=20Code/Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/IEditor.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index df7d8d8dd3..fa20481192 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -323,12 +323,6 @@ enum MouseCallbackFlags MK_CALLBACK_FLAGS = 0x100 }; -//! Types of database items -enum EDataBaseItemType -{ - EDB_TYPE_UNUSED -}; - enum EEditorPathName { EDITOR_PATH_OBJECTS, From b3bd293390f59e282ea1a1f4ab6771982a032866 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:41:46 -0800 Subject: [PATCH 131/620] =?UTF-8?q?=EF=BB=BFRemoves=20ConfigGroup=20from?= =?UTF-8?q?=20Code/Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/ConfigGroup.cpp | 195 ----------------------------- Code/Editor/ConfigGroup.h | 113 ----------------- Code/Editor/editor_lib_files.cmake | 2 - 3 files changed, 310 deletions(-) delete mode 100644 Code/Editor/ConfigGroup.cpp delete mode 100644 Code/Editor/ConfigGroup.h diff --git a/Code/Editor/ConfigGroup.cpp b/Code/Editor/ConfigGroup.cpp deleted file mode 100644 index 42236e43dd..0000000000 --- a/Code/Editor/ConfigGroup.cpp +++ /dev/null @@ -1,195 +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 - * - */ - - -#include "EditorDefs.h" - -#include "ConfigGroup.h" - -namespace Config -{ - CConfigGroup::CConfigGroup() - { - } - - CConfigGroup::~CConfigGroup() - { - for (IConfigVar* var : m_vars) - { - delete var; - } - } - - void CConfigGroup::AddVar(IConfigVar* var) - { - m_vars.push_back(var); - } - - AZ::u32 CConfigGroup::GetVarCount() - { - return aznumeric_cast(m_vars.size()); - } - - IConfigVar* CConfigGroup::GetVar(const char* szName) - { - for (IConfigVar* var : m_vars) - { - if (0 == _stricmp(szName, var->GetName().c_str())) - { - return var; - } - } - - return nullptr; - } - - const IConfigVar* CConfigGroup::GetVar(const char* szName) const - { - for (const IConfigVar* var : m_vars) - { - if (0 == _stricmp(szName, var->GetName().c_str())) - { - return var; - } - - } - - return nullptr; - } - - IConfigVar* CConfigGroup::GetVar(AZ::u32 index) - { - if (index < m_vars.size()) - { - return m_vars[index]; - } - - return nullptr; - } - - const IConfigVar* CConfigGroup::GetVar(AZ::u32 index) const - { - if (index < m_vars.size()) - { - return m_vars[index]; - } - - return nullptr; - } - - void CConfigGroup::SaveToXML(XmlNodeRef node) - { - // save only values that don't have default values - for (const IConfigVar* var : m_vars) - { - if (var->IsFlagSet(IConfigVar::eFlag_DoNotSave) || var->IsDefault()) - { - continue; - } - - const char* szName = var->GetName().c_str(); - - switch (var->GetType()) - { - case IConfigVar::eType_BOOL: - { - bool currentValue = false; - var->Get(¤tValue); - node->setAttr(szName, currentValue); - break; - } - - case IConfigVar::eType_INT: - { - int currentValue = 0; - var->Get(¤tValue); - node->setAttr(szName, currentValue); - break; - } - - case IConfigVar::eType_FLOAT: - { - float currentValue = 0; - var->Get(¤tValue); - node->setAttr(szName, currentValue); - break; - } - - case IConfigVar::eType_STRING: - { - AZStd::string currentValue; - var->Get(¤tValue); - node->setAttr(szName, currentValue.c_str()); - break; - } - } - } - } - - void CConfigGroup::LoadFromXML(XmlNodeRef node) - { - // load values that are save-able - for (IConfigVar* var : m_vars) - { - if (var->IsFlagSet(IConfigVar::eFlag_DoNotSave)) - { - continue; - } - const char* szName = var->GetName().c_str(); - - switch (var->GetType()) - { - case IConfigVar::eType_BOOL: - { - bool currentValue = false; - var->GetDefault(¤tValue); - if (node->getAttr(szName, currentValue)) - { - var->Set(¤tValue); - } - break; - } - - case IConfigVar::eType_INT: - { - int currentValue = 0; - var->GetDefault(¤tValue); - if (node->getAttr(szName, currentValue)) - { - var->Set(¤tValue); - } - break; - } - - case IConfigVar::eType_FLOAT: - { - float currentValue = 0; - var->GetDefault(¤tValue); - if (node->getAttr(szName, currentValue)) - { - var->Set(¤tValue); - } - break; - } - - case IConfigVar::eType_STRING: - { - AZStd::string currentValue; - var->GetDefault(¤tValue); - QString readValue(currentValue.c_str()); - if (node->getAttr(szName, readValue)) - { - currentValue = readValue.toUtf8().data(); - var->Set(¤tValue); - } - break; - } - } - } - } -} diff --git a/Code/Editor/ConfigGroup.h b/Code/Editor/ConfigGroup.h deleted file mode 100644 index 004725e32c..0000000000 --- a/Code/Editor/ConfigGroup.h +++ /dev/null @@ -1,113 +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 - * - */ - - -#pragma once -#include -#include -#include - -struct ICVar; -class XmlNodeRef; - -namespace Config -{ - // Abstract configurable variable - struct IConfigVar - { - public: - enum EType - { - eType_BOOL, - eType_INT, - eType_FLOAT, - eType_STRING, - }; - - enum EFlags - { - eFlag_NoUI = 1 << 0, - eFlag_NoCVar = 1 << 1, - eFlag_DoNotSave = 1 << 2, - }; - - IConfigVar(const char* szName, const char* szDescription, EType varType, AZ::u8 flags) - : m_name(szName) - , m_description(szDescription) - , m_type(varType) - , m_flags(flags) - , m_ptr(nullptr) - {}; - - virtual ~IConfigVar() = default; - - AZ_FORCE_INLINE EType GetType() const - { - return m_type; - } - - AZ_FORCE_INLINE const AZStd::string& GetName() const - { - return m_name; - } - - AZ_FORCE_INLINE const AZStd::string& GetDescription() const - { - return m_description; - } - - AZ_FORCE_INLINE bool IsFlagSet(EFlags flag) const - { - return 0 != (m_flags & flag); - } - - virtual void Get(void* outPtr) const = 0; - virtual void Set(const void* ptr) = 0; - virtual bool IsDefault() const = 0; - virtual void GetDefault(void* outPtr) const = 0; - virtual void Reset() = 0; - - static constexpr EType TranslateType(const bool&) { return eType_BOOL; } - static constexpr EType TranslateType(const int&) { return eType_INT; } - static constexpr EType TranslateType(const float&) { return eType_FLOAT; } - static constexpr EType TranslateType(const AZStd::string&) { return eType_STRING; } - - protected: - EType m_type; - AZ::u8 m_flags; - AZStd::string m_name; - AZStd::string m_description; - void* m_ptr; - ICVar* m_pCVar; - }; - - // Group of configuration variables with optional mapping to CVars - class CConfigGroup - { - private: - using TConfigVariables = AZStd::vector ; - TConfigVariables m_vars; - - using TConsoleVariables = AZStd::vector; - TConsoleVariables m_consoleVars; - - public: - CConfigGroup(); - virtual ~CConfigGroup(); - - void AddVar(IConfigVar* var); - AZ::u32 GetVarCount(); - IConfigVar* GetVar(const char* szName); - IConfigVar* GetVar(AZ::u32 index); - const IConfigVar* GetVar(const char* szName) const; - const IConfigVar* GetVar(AZ::u32 index) const; - - void SaveToXML(XmlNodeRef node); - void LoadFromXML(XmlNodeRef node); - }; -}; diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 5d45bbd853..698fa65e9c 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -631,8 +631,6 @@ set(FILES TrackView/TrackViewSequence.h TrackView/TrackViewNodeFactories.h TrackView/TrackViewEventNode.h - ConfigGroup.cpp - ConfigGroup.h Util/AffineParts.h Util/AutoLogTime.cpp Util/AutoLogTime.h From 51ecbbca818eebbdbbdb94c66dee46eb3c2a45c9 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:50:49 -0800 Subject: [PATCH 132/620] =?UTF-8?q?=EF=BB=BFRemoves=20ResizeResolutionDial?= =?UTF-8?q?og=20from=20Code/Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/ResizeResolutionDialog.cpp | 119 ------------------------- Code/Editor/ResizeResolutionDialog.h | 46 ---------- Code/Editor/ResizeResolutionDialog.ui | 58 ------------ Code/Editor/editor_lib_files.cmake | 3 - 4 files changed, 226 deletions(-) delete mode 100644 Code/Editor/ResizeResolutionDialog.cpp delete mode 100644 Code/Editor/ResizeResolutionDialog.h delete mode 100644 Code/Editor/ResizeResolutionDialog.ui diff --git a/Code/Editor/ResizeResolutionDialog.cpp b/Code/Editor/ResizeResolutionDialog.cpp deleted file mode 100644 index f2a03fb1b2..0000000000 --- a/Code/Editor/ResizeResolutionDialog.cpp +++ /dev/null @@ -1,119 +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 - * - */ - - -#include "EditorDefs.h" - -#include "ResizeResolutionDialog.h" - -AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING -#include -AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - -class ResizeResolutionModel - : public QAbstractListModel -{ -public: - ResizeResolutionModel(QObject* parent = nullptr); - - int rowCount(const QModelIndex& parent = {}) const override; - int columnCount(const QModelIndex& parent = {}) const override; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - - int SizeRow(uint32 dwSize) const; - -private: - static const int kNumSizes = 6; -}; - -ResizeResolutionModel::ResizeResolutionModel(QObject* parent) - : QAbstractListModel(parent) -{ -} - -int ResizeResolutionModel::rowCount(const QModelIndex& parent) const -{ - return parent.isValid() ? 0 : kNumSizes; -} - -int ResizeResolutionModel::columnCount(const QModelIndex& parent) const -{ - return parent.isValid() ? 0 : 1; -} - -QVariant ResizeResolutionModel::data(const QModelIndex& index, int role) const -{ - if (!index.isValid() || index.column() > 0 || index.row() >= kNumSizes) - { - return {}; - } - - const int size = 64 * (1 << index.row()); - - switch (role) - { - case Qt::DisplayRole: - return QStringLiteral("%1x%2").arg(size).arg(size); - - case Qt::UserRole: - return size; - } - - return {}; -} - -int ResizeResolutionModel::SizeRow(uint32 dwSize) const -{ - // not a power of 2? - if (dwSize & (dwSize - 1)) - { - return 0; - } - - int row = 0; - - for (auto i = dwSize / 64; i > 1; i >>= 1) - { - ++row; - } - - return row; -} - -///////////////////////////////////////////////////////////////////////////// -// CResizeResolutionDialog dialog - - -CResizeResolutionDialog::CResizeResolutionDialog(QWidget* pParent /*=nullptr*/) - : QDialog(pParent) - , m_model(new ResizeResolutionModel(this)) - , ui(new Ui::CResizeResolutionDialog) -{ - ui->setupUi(this); - - ui->m_resolution->setModel(m_model); - - connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); - connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); -} - -CResizeResolutionDialog::~CResizeResolutionDialog() -{ -} - -///////////////////////////////////////////////////////////////////////////// -void CResizeResolutionDialog::SetSize(uint32 dwSize) -{ - ui->m_resolution->setCurrentIndex(m_model->SizeRow(dwSize)); -} - -///////////////////////////////////////////////////////////////////////////// -uint32 CResizeResolutionDialog::GetSize() -{ - return ui->m_resolution->itemData(ui->m_resolution->currentIndex()).toInt(); -} diff --git a/Code/Editor/ResizeResolutionDialog.h b/Code/Editor/ResizeResolutionDialog.h deleted file mode 100644 index 123075688f..0000000000 --- a/Code/Editor/ResizeResolutionDialog.h +++ /dev/null @@ -1,46 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_RESIZERESOLUTIONDIALOG_H -#define CRYINCLUDE_EDITOR_RESIZERESOLUTIONDIALOG_H - -#pragma once -// ResizeResolutionDialog.h : header file -// - -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace Ui { - class CResizeResolutionDialog; -} - -class ResizeResolutionModel; - -///////////////////////////////////////////////////////////////////////////// -// CResizeResolutionDialog dialog - -class CResizeResolutionDialog - : public QDialog -{ - // Construction -public: - CResizeResolutionDialog(QWidget* pParent = nullptr); // standard constructor - ~CResizeResolutionDialog(); - - void SetSize(uint32 dwSize); - uint32 GetSize(); - -private: - ResizeResolutionModel* m_model; - QScopedPointer ui; -}; - -#endif // CRYINCLUDE_EDITOR_RESIZERESOLUTIONDIALOG_H diff --git a/Code/Editor/ResizeResolutionDialog.ui b/Code/Editor/ResizeResolutionDialog.ui deleted file mode 100644 index c958e6acaf..0000000000 --- a/Code/Editor/ResizeResolutionDialog.ui +++ /dev/null @@ -1,58 +0,0 @@ - - - CResizeResolutionDialog - - - - 0 - 0 - 250 - 96 - - - - - - - - - - 0 - 0 - - - - Select resolution: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 698fa65e9c..36a45905bd 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -392,9 +392,6 @@ set(FILES QuickAccessBar.cpp QuickAccessBar.h QuickAccessBar.ui - ResizeResolutionDialog.cpp - ResizeResolutionDialog.h - ResizeResolutionDialog.ui SelectLightAnimationDialog.cpp SelectLightAnimationDialog.h SelectSequenceDialog.cpp From b49a7a9975d000e51bc2ac2895752e3d4b1bef74 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Thu, 20 Jan 2022 16:58:48 -0600 Subject: [PATCH 133/620] =?UTF-8?q?Atom=20Tools:=20updating=20gem=20autolo?= =?UTF-8?q?ad=20settings=20registry=20for=20ME=20and=20SMC=20to=20disable?= =?UTF-8?q?=20script=20canvas=20developer=20gem=20Script=20canvas=20and=20?= =?UTF-8?q?related=20gems=20were=20already=20being=20disabled=20for=20some?= =?UTF-8?q?=20atom=20tools.=20The=20script=20canvas=20developer=20gem=20wa?= =?UTF-8?q?s=20not=20added=20initially=20because=20it=E2=80=99s=20not=20us?= =?UTF-8?q?ed=20in=20automated=20testing=20or=20other=20common=20projects.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guthrie Adams --- Registry/gem_autoload.materialeditor.setreg | 3 +++ Registry/gem_autoload.shadermanagementconsole.setreg | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Registry/gem_autoload.materialeditor.setreg b/Registry/gem_autoload.materialeditor.setreg index fd00ff05c7..653cc80056 100644 --- a/Registry/gem_autoload.materialeditor.setreg +++ b/Registry/gem_autoload.materialeditor.setreg @@ -28,6 +28,9 @@ "ScriptCanvas.Editor": { "AutoLoad": false }, + "ScriptCanvasDeveloper": { + "AutoLoad": false + }, "ScriptCanvasPhysics": { "AutoLoad": false }, diff --git a/Registry/gem_autoload.shadermanagementconsole.setreg b/Registry/gem_autoload.shadermanagementconsole.setreg index fd00ff05c7..653cc80056 100644 --- a/Registry/gem_autoload.shadermanagementconsole.setreg +++ b/Registry/gem_autoload.shadermanagementconsole.setreg @@ -28,6 +28,9 @@ "ScriptCanvas.Editor": { "AutoLoad": false }, + "ScriptCanvasDeveloper": { + "AutoLoad": false + }, "ScriptCanvasPhysics": { "AutoLoad": false }, From 37a1b8d8202d5a5d2623813f64bb112ceeaa55e0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:59:22 -0800 Subject: [PATCH 134/620] Removes AssetBrowserWindow unused files Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzAssetBrowser/AssetBrowserWindow.cpp | 73 ------------------- .../AzAssetBrowser/AssetBrowserWindow.h | 57 --------------- 2 files changed, 130 deletions(-) delete mode 100644 Code/Editor/AzAssetBrowser/AssetBrowserWindow.cpp delete mode 100644 Code/Editor/AzAssetBrowser/AssetBrowserWindow.h diff --git a/Code/Editor/AzAssetBrowser/AssetBrowserWindow.cpp b/Code/Editor/AzAssetBrowser/AssetBrowserWindow.cpp deleted file mode 100644 index 1a45d1e391..0000000000 --- a/Code/Editor/AzAssetBrowser/AssetBrowserWindow.cpp +++ /dev/null @@ -1,73 +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 - * - */ -#include "AzAssetBrowserWindow.h" -#include "AzAssetBrowser/ui_AssetBrowserWindow.h" - -#include -#include -#include -#include -#include - -const char* ASSET_BROWSER_PREVIEW_NAME = "Asset Browser (PREVIEW)"; - -AzAssetBrowserWindow::AzAssetBrowserWindow(const QString& name, QWidget* parent) - : QDialog(parent) - , m_ui(new Ui::AssetBrowserWindowClass()) - , m_assetDatabaseSortFilterProxyModel(new AssetBrowser::UI::SortFilterProxyModel(parent)) - , m_name(name) - , m_assetBrowser(new AssetBrowser::UI::AssetTreeView(name, this)) - { - EBUS_EVENT_RESULT(m_assetBrowserModel, AssetBrowser::AssetCache::AssetCacheRequestsBus, GetAssetBrowserModel); - AZ_Assert(m_assetBrowserModel, "Failed to get filebrowser model"); - m_assetDatabaseSortFilterProxyModel->setSourceModel(m_assetBrowserModel); - - m_ui->setupUi(this); - - connect(m_ui->searchCriteriaWidget, - &AzToolsFramework::SearchCriteriaWidget::SearchCriteriaChanged, - m_assetDatabaseSortFilterProxyModel.data(), - &AssetBrowser::UI::SortFilterProxyModel::OnSearchCriteriaChanged); - - connect(m_assetBrowser, &QTreeView::customContextMenuRequested, this, &AzAssetBrowserWindow::OnContextMenu); - } - - AzAssetBrowserWindow::~AzAssetBrowserWindow() - { - m_assetBrowser->SaveState(); - } - - ////////////////////////////////////////////////////////////////////////// - const AZ::Uuid& AzAssetBrowserWindow::GetClassID() - { - return AZ::AzTypeInfo::Uuid(); - } - - void AzAssetBrowserWindow::OnContextMenu(const QPoint& point) - { - (void)point; - //get the selected entries - QModelIndexList sourceIndexes; - for (const auto& index : m_assetBrowser->selectedIndexes()) - { - sourceIndexes.push_back(m_assetDatabaseSortFilterProxyModel->mapToSource(index)); - } - AZStd::vector entries; - m_assetBrowserModel->SourceIndexesToAssetDatabaseEntries(sourceIndexes, entries); - - if (entries.empty() || entries.size() > 1) - { - return; - } - auto entry = entries.front(); - - EBUS_EVENT(AssetBrowser::AssetBrowserRequestBus::Bus, OnItemContextMenu, this, entry); - } - -#include - diff --git a/Code/Editor/AzAssetBrowser/AssetBrowserWindow.h b/Code/Editor/AzAssetBrowser/AssetBrowserWindow.h deleted file mode 100644 index a16cc4b494..0000000000 --- a/Code/Editor/AzAssetBrowser/AssetBrowserWindow.h +++ /dev/null @@ -1,57 +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 - * - */ -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include - -#include -#endif - -namespace Ui -{ - class AssetBrowserWindowClass; -} - -namespace AssetBrowser -{ - namespace UI - { - class AssetTreeView; - class SortFilterProxyModel; - class AssetBrowserModel; - } -} - -class AzAssetBrowserWindow - : public QDialog -{ - Q_OBJECT -public: - AZ_CLASS_ALLOCATOR(AzAssetBrowserWindow, AZ::SystemAllocator, 0); - AZ_TYPE_INFO(AzAssetBrowserWindow, "{20238D23-2670-44BC-9110-A51374C18B5A}"); - - explicit AzAssetBrowserWindow(const QString& name = "default", QWidget* parent = nullptr); - virtual ~AzAssetBrowserWindow(); - - static const AZ::Uuid& GetClassID(); - -protected Q_SLOTS: - void OnContextMenu(const QPoint& point); - -private: - QScopedPointer m_ui; - QScopedPointer m_assetDatabaseModel; - QScopedPointer m_assetDatabaseSortFilterProxyModel; - QString m_name; - AssetBrowser::UI::AssetTreeView* m_assetBrowser; - AssetBrowser::UI::AssetBrowserModel* m_assetBrowserModel; -}; - -extern const char* ASSET_BROWSER_PREVIEW_NAME; From b3c2a716adc6c9f325def37b1469d627d899e228 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:19:53 -0800 Subject: [PATCH 135/620] Removes PropertyAnimationCtrl from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../PropertyAnimationCtrl.cpp | 131 ------------------ .../PropertyAnimationCtrl.h | 78 ----------- 2 files changed, 209 deletions(-) delete mode 100644 Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.cpp delete mode 100644 Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.h diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.cpp deleted file mode 100644 index 4fb18e438c..0000000000 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.cpp +++ /dev/null @@ -1,131 +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 - * - */ - -#include "EditorDefs.h" - -#include "PropertyAnimationCtrl.h" - -// Qt -#include -#include -#include - -// Editor -#include "Util/UIEnumerations.h" -#include "IResourceSelectorHost.h" - -AnimationPropertyCtrl::AnimationPropertyCtrl(QWidget *pParent) - : QWidget(pParent) -{ - m_animationLabel = new QLabel; - - m_pApplyButton = new QToolButton; - m_pApplyButton->setIcon(QIcon(":/reflectedPropertyCtrl/img/apply.png")); - - m_pApplyButton->setFocusPolicy(Qt::StrongFocus); - - QHBoxLayout *pLayout = new QHBoxLayout(this); - pLayout->setContentsMargins(0, 0, 0, 0); - pLayout->addWidget(m_animationLabel, 1); - pLayout->addWidget(m_pApplyButton); - - connect(m_pApplyButton, &QAbstractButton::clicked, this, &AnimationPropertyCtrl::OnApplyClicked); -}; - -AnimationPropertyCtrl::~AnimationPropertyCtrl() -{ -} - - -void AnimationPropertyCtrl::SetValue(const CReflectedVarAnimation &animation) -{ - m_animation = animation; - m_animationLabel->setText(animation.m_animation.c_str()); -} - -CReflectedVarAnimation AnimationPropertyCtrl::value() const -{ - return m_animation; -} - -void AnimationPropertyCtrl::OnApplyClicked() -{ - QStringList cSelectedAnimations; - int nTotalAnimations(0); - int nCurrentAnimation(0); - - QString combinedString = GetIEditor()->GetResourceSelectorHost()->GetGlobalSelection("animation"); - SplitString(combinedString, cSelectedAnimations, ','); - - nTotalAnimations = cSelectedAnimations.size(); - for (nCurrentAnimation = 0; nCurrentAnimation < nTotalAnimations; ++nCurrentAnimation) - { - QString& rstrCurrentAnimAction = cSelectedAnimations[nCurrentAnimation]; - if (!rstrCurrentAnimAction.isEmpty()) - { - m_animation.m_animation = rstrCurrentAnimAction.toUtf8().data(); - m_animationLabel->setText(m_animation.m_animation.c_str()); - emit ValueChanged(m_animation); - } - } -} - -QWidget* AnimationPropertyCtrl::GetFirstInTabOrder() -{ - return m_pApplyButton; -} -QWidget* AnimationPropertyCtrl::GetLastInTabOrder() -{ - return m_pApplyButton; -} - -void AnimationPropertyCtrl::UpdateTabOrder() -{ - setTabOrder(m_pApplyButton, m_pApplyButton); -} - - -QWidget* AnimationPropertyWidgetHandler::CreateGUI(QWidget *pParent) -{ - AnimationPropertyCtrl* newCtrl = aznew AnimationPropertyCtrl(pParent); - connect(newCtrl, &AnimationPropertyCtrl::ValueChanged, newCtrl, [newCtrl]() - { - EBUS_EVENT(AzToolsFramework::PropertyEditorGUIMessages::Bus, RequestWrite, newCtrl); - }); - return newCtrl; -} - - -void AnimationPropertyWidgetHandler::ConsumeAttribute(AnimationPropertyCtrl* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) -{ - Q_UNUSED(GUI); - Q_UNUSED(attrib); - Q_UNUSED(attrValue); - Q_UNUSED(debugName); -} - -void AnimationPropertyWidgetHandler::WriteGUIValuesIntoProperty(size_t index, AnimationPropertyCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) -{ - Q_UNUSED(index); - Q_UNUSED(node); - CReflectedVarAnimation val = GUI->value(); - instance = static_cast(val); -} - -bool AnimationPropertyWidgetHandler::ReadValuesIntoGUI(size_t index, AnimationPropertyCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) -{ - Q_UNUSED(index); - Q_UNUSED(node); - CReflectedVarAnimation val = instance; - GUI->SetValue(val); - return false; -} - - -#include - diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.h b/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.h deleted file mode 100644 index 6f3e5b44f3..0000000000 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.h +++ /dev/null @@ -1,78 +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 - * - */ - -#ifndef CRYINCLUDE_EDITOR_UTILS_PROPERTYANIMATIONCTRL_H -#define CRYINCLUDE_EDITOR_UTILS_PROPERTYANIMATIONCTRL_H -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include "ReflectedVar.h" -#include -#include -#endif - -class QToolButton; -class QLabel; -class QHBoxLayout; - -class AnimationPropertyCtrl - : public QWidget -{ - Q_OBJECT -public: - AZ_CLASS_ALLOCATOR(AnimationPropertyCtrl, AZ::SystemAllocator, 0); - - AnimationPropertyCtrl(QWidget* pParent = nullptr); - virtual ~AnimationPropertyCtrl(); - - CReflectedVarAnimation value() const; - - QWidget* GetFirstInTabOrder(); - QWidget* GetLastInTabOrder(); - void UpdateTabOrder(); - -signals: - void ValueChanged(CReflectedVarAnimation value); - -public slots: - void SetValue(const CReflectedVarAnimation& animation); - -protected slots: - void OnApplyClicked(); - -private: - QToolButton* m_pApplyButton; - QLabel* m_animationLabel; - - CReflectedVarAnimation m_animation; -}; - -class AnimationPropertyWidgetHandler - : QObject - , public AzToolsFramework::PropertyHandler < CReflectedVarAnimation, AnimationPropertyCtrl > -{ -public: - AZ_CLASS_ALLOCATOR(AnimationPropertyWidgetHandler, AZ::SystemAllocator, 0); - - virtual AZ::u32 GetHandlerName(void) const override { return AZ_CRC("Animation", 0x8d5284dc); } - virtual bool IsDefaultHandler() const override { return true; } - virtual QWidget* GetFirstInTabOrder(AnimationPropertyCtrl* widget) override { return widget->GetFirstInTabOrder(); } - virtual QWidget* GetLastInTabOrder(AnimationPropertyCtrl* widget) override { return widget->GetLastInTabOrder(); } - virtual void UpdateWidgetInternalTabbing(AnimationPropertyCtrl* widget) override { widget->UpdateTabOrder(); } - - virtual QWidget* CreateGUI(QWidget* pParent) override; - virtual void ConsumeAttribute(AnimationPropertyCtrl* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override; - virtual void WriteGUIValuesIntoProperty(size_t index, AnimationPropertyCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) override; - virtual bool ReadValuesIntoGUI(size_t index, AnimationPropertyCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) override; -}; - - -#endif // CRYINCLUDE_EDITOR_UTILS_PROPERTYANIMATIONCTRL_H From f4ae72ab347441d6a667d71f016c92d15265964e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:39:52 -0800 Subject: [PATCH 136/620] Removes InformationPanel from Code/Editor/Plugins/ComponentEntityEditorPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UI/ComponentPalette/InformationPanel.cpp | 12 ------------ .../UI/ComponentPalette/InformationPanel.h | 11 ----------- .../componententityeditorplugin_files.cmake | 2 -- 3 files changed, 25 deletions(-) delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.h diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.cpp deleted file mode 100644 index dd6a53f3ac..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.cpp +++ /dev/null @@ -1,12 +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 - * - */ - -#include "InformationPanel.h" - -// TODO: LMBR-28174 - diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.h deleted file mode 100644 index 13be58cccf..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.h +++ /dev/null @@ -1,11 +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 - * - */ - -#pragma once - -// TODO: LMBR-28174 diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake index c663926618..1cb4e25304 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake @@ -31,8 +31,6 @@ set(FILES UI/ComponentPalette/FavoriteComponentList.cpp UI/ComponentPalette/FilteredComponentList.h UI/ComponentPalette/FilteredComponentList.cpp - UI/ComponentPalette/InformationPanel.h - UI/ComponentPalette/InformationPanel.cpp UI/Outliner/OutlinerDisplayOptionsMenu.h UI/Outliner/OutlinerDisplayOptionsMenu.cpp UI/Outliner/OutlinerTreeView.hxx From 0d88b9d892038c2c6d9593c716cdc91e4054db40 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:45:13 -0800 Subject: [PATCH 137/620] Removes DeepFilterProxyModel from Code/Editor/Plugins/EditorCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../EditorCommon/DeepFilterProxyModel.cpp | 172 ------------------ .../EditorCommon/DeepFilterProxyModel.h | 48 ----- .../EditorCommon/editorcommon_files.cmake | 2 - 3 files changed, 222 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.cpp delete mode 100644 Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.h diff --git a/Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.cpp b/Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.cpp deleted file mode 100644 index d4bcabdfbe..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.cpp +++ /dev/null @@ -1,172 +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 - * - */ - - -#include "DeepFilterProxyModel.h" -#include - -DeepFilterProxyModel::DeepFilterProxyModel(QObject* parent) - : QSortFilterProxyModel(parent) -{ -} - -void DeepFilterProxyModel::setFilterString(const QString& filter) -{ - m_filter = filter; - m_filterParts = m_filter.split(' ', Qt::SkipEmptyParts); - m_acceptCache.clear(); -} - -void DeepFilterProxyModel::invalidate() -{ - QSortFilterProxyModel::invalidate(); - m_acceptCache.clear(); -} - -QVariant DeepFilterProxyModel::data(const QModelIndex& index, int role) const -{ - if (role == Qt::ForegroundRole) - { - QModelIndex sourceIndex = mapToSource(index); - if (matchFilter(sourceIndex.row(), sourceIndex.parent())) - { - return QSortFilterProxyModel::data(index, role); - } - else - { - return QPalette().color(QPalette::Disabled, QPalette::Text); - } - } - else - { - return QSortFilterProxyModel::data(index, role); - } -} - - -void DeepFilterProxyModel::setFilterWildcard(const QString& pattern) -{ - m_acceptCache.clear(); - QSortFilterProxyModel::setFilterWildcard(pattern); -} - -bool DeepFilterProxyModel::matchFilter(int sourceRow, const QModelIndex& sourceParent) const -{ - int columnCount = sourceModel()->columnCount(sourceParent); - for (int i = 0; i < m_filterParts.size(); ++i) - { - bool atLeastOneContains = false; - for (int j = 0; j < columnCount; ++j) - { - QModelIndex index = sourceModel()->index(sourceRow, j, sourceParent); - QVariant data = sourceModel()->data(index, Qt::DisplayRole); - QString str(data.toString()); - if (str.isEmpty()) - { - if (m_filterParts.empty()) - { - atLeastOneContains = true; - } - } - else if (str.contains(m_filterParts[i], Qt::CaseInsensitive)) - { - atLeastOneContains = true; - } - } - if (!atLeastOneContains) - { - return false; - } - } - return true; -} - -bool DeepFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const -{ - if (matchFilter(sourceRow, sourceParent)) - { - return true; - } - - if (hasAcceptedChildrenCached(sourceRow, sourceParent)) - { - return true; - } - - return false; -} - -bool DeepFilterProxyModel::hasAcceptedChildrenCached(int sourceRow, const QModelIndex& sourceParent) const -{ - std::pair indexId = std::make_pair(sourceParent, sourceRow); - TAcceptCache::iterator it = m_acceptCache.find(indexId); - if (it == m_acceptCache.end()) - { - bool result = hasAcceptedChildren(sourceRow, sourceParent); - m_acceptCache[indexId] = result; - return result; - } - else - { - return it->second; - } -} - -bool DeepFilterProxyModel::hasAcceptedChildren(int sourceRow, const QModelIndex& sourceParent) const -{ - QModelIndex item = sourceModel()->index(sourceRow, 0, sourceParent); - if (!item.isValid()) - { - return false; - } - - int childCount = item.model()->rowCount(item); - if (childCount == 0) - { - return false; - } - - for (int i = 0; i < childCount; ++i) - { - if (filterAcceptsRow(i, item)) - { - return true; - } - } - - return false; -} - -QModelIndex DeepFilterProxyModel::findFirstMatchingIndex(const QModelIndex& root) -{ - int rowCount = this->rowCount(root); - for (int i = 0; i < rowCount; ++i) - { - QModelIndex index = this->index(i, 0, root); - if (!index.isValid()) - { - continue; - } - QModelIndex sourceIndex = mapToSource(index); - if (!sourceIndex.isValid()) - { - continue; - } - if (matchFilter(sourceIndex.row(), sourceIndex.parent())) - { - return index; - } - - QModelIndex child = findFirstMatchingIndex(index); - if (child.isValid()) - { - return child; - } - } - return QModelIndex(); -} diff --git a/Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.h b/Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.h deleted file mode 100644 index c7373ef18c..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.h +++ /dev/null @@ -1,48 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITORCOMMON_DEEPFILTERPROXYMODEL_H -#define CRYINCLUDE_EDITORCOMMON_DEEPFILTERPROXYMODEL_H -#pragma once - -#include -#include -#include -#include "EditorCommonAPI.h" - -class EDITOR_COMMON_API DeepFilterProxyModel - : public QSortFilterProxyModel -{ -public: - DeepFilterProxyModel(QObject* parent); - - void setFilterString(const QString& filter); - void invalidate(); - - QVariant data(const QModelIndex& index, int role) const override; - - void setFilterWildcard(const QString& pattern); - - bool matchFilter(int source_row, const QModelIndex& source_parent) const; - bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override; - bool hasAcceptedChildrenCached(int source_row, const QModelIndex& source_parent) const; - bool hasAcceptedChildren(int source_row, const QModelIndex& source_parent) const; - - QModelIndex findFirstMatchingIndex(const QModelIndex& root); - -private: - QString m_filter; - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - QStringList m_filterParts; - typedef std::map, bool> TAcceptCache; - mutable TAcceptCache m_acceptCache; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING -}; - -#endif // CRYINCLUDE_EDITORCOMMON_DEEPFILTERPROXYMODEL_H diff --git a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake index 1c6efbdf2c..d07ab71acf 100644 --- a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake +++ b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake @@ -19,8 +19,6 @@ set(FILES SaveUtilities/AsyncSaveRunner.cpp AxisHelper.cpp DisplayContext.cpp - DeepFilterProxyModel.cpp - DeepFilterProxyModel.h Resource.h DrawingPrimitives/Ruler.cpp DrawingPrimitives/Ruler.h From 2f6d416df420db11a254e7416a27cb3182ae6501 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:49:02 -0800 Subject: [PATCH 138/620] Removes QtViewPane.cpp which is not being compiled Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Plugins/EditorCommon/QtViewPane.cpp | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/QtViewPane.cpp diff --git a/Code/Editor/Plugins/EditorCommon/QtViewPane.cpp b/Code/Editor/Plugins/EditorCommon/QtViewPane.cpp deleted file mode 100644 index 3deef7e503..0000000000 --- a/Code/Editor/Plugins/EditorCommon/QtViewPane.cpp +++ /dev/null @@ -1,39 +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 - * - */ - - -#include "platform.h" - -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS -#include -#include - -#include "QtViewPane.h" - -#include "Include/IViewPane.h" -#include "Util/RefCountBase.h" -#include "QtWinMigrate/qwinwidget.h" - -#include -#include -#include -#include -#include - -#include "QtUtil.h" - -// ugly dependencies: -#include "Functor.h" -class CXmlArchive; -#include -#include "Util/PathUtil.h" -// ^^^ - -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- - From e791655cc4db41a7d391147730082af4c46be0bc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:58:49 -0800 Subject: [PATCH 139/620] Removes DrawingPrimitives from Code/Editor/Plugins/EditorCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../EditorCommon/DrawingPrimitives/Ruler.cpp | 192 ------------------ .../EditorCommon/DrawingPrimitives/Ruler.h | 52 ----- .../DrawingPrimitives/TimeSlider.cpp | 48 ----- .../DrawingPrimitives/TimeSlider.h | 31 --- .../EditorCommon/editorcommon_files.cmake | 4 - 5 files changed, 327 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.cpp delete mode 100644 Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.h delete mode 100644 Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.cpp delete mode 100644 Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.h diff --git a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.cpp b/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.cpp deleted file mode 100644 index 1f0bd9ad88..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.cpp +++ /dev/null @@ -1,192 +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 - * - */ - - -#include "Ruler.h" - -#include -#include -#include -#include - -namespace DrawingPrimitives -{ - enum - { - RULER_MIN_PIXELS_PER_TICK = 3, - }; - - std::vector CalculateTicks(uint size, Range visibleRange, Range rulerRange, int* pRulerPrecision, Range* pScreenRulerRange) - { - std::vector ticks; - - if (size == 0) - { - if (pRulerPrecision) - { - *pRulerPrecision = 0; - } - - return ticks; - } - - const float pixelsPerUnit = visibleRange.Length() > 0.0f ? (float)size / visibleRange.Length() : 1.0f; - - const float startTime = rulerRange.start; - const float endTime = rulerRange.end; - const float totalDuration = endTime - startTime; - - const float ticksMinPower = log10f(RULER_MIN_PIXELS_PER_TICK); - const float ticksPowerDelta = ticksMinPower - log10f(pixelsPerUnit); - - const int digitsAfterPoint = AZStd::max(-int(ceil(ticksPowerDelta)) - 1, 0); - if (pRulerPrecision) - { - *pRulerPrecision = digitsAfterPoint; - } - - const float scaleStep = powf(10.0f, ceil(ticksPowerDelta)); - const float scaleStepPixels = scaleStep * pixelsPerUnit; - const int numMarkers = int(totalDuration / scaleStep) + 1; - - const float startTimeRound = int(startTime / scaleStep) * scaleStep; - const int startOffsetMod = int(startTime / scaleStep) % 10; - const int scaleOffsetPixels = aznumeric_cast((startTime - startTimeRound) * pixelsPerUnit); - - const int startX = aznumeric_cast((rulerRange.start - visibleRange.start) * pixelsPerUnit); - const int endX = aznumeric_cast(startX + (numMarkers - 1) * scaleStepPixels - scaleOffsetPixels); - - if (pScreenRulerRange) - { - *pScreenRulerRange = Range(aznumeric_cast(startX), aznumeric_cast(endX)); - } - - const int startLoop = std::max((int)((scaleOffsetPixels - startX) / scaleStepPixels) - 1, 0); - const int endLoop = std::min((int)((size + scaleOffsetPixels - startX) / scaleStepPixels) + 1, numMarkers); - - for (int i = startLoop; i < endLoop; ++i) - { - STick tick; - - const int x = aznumeric_cast(startX + i * scaleStepPixels - scaleOffsetPixels); - const float value = startTimeRound + i * scaleStep; - - tick.m_bTenth = (startOffsetMod + i) % 10 != 0; - tick.m_position = x; - tick.m_value = value; - - ticks.push_back(tick); - } - - return ticks; - } - - QColor Interpolate(const QColor& a, const QColor& b, float k) - { - float mk = 1.0f - k; - return QColor(aznumeric_cast(a.red() * mk + b.red() * k), - aznumeric_cast(a.green() * mk + b.green() * k), - aznumeric_cast(a.blue() * mk + b.blue() * k), - aznumeric_cast(a.alpha() * mk + b.alpha() * k)); - } - - void DrawTicks(const std::vector& ticks, QPainter& painter, const QPalette& palette, const STickOptions& options) - { - QColor midDark = DrawingPrimitives::Interpolate(palette.color(QPalette::Dark), palette.color(QPalette::Button), 0.5f); - painter.setPen(QPen(midDark)); - - const int height = options.m_rect.height(); - const int top = options.m_rect.top(); - - for (const STick& tick : ticks) - { - const int x = tick.m_position + options.m_rect.left(); - - if (tick.m_bTenth) - { - painter.drawLine(QPoint(x, top + height - options.m_markHeight / 2), QPoint(x, top + height)); - } - else - { - painter.drawLine(QPoint(x, top + height - options.m_markHeight), QPoint(x, top + height)); - } - } - } - - void DrawTicks(QPainter& painter, const QPalette& palette, const SRulerOptions& options) - { - const std::vector ticks = CalculateTicks(options.m_rect.width(), options.m_visibleRange, options.m_rulerRange, nullptr, nullptr); - DrawTicks(ticks, painter, palette, options); - } - - void DrawRuler(QPainter& painter, const QPalette& palette, const SRulerOptions& options, int* pRulerPrecision) - { - int rulerPrecision; - Range screenRulerRange; - const std::vector ticks = CalculateTicks(options.m_rect.width(), options.m_visibleRange, options.m_rulerRange, &rulerPrecision, &screenRulerRange); - - if (pRulerPrecision) - { - *pRulerPrecision = rulerPrecision; - } - - if (options.m_shadowSize > 0) - { - QRect shadowRect = QRect(options.m_rect.left(), options.m_rect.height(), options.m_rect.width(), options.m_shadowSize); - QLinearGradient upperGradient(shadowRect.left(), shadowRect.top(), shadowRect.left(), shadowRect.bottom()); - upperGradient.setColorAt(0.0f, QColor(0, 0, 0, 128)); - upperGradient.setColorAt(1.0f, QColor(0, 0, 0, 0)); - QBrush upperBrush(upperGradient); - painter.fillRect(shadowRect, upperBrush); - } - - painter.fillRect(options.m_rect, DrawingPrimitives::Interpolate(palette.color(QPalette::Button), palette.color(QPalette::Midlight), 0.25f)); - if (options.m_drawBackgroundCallback) - { - options.m_drawBackgroundCallback(); - } - - QColor midDark = DrawingPrimitives::Interpolate(palette.color(QPalette::Dark), palette.color(QPalette::Button), 0.5f); - painter.setPen(QPen(midDark)); - - QFont font; - font.setPixelSize(10); - painter.setFont(font); - - - char format[16] = ""; - azsprintf(format, "%%.%df", rulerPrecision); - - const int height = options.m_rect.height(); - const int top = options.m_rect.top(); - - QString str; - for (const STick& tick : ticks) - { - const int x = tick.m_position + options.m_rect.left(); - const float value = tick.m_value; - - if (tick.m_bTenth) - { - painter.drawLine(QPoint(x, top + height - options.m_markHeight / 2), QPoint(x, top + height)); - } - else - { - painter.drawLine(QPoint(x, top + height - options.m_markHeight), QPoint(x, top + height)); - painter.setPen(palette.color(QPalette::Disabled, QPalette::Text)); - str.asprintf(format, value); - painter.drawText(QPoint(x + 2, top + height - options.m_markHeight + 1), str); - painter.setPen(midDark); - } - } - - painter.setPen(QPen(palette.color(QPalette::Dark))); - painter.drawLine(QPoint(aznumeric_cast(options.m_rect.left() + screenRulerRange.start), 0), QPoint(aznumeric_cast(options.m_rect.left() + screenRulerRange.start), options.m_rect.top() + height)); - painter.drawLine(QPoint(aznumeric_cast(options.m_rect.left() + screenRulerRange.end), 0), QPoint(aznumeric_cast(options.m_rect.left() + screenRulerRange.end), options.m_rect.top() + height)); - } -} diff --git a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.h b/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.h deleted file mode 100644 index fd8bc62ff7..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.h +++ /dev/null @@ -1,52 +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 - * - */ - - -#pragma once - -#include "Range.h" - -#include -#include -#include - -class QPainter; -class QPalette; - -namespace DrawingPrimitives -{ - struct SRulerOptions; - typedef std::function TDrawCallback; - - struct SRulerOptions - { - QRect m_rect; - Range m_visibleRange; - Range m_rulerRange; - int m_textXOffset; - int m_textYOffset; - int m_markHeight; - int m_shadowSize; - - TDrawCallback m_drawBackgroundCallback; - }; - - struct STick - { - bool m_bTenth; - int m_position; - float m_value; - }; - - typedef SRulerOptions STickOptions; - - std::vector CalculateTicks(uint size, Range visibleRange, Range rulerRange, int* pRulerPrecision, Range* pScreenRulerRange); - void DrawTicks(const std::vector& ticks, QPainter& painter, const QPalette& palette, const STickOptions& options); - void DrawTicks(QPainter& painter, const QPalette& palette, const STickOptions& options); - void DrawRuler(QPainter& painter, const QPalette& palette, const SRulerOptions& options, int* pRulerPrecision); -} diff --git a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.cpp b/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.cpp deleted file mode 100644 index 291723ff6b..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.cpp +++ /dev/null @@ -1,48 +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 - * - */ - - -#include "TimeSlider.h" - -#include -#include - -#include - -namespace DrawingPrimitives -{ - void DrawTimeSlider(QPainter& painter, const QPalette& palette, const STimeSliderOptions& options) - { - QString text = QString::number(options.m_time, 'f', options.m_precision + 1); - - QFontMetrics fm(painter.font()); - const int textWidth = fm.horizontalAdvance(text) + fm.height(); - const int markerHeight = fm.height(); - - const int thumbX = options.m_position; - const bool fits = thumbX + textWidth < options.m_rect.right(); - - const QRect timeRect(fits ? thumbX : thumbX - textWidth, 3, textWidth, fm.height()); - painter.fillRect(timeRect.adjusted(fits ? 0 : -1, 0, fits ? 1 : 0, 0), options.m_bHasFocus ? palette.highlight() : palette.shadow()); - painter.setPen(palette.color(QPalette::HighlightedText)); - painter.drawText(timeRect.adjusted(fits ? 0 : aznumeric_cast(markerHeight * 0.2f), -1, fits ? aznumeric_cast(-markerHeight * 0.2f) : 0, 0), text, QTextOption(fits ? Qt::AlignRight : Qt::AlignLeft)); - - painter.setPen(palette.color(QPalette::Text)); - painter.drawLine(QPointF(thumbX, 0), QPointF(thumbX, options.m_rect.height())); - QPointF points[3] = - { - QPointF(thumbX, markerHeight), - QPointF(thumbX - markerHeight * 0.66f, 0), - QPointF(thumbX + markerHeight * 0.66f, 0) - }; - - painter.setBrush(palette.base()); - painter.setPen(palette.color(QPalette::Text)); - painter.drawPolygon(points, 3); - } -} diff --git a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.h b/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.h deleted file mode 100644 index 4553b106e2..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.h +++ /dev/null @@ -1,31 +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 - * - */ - - -#pragma once - -#include "Range.h" - -#include - -class QPainter; -class QPalette; - -namespace DrawingPrimitives -{ - struct STimeSliderOptions - { - QRect m_rect; - int m_precision; - int m_position; - float m_time; - bool m_bHasFocus; - }; - - void DrawTimeSlider(QPainter& painter, const QPalette& palette, const STimeSliderOptions& options); -} diff --git a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake index d07ab71acf..7a380bc6ea 100644 --- a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake +++ b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake @@ -20,10 +20,6 @@ set(FILES AxisHelper.cpp DisplayContext.cpp Resource.h - DrawingPrimitives/Ruler.cpp - DrawingPrimitives/Ruler.h - DrawingPrimitives/TimeSlider.cpp - DrawingPrimitives/TimeSlider.h WinWidget/WinWidget.h WinWidget/WinWidgetManager.h WinWidget/WinWidgetManager.cpp From bc8bdd1db4eb73500195ca379e110d22ebdf9c42 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 19:06:08 -0800 Subject: [PATCH 140/620] Removes resource and rc file from FFMPEGPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Plugins/FFMPEGPlugin/FFMPEGPlugin.rc | 61 ------------------- .../FFMPEGPlugin/ffmpegplugin_files.cmake | 1 - Code/Editor/Plugins/FFMPEGPlugin/resource.h | 22 ------- 3 files changed, 84 deletions(-) delete mode 100644 Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin.rc delete mode 100644 Code/Editor/Plugins/FFMPEGPlugin/resource.h diff --git a/Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin.rc b/Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin.rc deleted file mode 100644 index 404387a244..0000000000 --- a/Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin.rc +++ /dev/null @@ -1,61 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE 9, 1 -#pragma code_page(1252) - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/Code/Editor/Plugins/FFMPEGPlugin/ffmpegplugin_files.cmake b/Code/Editor/Plugins/FFMPEGPlugin/ffmpegplugin_files.cmake index 779fc816f4..6d63e3a8f8 100644 --- a/Code/Editor/Plugins/FFMPEGPlugin/ffmpegplugin_files.cmake +++ b/Code/Editor/Plugins/FFMPEGPlugin/ffmpegplugin_files.cmake @@ -7,7 +7,6 @@ # set(FILES - FFMPEGPlugin.rc main.cpp FFMPEGPlugin.cpp FFMPEGPlugin.h diff --git a/Code/Editor/Plugins/FFMPEGPlugin/resource.h b/Code/Editor/Plugins/FFMPEGPlugin/resource.h deleted file mode 100644 index dcf269a2b4..0000000000 --- a/Code/Editor/Plugins/FFMPEGPlugin/resource.h +++ /dev/null @@ -1,22 +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 - * - */ - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by FFMPEGPlugin.rc - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif From 43b35add368232529b86d1331e34f58e315e4684 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 19:08:06 -0800 Subject: [PATCH 141/620] Removes ImagePainter and some Terrain leftovers from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/ImagePainter.cpp | 350 ------------------ Code/Editor/Util/ImagePainter.h | 76 ---- Code/Editor/editor_lib_terrain_files.cmake | 84 ----- .../editor_lib_test_terrain_files.cmake | 17 - 4 files changed, 527 deletions(-) delete mode 100644 Code/Editor/Util/ImagePainter.cpp delete mode 100644 Code/Editor/Util/ImagePainter.h delete mode 100644 Code/Editor/editor_lib_terrain_files.cmake delete mode 100644 Code/Editor/editor_lib_test_terrain_files.cmake diff --git a/Code/Editor/Util/ImagePainter.cpp b/Code/Editor/Util/ImagePainter.cpp deleted file mode 100644 index 37cf5d000c..0000000000 --- a/Code/Editor/Util/ImagePainter.cpp +++ /dev/null @@ -1,350 +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 - * - */ - - -#include "EditorDefs.h" - -#include "ImagePainter.h" - -// Editor -#include "Terrain/Heightmap.h" -#include "Terrain/Layer.h" - -SEditorPaintBrush::SEditorPaintBrush(CHeightmap& rHeightmap, CLayer& rLayer, - const bool bMaskByLayerSettings, const uint32 dwLayerIdMask, const bool bFlood) - : bBlended(true) - , m_rHeightmap(rHeightmap) - , m_rLayer(rLayer) - , m_cFilterColor(1, 1, 1) - , m_dwLayerIdMask(dwLayerIdMask) - , m_bFlood(bFlood) -{ - if (bMaskByLayerSettings) - { - m_fMinAltitude = m_rLayer.GetLayerStart(); - m_fMaxAltitude = m_rLayer.GetLayerEnd(); - m_fMinSlope = tan(m_rLayer.GetLayerMinSlopeAngle() / 90.1f * g_PI / 2.0f); // 0..90 -> 0..~1/0 - m_fMaxSlope = tan(m_rLayer.GetLayerMaxSlopeAngle() / 90.1f * g_PI / 2.0f); // 0..90 -> 0..~1/0 - } - else - { - m_fMinAltitude = -FLT_MAX; - m_fMaxAltitude = FLT_MAX; - m_fMinSlope = 0; - m_fMaxSlope = FLT_MAX; - } -} - -float SEditorPaintBrush::GetMask(const float fX, const float fY) const -{ - // Our expectation is that fX and fY are values of [0, 1) (i.e. includes 0, excludes 1). - // We're mapping this back to an int range where the width & height are generally powers of 2. So for example, we're mapping to 0 - 1023. - // To preserve maximum precision in our floats, and for ease of understanding, we're going to expect that our floats actually represent - // the 0 - 1024 range (i.e. 1 is 1024, not 1023), so that way each increment of a float is 1/1024 instead of 1/1023. This means that a value - // of 1 that's passed in is off the right edge of our range and technically invalid, so we'll just clamp if that happens. - int iX = AZStd::clamp(static_cast(fX * m_rHeightmap.GetWidth()), static_cast(0), static_cast(m_rHeightmap.GetWidth() - 1)); - int iY = AZStd::clamp(static_cast(fY * m_rHeightmap.GetHeight()), static_cast(0), static_cast(m_rHeightmap.GetHeight() - 1)); - - float fAltitude = m_rHeightmap.GetZInterpolated(fX * m_rHeightmap.GetWidth(), fY * m_rHeightmap.GetHeight()); - - // Check if altitude is within brush min/max altitude - if (fAltitude < m_fMinAltitude || fAltitude > m_fMaxAltitude) - { - return 0; - } - - float fSlope = m_rHeightmap.GetAccurateSlope(fX * m_rHeightmap.GetWidth(), fY * m_rHeightmap.GetHeight()); - - // Check if slope is within brush min/max slope - if (fSlope < m_fMinSlope || fSlope > m_fMaxSlope) - { - return 0; - } - - // Soft slope test - // float fSlopeAplha = 1.f; - // fSlopeAplha *= CLAMP((m_fMaxSlope-fSlope)*4 + 0.25f,0,1); - // fSlopeAplha *= CLAMP((fSlope-m_fMinSlope)*4 + 0.25f,0,1); - - if (m_dwLayerIdMask != 0xffffffff) - { - LayerWeight weight = m_rHeightmap.GetLayerWeightAt(iX, iY); - - if ((weight.PrimaryId() & CLayer::e_undefined) != m_dwLayerIdMask) - { - return 0; - } - } - - return 1; -} - - -////////////////////////////////////////////////////////////////////////// -void CImagePainter::PaintBrush(const float fpx, const float fpy, TImage& image, const SEditorPaintBrush& brush) -{ - float fX = fpx * image.GetWidth(), fY = fpy * image.GetHeight(); - - // By using 1/width and 1/height as our scale, this means we're expecting to generate values of [0, 1). - // i.e. we're expecting to generate 0/width to (width-1)/width, and 0/height to (height-1)/height. - // This aligns with the expectations of how GetMask() will use these values. - const float fScaleX = 1.0f / image.GetWidth(); - const float fScaleY = 1.0f / image.GetHeight(); - - //////////////////////////////////////////////////////////////////////// - // Draw an attenuated spot on the map - //////////////////////////////////////////////////////////////////////// - float fMaxDist, fAttenuation, fYSquared; - float fHardness = brush.hardness; - - unsigned int pos; - - LayerWeight* sourceData = image.GetData(); - - // Calculate the maximum distance - fMaxDist = brush.fRadius * image.GetWidth(); - - assert(image.GetWidth() == image.GetHeight()); - - int width = image.GetWidth(); - int height = image.GetHeight(); - - int iMinX = (int)floor(fX - fMaxDist), iMinY = (int)floor(fY - fMaxDist); - int iMaxX = (int)ceil(fX + fMaxDist), iMaxY = (int)ceil(fY + fMaxDist); - - for (int iPosY = iMinY; iPosY <= iMaxY; iPosY++) - { - // Skip invalid locations - if (iPosY < 0 || iPosY > height - 1) - { - continue; - } - - float fy = (float)iPosY - fY; - - // Precalculate - fYSquared = (float)(fy * fy); - - for (int iPosX = iMinX; iPosX <= iMaxX; iPosX++) - { - float fx = (float)iPosX - fX; - - // Skip invalid locations - if (iPosX < 0 || iPosX > width - 1) - { - continue; - } - - // Only circle. - float dist = sqrtf(fYSquared + fx * fx); - if (!brush.m_bFlood && dist > fMaxDist) - { - continue; - } - - float fMask = brush.GetMask(iPosX * fScaleX, iPosY * fScaleY); - - if (fMask < 0.5f) - { - continue; - } - - - // Calculate the array index - pos = iPosX + iPosY * width; - - // Calculate attenuation factor - fAttenuation = brush.m_bFlood ? 1.0f : 1.0f - __min(1.0f, dist / fMaxDist); - - float h = static_cast(sourceData[pos].GetWeight(brush.color) / 255.0f); - float dh = 1.0f - h; - float fh = clamp_tpl((fAttenuation) * dh * fHardness + h, 0.0f, 1.0f); - - // A non-zero distance between our weight sample and the center point of the brush - // can cause fAttenuation to be ~0.999, so if h (the current weight) is 254, any - // value less than 1 * dh will give us a value between 254 and 255. - // As we convert from 0-1 back to 0-255 number ranges, it's important to round - // instead of truncating so that we don't have to have an exact distance of 0 - // to reach a value of 255. - uint8 weight = static_cast(clamp_tpl(round(fh * 255.0f), 0.0f, 255.0f)); - - sourceData[pos].SetWeight(brush.color, weight); - } - } -} - - -void CImagePainter::PaintBrushWithPattern(const float fpx, const float fpy, CImageEx& outImageBGR, - const uint32 dwOffsetX, const uint32 dwOffsetY, const float fScaleX, const float fScaleY, - const SEditorPaintBrush& brush, const CImageEx& imgPattern) -{ - float fX = fpx * fScaleX, fY = fpy * fScaleY; - - //////////////////////////////////////////////////////////////////////// - // Draw an attenuated spot on the map - //////////////////////////////////////////////////////////////////////// - float fMaxDist, fAttenuation, fYSquared; - float fHardness = brush.hardness; - - unsigned int pos; - - uint32* srcBGR = outImageBGR.GetData(); - uint32* pat = imgPattern.GetData(); - - int value = brush.color; - - // Calculate the maximum distance - fMaxDist = brush.fRadius; - - int width = outImageBGR.GetWidth(); - int height = outImageBGR.GetHeight(); - - int patwidth = imgPattern.GetWidth(); - int patheight = imgPattern.GetHeight(); - - int iMinX = (int)floor(fX - fMaxDist), iMinY = (int)floor(fY - fMaxDist); - int iMaxX = (int)ceil(fX + fMaxDist), iMaxY = (int)ceil(fY + fMaxDist); - - bool bSRGB = imgPattern.GetSRGB(); - - for (int iPosY = iMinY; iPosY < iMaxY; iPosY++) - { - // Skip invalid locations - if (iPosY - dwOffsetY < 0 || iPosY - dwOffsetY > height - 1) - { - continue; - } - - float fy = (float)iPosY - fY; - - // Precalculate - fYSquared = (float)(fy * fy); - - int32 iPatY = ((uint32)iPosY) % patheight; - assert(iPatY >= 0 && iPatY < patheight); - - for (int iPosX = iMinX; iPosX < iMaxX; iPosX++) - { - float fx = (float)iPosX - fX; - - // Skip invalid locations - if (iPosX - dwOffsetX < 0 || iPosX - dwOffsetX > width - 1) - { - continue; - } - - // Only circle. - float dist = sqrtf(fYSquared + fx * fx); - - if (!brush.m_bFlood && dist > fMaxDist) - { - continue; - } - - // Calculate the array index - pos = (iPosX - dwOffsetX) + (iPosY - dwOffsetY) * width; - - // Calculate attenuation factor - fAttenuation = brush.m_bFlood ? 1.0f : 1.0f - __min(1.0f, dist / fMaxDist); - assert(fAttenuation >= 0.0f && fAttenuation <= 1.0f); - - // Note that GetMask expects a range of [0, 1), so it's correct to divide by - // fScaleX and fScaleY instead of (fScaleX-1) and (fScaleY-1). - float fMask = brush.GetMask(iPosX / fScaleX, iPosY / fScaleY); - - uint32 cDstPixBGR = srcBGR[pos]; - - int32 iPatX = ((uint32)iPosX) % patwidth; - assert(iPatX >= 0 && iPatX < patwidth); - - uint32 cSrcPix = pat[iPatX + iPatY * patwidth]; - - float s = fAttenuation * fHardness * fMask; - assert(s >= 0.0f && s <= 1.0f); - if (fcmp(s, 0)) - { - // If the blend would be entirely biased to the pixel in outImage then don't modify anything - // (The logic below is susceptible to floating point inaccuracy and would change the pixel - // even though it is not supposed to) - continue; - } - - const float fRecip255 = 1.0f / 255.0f; - - // Convert Src to Linear Space (Src is pattern texture, can be in linear or gamma space) - ColorF cSrc = ColorF(GetRValue(cSrcPix), GetGValue(cSrcPix), GetBValue(cSrcPix)) * fRecip255; - if (bSRGB) - { - cSrc.srgb2rgb(); - } - - ColorF cMtl = brush.m_cFilterColor; - cMtl.srgb2rgb(); - - cSrc *= cMtl; - cSrc.clamp(0.0f, 1.0f); - - // Convert Dst to Linear Space ( Dst is always in gamma space ), and load from BGR -> RGB - ColorF cDst = ColorF(GetBValue(cDstPixBGR), GetGValue(cDstPixBGR), GetRValue(cDstPixBGR)) * fRecip255; - cDst.srgb2rgb(); - - // Linear space blend - ColorF cOut = cSrc * s + cDst * (1.0f - s); - - // Convert final result to gamma space and put back in [0..255] range - cOut.rgb2srgb(); - cOut *= 255.0f; - - // Save the blended result as BGR - // It's important to round as we go from float back to int. If we just truncate, - // we'll end up with consistently darker colors. - srcBGR[pos] = RGB(round(cOut.b), round(cOut.g), round(cOut.r)); - } - } -} - - -void CImagePainter::FillWithPattern(CImageEx& outImage, const uint32 dwOffsetX, const uint32 dwOffsetY, - const CImageEx& imgPattern) -{ - unsigned int pos; - - uint32* src = outImage.GetData(); - uint32* pat = imgPattern.GetData(); - - int width = outImage.GetWidth(); - int height = outImage.GetHeight(); - - int patwidth = imgPattern.GetWidth(); - int patheight = imgPattern.GetHeight(); - - if (patheight == 0 || patwidth == 0) - { - return; - } - - for (int iPosY = 0; iPosY < height; iPosY++) - { - int32 iPatY = ((uint32)iPosY + dwOffsetY) % patheight; - assert(iPatY >= 0 && iPatY < patheight); - - for (int iPosX = 0; iPosX < width; iPosX++) - { - // Calculate the array index - pos = iPosX + iPosY * width; - - int32 iPatX = ((uint32)iPosX + dwOffsetX) % patwidth; - assert(iPatX >= 0 && iPatX < patwidth); - - uint32 cSrc = pat[iPatX + iPatY * patwidth]; - - src[pos] = cSrc; - } - } -} - diff --git a/Code/Editor/Util/ImagePainter.h b/Code/Editor/Util/ImagePainter.h deleted file mode 100644 index 81d1450f06..0000000000 --- a/Code/Editor/Util/ImagePainter.h +++ /dev/null @@ -1,76 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_UTIL_IMAGEPAINTER_H -#define CRYINCLUDE_EDITOR_UTIL_IMAGEPAINTER_H -#pragma once - -#include "Util/Image.h" - -struct LayerWeight; - -// Brush structure used for painting. -struct SANDBOX_API SEditorPaintBrush -{ - // constructor - SEditorPaintBrush(class CHeightmap& rHeightmap, class CLayer& rLayer, - const bool bMaskByLayerSettings, const uint32 dwLayerIdMask, const bool bFlood); - - CHeightmap& m_rHeightmap; // for mask support - unsigned char color; // Painting color - float fRadius; // outer radius (0..1 for the whole terrain size) - float hardness; // 0-1 hardness of brush - bool bBlended; // true=shades of the value are stores, false=the value is either stored or not - bool m_bFlood; // true=fills square area without attenuation, false=fills circle area with attenuation - uint32 m_dwLayerIdMask;// reference Value for the mask, 0xffffffff if not used - CLayer& m_rLayer; // layer we paint with - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - ColorF m_cFilterColor; // (1,1,1) if not used, multiplied with brightness - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - - // Arguments: - // fX - 0..1 in the whole terrain - // fY - 0..1 in the whole terrain - // Return: - // 0=paint there 0% .. 1=paint there 100% - float GetMask(const float fX, const float fY) const; - -protected: // -------------------------------------------------------------------------- - - float m_fMinSlope; // in m per m - float m_fMaxSlope; // in m per me - float m_fMinAltitude; // in m - float m_fMaxAltitude; // in m -}; - -// Contains image painting functions. -class CImagePainter -{ -public: - - // Paint spot on image at position px,py with specified paint brush parameters (to a layer) - // Arguments: - // fpx - 0..1 in the whole terrain (used for the mask) - // fpy - 0..1 in the whole terrain (used for the mask) - SANDBOX_API void PaintBrush(const float fpx, const float fpy, TImage& image, const SEditorPaintBrush& brush); - - // Paint spot with pattern (to an RGB image) - // real spot is drawn to (fpx-dwOffsetX,fpy-dwOffsetY) - to get the pattern working we need this info split up like this - // Arguments: - // fpx - 0..1 in the whole terrain (used for the mask) - // fpy - 0..1 in the whole terrain (used for the mask) - void PaintBrushWithPattern(const float fpx, const float fpy, CImageEx& outImage, const uint32 dwOffsetX, const uint32 dwOffsetY, - const float fScaleX, const float fScaleY, const SEditorPaintBrush& brush, const CImageEx& imgPattern); - - // - void FillWithPattern(CImageEx& outImage, const uint32 dwOffsetX, const uint32 dwOffsetY, const CImageEx& imgPattern); -}; - - -#endif // CRYINCLUDE_EDITOR_UTIL_IMAGEPAINTER_H diff --git a/Code/Editor/editor_lib_terrain_files.cmake b/Code/Editor/editor_lib_terrain_files.cmake deleted file mode 100644 index 09b521ad39..0000000000 --- a/Code/Editor/editor_lib_terrain_files.cmake +++ /dev/null @@ -1,84 +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 -# -# - -set(FILES - TerrainPainterPanel.cpp - TerrainPainterPanel.h - TerrainPainterPanel.ui - NewTerrainDialog.cpp - NewTerrainDialog.h - NewTerrainDialog.ui - TerrainTextureExport.cpp - TerrainTextureExport.h - TerrainTextureExport.ui - Terrain/Clouds.cpp - Terrain/GenerationParam.cpp - Terrain/GenerationParam.ui - Terrain/Heightmap.cpp - Terrain/Layer.cpp - Terrain/Noise.cpp - Terrain/PythonTerrainFuncs.cpp - Terrain/PythonTerrainLayerFuncs.cpp - Terrain/RGBLayer.cpp - Terrain/SurfaceType.cpp - Terrain/TerrainConverter.cpp - Terrain/TerrainGrid.cpp - Terrain/TerrainLayerTexGen.cpp - Terrain/TerrainLightGen.cpp - Terrain/TerrainManager.cpp - Terrain/TerrainTexGen.cpp - Terrain/TextureCompression.cpp - Terrain/MacroTextureExporter.cpp - Terrain/Clouds.h - Terrain/GenerationParam.h - Terrain/Heightmap.h - Terrain/Layer.h - Terrain/LayerWeight.h - Terrain/Noise.h - Terrain/RGBLayer.h - Terrain/SurfaceType.h - Terrain/TerrainConverter.h - Terrain/TerrainGrid.h - Terrain/TerrainLayerTexGen.h - Terrain/TerrainLightGen.h - Terrain/TerrainManager.h - Terrain/TerrainTexGen.h - Terrain/LayerWeight.cpp - Terrain/TextureCompression.h - Terrain/MacroTextureExporter.h - TerrainDialog.cpp - TerrainDialog.h - TerrainDialog.ui - TerrainTexture.cpp - TerrainTexture.h - TerrainTexture.ui - Terrain/SkyAccessibility/HeightmapAccessibility.h - Terrain/SkyAccessibility/HorizonTracker.h - TerrainHolePanel.cpp - TerrainHoleTool.cpp - TerrainHolePanel.h - TerrainHolePanel.ui - TerrainHoleTool.h - TerrainMiniMapTool.cpp - TerrainMiniMapTool.h - TerrainMiniMapPanel.ui - TerrainModifyPanel.cpp - TerrainModifyPanel.h - TerrainModifyPanel.ui - TerrainModifyTool.cpp - TerrainModifyTool.h - TerrainMoveTool.cpp - TerrainMoveToolPanel.cpp - TerrainMoveTool.h - TerrainMoveToolPanel.h - TerrainMoveToolPanel.ui - TerrainTexturePainter.cpp - TerrainTexturePainter.h - Util/ImagePainter.cpp - Util/ImagePainter.h -) diff --git a/Code/Editor/editor_lib_test_terrain_files.cmake b/Code/Editor/editor_lib_test_terrain_files.cmake deleted file mode 100644 index e0f4c99cdb..0000000000 --- a/Code/Editor/editor_lib_test_terrain_files.cmake +++ /dev/null @@ -1,17 +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 -# -# - -set(FILES - Lib/Tests/test_TerrainModifyPythonBindings.cpp - Lib/Tests/test_TerrainPythonBindings.cpp - Lib/Tests/test_TerrainLayerPythonBindings.cpp - Lib/Tests/test_TerrainPainterPythonBindings.cpp - Lib/Tests/test_TerrainHoleToolPythonBindings.cpp - Lib/Tests/test_TerrainTexturePythonBindings.cpp - Terrain/Tests/test_Terrain.cpp -) From 6b7b8c45a776b2774dc3bcd070dfd470d93e394a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 19:26:15 -0800 Subject: [PATCH 142/620] Removes UIEnumerations from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/UIEnumerations.cpp | 75 ----------------------------- Code/Editor/Util/UIEnumerations.h | 37 -------------- Code/Editor/editor_lib_files.cmake | 2 - 3 files changed, 114 deletions(-) delete mode 100644 Code/Editor/Util/UIEnumerations.cpp delete mode 100644 Code/Editor/Util/UIEnumerations.h diff --git a/Code/Editor/Util/UIEnumerations.cpp b/Code/Editor/Util/UIEnumerations.cpp deleted file mode 100644 index 2666a49f8e..0000000000 --- a/Code/Editor/Util/UIEnumerations.cpp +++ /dev/null @@ -1,75 +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 : This file implements the container for the assotiaon of -// enumeration name to enumeration values - - -#include "EditorDefs.h" - -#include "UIEnumerations.h" - -////////////////////////////////////////////////////////////////////////// -CUIEnumerations& CUIEnumerations::GetUIEnumerationsInstance() -{ - static CUIEnumerations oGeneralProxy; - return oGeneralProxy; -} - -////////////////////////////////////////////////////////////////////////// -CUIEnumerations::TDValuesContainer& CUIEnumerations::GetStandardNameContainer() -{ - static TDValuesContainer cValuesContainer; - static bool boInit(false); - - if (!boInit) - { - boInit = true; - - XmlNodeRef oRootNode; - XmlNodeRef oEnumaration; - XmlNodeRef oEnumerationItem; - - int nNumberOfEnumarations(0); - int nCurrentEnumaration(0); - - int nNumberOfEnumerationItems(0); - int nCurrentEnumarationItem(0); - - oRootNode = GetISystem()->GetXmlUtils()->LoadXmlFromFile("Editor\\PropertyEnumerations.xml"); - nNumberOfEnumarations = oRootNode ? oRootNode->getChildCount() : 0; - - for (nCurrentEnumaration = 0; nCurrentEnumaration < nNumberOfEnumarations; ++nCurrentEnumaration) - { - TDValues cValues; - oEnumaration = oRootNode->getChild(nCurrentEnumaration); - - nNumberOfEnumerationItems = oEnumaration->getChildCount(); - for (nCurrentEnumarationItem = 0; nCurrentEnumarationItem < nNumberOfEnumerationItems; ++nCurrentEnumarationItem) - { - oEnumerationItem = oEnumaration->getChild(nCurrentEnumarationItem); - - const char* szKey(nullptr); - const char* szValue(nullptr); - oEnumerationItem->getAttributeByIndex(0, &szKey, &szValue); - - cValues.push_back(szValue); - } - - const char* szKey(nullptr); - const char* szValue(nullptr); - oEnumaration->getAttributeByIndex(0, &szKey, &szValue); - - cValuesContainer.insert(TDValuesContainer::value_type(szValue, cValues)); - } - } - - return cValuesContainer; -} -////////////////////////////////////////////////////////////////////////// diff --git a/Code/Editor/Util/UIEnumerations.h b/Code/Editor/Util/UIEnumerations.h deleted file mode 100644 index f23ebf9604..0000000000 --- a/Code/Editor/Util/UIEnumerations.h +++ /dev/null @@ -1,37 +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 : This file declares the container for the assotiaon of -// enumeration name to enumeration values - - -#ifndef CRYINCLUDE_EDITOR_UTIL_UIENUMERATIONS_H -#define CRYINCLUDE_EDITOR_UTIL_UIENUMERATIONS_H -#pragma once - - -class CUIEnumerations -{ -public: - // For XML standard values. - typedef QStringList TDValues; - typedef std::map TDValuesContainer; -protected: -private: - -public: - static CUIEnumerations& GetUIEnumerationsInstance(); - - TDValuesContainer& GetStandardNameContainer(); -protected: -private: -}; - - -#endif // CRYINCLUDE_EDITOR_UTIL_UIENUMERATIONS_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 36a45905bd..758143ac8d 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -708,8 +708,6 @@ set(FILES Util/ImageTIF.cpp Util/ImageTIF.h Util/Math.h - Util/UIEnumerations.cpp - Util/UIEnumerations.h WelcomeScreen/WelcomeScreenDialog.h WelcomeScreen/WelcomeScreenDialog.cpp WelcomeScreen/WelcomeScreenDialog.ui From 0374215c00f63ca30fb033e707aa4cfec3659b48 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 9 Nov 2021 10:21:35 -0800 Subject: [PATCH 143/620] Removes some old BuildInfo files Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/BuildInfo.h | 11 ---------- Code/Framework/GridMate/GridMate/BuildInfo.h | 11 ---------- Code/Framework/GridMate/GridMate/GridMate.cpp | 1 - Code/Framework/GridMate/GridMate/Version.h | 20 ------------------- .../GridMate/GridMate/gridmate_files.cmake | 2 -- 5 files changed, 45 deletions(-) delete mode 100644 Code/Framework/AzCore/AzCore/BuildInfo.h delete mode 100644 Code/Framework/GridMate/GridMate/BuildInfo.h delete mode 100644 Code/Framework/GridMate/GridMate/Version.h diff --git a/Code/Framework/AzCore/AzCore/BuildInfo.h b/Code/Framework/AzCore/AzCore/BuildInfo.h deleted file mode 100644 index 7032b4b190..0000000000 --- a/Code/Framework/AzCore/AzCore/BuildInfo.h +++ /dev/null @@ -1,11 +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 - * - */ -#define AZCORE_BUILD_NUMBER 368 -#define AZCORE_BUILD_DATE "Thu 10/10/2013" -#define AZCORE_BUILD_TIME "19:42:16.96" -#define AZCORE_SOURCE_CHANGELIST 2992189 diff --git a/Code/Framework/GridMate/GridMate/BuildInfo.h b/Code/Framework/GridMate/GridMate/BuildInfo.h deleted file mode 100644 index 5abeab249f..0000000000 --- a/Code/Framework/GridMate/GridMate/BuildInfo.h +++ /dev/null @@ -1,11 +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 - * - */ -#define GM_BUILD_NUMBER 263 -#define GM_BUILD_DATE "Fri 10/11/2013" -#define GM_BUILD_TIME "11:42:40.81" -#define GM_SOURCE_CHANGELIST 2992328 diff --git a/Code/Framework/GridMate/GridMate/GridMate.cpp b/Code/Framework/GridMate/GridMate/GridMate.cpp index 22b4fd7af6..009aef7e83 100644 --- a/Code/Framework/GridMate/GridMate/GridMate.cpp +++ b/Code/Framework/GridMate/GridMate/GridMate.cpp @@ -13,7 +13,6 @@ #include #include #include -#include AZ_DEFINE_BUDGET(GridMate); diff --git a/Code/Framework/GridMate/GridMate/Version.h b/Code/Framework/GridMate/GridMate/Version.h deleted file mode 100644 index 0bebf6e1c1..0000000000 --- a/Code/Framework/GridMate/GridMate/Version.h +++ /dev/null @@ -1,20 +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 - * - */ -#ifndef GRIDMATE_VERSION_H -#define GRIDMATE_VERSION_H 1 - -// buildversion.h is updated automatically when we release an SDK. -// It contians the folling defines (with example numbers) -// #define GM_BUILD_NUMBER 18 -// #define GM_BUILD_DATE "Tue 06/09/2009" -// #define GM_BUILD_TIME "14:10:34.72" -#include - -#define GM_BUILD_VERSION 001 // Hundreds is a major version, tens in a minor. For instance 155 is 1.55. - -#endif // GRIDMATE_VERSION_H diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index 99dc4257f6..7fac75a442 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -7,7 +7,6 @@ # set(FILES - BuildInfo.h EBus.h Docs.h GridMate.cpp @@ -17,7 +16,6 @@ set(FILES MathUtils.h Memory.h Types.h - Version.h Carrier/Carrier.cpp Carrier/Carrier.h Carrier/Compressor.h From 1de0e574f7f3629142964696539d0e59a2f3d3be Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 9 Nov 2021 19:12:18 -0800 Subject: [PATCH 144/620] Removes LegacyJobExecutor from AzCore Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Jobs/LegacyJobExecutor.h | 197 ------------------ .../AzCore/AzCore/azcore_files.cmake | 1 - 2 files changed, 198 deletions(-) delete mode 100644 Code/Framework/AzCore/AzCore/Jobs/LegacyJobExecutor.h diff --git a/Code/Framework/AzCore/AzCore/Jobs/LegacyJobExecutor.h b/Code/Framework/AzCore/AzCore/Jobs/LegacyJobExecutor.h deleted file mode 100644 index 8018cf409f..0000000000 --- a/Code/Framework/AzCore/AzCore/Jobs/LegacyJobExecutor.h +++ /dev/null @@ -1,197 +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 - * - */ -#ifndef AZCORE_JOBS_JOBEXECUTOR_H -#define AZCORE_JOBS_JOBEXECUTOR_H - -#pragma once - -#include -#include -#include -#include - -namespace AZ -{ - /** - * Helper for porting legacy jobs that allows Starting and Waiting for multiple jobs asynchronously - */ - class LegacyJobExecutor final - { - public: - LegacyJobExecutor() = default; - - LegacyJobExecutor(const LegacyJobExecutor&) = delete; - - ~LegacyJobExecutor() - { - WaitForCompletion(); - } - - template - inline void StartJob(const Function& processFunction, JobContext* context = nullptr) - { - Job * job = aznew JobFunctionExecutorHelper(processFunction, *this, context); - StartJobInternal(job); - } - - // SetPostJob - This API exists to support backwards compatibility and is not a recommended pattern to be copied. - // Instead, create AZ::Jobs with appropriate dependencies on each other - template - inline void SetPostJob(LegacyJobExecutor& postJobExecutor, const Function& processFunction, JobContext* context = nullptr) - { - AZStd::unique_ptr postJob(aznew JobFunctionExecutorHelper(processFunction, postJobExecutor, context)); // Allocate outside the lock - { - LockGuard lockGuard(m_conditionLock); - - AZ_Assert(!m_postJob, "Post already set"); - AZ_Assert(!m_running, "LegacyJobExecutor::SetPostJob() must be called before starting any jobs"); - m_postJob = std::move(postJob); - // Note: m_jobCount is not incremented until we push the post job - } - } - - inline void ClearPostJob() - { - LockGuard lockGuard(m_conditionLock); - m_postJob.reset(); - } - - inline void Reset() - { - AZ_Assert(!IsRunning(), "LegacyJobExecutor::Reset() called while jobs in flight"); - } - - inline void WaitForCompletion() - { - AZStd::unique_lock uniqueLock(m_conditionLock); - - while (m_running) - { - AZ_PROFILE_FUNCTION(AzCore); - m_completionCondition.wait(uniqueLock, [this] { return !this->m_running; }); - } - } - - // Push a logical fence that will cause WaitForCompletion to wait until PopCompletionFence is called and all jobs are complete. Analogue to the legacy API SJobState::SetStarted() - // Note: this does NOT fence execution of jobs in relation to each other - inline void PushCompletionFence() - { - IncJobCount(); - } - - // Pop a logical completion fence. Analogue to the legacy API SJobState::SetStopped() - inline void PopCompletionFence() - { - JobCompleteUpdate(); - } - - // Are there presently jobs in-flight (queued or running)? - inline bool IsRunning() - { - return m_running; - } - - private: - void JobCompleteUpdate() - { - AZ_Assert(m_jobCount, "Invalid LegacyJobExecutor::m_jobCount."); - if (--m_jobCount == 0) // note: m_jobCount is atomic, so only the last completing job will take the count to zero - { - JobExecutorHelper* postJob = nullptr; - { - // All state transitions to and from running must be serialized through the condition lock - LockGuard lockGuard(m_conditionLock); - - // Test count again as another job may have started before we got the lock - if (!m_jobCount) - { - m_running = false; - postJob = m_postJob.release(); - m_completionCondition.notify_all(); - } - } - - // outside the lock (this pointer is no longer valid)... - if (postJob) - { - postJob->StartOnExecutor(); - } - } - } - - void StartJobInternal(Job * job) - { - IncJobCount(); - job->Start(); - } - - void IncJobCount() - { - if (m_jobCount++ == 0) - { - // All state transitions to and from running must be serialized through the condition lock (Even though m_running is atomic) - LockGuard lockGuard(m_conditionLock); - m_running = true; - } - } - - class JobExecutorHelper - { - public: - virtual ~JobExecutorHelper() = default; - virtual void StartOnExecutor() = 0; - }; - - /** - * Private Job type that notifies the owning LegacyJobExecutor of completion - */ - template - class JobFunctionExecutorHelper : public JobFunction, public JobExecutorHelper - { - using Base = JobFunction; - public: - AZ_CLASS_ALLOCATOR(JobFunctionExecutorHelper, ThreadPoolAllocator, 0) - - JobFunctionExecutorHelper(typename JobFunction::FunctionCRef processFunction, LegacyJobExecutor& executor, JobContext* context) - : JobFunction(processFunction, true /* isAutoDelete */, context) - , m_executor(executor) - { - } - - void StartOnExecutor() override - { - m_executor.StartJobInternal(this); - } - - void Process() override - { - Base::Process(); - - m_executor.JobCompleteUpdate(); - } - - private: - LegacyJobExecutor& m_executor; - }; - - template - friend class JobFunctionExecutorHelper; // For JobCompleteUpdate, StartJobInternal - - using Lock = AZStd::mutex; - using LockGuard = AZStd::lock_guard; - - AZStd::condition_variable m_completionCondition; - Lock m_conditionLock; - AZStd::unique_ptr m_postJob; - - AZStd::atomic_uint m_jobCount{0}; - AZStd::atomic_bool m_running{false}; - }; -} - -#endif diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index 8b8a3b377a..7e3f501d6f 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -238,7 +238,6 @@ set(FILES Jobs/JobManagerComponent.cpp Jobs/JobManagerComponent.h Jobs/JobManagerDesc.h - Jobs/LegacyJobExecutor.h Jobs/MultipleDependentJob.h Jobs/task_group.h Math/Aabb.cpp From 495d40fa2016024b389d663f446b073e53eda690 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 09:00:29 -0800 Subject: [PATCH 145/620] Removes unused ModuleStoragePolicy from Memory.h/cpp in AzCore Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Framework/AzCore/AzCore/Memory/Memory.cpp | 14 --- Code/Framework/AzCore/AzCore/Memory/Memory.h | 94 ------------------- 2 files changed, 108 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/Memory.cpp b/Code/Framework/AzCore/AzCore/Memory/Memory.cpp index 6ec66f9e3d..6393e3138f 100644 --- a/Code/Framework/AzCore/AzCore/Memory/Memory.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/Memory.cpp @@ -7,22 +7,8 @@ */ #include -#include #include -#include -#include - -AZ::AllocatorStorage::LazyAllocatorRef::~LazyAllocatorRef() -{ - m_destructor(*m_allocator); -} - -void AZ::AllocatorStorage::LazyAllocatorRef::Init(size_t size, size_t alignment, CreationFn creationFn, DestructionFn destructionFn) -{ - m_allocator = AZ::AllocatorManager::CreateLazyAllocator(size, alignment, creationFn); - m_destructor = destructionFn; -} ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // New overloads diff --git a/Code/Framework/AzCore/AzCore/Memory/Memory.h b/Code/Framework/AzCore/AzCore/Memory/Memory.h index 2e08ec1b15..2e568a6cfb 100644 --- a/Code/Framework/AzCore/AzCore/Memory/Memory.h +++ b/Code/Framework/AzCore/AzCore/Memory/Memory.h @@ -521,19 +521,6 @@ namespace AZ { namespace AllocatorStorage { - /// A private structure to create heap-storage for an allocator that won't expire until other static module members are destructed. - struct LazyAllocatorRef - { - using CreationFn = IAllocator*(*)(void*); - using DestructionFn = void(*)(IAllocator&); - - ~LazyAllocatorRef(); - void Init(size_t size, size_t alignment, CreationFn creationFn, DestructionFn destructionFn); - - IAllocator* m_allocator = nullptr; - DestructionFn m_destructor = nullptr; - }; - /** * A base class for all storage policies. This exists to provide access to private IAllocator methods via template friends. */ @@ -640,87 +627,6 @@ namespace AZ template EnvironmentVariable EnvironmentStoragePolicy::s_allocator; - - /** - * ModuleStoragePolicy stores the allocator in a static variable that is local to the module using it. - * This forces separate instances of the allocator to exist in each module, and permits lazy instantiation. - * We only tolerate this for some special allocators, primarily to maintain backwards compatibility with CryEngine, - * since it still allocates outside of code in the data section. - * - * It has two ways of storing its allocator: either on the heap, which is the preferred way, since it guarantees - * the memory for the allocator won't be deallocated (such as in a DLL) before anyone that's using it. If disabled - * the allocator is stored in a static variable, which should only be used where this isn't a problem a shut-down - * time, such as on a console. - */ - template - struct ModuleStoragePolicyBase; - - template - struct ModuleStoragePolicyBase: public StoragePolicyBase - { - protected: - // Use a static instance to store the allocator. This is not recommended when the order of shut-down with the module matters, as the allocator could have its memory destroyed - // before the users of it are destroyed. The primary use case for this is allocators that need to support the CRT, as they cannot allocate from the heap. - static Allocator& GetModuleAllocatorInstance() - { - static Allocator* s_allocator = nullptr; - static typename AZStd::aligned_storage::value>::type s_storage; - - if (!s_allocator) - { - s_allocator = new (&s_storage) Allocator; - StoragePolicyBase::Create(*s_allocator, typename Allocator::Descriptor(), true); - } - - return *s_allocator; - } - }; - - template - struct ModuleStoragePolicyBase : public StoragePolicyBase - { - protected: - // Store-on-heap implementation uses the LazyAllocatorRef to create and destroy an allocator using heap-space so there isn't a problem with destruction order within the module. - static Allocator& GetModuleAllocatorInstance() - { - static LazyAllocatorRef s_allocator; - - if (!s_allocator.m_allocator) - { - s_allocator.Init(sizeof(Allocator), AZStd::alignment_of::value, [](void* mem) -> IAllocator* { return new (mem) Allocator; }, &StoragePolicyBase::Destroy); - StoragePolicyBase::Create(*static_cast(s_allocator.m_allocator), typename Allocator::Descriptor(), true); - } - - return *static_cast(s_allocator.m_allocator); - } - }; - - template - class ModuleStoragePolicy : public ModuleStoragePolicyBase - { - public: - using Base = ModuleStoragePolicyBase; - - static IAllocator& GetAllocator() - { - return Base::GetModuleAllocatorInstance(); - } - - static void Create(const typename Allocator::Descriptor& desc = typename Allocator::Descriptor()) - { - StoragePolicyBase::Create(Base::GetModuleAllocatorInstance(), desc, true); - } - - static void Destroy() - { - StoragePolicyBase::Destroy(Base::GetModuleAllocatorInstance()); - } - - static bool IsReady() - { - return Base::GetModuleAllocatorInstance().IsReady(); - } - }; } namespace Internal From db68078639a36fd677fd44a7edea85982d2742c5 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 13:25:47 -0800 Subject: [PATCH 146/620] Removes TimeDataStatisticsManager from AzCore Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Statistics/TimeDataStatisticsManager.cpp | 49 ------------------ .../Statistics/TimeDataStatisticsManager.h | 51 ------------------- 2 files changed, 100 deletions(-) delete mode 100644 Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.cpp delete mode 100644 Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.h diff --git a/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.cpp b/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.cpp deleted file mode 100644 index 0e9b36a8b6..0000000000 --- a/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.cpp +++ /dev/null @@ -1,49 +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 - * - */ - -#include "TimeDataStatisticsManager.h" - -namespace AZ -{ - namespace Statistics - { - void TimeDataStatisticsManager::PushTimeDataSample(const char * registerName, const AZ::Debug::ProfilerRegister::TimeData& timeData) - { - const AZStd::string statName(registerName); - NamedRunningStatistic* statistic = GetStatistic(statName); - if (!statistic) - { - const AZStd::string units("us"); - AddStatistic(statName, statName, units, false); - AZ::Debug::ProfilerRegister::TimeData zeroTimeData; - memset(&zeroTimeData, 0, sizeof(AZ::Debug::ProfilerRegister::TimeData)); - m_previousTimeData[statName] = zeroTimeData; - statistic = GetStatistic(statName); - AZ_Assert(statistic != nullptr, "Fatal error adding a new statistic object"); - } - - const AZ::u64 accumulatedTime = timeData.m_time; - const AZ::s64 totalNumCalls = timeData.m_calls; - const AZ::u64 previousAccumulatedTime = m_previousTimeData[statName].m_time; - const AZ::s64 previousTotalNumCalls = m_previousTimeData[statName].m_calls; - const AZ::u64 deltaTime = accumulatedTime - previousAccumulatedTime; - const AZ::s64 deltaCalls = totalNumCalls - previousTotalNumCalls; - - if (deltaCalls == 0) - { - //This is the same old data. Let's skip it - return; - } - - double newSample = static_cast(deltaTime) / deltaCalls; - - statistic->PushSample(newSample); - m_previousTimeData[statName] = timeData; - } - } //namespace Statistics -} //namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.h b/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.h deleted file mode 100644 index c9adc4de2f..0000000000 --- a/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.h +++ /dev/null @@ -1,51 +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 - * - */ -#pragma once - -#include -#include - -namespace AZ -{ - namespace Statistics - { - /** - * @brief Specialization useful for data generated with AZ::Debug::FrameProfileComponent - * - * Timer based data collection using AZ_PROFILE_TIMER(...), available in - * AzCore/Debug/Profiler.h can be collected when using AZ::Debug::FrameProfilerComponent - * and AZ::Debug::FrameProfilerBus. The method PushTimeDataSample(...) is a convenience - * to convert those Timer registers into a RunningStatistic. - * - * - */ - class TimeDataStatisticsManager : public StatisticsManager<> - { - public: - TimeDataStatisticsManager() = default; - virtual ~TimeDataStatisticsManager() = default; - - /** - * @brief Adds one sample data to a specific running stat by name. - * - * This method is specialized to work with ProfilerRegister::TimeData that can be intercepted - * during AZ::Debug::FrameProfilerBus::OnFrameProfilerData(). - * For each @param registerName a new RunningStat object is created if it doesn't exist. - * - * Adds the TimeData as one sample for its RunningStatistic. - */ - void PushTimeDataSample(const char * registerName, const AZ::Debug::ProfilerRegister::TimeData& timeData); - - protected: - ///We store here the previous value from the previous timer frame data. - ///This is necessary because AZ_PROFILER_TIMER is cumulative - ///and we need the time spent for each call. - AZStd::unordered_map m_previousTimeData; - }; - } //namespace Statistics -} //namespace AZ From f2ec19b5e7bf7898b63df1cc1f5d2c0d879711c7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 14:08:21 -0800 Subject: [PATCH 147/620] Remove MockComponentApplication reimplementation from Blast.Editor tests Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/Blast/Code/CMakeLists.txt | 1 + .../Editor/EditorBlastChunksAssetHandlerTest.cpp | 12 ------------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Gems/Blast/Code/CMakeLists.txt b/Gems/Blast/Code/CMakeLists.txt index 7f478054b8..a01c0d621a 100644 --- a/Gems/Blast/Code/CMakeLists.txt +++ b/Gems/Blast/Code/CMakeLists.txt @@ -162,6 +162,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) 3rdParty::Qt::Test AZ::AzTestShared AZ::AzTest + AZ::AzCoreTestCommon AZ::AzToolsFrameworkTestCommon Gem::Blast.Editor.Static ) diff --git a/Gems/Blast/Code/Tests/Editor/EditorBlastChunksAssetHandlerTest.cpp b/Gems/Blast/Code/Tests/Editor/EditorBlastChunksAssetHandlerTest.cpp index 80a0587b1b..bb5d6160a7 100644 --- a/Gems/Blast/Code/Tests/Editor/EditorBlastChunksAssetHandlerTest.cpp +++ b/Gems/Blast/Code/Tests/Editor/EditorBlastChunksAssetHandlerTest.cpp @@ -16,18 +16,6 @@ namespace UnitTest { - MockComponentApplication::MockComponentApplication() - { - AZ::ComponentApplicationBus::Handler::BusConnect(); - AZ::Interface::Register(this); - } - - MockComponentApplication::~MockComponentApplication() - { - AZ::Interface::Unregister(this); - AZ::ComponentApplicationBus::Handler::BusDisconnect(); - } - class MockAssetCatalogRequestBusHandler final : public AZ::Data::AssetCatalogRequestBus::Handler { From 8cf499b6573ade44a24d77128df66917b497ac29 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 14:23:32 -0800 Subject: [PATCH 148/620] Remove CfgFileAsset from AzFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzFramework/Asset/CfgFileAsset.h | 24 ------------------- .../AzFramework/azframework_files.cmake | 1 - 2 files changed, 25 deletions(-) delete mode 100644 Code/Framework/AzFramework/AzFramework/Asset/CfgFileAsset.h diff --git a/Code/Framework/AzFramework/AzFramework/Asset/CfgFileAsset.h b/Code/Framework/AzFramework/AzFramework/Asset/CfgFileAsset.h deleted file mode 100644 index 2aadf9ae6c..0000000000 --- a/Code/Framework/AzFramework/AzFramework/Asset/CfgFileAsset.h +++ /dev/null @@ -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 - * - */ -#pragma once - -#include -#include - -namespace AzFramework -{ - class CfgFileAsset - { - public: - AZ_TYPE_INFO(CfgFileAsset, "{117A80A5-206B-4D85-9445-33B446D94C35}") - static const char* GetFileFilter() - { - return "*.cfg"; - } - }; -} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 73608d6a85..87108040b2 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -59,7 +59,6 @@ set(FILES Asset/AssetSeedList.h Asset/AssetSystemComponent.cpp Asset/AssetSystemComponent.h - Asset/CfgFileAsset.h Asset/GenericAssetHandler.h Asset/AssetBundleManifest.cpp Asset/AssetBundleManifest.h From 1846077f71f7b183178bb921d3516dd253949add Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 15:47:12 -0800 Subject: [PATCH 149/620] =?UTF-8?q?=EF=BB=BFunused=20DebugCameraBus=20ebus?= =?UTF-8?q?=20from=20AzFramework?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzFramework/Debug/DebugCameraBus.h | 68 ------------------- .../AzFramework/azframework_files.cmake | 2 - 2 files changed, 70 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h b/Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h index 0f8ee60efd..e69de29bb2 100644 --- a/Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h +++ b/Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h @@ -1,68 +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 - * - */ -#pragma once - -#include - -namespace AZ -{ - class Transform; - class Matrix3x3; - class Vector3; -} - -namespace AzFramework -{ - //! The debug camera allows the user control over the view through mouse + keyboard and/or - //! controller while the game still uses the view camera for everything else. This can for - //! instance be used to debug occlusion culling as all occlusion calculates will be done - //! from the view camera, so the debug camera makes it possible to check if hidden objects - //! are correctly culled. - //! This class can be useful to validate a hypothetical camera-based look-ahead asset streaming system. - //! The developer can update the camera location using this EBus, without requiring to move the viewport camera. - class DebugCameraInterface - : public AZ::EBusTraits - { - public: - enum class Mode - { - FreeFloating, //< Controls move the debug camera through the world. - Fixed, //< The debug camera stays in the position it was navigated to and control is handed back to the game. - Disabled, //< Debug camera is disabled. - - Unknown - }; - - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - - //! Sets the debug camera in free floating, fixed or disabled mode. - virtual void SetMode(Mode mode) = 0; - //! Returns the current mode the debug camera is in. - virtual Mode GetMode() const = 0; - - //! Retrieves the world position of the debug camera. This is the same position that can be retrieved - //! from GetTransform. - virtual void GetPosition(AZ::Vector3& result) const = 0; - //! Retrieves the view orientation of the debub camera. This is the same orientation that can be retrieved - //! from GetTransform. - virtual void GetView(AZ::Matrix3x3& result) const = 0; - //! Get the world transform for the debug camera. - virtual void GetTransform(AZ::Transform& result) const = 0; - }; - using DebugCameraBus = AZ::EBus; - - //! The debug camera sends out notifications about some changes. This interface provides access to these. - class DebugCameraEventsInterface - : public AZ::EBusTraits - { - public: - //! Called when the debug camera moves, usually due to user interaction. - virtual void DebugCameraMoved(const AZ::Transform& world) {} - }; - using DebugCameraEventsBus = AZ::EBus; -} // namespace AzFramework diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 87108040b2..9af049a7c1 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -77,8 +77,6 @@ set(FILES Asset/Benchmark/BenchmarkSettingsAsset.h CommandLine/CommandLine.h CommandLine/CommandRegistrationBus.h - Debug/DebugCameraBus.h - feature_options.cmake Viewport/ViewportBus.h Viewport/ViewportBus.cpp Viewport/ViewportColors.h From 02c0521a201ee4ec592982249ab16d196741afc8 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 15:48:42 -0800 Subject: [PATCH 150/620] Removes PrefabEntityOwnershipService from AzFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Entity/PrefabEntityOwnershipService.cpp | 13 ------------ .../Entity/PrefabEntityOwnershipService.h | 20 ------------------- .../AzFramework/azframework_files.cmake | 2 -- 3 files changed, 35 deletions(-) delete mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp delete mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp deleted file mode 100644 index 9b2c432332..0000000000 --- a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp +++ /dev/null @@ -1,13 +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 - * - */ - -#include - -namespace AzFramework -{ -} diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h deleted file mode 100644 index ac24af880a..0000000000 --- a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h +++ /dev/null @@ -1,20 +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 - * - */ - -#pragma once - -#include - -namespace AzFramework -{ - class PrefabEntityOwnershipService - : public EntityOwnershipService - { - - }; -} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 9af049a7c1..511439ab10 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -120,8 +120,6 @@ set(FILES Entity/SliceGameEntityOwnershipService.h Entity/SliceGameEntityOwnershipService.cpp Entity/SliceGameEntityOwnershipServiceBus.h - Entity/PrefabEntityOwnershipService.h - Entity/PrefabEntityOwnershipService.cpp Components/ComponentAdapter.h Components/ComponentAdapter.inl Components/ComponentAdapterHelpers.h From 53272d82c9622fa59ff4bef9c5b03ba08c3baae0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 11 Nov 2021 13:47:13 -0800 Subject: [PATCH 151/620] Revert "Removes PrefabEntityOwnershipService from AzFramework" This reverts commit e2d2cb07a0a1431f8fcdd20ee07ff2788ed603c0. Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Entity/PrefabEntityOwnershipService.cpp | 13 ++++++++++++ .../Entity/PrefabEntityOwnershipService.h | 20 +++++++++++++++++++ .../AzFramework/azframework_files.cmake | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp create mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp new file mode 100644 index 0000000000..9b2c432332 --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp @@ -0,0 +1,13 @@ +/* + * 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 + * + */ + +#include + +namespace AzFramework +{ +} diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h new file mode 100644 index 0000000000..ac24af880a --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +namespace AzFramework +{ + class PrefabEntityOwnershipService + : public EntityOwnershipService + { + + }; +} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 511439ab10..9af049a7c1 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -120,6 +120,8 @@ set(FILES Entity/SliceGameEntityOwnershipService.h Entity/SliceGameEntityOwnershipService.cpp Entity/SliceGameEntityOwnershipServiceBus.h + Entity/PrefabEntityOwnershipService.h + Entity/PrefabEntityOwnershipService.cpp Components/ComponentAdapter.h Components/ComponentAdapter.inl Components/ComponentAdapterHelpers.h From 507a305f67a86f344d2c174bf0e6acf186369067 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 12:25:29 -0800 Subject: [PATCH 152/620] Cleanup before merge Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/Tests/Jobs.cpp | 98 ------------------- .../Entity/PrefabEntityOwnershipService.cpp | 13 --- .../AzFramework/azframework_files.cmake | 1 - scripts/cleanup/unusued_compilation.py | 25 +++-- 4 files changed, 17 insertions(+), 120 deletions(-) delete mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp diff --git a/Code/Framework/AzCore/Tests/Jobs.cpp b/Code/Framework/AzCore/Tests/Jobs.cpp index 041f4970d1..20c960535d 100644 --- a/Code/Framework/AzCore/Tests/Jobs.cpp +++ b/Code/Framework/AzCore/Tests/Jobs.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -1398,103 +1397,6 @@ namespace UnitTest run(); } - using JobLegacyJobExecutorIsRunning = DefaultJobManagerSetupFixture; - TEST_F(JobLegacyJobExecutorIsRunning, Test) - { - // Note: Legacy JobExecutor exists as an adapter to Legacy CryEngine jobs. - // When writing new jobs instead favor direct use of the AZ::Job type family - AZ::LegacyJobExecutor jobExecutor; - EXPECT_FALSE(jobExecutor.IsRunning()); - - // Completion fences and IsRunning() - { - jobExecutor.PushCompletionFence(); - EXPECT_TRUE(jobExecutor.IsRunning()); - jobExecutor.PopCompletionFence(); - EXPECT_FALSE(jobExecutor.IsRunning()); - } - - AZStd::atomic_bool jobExecuted{ false }; - AZStd::binary_semaphore jobSemaphore; - - jobExecutor.StartJob([&jobSemaphore, &jobExecuted] - { - // Wait until the test thread releases - jobExecuted = true; - jobSemaphore.acquire(); - } - ); - EXPECT_TRUE(jobExecutor.IsRunning()); - - // Allow the job to complete - jobSemaphore.release(); - - // Wait for completion - jobExecutor.WaitForCompletion(); - EXPECT_FALSE(jobExecutor.IsRunning()); - EXPECT_TRUE(jobExecuted); - } - - using JobLegacyJobExecutorWaitForCompletion = DefaultJobManagerSetupFixture; - TEST_F(JobLegacyJobExecutorWaitForCompletion, Test) - { - // Note: Legacy JobExecutor exists as an adapter to Legacy CryEngine jobs. - // When writing new jobs instead favor direct use of the AZ::Job type family - AZ::LegacyJobExecutor jobExecutor; - - // Semaphores used to park job threads until released - const AZ::u32 numParkJobs = AZ::JobContext::GetGlobalContext()->GetJobManager().GetNumWorkerThreads(); - AZStd::vector jobSemaphores(numParkJobs); - - // Data destination for workers - const AZ::u32 workJobCount = numParkJobs * 2; - AZStd::vector jobData(workJobCount, 0); - - // Touch completion multiple times as a test of correctly transitioning in and out of the all jobs completed state - AZ::u32 NumCompletionCycles = 5; - for (AZ::u32 completionItrIdx = 0; completionItrIdx < NumCompletionCycles; ++completionItrIdx) - { - // Intentionally park every job thread - for (auto& jobSemaphore : jobSemaphores) - { - jobExecutor.StartJob([&jobSemaphore] - { - jobSemaphore.acquire(); - } - ); - } - EXPECT_TRUE(jobExecutor.IsRunning()); - - // Kick off verifiable "work" jobs - for (AZ::u32 i = 0; i < workJobCount; ++i) - { - jobExecutor.StartJob([i, &jobData] - { - jobData[i] = i + 1; - } - ); - } - EXPECT_TRUE(jobExecutor.IsRunning()); - - // Now released our parked job threads - for (auto& jobSemaphore : jobSemaphores) - { - jobSemaphore.release(); - } - - // And wait for all jobs to finish - jobExecutor.WaitForCompletion(); - EXPECT_FALSE(jobExecutor.IsRunning()); - - // Verify our workers ran and clear data - for (size_t i = 0; i < workJobCount; ++i) - { - EXPECT_EQ(jobData[i], i + 1); - jobData[i] = 0; - } - } - } - class JobCompletionCompleteNotScheduled : public DefaultJobManagerSetupFixture { diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp deleted file mode 100644 index 9b2c432332..0000000000 --- a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp +++ /dev/null @@ -1,13 +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 - * - */ - -#include - -namespace AzFramework -{ -} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 9af049a7c1..9693d75b06 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -121,7 +121,6 @@ set(FILES Entity/SliceGameEntityOwnershipService.cpp Entity/SliceGameEntityOwnershipServiceBus.h Entity/PrefabEntityOwnershipService.h - Entity/PrefabEntityOwnershipService.cpp Components/ComponentAdapter.h Components/ComponentAdapter.inl Components/ComponentAdapterHelpers.h diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 25fa4ca3ce..0d188aaa6f 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -14,7 +14,12 @@ sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../bui import ci_build EXTENSIONS_OF_INTEREST = ('.c', '.cc', '.cpp', '.cxx', '.h', '.hpp', '.hxx', '.inl') -EXCLUSIONS = ('AZ_DECLARE_MODULE_CLASS') +EXCLUSIONS = ( + 'AZ_DECLARE_MODULE_CLASS(', + 'REGISTER_QT_CLASS_DESC(', + 'TEST(', + 'TEST_F(' +) def create_filelist(path): filelist = set() @@ -42,6 +47,13 @@ def is_excluded(file): normalized_file = os.path.normpath(file) if '\\Platform\\' in normalized_file and not '\\Windows\\' in normalized_file: return True + if '\\Template\\' in normalized_file: + return True + with open(file, 'r') as file: + contents = file.readlines() + for exclusion_term in EXCLUSIONS: + if exclusion_term in contents: + return True return False def filter_from_processed(filelist, filter_file_path): @@ -49,11 +61,7 @@ def filter_from_processed(filelist, filter_file_path): return # nothing to filter with open(filter_file_path, 'r') as filter_file: - try: - processed_files = [s.strip() for s in filter_file.readlines()] - except UnicodeDecodeError as err: - print('Error reading file {}, err: {}'.format(filter_file_path, err)) - sys.exit(1) + processed_files = [s.strip() for s in filter_file.readlines()] filelist -= set(processed_files) filelist = [f for f in filelist if not is_excluded(f)] @@ -65,10 +73,11 @@ def cleanup_unused_compilation(path): # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') filter_from_processed(filelist, filter_file_path) + sorted_filelist = sorted(filelist) # 3. For each file - total_files = len(filelist) + total_files = len(sorted_filelist) current_files = 1 - for file in filelist: + for file in sorted_filelist: print(f"[{current_files}/{total_files}] Trying {file}") # b. create backup shutil.copy(file, file + '.bak') From 7c301ef762897fc82edd43783f23eec186a02cb0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 17:25:14 -0800 Subject: [PATCH 153/620] cleanup script updates Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 42 ++++++++++++++++---------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 0d188aaa6f..715ba1f6fa 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -7,6 +7,7 @@ # import argparse +import fnmatch import os import shutil import sys @@ -20,6 +21,17 @@ EXCLUSIONS = ( 'TEST(', 'TEST_F(' ) +PATH_EXCLUSIONS = ( + '*\\Platform\\Android\\*', + '*\\Platform\\Common\\*', + '*\\Platform\\iOS\\*', + '*\\Platform\\Linux\\*', + '*\\Platform\\Mac\\*', + 'Templates\\*', + 'python\\*', + 'build\\*', + 'install\\*' +) def create_filelist(path): filelist = set() @@ -32,38 +44,37 @@ def create_filelist(path): extension = os.path.splitext(f)[1] extension_lower = extension.lower() if extension_lower in EXTENSIONS_OF_INTEREST: - filelist.add(os.path.join(dp, f)) + normalized_file = os.path.normpath(os.path.join(dp, f)) + filelist.add(normalized_file) else: extension = os.path.splitext(input_file)[1] extension_lower = extension.lower() if extension_lower in EXTENSIONS_OF_INTEREST: - filelist.add(os.path.join(os.getcwd(), input_file)) + normalized_file = os.path.normpath(os.path.join(os.getcwd(), input_file)) + filelist.add(normalized_file) else: print(f'Error, file {input_file} does not have an extension of interest') sys.exit(1) return filelist def is_excluded(file): - normalized_file = os.path.normpath(file) - if '\\Platform\\' in normalized_file and not '\\Windows\\' in normalized_file: - return True - if '\\Template\\' in normalized_file: - return True + for path_exclusion in PATH_EXCLUSIONS: + if fnmatch.fnmatch(file, path_exclusion): + return True with open(file, 'r') as file: - contents = file.readlines() + contents = file.read() for exclusion_term in EXCLUSIONS: if exclusion_term in contents: return True return False def filter_from_processed(filelist, filter_file_path): - if not os.path.exists(filter_file_path): - return # nothing to filter - - with open(filter_file_path, 'r') as filter_file: - processed_files = [s.strip() for s in filter_file.readlines()] - filelist -= set(processed_files) filelist = [f for f in filelist if not is_excluded(f)] + if os.path.exists(filter_file_path): + with open(filter_file_path, 'r') as filter_file: + processed_files = [s.strip() for s in filter_file.readlines()] + filelist -= set(processed_files) + return filelist def cleanup_unused_compilation(path): # 1. Create a list of all h/cpp files (consider multiple extensions) @@ -72,8 +83,7 @@ def cleanup_unused_compilation(path): # can take a while. If something is found in the middle, we want to be able to continue instead of # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') - filter_from_processed(filelist, filter_file_path) - sorted_filelist = sorted(filelist) + filelist = filter_from_processed(filelist, filter_file_path) # 3. For each file total_files = len(sorted_filelist) current_files = 1 From 5f55815fca0d03bd006bf852abee33878b698970 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 19:03:29 -0800 Subject: [PATCH 154/620] more filters/using reverse on this node Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 715ba1f6fa..a162683460 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -19,7 +19,8 @@ EXCLUSIONS = ( 'AZ_DECLARE_MODULE_CLASS(', 'REGISTER_QT_CLASS_DESC(', 'TEST(', - 'TEST_F(' + 'TEST_F(', + 'INSTANTIATE_TEST_CASE_P(' ) PATH_EXCLUSIONS = ( '*\\Platform\\Android\\*', @@ -84,6 +85,7 @@ def cleanup_unused_compilation(path): # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') filelist = filter_from_processed(filelist, filter_file_path) + sorted_filelist = sorted(filelist, reverse=True) # 3. For each file total_files = len(sorted_filelist) current_files = 1 From 6876cfda30ffeac9af894315da5367c4f0ca9336 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 19:02:07 -0800 Subject: [PATCH 155/620] =?UTF-8?q?=EF=BB=BFMore=20filters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index a162683460..f209d5325b 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -20,7 +20,8 @@ EXCLUSIONS = ( 'REGISTER_QT_CLASS_DESC(', 'TEST(', 'TEST_F(', - 'INSTANTIATE_TEST_CASE_P(' + 'INSTANTIATE_TEST_CASE_P(', + 'AZ_UNIT_TEST_HOOK(' ) PATH_EXCLUSIONS = ( '*\\Platform\\Android\\*', @@ -85,7 +86,7 @@ def cleanup_unused_compilation(path): # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') filelist = filter_from_processed(filelist, filter_file_path) - sorted_filelist = sorted(filelist, reverse=True) + sorted_filelist = sorted(filelist) # 3. For each file total_files = len(sorted_filelist) current_files = 1 From bbec1b52421d7c379e791148f961a53f48fd7d73 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 15 Nov 2021 09:34:00 -0800 Subject: [PATCH 156/620] more exclusions for unused_compilation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index f209d5325b..69ff6bc3cf 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -21,7 +21,10 @@ EXCLUSIONS = ( 'TEST(', 'TEST_F(', 'INSTANTIATE_TEST_CASE_P(', - 'AZ_UNIT_TEST_HOOK(' + 'AZ_UNIT_TEST_HOOK(', + 'IMPLEMENT_TEST_EXECUTABLE_MAIN(', + 'DllMain(', + 'CreatePluginInstance(' ) PATH_EXCLUSIONS = ( '*\\Platform\\Android\\*', @@ -32,7 +35,8 @@ PATH_EXCLUSIONS = ( 'Templates\\*', 'python\\*', 'build\\*', - 'install\\*' + 'install\\*', + 'Code\\Framework\\AzCore\\AzCore\\Android\\*' ) def create_filelist(path): From 2de27a6d08fc25126a2fd67beedc87175f234734 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 15 Nov 2021 14:04:05 -0800 Subject: [PATCH 157/620] some more exclussions Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 69ff6bc3cf..1f1a9894c7 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -21,6 +21,7 @@ EXCLUSIONS = ( 'TEST(', 'TEST_F(', 'INSTANTIATE_TEST_CASE_P(', + 'INSTANTIATE_TYPED_TEST_CASE_P(', 'AZ_UNIT_TEST_HOOK(', 'IMPLEMENT_TEST_EXECUTABLE_MAIN(', 'DllMain(', @@ -75,7 +76,7 @@ def is_excluded(file): return False def filter_from_processed(filelist, filter_file_path): - filelist = [f for f in filelist if not is_excluded(f)] + filelist = set([f for f in filelist if not is_excluded(f)]) if os.path.exists(filter_file_path): with open(filter_file_path, 'r') as filter_file: processed_files = [s.strip() for s in filter_file.readlines()] From 8e1a3bc0731a23023eb308035d5c0fa80e05bc5d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 11:52:52 -0800 Subject: [PATCH 158/620] Removes CVarMenu from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/CVarMenu.cpp | 186 ----------------------------- Code/Editor/CVarMenu.h | 65 ---------- Code/Editor/MainWindow.cpp | 1 - Code/Editor/MainWindow.h | 1 - Code/Editor/editor_lib_files.cmake | 2 - 5 files changed, 255 deletions(-) delete mode 100644 Code/Editor/CVarMenu.cpp delete mode 100644 Code/Editor/CVarMenu.h diff --git a/Code/Editor/CVarMenu.cpp b/Code/Editor/CVarMenu.cpp deleted file mode 100644 index 6449be9b3c..0000000000 --- a/Code/Editor/CVarMenu.cpp +++ /dev/null @@ -1,186 +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 - * - */ - -#include "EditorDefs.h" - -#include "CVarMenu.h" - -CVarMenu::CVarMenu(QWidget* parent) - : QMenu(parent) -{ -} - -void CVarMenu::AddCVarToggleItem(CVarToggle cVarToggle) -{ - // Add CVar toggle action - QAction* action = addAction(cVarToggle.m_displayName); - connect(action, &QAction::triggered, [this, cVarToggle](bool checked) - { - // Update the CVar's value based on the action's new checked state - ICVar* cVar = gEnv->pConsole->GetCVar(cVarToggle.m_cVarName.toUtf8().data()); - if (cVar) - { - SetCVar(cVar, checked ? cVarToggle.m_onValue : cVarToggle.m_offValue); - } - }); - action->setCheckable(true); - - // Initialize the action's checked state based on the associated CVar's value - ICVar* cVar = gEnv->pConsole->GetCVar(cVarToggle.m_cVarName.toUtf8().data()); - bool checked = (cVar && cVar->GetFVal() == cVarToggle.m_onValue); - action->setChecked(checked); -} - -void CVarMenu::AddCVarValuesItem(QString cVarName, - QString displayName, - CVarDisplayNameValuePairs availableCVarValues, - float offValue) -{ - // Add a submenu offering multiple values for one CVar - QMenu* menu = addMenu(displayName); - QActionGroup* group = new QActionGroup(menu); - group->setExclusive(true); - - ICVar* cVar = gEnv->pConsole->GetCVar(cVarName.toUtf8().data()); - float cVarValue = cVar ? cVar->GetFVal() : 0.0f; - for (const auto& availableCVarValue : availableCVarValues) - { - QAction* action = menu->addAction(availableCVarValue.first); - action->setCheckable(true); - group->addAction(action); - - float availableOnValue = availableCVarValue.second; - connect(action, &QAction::triggered, [this, action, cVarName, availableOnValue, offValue](bool checked) - { - ICVar* cVar = gEnv->pConsole->GetCVar(cVarName.toUtf8().data()); - if (cVar) - { - if (!checked) - { - SetCVar(cVar, offValue); - } - else - { - // Toggle the CVar and update the action's checked state to - // allow none of the items to be checked in the exclusive group. - // Otherwise we could have just used the action's currently checked - // state and updated the CVar's value only - bool cVarOn = (cVar->GetFVal() == availableOnValue); - checked = !cVarOn; - SetCVar(cVar, checked ? availableOnValue : offValue); - action->setChecked(checked); - } - } - }); - - // Initialize the action's checked state based on the CVar's current value - bool checked = (cVarValue == availableOnValue); - action->setChecked(checked); - } -} - -void CVarMenu::AddUniqueCVarsItem(QString displayName, - AZStd::vector availableCVars) -{ - // Add a submenu of actions offering values for unique CVars - QMenu* menu = addMenu(displayName); - QActionGroup* group = new QActionGroup(menu); - group->setExclusive(true); - - for (const CVarToggle& availableCVar : availableCVars) - { - QAction* action = menu->addAction(availableCVar.m_displayName); - action->setCheckable(true); - group->addAction(action); - - connect(action, &QAction::triggered, [this, action, availableCVar, availableCVars](bool checked) - { - ICVar* cVar = gEnv->pConsole->GetCVar(availableCVar.m_cVarName.toUtf8().data()); - if (cVar) - { - if (!checked) - { - SetCVar(cVar, availableCVar.m_offValue); - } - else - { - // Toggle the CVar and update the action's checked state to - // allow none of the items to be checked in the exclusive group. - // Otherwise we could have just used the action's currently checked - // state and updated the CVar's value only - bool cVarOn = (cVar->GetFVal() == availableCVar.m_onValue); - bool cVarChecked = !cVarOn; - SetCVar(cVar, cVarChecked ? availableCVar.m_onValue : availableCVar.m_offValue); - action->setChecked(cVarChecked); - if (cVarChecked) - { - // Set the rest of the CVars in the group to their off values - SetCVarsToOffValue(availableCVars, availableCVar); - } - } - } - }); - - // Initialize the action's checked state based on its associated CVar's current value - ICVar* cVar = gEnv->pConsole->GetCVar(availableCVar.m_cVarName.toUtf8().data()); - bool cVarChecked = (cVar && cVar->GetFVal() == availableCVar.m_onValue); - action->setChecked(cVarChecked); - if (cVarChecked) - { - // Set the rest of the CVars in the group to their off values - SetCVarsToOffValue(availableCVars, availableCVar); - } - } -} - -void CVarMenu::AddResetCVarsItem() -{ - QAction* action = addAction(tr("Reset to Default")); - connect(action, &QAction::triggered, this, [this]() - { - for (auto it : m_originalCVarValues) - { - ICVar* cVar = gEnv->pConsole->GetCVar(it.first.c_str()); - if (cVar) - { - cVar->Set(it.second); - } - } - }); -} - -void CVarMenu::SetCVarsToOffValue(const AZStd::vector& cVarToggles, const CVarToggle& excludeCVarToggle) -{ - // Set all but the specified CVars to their off values - for (const CVarToggle& cVarToggle : cVarToggles) - { - if (cVarToggle.m_cVarName != excludeCVarToggle.m_cVarName - || cVarToggle.m_onValue != excludeCVarToggle.m_onValue) - { - ICVar* cVar = gEnv->pConsole->GetCVar(cVarToggle.m_cVarName.toUtf8().data()); - if (cVar) - { - SetCVar(cVar, cVarToggle.m_offValue); - } - } - } -} - -void CVarMenu::SetCVar(ICVar* cVar, float newValue) -{ - float oldValue = cVar->GetFVal(); - cVar->Set(newValue); - - // Store original value for CVar if not already in the list - m_originalCVarValues.emplace(AZStd::string(cVar->GetName()), oldValue); -} - -void CVarMenu::AddSeparator() -{ - addSeparator(); -} diff --git a/Code/Editor/CVarMenu.h b/Code/Editor/CVarMenu.h deleted file mode 100644 index 5195bd99d7..0000000000 --- a/Code/Editor/CVarMenu.h +++ /dev/null @@ -1,65 +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 - * - */ - -#pragma once - -#include -#include - -#include -#include -#include -#include - -struct ICVar; - -class CVarMenu - : public QMenu -{ - Q_OBJECT -public: - // CVar that can be toggled on and off - struct CVarToggle - { - QString m_cVarName; - QString m_displayName; - float m_onValue; - float m_offValue; - }; - - // List of a CVar's available values and their descriptions - using CVarDisplayNameValuePairs = AZStd::vector>; - - CVarMenu(QWidget* parent = nullptr); - - // Add an action that turns a CVar on/off - void AddCVarToggleItem(CVarToggle cVarToggle); - - // Add a submenu of actions for a CVar that offers multiple values for exclusive selection - void AddCVarValuesItem(QString cVarName, - QString displayName, - CVarDisplayNameValuePairs availableCVarValues, - float offValue); - - // Add a submenu of actions for exclusively turning unique CVars on/off - void AddUniqueCVarsItem(QString displayName, - AZStd::vector availableCVars); - - // Add an action to reset all CVars to their original values before they - // were modified by this menu - void AddResetCVarsItem(); - - void AddSeparator(); - -private: - void SetCVarsToOffValue(const AZStd::vector& cVarToggles, const CVarToggle& excludeCVarToggle); - void SetCVar(ICVar* cVar, float newValue); - - // Original CVar values before they were modified by this menu - AZStd::unordered_map m_originalCVarValues; -}; diff --git a/Code/Editor/MainWindow.cpp b/Code/Editor/MainWindow.cpp index bbebac96a3..dca6de4fc3 100644 --- a/Code/Editor/MainWindow.cpp +++ b/Code/Editor/MainWindow.cpp @@ -77,7 +77,6 @@ AZ_POP_DISABLE_WARNING #include "ToolbarManager.h" #include "Core/QtEditorApplication.h" #include "UndoDropDown.h" -#include "CVarMenu.h" #include "EditorViewportSettings.h" #include "KeyboardCustomizationSettings.h" diff --git a/Code/Editor/MainWindow.h b/Code/Editor/MainWindow.h index 1e375b08f2..5adf9a8036 100644 --- a/Code/Editor/MainWindow.h +++ b/Code/Editor/MainWindow.h @@ -49,7 +49,6 @@ class ToolbarCustomizationDialog; class QWidgetAction; class ActionManager; class ShortcutDispatcher; -class CVarMenu; namespace AzQtComponents { diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 758143ac8d..270c5293a7 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -249,8 +249,6 @@ set(FILES CryEditPy.cpp CryEdit.cpp CryEdit.h - CVarMenu.cpp - CVarMenu.h EditorToolsApplication.cpp EditorToolsApplication.h EditorToolsApplicationAPI.h From 328a5ddbd300876899c9f5a0a28a9d9714c55102 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 11:54:24 -0800 Subject: [PATCH 159/620] duplicated bus that is in AzToolsFramework, this one is not used Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/EditorPreferencesBus.h | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 Code/Editor/EditorPreferencesBus.h diff --git a/Code/Editor/EditorPreferencesBus.h b/Code/Editor/EditorPreferencesBus.h deleted file mode 100644 index d6c9e3ed55..0000000000 --- a/Code/Editor/EditorPreferencesBus.h +++ /dev/null @@ -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 - * - */ - -#pragma once - -#include - -//! Allows handlers to be notified when settings are changed to refresh accordingly -class EditorPreferencesNotifications - : public AZ::EBusTraits -{ -public: - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - - //! Notifies about changes in the Editor Preferences - virtual void OnEditorPreferencesChanged() {} -}; -using EditorPreferencesNotificationBus = AZ::EBus; From 9107af5af7a3bff45b8379e5dfc8c60b857c919b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 11:59:10 -0800 Subject: [PATCH 160/620] Removes IObservable/Observable from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/IObservable.h | 20 ------ Code/Editor/Util/IObservable.h | 20 ------ Code/Editor/Util/Observable.h | 103 ----------------------------- Code/Editor/editor_lib_files.cmake | 3 - 4 files changed, 146 deletions(-) delete mode 100644 Code/Editor/IObservable.h delete mode 100644 Code/Editor/Util/IObservable.h delete mode 100644 Code/Editor/Util/Observable.h diff --git a/Code/Editor/IObservable.h b/Code/Editor/IObservable.h deleted file mode 100644 index 9de78a7bc1..0000000000 --- a/Code/Editor/IObservable.h +++ /dev/null @@ -1,20 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_IOBSERVABLE_H -#define CRYINCLUDE_EDITOR_IOBSERVABLE_H -#pragma once - -//! Observable macro to be used in pure interfaces -#define DEFINE_OBSERVABLE_PURE_METHODS(observerClassName) \ - virtual bool RegisterObserver(observerClassName * pObserver) = 0; \ - virtual bool UnregisterObserver(observerClassName * pObserver) = 0; \ - virtual void UnregisterAllObservers() = 0; - -#endif // CRYINCLUDE_EDITOR_IOBSERVABLE_H diff --git a/Code/Editor/Util/IObservable.h b/Code/Editor/Util/IObservable.h deleted file mode 100644 index 5fa7201c80..0000000000 --- a/Code/Editor/Util/IObservable.h +++ /dev/null @@ -1,20 +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 : Handy macro when working with observers in interfaces - - -#ifndef CRYINCLUDE_EDITOR_UTIL_IOBSERVABLE_H -#define CRYINCLUDE_EDITOR_UTIL_IOBSERVABLE_H -#pragma once -#define DEFINE_OBSERVABLE_PURE_METHODS(observerClassName) \ - virtual bool RegisterObserver(observerClassName * pObserver) = 0; \ - virtual bool UnregisterObserver(observerClassName * pObserver) = 0; \ - virtual void UnregisterAllObservers() = 0; -#endif // CRYINCLUDE_EDITOR_UTIL_IOBSERVABLE_H diff --git a/Code/Editor/Util/Observable.h b/Code/Editor/Util/Observable.h deleted file mode 100644 index e42fc2c94a..0000000000 --- a/Code/Editor/Util/Observable.h +++ /dev/null @@ -1,103 +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 : This file declares templates to be used when a class can -// have a list of observers to feed - - -#ifndef CRYINCLUDE_EDITOR_UTIL_OBSERVABLE_H -#define CRYINCLUDE_EDITOR_UTIL_OBSERVABLE_H -#pragma once - -#include - -//! Observable template class, holds a list of observers which can be called at once using the helper defines -template -class CObservable -{ -public: - // Description: - // Register a new observer for the class, will check if not already added - // Return: - // true - if the observer was successfully added to the list - // false - if the observer is already in the list - bool RegisterObserver(T* pObserver) - { - if (m_observers.end() != std::find(m_observers.begin(), m_observers.end(), pObserver)) - { - return false; - } - - m_observers.push_back(pObserver); - - return true; - } - - // Description: - // Unregister an observer from the list - // Return: - // true - if the observer was successfuly removed - // false - if the observer is not in the list - bool UnregisterObserver(T* pObserver) - { - typename std::vector::iterator iter; - - if (m_observers.end() == (iter = std::find(m_observers.begin(), m_observers.end(), pObserver))) - { - return false; - } - - m_observers.erase(iter); - - return true; - } - - // Description: - // Uregister all the observers - void UnregisterAllObservers() - { - m_observers.clear(); - } - -protected: - std::vector m_observers; -}; - -// -// Helper defines to ease the process of calling the methods of all observers in the list -// - -// Description: -// Call the method of the observers, this must be used inside the subject class -// Example: CALL_OBSERVERS_METHOD(OnStuffHappened(120, "NO!")) -#define CALL_OBSERVERS_METHOD(methodCall) \ - { for (size_t iObs = 0, iObsCount = m_observers.size(); iObs < iObsCount; ++iObs) { m_observers[iObs]->methodCall; } \ - } - -// Description: -// Call the method of the observers, this can be used outside the subject class -// Example: CALL_OBSERVERS_METHOD_OF(pSomeObservableSubject, OnStuffHappened(120, "NO!")) -#define CALL_OBSERVERS_METHOD_OF(pObservable, methodCall) \ - { for (size_t iObs = 0, iObsCount = pObservable->m_observers.size(); iObs < iObsCount; ++iObs) { pObservable->m_observers[iObs]->methodCall; } \ - } - -// Description: -// Call the method of the observers, this can be called using a custom vector of observers -// Example: CALL_SPECIFIED_OBSERVERS_LIST_METHOD(vMyPreciousSpecialObservers, OnStuffHappened(120, "NO!")) -#define CALL_SPECIFIED_OBSERVERS_LIST_METHOD(vObservers, methodCall) \ - { for (size_t iObs = 0, iObsCount = vObservers.size(); iObs < iObsCount; ++iObs) { vObservers[iObs]->methodCall; } \ - } - -// Description: -// Implement the observable methods when the user class is inheriting from a virtual interface using the observable methods -#define IMPLEMENT_OBSERVABLE_METHODS(observerClassName) \ - virtual bool RegisterObserver(observerClassName * pObserver) { return CObservable::RegisterObserver(pObserver); }; \ - virtual bool UnregisterObserver(observerClassName * pObserver) { return CObservable::UnregisterObserver(pObserver); }; \ - virtual void UnregisterAllObservers() { CObservable::UnregisterAllObservers(); }; -#endif // CRYINCLUDE_EDITOR_UTIL_OBSERVABLE_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 270c5293a7..bcff55f40f 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -438,7 +438,6 @@ set(FILES FBXExporterDialog.h FileTypeUtils.h GridUtils.h - IObservable.h IPostRenderer.h ToolBox.h TrackViewNewSequenceDialog.h @@ -647,11 +646,9 @@ set(FILES Util/GeometryUtil.cpp Util/GuidUtil.cpp Util/GuidUtil.h - Util/IObservable.h Util/Mailer.h Util/NamedData.cpp Util/NamedData.h - Util/Observable.h Util/PakFile.cpp Util/PakFile.h Util/PredefinedAspectRatios.cpp From 06331dae37049067461e69bc5136ec2fb693450f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 12:04:41 -0800 Subject: [PATCH 161/620] =?UTF-8?q?=EF=BB=BFRemoves=20Report=20from=20Code?= =?UTF-8?q?/Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Report.h | 183 ----------------------------- Code/Editor/editor_lib_files.cmake | 1 - 2 files changed, 184 deletions(-) delete mode 100644 Code/Editor/Report.h diff --git a/Code/Editor/Report.h b/Code/Editor/Report.h deleted file mode 100644 index 1dbf3788cd..0000000000 --- a/Code/Editor/Report.h +++ /dev/null @@ -1,183 +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 : Generic report class, which contains arbitrary report entries. - -#ifndef CRYINCLUDE_EDITOR_REPORT_H -#define CRYINCLUDE_EDITOR_REPORT_H -#pragma once - - -class IReportField -{ -public: - virtual ~IReportField() {} - - virtual const char* GetDescription() const = 0; - virtual const char* GetText() const = 0; -}; - -template -class CReportField - : public IReportField -{ -public: - typedef T Object; - typedef G TextGetter; - - CReportField(Object& object, const char* description, TextGetter& getter); - virtual const char* GetDescription() const; - virtual const char* GetText() const; - -private: - TextGetter m_getter; - string m_text; - string m_description; -}; - -class IReportRecord -{ -public: - virtual ~IReportRecord() {} - virtual int GetFieldCount() const = 0; - virtual const char* GetFieldDescription(int fieldIndex) const = 0; - virtual const char* GetFieldText(int fieldIndex) const = 0; -}; - -template -class CReportRecord - : public IReportRecord -{ -public: - typedef T Object; - - CReportRecord(Object& object); - virtual ~CReportRecord(); - virtual int GetFieldCount() const; - virtual const char* GetFieldDescription(int fieldIndex) const; - virtual const char* GetFieldText(int fieldIndex) const; - template - CReportField* AddField(const char* description, G& getter); - -private: - Object m_object; - typedef std::vector FieldContainer; - FieldContainer m_fields; -}; - -class CReport -{ -public: - ~CReport(); - template - CReportRecord* AddRecord(T& object); - int GetRecordCount() const; - IReportRecord* GetRecord(int recordIndex); - void Clear(); - -private: - typedef std::vector RecordContainer; - RecordContainer m_records; -}; - -template -inline CReportField::CReportField(Object& object, const char* description, TextGetter& getter) - : m_getter(getter) - , m_description(description) -{ - m_text = m_getter(object); -} - -template -inline const char* CReportField::GetDescription() const -{ - return m_description.c_str(); -} - -template -inline const char* CReportField::GetText() const -{ - return m_text.c_str(); -} - -template -inline CReportRecord::CReportRecord(Object& object) - : m_object(object) -{ -} - -template -inline CReportRecord::~CReportRecord() -{ - for (FieldContainer::iterator it = m_fields.begin(); it != m_fields.end(); ++it) - { - delete (*it); - } -} - -template -inline int CReportRecord::GetFieldCount() const -{ - return m_fields.size(); -} - -template -inline const char* CReportRecord::GetFieldDescription(int fieldIndex) const -{ - return m_fields[fieldIndex]->GetDescription(); -} - -template -inline const char* CReportRecord::GetFieldText(int fieldIndex) const -{ - return m_fields[fieldIndex]->GetText(); -} - -template -template -inline CReportField* CReportRecord::AddField(const char* description, G& getter) -{ - CReportField* field = new CReportField(m_object, description, getter); - m_fields.push_back(field); - return field; -} - -inline CReport::~CReport() -{ - Clear(); -} - -template -inline CReportRecord* CReport::AddRecord(T& object) -{ - CReportRecord* record = new CReportRecord(object); - m_records.push_back(record); - return record; -} - -inline int CReport::GetRecordCount() const -{ - return m_records.size(); -} - -inline IReportRecord* CReport::GetRecord(int recordIndex) -{ - return m_records[recordIndex]; -} - -inline void CReport::Clear() -{ - for (RecordContainer::iterator it = m_records.begin(); it != m_records.end(); ++it) - { - delete (*it); - } - m_records.clear(); -} - -#endif // CRYINCLUDE_EDITOR_REPORT_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index bcff55f40f..4545bb5b44 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -546,7 +546,6 @@ set(FILES LevelInfo.h ProcessInfo.cpp ProcessInfo.h - Report.h TrackView/AtomOutputFrameCapture.cpp TrackView/AtomOutputFrameCapture.h TrackView/TrackViewDialog.qrc From d44d01c6a57e5d32c4efe11dbfbf6f99e58a7fff Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 15:01:31 -0800 Subject: [PATCH 162/620] Removes CommandManagerBus from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Commands/CommandManagerBus.h | 30 ------------------------ 1 file changed, 30 deletions(-) delete mode 100644 Code/Editor/Commands/CommandManagerBus.h diff --git a/Code/Editor/Commands/CommandManagerBus.h b/Code/Editor/Commands/CommandManagerBus.h deleted file mode 100644 index a5edceaee8..0000000000 --- a/Code/Editor/Commands/CommandManagerBus.h +++ /dev/null @@ -1,30 +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 - * - */ - -#pragma once - -#include - -class CommandManagerRequests : public AZ::EBusTraits -{ -public: - - struct CommandDetails - { - AZStd::string m_name; - AZStd::vector m_arguments; - }; - - virtual AZStd::vector GetCommands() const = 0; - virtual void ExecuteCommand(const AZStd::string& commandLine) {} - - virtual void GetCommandDetails(AZStd::string commandName, CommandDetails& outArguments) const = 0; - -}; - -using CommandManagerRequestBus = AZ::EBus; From 28c40764e6e843e957071edb5806b22ec43c66bc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 16:26:36 -0800 Subject: [PATCH 163/620] Remove SubObjSelection from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Objects/BaseObject.h | 1 - Code/Editor/Objects/SubObjSelection.cpp | 62 ----------------- Code/Editor/Objects/SubObjSelection.h | 91 ------------------------- Code/Editor/editor_lib_files.cmake | 2 - 4 files changed, 156 deletions(-) delete mode 100644 Code/Editor/Objects/SubObjSelection.cpp delete mode 100644 Code/Editor/Objects/SubObjSelection.h diff --git a/Code/Editor/Objects/BaseObject.h b/Code/Editor/Objects/BaseObject.h index fea248c7f7..666d9f3e1d 100644 --- a/Code/Editor/Objects/BaseObject.h +++ b/Code/Editor/Objects/BaseObject.h @@ -31,7 +31,6 @@ class CUndoBaseObject; class CObjectManager; class CGizmo; class CObjectArchive; -struct SSubObjSelectionModifyContext; struct SRayHitInfo; class CPopupMenuItem; class QMenu; diff --git a/Code/Editor/Objects/SubObjSelection.cpp b/Code/Editor/Objects/SubObjSelection.cpp deleted file mode 100644 index 3a67b8dfb7..0000000000 --- a/Code/Editor/Objects/SubObjSelection.cpp +++ /dev/null @@ -1,62 +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 - * - */ - - -#include "EditorDefs.h" - -#include "SubObjSelection.h" - -SSubObjSelOptions g_SubObjSelOptions; - -/* - -////////////////////////////////////////////////////////////////////////// -bool CSubObjSelContext::IsEmpty() const -{ - if (GetCount() == 0) - return false; - for (int i = 0; i < GetCount(); i++) - { - CSubObjectSelection *pSel = GetSelection(i); - if (!pSel->IsEmpty()) - return true; - } - return false; -} - -////////////////////////////////////////////////////////////////////////// -void CSubObjSelContext::ModifySelection( SSubObjSelectionModifyContext &modCtx ) -{ - for (int n = 0; n < GetCount(); n++) - { - CSubObjectSelection *pSel = GetSelection(n); - if (pSel->IsEmpty()) - continue; - modCtx.pSubObjSelection = pSel; - pSel->pGeometry->SubObjSelectionModify( modCtx ); - } - if (modCtx.type == SO_MODIFY_MOVE) - { - OnSelectionChange(); - } -} - -////////////////////////////////////////////////////////////////////////// -void CSubObjSelContext::AcceptModifySelection() -{ - for (int n = 0; n < GetCount(); n++) - { - CSubObjectSelection *pSel = GetSelection(n); - if (pSel->IsEmpty()) - continue; - if (pSel->pGeometry) - pSel->pGeometry->Update(); - } -} - -*/ diff --git a/Code/Editor/Objects/SubObjSelection.h b/Code/Editor/Objects/SubObjSelection.h deleted file mode 100644 index 9e07bdc203..0000000000 --- a/Code/Editor/Objects/SubObjSelection.h +++ /dev/null @@ -1,91 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_OBJECTS_SUBOBJSELECTION_H -#define CRYINCLUDE_EDITOR_OBJECTS_SUBOBJSELECTION_H -#pragma once - -////////////////////////////////////////////////////////////////////////// -// Sub Object element type. -////////////////////////////////////////////////////////////////////////// -enum ESubObjElementType -{ - SO_ELEM_NONE = 0, - SO_ELEM_VERTEX, - SO_ELEM_EDGE, - SO_ELEM_FACE, - SO_ELEM_POLYGON, - SO_ELEM_UV, -}; - -////////////////////////////////////////////////////////////////////////// -enum ESubObjDisplayType -{ - SO_DISPLAY_WIREFRAME, - SO_DISPLAY_FLAT, - SO_DISPLAY_GEOMETRY, -}; - -////////////////////////////////////////////////////////////////////////// -// Options for sub-object selection. -////////////////////////////////////////////////////////////////////////// -struct SSubObjSelOptions -{ - bool bSelectByVertex; - bool bIgnoreBackfacing; - int nMatID; - - bool bSoftSelection; - float fSoftSelFalloff; - - // Display options. - bool bDisplayBackfacing; - bool bDisplayNormals; - float fNormalsLength; - ESubObjDisplayType displayType; - - SSubObjSelOptions() - { - bSelectByVertex = false; - bIgnoreBackfacing = false; - bSoftSelection = false; - nMatID = 0; - fSoftSelFalloff = 1; - - bDisplayBackfacing = true; - bDisplayNormals = false; - displayType = SO_DISPLAY_FLAT; - fNormalsLength = 0.4f; - } -}; - -extern SSubObjSelOptions g_SubObjSelOptions; - - -////////////////////////////////////////////////////////////////////////// -enum ESubObjSelectionModifyType -{ - SO_MODIFY_UNSELECT, - SO_MODIFY_MOVE, - SO_MODIFY_ROTATE, - SO_MODIFY_SCALE, -}; - -////////////////////////////////////////////////////////////////////////// -// This structure is passed when user is dragging sub object selection. -////////////////////////////////////////////////////////////////////////// -struct SSubObjSelectionModifyContext -{ - CViewport* view; - ESubObjSelectionModifyType type; - Vec3 vValue; - Matrix34 worldRefFrame; -}; - -#endif // CRYINCLUDE_EDITOR_OBJECTS_SUBOBJSELECTION_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 4545bb5b44..aa52b18b45 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -452,8 +452,6 @@ set(FILES Objects/DisplayContextShared.inl Objects/SelectionGroup.cpp Objects/SelectionGroup.h - Objects/SubObjSelection.cpp - Objects/SubObjSelection.h Objects/ObjectLoader.cpp Objects/ObjectLoader.h Objects/ObjectManager.cpp From 580027f75e919b3e45347f3f895c994d501af77a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 16:36:59 -0800 Subject: [PATCH 164/620] Removes ComponentPaletteWindow from Code/Editor/Plugins/ComponentEntityEditorPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ComponentEntityEditorPlugin.cpp | 1 - .../ComponentPaletteWindow.cpp | 116 ------------------ .../ComponentPalette/ComponentPaletteWindow.h | 59 --------- .../componententityeditorplugin_files.cmake | 2 - 4 files changed, 178 deletions(-) delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.h diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp index 50b315b9c3..9022341309 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp @@ -14,7 +14,6 @@ #include "UI/QComponentEntityEditorOutlinerWindow.h" #include "UI/QComponentLevelEntityEditorMainWindow.h" #include "UI/ComponentPalette/ComponentPaletteSettings.h" -#include "UI/ComponentPalette/ComponentPaletteWindow.h" #include #include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.cpp deleted file mode 100644 index 1791301654..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.cpp +++ /dev/null @@ -1,116 +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 - * - */ - -#include "ComponentPaletteWindow.h" -#include "ComponentDataModel.h" -#include "FavoriteComponentList.h" -#include "FilteredComponentList.h" -#include "CategoriesList.h" - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -ComponentPaletteWindow::ComponentPaletteWindow(QWidget* parent) - : QMainWindow(parent) -{ - Init(); -} - -void ComponentPaletteWindow::Init() -{ - layout()->setSizeConstraint(QLayout::SetMinimumSize); - - QVBoxLayout* layout = new QVBoxLayout(); - layout->setSizeConstraint(QLayout::SetMinimumSize); - layout->setContentsMargins(0, 0, 0, 0); - layout->setSpacing(0); - - QHBoxLayout* gridLayout = new QHBoxLayout(nullptr); - gridLayout->setSizeConstraint(QLayout::SetMaximumSize); - gridLayout->setContentsMargins(0, 0, 0, 0); - gridLayout->setSpacing(0); - - m_filterWidget = new AzToolsFramework::SearchCriteriaWidget(this); - - QStringList tags; - tags << tr("name"); - m_filterWidget->SetAcceptedTags(tags, tags[0]); - layout->addLayout(gridLayout, 1); - - // Left Panel - QVBoxLayout* leftPaneLayout = new QVBoxLayout(this); - - // Favorites - leftPaneLayout->addWidget(new QLabel(tr("Favorites"))); - leftPaneLayout->addWidget(new QLabel(tr("Drag components here to add favorites."))); - FavoritesList* favorites = new FavoritesList(); - favorites->Init(); - leftPaneLayout->addWidget(favorites); - - // Categories - m_categoryListWidget = new ComponentCategoryList(); - m_categoryListWidget->Init(); - leftPaneLayout->addWidget(m_categoryListWidget); - gridLayout->addLayout(leftPaneLayout); - - // Right Panel - QVBoxLayout* rightPanelLayout = new QVBoxLayout(this); - gridLayout->addLayout(rightPanelLayout); - - // Component list - m_componentListWidget = new FilteredComponentList(this); - m_componentListWidget->Init(); - - rightPanelLayout->addWidget(new QLabel(tr("Components"))); - rightPanelLayout->addWidget(m_filterWidget, 0, Qt::AlignTop); - rightPanelLayout->addWidget(m_componentListWidget); - - // The main window - QWidget* window = new QWidget(); - window->setLayout(layout); - setCentralWidget(window); - - connect(m_categoryListWidget, &ComponentCategoryList::OnCategoryChange, m_componentListWidget, &FilteredComponentList::SetCategory); - connect(m_filterWidget, &AzToolsFramework::SearchCriteriaWidget::SearchCriteriaChanged, m_componentListWidget, &FilteredComponentList::SearchCriteriaChanged); - -} - -void ComponentPaletteWindow::keyPressEvent(QKeyEvent* event) -{ - if (event->modifiers().testFlag(Qt::ControlModifier) && event->key() == Qt::Key_F) - { - m_filterWidget->SelectTextEntryBox(); - } - else - { - QMainWindow::keyPressEvent(event); - } -} - -void ComponentPaletteWindow::RegisterViewClass() -{ - using namespace AzToolsFramework; - - ViewPaneOptions options; - options.canHaveMultipleInstances = true; - RegisterViewPane("Component Palette", LyViewPane::CategoryOther, options); -} - -#include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.h deleted file mode 100644 index f662f69342..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.h +++ /dev/null @@ -1,59 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#endif - -namespace AzToolsFramework -{ - class SearchCriteriaWidget; -} - -class ComponentCategoryList; -class FilteredComponentList; -class ComponentDataModel; - -//! ComponentPaletteWindow -//! Provides a window with controls related to the Component Entity system. It provides an intuitive and organized -//! set of controls to display, sort, filter components. It provides mechanisms for creating entities by dragging -//! and dropping components into the viewport as well as from context menus. -class ComponentPaletteWindow - : public QMainWindow -{ - Q_OBJECT - -public: - - explicit ComponentPaletteWindow(QWidget* parent = 0); - - void Init(); - - static const GUID& GetClassID() - { - // {4236998F-1138-466D-9DF5-6533BFA1DFCA} - static const GUID guid = - { - 0x4236998F, 0x1138, 0x466D, { 0x9D, 0xF5, 0x65, 0x33, 0xBF, 0xA1, 0xDF, 0xCA } - }; - return guid; - } - - static void RegisterViewClass(); - -protected: - ComponentCategoryList* m_categoryListWidget; - FilteredComponentList* m_componentListWidget; - AzToolsFramework::SearchCriteriaWidget* m_filterWidget; - - void keyPressEvent(QKeyEvent* event) override; -}; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake index 1cb4e25304..a03c25e8f0 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake @@ -25,8 +25,6 @@ set(FILES UI/ComponentPalette/ComponentDataModel.h UI/ComponentPalette/ComponentDataModel.cpp UI/ComponentPalette/ComponentPaletteSettings.h - UI/ComponentPalette/ComponentPaletteWindow.h - UI/ComponentPalette/ComponentPaletteWindow.cpp UI/ComponentPalette/FavoriteComponentList.h UI/ComponentPalette/FavoriteComponentList.cpp UI/ComponentPalette/FilteredComponentList.h From 8ac886c2189ca4d55bcba5b7bca3b77eed52d1be Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 17:25:11 -0800 Subject: [PATCH 165/620] Removes FavoriteComponentList from Code/Editor/Plugins/ComponentEntityEditorPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../FavoriteComponentList.cpp | 392 ------------------ .../ComponentPalette/FavoriteComponentList.h | 117 ------ .../componententityeditorplugin_files.cmake | 2 - 3 files changed, 511 deletions(-) delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.h diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.cpp deleted file mode 100644 index 41eed6f93f..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.cpp +++ /dev/null @@ -1,392 +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 - * - */ - -#include "FavoriteComponentList.h" -#include -#include -#include - -#include -#include - -#include -#include - -// FavoritesList -////////////////////////////////////////////////////////////////////////// - -FavoritesList::FavoritesList(QWidget* parent /*= nullptr*/) - : FilteredComponentList(parent) -{ -} - -FavoritesList::~FavoritesList() -{ - FavoriteComponentListRequestBus::Handler::BusDisconnect(); -} - -void FavoritesList::Init() -{ - FavoriteComponentListRequestBus::Handler::BusConnect(); - - FavoritesDataModel* favoritesDataModel = new FavoritesDataModel(this); - - setModel(favoritesDataModel); - - horizontalHeader()->setSectionResizeMode(ComponentDataModel::ColumnIndex::Name, QHeaderView::Stretch); - - setShowGrid(false); - - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection); - setStyleSheet("QTableView { selection-background-color: rgba(255,255,255,0.2); }"); - setGridStyle(Qt::PenStyle::NoPen); - verticalHeader()->hide(); - horizontalHeader()->hide(); - setSelectionBehavior(QAbstractItemView::SelectionBehavior::SelectRows); - setShowGrid(false); - setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); - setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); - - setColumnWidth(ComponentDataModel::ColumnIndex::Icon, 32); - hideColumn(ComponentDataModel::ColumnIndex::Category); - - setDragDropMode(QAbstractItemView::DragDrop); - setAcceptDrops(true); - - horizontalHeader()->setSectionResizeMode(ComponentDataModel::ColumnIndex::Icon, QHeaderView::ResizeToContents); - setColumnWidth(ComponentDataModel::ColumnIndex::Icon, 32); - - horizontalHeader()->setSectionResizeMode(ComponentDataModel::ColumnIndex::Category, QHeaderView::Stretch); - setColumnWidth(ComponentDataModel::ColumnIndex::Category, 90); - - // Context menu - setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, &QWidget::customContextMenuRequested, this, &FavoritesList::ShowContextMenu); -} - -void FavoritesList::ShowContextMenu(const QPoint& pos) -{ - // Only show if a level is loaded - if (!GetIEditor() || GetIEditor()->IsInGameMode()) - { - return; - } - - if ( model()->rowCount() == 0) - { - return; - } - - QMenu contextMenu(tr("Context menu"), this); - - QAction actionNewEntity(tr("Make entity with selected favorites"), this); - QAction actionAddToSelection(this); - if (GetIEditor()->GetDocument()->IsDocumentReady()) - { - QObject::connect(&actionNewEntity, &QAction::triggered, this, [&] { ContextMenu_NewEntity(); }); - contextMenu.addAction(&actionNewEntity); - - AzToolsFramework::EntityIdList selectedEntities; - EBUS_EVENT_RESULT(selectedEntities, AzToolsFramework::ToolsApplicationRequests::Bus, GetSelectedEntities); - - if (!selectedEntities.empty()) - { - QString addToSelection = selectedEntities.size() > 1 ? tr("Add to selected entities") : tr("Add to selected entity"); - actionAddToSelection.setText(addToSelection); - - QObject::connect(&actionAddToSelection, &QAction::triggered, this, [&] { ContextMenu_AddToSelectedEntities(); }); - contextMenu.addAction(&actionAddToSelection); - } - - contextMenu.addSeparator(); - } - - QAction action(tr("Remove"), this); - QObject::connect(&action, &QAction::triggered, this, [&] { ContextMenu_RemoveSelectedFavorites(); }); - contextMenu.addAction(&action); - - contextMenu.exec(mapToGlobal(pos)); -} - -void FavoritesList::ContextMenu_RemoveSelectedFavorites() -{ - FavoritesDataModel* dataModel = qobject_cast(model()); - if (!selectedIndexes().empty()) - { - dataModel->Remove(selectedIndexes()); - } -} - -void FavoritesList::rowsInserted([[maybe_unused]] const QModelIndex& parent, [[maybe_unused]] int start, [[maybe_unused]] int end) -{ - resizeRowToContents(0); -} - -void FavoritesList::AddFavorites(const AZStd::vector& classDataContainer) -{ - for (const AZ::SerializeContext::ClassData* classData : classDataContainer) - { - if (classData) - { - FavoritesDataModel* dataModel = qobject_cast(model()); - dataModel->AddFavorite(classData); - } - } -} - -void FavoritesList::dragEnterEvent(QDragEnterEvent* event) -{ - if (event->mimeData()->hasFormat(AzToolsFramework::ComponentTypeMimeData::GetMimeType())) - { - event->acceptProposedAction(); - } -} - -void FavoritesList::dragMoveEvent(QDragMoveEvent* event) -{ - if (event->source() == this) - { - event->ignore(); - } - else - { - event->accept(); - } -} - -// FavoritesDataModel -////////////////////////////////////////////////////////////////////////// - -int FavoritesDataModel::rowCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const -{ - return m_favorites.size(); -} - -int FavoritesDataModel::columnCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const -{ - return ColumnIndex::Count; -} - -void FavoritesDataModel::SaveState() -{ - AZStd::vector favorites; - for (const AZ::SerializeContext::ClassData* classData : m_favorites) - { - favorites.push_back(classData->m_typeId); - } - m_settings->SetFavorites(AZStd::move(favorites)); - - - // Write the settings to file... - AZ::SerializeContext* serializeContext = nullptr; - EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(serializeContext, "Serialize Context is null!"); - - char settingsPath[AZ_MAX_PATH_LEN] = { 0 }; - AZ::IO::FileIOBase::GetInstance()->ResolvePath(ComponentPaletteSettings::GetSettingsFile(), settingsPath, AZ_MAX_PATH_LEN); - - bool result = m_provider.Save(settingsPath, serializeContext); - (void)result; - AZ_Warning("ComponentPaletteSettings", result, "Failed to Save the Component Palette Settings!"); -} - -void FavoritesDataModel::LoadState() -{ - // It is necessary to Load the settings file *before* you call UserSettings::CreateFind! - AZ::SerializeContext* serializeContext = nullptr; - EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(serializeContext, "Serialize Context is null!"); - - char settingsPath[AZ_MAX_PATH_LEN] = { 0 }; - AZ::IO::FileIOBase::GetInstance()->ResolvePath(ComponentPaletteSettings::GetSettingsFile(), settingsPath, AZ_MAX_PATH_LEN); - - bool result = m_provider.Load(settingsPath, serializeContext); - (void)result; - - - // Create (if no file was found) or find the settings, this will populate the m_settings->m_favorites list. - m_settings = AZ::UserSettings::CreateFind(AZ_CRC("ComponentPaletteSettings", 0x481d355b), m_providerId); - - // Add favorites to the data model from loaded settings - for (const AZ::Uuid& favorite : m_settings->m_favorites) - { - const AZ::SerializeContext::ClassData* classData = serializeContext->FindClassData(favorite); - if (classData) - { - AddFavorite(classData, false); - } - } -} - -void FavoritesDataModel::Remove(const QModelIndexList& indices) -{ - beginResetModel(); - - auto newFavorites = m_favorites; - - // swap here - for (auto index : indices) - { - // we're only dealing with columns and they're the only thing with class data anyways - if (index.column() == 0) - { - QVariant classDataVariant = index.data(ComponentDataModel::ClassDataRole); - if (classDataVariant.isValid()) - { - const AZ::SerializeContext::ClassData* classData = reinterpret_cast(classDataVariant.value()); - newFavorites.removeAll(classData); - - AZ_TracePrintf("Debug", "Removing: %s\n", classData->m_editData->m_name); - } - } - } - - m_favorites.swap(newFavorites); - - endResetModel(); - - SaveState(); -} - -QModelIndex FavoritesDataModel::index(int row, int column, const QModelIndex &parent) const -{ - if (!hasIndex(row, column, parent)) - { - return QModelIndex(); - } - - if (row >= rowCount(parent) || column >= columnCount(parent)) - { - return QModelIndex(); - } - - return createIndex(row, column, (void*)(m_favorites[row])); -} - -QVariant FavoritesDataModel::data(const QModelIndex &index, int role /*= Qt::DisplayRole*/) const -{ - if (!index.isValid()) - { - return QVariant(); - } - - const AZ::SerializeContext::ClassData* classData = m_favorites[index.row()]; - if (!classData) - { - return QVariant(); - } - - switch (role) - { - case Qt::DisplayRole: - { - if (index.column() == ComponentDataModel::ColumnIndex::Name) - { - if (m_favorites.empty()) - { - return QVariant(tr("You have 0 favorites.\nDrag some components here.")); - } - - return QVariant(classData->m_editData->m_name); - } - } - break; - - case Qt::DecorationRole: - { - if (index.column() == ColumnIndex::Icon) - { - const AZ::SerializeContext::ClassData* iconClassData = m_favorites[index.row()]; - auto iconIterator = m_componentIcons.find(iconClassData->m_typeId); - if (iconIterator != m_componentIcons.end()) - { - return iconIterator->second; - } - - return QVariant(); - } - } - break; - - case ClassDataRole: - if (index.column() == 0) // Only get data for one column - { - return QVariant::fromValue(reinterpret_cast(const_cast(classData))); - } - break; - - default: - break; - } - - return ComponentDataModel::data(index, role); - -} - -void FavoritesDataModel::SetSavedStateKey([[maybe_unused]] AZ::u32 key) -{ -} - -FavoritesDataModel::FavoritesDataModel(QWidget* parent /*= nullptr*/) - : ComponentDataModel(parent) - , m_providerId(AZ_CRC("ComponentPaletteSettingsProviderId")) -{ - m_provider.Activate(m_providerId); - LoadState(); -} - -FavoritesDataModel::~FavoritesDataModel() -{ - m_provider.Deactivate(); -} - -void FavoritesDataModel::AddFavorite(const AZ::SerializeContext::ClassData* classData, bool updateSettings) -{ - beginResetModel(); - - if (m_favorites.indexOf(classData) < 0) - { - m_favorites.push_back(classData); - } - - endResetModel(); - - if (updateSettings) - { - SaveState(); - } -} - -bool FavoritesDataModel::dropMimeData(const QMimeData *data, Qt::DropAction action, [[maybe_unused]] int row, [[maybe_unused]] int column, [[maybe_unused]] const QModelIndex &parent) -{ - if (action == Qt::IgnoreAction) - { - return true; - } - - if (data && data->hasFormat(AzToolsFramework::ComponentTypeMimeData::GetMimeType())) - { - AzToolsFramework::ComponentTypeMimeData::ClassDataContainer classDataContainer; - AzToolsFramework::ComponentTypeMimeData::Get(data, classDataContainer); - - for (const AZ::SerializeContext::ClassData* classData : classDataContainer) - { - if (classData) - { - AddFavorite(classData); - } - } - - return true; - } - - return false; -} - -#include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.h deleted file mode 100644 index 2bd2d83e04..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.h +++ /dev/null @@ -1,117 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include "ComponentDataModel.h" -#include "FilteredComponentList.h" -#include "ComponentPaletteSettings.h" - -#include -#include -#include -#include -#endif - -//! FavoriteComponentListRequest -//! Bus that provides a way for external features to record favorites -class FavoriteComponentListRequest : public AZ::EBusTraits -{ -public: - virtual void AddFavorites(const AZStd::vector&) = 0; -}; - -using FavoriteComponentListRequestBus = AZ::EBus; - - -//! FavoritesDataModel -//! Stores the list of component class data to display in the favorites control, offers persistence through user settings. -class FavoritesDataModel - : public ComponentDataModel -{ - Q_OBJECT - -public: - - AZ_CLASS_ALLOCATOR(FavoritesDataModel, AZ::SystemAllocator, 0); - - FavoritesDataModel(QWidget* parent = nullptr); - ~FavoritesDataModel() override; - - //! Add a favorite component - //! \param classData The ClassData information for the component to store as favorite - //! \param updateSettings Optional parameter used to determine if the persistent settings need to be updated. - void AddFavorite(const AZ::SerializeContext::ClassData* classData, bool updateSettings = true); - - //! Remove all the specified items from the table - //! \param indices List of indices to remove from favorites - void Remove(const QModelIndexList& indices); - - //! Save the list of favorite components to user settings - void SaveState(); - - //! Load the list of favorite components from user settings - void LoadState(); - -protected: - - void SetSavedStateKey(AZ::u32 key); - - // Qt handlers - QModelIndex index(int row, int column, const QModelIndex &parent) const override; - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - int columnCount(const QModelIndex &parent = QModelIndex()) const override; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; - - // List of component class data - QList m_favorites; - - // The Palette settings and provider information for saving out the Favorites list - AZStd::intrusive_ptr m_settings; - AZ::UserSettingsProvider m_provider; - AZ::u32 m_providerId; -}; - - -//! FavoritesList -//! User customized list of favorite components, provides persistence. -class FavoritesList - : public FilteredComponentList - , FavoriteComponentListRequestBus::Handler -{ - Q_OBJECT - -public: - - explicit FavoritesList(QWidget* parent = nullptr); - ~FavoritesList() override; - - void Init() override; - -protected: - - ////////////////////////////////////////////////////////////////////////// - // FavoriteComponentListRequestBus - void AddFavorites(const AZStd::vector& classDataContainer) override; - ////////////////////////////////////////////////////////////////////////// - - void rowsInserted(const QModelIndex& parent, int start, int end) override; - - // Context menu handlers - void ShowContextMenu(const QPoint&); - void ContextMenu_RemoveSelectedFavorites(); - - // Validate data being dragged in - void dragEnterEvent(QDragEnterEvent * event) override; - void dragMoveEvent(QDragMoveEvent* event) override; - - //! Handler used when dropping PaletteItems into the Viewport. - static void DragDropHandler(CViewport* viewport, int ptx, int pty, void* custom); -}; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake index a03c25e8f0..1aaa5abf4d 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake @@ -25,8 +25,6 @@ set(FILES UI/ComponentPalette/ComponentDataModel.h UI/ComponentPalette/ComponentDataModel.cpp UI/ComponentPalette/ComponentPaletteSettings.h - UI/ComponentPalette/FavoriteComponentList.h - UI/ComponentPalette/FavoriteComponentList.cpp UI/ComponentPalette/FilteredComponentList.h UI/ComponentPalette/FilteredComponentList.cpp UI/Outliner/OutlinerDisplayOptionsMenu.h From cd7c069fbbbdf5089435751b578a19d051a5a4dd Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 17:30:33 -0800 Subject: [PATCH 166/620] Removes FilteredComponentList from Code/Editor/Plugins/ComponentEntityEditorPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../FilteredComponentList.cpp | 264 ------------------ .../ComponentPalette/FilteredComponentList.h | 68 ----- .../componententityeditorplugin_files.cmake | 2 - 3 files changed, 334 deletions(-) delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.h diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.cpp deleted file mode 100644 index 2431653e36..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.cpp +++ /dev/null @@ -1,264 +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 - * - */ - -#include "ComponentDataModel.h" -#include "FavoriteComponentList.h" -#include "FilteredComponentList.h" - -#include "CryCommon/MathConversion.h" -#include "Editor/IEditor.h" -#include "Editor/ViewManager.h" -#include - -#include - -#include - -void FilteredComponentList::Init() -{ - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - setDragDropMode(QAbstractItemView::DragDropMode::DragOnly); - setDragEnabled(true); - - setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection); - setStyleSheet("QTreeWidget { selection-background-color: rgba(255,255,255,0.2); }"); - setGridStyle(Qt::PenStyle::NoPen); - verticalHeader()->hide(); - horizontalHeader()->hide(); - setSelectionBehavior(QAbstractItemView::SelectionBehavior::SelectRows); - setAcceptDrops(false); - - m_componentDataModel = new ComponentDataModel(this); - ComponentDataProxyModel* componentDataProxyModel = new ComponentDataProxyModel(this); - componentDataProxyModel->setSourceModel(m_componentDataModel); - setModel(componentDataProxyModel); - - QHeaderView* horizontalHeaderView = horizontalHeader(); - horizontalHeaderView->setSectionResizeMode(ComponentDataModel::ColumnIndex::Icon, QHeaderView::ResizeToContents); - horizontalHeaderView->setSectionResizeMode(ComponentDataModel::ColumnIndex::Name, QHeaderView::Stretch); - - setColumnWidth(ComponentDataModel::ColumnIndex::Icon, 32); - setShowGrid(false); - - setColumnWidth(ComponentDataModel::ColumnIndex::Name, 90); - setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); - - sortByColumn(ComponentDataModel::ColumnIndex::Name, Qt::AscendingOrder); - hideColumn(ComponentDataModel::ColumnIndex::Category); - - connect(model(), &QAbstractItemModel::rowsInserted, this, &FilteredComponentList::rowsInserted); - connect(model(), &QAbstractItemModel::rowsRemoved, this, &FilteredComponentList::rowsAboutToBeRemoved); - - connect(model(), SIGNAL(modelReset()), SLOT(modelReset())); - - - // Context menu - setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, &QWidget::customContextMenuRequested, this, &FilteredComponentList::ShowContextMenu); -} - -void FilteredComponentList::ContextMenu_NewEntity() -{ - AZ::EntityId entityId; - - auto proxyDataModel = qobject_cast(model()); - if (proxyDataModel) - { - entityId = proxyDataModel->NewEntityFromSelection(selectedIndexes()); - } - else - { - auto dataModel = qobject_cast(model()); - if (dataModel) - { - entityId = dataModel->NewEntityFromSelection(selectedIndexes()); - } - } -} - - -void FilteredComponentList::ContextMenu_AddToFavorites() -{ - AZStd::vector componentsToAdd; - for (auto index : selectedIndexes()) - { - QVariant classDataVariant = index.data(ComponentDataModel::ClassDataRole); - if (classDataVariant.isValid()) - { - auto classData = reinterpret_cast(classDataVariant.value()); - componentsToAdd.push_back(classData); - } - } - - if (!componentsToAdd.empty()) - { - EBUS_EVENT(FavoriteComponentListRequestBus, AddFavorites, componentsToAdd); - } -} - -void FilteredComponentList::ContextMenu_AddToSelectedEntities() -{ - ComponentDataUtilities::AddComponentsToSelectedEntities(selectedIndexes(), model()); -} - -void FilteredComponentList::ShowContextMenu(const QPoint& pos) -{ - QMenu contextMenu(tr("Context menu"), this); - - QAction actionNewEntity(tr("Create new entity with selected components"), this); - if (GetIEditor()->GetDocument()->IsDocumentReady()) - { - QObject::connect(&actionNewEntity, &QAction::triggered, this, [this] { ContextMenu_NewEntity(); }); - contextMenu.addAction(&actionNewEntity); - } - - QAction actionAddFavorite(tr("Add to favorites"), this); - QObject::connect(&actionAddFavorite, &QAction::triggered, this, [this] { ContextMenu_AddToFavorites(); }); - contextMenu.addAction(&actionAddFavorite); - - QAction actionAddToSelection(this); - if (GetIEditor()->GetDocument()->IsDocumentReady()) - { - AzToolsFramework::EntityIdList selectedEntities; - EBUS_EVENT_RESULT(selectedEntities, AzToolsFramework::ToolsApplicationRequests::Bus, GetSelectedEntities); - - if (!selectedEntities.empty()) - { - QString addToSelection = selectedEntities.size() > 1 ? tr("Add to selected entities") : tr("Add to selected entity"); - - actionAddToSelection.setText(addToSelection); - QObject::connect(&actionAddToSelection, &QAction::triggered, this, [this] { ContextMenu_AddToSelectedEntities(); }); - contextMenu.addAction(&actionAddToSelection); - } - } - // TODO: Requires information panel implementation LMBR-28174 - //QAction actionHelp(tr("Help"), this); - //QObject::connect(&actionHelp, &QAction::triggered, this, [&] {}); - //contextMenu.addAction(&actionHelp); - - contextMenu.exec(mapToGlobal(pos)); -} - -void FilteredComponentList::modelReset() -{ - // Ensure that the category column is hidden - hideColumn(ComponentDataModel::ColumnIndex::Category); -} - -FilteredComponentList::FilteredComponentList(QWidget* parent /*= nullptr*/) - : QTableView(parent) -{ -} - -FilteredComponentList::~FilteredComponentList() -{ -} - -void FilteredComponentList::SearchCriteriaChanged(QStringList& criteriaList, AzToolsFramework::FilterOperatorType filterOperator) -{ - setUpdatesEnabled(false); - - auto dataModel = qobject_cast(model()); - if (dataModel) - { - // Go through the list of items and show/hide as needed due to filter. - QString filter; - for (const auto& criteria : criteriaList) - { - QString tag, text; - AzToolsFramework::SearchCriteriaButton::SplitTagAndText(criteria, tag, text); - AppendFilter(filter, text, filterOperator); - } - - dataModel->setFilterRegExp(QRegExp(filter, Qt::CaseSensitivity::CaseInsensitive)); - } - - setUpdatesEnabled(true); -} - -void FilteredComponentList::SetCategory(const char* category) -{ - auto dataModel = qobject_cast(model()); - if (dataModel) - { - if (!category || category[0] == 0 || azstricmp(category, "All") == 0) - { - dataModel->ClearSelectedCategory(); - } - else - { - dataModel->SetSelectedCategory(category); - } - } - - // Note: this ensures the category column remains hidden - hideColumn(ComponentDataModel::ColumnIndex::Category); -} - -void FilteredComponentList::BuildFilter(QStringList& criteriaList, AzToolsFramework::FilterOperatorType filterOperator) -{ - ClearFilterRegExp(); - - for (const auto& criteria : criteriaList) - { - QString tag, text; - AzToolsFramework::SearchCriteriaButton::SplitTagAndText(criteria, tag, text); - if (tag.isEmpty()) - { - tag = "null"; - } - - QString filter = m_filtersRegExp[tag.toStdString().c_str()].pattern(); - - AppendFilter(filter, text, filterOperator); - - SetFilterRegExp(tag.toStdString().c_str(), QRegExp(filter, Qt::CaseInsensitive)); - } -} - -void FilteredComponentList::AppendFilter(QString& filter, const QString& text, AzToolsFramework::FilterOperatorType filterOperator) -{ - if (filterOperator == AzToolsFramework::FilterOperatorType::Or) - { - if (filter.isEmpty()) - { - filter = text; - } - else - { - filter += "|" + text; - } - } - else if (filterOperator == AzToolsFramework::FilterOperatorType::And) - { - //using lookaheads to produce an "and" effect. - filter += "(?=.*" + text + ")"; - } -} - -void FilteredComponentList::SetFilterRegExp(const AZStd::string& filterType, const QRegExp& regExp) -{ - m_filtersRegExp[filterType] = regExp; -} - -void FilteredComponentList::ClearFilterRegExp(const AZStd::string& filterType /*= AZStd::string()*/) -{ - if (filterType.empty()) - { - for (auto& it : m_filtersRegExp) - { - it.second = QRegExp(); - } - } - else - { - m_filtersRegExp[filterType] = QRegExp(); - } -} - -#include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.h deleted file mode 100644 index 113128fbcc..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.h +++ /dev/null @@ -1,68 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include - -#include -#include -#include -#include "ComponentDataModel.h" -#endif - -namespace AZ -{ - class SerializeContext; - class ClassData; -} - -class ComponentDataModel; - -//! FilteredComponentList -//! Provides a list of components that can be filtered according to search criteria provided and/or from -//! a category selection control. -class FilteredComponentList - : public QTableView -{ - Q_OBJECT - -public: - - explicit FilteredComponentList(QWidget* parent = nullptr); - - ~FilteredComponentList() override; - - virtual void Init(); - - void SearchCriteriaChanged(QStringList& criteriaList, AzToolsFramework::FilterOperatorType filterOperator); - - void SetCategory(const char* category); - -protected: - - // Filtering support - void BuildFilter(QStringList& criteriaList, AzToolsFramework::FilterOperatorType filterOperator); - void AppendFilter(QString& filter, const QString& text, AzToolsFramework::FilterOperatorType filterOperator); - void SetFilterRegExp(const AZStd::string& filterType, const QRegExp& regExp); - void ClearFilterRegExp(const AZStd::string& filterType = AZStd::string()); - - // Context menu handlers - void ShowContextMenu(const QPoint&); - void ContextMenu_NewEntity(); - void ContextMenu_AddToFavorites(); - void ContextMenu_AddToSelectedEntities(); - - void modelReset(); - - AzToolsFramework::FilterByCategoryMap m_filtersRegExp; - ComponentDataModel* m_componentDataModel; - -}; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake index 1aaa5abf4d..b5a8b00855 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake @@ -25,8 +25,6 @@ set(FILES UI/ComponentPalette/ComponentDataModel.h UI/ComponentPalette/ComponentDataModel.cpp UI/ComponentPalette/ComponentPaletteSettings.h - UI/ComponentPalette/FilteredComponentList.h - UI/ComponentPalette/FilteredComponentList.cpp UI/Outliner/OutlinerDisplayOptionsMenu.h UI/Outliner/OutlinerDisplayOptionsMenu.cpp UI/Outliner/OutlinerTreeView.hxx From 43679d398f60681e3d8006df7795a5cb20df2aa1 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 17 Nov 2021 13:44:58 -0800 Subject: [PATCH 167/620] Remove AxisHelper from Code/Editor/Plugins/EditorCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Plugins/EditorCommon/AxisHelper.cpp | 10 ---------- .../Plugins/EditorCommon/editorcommon_files.cmake | 1 - 2 files changed, 11 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/AxisHelper.cpp diff --git a/Code/Editor/Plugins/EditorCommon/AxisHelper.cpp b/Code/Editor/Plugins/EditorCommon/AxisHelper.cpp deleted file mode 100644 index dab7511779..0000000000 --- a/Code/Editor/Plugins/EditorCommon/AxisHelper.cpp +++ /dev/null @@ -1,10 +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 - * - */ - - -#include "../../Editor/RenderHelpers/AxisHelperShared.inl" diff --git a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake index 7a380bc6ea..511418efc7 100644 --- a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake +++ b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake @@ -17,7 +17,6 @@ set(FILES DockTitleBarWidget.h SaveUtilities/AsyncSaveRunner.h SaveUtilities/AsyncSaveRunner.cpp - AxisHelper.cpp DisplayContext.cpp Resource.h WinWidget/WinWidget.h From fb3a4321ed2c440fe631f7e623273754c7de0b07 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 17 Nov 2021 13:45:54 -0800 Subject: [PATCH 168/620] Remove Cry_LegacyPhysUtils from Code/Editor/Plugins/EditorCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../EditorCommon/Cry_LegacyPhysUtils.h | 700 ------------------ 1 file changed, 700 deletions(-) diff --git a/Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h b/Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h index b3735fa4b6..e69de29bb2 100644 --- a/Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h +++ b/Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h @@ -1,700 +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 - * - */ - -// Copied utils functions from CryPhysics that are used by non-physics systems -// This functions will be eventually removed, DO *NOT* use these functions -// TO-DO: Re-implement users using new code -// LY-109806 - -#pragma once - -#include "Cry_Math.h" - -namespace LegacyCryPhysicsUtils -{ - namespace polynomial_tpl_IMPL - { - template - class polynomial_tpl - { - public: - explicit polynomial_tpl() { denom = (ftype)1; }; - explicit polynomial_tpl(ftype op) { zero(); data[degree] = op; } - AZ_FORCE_INLINE polynomial_tpl& zero() - { - for (int i = 0; i <= degree; i++) - { - data[i] = 0; - } - denom = (ftype)1; - return *this; - } - polynomial_tpl(const polynomial_tpl& src) { *this = src; } - polynomial_tpl& operator=(const polynomial_tpl& src) - { - denom = src.denom; - for (int i = 0; i <= degree; i++) - { - data[i] = src.data[i]; - } - return *this; - } - template - AZ_FORCE_INLINE polynomial_tpl& operator=(const polynomial_tpl& src) - { - int i; - denom = src.denom; - for (i = 0; i <= min(degree, degree1); i++) - { - data[i] = src.data[i]; - } - for (; i < degree; i++) - { - data[i] = 0; - } - return *this; - } - AZ_FORCE_INLINE polynomial_tpl& set(ftype* pdata) - { - for (int i = 0; i <= degree; i++) - { - data[degree - i] = pdata[i]; - } - return *this; - } - - AZ_FORCE_INLINE ftype& operator[](int idx) { return data[idx]; } - - void calc_deriviative(polynomial_tpl& deriv, int curdegree = degree) const; - - AZ_FORCE_INLINE polynomial_tpl& fixsign() - { - ftype sg = sgnnz(denom); - denom *= sg; - for (int i = 0; i <= degree; i++) - { - data[i] *= sg; - } - return *this; - } - - int findroots(ftype start, ftype end, ftype* proots, int nIters = 20, int curdegree = degree, bool noDegreeCheck = false) const; - int nroots(ftype start, ftype end) const; - - AZ_FORCE_INLINE ftype eval(ftype x) const - { - ftype res = 0; - for (int i = degree; i >= 0; i--) - { - res = res * x + data[i]; - } - return res; - } - AZ_FORCE_INLINE ftype eval(ftype x, int subdegree) const - { - ftype res = data[subdegree]; - for (int i = subdegree - 1; i >= 0; i--) - { - res = res * x + data[i]; - } - return res; - } - - AZ_FORCE_INLINE polynomial_tpl& operator+=(ftype op) { data[0] += op * denom; return *this; } - AZ_FORCE_INLINE polynomial_tpl& operator-=(ftype op) { data[0] -= op * denom; return *this; } - AZ_FORCE_INLINE polynomial_tpl operator*(ftype op) const - { - polynomial_tpl res; - res.denom = denom; - for (int i = 0; i <= degree; i++) - { - res.data[i] = data[i] * op; - } - return res; - } - AZ_FORCE_INLINE polynomial_tpl& operator*=(ftype op) - { - for (int i = 0; i <= degree; i++) - { - data[i] *= op; - } - return *this; - } - AZ_FORCE_INLINE polynomial_tpl operator/(ftype op) const - { - polynomial_tpl res = *this; - res.denom = denom * op; - return res; - } - AZ_FORCE_INLINE polynomial_tpl& operator/=(ftype op) { denom *= op; return *this; } - - AZ_FORCE_INLINE polynomial_tpl sqr() const { return *this * *this; } - - ftype denom; - ftype data[degree + 1]; - }; - - template - struct tagPolyE - { - inline static ftype polye() { return (ftype)1E-10; } - }; - - template<> - inline float tagPolyE::polye() { return 1e-6f; } - - template - inline ftype polye() { return tagPolyE::polye(); } - - // Don't use this macro; use AZStd::max instead. This is only here to make the template const arguments below readable - // and because Visual Studio 2013 doesn't have a const_expr version of std::max - #define deprecated_degmax(degree1, degree2) (((degree1) > (degree2)) ? (degree1) : (degree2)) - - template - AZ_FORCE_INLINE polynomial_tpl operator+(const polynomial_tpl& pn, ftype op) - { - polynomial_tpl res = pn; - res.data[0] += op * res.denom; - return res; - } - template - AZ_FORCE_INLINE polynomial_tpl operator-(const polynomial_tpl& pn, ftype op) - { - polynomial_tpl res = pn; - res.data[0] -= op * res.denom; - return res; - } - - template - AZ_FORCE_INLINE polynomial_tpl operator+(ftype op, const polynomial_tpl& pn) - { - polynomial_tpl res = pn; - res.data[0] += op * res.denom; - return res; - } - template - AZ_FORCE_INLINE polynomial_tpl operator-(ftype op, const polynomial_tpl& pn) - { - polynomial_tpl res = pn; - res.data[0] -= op * res.denom; - for (int i = 0; i <= degree; i++) - { - res.data[i] = -res.data[i]; - } - return res; - } - template - polynomial_tpl AZ_FORCE_INLINE psqr(const polynomial_tpl& op) { return op * op; } - - template - AZ_FORCE_INLINE polynomial_tpl operator+(const polynomial_tpl& op1, const polynomial_tpl& op2) - { - polynomial_tpl res; - int i; - for (i = 0; i <= min(degree1, degree2); i++) - { - res.data[i] = op1.data[i] * op2.denom + op2.data[i] * op1.denom; - } - for (; i <= degree1; i++) - { - res.data[i] = op1.data[i] * op2.denom; - } - for (; i <= degree2; i++) - { - res.data[i] = op2.data[i] * op1.denom; - } - res.denom = op1.denom * op2.denom; - return res; - } - template - AZ_FORCE_INLINE polynomial_tpl operator-(const polynomial_tpl& op1, const polynomial_tpl& op2) - { - polynomial_tpl res; - int i; - for (i = 0; i <= min(degree1, degree2); i++) - { - res.data[i] = op1.data[i] * op2.denom - op2.data[i] * op1.denom; - } - for (; i <= degree1; i++) - { - res.data[i] = op1.data[i] * op2.denom; - } - for (; i <= degree2; i++) - { - res.data[i] = op2.data[i] * op1.denom; - } - res.denom = op1.denom * op2.denom; - return res; - } - - template - AZ_FORCE_INLINE polynomial_tpl& operator+=(polynomial_tpl& op1, const polynomial_tpl& op2) - { - for (int i = 0; i < min(degree1, degree2); i++) - { - op1.data[i] = op1.data[i] * op2.denom + op2.data[i] * op1.denom; - } - op1.denom *= op2.denom; - return op1; - } - template - AZ_FORCE_INLINE polynomial_tpl& operator-=(polynomial_tpl& op1, const polynomial_tpl& op2) - { - for (int i = 0; i < min(degree1, degree2); i++) - { - op1.data[i] = op1.data[i] * op2.denom - op2.data[i] * op1.denom; - } - op1.denom *= op2.denom; - return op1; - } - - template - AZ_FORCE_INLINE polynomial_tpl operator*(const polynomial_tpl& op1, const polynomial_tpl& op2) - { - polynomial_tpl res; - res.zero(); - int j; - switch (degree1) - { - case 8: - for (j = 0; j <= degree2; j++) - { - res.data[8 + j] += op1.data[8] * op2.data[j]; - } - case 7: - for (j = 0; j <= degree2; j++) - { - res.data[7 + j] += op1.data[7] * op2.data[j]; - } - case 6: - for (j = 0; j <= degree2; j++) - { - res.data[6 + j] += op1.data[6] * op2.data[j]; - } - case 5: - for (j = 0; j <= degree2; j++) - { - res.data[5 + j] += op1.data[5] * op2.data[j]; - } - case 4: - for (j = 0; j <= degree2; j++) - { - res.data[4 + j] += op1.data[4] * op2.data[j]; - } - case 3: - for (j = 0; j <= degree2; j++) - { - res.data[3 + j] += op1.data[3] * op2.data[j]; - } - case 2: - for (j = 0; j <= degree2; j++) - { - res.data[2 + j] += op1.data[2] * op2.data[j]; - } - case 1: - for (j = 0; j <= degree2; j++) - { - res.data[1 + j] += op1.data[1] * op2.data[j]; - } - case 0: - for (j = 0; j <= degree2; j++) - { - res.data[0 + j] += op1.data[0] * op2.data[j]; - } - } - res.denom = op1.denom * op2.denom; - return res; - } - - - template - AZ_FORCE_INLINE void polynomial_divide(const polynomial_tpl& num, const polynomial_tpl& den, polynomial_tpl& quot, - polynomial_tpl& rem, int degree1, int degree2) - { - int i, j, k, l; - ftype maxel; - for (i = 0; i <= degree1; i++) - { - rem.data[i] = num.data[i]; - } - for (i = 0; i <= degree1 - degree2; i++) - { - quot.data[i] = 0; - } - for (i = 1, maxel = fabs_tpl(num.data[0]); i <= degree1; i++) - { - maxel = max(maxel, num.data[i]); - } - for (maxel *= polye(); degree1 >= 0 && fabs_tpl(num.data[degree1]) < maxel; degree1--) - { - ; - } - for (i = 1, maxel = fabs_tpl(den.data[0]); i <= degree2; i++) - { - maxel = max(maxel, den.data[i]); - } - for (maxel *= polye(); degree2 >= 0 && fabs_tpl(den.data[degree2]) < maxel; degree2--) - { - ; - } - rem.denom = num.denom; - quot.denom = (ftype)1; - if (degree1 < 0 || degree2 < 0) - { - return; - } - - for (k = degree1 - degree2, l = degree1; l >= degree2; l--, k--) - { - quot.data[k] = rem.data[l] * den.denom; - quot.denom *= den.data[degree2]; - for (i = degree1 - degree2; i > k; i--) - { - quot.data[i] *= den.data[degree2]; - } - for (i = degree2 - 1, j = l - 1; i >= 0; i--, j--) - { - rem.data[j] = rem.data[j] * den.data[degree2] - den.data[i] * rem.data[l]; - } - for (; j >= 0; j--) - { - rem.data[j] *= den.data[degree2]; - } - rem.denom *= den.data[degree2]; - } - } - - template - AZ_FORCE_INLINE polynomial_tpl operator/(const polynomial_tpl& num, const polynomial_tpl& den) - { - polynomial_tpl quot; - polynomial_tpl rem; - polynomial_divide((polynomial_tpl&)num, (polynomial_tpl&)den, (polynomial_tpl&)quot, - (polynomial_tpl&)rem, degree1, degree2); - return quot; - } - template - AZ_FORCE_INLINE polynomial_tpl operator%(const polynomial_tpl& num, const polynomial_tpl& den) - { - polynomial_tpl quot; - polynomial_tpl rem; - polynomial_divide((polynomial_tpl&)num, (polynomial_tpl&)den, (polynomial_tpl&)quot, - (polynomial_tpl&)rem, degree1, degree2); - return (polynomial_tpl&)rem; - } - - template - AZ_FORCE_INLINE void polynomial_tpl::calc_deriviative(polynomial_tpl& deriv, int curdegree) const - { - for (int i = 0; i < curdegree; i++) - { - deriv.data[i] = data[i + 1] * (i + 1); - } - deriv.denom = denom; - } - - template - to_t* convert_type(from_t* input) - { - typedef union - { - to_t* to; - from_t* from; - } convert_union; - convert_union u; - u.from = input; - return u.to; - } - - template - AZ_FORCE_INLINE int polynomial_tpl::nroots(ftype start, ftype end) const - { - polynomial_tpl f[degree + 1]; - int i, j, sg_a, sg_b; - ftype val, prevval; - - calc_deriviative(f[0]); - polynomial_divide(*convert_type >(this), *convert_type< polynomial_tpl >(&f[0]), *convert_type >(&f[degree]), - *convert_type >(&f[1]), degree, degree - 1); - f[1].denom = -f[1].denom; - for (i = 2; i < degree; i++) - { - polynomial_divide(*convert_type >(&f[i - 2]), *convert_type >(&f[i - 1]), *convert_type >(&f[degree]), - *convert_type >(&f[i]), degree + 1 - i, degree - i); - f[i].denom = -f[i].denom; - if (fabs_tpl(f[i].denom) > (ftype)1E10) - { - for (j = 0; j <= degree - 1 - i; j++) - { - f[i].data[j] *= (ftype)1E-10; - } - f[i].denom *= (ftype)1E-10; - } - } - - prevval = eval(start) * denom; - for (i = sg_a = 0; i < degree; i++, prevval = val) - { - val = f[i].eval(start, degree - 1 - i) * f[i].denom; - sg_a += isneg(val * prevval); - } - - prevval = eval(end) * denom; - for (i = sg_b = 0; i < degree; i++, prevval = val) - { - val = f[i].eval(end, degree - 1 - i) * f[i].denom; - sg_b += isneg(val * prevval); - } - - return fabs_tpl(sg_a - sg_b); - } - - template - AZ_FORCE_INLINE ftype cubert_tpl(ftype x) { return fabs_tpl(x) > (ftype)1E-20 ? exp_tpl(log_tpl(fabs_tpl(x)) * (ftype)(1.0 / 3)) * sgnnz(x) : x; } - template - AZ_FORCE_INLINE ftype pow_tpl(ftype x, ftype pow) { return fabs_tpl(x) > (ftype)1E-20 ? exp_tpl(log_tpl(fabs_tpl(x)) * pow) * sgnnz(x) : x; } - template - AZ_FORCE_INLINE void swap(ftype* ptr, int i, int j) { ftype t = ptr[i]; ptr[i] = ptr[j]; ptr[j] = t; } - - template - int polynomial_tpl::findroots(ftype start, ftype end, ftype* proots, [[maybe_unused]] int nIters, int degree, bool noDegreeCheck) const - { - AZ_UNUSED(nIters); - int i, j, nRoots = 0; - ftype maxel; - if (!noDegreeCheck) - { - for (i = 1, maxel = fabs_tpl(data[0]); i <= degree; i++) - { - maxel = max(maxel, data[i]); - } - for (maxel *= polye(); degree > 0 && fabs_tpl(data[degree]) <= maxel; degree--) - { - ; - } - } - - if constexpr (maxdegree >= 1) - { - if (degree == 1) - { - proots[0] = data[0] / data[1]; - nRoots = 1; - } - } - - if constexpr (maxdegree >= 2) - { - if (degree == 2) - { - ftype a, b, c, d, bound[2], sg; - - a = data[2]; - b = data[1]; - c = data[0]; - d = aznumeric_cast(sgnnz(a)); - a *= d; - b *= d; - c *= d; - d = b * b - a * c * 4; - bound[0] = start * a * 2 + b; - bound[1] = end * a * 2 + b; - sg = aznumeric_cast((sgnnz(bound[0] * bound[1]) + 1) >> 1); - bound[0] *= bound[0]; - bound[1] *= bound[1]; - bound[isneg(fabs_tpl(bound[1]) - fabs_tpl(bound[0]))] *= sg; - - if (isnonneg(d) & inrange(d, bound[0], bound[1])) - { - d = sqrt_tpl(d); - a = (ftype)0.5 / a; - proots[nRoots] = (-b - d) * a; - nRoots += inrange(proots[nRoots], start, end); - proots[nRoots] = (-b + d) * a; - nRoots += inrange(proots[nRoots], start, end); - } - } - } - - if constexpr (maxdegree >= 3) - { - if (degree == 3) - { - ftype t, a, b, c, a3, p, q, Q, Qr, Ar, Ai, phi; - - t = (ftype)1.0 / data[3]; - a = data[2] * t; - b = data[1] * t; - c = data[0] * t; - a3 = a * (ftype)(1.0 / 3); - p = b - a * a3; - q = (a3 * b - c) * (ftype)0.5 - cube(a3); - Q = cube(p * (ftype)(1.0 / 3)) + q * q; - Qr = sqrt_tpl(fabs_tpl(Q)); - - if (Q > 0) - { - proots[0] = cubert_tpl(q + Qr) + cubert_tpl(q - Qr) - a3; - nRoots = 1; - } - else - { - phi = atan2_tpl(Qr, q) * (ftype)(1.0 / 3); - t = pow_tpl(Qr * Qr + q * q, (ftype)(1.0 / 6)); - Ar = t * cos_tpl(phi); - Ai = t * sin_tpl(phi); - proots[0] = 2 * Ar - a3; - proots[1] = aznumeric_cast(-Ar + Ai * sqrt3 - a3); - proots[2] = aznumeric_cast(-Ar - Ai * sqrt3 - a3); - i = idxmax3(proots); - swap(proots, i, 2); - i = isneg(proots[0] - proots[1]); - swap(proots, i, 1); - nRoots = 3; - } - } - } - - if constexpr (maxdegree >= 4) - { - if (degree == 4) - { - ftype t, a3, a2, a1, a0, y, R, D, E, subroots[3]; - const ftype e = (ftype)1E-9; - - t = (ftype)1.0 / data[4]; - a3 = data[3] * t; - a2 = data[2] * t; - a1 = data[1] * t; - a0 = data[0] * t; - polynomial_tpl p3aux; - ftype kp3aux[] = { 1, -a2, a1 * a3 - 4 * a0, 4 * a2 * a0 - a1 * a1 - a3 * a3 * a0 }; - p3aux.set(kp3aux); - if (!p3aux.findroots((ftype)-1E20, (ftype)1E20, subroots)) - { - return 0; - } - R = a3 * a3 * (ftype)0.25 - a2 + (y = subroots[0]); - - if (R > -e) - { - if (R < e) - { - D = E = a3 * a3 * (ftype)(3.0 / 4) - 2 * a2; - t = y * y - 4 * a0; - if (t < -e) - { - return 0; - } - t = 2 * sqrt_tpl(max((ftype)0, t)); - } - else - { - R = sqrt_tpl(max((ftype)0, R)); - D = E = a3 * a3 * (ftype)(3.0 / 4) - R * R - 2 * a2; - t = (4 * a3 * a2 - 8 * a1 - a3 * a3 * a3) / R * (ftype)0.25; - } - if (D + t > -e) - { - D = sqrt_tpl(max((ftype)0, D + t)); - proots[nRoots++] = a3 * (ftype)-0.25 + (R - D) * (ftype)0.5; - proots[nRoots++] = a3 * (ftype)-0.25 + (R + D) * (ftype)0.5; - } - if (E - t > -e) - { - E = sqrt_tpl(max((ftype)0, E - t)); - proots[nRoots++] = a3 * (ftype)-0.25 - (R + E) * (ftype)0.5; - proots[nRoots++] = a3 * (ftype)-0.25 - (R - E) * (ftype)0.5; - } - if (nRoots == 4) - { - i = idxmax3(proots); - if (proots[3] < proots[i]) - { - swap(proots, i, 3); - } - i = idxmax3(proots); - swap(proots, i, 2); - i = isneg(proots[0] - proots[1]); - swap(proots, i, 1); - } - } - } - } - - if constexpr (maxdegree > 4) - { - if (degree > 4) - { - ftype roots[maxdegree + 1], prevroot, val, prevval[2], curval, bound[2], middle; - polynomial_tpl deriv; - int nExtremes, iter, iBound; - calc_deriviative(deriv); - - // find a subset of deriviative extremes between start and end - for (nExtremes = deriv.findroots(start, end, roots + 1, nIters, degree - 1) + 1; nExtremes > 1 && roots[nExtremes - 1] > end; nExtremes--) - { - ; - } - for (i = 1; i < nExtremes && roots[i] < start; i++) - { - ; - } - roots[i - 1] = start; - PREFAST_ASSUME(nExtremes < maxdegree + 1); - roots[nExtremes++] = end; - - for (prevroot = start, prevval[0] = eval(start, degree), nRoots = 0; i < nExtremes; prevval[0] = val, prevroot = roots[i++]) - { - val = eval(roots[i], degree); - if (val * prevval[0] < 0) - { - // we have exactly one root between prevroot and roots[i] - bound[0] = prevroot; - bound[1] = roots[i]; - iter = 0; - do - { - middle = (bound[0] + bound[1]) * (ftype)0.5; - curval = eval(middle, degree); - iBound = isneg(prevval[0] * curval); - bound[iBound] = middle; - prevval[iBound] = curval; - } while (++iter < nIters); - proots[nRoots++] = middle; - } - } - } - } - - for (i = 0; i < nRoots && proots[i] < start; i++) - { - ; - } - for (; nRoots > i&& proots[nRoots - 1] > end; nRoots--) - { - ; - } - for (j = i; j < nRoots; j++) - { - proots[j - i] = proots[j]; - } - - return nRoots - i; - } - } // namespace polynomial_tpl_IMPL - template - using polynomial_tpl = polynomial_tpl_IMPL::polynomial_tpl; - - typedef polynomial_tpl P3; - typedef polynomial_tpl P2; - typedef polynomial_tpl P1; - typedef polynomial_tpl P3f; - typedef polynomial_tpl P2f; - typedef polynomial_tpl P1f; -} // namespace LegacyCryPhysicsUtils From 28adecf8b37557a5d2e0e40654e2519899b43ed5 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 17 Nov 2021 19:22:19 -0800 Subject: [PATCH 169/620] Removes DisplayContext.cpp and Cry_Legacy_PhysUtils.h from Code/Editor/Plugins/EditorCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h | 0 Code/Editor/Plugins/EditorCommon/DisplayContext.cpp | 9 --------- .../Editor/Plugins/EditorCommon/editorcommon_files.cmake | 1 - 3 files changed, 10 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h delete mode 100644 Code/Editor/Plugins/EditorCommon/DisplayContext.cpp diff --git a/Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h b/Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Code/Editor/Plugins/EditorCommon/DisplayContext.cpp b/Code/Editor/Plugins/EditorCommon/DisplayContext.cpp deleted file mode 100644 index f0a82ba13c..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DisplayContext.cpp +++ /dev/null @@ -1,9 +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 - * - */ - -#include "../../Editor/Objects/DisplayContextShared.inl" diff --git a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake index 511418efc7..a198bb0b4d 100644 --- a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake +++ b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake @@ -17,7 +17,6 @@ set(FILES DockTitleBarWidget.h SaveUtilities/AsyncSaveRunner.h SaveUtilities/AsyncSaveRunner.cpp - DisplayContext.cpp Resource.h WinWidget/WinWidget.h WinWidget/WinWidgetManager.h From 3f5b17b7925780a8ce6fa25593b96918ee6420e7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 13:59:43 -0800 Subject: [PATCH 170/620] =?UTF-8?q?=EF=BB=BFRemoves=20WinWidget=20from=20C?= =?UTF-8?q?ode/Editor/Plugins/EditorCommon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/IEditor.h | 9 --- Code/Editor/IEditorImpl.cpp | 19 ----- Code/Editor/IEditorImpl.h | 9 --- Code/Editor/Lib/Tests/IEditorMock.h | 2 - Code/Editor/Plugins/EditorCommon/Resource.h | 26 ------- .../EditorCommon/WinWidget/WinWidget.h | 59 ---------------- .../WinWidget/WinWidgetManager.cpp | 70 ------------------- .../EditorCommon/WinWidget/WinWidgetManager.h | 41 ----------- .../EditorCommon/editorcommon_files.cmake | 4 -- 9 files changed, 239 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/Resource.h delete mode 100644 Code/Editor/Plugins/EditorCommon/WinWidget/WinWidget.h delete mode 100644 Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.cpp delete mode 100644 Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.h diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index fa20481192..0ba24ac46a 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -66,11 +66,6 @@ struct SEditorSettings; class CGameExporter; class IAWSResourceManager; -namespace WinWidget -{ - class WinWidgetManager; -} - struct ISystem; struct IRenderer; struct AABB; @@ -586,10 +581,6 @@ struct IEditor virtual bool SetViewFocus(const char* sViewClassName) = 0; virtual void CloseView(const GUID& classId) = 0; // close ALL panels related to classId, used when unloading plugins. - // We want to open a view object but not wrap it in a view pane) - virtual QWidget* OpenWinWidget(WinWidgetId openId) = 0; - virtual WinWidget::WinWidgetManager* GetWinWidgetManager() const = 0; - //! Opens standard color selection dialog. //! Initialized with the color specified in color parameter. //! Returns true if selection is made and false if selection is canceled. diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index 38006c6fca..fc18e1f4c3 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -75,9 +75,6 @@ AZ_POP_DISABLE_WARNING #include "Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.h" #include "Editor/AssetEditor/AssetEditorRequestsHandler.h" -// EditorCommon -#include - // AWSNativeSDK #include @@ -177,8 +174,6 @@ CEditorImpl::CEditorImpl() DetectVersion(); RegisterTools(); - m_winWidgetManager.reset(new WinWidget::WinWidgetManager); - m_pAssetDatabaseLocationListener = nullptr; m_pAssetBrowserRequestHandler = nullptr; m_assetEditorRequestsHandler = nullptr; @@ -847,20 +842,6 @@ const QtViewPane* CEditorImpl::OpenView(QString sViewClassName, bool reuseOpened return QtViewPaneManager::instance()->OpenPane(sViewClassName, openMode); } -QWidget* CEditorImpl::OpenWinWidget(WinWidgetId openId) -{ - if (m_winWidgetManager) - { - return m_winWidgetManager->OpenWinWidget(openId); - } - return nullptr; -} - -WinWidget::WinWidgetManager* CEditorImpl::GetWinWidgetManager() const -{ - return m_winWidgetManager.get(); -} - QWidget* CEditorImpl::FindView(QString viewClassName) { return QtViewPaneManager::instance()->GetView(viewClassName); diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h index 7867912941..f53b1b84d5 100644 --- a/Code/Editor/IEditorImpl.h +++ b/Code/Editor/IEditorImpl.h @@ -53,11 +53,6 @@ namespace Editor class EditorQtApplication; } -namespace WinWidget -{ - class WinWidgetManager; -} - namespace AssetDatabase { class AssetDatabaseLocationListener; @@ -221,9 +216,6 @@ public: bool CloseView(const char* sViewClassName) override; bool SetViewFocus(const char* sViewClassName) override; - QWidget* OpenWinWidget(WinWidgetId openId) override; - WinWidget::WinWidgetManager* GetWinWidgetManager() const override; - // close ALL panels related to classId, used when unloading plugins. void CloseView(const GUID& classId) override; bool SelectColor(QColor &color, QWidget *parent = 0) override; @@ -370,7 +362,6 @@ protected: QString m_levelNameBuffer; IAWSResourceManager* m_awsResourceManager; - std::unique_ptr m_winWidgetManager; //! True if the editor is in material edit mode. Fast preview of materials. //! In this mode only very limited functionality is available. diff --git a/Code/Editor/Lib/Tests/IEditorMock.h b/Code/Editor/Lib/Tests/IEditorMock.h index aaee34c2c6..b2f7e2627f 100644 --- a/Code/Editor/Lib/Tests/IEditorMock.h +++ b/Code/Editor/Lib/Tests/IEditorMock.h @@ -128,8 +128,6 @@ public: MOCK_METHOD1(CloseView, bool(const char* )); MOCK_METHOD1(SetViewFocus, bool(const char* )); MOCK_METHOD1(CloseView, void(const GUID& )); - MOCK_METHOD1(OpenWinWidget, QWidget* (WinWidgetId )); - MOCK_CONST_METHOD0(GetWinWidgetManager, WinWidget::WinWidgetManager* ()); MOCK_METHOD2(SelectColor, bool(QColor &, QWidget *)); MOCK_METHOD0(GetUndoManager, class CUndoManager* ()); MOCK_METHOD0(BeginUndo, void()); diff --git a/Code/Editor/Plugins/EditorCommon/Resource.h b/Code/Editor/Plugins/EditorCommon/Resource.h deleted file mode 100644 index d1acef6314..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Resource.h +++ /dev/null @@ -1,26 +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 - * - */ - - - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by EditorCommon.rc -// - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS - -#define _APS_NEXT_RESOURCE_VALUE 1000 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 1000 -#define _APS_NEXT_COMMAND_VALUE 32771 -#endif -#endif diff --git a/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidget.h b/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidget.h deleted file mode 100644 index 06e84c1405..0000000000 --- a/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidget.h +++ /dev/null @@ -1,59 +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 - * - */ - - -#pragma once - -#include "EditorCommonAPI.h" -#include "IEditor.h" - - -#include -#include -#include - -namespace WinWidget -{ - template - bool RegisterWinWidget() - { - static QWidget* winWidget {nullptr}; // Must declare outside of lambda - - WinWidget::WinWidgetManager::WinWidgetCreateCall createCall = []() -> QWidget* - { - if (!winWidget) - { - winWidget = new QWidget(GetIEditor()->GetEditorMainWindow()); - } - - // Ensure only one instance of each window type exists - QList existingWidgets = winWidget->findChildren(); - if (existingWidgets.size() > 0) // Note that the list should contain 0 or 1 entries - { - if (existingWidgets.first()->isVisible()) - { - return nullptr; // TWidget type already in use - continue using it and don't create another - } - delete existingWidgets.first(); // Closed TWidget - remove - } - - TWidget* createWidget = new TWidget(winWidget); - - createWidget->Display(); - return winWidget; - }; - - return GetIEditor()->GetWinWidgetManager()->RegisterWinWidget(TWidget::GetWWId(), createCall); - } - - template - void UnregisterWinWidget() - { - GetIEditor()->GetWinWidgetManager()->UnregisterWinWidget(TWidget::GetWWId()); - } -} diff --git a/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.cpp b/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.cpp deleted file mode 100644 index 3ffa1b1b99..0000000000 --- a/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.cpp +++ /dev/null @@ -1,70 +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 - * - */ - -#include - -namespace WinWidget -{ - WinWidgetManager::WinWidgetManager() - : m_createCalls(size_t(WinWidgetId::NUM_WIN_WIDGET_IDS) + 1) - { - } - - size_t WinWidgetManager::GetIndexForId(WinWidgetId thisId) const - { - size_t thisIndex = static_cast(thisId); - if (thisIndex >= m_createCalls.size()) - { - return 0; - } - return thisIndex; - } - - WinWidgetManager::WinWidgetCreateCall WinWidgetManager::GetCreateCall(WinWidgetId thisId) const - { - size_t thisIndex = GetIndexForId(thisId); - if (!thisIndex) - { - return nullptr; - } - return m_createCalls[thisIndex]; - } - - bool WinWidgetManager::RegisterWinWidget(WinWidgetId thisId, WinWidgetCreateCall createCall) - { - size_t thisIndex = GetIndexForId(thisId); - if (m_createCalls[thisIndex] != nullptr) - { - return false; - } - m_createCalls[thisIndex] = createCall; - return true; - } - - bool WinWidgetManager::UnregisterWinWidget(WinWidgetId thisId) - { - size_t thisIndex = GetIndexForId(thisId); - if (m_createCalls[thisIndex] == nullptr) - { - return false; - } - m_createCalls[thisIndex] = nullptr; - return true; - } - - - QWidget* WinWidgetManager::OpenWinWidget(WinWidgetId createId) const - { - WinWidgetManager::WinWidgetCreateCall createCall = GetCreateCall(createId); - if (!createCall) - { - return nullptr; - } - return createCall(); - } -} diff --git a/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.h b/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.h deleted file mode 100644 index 968f3ea6d2..0000000000 --- a/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.h +++ /dev/null @@ -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 - * - */ - -#pragma once - -#include -#include "EditorCommonAPI.h" - -#include -#include - -class QWidget; - -namespace WinWidget -{ - class EDITOR_COMMON_API WinWidgetManager - { - public: - using WinWidgetCreateCall = std::function; - - WinWidgetManager(); - ~WinWidgetManager() {} - - bool RegisterWinWidget(WinWidgetId thisId, WinWidgetCreateCall createCall); - bool UnregisterWinWidget(WinWidgetId thisId); - - QWidget* OpenWinWidget(WinWidgetId) const; - private: - WinWidgetCreateCall GetCreateCall(WinWidgetId thisId) const; - size_t GetIndexForId(WinWidgetId thisId) const; - - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - std::vector m_createCalls; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - }; -} diff --git a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake index a198bb0b4d..031d8765ff 100644 --- a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake +++ b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake @@ -17,8 +17,4 @@ set(FILES DockTitleBarWidget.h SaveUtilities/AsyncSaveRunner.h SaveUtilities/AsyncSaveRunner.cpp - Resource.h - WinWidget/WinWidget.h - WinWidget/WinWidgetManager.h - WinWidget/WinWidgetManager.cpp ) From ac4ce8983bf6d406ef26274737931ba7db0ca14e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 14:11:33 -0800 Subject: [PATCH 171/620] Removes unused resource files Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Launcher/editor_launcher.rc | 2 - Code/Editor/Launcher/resource.h | 9 --- .../ComponentEntityEditorPlugin.mf | 3 - .../Plugins/EditorCommon/EditorCommon.rc | Bin 2326 -> 0 bytes .../EditorCommon/Icons/CurveEditor/auto.png | 3 - .../EditorCommon/Icons/CurveEditor/break.png | 3 - .../Icons/CurveEditor/fit_horizontal.png | 3 - .../Icons/CurveEditor/fit_vertical.png | 3 - .../Icons/CurveEditor/linear_in.png | 3 - .../Icons/CurveEditor/linear_out.png | 3 - .../Icons/CurveEditor/step_in.png | 3 - .../Icons/CurveEditor/step_out.png | 3 - .../EditorCommon/Icons/CurveEditor/unify.png | 3 - .../Icons/CurveEditor/zero_in.png | 3 - .../Icons/CurveEditor/zero_out.png | 3 - .../EditorCommon/editorcommon_files.cmake | 1 - .../Plugins/PerforcePlugin/PerforcePlugin.qrc | 4 - .../Plugins/PerforcePlugin/PerforcePlugin.rc | 71 ------------------ .../PerforcePlugin/perforceplugin_files.cmake | 2 - Code/Editor/Plugins/PerforcePlugin/resource.h | 23 ------ 20 files changed, 148 deletions(-) delete mode 100644 Code/Editor/Launcher/editor_launcher.rc delete mode 100644 Code/Editor/Launcher/resource.h delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.mf delete mode 100644 Code/Editor/Plugins/EditorCommon/EditorCommon.rc delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/auto.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/break.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_horizontal.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_vertical.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_in.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_out.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_in.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_out.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/unify.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_in.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_out.png delete mode 100644 Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.qrc delete mode 100644 Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.rc delete mode 100644 Code/Editor/Plugins/PerforcePlugin/resource.h diff --git a/Code/Editor/Launcher/editor_launcher.rc b/Code/Editor/Launcher/editor_launcher.rc deleted file mode 100644 index 26dad7a3da..0000000000 --- a/Code/Editor/Launcher/editor_launcher.rc +++ /dev/null @@ -1,2 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "..\\res\\lyeditor.ico" - diff --git a/Code/Editor/Launcher/resource.h b/Code/Editor/Launcher/resource.h deleted file mode 100644 index 1be83bd298..0000000000 --- a/Code/Editor/Launcher/resource.h +++ /dev/null @@ -1,9 +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 - * - */ - -#define IDI_ICON1 2 diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.mf b/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.mf deleted file mode 100644 index 997209477a..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.mf +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Code/Editor/Plugins/EditorCommon/EditorCommon.rc b/Code/Editor/Plugins/EditorCommon/EditorCommon.rc deleted file mode 100644 index 77deebb598990e925cf97758d98877e71ec79872..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2326 zcmd6p%Wm306o${5r?8w&t5)2aO_n7#77Br=5TmXTL_`8MB~VS*=s3R0z3 z)_6Q~?*F;K?_VV;Ng%f}lcB6+A#2t|Hr%D$t>sAuGUs$HA9wXMDjn%Vi$SU*4QUf;pS>k@zJu4t z=Wz6bq1WMWqQU3c$?8`H#LC;Hxar*;Hro<`>$P-`Nbk!zYju;C1g~$&OGj?dXrrm) zdxI#BbJ|*&m@1hd*T;)kYIu?u-}WW*x_#~oaGite_^4!AeiC~Vy7FdNozVk|fwR-b zf3=`{AMCrldnOAJcRg-DN!63+%2)8yT1?TR{1Fz^#!hR8cxupm&MLh3*tlV-?iMmN zG$qEK&5UNJhPF1DQCvej*qDyX=+HX;&xxc#EEB3p`^jbdkft3iudytbpmN2!#8%nU zvXj{N%hBAPlKmzTDHb9AF65E9Fu=EGVjFN8bFcksso6G?Z%l~|+}aa?`O^0T+yQYf zO{M~Hk2uF@o0{pM)H`Gr@*R#L68Y$zPj2^pbGSuF<|ml#$h?n_c&%OfCr@HiOE!uC z3^pb+Gxld>ZAF~#pFb(AUoN7MPA-xyyDDcyuhpUxeZ{Ub-_MQJAA+=YhmFYQ(jrmh ze$I1xG)-(xjV0By1QGqkn37@5*{&XZN+9pZ>U+>rsee~1?X9=^i>7F~+R>A%=)Z}U zt?3axp*8L2CZr#<546Mb`8hoozV^fQbxLK$coyZR&D*m-vr@2Hy&`w+wDNnmizb~Z bYjUCgO!7Tz=ewO|_J2W@4k;h-)B5`YCMh&c diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/auto.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/auto.png deleted file mode 100644 index 4009c4110c..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/auto.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3e60156229cc8677e0294d297486f04bd78867ef4e0922b35444c8b45f78584d -size 1090 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/break.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/break.png deleted file mode 100644 index 75399a536a..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/break.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd29a16a1d1d9a363e4b154d51910c2cba2787fbbe1360cfd107b393053d2e49 -size 1226 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_horizontal.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_horizontal.png deleted file mode 100644 index fee50a459c..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_horizontal.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:244005cde119238bbfc2815f36a343c6135c3233d0b72a5c97a6080604568e8f -size 1160 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_vertical.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_vertical.png deleted file mode 100644 index 9a067e6980..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_vertical.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33176a8ea6b0798adf1114fdbea4b0f5c708f40c3d48a047b1cb0fa6ebcbbded -size 1181 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_in.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_in.png deleted file mode 100644 index 1ba6d72859..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_in.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c122557745cc377768491ce59c5b5b17e54671aa59f7f87101766aa61758959e -size 939 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_out.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_out.png deleted file mode 100644 index 58694e0c4f..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_out.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3c2a360a56a37bfae2bea16b495f5b6ee482caa28d0949e8eadea48fdaae654f -size 845 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_in.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_in.png deleted file mode 100644 index d1a2238790..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_in.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:eb0f43228bdb5246ea3bfde0726f07e0df0468279610ba4c801b21e264b33123 -size 765 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_out.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_out.png deleted file mode 100644 index 910db1aeb3..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_out.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:97a2e879222323bc70787efbe2cbc1c47bbabb7b10df8465857e600a9084abb2 -size 795 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/unify.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/unify.png deleted file mode 100644 index 5a8a5105d7..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/unify.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:58e8476b7bec1ed8eddfde3d5228f58fcfba11329318f5dfef3d98eb99f3a897 -size 1113 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_in.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_in.png deleted file mode 100644 index d43d881d45..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_in.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a7847e8b7f3dd76395d893888916e4bd97ddf3f678d37d19836da04c2923791e -size 871 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_out.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_out.png deleted file mode 100644 index f287d1c7af..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_out.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:470266956c6911690299f29539c400122ae707f88d9b6ba3516faf196a8fd571 -size 877 diff --git a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake index 031d8765ff..1ae1f51632 100644 --- a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake +++ b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake @@ -9,7 +9,6 @@ set(FILES EditorCommon.h EditorCommon.cpp - EditorCommon.rc EditorCommonAPI.h ActionOutput.h ActionOutput.cpp diff --git a/Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.qrc b/Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.qrc deleted file mode 100644 index d378e6b5e4..0000000000 --- a/Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.qrc +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.rc b/Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.rc deleted file mode 100644 index 26e4bbda6b..0000000000 --- a/Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.rc +++ /dev/null @@ -1,71 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_P4 ICON "res\\p4.ico" -IDI_P4_ERROR ICON "res\\p4_error.ico" -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/Code/Editor/Plugins/PerforcePlugin/perforceplugin_files.cmake b/Code/Editor/Plugins/PerforcePlugin/perforceplugin_files.cmake index 7932c01015..5302a9f718 100644 --- a/Code/Editor/Plugins/PerforcePlugin/perforceplugin_files.cmake +++ b/Code/Editor/Plugins/PerforcePlugin/perforceplugin_files.cmake @@ -13,8 +13,6 @@ set(FILES PasswordDlg.h PerforcePlugin.cpp PerforcePlugin.h - PerforcePlugin.qrc PerforceSourceControl.cpp PerforceSourceControl.h - resource.h ) diff --git a/Code/Editor/Plugins/PerforcePlugin/resource.h b/Code/Editor/Plugins/PerforcePlugin/resource.h deleted file mode 100644 index bb41c2b1bd..0000000000 --- a/Code/Editor/Plugins/PerforcePlugin/resource.h +++ /dev/null @@ -1,23 +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 - * - */ - - -#define IDI_P4 104 -#define IDI_P4_ERROR 106 -#define IDC_ERROR 1004 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 107 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1010 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif From 0d94e5cb0def09dfcd7e707e060ab12ba36c9d83 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 14:21:32 -0800 Subject: [PATCH 172/620] Removes bitarray.h from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/EditorDefs.h | 1 - Code/Editor/Util/bitarray.h | 335 ----------------------------- Code/Editor/editor_lib_files.cmake | 1 - 3 files changed, 337 deletions(-) delete mode 100644 Code/Editor/Util/bitarray.h diff --git a/Code/Editor/EditorDefs.h b/Code/Editor/EditorDefs.h index 97c03b2b45..3abc3eb53c 100644 --- a/Code/Editor/EditorDefs.h +++ b/Code/Editor/EditorDefs.h @@ -123,7 +123,6 @@ #include "Util/XmlTemplate.h" // Utility classes. -#include "Util/bitarray.h" #include "Util/RefCountBase.h" #include "Util/TRefCountBase.h" #include "Util/MemoryBlock.h" diff --git a/Code/Editor/Util/bitarray.h b/Code/Editor/Util/bitarray.h deleted file mode 100644 index 5a887b02d5..0000000000 --- a/Code/Editor/Util/bitarray.h +++ /dev/null @@ -1,335 +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 : Array of m_bits. - - -#ifndef CRYINCLUDE_EDITOR_UTIL_BITARRAY_H -#define CRYINCLUDE_EDITOR_UTIL_BITARRAY_H -#pragma once - - -////////////////////////////////////////////////////////////////////////// -// -// CBitArray is similar to std::vector but faster to clear. -// -////////////////////////////////////////////////////////////////////////// -class CBitArray -{ -public: - struct BitReference - { - uint32* p; - uint32 mask; - BitReference(uint32* __x, uint32 __y) - : p(__x) - , mask(__y) {} - - - public: - BitReference() - : p(0) - , mask(0) {} - - operator bool() const { - return !(!(*p & mask)); - } - BitReference& operator=(bool __x) - { - if (__x) - { - * p |= mask; - } - else - { - * p &= ~mask; - } - return *this; - } - BitReference& operator=(const BitReference& __x) { return *this = bool(__x); } - bool operator==(const BitReference& __x) const { return bool(*this) == bool(__x); } - bool operator<(const BitReference& __x) const { return !bool(*this) && bool(__x); } - BitReference& operator |= (bool __x) - { - if (__x) - { - * p |= mask; - } - return *this; - } - BitReference& operator &= (bool __x) - { - if (!__x) - { - * p &= ~mask; - } - return *this; - } - void flip() {* p ^= mask; } - }; - - CBitArray() { m_base = nullptr; m_bits = nullptr; m_size = 0; m_numBits = 0; }; - CBitArray(int numBits) { resize(numBits); }; - ~CBitArray() - { - if (m_base) - { - free(m_base); - } - }; - - void resize(int c) - { - m_numBits = c; - int newSize = ((c + 63) & (~63)) >> 5; - if (newSize > m_size) - { - Alloc(newSize); - } - } - int size() const { return m_numBits; }; - bool empty() const { return m_numBits == 0; }; - - ////////////////////////////////////////////////////////////////////////// - void set() - { - memset(m_bits, 0xFFFFFFFF, m_size * sizeof(uint32)); // Set all bits. - } - ////////////////////////////////////////////////////////////////////////// - void set(int numBits) - { - int num = (numBits >> 3) + 1; - if (num > (m_size * sizeof(uint32))) - { - num = m_size * sizeof(uint32); - } - memset(m_bits, 0xFFFFFFFF, num); // Reset num bits. - } - - ////////////////////////////////////////////////////////////////////////// - void clear() - { - memset(m_bits, 0, m_size * sizeof(uint32)); // Reset all bits. - } - - ////////////////////////////////////////////////////////////////////////// - void clear(int numBits) - { - int num = (numBits >> 3) + 1; - if (num > (m_size * sizeof(uint32))) - { - num = m_size * sizeof(uint32); - } - memset(m_bits, 0, num); // Reset num bits. - } - - ////////////////////////////////////////////////////////////////////////// - // Check if all bits are 0. - bool is_zero() const - { - for (int i = 0; i < m_size; i++) - { - if (m_bits[i] != 0) - { - return false; - } - } - return true; - } - - // Count number of set bits. - int count_bits() const - { - int c = 0; - for (int i = 0; i < m_size; i++) - { - uint32 v = m_bits[i]; - for (int j = 0; j < 32; j++) - { - if (v & (1 << (j & 0x1F))) - { - c++; // if bit set increase bit count. - } - } - } - return c; - } - - BitReference operator[](int pos) { return BitReference(&m_bits[index(pos)], shift(pos)); } - const BitReference operator[](int pos) const { return BitReference(&m_bits[index(pos)], shift(pos)); } - - ////////////////////////////////////////////////////////////////////////// - void swap(CBitArray& bitarr) - { - std::swap(m_base, bitarr.m_base); - std::swap(m_bits, bitarr.m_bits); - std::swap(m_size, bitarr.m_size); - } - - CBitArray& operator =(const CBitArray& b) - { - if (m_size != b.m_size) - { - Alloc(b.m_size); - } - memcpy(m_bits, b.m_bits, m_size * sizeof(uint32)); - return *this; - } - - bool checkByte(int pos) const { return reinterpret_cast(m_bits)[pos] != 0; }; - - ////////////////////////////////////////////////////////////////////////// - // Compresses this bit array into the specified one. - // Uses run length encoding compression. - void compress(CBitArray& b) const - { - int i, countz, compsize, bsize; - char* out; - char* in; - - bsize = m_size * 4; - compsize = 0; - in = (char*)m_bits; - for (i = 0; i < bsize; i++) - { - compsize++; - if (in[i] == 0) - { - countz = 1; - while (++i < bsize) - { - if (in[i] == 0 && countz != 255) - { - countz++; - } - else - { - break; - } - } - i--; - compsize++; - } - } - b.resize((compsize + 1) << 3); - out = (char*)b.m_bits; - in = (char*)m_bits; - *out++ = static_cast(bsize); - for (i = 0; i < bsize; i++) - { - *out++ = in[i]; - if (in[i] == 0) - { - countz = 1; - while (++i < bsize) - { - if (in[i] == 0 && countz != 255) - { - countz++; - } - else - { - break; - } - } - i--; - *out++ = static_cast(countz); - } - } - } - - ////////////////////////////////////////////////////////////////////////// - // Decompress specified bit array in to this one. - // Uses run length encoding compression. - void decompress(CBitArray& b) - { - int raw, decompressed, c; - char* out, * in; - - in = (char*)m_bits; - out = (char*)b.m_bits; - decompressed = 0; - raw = *in++; - while (decompressed < raw) - { - if (*in != 0) - { - *out++ = *in++; - decompressed++; - } - else - { - in++; - c = *in++; - decompressed += c; - while (c) - { - *out++ = 0; - c--; - } - ; - } - } - m_numBits = decompressed; - } - - void CopyFromMem(const char* src, int size) - { - Alloc(size); - memcpy(m_bits, src, size); - } - int CopyToMem(char* trg) - { - memcpy(trg, m_bits, m_size); - return m_size; - } - -private: - void* m_base; - uint32* m_bits; - int m_size; - int m_numBits; - - void Alloc(int s) - { - if (m_base) - { - free(m_base); - } - m_size = s; - m_base = (char*)malloc(m_size * sizeof(uint32) + 32); - m_bits = (uint32*)(((UINT_PTR)m_base + 31) & (~31)); // align by 32. - memset(m_bits, 0, m_size * sizeof(uint32)); // Reset all bits. - } - uint32 shift(int pos) const - { - return (1 << (pos & 0x1F)); - } - uint32 index(int pos) const - { - return pos >> 5; - } - - friend int concatBitarray(CBitArray& b1, CBitArray& b2, CBitArray& test, CBitArray& res); -}; - -inline int concatBitarray(CBitArray& b1, CBitArray& b2, CBitArray& test, CBitArray& res) -{ - unsigned int b, any; - any = 0; - for (int i = 0; i < b1.size(); i++) - { - b = b1.m_bits[i] & b2.m_bits[i]; - any |= (b & (~test.m_bits[i])); // test if any different from test(i) bit set. - res.m_bits[i] = b; - } - return any; -} - -#endif // CRYINCLUDE_EDITOR_UTIL_BITARRAY_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index aa52b18b45..3bdd85beee 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -660,7 +660,6 @@ set(FILES Util/XmlArchive.h Util/XmlTemplate.cpp Util/XmlTemplate.h - Util/bitarray.h Util/fastlib.h Util/smartptr.h WaitProgress.cpp From 63aaa0cba452770aa1962dec967dc08170c00149 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 14:37:25 -0800 Subject: [PATCH 173/620] Removes DynamicArray2D from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/DynamicArray2D.cpp | 150 ---------------------------- Code/Editor/Util/DynamicArray2D.h | 37 ------- Code/Editor/editor_lib_files.cmake | 2 - 3 files changed, 189 deletions(-) delete mode 100644 Code/Editor/Util/DynamicArray2D.cpp delete mode 100644 Code/Editor/Util/DynamicArray2D.h diff --git a/Code/Editor/Util/DynamicArray2D.cpp b/Code/Editor/Util/DynamicArray2D.cpp deleted file mode 100644 index 3f09c557de..0000000000 --- a/Code/Editor/Util/DynamicArray2D.cpp +++ /dev/null @@ -1,150 +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 - * - */ - - -#include "EditorDefs.h" - -#include "DynamicArray2D.h" - -// Editor -#include "Util/fastlib.h" - -////////////////////////////////////////////////////////////////////// -// Construction / destruction -////////////////////////////////////////////////////////////////////// - -CDynamicArray2D::CDynamicArray2D(unsigned int iDimension1, unsigned int iDimension2) -{ - //////////////////////////////////////////////////////////////////////// - // Declare a 2D array on the free store - //////////////////////////////////////////////////////////////////////// - - unsigned int i; - - // Save the position of the array dimensions - m_Dimension1 = iDimension1; - m_Dimension2 = iDimension2; - - // First dimension - m_Array = new float* [m_Dimension1]; - assert(m_Array); - - // Second dimension - for (i = 0; i < m_Dimension1; ++i) - { - m_Array[i] = new float[m_Dimension2]; - - // Init all fields with 0 - memset(&m_Array[i][0], 0, m_Dimension2 * sizeof(float)); - } -} - -CDynamicArray2D::~CDynamicArray2D() -{ - //////////////////////////////////////////////////////////////////////// - // Remove the 2D array and all its sub arrays from the free store - //////////////////////////////////////////////////////////////////////// - - unsigned int i; - - for (i = 0; i < m_Dimension1; ++i) - { - delete [] m_Array[i]; - } - - delete [] m_Array; - m_Array = nullptr; -} - - -void CDynamicArray2D::ScaleImage(CDynamicArray2D* pDestination) -{ - //////////////////////////////////////////////////////////////////////// - // Scale an image stored (in an array class) to a new size - //////////////////////////////////////////////////////////////////////// - - unsigned int i, j, iOldWidth; - int iXSrcFl, iXSrcCe, iYSrcFl, iYSrcCe; - float fXSrc, fYSrc; - float fHeight[4]; - float fHeightWeight[4]; - float fHeightBottom; - float fHeightTop; - - assert(pDestination); - assert(pDestination->m_Dimension1 > 1); - - // Width has to be zero based, not a count - iOldWidth = m_Dimension1 - 1; - - // Loop trough each field of the new image and interpolate the value - // from the source heightmap - for (i = 0; i < pDestination->m_Dimension1; i++) - { - // Calculate the average source array position - fXSrc = i / (float) pDestination->m_Dimension1 * iOldWidth; - assert(fXSrc >= 0.0f && fXSrc <= iOldWidth); - - // Precalculate floor and ceiling values. Use fast asm integer floor and - // fast asm float / integer conversion - iXSrcFl = ifloor(fXSrc); - iXSrcCe = FloatToIntRet((float) ceil(fXSrc)); - - // Distribution between left and right height values - fHeightWeight[0] = (float) iXSrcCe - fXSrc; - fHeightWeight[1] = fXSrc - (float) iXSrcFl; - - // Avoid error when floor() and ceil() return the same value - if (fHeightWeight[0] == 0.0f && fHeightWeight[1] == 0.0f) - { - fHeightWeight[0] = 0.5f; - fHeightWeight[1] = 0.5f; - } - - for (j = 0; j < pDestination->m_Dimension1; j++) - { - // Calculate the average source array position - fYSrc = j / (float) pDestination->m_Dimension1 * iOldWidth; - assert(fYSrc >= 0.0f && fYSrc <= iOldWidth); - - // Precalculate floor and ceiling values. Use fast asm integer floor and - // fast asm float / integer conversion - iYSrcFl = ifloor(fYSrc); - iYSrcCe = FloatToIntRet((float) ceil(fYSrc)); - - // Get the four nearest height values - fHeight[0] = m_Array[iXSrcFl][iYSrcFl]; - fHeight[1] = m_Array[iXSrcCe][iYSrcFl]; - fHeight[2] = m_Array[iXSrcFl][iYSrcCe]; - fHeight[3] = m_Array[iXSrcCe][iYSrcCe]; - - // Calculate how much weight each height value has - - // Distribution between top and bottom height values - fHeightWeight[2] = (float) iYSrcCe - fYSrc; - fHeightWeight[3] = fYSrc - (float) iYSrcFl; - - // Avoid error when floor() and ceil() return the same value - if (fHeightWeight[2] == 0.0f && fHeightWeight[3] == 0.0f) - { - fHeightWeight[2] = 0.5f; - fHeightWeight[3] = 0.5f; - } - - // Interpolate between the four nearest height values - - // Get the height for the given X position trough interpolation between - // the left and the right height - fHeightBottom = (fHeight[0] * fHeightWeight[0] + fHeight[1] * fHeightWeight[1]); - fHeightTop = (fHeight[2] * fHeightWeight[0] + fHeight[3] * fHeightWeight[1]); - - // Set the new value in the destination heightmap - pDestination->m_Array[i][j] = fHeightBottom * fHeightWeight[2] + fHeightTop * fHeightWeight[3]; - } - } -} diff --git a/Code/Editor/Util/DynamicArray2D.h b/Code/Editor/Util/DynamicArray2D.h deleted file mode 100644 index 20d26d2d87..0000000000 --- a/Code/Editor/Util/DynamicArray2D.h +++ /dev/null @@ -1,37 +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 : Interface of the class CDynamicArray. - - -#ifndef CRYINCLUDE_EDITOR_UTIL_DYNAMICARRAY2D_H -#define CRYINCLUDE_EDITOR_UTIL_DYNAMICARRAY2D_H -#pragma once - - -class CDynamicArray2D -{ -public: - // constructor - CDynamicArray2D(unsigned int iDimension1, unsigned int iDimension2); - // destructor - virtual ~CDynamicArray2D(); - // - void ScaleImage(CDynamicArray2D* pDestination); - - - float** m_Array; // - -private: - - unsigned int m_Dimension1; // - unsigned int m_Dimension2; // -}; - -#endif // CRYINCLUDE_EDITOR_UTIL_DYNAMICARRAY2D_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 3bdd85beee..82cfe545b6 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -628,8 +628,6 @@ set(FILES Util/AutoDirectoryRestoreFileDialog.h Util/AutoDirectoryRestoreFileDialog.cpp Util/CryMemFile.h - Util/DynamicArray2D.cpp - Util/DynamicArray2D.h Util/EditorAutoLevelLoadTest.cpp Util/EditorAutoLevelLoadTest.h Util/EditorUtils.cpp From 821c352e6a83234b9feb8c280fc666bcb836967b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 17:17:39 -0800 Subject: [PATCH 174/620] Removes GdiUtil and cleanups GuidUtil from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Plugin.h | 39 ------- Code/Editor/Util/GdiUtil.cpp | 179 ----------------------------- Code/Editor/Util/GdiUtil.h | 54 --------- Code/Editor/Util/GuidUtil.cpp | 35 +++++- Code/Editor/Util/GuidUtil.h | 41 ------- Code/Editor/editor_lib_files.cmake | 2 - 6 files changed, 29 insertions(+), 321 deletions(-) delete mode 100644 Code/Editor/Util/GdiUtil.cpp delete mode 100644 Code/Editor/Util/GdiUtil.h diff --git a/Code/Editor/Plugin.h b/Code/Editor/Plugin.h index 5fa45ac140..dd2637f0e9 100644 --- a/Code/Editor/Plugin.h +++ b/Code/Editor/Plugin.h @@ -15,45 +15,6 @@ #include "Util/GuidUtil.h" #include -//! Derive from this class to decrease the amount of work for creating a new class description -//! Provides standard reference counter implementation for IUnknown -class CRefCountClassDesc - : public IClassDesc -{ -public: - virtual ~CRefCountClassDesc() { } - HRESULT STDMETHODCALLTYPE QueryInterface([[maybe_unused]] const IID& riid, [[maybe_unused]] void** ppvObj) - { - return E_NOINTERFACE; - } - - ULONG STDMETHODCALLTYPE AddRef() - { - ++m_nRefCount; - return m_nRefCount; - } - - ULONG STDMETHODCALLTYPE Release() - { - int refs = m_nRefCount; - - if (--m_nRefCount <= 0) - { - delete this; - } - - return refs; - } - -private: - int m_nRefCount; -}; - - -// Use this for debugging unregistration problems. -//#define DEBUG_CLASS_NAME_REGISTRATION - - //! Class factory is a common repository of all registered plugin classes, //! Classes here can found by their class ID or all classes of given system class retrieved class CRYEDIT_API CClassFactory diff --git a/Code/Editor/Util/GdiUtil.cpp b/Code/Editor/Util/GdiUtil.cpp deleted file mode 100644 index 72e5e28605..0000000000 --- a/Code/Editor/Util/GdiUtil.cpp +++ /dev/null @@ -1,179 +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 - * - */ - - -#include "EditorDefs.h" - -#include "GdiUtil.h" - -// Qt -#include -#include - -QColor ScaleColor(const QColor& c, float aScale) -{ - QColor aColor = c; - if (!aColor.isValid()) - { - // help out scaling, by starting at very low black - aColor = QColor(1, 1, 1); - } - - const float r = static_cast(aColor.red()) * aScale; - const float g = static_cast(aColor.green()) * aScale; - const float b = static_cast(aColor.blue()) * aScale; - - return QColor(AZStd::clamp(static_cast(r), 0, 255), AZStd::clamp(static_cast(g), 0, 255), AZStd::clamp(static_cast(b), 0, 255)); -} - -CAlphaBitmap::CAlphaBitmap() -{ - m_width = m_height = 0; -} - -CAlphaBitmap::~CAlphaBitmap() -{ - Free(); -} - -bool CAlphaBitmap::Create(void* pData, UINT aWidth, UINT aHeight, bool bVerticalFlip, bool bPremultiplyAlpha) -{ - if (!aWidth || !aHeight) - { - return false; - } - - m_bmp = QImage(aWidth, aHeight, QImage::Format_RGBA8888); - if (m_bmp.isNull()) - { - return false; - } - - std::vector vBuffer; - - if (pData) - { - // copy over the raw 32bpp data - bVerticalFlip = !bVerticalFlip; // in Qt, the flip is not required. Still, keep the API behaving the same - if (bVerticalFlip) - { - UINT nBufLen = aWidth * aHeight; - vBuffer.resize(nBufLen); - - if (IsBadReadPtr(pData, nBufLen * 4)) - { - //TODO: remove after testing alot the browser, it doesnt happen anymore - QMessageBox::critical(QApplication::activeWindow(), QString(), QObject::tr("Bad image data ptr!")); - Free(); - return false; - } - - assert(!vBuffer.empty()); - - if (vBuffer.empty()) - { - Free(); - return false; - } - - UINT scanlineSize = aWidth * 4; - - for (UINT i = 0, iCount = aHeight; i < iCount; ++i) - { - // top scanline position - UINT* pTopScanPos = (UINT*)&vBuffer[0] + i * aWidth; - // bottom scanline position - UINT* pBottomScanPos = (UINT*)pData + (aHeight - i - 1) * aWidth; - - // save a scanline from top - memcpy(pTopScanPos, pBottomScanPos, scanlineSize); - } - - pData = &vBuffer[0]; - } - - // premultiply alpha, AlphaBlend GDI expects it - if (bPremultiplyAlpha) - { - for (UINT y = 0; y < aHeight; ++y) - { - BYTE* pPixel = (BYTE*) pData + aWidth * 4 * y; - - for (UINT x = 0; x < aWidth; ++x) - { - pPixel[0] = ((int)pPixel[0] * pPixel[3] + 127) >> 8; - pPixel[1] = ((int)pPixel[1] * pPixel[3] + 127) >> 8; - pPixel[2] = ((int)pPixel[2] * pPixel[3] + 127) >> 8; - pPixel += 4; - } - } - } - - memcpy(m_bmp.bits(), pData, aWidth * aHeight * 4); - - if (m_bmp.isNull()) - { - return false; - } - } - else - { - m_bmp.fill(Qt::transparent); - } - - // we dont need this screen DC anymore - m_width = aWidth; - m_height = aHeight; - - return true; -} - -QImage& CAlphaBitmap::GetBitmap() -{ - return m_bmp; -} - -void CAlphaBitmap::Free() -{ - -} - -UINT CAlphaBitmap::GetWidth() -{ - return m_width; -} - -UINT CAlphaBitmap::GetHeight() -{ - return m_height; -} - -void CheckerboardFillRect(QPainter* pGraphics, const QRect& rRect, int checkDiameter, const QColor& aColor1, const QColor& aColor2) -{ - pGraphics->save(); - pGraphics->setClipRect(rRect); - // Create a checkerboard background for easier readability - pGraphics->fillRect(rRect, aColor1); - QBrush lightBrush(aColor2); - - // QRect bottom/right methods are short one unit for legacy reasons. Compute bottomr/right of the rectange ourselves to get the full size. - const int rectRight = rRect.x() + rRect.width(); - const int rectBottom = rRect.y() + rRect.height(); - - for (int i = rRect.left(); i < rectRight; i += checkDiameter) - { - for (int j = rRect.top(); j < rectBottom; j += checkDiameter) - { - if ((i / checkDiameter) % 2 ^ (j / checkDiameter) % 2) - { - pGraphics->fillRect(QRect(i, j, checkDiameter, checkDiameter), lightBrush); - } - } - } - pGraphics->restore(); -} diff --git a/Code/Editor/Util/GdiUtil.h b/Code/Editor/Util/GdiUtil.h deleted file mode 100644 index f38cbc0c0e..0000000000 --- a/Code/Editor/Util/GdiUtil.h +++ /dev/null @@ -1,54 +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 : Utilitarian classes for double buffer GDI rendering and 32bit bitmaps - - -#ifndef CRYINCLUDE_EDITOR_UTIL_GDIUTIL_H -#define CRYINCLUDE_EDITOR_UTIL_GDIUTIL_H -#pragma once - -QColor ScaleColor(const QColor& coor, float aScale); - -//! This class loads alpha-channel bitmaps and holds a DC for use with AlphaBlend function -class CRYEDIT_API CAlphaBitmap -{ -public: - - CAlphaBitmap(); - ~CAlphaBitmap(); - - //! creates the bitmap from raw 32bpp data - //! \param pData the 32bpp raw image data, RGBA, can be nullptr and it would create just an empty bitmap - //! \param aWidth the bitmap width - //! \param aHeight the bitmap height - bool Create(void* pData, UINT aWidth, UINT aHeight, bool bVerticalFlip = false, bool bPremultiplyAlpha = false); - //! \return the actual bitmap - QImage& GetBitmap(); - //! free the bitmap and DC - void Free(); - //! \return bitmap width - UINT GetWidth(); - //! \return bitmap height - UINT GetHeight(); - -protected: - - QImage m_bmp; - UINT m_width, m_height; -}; - -//! Fill a rectangle with a checkerboard pattern. -//! \param pGraphics The Graphics object used for drawing -//! \param rRect The rectangle to be filled -//! \param checkDiameter the diameter of the check squares -//! \param aColor1 the color that starts in the top left corner check square -//! \param aColor2 the second color used for check squares -void CheckerboardFillRect(QPainter* pGraphics, const QRect& rRect, int checkDiameter, const QColor& aColor1, const QColor& aColor2); -#endif // CRYINCLUDE_EDITOR_UTIL_GDIUTIL_H diff --git a/Code/Editor/Util/GuidUtil.cpp b/Code/Editor/Util/GuidUtil.cpp index 5f81eac88e..e8ea6fd3f8 100644 --- a/Code/Editor/Util/GuidUtil.cpp +++ b/Code/Editor/Util/GuidUtil.cpp @@ -6,12 +6,35 @@ * */ - -#include "EditorDefs.h" - #include "GuidUtil.h" +const char* GuidUtil::ToString(REFGUID guid) +{ + static char guidString[64]; + sprintf_s(guidString, "{%.8" GUID_FORMAT_DATA1 "-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], + guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); + return guidString; +} + ////////////////////////////////////////////////////////////////////////// -const GUID GuidUtil::NullGuid = { - 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } -}; +GUID GuidUtil::FromString(const char* guidString) +{ + GUID guid; + unsigned int d[8]; + memset(&d, 0, sizeof(guid)); + guid.Data1 = 0; + guid.Data2 = 0; + guid.Data3 = 0; + azsscanf(guidString, "{%8" GUID_FORMAT_DATA1 "-%4hX-%4hX-%2X%2X-%2X%2X%2X%2X%2X%2X}", + &guid.Data1, &guid.Data2, &guid.Data3, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7]); + guid.Data4[0] = static_cast(d[0]); + guid.Data4[1] = static_cast(d[1]); + guid.Data4[2] = static_cast(d[2]); + guid.Data4[3] = static_cast(d[3]); + guid.Data4[4] = static_cast(d[4]); + guid.Data4[5] = static_cast(d[5]); + guid.Data4[6] = static_cast(d[6]); + guid.Data4[7] = static_cast(d[7]); + + return guid; +} diff --git a/Code/Editor/Util/GuidUtil.h b/Code/Editor/Util/GuidUtil.h index de2bad8759..f42021ae2a 100644 --- a/Code/Editor/Util/GuidUtil.h +++ b/Code/Editor/Util/GuidUtil.h @@ -23,9 +23,6 @@ struct GuidUtil static const char* ToString(REFGUID guid); //! Convert from guid string in valid format to GUID class. static GUID FromString(const char* guidString); - static bool IsEmpty(REFGUID guid); - - static const GUID NullGuid; }; /** Used to compare GUID keys. @@ -38,42 +35,4 @@ struct guid_less_predicate } }; -////////////////////////////////////////////////////////////////////////// -inline bool GuidUtil::IsEmpty(REFGUID guid) -{ - return guid == NullGuid; -} - -////////////////////////////////////////////////////////////////////////// -inline const char* GuidUtil::ToString(REFGUID guid) -{ - static char guidString[64]; - sprintf_s(guidString, "{%.8" GUID_FORMAT_DATA1 "-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], - guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); - return guidString; -} - -////////////////////////////////////////////////////////////////////////// -inline GUID GuidUtil::FromString(const char* guidString) -{ - GUID guid; - unsigned int d[8]; - memset(&d, 0, sizeof(guid)); - guid.Data1 = 0; - guid.Data2 = 0; - guid.Data3 = 0; - azsscanf(guidString, "{%8" GUID_FORMAT_DATA1 "-%4hX-%4hX-%2X%2X-%2X%2X%2X%2X%2X%2X}", - &guid.Data1, &guid.Data2, &guid.Data3, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7]); - guid.Data4[0] = static_cast(d[0]); - guid.Data4[1] = static_cast(d[1]); - guid.Data4[2] = static_cast(d[2]); - guid.Data4[3] = static_cast(d[3]); - guid.Data4[4] = static_cast(d[4]); - guid.Data4[5] = static_cast(d[5]); - guid.Data4[6] = static_cast(d[6]); - guid.Data4[7] = static_cast(d[7]); - - return guid; -} - #endif // CRYINCLUDE_EDITOR_UTIL_GUIDUTIL_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 82cfe545b6..8064d56184 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -636,8 +636,6 @@ set(FILES Util/FileEnum.h Util/FileUtil.cpp Util/FileUtil.h - Util/GdiUtil.cpp - Util/GdiUtil.h Util/GeometryUtil.cpp Util/GuidUtil.cpp Util/GuidUtil.h From 796780af11c1c39aade6bb0cefe54f18148d4e5e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 17:23:44 -0800 Subject: [PATCH 175/620] Removes ImageASC from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/ImageASC.cpp | 190 ----------------------------- Code/Editor/Util/ImageASC.h | 23 ---- Code/Editor/editor_lib_files.cmake | 2 - 3 files changed, 215 deletions(-) delete mode 100644 Code/Editor/Util/ImageASC.cpp delete mode 100644 Code/Editor/Util/ImageASC.h diff --git a/Code/Editor/Util/ImageASC.cpp b/Code/Editor/Util/ImageASC.cpp deleted file mode 100644 index 1c4a8acf73..0000000000 --- a/Code/Editor/Util/ImageASC.cpp +++ /dev/null @@ -1,190 +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 - * - */ - -#include "EditorDefs.h" - -#include "ImageASC.h" - -// Editor -#include "Util/Image.h" - -//--------------------------------------------------------------------------- - -bool CImageASC::Save(const QString& fileName, const CFloatImage& image) -{ - // There are two types of ARCGrid file formats - binary (ADF) and ASCII (ASC). - // See here: https://en.wikipedia.org/wiki/Esri_grid - - uint32 width = image.GetWidth(); - uint32 height = image.GetHeight(); - float* pixels = image.GetData(); - - AZStd::string fileHeader = AZStd::string::format( - // Number of columns and rows in the data - "ncols %d\n" - "nrows %d\n" - - // The coordinates of the bottom-left corner. - // These numbers represent coordinates on a globe, so this choice of values is arbitrary. - "xllcorner 0.0\n" - "yllcorner 0.0\n" - - // The size of each grid square. - // The problem is that cellsize represents the size of a square on a grid being projected onto a globe. - // This number can be used to convert size to degrees, based on where on the globe it appears. - // We don't have a real-world location associated with our data, so this size choice is arbitrary. - "cellsize 0.0003\n" - - // The value used for missing data. Since we shouldn't have any missing data, we'll choose a value that can't appear below. - "nodata_value -1\n" - , width, height); - - FILE* file = nullptr; - azfopen(&file, fileName.toUtf8().data(), "wt"); - if (!file) - { - return false; - } - - // First print the file header - fprintf(file, "%s", fileHeader.c_str()); - - // Then print all the pixels. - for (uint32 y = 0; y < height; y++) - { - for (uint32 x = 0; x < width; x++) - { - fprintf(file, "%.7f ", pixels[x + y * width]); - } - fprintf(file, "\n"); - } - - fclose(file); - return true; -} - -//--------------------------------------------------------------------------- - -bool CImageASC::Load(const QString& fileName, CFloatImage& image) -{ - FILE* file = nullptr; - azfopen(&file, fileName.toUtf8().data(), "rt"); - if (!file) - { - return false; - } - - const char seps[] = " \r\n\t"; - char* token; - - int32 width = 0; - int32 height = 0; - float nodataValue = 0.0f; - - bool validData = true; - - // Read the file into memory - - fseek(file, 0, SEEK_END); - int fileSize = ftell(file); - fseek(file, 0, SEEK_SET); - - char* str = new char[fileSize]; - fread(str, fileSize, 1, file); - - // Break all of the values in the file apart into tokens. - - [[maybe_unused]] char* nextToken = nullptr; - token = azstrtok(str, 0, seps, &nextToken); - - // ncols = grid width - validData = validData && (azstricmp(token, "ncols") == 0); - token = azstrtok(nullptr, 0, seps, &nextToken); - width = atoi(token); - - // nrows = grid height - token = azstrtok(nullptr, 0, seps, &nextToken); - validData = validData && (azstricmp(token, "nrows") == 0); - token = azstrtok(nullptr, 0, seps, &nextToken); - height = atoi(token); - - // xllcorner = leftmost coordinate. (Skip, we don't care about it) - token = azstrtok(nullptr, 0, seps, &nextToken); - validData = validData && (azstricmp(token, "xllcorner") == 0); - token = azstrtok(nullptr, 0, seps, &nextToken); - - // yllcorner = bottommost coordinate. (Skip, we don't care about it) - token = azstrtok(nullptr, 0, seps, &nextToken); - validData = validData && (azstricmp(token, "yllcorner") == 0); - token = azstrtok(nullptr, 0, seps, &nextToken); - - // cellsize = size of each grid cell. (Skip, we don't care about it) - token = azstrtok(nullptr, 0, seps, &nextToken); - validData = validData && (azstricmp(token, "cellsize") == 0); - token = azstrtok(nullptr, 0, seps, &nextToken); - - // nodata_value = the value used for missing data. We'll replace these with 0 height. - token = azstrtok(nullptr, 0, seps, &nextToken); - validData = validData && (azstricmp(token, "nodata_value") == 0); - token = azstrtok(nullptr, 0, seps, &nextToken); - nodataValue = static_cast(atof(token)); - - if (!validData) - { - // Bad file. not supported asc. - delete[]str; - fclose(file); - return false; - } - - image.Allocate(width, height); - - // Read in the pixel data - - float* p = image.GetData(); - int size = width * height; - int i = 0; - float pixelValue; - float maxPixel = 0.0f; - while (token != nullptr && i < size) - { - token = azstrtok(nullptr, 0, seps, &nextToken); - if (token != nullptr) - { - // Negative heights aren't supported, clamp to 0. - pixelValue = max(0.0f, static_cast(atof(token))); - - // If this is a location we specifically don't have data for, set it to 0. - if (pixelValue == nodataValue) - { - pixelValue = 0.0f; - } - - *p++ = pixelValue; - maxPixel = max(maxPixel, pixelValue); - i++; - } - } - - if (maxPixel > 0.0f) - { - // Scale our range down to 0 - 1 - float* pp = image.GetData(); - for (i = 0; i < size; i++) - { - pp[i] = clamp_tpl(pp[i] / maxPixel, 0.0f, 1.0f); - } - } - - delete[]str; - - fclose(file); - - return true; -} - diff --git a/Code/Editor/Util/ImageASC.h b/Code/Editor/Util/ImageASC.h deleted file mode 100644 index 4570145dcf..0000000000 --- a/Code/Editor/Util/ImageASC.h +++ /dev/null @@ -1,23 +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 - * - */ - -#ifndef CRYINCLUDE_EDITOR_UTIL_IMAGEASC_H -#define CRYINCLUDE_EDITOR_UTIL_IMAGEASC_H -#pragma once - -#include "Util/Image.h" - -class SANDBOX_API CImageASC -{ -public: - bool Load(const QString& fileName, CFloatImage& outImage); - bool Save(const QString& fileName, const CFloatImage& image); -}; - - -#endif // CRYINCLUDE_EDITOR_UTIL_IMAGEASC_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 8064d56184..66d1a544db 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -686,8 +686,6 @@ set(FILES Util/FileChangeMonitor.h Util/ImageUtil.cpp Util/ImageUtil.h - Util/ImageASC.cpp - Util/ImageASC.h Util/ImageBT.cpp Util/ImageBT.h Util/ImageGif.cpp From 53f7594ab62a0b3d4366f6f3f44b8b1325132d28 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 17:31:31 -0800 Subject: [PATCH 176/620] Removes ImageBT from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/ImageBT.cpp | 207 ----------------------------- Code/Editor/Util/ImageBT.h | 23 ---- Code/Editor/editor_lib_files.cmake | 2 - 3 files changed, 232 deletions(-) delete mode 100644 Code/Editor/Util/ImageBT.cpp delete mode 100644 Code/Editor/Util/ImageBT.h diff --git a/Code/Editor/Util/ImageBT.cpp b/Code/Editor/Util/ImageBT.cpp deleted file mode 100644 index eb54213cf1..0000000000 --- a/Code/Editor/Util/ImageBT.cpp +++ /dev/null @@ -1,207 +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 - * - */ - -#include "EditorDefs.h" - -#include "ImageBT.h" - -//--------------------------------------------------------------------------- -// Load and save the VTP Binary Terrain (BT) format, documented here: -// http://vterrain.org/Implementation/Formats/BT.html - -// This structure represents a binary layout in the file. To direct load & save it, we need to remove all structure memory padding -#pragma pack(push,1) -struct BtHeader -{ - char headerTag[7]; // Should be "binterr" - char headerTagVersion[3]; // Should be "1.3" - int32 columns; // # of columns in the heightfield - int32 rows; // # of rows in the heightfield - int16 bytesPerPoint; // bytes per height value, either 2 for signed ints or 4 for floats - int16 isFloatingPointData; // 1 if height values are floats, 0 for 16-bit signed ints - int16 horizUnits; // 0 if degrees, 1 if meters, 2 if international feet, 3 if US survey feet - int16 utmZone; // UTM projection zone 1 to 60 or -1 to -60 (see https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system ) - int16 datum; // Datum value (6001 to 6094), see http://www.epsg.org/ - double leftExtent; // left coordinate projection of the file - double rightExtent; // right coordinate projection of the file - double bottomExtent; // bottom coordinate projection of the file - double topExtent; // top coordinate projection of the file - int16 externalProjection; // 1 if projection is in an external .prj file, 0 if it's contained in the header - float scale; // vertical units in meters. 0.0 should be treated as 1.0 - char unused[190]; -}; -#pragma pack(pop) - -bool CImageBT::Save(const QString& fileName, const CFloatImage& image) -{ - int width = image.GetWidth(); - int height = image.GetHeight(); - - float *pixels = image.GetData(); - - // Create a header with reasonable default values. - BtHeader header = - { - {'b', 'i', 'n', 't', 'e', 'r', 'r'}, - {'1', '.', '3' }, - width, - height, - sizeof(float), // we'll use floats to make sure we can capture the full potential range of heightfield values - 1, // use floats - 1, // units are meters - 0, // no UTM projection zone - 6326, // WGS84 Datum value. Recommended by VTP as the default if you don't care about Datum values. - 0.0, // set the left extent to 0? - double(width), // set the right extent to the width? (assumes 1 m per pixel) - double(height), // set the bottom extent to the height? (assumes 1 m per pixel) - 0.0, // set the top extent to 0? - 0, // no external prj file - 1.0f - }; - - memset(header.unused, 0, sizeof(header.unused)); - - FILE* file = nullptr; - azfopen(&file, fileName.toUtf8().data(), "wb"); - if (!file) - { - return false; - } - - fwrite(&header, sizeof(header), 1, file); - for (int32 y = 0; y < height; y++) - { - for (int32 x = 0; x < width; x++) - { - float heightmapValue = pixels[(y * width) + x]; - fwrite(&heightmapValue, sizeof(float), 1, file); - } - } - - fclose(file); - return true; -} - -//--------------------------------------------------------------------------- - -bool CImageBT::Load(const QString& fileName, CFloatImage& image) -{ - FILE* file = nullptr; - azfopen(&file, fileName.toUtf8().data(), "rb"); - if (!file) - { - return false; - } - - // Get the file size - - fseek(file, 0, SEEK_END); - int fileSize = ftell(file); - fseek(file, 0, SEEK_SET); - - // Our file needs to be at least as big as the BT file header. - if (fileSize < sizeof(BtHeader)) - { - return false; - } - - // Get the BT header data - BtHeader header; - memset(&header, 0, sizeof(BtHeader)); // C4701 potentially uninitialized local variable 'header' used - bool validData = true; - validData = validData && (fread(&header, sizeof(BtHeader), 1, file) != 0); - - // Do some quick error-checking on the header to make sure it meets our expectations - - // Does the header have the right header tag? (binterr1.0 - binterr1.3) - validData = validData && (memcmp(header.headerTag, "binterr", sizeof(header.headerTag)) == 0); - validData = validData && (header.headerTagVersion[0] == '1') && (header.headerTagVersion[1] == '.') && (header.headerTagVersion[2] >= '0') && (header.headerTagVersion[2] <= '3'); - - // Will the grid fit into a reasonable image size? - validData = validData && (header.columns >= 0) && (header.columns < 65536); - validData = validData && (header.rows >= 0) && (header.rows < 65536); - - // Do we either have 32-bit floats or 16-bit ints? - validData = validData && (((header.isFloatingPointData == 1) && (header.bytesPerPoint == 4)) || ((header.isFloatingPointData == 0) && (header.bytesPerPoint == 2))); - - // Is the remaining data exactly the size needed to fill our image? - validData = validData && ((fileSize - sizeof(BtHeader)) == (header.columns * header.rows * header.bytesPerPoint)); - - if (!validData) - { - fclose(file); - return false; - } - - if (header.scale == 0.0f) - { - header.scale = 1.0f; - } - - // The BT format defines the data as stored in column-first order, from bottom to top. - // However, some BT files store the data in row-first order, from top to bottom. - // There isn't anything that clearly specifies which type of file it is. If you load it the wrong way, - // the data will look like a bunch of wavy stripes. - // The only difference I've found in test files is datum values above 8000, which appears to be an invalid value for datum - // (it should be 6001-6904 according to the BT definition) - const int invalidDatumValueDenotingColumnFirstData = 8000; - bool isColumnFirstData = (header.datum >= invalidDatumValueDenotingColumnFirstData) ? true : false; - float height = 0.0f; - int imageWidth, imageHeight; - - if (isColumnFirstData) - { - imageWidth = header.rows; - imageHeight = header.columns; - } - else - { - imageWidth = header.columns; - imageHeight = header.rows; - } - - - image.Allocate(imageWidth, imageHeight); - float* p = image.GetData(); - float maxPixel = 0.0f; - - // Read in the pixel data - for (int32 y = 0; y < imageHeight; y++) - { - for (int32 x = 0; x < imageWidth; x++) - { - if (header.isFloatingPointData) - { - fread(&height, sizeof(float), 1, file); - } - else - { - int16 intHeight = 0; - fread(&intHeight, sizeof(int16), 1, file); - height = static_cast(intHeight); - } - // Scale based on what our header defines, and clamp the values to positive range, negatives not supported - p[(y * imageWidth) + x] = max((height * header.scale), 0.0f); - maxPixel = max(maxPixel, p[(y * imageWidth) + x]); - } - } - - // Scale our range down to 0 - 1 - if (maxPixel > 0.0f) - { - p = image.GetData(); - for (int32 i = 0; i < (imageWidth * imageHeight); i++) - { - p[i] = clamp_tpl(p[i] / maxPixel, 0.0f, 1.0f); - } - } - - fclose(file); - return true; -} - diff --git a/Code/Editor/Util/ImageBT.h b/Code/Editor/Util/ImageBT.h deleted file mode 100644 index dc7061527a..0000000000 --- a/Code/Editor/Util/ImageBT.h +++ /dev/null @@ -1,23 +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 - * - */ - -#ifndef CRYINCLUDE_EDITOR_UTIL_IMAGEBT_H -#define CRYINCLUDE_EDITOR_UTIL_IMAGEBT_H -#pragma once - -#include "Util/Image.h" - -class SANDBOX_API CImageBT -{ -public: - bool Load(const QString& fileName, CFloatImage& outImage); - bool Save(const QString& fileName, const CFloatImage& image); -}; - - -#endif // CRYINCLUDE_EDITOR_UTIL_IMAGEBT_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 66d1a544db..171a9527d4 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -686,8 +686,6 @@ set(FILES Util/FileChangeMonitor.h Util/ImageUtil.cpp Util/ImageUtil.h - Util/ImageBT.cpp - Util/ImageBT.h Util/ImageGif.cpp Util/ImageGif.h Util/ImageTIF.cpp From 46cc160d8ce768026518828956f202232ebb4a95 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 18:03:08 -0800 Subject: [PATCH 177/620] Removes smartptr and TRefCountBase from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/EditorDefs.h | 1 - Code/Editor/Util/TRefCountBase.h | 56 ------------------- Code/Editor/Util/smartptr.h | 29 ---------- Code/Editor/editor_lib_files.cmake | 2 - .../Animation/UiAnimViewSequenceManager.h | 2 - 5 files changed, 90 deletions(-) delete mode 100644 Code/Editor/Util/TRefCountBase.h delete mode 100644 Code/Editor/Util/smartptr.h diff --git a/Code/Editor/EditorDefs.h b/Code/Editor/EditorDefs.h index 3abc3eb53c..5dd653679b 100644 --- a/Code/Editor/EditorDefs.h +++ b/Code/Editor/EditorDefs.h @@ -124,7 +124,6 @@ // Utility classes. #include "Util/RefCountBase.h" -#include "Util/TRefCountBase.h" #include "Util/MemoryBlock.h" #include "Util/PathUtil.h" diff --git a/Code/Editor/Util/TRefCountBase.h b/Code/Editor/Util/TRefCountBase.h deleted file mode 100644 index aeedda9d16..0000000000 --- a/Code/Editor/Util/TRefCountBase.h +++ /dev/null @@ -1,56 +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 : Reference counted base object. - - -#ifndef CRYINCLUDE_EDITOR_UTIL_TREFCOUNTBASE_H -#define CRYINCLUDE_EDITOR_UTIL_TREFCOUNTBASE_H -#pragma once - -AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING -////////////////////////////////////////////////////////////////////////// -//! Derive from this class to get reference counting for your class. -////////////////////////////////////////////////////////////////////////// -template -class CRYEDIT_API TRefCountBase - : public ParentClass -{ -AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING -public: - TRefCountBase() { m_nRefCount = 0; }; - - //! Add new refrence to this object. - unsigned long AddRef() - { - m_nRefCount++; - return m_nRefCount; - }; - - //! Release refrence to this object. - //! when reference count reaches zero, object is deleted. - unsigned long Release() - { - int refs = --m_nRefCount; - if (m_nRefCount <= 0) - { - delete this; - } - return refs; - } - -protected: - virtual ~TRefCountBase() {}; - -private: - int m_nRefCount; -}; - - -#endif // CRYINCLUDE_EDITOR_UTIL_TREFCOUNTBASE_H diff --git a/Code/Editor/Util/smartptr.h b/Code/Editor/Util/smartptr.h deleted file mode 100644 index d9e656ef24..0000000000 --- a/Code/Editor/Util/smartptr.h +++ /dev/null @@ -1,29 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_UTIL_SMARTPTR_H -#define CRYINCLUDE_EDITOR_UTIL_SMARTPTR_H -#pragma once - -#include - -#define TSmartPtr _smart_ptr - -/** Use this to define smart pointers of classes. - For example: - class CNode : public CRefCountBase {}; - SMARTPTRTypeYPEDEF( CNode ); - { - CNodePtr node; // Smart pointer. - } -*/ - -#define SMARTPTR_TYPEDEF(Class) typedef TSmartPtr Class##Ptr - -#endif // CRYINCLUDE_EDITOR_UTIL_SMARTPTR_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 171a9527d4..28950c9fa9 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -648,7 +648,6 @@ set(FILES Util/PredefinedAspectRatios.h Util/StringHelpers.cpp Util/StringHelpers.h - Util/TRefCountBase.h Util/Triangulate.cpp Util/Triangulate.h Util/Util.h @@ -657,7 +656,6 @@ set(FILES Util/XmlTemplate.cpp Util/XmlTemplate.h Util/fastlib.h - Util/smartptr.h WaitProgress.cpp WaitProgress.h Util/FileUtil_impl.h diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.h b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.h index 1fe9d96f85..6844a8272b 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.h +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.h @@ -9,8 +9,6 @@ #pragma once -#include "Util/smartptr.h" - #include "UiAnimViewSequence.h" #include #include "UiEditorAnimationBus.h" From 3d1b30dedaaf3587f8b6d8a12d33db7d448fa866 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 18:09:56 -0800 Subject: [PATCH 178/620] Removes Triangulate from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/Triangulate.cpp | 69 ------------------------------ Code/Editor/Util/Triangulate.h | 26 ----------- Code/Editor/editor_lib_files.cmake | 2 - 3 files changed, 97 deletions(-) delete mode 100644 Code/Editor/Util/Triangulate.cpp delete mode 100644 Code/Editor/Util/Triangulate.h diff --git a/Code/Editor/Util/Triangulate.cpp b/Code/Editor/Util/Triangulate.cpp deleted file mode 100644 index c8160a375a..0000000000 --- a/Code/Editor/Util/Triangulate.cpp +++ /dev/null @@ -1,69 +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 - * - */ - - -#include "EditorDefs.h" - -#include "Triangulate.h" - -// this file is essentially a wrapper for a portion of the MIT-licenced -// ConvexDecomposition library by John W. Ratcliff mailto:jratcliffscarab@gmail.com. -// it contains no code from that library, it just provides it with the required types, then includes the -// portion we need. - -static const float TRIANGULATION_EPSILON = 0.0000000001f; - -#define MEMALLOC_MALLOC malloc -#define MEMALLOC_FREE free - -namespace TriInternal -{ - class TVec; - typedef double NxF64; - typedef float NxF32; - typedef unsigned char NxU8; - typedef unsigned int NxU32; - typedef int NxI32; - typedef unsigned int TU32; - - typedef std::vector< TVec > TVecVector; - typedef std::vector< NxU32 > TU32Vector; - #include "Contrib/NvFloatMath.inl" -} - -#undef MEMALLOC_MALLOC -#undef MEMALLOC_FREE - -namespace Triangulator -{ - // given the contour of a triangle, triangulate it, and return the result - // as a set of triangles - // return false if you fail to triangulate it. - bool Triangulate(const VectorOfVectors& contour, VectorOfVectors& result) - { - TriInternal::CTriangulator tri; - for (auto pt : contour) - { - tri.addPoint(pt.x, pt.y, pt.z); - } - TriInternal::NxU32 tricount = 0; - TriInternal::NxU32* indices = tri.triangulate(tricount, TRIANGULATION_EPSILON); - if (!indices) - { - return false; - } - - for (TriInternal::NxU32 currentIdx = 0; currentIdx < tricount * 3; ++currentIdx) - { - TriInternal::NxU32 indexValue = *indices++; - result.push_back(contour[indexValue]); - } - - return result.size() > 2; - } -} diff --git a/Code/Editor/Util/Triangulate.h b/Code/Editor/Util/Triangulate.h deleted file mode 100644 index dad3a14de1..0000000000 --- a/Code/Editor/Util/Triangulate.h +++ /dev/null @@ -1,26 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_UTIL_TRIANGULATE_H -#define CRYINCLUDE_EDITOR_UTIL_TRIANGULATE_H -#pragma once - -#include -#include "Cry_Vector3.h" - -// you pass in a vector of vec3 (the contour of a shape) and it outputs a vector of vec3 (being the triangles) - -namespace Triangulator -{ - typedef std::vector< Vec3 > VectorOfVectors; - bool Triangulate(const VectorOfVectors& contour, VectorOfVectors& result); -}; - - -#endif diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 28950c9fa9..d1c903eb72 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -648,8 +648,6 @@ set(FILES Util/PredefinedAspectRatios.h Util/StringHelpers.cpp Util/StringHelpers.h - Util/Triangulate.cpp - Util/Triangulate.h Util/Util.h Util/XmlArchive.cpp Util/XmlArchive.h From cc796476548f24597c78d182a090294bc8a3613a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 19 Nov 2021 16:33:19 -0800 Subject: [PATCH 179/620] Removes WinWidgetId from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/IEditor.h | 2 -- Code/Editor/WinWidgetId.h | 20 -------------------- Code/Editor/editor_core_files.cmake | 1 - 3 files changed, 23 deletions(-) delete mode 100644 Code/Editor/WinWidgetId.h diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index 0ba24ac46a..52f8c1ac6f 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -19,8 +19,6 @@ #include "Util/UndoUtil.h" #include -#include - #include #include diff --git a/Code/Editor/WinWidgetId.h b/Code/Editor/WinWidgetId.h deleted file mode 100644 index dc8daa43c6..0000000000 --- a/Code/Editor/WinWidgetId.h +++ /dev/null @@ -1,20 +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 - * - */ - -#pragma once - -enum class WinWidgetId -{ - NONE = 0, - ACTIVE_DEPLOYMENT, - PROFILE_SELECTOR, - ADD_PROFILE, - INITIALIZE_PROJECT, - // ALL VALIDS ABOVE HERE - NUM_WIN_WIDGET_IDS -}; diff --git a/Code/Editor/editor_core_files.cmake b/Code/Editor/editor_core_files.cmake index 1f0a5a3618..60fe18ec65 100644 --- a/Code/Editor/editor_core_files.cmake +++ b/Code/Editor/editor_core_files.cmake @@ -64,7 +64,6 @@ set(FILES Undo/IUndoObject.h Undo/Undo.h Undo/UndoVariableChange.h - WinWidgetId.h QtUI/ColorButton.cpp QtUI/ColorButton.h QtUtil.h From fba00b0b2beb675ce9df71828b739257108defa1 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 19 Nov 2021 16:43:37 -0800 Subject: [PATCH 180/620] Removes ComponentPalette/CategoriesList and ComponentPalette/ComponentDataModel from Code/Editor/Plugins/ComponentEntityEditorPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UI/ComponentPalette/CategoriesList.cpp | 97 ---- .../UI/ComponentPalette/CategoriesList.h | 39 -- .../ComponentPalette/ComponentDataModel.cpp | 547 ------------------ .../UI/ComponentPalette/ComponentDataModel.h | 128 ---- .../componententityeditorplugin_files.cmake | 4 - Code/Editor/Util/Contrib/NvFloatMath.inl | 455 --------------- 6 files changed, 1270 deletions(-) delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.h delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.h delete mode 100644 Code/Editor/Util/Contrib/NvFloatMath.inl diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.cpp deleted file mode 100644 index cd157fe838..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.cpp +++ /dev/null @@ -1,97 +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 - * - */ - -#include "CategoriesList.h" - -ComponentCategoryList::ComponentCategoryList(QWidget* parent /*= nullptr*/) - : QTreeWidget(parent) -{ -} - -void ComponentCategoryList::Init() -{ - setColumnCount(1); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - setDragDropMode(QAbstractItemView::DragDropMode::DragOnly); - setDragEnabled(true); - setSelectionMode(QAbstractItemView::ExtendedSelection); - setAllColumnsShowFocus(true); - setStyleSheet("QTreeWidget { selection-background-color: rgba(255,255,255,0.2); }"); - - QStringList headers; - headers << tr("Categories"); - setHeaderLabels(headers); - - const QString parentCategoryIconPath = QString("Icons/PropertyEditor/Browse_on.png"); - const QString categoryIconPath = QString("Icons/PropertyEditor/Browse.png"); - - QTreeWidgetItem* allCategory = new QTreeWidgetItem(this); - allCategory->setText(0, "All"); - allCategory->setIcon(0, QIcon(categoryIconPath)); - - // Need this briefly to collect the list of available categories. - ComponentDataModel dataModel(this); - for (const auto& cat : dataModel.GetCategories()) - { - QString categoryString = QString(cat.c_str()); - QStringList categories = categoryString.split('/', Qt::SkipEmptyParts); - - QTreeWidgetItem* parent = nullptr; - QTreeWidgetItem* categoryWidget = nullptr; - - for (const auto& categoryName : categories) - { - if (parent) - { - categoryWidget = new QTreeWidgetItem(parent); - categoryWidget->setIcon(0, QIcon(categoryIconPath)); - - // Store the full category path in a user role because we'll need it to locate the actual category - categoryWidget->setData(0, Qt::UserRole, QVariant::fromValue(categoryString)); - } - else - { - auto existingCategory = findItems(categoryName, Qt::MatchExactly); - if (existingCategory.empty()) - { - categoryWidget = new QTreeWidgetItem(this); - categoryWidget->setIcon(0, QIcon(parentCategoryIconPath)); - } - else - { - categoryWidget = static_cast(existingCategory.first()); - categoryWidget->setIcon(0, QIcon(parentCategoryIconPath)); - } - } - - parent = categoryWidget; - - categoryWidget->setText(0, categoryName); - } - } - - expandAll(); - - connect(this, &QTreeWidget::itemClicked, this, &ComponentCategoryList::OnItemClicked); -} - -void ComponentCategoryList::OnItemClicked(QTreeWidgetItem* item, int /*column*/) -{ - QVariant userData = item->data(0, Qt::UserRole); - if (userData.isValid()) - { - // Send in the full category path, not just the child category name - emit OnCategoryChange(userData.value().toStdString().c_str()); - } - else - { - emit OnCategoryChange(item->text(0).toStdString().c_str()); - } -} - -#include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.h deleted file mode 100644 index 76a955ea76..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.h +++ /dev/null @@ -1,39 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include "ComponentDataModel.h" -#include -#endif - -//! ComponentCategoryList -//! Provides a list of all reflected categories that users can select for quick -//! filtering the filtered component list. -class ComponentCategoryList : public QTreeWidget -{ - Q_OBJECT - -public: - - AZ_CLASS_ALLOCATOR(ComponentCategoryList, AZ::SystemAllocator, 0); - - explicit ComponentCategoryList(QWidget* parent = nullptr); - - void Init(); - -Q_SIGNALS: - void OnCategoryChange(const char* category); - -protected: - - // Will emit OnCategoryChange signal - void OnItemClicked(QTreeWidgetItem* item, int column); - -}; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.cpp deleted file mode 100644 index dcae6abfeb..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.cpp +++ /dev/null @@ -1,547 +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 - * - */ - -#include "ComponentDataModel.h" - -#include "Include/IObjectManager.h" -#include "Objects/SelectionGroup.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include - -namespace -{ - // This is a helper function that given an object that derives from QAbstractItemModel, - // it will request the model's "ClassDataRole" class data for an entry and use that - // information to create a new entity with the selected components. - AZ::EntityId CreateEntityFromSelection(const QModelIndexList& selection, QAbstractItemModel* model) - { - AZ::Vector3 position = AZ::Vector3::CreateZero(); - CViewport *view = GetIEditor()->GetViewManager()->GetGameViewport(); - int width, height; - view->GetDimensions(&width, &height); - position = LYVec3ToAZVec3(view->ViewToWorld(QPoint(width / 2, height / 2))); - - AZ::EntityId newEntityId; - EBUS_EVENT_RESULT(newEntityId, AzToolsFramework::EditorRequests::Bus, CreateNewEntityAtPosition, position, AZ::EntityId()); - if (newEntityId.IsValid()) - { - // Add all the selected components. - AZ::ComponentTypeList componentsToAdd; - for (auto index : selection) - { - // We only need to consider the first column, it's important that the data() function that - // returns ComponentDataModel::ClassDataRole also does so for the first column. - if (index.column() != 0) - { - continue; - } - - QVariant classDataVariant = model->data(index, ComponentDataModel::ClassDataRole); - if (classDataVariant.isValid()) - { - const AZ::SerializeContext::ClassData* classData = reinterpret_cast(classDataVariant.value()); - componentsToAdd.push_back(classData->m_typeId); - } - } - - AzToolsFramework::EntityCompositionRequestBus::Broadcast(&AzToolsFramework::EntityCompositionRequests::AddComponentsToEntities, AzToolsFramework::EntityIdList{ newEntityId }, componentsToAdd); - - return newEntityId; - } - - return AZ::EntityId(); - } -} - -namespace ComponentDataUtilities -{ - // This is a helper function to add the specified components to the selected entities, it relies on the provided - // QAbstractItemModel to determine the appropriate ClassData to use to create the components (given that some widgets - // may provide proxy models that alter the order). - void AddComponentsToSelectedEntities(const QModelIndexList& selectedComponents, QAbstractItemModel* model) - { - AzToolsFramework::EntityIdList selectedEntities; - AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntities, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - if (selectedEntities.empty()) - { - return; - } - - // Add all the selected components. - AZ::ComponentTypeList componentsToAdd; - for (auto index : selectedComponents) - { - // We only need to consider the first column, it's important that the data() function that - // returns ComponentDataModel::ClassDataRole also does so for the first column. - if (index.column() != 0) - { - continue; - } - - QVariant classDataVariant = model->data(index, ComponentDataModel::ClassDataRole); - if (classDataVariant.isValid()) - { - const AZ::SerializeContext::ClassData* classData = reinterpret_cast(classDataVariant.value()); - componentsToAdd.push_back(classData->m_typeId); - } - } - - AzToolsFramework::EntityCompositionRequestBus::Broadcast(&AzToolsFramework::EntityCompositionRequests::AddComponentsToEntities, selectedEntities, componentsToAdd); - } -} - - -// ComponentDataModel -////////////////////////////////////////////////////////////////////////// - -ComponentDataModel::ComponentDataModel(QObject* parent) - : QAbstractTableModel(parent) -{ - AZ::SerializeContext* serializeContext = nullptr; - EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(serializeContext, "Failed to acquire application serialize context."); - - serializeContext->EnumerateDerived([this](const AZ::SerializeContext::ClassData* classData, const AZ::Uuid&) -> bool - { - bool allowed = false; - bool hidden = false; - AZStd::string category = "Miscellaneous"; - - if (classData->m_editData) - { - for (const AZ::Edit::ElementData& element : classData->m_editData->m_elements) - { - if (element.m_elementId == AZ::Edit::ClassElements::EditorData) - { - AZStd::string iconPath; - AzToolsFramework::EditorRequestBus::BroadcastResult(iconPath, &AzToolsFramework::EditorRequests::GetComponentTypeEditorIcon, classData->m_typeId); - if (!iconPath.empty()) - { - m_componentIcons[classData->m_typeId] = QIcon(iconPath.c_str()); - } - - for (const AZ::Edit::AttributePair& attribPair : element.m_attributes) - { - if (attribPair.first == AZ::Edit::Attributes::AppearsInAddComponentMenu) - { - if (auto data = azdynamic_cast*>(attribPair.second)) - { - if (data->Get(nullptr) == AZ_CRC("Game")) - { - allowed = true; - } - } - } - else if (attribPair.first == AZ::Edit::Attributes::AddableByUser) - { - // skip this component if user is not allowed to add it directly - if (auto data = azdynamic_cast*>(attribPair.second)) - { - if (!data->Get(nullptr)) - { - hidden = true; - } - } - } - else if (attribPair.first == AZ::Edit::Attributes::Category) - { - if (auto data = azdynamic_cast*>(attribPair.second)) - { - category = data->Get(nullptr); - } - } - } - - break; - } - } - } - - if (allowed && !hidden) - { - m_componentList.push_back(classData); - m_componentMap[category].push_back(classData); - m_categories.insert(category); - } - - return true; - }); - - // we'd like viewport events - AzQtComponents::DragAndDropEventsBus::Handler::BusConnect(AzQtComponents::DragAndDropContexts::EditorViewport); -} - -ComponentDataModel::~ComponentDataModel() -{ - AzQtComponents::DragAndDropEventsBus::Handler::BusDisconnect(); -} - -Qt::ItemFlags ComponentDataModel::flags([[maybe_unused]] const QModelIndex &index) const -{ - return Qt::ItemFlags( - Qt::ItemIsEnabled | - Qt::ItemIsDragEnabled | - Qt::ItemIsDropEnabled | - Qt::ItemIsSelectable); -} - -const AZ::SerializeContext::ClassData* ComponentDataModel::GetClassData(const QModelIndex& index) const -{ - int row = index.row(); - if (row < 0 || row >= m_componentList.size()) - { - return nullptr; - } - - return m_componentList[row]; -} - -const char* ComponentDataModel::GetCategory(const AZ::SerializeContext::ClassData* classData) -{ - if (classData) - { - if (auto editorDataElement = classData->m_editData->FindElementData(AZ::Edit::ClassElements::EditorData)) - { - if (auto categoryAttribute = editorDataElement->FindAttribute(AZ::Edit::Attributes::Category)) - { - if (auto categoryData = azdynamic_cast*>(categoryAttribute)) - { - const char* result = categoryData->Get(nullptr); - if (result) - { - return result; - } - } - } - } - } - - return ""; -} - - -QModelIndex ComponentDataModel::index(int row, int column, const QModelIndex &parent /*= QModelIndex()*/) const -{ - if (row >= rowCount(parent) || column >= columnCount(parent)) - { - return QModelIndex(); - } - - return createIndex(row, column, (void*)(m_componentList[row])); -} - -QModelIndex ComponentDataModel::parent([[maybe_unused]] const QModelIndex &child) const -{ - return QModelIndex(); -} - -int ComponentDataModel::rowCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const -{ - return static_cast(m_componentList.size()); -} - -int ComponentDataModel::columnCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const -{ - return ColumnIndex::Count; -} - -QVariant ComponentDataModel::data(const QModelIndex &index, int role /*= Qt::DisplayRole*/) const -{ - if (index.isValid()) - { - const AZ::SerializeContext::ClassData* classData = m_componentList[index.row()]; - if (!classData) - { - return QVariant(); - } - - switch (role) - { - case ClassDataRole: - if (index.column() == 0) // Only get data for one column - { - return QVariant::fromValue(reinterpret_cast(const_cast(classData))); - } - break; - - case Qt::DisplayRole: - { - if (index.column() == ColumnIndex::Name) - { - return QVariant(classData->m_editData->m_name); - } - else - if (index.column() == ColumnIndex::Category) - { - if (auto editorDataElement = classData->m_editData->FindElementData(AZ::Edit::ClassElements::EditorData)) - { - if (auto categoryAttribute = editorDataElement->FindAttribute(AZ::Edit::Attributes::Category)) - { - if (auto categoryData = azdynamic_cast*>(categoryAttribute)) - { - return QVariant(categoryData->Get(nullptr)); - } - } - } - } - - } - break; - - case Qt::ToolTipRole: - { - return QVariant(classData->m_editData->m_description); - } - - case Qt::DecorationRole: - { - if (index.column() == ColumnIndex::Icon) - { - auto iconIterator = m_componentIcons.find(classData->m_typeId); - if (iconIterator != m_componentIcons.end()) - { - return iconIterator->second; - } - } - } - break; - - default: - break; - } - } - - return QVariant(); -} - -QMimeData* ComponentDataModel::mimeData(const QModelIndexList& indices) const -{ - QModelIndexList list; - - // Filter out columns we are not interested in. - for (const QModelIndex& index : indices) - { - if (index.column() == 0) - { - list.push_back(index); - } - } - - AZStd::vector sortedList; - for (QModelIndex index : list) - { - QVariant classDataVariant = index.data(ComponentDataModel::ClassDataRole); - if (classDataVariant.isValid()) - { - const AZ::SerializeContext::ClassData* classData = reinterpret_cast(classDataVariant.value()); - sortedList.push_back(classData); - } - } - - QMimeData* mimeData = nullptr; - if (!sortedList.empty()) - { - mimeData = AzToolsFramework::ComponentTypeMimeData::Create(sortedList).release(); - } - - return mimeData; -} - -bool ComponentDataModel::CanAcceptDragAndDropEvent(QDropEvent* event, AzQtComponents::DragAndDropContextBase& context) const -{ - using namespace AzToolsFramework; - using namespace AzQtComponents; - - // if a listener with a higher priority already claimed this event, do not touch it. - if ((!event) || (event->isAccepted()) || (!event->mimeData())) - { - return false; - } - - ViewportDragContext* contextVP = azrtti_cast(&context); - if (!contextVP) - { - // not a viewport event. This is for some other GUI such as the main window itself. - return false; - } - - AZStd::vector componentClassDataList; - return AzToolsFramework::ComponentTypeMimeData::Get(event->mimeData(), componentClassDataList); -} - -void ComponentDataModel::DragEnter(QDragEnterEvent* event, AzQtComponents::DragAndDropContextBase& context) -{ - if (CanAcceptDragAndDropEvent(event, context)) - { - event->setDropAction(Qt::CopyAction); - event->setAccepted(true); - // opportunities to show special highlights, or ghosted entities or previews here. - } -} - -void ComponentDataModel::DragMove(QDragMoveEvent* event, AzQtComponents::DragAndDropContextBase& context) -{ - if (CanAcceptDragAndDropEvent(event, context)) - { - event->setDropAction(Qt::CopyAction); - event->setAccepted(true); - // opportunities to update special highlights, or ghosted entities or previews here. - } -} - -void ComponentDataModel::DragLeave(QDragLeaveEvent* /*event*/) -{ - // opportunities to remove ghosted entities or previews here. -} - -void ComponentDataModel::Drop(QDropEvent* event, AzQtComponents::DragAndDropContextBase& context) -{ - using namespace AzToolsFramework; - using namespace AzQtComponents; - - // ALWAYS CHECK - you are not the only one connected to this bus, and someone else may have already - // handled the event or accepted the drop - it might not contain types relevant to you. - // you still get informed about the drop event in case you did some stuff in your gui and need to clean it up. - if (!CanAcceptDragAndDropEvent(event, context)) - { - return; - } - - // note that the above call already checks all the pointers such as event, or whether context is a VP context, mimetype, etc - ViewportDragContext* contextVP = azrtti_cast(&context); - - // we don't get given this action by Qt unless we already returned accepted from one of the other ones (such as drag move of drag enter) - event->setDropAction(Qt::CopyAction); - event->setAccepted(true); - - AzToolsFramework::ScopedUndoBatch undo("Create entity from components"); - const AZStd::string name = AZStd::string::format("Entity%d", GetIEditor()->GetObjectManager()->GetObjectCount()); - - AZ::Entity* newEntity = aznew AZ::Entity(name.c_str()); - if (newEntity) - { - AzToolsFramework::EditorEntityContextRequestBus::Broadcast(&AzToolsFramework::EditorEntityContextRequests::AddRequiredComponents, *newEntity); - auto* transformComponent = newEntity->FindComponent(); - if (transformComponent) - { - transformComponent->SetWorldTM(AZ::Transform::CreateTranslation(contextVP->m_hitLocation)); - } - - // Add the entity to the editor context, which activates it and creates the sandbox object. - AzToolsFramework::EditorEntityContextRequestBus::Broadcast(&AzToolsFramework::EditorEntityContextRequests::AddEditorEntity, newEntity); - - // Prepare undo command last so it captures the final state of the entity. - AzToolsFramework::EntityCreateCommand* command = aznew AzToolsFramework::EntityCreateCommand(static_cast(newEntity->GetId())); - command->Capture(newEntity); - command->SetParent(undo.GetUndoBatch()); - - // Only need to add components to the new entity - AzToolsFramework::EntityIdList entities = { newEntity->GetId() }; - - AZStd::vector componentClassDataList; - AzToolsFramework::ComponentTypeMimeData::Get(event->mimeData(), componentClassDataList); - - AZ::ComponentTypeList componentsToAdd; - for (auto classData : componentClassDataList) - { - if (!classData) - { - continue; - } - - componentsToAdd.push_back(classData->m_typeId); - } - - AzToolsFramework::EntityCompositionRequests::AddComponentsOutcome addedComponentsResult = AZ::Failure(AZStd::string("Failed to call AddComponentsToEntities on EntityCompositionRequestBus")); - AzToolsFramework::EntityCompositionRequestBus::BroadcastResult(addedComponentsResult, &AzToolsFramework::EntityCompositionRequests::AddComponentsToEntities, entities, componentsToAdd); - - ToolsApplicationRequests::Bus::Broadcast(&ToolsApplicationRequests::AddDirtyEntity, newEntity->GetId()); - AzToolsFramework::ToolsApplicationRequestBus::Broadcast(&AzToolsFramework::ToolsApplicationRequests::SetSelectedEntities, entities); - } -} - -AZ::EntityId ComponentDataProxyModel::NewEntityFromSelection(const QModelIndexList& selection) -{ - return CreateEntityFromSelection(selection, this); -} - -AZ::EntityId ComponentDataModel::NewEntityFromSelection(const QModelIndexList& selection) -{ - return CreateEntityFromSelection(selection, this); -} - -bool ComponentDataProxyModel::filterAcceptsRow(int sourceRow, [[maybe_unused]] const QModelIndex &sourceParent) const -{ - if (m_selectedCategory.empty() && !filterRegExp().isValid()) - return true; - - ComponentDataModel* dataModel = static_cast(sourceModel()); - if (sourceRow < 0 || sourceRow >= dataModel->GetComponents().size()) - { - return false; - } - - const AZ::SerializeContext::ClassData* classData = dataModel->GetComponents()[sourceRow]; - if (!classData) - { - return false; - } - - // Get Category - if (!m_selectedCategory.empty()) - { - AZStd::string currentCateogry = ComponentDataModel::GetCategory(classData); - - if (AzFramework::StringFunc::Find(currentCateogry.c_str(), m_selectedCategory.c_str())) - { - return false; - } - } - - if (filterRegExp().isValid()) - { - QString componentName = QString::fromUtf8(classData->m_editData->m_name); - return componentName.contains(filterRegExp()); - } - - return true; -} - -void ComponentDataProxyModel::SetSelectedCategory(const AZStd::string& category) -{ - m_selectedCategory = category; - invalidate(); -} - -void ComponentDataProxyModel::ClearSelectedCategory() -{ - m_selectedCategory.clear(); - invalidate(); -} - -#include "UI/ComponentPalette/moc_ComponentDataModel.cpp" diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.h deleted file mode 100644 index 2c9cd27a5f..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.h +++ /dev/null @@ -1,128 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include - -#include -#include - -#include -#include -#include - -#include -#endif - -namespace ComponentDataUtilities -{ - // Given a list of selected components, use the provided model to get the components to add to any selected entities. - void AddComponentsToSelectedEntities(const QModelIndexList& selectedComponents, QAbstractItemModel* model); -} - -class CViewport; - -//! ComponentDataModel -//! Holds the data required to display components in a table, this includes component name, categories, icons. -class ComponentDataModel - : public QAbstractTableModel - , protected AzQtComponents::DragAndDropEventsBus::Handler // its okay if more than one of these is installed, the first one gets it. -{ - Q_OBJECT - -public: - AZ_CLASS_ALLOCATOR(ComponentDataModel, AZ::SystemAllocator, 0); - - using ComponentClassList = AZStd::vector; - using ComponentCategorySet = AZStd::set; - using ComponentClassMap = AZStd::unordered_map>; - using ComponentIconMap = AZStd::unordered_map; - - enum ColumnIndex - { - Icon, - Category, - Name, - Count - }; - - enum CustomRoles - { - ClassDataRole = Qt::UserRole + 1 - }; - - ComponentDataModel(QObject* parent = nullptr); - ~ComponentDataModel() override; - - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; - QModelIndex parent(const QModelIndex &child) const override; - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - int columnCount(const QModelIndex &parent = QModelIndex()) const override; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - - Qt::ItemFlags flags(const QModelIndex &index) const override; - - QMimeData* mimeData(const QModelIndexList& indexes) const override; - - const AZ::SerializeContext::ClassData* GetClassData(const QModelIndex&) const; - - AZ::EntityId NewEntityFromSelection(const QModelIndexList& selection); - - static const char* GetCategory(const AZ::SerializeContext::ClassData* classData); - - ComponentClassList& GetComponents() { return m_componentList; } - ComponentCategorySet& GetCategories() { return m_categories; } - -protected: - ////////////////////////////////////////////////////////////////////////// - // AzQtComponents::DragAndDropEventsBus::Handler - ////////////////////////////////////////////////////////////////////////// - void DragEnter(QDragEnterEvent* event, AzQtComponents::DragAndDropContextBase& context) override; - void DragMove(QDragMoveEvent* event, AzQtComponents::DragAndDropContextBase& context) override; - void DragLeave(QDragLeaveEvent* event) override; - void Drop(QDropEvent* event, AzQtComponents::DragAndDropContextBase& context) override; - bool CanAcceptDragAndDropEvent(QDropEvent* event, AzQtComponents::DragAndDropContextBase& context) const; - - ComponentClassList m_componentList; - ComponentClassMap m_componentMap; - ComponentIconMap m_componentIcons; - ComponentCategorySet m_categories; -}; - -//! ComponentDataProxyModel -//! FilterProxy for the ComponentDataModel is used along with the search criteria to filter the -//! list of components based on tags and/or selected category. -class ComponentDataProxyModel : public QSortFilterProxyModel -{ - Q_OBJECT - -public: - AZ_CLASS_ALLOCATOR(ComponentDataProxyModel, AZ::SystemAllocator, 0); - - ComponentDataProxyModel(QObject* parent = nullptr) - : QSortFilterProxyModel(parent) - {} - - // Creates a new entity and adds the selected components to it. - // It is specialized here to ensure it uses the correct indices according to the sorted data. - AZ::EntityId NewEntityFromSelection(const QModelIndexList& selection); - - // Filters rows according to the specifed tags and/or selected category - bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; - - // Set the category to filter by. - void SetSelectedCategory(const AZStd::string& category); - void ClearSelectedCategory(); - -protected: - - AZStd::string m_selectedCategory; -}; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake index b5a8b00855..28f96de862 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake @@ -20,10 +20,6 @@ set(FILES UI/QComponentEntityEditorOutlinerWindow.cpp UI/AssetCatalogModel.h UI/AssetCatalogModel.cpp - UI/ComponentPalette/CategoriesList.h - UI/ComponentPalette/CategoriesList.cpp - UI/ComponentPalette/ComponentDataModel.h - UI/ComponentPalette/ComponentDataModel.cpp UI/ComponentPalette/ComponentPaletteSettings.h UI/Outliner/OutlinerDisplayOptionsMenu.h UI/Outliner/OutlinerDisplayOptionsMenu.cpp diff --git a/Code/Editor/Util/Contrib/NvFloatMath.inl b/Code/Editor/Util/Contrib/NvFloatMath.inl deleted file mode 100644 index 6bd3b9f7c5..0000000000 --- a/Code/Editor/Util/Contrib/NvFloatMath.inl +++ /dev/null @@ -1,455 +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 - * - */ -/* BEGIN CONTENTS OF README.TXT ------------------------------------- -The ConvexDecomposition library was written by John W. Ratcliff mailto:jratcliffscarab@gmail.com - -What is Convex Decomposition? - -Convex Decomposition is when you take an arbitrarily complex triangle mesh and sub-divide it into -a collection of discrete compound pieces (each represented as a convex hull) to approximate -the original shape of the objet. - -This is required since few physics engines can treat aribtrary triangle mesh objects as dynamic -objects. Even those engines which can handle this use case incurr a huge performance and memory -penalty to do so. - -By breaking a complex triangle mesh up into a discrete number of convex components you can greatly -improve performance for dynamic simulations. - --------------------------------------------------------------------------------- - -This code is released under the MIT license. - -The code is functional but could use the following improvements: - -(1) The convex hull generator, originally written by Stan Melax, could use some major code cleanup. - -(2) The code to remove T-junctions appears to have a bug in it. This code was working fine before, -but I haven't had time to debug why it stopped working. - -(3) Island generation once the mesh has been split is currently disabled due to the fact that the -Remove Tjunctions functionality has a bug in it. - -(4) The code to perform a raycast against a triangle mesh does not currently use any acceleration -data structures. - -(5) When a split is performed, the surface that got split is not 'capped'. This causes a problem -if you use a high recursion depth on your convex decomposition. It will cause the object to -be modelled as if it had a hollow interior. A lot of work was done to solve this problem, but -it hasn't been integrated into this code drop yet. - - -*/// ---------- END CONTENTS OF README.TXT ---------------------------- - - -// a set of routines that let you do common 3d math -// operations without any vector, matrix, or quaternion -// classes or templates. -// -// a vector (or point) is a 'NxF32 *' to 3 floating point numbers. -// a matrix is a 'NxF32 *' to an array of 16 floating point numbers representing a 4x4 transformation matrix compatible with D3D or OGL -// a quaternion is a 'NxF32 *' to 4 floats representing a quaternion x,y,z,w -// -// -/*! -** -** Copyright (c) 2009 by John W. Ratcliff mailto:jratcliffscarab@gmail.com -** -** Portions of this source has been released with the PhysXViewer application, as well as -** Rocket, CreateDynamics, ODF, and as a number of sample code snippets. -** -** If you find this code useful or you are feeling particularily generous I would -** ask that you please go to http://www.amillionpixels.us and make a donation -** to Troy DeMolay. -** -** DeMolay is a youth group for young men between the ages of 12 and 21. -** It teaches strong moral principles, as well as leadership skills and -** public speaking. The donations page uses the 'pay for pixels' paradigm -** where, in this case, a pixel is only a single penny. Donations can be -** made for as small as $4 or as high as a $100 block. Each person who donates -** will get a link to their own site as well as acknowledgement on the -** donations blog located here http://www.amillionpixels.blogspot.com/ -** -** If you wish to contact me you can use the following methods: -** -** Skype ID: jratcliff63367 -** Yahoo: jratcliff63367 -** AOL: jratcliff1961 -** email: jratcliffscarab@gmail.com -** -** -** The MIT license: -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and associated documentation files (the "Software"), to deal -** in the Software without restriction, including without limitation the rights -** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -** copies of the Software, and to permit persons to whom the Software is furnished -** to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in all -** copies or substantial portions of the Software. - -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -** WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -*/ - -class TVec -{ -public: - TVec(NxF64 _x, NxF64 _y, NxF64 _z) { x = _x; y = _y; z = _z; }; - TVec(void) { }; - - NxF64 x; - NxF64 y; - NxF64 z; -}; - - -class CTriangulator -{ -public: - /// Default constructor - CTriangulator(); - - /// Default destructor - virtual ~CTriangulator(); - - /// Returns the given point in the triangulator array - inline TVec get(const TU32 id) { return mPoints[id]; } - - virtual void reset(void) - { - mInputPoints.clear(); - mPoints.clear(); - mIndices.clear(); - } - - virtual void addPoint(NxF64 x, NxF64 y, NxF64 z) - { - TVec v(x, y, z); - // update bounding box... - if (mInputPoints.empty()) - { - mMin = v; - mMax = v; - } - else - { - if (x < mMin.x) - { - mMin.x = x; - } - if (y < mMin.y) - { - mMin.y = y; - } - if (z < mMin.z) - { - mMin.z = z; - } - - if (x > mMax.x) - { - mMax.x = x; - } - if (y > mMax.y) - { - mMax.y = y; - } - if (z > mMax.z) - { - mMax.z = z; - } - } - mInputPoints.push_back(v); - } - - // Triangulation happens in 2d. We could inverse transform the polygon around the normal direction, or we just use the two most signficant axes - // Here we find the two longest axes and use them to triangulate. Inverse transforming them would introduce more doubleing point error and isn't worth it. - virtual NxU32* triangulate(NxU32& tcount, NxF64 epsilon) - { - NxU32* ret = 0; - tcount = 0; - mEpsilon = epsilon; - - if (!mInputPoints.empty()) - { - mPoints.clear(); - - NxF64 dx = mMax.x - mMin.x; // locate the first, second and third longest edges and store them in i1, i2, i3 - NxF64 dy = mMax.y - mMin.y; - NxF64 dz = mMax.z - mMin.z; - - NxU32 i1, i2, i3; - - if (dx > dy && dx > dz) - { - i1 = 0; - if (dy > dz) - { - i2 = 1; - i3 = 2; - } - else - { - i2 = 2; - i3 = 1; - } - } - else if (dy > dx && dy > dz) - { - i1 = 1; - if (dx > dz) - { - i2 = 0; - i3 = 2; - } - else - { - i2 = 2; - i3 = 0; - } - } - else - { - i1 = 2; - if (dx > dy) - { - i2 = 0; - i3 = 1; - } - else - { - i2 = 1; - i3 = 0; - } - } - - NxU32 pcount = (NxU32)mInputPoints.size(); - const NxF64* points = &mInputPoints[0].x; - for (NxU32 i = 0; i < pcount; i++) - { - TVec v(points[i1], points[i2], points[i3]); - mPoints.push_back(v); - points += 3; - } - - mIndices.clear(); - triangulate(mIndices); - tcount = (NxU32)mIndices.size() / 3; - if (tcount) - { - ret = &mIndices[0]; - } - } - return ret; - } - - virtual const NxF64* getPoint(NxU32 index) - { - return &mInputPoints[index].x; - } - - -private: - NxF64 mEpsilon; - TVec mMin; - TVec mMax; - TVecVector mInputPoints; - TVecVector mPoints; - TU32Vector mIndices; - - /// Tests if a point is inside the given triangle - bool _insideTriangle(const TVec& A, const TVec& B, const TVec& C, const TVec& P); - - /// Returns the area of the contour - NxF64 _area(); - - bool _snip(NxI32 u, NxI32 v, NxI32 w, NxI32 n, NxI32* V); - - /// Processes the triangulation - void _process(TU32Vector& indices); - /// Triangulates the contour - void triangulate(TU32Vector& indices); -}; - -/// Default constructor -CTriangulator::CTriangulator(void) -{ -} - -/// Default destructor -CTriangulator::~CTriangulator() -{ -} - -/// Triangulates the contour -void CTriangulator::triangulate(TU32Vector& indices) -{ - _process(indices); -} - -/// Processes the triangulation -void CTriangulator::_process(TU32Vector& indices) -{ - const NxI32 n = (const NxI32)mPoints.size(); - if (n < 3) - { - return; - } - NxI32* V = (NxI32*)MEMALLOC_MALLOC(sizeof(NxI32) * n); - - bool flipped = false; - - if (0.0f < _area()) - { - for (NxI32 v = 0; v < n; v++) - { - V[v] = v; - } - } - else - { - flipped = true; - for (NxI32 v = 0; v < n; v++) - { - V[v] = (n - 1) - v; - } - } - - NxI32 nv = n; - NxI32 count = 2 * nv; - for (NxI32 m = 0, v = nv - 1; nv > 2; ) - { - if (0 >= (count--)) - { - return; - } - - NxI32 u = v; - if (nv <= u) - { - u = 0; - } - v = u + 1; - if (nv <= v) - { - v = 0; - } - NxI32 w = v + 1; - if (nv <= w) - { - w = 0; - } - - if (_snip(u, v, w, nv, V)) - { - NxI32 a, b, c, s, t; - a = V[u]; - b = V[v]; - c = V[w]; - if (flipped) - { - indices.push_back(a); - indices.push_back(b); - indices.push_back(c); - } - else - { - indices.push_back(c); - indices.push_back(b); - indices.push_back(a); - } - m++; - for (s = v, t = v + 1; t < nv; s++, t++) - { - V[s] = V[t]; - } - nv--; - count = 2 * nv; - } - } - - MEMALLOC_FREE(V); -} - -/// Returns the area of the contour -NxF64 CTriangulator::_area() -{ - NxI32 n = (NxU32)mPoints.size(); - NxF64 A = 0.0f; - for (NxI32 p = n - 1, q = 0; q < n; p = q++) - { - const TVec& pval = mPoints[p]; - const TVec& qval = mPoints[q]; - A += pval.x * qval.y - qval.x * pval.y; - } - A *= 0.5f; - return A; -} - -bool CTriangulator::_snip(NxI32 u, NxI32 v, NxI32 w, NxI32 n, NxI32* V) -{ - NxI32 p; - - const TVec& A = mPoints[V[u]]; - const TVec& B = mPoints[V[v]]; - const TVec& C = mPoints[V[w]]; - - if (mEpsilon > (((B.x - A.x) * (C.y - A.y)) - ((B.y - A.y) * (C.x - A.x)))) - { - return false; - } - - for (p = 0; p < n; p++) - { - if ((p == u) || (p == v) || (p == w)) - { - continue; - } - const TVec& P = mPoints[V[p]]; - if (_insideTriangle(A, B, C, P)) - { - return false; - } - } - return true; -} - -/// Tests if a point is inside the given triangle -bool CTriangulator::_insideTriangle(const TVec& A, const TVec& B, const TVec& C, const TVec& P) -{ - NxF64 ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy; - NxF64 cCROSSap, bCROSScp, aCROSSbp; - - ax = C.x - B.x; - ay = C.y - B.y; - bx = A.x - C.x; - by = A.y - C.y; - cx = B.x - A.x; - cy = B.y - A.y; - apx = P.x - A.x; - apy = P.y - A.y; - bpx = P.x - B.x; - bpy = P.y - B.y; - cpx = P.x - C.x; - cpy = P.y - C.y; - - aCROSSbp = ax * bpy - ay * bpx; - cCROSSap = cx * apy - cy * apx; - bCROSScp = bx * cpy - by * cpx; - - return ((aCROSSbp >= 0.0f) && (bCROSScp >= 0.0f) && (cCROSSap >= 0.0f)); -} - From 03543a9e8eb6047b8fbf912d933759ade5887300 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 19 Nov 2021 16:52:26 -0800 Subject: [PATCH 181/620] Removes ColorUtils from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/ColorUtils.h | 22 ---------------------- Code/Editor/editor_core_files.cmake | 1 - 2 files changed, 23 deletions(-) delete mode 100644 Code/Editor/Util/ColorUtils.h diff --git a/Code/Editor/Util/ColorUtils.h b/Code/Editor/Util/ColorUtils.h deleted file mode 100644 index 9993238e10..0000000000 --- a/Code/Editor/Util/ColorUtils.h +++ /dev/null @@ -1,22 +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 : Utility classes used by Editor. - - -#pragma once - -#include - -class QColor; - -QColor ColorLinearToGamma(ColorF col); -ColorF ColorGammaToLinear(const QColor& col); -QColor ColorToQColor(uint32 color); - diff --git a/Code/Editor/editor_core_files.cmake b/Code/Editor/editor_core_files.cmake index 60fe18ec65..7cb40927a4 100644 --- a/Code/Editor/editor_core_files.cmake +++ b/Code/Editor/editor_core_files.cmake @@ -58,7 +58,6 @@ set(FILES Util/ImageHistogram.h Util/Image.h Util/ColorUtils.cpp - Util/ColorUtils.h Undo/Undo.cpp Undo/IUndoManagerListener.h Undo/IUndoObject.h From c00d3105c6eb31588edd787c91ff2910566d4657 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 19 Nov 2021 19:00:25 -0800 Subject: [PATCH 182/620] =?UTF-8?q?=EF=BB=BFRemoves=20some=20CryAssert=20m?= =?UTF-8?q?ethods=20that=20are=20not=20being=20used=20because=20we=20redir?= =?UTF-8?q?ected=20it=20all=20to=20AZ=5FAssert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/EditorDefs.h | 15 - Code/Editor/StartupTraceHandler.cpp | 16 - Code/Editor/Util/ColorUtils.cpp | 3 - Code/Editor/Util/MemoryBlock.cpp | 7 +- Code/Legacy/CryCommon/CryAssert.h | 90 +--- Code/Legacy/CryCommon/CryAssert_Android.h | 101 ---- Code/Legacy/CryCommon/CryAssert_Linux.h | 132 ----- Code/Legacy/CryCommon/CryAssert_Mac.h | 107 ---- Code/Legacy/CryCommon/CryAssert_iOS.h | 99 ---- Code/Legacy/CryCommon/CryAssert_impl.h | 468 ------------------ Code/Legacy/CryCommon/ISystem.h | 8 - Code/Legacy/CryCommon/WinBase.cpp | 10 - Code/Legacy/CryCommon/crycommon_files.cmake | 5 - Code/Legacy/CryCommon/platform.h | 6 - Code/Legacy/CryCommon/platform_impl.cpp | 6 - Code/Legacy/CrySystem/AZCoreLogSink.h | 53 -- Code/Legacy/CrySystem/System.cpp | 5 +- Code/Legacy/CrySystem/System.h | 7 - Gems/Maestro/Code/Source/Cinematics/Movie.cpp | 2 +- 19 files changed, 10 insertions(+), 1130 deletions(-) delete mode 100644 Code/Legacy/CryCommon/CryAssert_Android.h delete mode 100644 Code/Legacy/CryCommon/CryAssert_Linux.h delete mode 100644 Code/Legacy/CryCommon/CryAssert_Mac.h delete mode 100644 Code/Legacy/CryCommon/CryAssert_iOS.h delete mode 100644 Code/Legacy/CryCommon/CryAssert_impl.h diff --git a/Code/Editor/EditorDefs.h b/Code/Editor/EditorDefs.h index 5dd653679b..e86f007604 100644 --- a/Code/Editor/EditorDefs.h +++ b/Code/Editor/EditorDefs.h @@ -166,18 +166,3 @@ #ifdef LoadCursor #undef LoadCursor #endif - - -#ifdef _DEBUG -#if !defined(AZ_PLATFORM_LINUX) -#ifdef assert -#undef assert -#if defined(USE_AZ_ASSERT) -#define assert(condition) AZ_Assert(condition, "") -#else -#define assert CRY_ASSERT -#endif -#endif // !defined(AZ_PLATFORM_LINUX) -#endif -#endif - diff --git a/Code/Editor/StartupTraceHandler.cpp b/Code/Editor/StartupTraceHandler.cpp index 498bf10e31..407b030e9a 100644 --- a/Code/Editor/StartupTraceHandler.cpp +++ b/Code/Editor/StartupTraceHandler.cpp @@ -37,26 +37,10 @@ namespace SandboxEditor bool StartupTraceHandler::OnPreAssert(const char* fileName, int line, const char* func, const char* message) { - // Asserts are more fatal than errors, and need to be displayed right away. - // After the assert occurs, nothing else may be functional enough to collect and display messages. - - // Only use Cry message boxes if we aren't using native dialog boxes -#ifndef USE_AZ_ASSERT - if (message == nullptr || message[0] == 0) - { - AZStd::string emptyText = AZStd::string::format("Assertion failed in %s %s:%i", func, fileName, line); - OnMessage(emptyText.c_str(), nullptr, MessageDisplayBehavior::AlwaysShow); - } - else - { - OnMessage(message, nullptr, MessageDisplayBehavior::AlwaysShow); - } -#else AZ_UNUSED(fileName); AZ_UNUSED(line); AZ_UNUSED(func); AZ_UNUSED(message); -#endif // !USE_AZ_ASSERT // Return false so other listeners can handle this. The StartupTraceHandler won't report messages // will probably crash before that occurs, because this is an assert. diff --git a/Code/Editor/Util/ColorUtils.cpp b/Code/Editor/Util/ColorUtils.cpp index 02e3c9b615..3ca715e021 100644 --- a/Code/Editor/Util/ColorUtils.cpp +++ b/Code/Editor/Util/ColorUtils.cpp @@ -6,9 +6,6 @@ * */ - -#include "ColorUtils.h" - // Qt #include diff --git a/Code/Editor/Util/MemoryBlock.cpp b/Code/Editor/Util/MemoryBlock.cpp index b7ae017113..6b57557f6f 100644 --- a/Code/Editor/Util/MemoryBlock.cpp +++ b/Code/Editor/Util/MemoryBlock.cpp @@ -169,13 +169,12 @@ void CMemoryBlock::Uncompress(CMemoryBlock& toBlock) const assert(this != &toBlock); toBlock.Allocate(m_uncompressedSize); toBlock.m_uncompressedSize = 0; - unsigned long destSize = m_uncompressedSize; #if !defined(NDEBUG) - int result = -#endif - uncompress((unsigned char*)toBlock.GetBuffer(), &destSize, (unsigned char*)GetBuffer(), GetSize()); + unsigned long destSize = m_uncompressedSize; + int result = uncompress((unsigned char*)toBlock.GetBuffer(), &destSize, (unsigned char*)GetBuffer(), GetSize()); assert(result == Z_OK); assert(destSize == static_cast(m_uncompressedSize)); +#endif } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Legacy/CryCommon/CryAssert.h b/Code/Legacy/CryCommon/CryAssert.h index 1494654d87..c401dacb00 100644 --- a/Code/Legacy/CryCommon/CryAssert.h +++ b/Code/Legacy/CryCommon/CryAssert.h @@ -13,92 +13,12 @@ #include -//----------------------------------------------------------------------------------------------------- -// Just undef this if you want to use the standard assert function -//----------------------------------------------------------------------------------------------------- - -// if AZ_ENABLE_TRACING is enabled, then calls to AZ_Assert(...) will flow in. This is the case -// even in Profile mode - thus if you want to manage what happens, USE_CRY_ASSERT also needs to be enabled in those cases. -// if USE_CRY_ASSERT is not enabled, but AZ_ENABLE_TRACING is enabled, then the default behavior for assets will occur instead -// which is to throw the DEBUG BREAK exception / signal, which tends to end with application shutdown. -#if defined(AZ_ENABLE_TRACE_ASSERTS) -#define USE_AZ_ASSERT -#endif - -#if !defined (USE_AZ_ASSERT) && defined(AZ_ENABLE_TRACING) -#undef USE_CRY_ASSERT -#define USE_CRY_ASSERT -#endif - -// you can undefine this. It will cause the assert message box to appear anywhere that USE_CRY_ASSERT is enabled -// instead of it only appearing in debug. -// if this is DEFINED then only in debug builds will you see the message box. In other builds, CRY_ASSERTS become CryWarning instead of -// instead (showing no message box, only a warning). -#define CRY_ASSERT_DIALOG_ONLY_IN_DEBUG - -#if defined(FORCE_STANDARD_ASSERT) || defined(USE_AZ_ASSERT) -#undef USE_CRY_ASSERT -#undef CRY_ASSERT_DIALOG_ONLY_IN_DEBUG -#endif - // Using AZ_Assert for all assert kinds (assert =, CRY_ASSERT, AZ_Assert). // see Trace::Assert for implementation -#if defined(USE_AZ_ASSERT) - #undef assert - #if !defined(NDEBUG) - #define assert(condition) AZ_Assert(condition, "%s", #condition) - #else - #define assert(condition) - #endif -#endif //defined(USE_AZ_ASSERT) +#undef assert +#define assert(condition) AZ_Assert(condition, "%s", #condition) -//----------------------------------------------------------------------------------------------------- -// Use like this: -// CRY_ASSERT(expression); -// CRY_ASSERT_MESSAGE(expression,"Useful message"); -// CRY_ASSERT_TRACE(expression,("This should never happen because parameter n%d named %s is %f",iParameter,szParam,fValue)); -//----------------------------------------------------------------------------------------------------- +#define CRY_ASSERT(condition) AZ_Assert(condition, "%s", #condition) +#define CRY_ASSERT_MESSAGE(condition, message) AZ_Assert(condition, message) +#define CRY_ASSERT_TRACE(condition, parenthese_message) AZ_Assert(condition, parenthese_message) -#if defined(AZ_RESTRICTED_PLATFORM) - #include AZ_RESTRICTED_FILE(CryAssert_h) -#endif -#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED) - #undef AZ_RESTRICTED_SECTION_IMPLEMENTED -#elif defined(WIN32) || defined(APPLE) || defined(LINUX) - #define CRYASSERT_H_TRAIT_USE_CRY_ASSERT_MESSAGE 1 -#endif - -#if defined(USE_CRY_ASSERT) && CRYASSERT_H_TRAIT_USE_CRY_ASSERT_MESSAGE -void CryAssertTrace(const char*, ...); -bool CryAssert(const char*, const char*, unsigned int, bool*); - - #define CRY_ASSERT(condition) CRY_ASSERT_MESSAGE(condition, NULL) - - #define CRY_ASSERT_MESSAGE(condition, message) CRY_ASSERT_TRACE(condition, (message)) - - #define CRY_ASSERT_TRACE(condition, parenthese_message) \ - do \ - { \ - static bool s_bIgnoreAssert = false; \ - if (!s_bIgnoreAssert && !(condition)) \ - { \ - CryAssertTrace parenthese_message; \ - if (CryAssert(#condition, __FILE__, __LINE__, &s_bIgnoreAssert)) \ - { \ - AZ::Debug::Trace::Break(); \ - } \ - } \ - } while (0) - - #undef assert - #define assert CRY_ASSERT -#elif !defined(CRY_ASSERT) -#ifndef USE_AZ_ASSERT - #include -#endif //USE_AZ_ASSERT - #define CRY_ASSERT(condition) assert(condition) - #define CRY_ASSERT_MESSAGE(condition, message) assert(condition) - #define CRY_ASSERT_TRACE(condition, parenthese_message) assert(condition) -#endif - -//----------------------------------------------------------------------------------------------------- diff --git a/Code/Legacy/CryCommon/CryAssert_Android.h b/Code/Legacy/CryCommon/CryAssert_Android.h deleted file mode 100644 index e6c285dc9d..0000000000 --- a/Code/Legacy/CryCommon/CryAssert_Android.h +++ /dev/null @@ -1,101 +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 : Assert dialog box for android - - -#ifndef CRYINCLUDE_CRYCOMMON_CRYASSERT_ANDROID_H -#define CRYINCLUDE_CRYCOMMON_CRYASSERT_ANDROID_H -#pragma once - -#if defined(USE_CRY_ASSERT) && defined(ANDROID) - -#include - -static char gs_szMessage[MAX_PATH]; - -void CryAssertTrace(const char* szFormat, ...) -{ - if (gEnv == 0) - { - return; - } - - if (!gEnv->bIgnoreAllAsserts) - { - if (szFormat == NULL) - { - gs_szMessage[0] = '\0'; - } - else - { - va_list args; - va_start(args, szFormat); - vsnprintf(gs_szMessage, sizeof(gs_szMessage), szFormat, args); - va_end(args); - } - } -} - -bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, bool* pIgnore) -{ - if (!gEnv) - { - return true; - } - -#if defined(CRY_ASSERT_DIALOG_ONLY_IN_DEBUG) && !defined(AZ_DEBUG_BUILD) - // we are in a non-debug build, so we should turn this into a warning instead. - if ((gEnv) && (gEnv->pLog)) - { - if (!gEnv->bIgnoreAllAsserts) - { - gEnv->pLog->LogWarning("%s(%u): Assertion failed - \"%s\"", szFile, line, szCondition); - } - } - - if (pIgnore) - { - // avoid showing the same one repeatedly. - *pIgnore = true; - } - return false; -#endif - - gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line); - - if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts) - { - AZ::NativeUI::AssertAction result; - EBUS_EVENT_RESULT(result, AZ::NativeUI::NativeUIRequestBus, DisplayAssertDialog, gs_szMessage); - - switch (result) - { - case AZ::NativeUI::AssertAction::IGNORE_ASSERT: - return false; - case AZ::NativeUI::AssertAction::IGNORE_ALL_ASSERTS: - gEnv->bNoAssertDialog = true; - gEnv->bIgnoreAllAsserts = true; - return false; - case AZ::NativeUI::AssertAction::BREAK: - return true; - default: - break; - } - - return true; - } - else - { - return false; - } -} - -#endif -#endif // CRYINCLUDE_CRYCOMMON_CRYASSERT_ANDROID_H diff --git a/Code/Legacy/CryCommon/CryAssert_Linux.h b/Code/Legacy/CryCommon/CryAssert_Linux.h deleted file mode 100644 index 112c60a80c..0000000000 --- a/Code/Legacy/CryCommon/CryAssert_Linux.h +++ /dev/null @@ -1,132 +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 : -// Assert dialog box for LINUX. The linux assert dialog is based on a -// small ncurses application which writes the choice to a file. This -// was chosen since there is no default UI system on Linux. X11 wasn't -// used due to the possibility of the system running another display -// protocol (e.g.: WayLand, Mir) - -#ifndef CRYINCLUDE_CRYCOMMON_CRYASSERT_LINUX_H -#define CRYINCLUDE_CRYCOMMON_CRYASSERT_LINUX_H -#pragma once - -#if defined(USE_CRY_ASSERT) && defined(LINUX) && !defined(ANDROID) - -static char gs_szMessage[MAX_PATH]; - -void CryAssertTrace(const char* szFormat, ...) -{ - if (gEnv == 0) - { - return; - } - - if (!gEnv->bIgnoreAllAsserts) - { - if (szFormat == NULL) - { - gs_szMessage[0] = '\0'; - } - else - { - va_list args; - va_start(args, szFormat); - vsnprintf(gs_szMessage, sizeof(gs_szMessage), szFormat, args); - va_end(args); - } - } -} - -bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, bool* pIgnore) -{ - if (!gEnv) - { - return false; - } - -#if defined(CRY_ASSERT_DIALOG_ONLY_IN_DEBUG) && !defined(AZ_DEBUG_BUILD) - // we are in a non-debug build, so we should turn this into a warning instead. - if (gEnv->pLog) - { - if (!gEnv->bIgnoreAllAsserts) - { - gEnv->pLog->LogWarning("%s(%u): Assertion failed - \"%s\"", szFile, line, szCondition); - } - } - if (pIgnore) - { - // avoid showing the same one repeatedly. - *pIgnore = true; - } - return false; -#endif - - static const int max_len = 4096; - static char gs_command_str[4096]; - static AZStd::recursive_mutex lock; - - gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line); - - size_t file_len = strlen(szFile); - - if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts) - { - AZStd::scoped_lock lk(lock); - snprintf(gs_command_str, max_len, "xterm -geometry 100x20 -n 'Assert Dialog [Linux Launcher]' -T 'Assert Dialog [Linux Launcher]' -e 'BinLinux/assert_term \"%s\" \"%s\" %d \"%s\"; echo \"$?\" > .assert_return'", - szCondition, (file_len > 60) ? szFile + (file_len - 61) : szFile, line, gs_szMessage); - int ret = system(gs_command_str); - if (ret != 0) - { - CryLogAlways(" Terminal failed to execute"); - return false; - } - - FILE* assert_file = fopen(".assert_return", "r"); - if (!assert_file) - { - CryLogAlways(" Couldn't open assert file"); - return false; - } - int result = -1; - fscanf(assert_file, "%d", &result); - fclose(assert_file); - - switch (result) - { - case 0: - break; - case 1: - *pIgnore = true; - break; - case 2: - gEnv->bIgnoreAllAsserts = true; - break; - case 3: - return true; - break; - case 4: - raise(SIGABRT); - exit(-1); - break; - default: - CryLogAlways(" Unknown result in assert file: %d", result); - return false; - } - } - - - return false; -} - -#endif - -#endif // CRYINCLUDE_CRYCOMMON_CRYASSERT_LINUX_H diff --git a/Code/Legacy/CryCommon/CryAssert_Mac.h b/Code/Legacy/CryCommon/CryAssert_Mac.h deleted file mode 100644 index f0a893630e..0000000000 --- a/Code/Legacy/CryCommon/CryAssert_Mac.h +++ /dev/null @@ -1,107 +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 : Assert dialog box for Mac OS X - - -#ifndef CRYINCLUDE_CRYCOMMON_CRYASSERT_MAC_H -#define CRYINCLUDE_CRYCOMMON_CRYASSERT_MAC_H -#pragma once - -#if defined(USE_CRY_ASSERT) && defined(MAC) -#include - -static char gs_szMessage[MAX_PATH]; - -void CryAssertTrace(const char* szFormat, ...) -{ - if (gEnv == 0) - { - return; - } - - if (!gEnv->bIgnoreAllAsserts) - { - if (szFormat == NULL) - { - gs_szMessage[0] = '\0'; - } - else - { - va_list args; - va_start(args, szFormat); - vsnprintf(gs_szMessage, sizeof(gs_szMessage), szFormat, args); - va_end(args); - } - } -} - -bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, bool* pIgnore) -{ - if (!gEnv) - { - return false; - } - -#if defined(CRY_ASSERT_DIALOG_ONLY_IN_DEBUG) && !defined(AZ_DEBUG_BUILD) - // we are in a non-debug build, so we should turn this into a warning instead. - if ((gEnv) && (gEnv->pLog)) - { - if (!gEnv->bIgnoreAllAsserts) - { - gEnv->pLog->LogWarning("%s(%u): Assertion failed - \"%s\"", szFile, line, szCondition); - } - } - - if (pIgnore) - { - // avoid showing the same one repeatedly. - *pIgnore = true; - } - return false; -#endif - - static const int max_len = 4096; - static char gs_command_str[4096]; - - gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line); - - size_t file_len = strlen(szFile); - - if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts) - { - AZ::NativeUI::AssertAction result; - EBUS_EVENT_RESULT(result, AZ::NativeUI::NativeUIRequestBus, DisplayAssertDialog, gs_szMessage); - - switch(result) - { - case AZ::NativeUI::AssertAction::IGNORE_ASSERT: - return false; - case AZ::NativeUI::AssertAction::IGNORE_ALL_ASSERTS: - gEnv->bNoAssertDialog = true; - gEnv->bIgnoreAllAsserts = true; - return false; - case AZ::NativeUI::AssertAction::BREAK: - return true; - default: - break; - } - - // For asserts on the Mac always trigger a debug break. Annoying but at least it does not kill the thread like assert() does. - __asm__("int $3"); - } - - - return false; -} - - -#endif - -#endif // CRYINCLUDE_CRYCOMMON_CRYASSERT_MAC_H diff --git a/Code/Legacy/CryCommon/CryAssert_iOS.h b/Code/Legacy/CryCommon/CryAssert_iOS.h deleted file mode 100644 index e7f07eba9b..0000000000 --- a/Code/Legacy/CryCommon/CryAssert_iOS.h +++ /dev/null @@ -1,99 +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 : Assert dialog box for Mac OS X - - -#ifndef CRYINCLUDE_CRYCOMMON_CRYASSERT_IOS_H -#define CRYINCLUDE_CRYCOMMON_CRYASSERT_IOS_H -#pragma once - -#if defined(USE_CRY_ASSERT) && (defined(IOS) - -#include - -static char gs_szMessage[MAX_PATH]; - -void CryAssertTrace(const char* szFormat, ...) -{ - if (gEnv == 0) - { - return; - } - - if (!gEnv->bIgnoreAllAsserts) - { - if (szFormat == NULL) - { - gs_szMessage[0] = '\0'; - } - else - { - va_list args; - va_start(args, szFormat); - vsnprintf(gs_szMessage, sizeof(gs_szMessage), szFormat, args); - va_end(args); - } - } -} - -bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, bool* pIgnore) -{ - if (!gEnv) - { - return false; - } - -#if defined(CRY_ASSERT_DIALOG_ONLY_IN_DEBUG) && !defined(AZ_DEBUG_BUILD) - // we are in a non-debug build, so we should turn this into a warning instead. - if ((gEnv) && (gEnv->pLog)) - { - if (!gEnv->bIgnoreAllAsserts) - { - gEnv->pLog->LogWarning("%s(%u): Assertion failed - \"%s\"", szFile, line, szCondition); - } - } - - if (pIgnore) - { - // avoid showing the same one repeatedly. - *pIgnore = true; - } - return false; -#endif - - gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line); - - if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts) - { - printf("!!ASSERT!!\n\tCondition: %s\n\tMessage : %s\n\tFile : %s\n\tLine : %d", szCondition, gs_szMessage, szFile, line); - - AZ::NativeUI::AssertAction result; - EBUS_EVENT_RESULT(result, AZ::NativeUI::NativeUIRequestBus, DisplayAssertDialog, gs_szMessage); - - switch(result) - { - case AZ::NativeUI::AssertAction::IGNORE_ASSERT: - return false; - case AZ::NativeUI::AssertAction::IGNORE_ALL_ASSERTS: - gEnv->bNoAssertDialog = true; - gEnv->bIgnoreAllAsserts = true; - return false; - case AZ::NativeUI::AssertAction::BREAK: - return true; - default: - break; - } - } - return false; -} - -#endif - -#endif // CRYINCLUDE_CRYCOMMON_CRYASSERT_IOS_H diff --git a/Code/Legacy/CryCommon/CryAssert_impl.h b/Code/Legacy/CryCommon/CryAssert_impl.h deleted file mode 100644 index 27c4024d42..0000000000 --- a/Code/Legacy/CryCommon/CryAssert_impl.h +++ /dev/null @@ -1,468 +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 : Assert dialog box - -#pragma once - -#if defined(AZ_RESTRICTED_PLATFORM) -#undef AZ_RESTRICTED_SECTION -#define CRYASSERT_IMPL_H_SECTION_1 1 -#define CRYASSERT_IMPL_H_SECTION_2 2 -#endif - -#if defined(USE_CRY_ASSERT) -#if defined(AZ_RESTRICTED_PLATFORM) - #define AZ_RESTRICTED_SECTION CRYASSERT_IMPL_H_SECTION_1 - #include AZ_RESTRICTED_FILE(CryAssert_impl_h) -#endif - -#if defined(APPLE) -#if defined(MAC) -#include "CryAssert_Mac.h" -#else -#include "CryAssert_iOS.h" -#endif -#endif - -#if defined(LINUX) -#if defined(ANDROID) -#include "CryAssert_Android.h" -#else -#include "CryAssert_Linux.h" -#endif -#endif - -#if defined(AZ_RESTRICTED_PLATFORM) - #define AZ_RESTRICTED_SECTION CRYASSERT_IMPL_H_SECTION_2 - #include AZ_RESTRICTED_FILE(CryAssert_impl_h) -#elif defined(WIN32) - -//----------------------------------------------------------------------------------------------------- - -#include - -#include - -//----------------------------------------------------------------------------------------------------- - -#define IDD_DIALOG_ASSERT 101 -#define IDC_CRYASSERT_EDIT_LINE 1000 -#define IDC_CRYASSERT_EDIT_FILE 1001 -#define IDC_CRYASSERT_EDIT_CONDITION 1002 -#define IDC_CRYASSERT_BUTTON_CONTINUE 1003 -#define IDC_CRYASSERT_EDIT_REASON 1004 -#define IDC_CRYASSERT_BUTTON_IGNORE 1005 -#define IDC_CRYASSERT_BUTTON_STOP 1007 -#define IDC_CRYASSERT_BUTTON_BREAK 1008 -#define IDC_CRYASSERT_BUTTON_IGNORE_ALL 1009 - -#define IDC_CRYASSERT_STATIC_TEXT 0 - -#define DLG_TITLE L"Assertion Failed" -#define DLG_FONT L"MS Sans Serif" -#define DLG_ITEM_TEXT_0 L"Continue" -#define DLG_ITEM_TEXT_1 L"Stop" -#define DLG_ITEM_TEXT_2 L"Info" -#define DLG_ITEM_TEXT_3 L"" -#define DLG_ITEM_TEXT_4 L"Line" -#define DLG_ITEM_TEXT_5 L"" -#define DLG_ITEM_TEXT_6 L"File" -#define DLG_ITEM_TEXT_7 L"Condition" -#define DLG_ITEM_TEXT_8 L"" -#define DLG_ITEM_TEXT_9 L"failed" -#define DLG_ITEM_TEXT_10 L"" -#define DLG_ITEM_TEXT_11 L"Reason" -#define DLG_ITEM_TEXT_12 L"Ignore" - -#define DLG_ITEM_TEXT_14 L"Break" -#define DLG_ITEM_TEXT_15 L"Ignore All" - -#define DLG_NB_ITEM 15 - - -template -struct SDlgItem -{ - // If use my struct instead of DLGTEMPLATE, or else (for some strange reason) it is not DWORD aligned !! - DWORD style; - DWORD dwExtendedStyle; - short x; - short y; - short cx; - short cy; - WORD id; - WORD ch; - WORD c; - WCHAR t[iTitleSize]; - WORD dummy; -}; -#define SDLGITEM(TEXT, V) SDlgItem V; - -struct SDlgData -{ - DLGTEMPLATE dlt; - WORD _menu; - WORD _class; - WCHAR _title[sizeof(DLG_TITLE) / 2]; - WORD pointSize; - WCHAR _font[sizeof(DLG_FONT) / 2]; - - SDLGITEM(DLG_ITEM_TEXT_0, i0); - SDLGITEM(DLG_ITEM_TEXT_12, i12); - SDLGITEM(DLG_ITEM_TEXT_15, i15); - SDLGITEM(DLG_ITEM_TEXT_14, i14); - SDLGITEM(DLG_ITEM_TEXT_1, i1); - SDLGITEM(DLG_ITEM_TEXT_2, i2); - SDLGITEM(DLG_ITEM_TEXT_3, i3); - SDLGITEM(DLG_ITEM_TEXT_4, i4); - SDLGITEM(DLG_ITEM_TEXT_5, i5); - SDLGITEM(DLG_ITEM_TEXT_6, i6); - SDLGITEM(DLG_ITEM_TEXT_7, i7); - SDLGITEM(DLG_ITEM_TEXT_8, i8); - SDLGITEM(DLG_ITEM_TEXT_9, i9); - SDLGITEM(DLG_ITEM_TEXT_10, i10); - SDLGITEM(DLG_ITEM_TEXT_11, i11); -}; - -//----------------------------------------------------------------------------------------------------- - -static SDlgData g_dialogRC = -{ - {DS_SETFOREGROUND | DS_MODALFRAME | DS_3DLOOK | DS_SETFONT | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE, 0, DLG_NB_ITEM, 0, 0, 330, 134}, 0, 0, DLG_TITLE, 8, DLG_FONT, - {BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 12, 113, 50, 14, IDC_CRYASSERT_BUTTON_CONTINUE, 0xFFFF, 0x0080, DLG_ITEM_TEXT_0, 0}, - {BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 66, 113, 50, 14, IDC_CRYASSERT_BUTTON_IGNORE, 0xFFFF, 0x0080, DLG_ITEM_TEXT_12, 0}, - {BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 120, 113, 50, 14, IDC_CRYASSERT_BUTTON_IGNORE_ALL, 0xFFFF, 0x0080, DLG_ITEM_TEXT_15, 0}, - {BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 214, 113, 50, 14, IDC_CRYASSERT_BUTTON_BREAK, 0xFFFF, 0x0080, DLG_ITEM_TEXT_14, 0}, - {BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 268, 113, 50, 14, IDC_CRYASSERT_BUTTON_STOP, 0xFFFF, 0x0080, DLG_ITEM_TEXT_1, 0}, - {BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 0, 7, 7, 316, 100, IDC_CRYASSERT_STATIC_TEXT, 0xFFFF, 0x0080, DLG_ITEM_TEXT_2, 0}, - {ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_CHILD | WS_VISIBLE, 0, 50, 48, 25, 13, IDC_CRYASSERT_EDIT_LINE, 0xFFFF, 0x0081, DLG_ITEM_TEXT_3, 0}, - {WS_CHILD | WS_VISIBLE, 0, 14, 50, 14, 8, IDC_CRYASSERT_STATIC_TEXT, 0xFFFF, 0x0082, DLG_ITEM_TEXT_4, 0}, - {ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_CHILD | WS_VISIBLE, 0, 50, 32, 240, 13, IDC_CRYASSERT_EDIT_FILE, 0xFFFF, 0x0081, DLG_ITEM_TEXT_5, 0}, - {WS_CHILD | WS_VISIBLE, 0, 14, 34, 12, 8, IDC_CRYASSERT_STATIC_TEXT, 0xFFFF, 0x0082, DLG_ITEM_TEXT_6, 0}, - {WS_CHILD | WS_VISIBLE, 0, 13, 18, 30, 8, IDC_CRYASSERT_STATIC_TEXT, 0xFFFF, 0x0082, DLG_ITEM_TEXT_7, 0}, - {ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_CHILD | WS_VISIBLE, 0, 50, 16, 240, 13, IDC_CRYASSERT_EDIT_CONDITION, 0xFFFF, 0x0081, DLG_ITEM_TEXT_8, 0}, - {WS_CHILD | WS_VISIBLE, 0, 298, 19, 18, 8, IDC_CRYASSERT_STATIC_TEXT, 0xFFFF, 0x0082, DLG_ITEM_TEXT_9, 0}, - {ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_CHILD | WS_VISIBLE, 0, 50, 67, 240, 13, IDC_CRYASSERT_EDIT_REASON, 0xFFFF, 0x0081, DLG_ITEM_TEXT_10, 0}, - {WS_CHILD | WS_VISIBLE, 0, 15, 69, 26, 8, IDC_CRYASSERT_STATIC_TEXT, 0xFFFF, 0x0082, DLG_ITEM_TEXT_11, 0}, -}; - -//----------------------------------------------------------------------------------------------------- - -struct SCryAssertInfo -{ - const char* pszCondition; - const char* pszFile; - const char* pszMessage; - - unsigned int uiLine; - - enum - { - BUTTON_CONTINUE, - BUTTON_IGNORE, - BUTTON_IGNORE_ALL, - BUTTON_BREAK, - BUTTON_STOP, - BUTTON_REPORT_AS_BUG, - } btnChosen; - - unsigned int uiX; - unsigned int uiY; -}; - -//----------------------------------------------------------------------------------------------------- - -static INT_PTR CALLBACK DlgProc(HWND _hDlg, UINT _uiMsg, WPARAM _wParam, LPARAM _lParam) -{ - static SCryAssertInfo* pAssertInfo = NULL; - - const UINT WM_USER_SHOWFILE_MESSAGE = (WM_USER + 0x4000); - - switch (_uiMsg) - { - case WM_INITDIALOG: - { - pAssertInfo = (SCryAssertInfo*) _lParam; - - SetWindowText(GetDlgItem(_hDlg, IDC_CRYASSERT_EDIT_CONDITION), pAssertInfo->pszCondition); - SetWindowText(GetDlgItem(_hDlg, IDC_CRYASSERT_EDIT_FILE), pAssertInfo->pszFile); - - // Want to move the cursor on the file text, so that the end of the file is the first thing visible, - // instead of the beginning, which will be the user's depot, and the same for pretty much every file. - // Have to do this delayed, because if it's done in WM_INITDIALOG, it doesn't work. - // PostMessage will add this to the end of the message queue. - PostMessage(_hDlg, WM_USER_SHOWFILE_MESSAGE, 0, 0); - - char szLine[MAX_PATH]; - sprintf_s(szLine, "%d", pAssertInfo->uiLine); - SetWindowText(GetDlgItem(_hDlg, IDC_CRYASSERT_EDIT_LINE), szLine); - - if (pAssertInfo->pszMessage && pAssertInfo->pszMessage[0] != '\0') - { - SetWindowText(GetDlgItem(_hDlg, IDC_CRYASSERT_EDIT_REASON), pAssertInfo->pszMessage); - } - else - { - SetWindowText(GetDlgItem(_hDlg, IDC_CRYASSERT_EDIT_REASON), "No Reason"); - } - - SetWindowPos(_hDlg, HWND_TOPMOST, pAssertInfo->uiX, pAssertInfo->uiY, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE); - - break; - } - - case WM_USER_SHOWFILE_MESSAGE: - { - // Still have to delay sending this message, or it won't work for some reason. - // Windows does a whole bunch of stuff behind the scenes. Using PostMessage here seems to work better. - PostMessage(GetDlgItem(_hDlg, IDC_CRYASSERT_EDIT_FILE), EM_SETSEL, strlen(pAssertInfo->pszFile), -1); - break; - } - - case WM_COMMAND: - { - switch (LOWORD(_wParam)) - { - case IDCANCEL: - case IDC_CRYASSERT_BUTTON_CONTINUE: - { - pAssertInfo->btnChosen = SCryAssertInfo::BUTTON_CONTINUE; - EndDialog(_hDlg, 0); - break; - } - case IDC_CRYASSERT_BUTTON_IGNORE: - { - pAssertInfo->btnChosen = SCryAssertInfo::BUTTON_IGNORE; - EndDialog(_hDlg, 0); - break; - } - case IDC_CRYASSERT_BUTTON_IGNORE_ALL: - { - pAssertInfo->btnChosen = SCryAssertInfo::BUTTON_IGNORE_ALL; - EndDialog(_hDlg, 0); - break; - } - case IDC_CRYASSERT_BUTTON_BREAK: - { - pAssertInfo->btnChosen = SCryAssertInfo::BUTTON_BREAK; - EndDialog(_hDlg, 0); - break; - } - case IDC_CRYASSERT_BUTTON_STOP: - { - pAssertInfo->btnChosen = SCryAssertInfo::BUTTON_STOP; - EndDialog(_hDlg, 1); - break; - } - default: - break; - } - ; - break; - } - - case WM_DESTROY: - { - if (pAssertInfo) - { - RECT rcWindowBounds; - GetWindowRect(_hDlg, &rcWindowBounds); - pAssertInfo->uiX = rcWindowBounds.left; - pAssertInfo->uiY = rcWindowBounds.top; - } - break; - } - - default: - return FALSE; - } - ; - - return TRUE; -} - -//----------------------------------------------------------------------------------------------------- - -static char gs_szMessage[MAX_PATH]; - -//----------------------------------------------------------------------------------------------------- - -void CryAssertTrace(const char* _pszFormat, ...) -{ - if (gEnv == 0) - { - return; - } - if (!gEnv->bIgnoreAllAsserts) - { - if (NULL == _pszFormat) - { - gs_szMessage[0] = '\0'; - } - else - { - va_list args; - va_start(args, _pszFormat); - vsnprintf_s(gs_szMessage, sizeof(gs_szMessage), _TRUNCATE, _pszFormat, args); - va_end(args); - } - } -} - -//----------------------------------------------------------------------------------------------------- - -static const char* gs_strRegSubKey = "Software\\O3DE\\AssertWindow"; -static const char* gs_strRegXValue = "AssertInfoX"; -static const char* gs_strRegYValue = "AssertInfoY"; - -//----------------------------------------------------------------------------------------------------- - -void RegistryReadUInt32(const char* _strSubKey, const char* _strRegName, unsigned int* _puiValue, unsigned int _uiDefault) -{ - HKEY hKey; - RegCreateKeyEx(HKEY_CURRENT_USER, _strSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL); - - DWORD dwType; - DWORD dwLength = sizeof(DWORD); - - if (ERROR_SUCCESS != RegQueryValueEx(hKey, _strRegName, 0, &dwType, (BYTE*) _puiValue, &dwLength)) - { - *_puiValue = _uiDefault; - } - - RegCloseKey(hKey); -} - -//----------------------------------------------------------------------------------------------------- - -void RegistryWriteUInt32(const char* _strSubKey, const char* _strRegName, unsigned int _uiValue) -{ - HKEY hKey; - RegCreateKeyEx(HKEY_CURRENT_USER, _strSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL); - RegSetValueEx (hKey, _strRegName, 0, REG_DWORD, (BYTE*) &_uiValue, sizeof(DWORD)); - RegCloseKey (hKey); -} - -//----------------------------------------------------------------------------------------------------- - -class CCursorShowerWithStack -{ -public: - void StoreCurrentAndShow() - { - m_numberOfShows = 1; - - while (ShowCursor(TRUE) < 0) - { - ++m_numberOfShows; - } - } - - void RevertToPrevious() - { - while (m_numberOfShows > 0) - { - ShowCursor(FALSE); - --m_numberOfShows; - } - } - -private: - int m_numberOfShows; -}; - -bool CryAssert(const char* _pszCondition, const char* _pszFile, unsigned int _uiLine, bool* _pbIgnore) -{ - if (!gEnv) - { - return false; - } - -#if defined(CRY_ASSERT_DIALOG_ONLY_IN_DEBUG) && !defined(AZ_DEBUG_BUILD) - // we are in a non-debug build, so we should turn this into a warning instead. - if ((gEnv) && (gEnv->pLog)) - { - if (!gEnv->bIgnoreAllAsserts) - { - gEnv->pLog->LogWarning("%s(%u): Assertion failed - \"%s\"", _pszFile, _uiLine, _pszCondition); - } - } - - if (_pbIgnore) - { - // avoid showing the same one repeatedly. - *_pbIgnore = true; - } - return false; -#endif - - if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts) - { - SCryAssertInfo assertInfo; - - assertInfo.pszCondition = _pszCondition; - assertInfo.pszFile = _pszFile; - assertInfo.pszMessage = gs_szMessage; - assertInfo.uiLine = _uiLine; - assertInfo.btnChosen = SCryAssertInfo::BUTTON_CONTINUE; - - gEnv->pSystem->SetAssertVisible(true); - RegistryReadUInt32(gs_strRegSubKey, gs_strRegXValue, &assertInfo.uiX, 10); - RegistryReadUInt32(gs_strRegSubKey, gs_strRegYValue, &assertInfo.uiY, 10); - - CCursorShowerWithStack cursorShowerWithStack; - cursorShowerWithStack.StoreCurrentAndShow(); - - DialogBoxIndirectParam(GetModuleHandle(NULL), (DLGTEMPLATE*) &g_dialogRC, GetDesktopWindow(), DlgProc, (LPARAM) &assertInfo); - - cursorShowerWithStack.RevertToPrevious(); - - RegistryWriteUInt32(gs_strRegSubKey, gs_strRegXValue, assertInfo.uiX); - RegistryWriteUInt32(gs_strRegSubKey, gs_strRegYValue, assertInfo.uiY); - gEnv->pSystem->SetAssertVisible(false); - - switch (assertInfo.btnChosen) - { - case SCryAssertInfo::BUTTON_IGNORE: - *_pbIgnore = true; - break; - case SCryAssertInfo::BUTTON_IGNORE_ALL: - gEnv->bIgnoreAllAsserts = true; - break; - case SCryAssertInfo::BUTTON_BREAK: - return true; - case SCryAssertInfo::BUTTON_STOP: - raise(SIGABRT); - exit(-1); - case SCryAssertInfo::BUTTON_REPORT_AS_BUG: - if (gEnv && gEnv->pSystem) - { - const char* pszSafeMessage = (assertInfo.pszMessage && assertInfo.pszMessage[0]) ? assertInfo.pszMessage : ""; - gEnv->pSystem->ReportBug("Assert: %s - %s", assertInfo.pszCondition, pszSafeMessage); - } - break; - } - } - - if (gEnv && gEnv->pSystem) - { - // this also can cause fatal / shutdown behavior: - gEnv->pSystem->OnAssert(_pszCondition, gs_szMessage, _pszFile, _uiLine); - } - - return false; -} - -//----------------------------------------------------------------------------------------------------- - -#endif -#endif - -//----------------------------------------------------------------------------------------------------- diff --git a/Code/Legacy/CryCommon/ISystem.h b/Code/Legacy/CryCommon/ISystem.h index 6fdc8b52fe..50f7fccfcb 100644 --- a/Code/Legacy/CryCommon/ISystem.h +++ b/Code/Legacy/CryCommon/ISystem.h @@ -1295,15 +1295,7 @@ namespace Detail #endif -#if defined(USE_CRY_ASSERT) -static void AssertConsoleExists(void) -{ - CRY_ASSERT(gEnv->pConsole != NULL); -} -#define ASSERT_CONSOLE_EXISTS AssertConsoleExists() -#else #define ASSERT_CONSOLE_EXISTS 0 -#endif // defined(USE_CRY_ASSERT) // the following macros allow the help text to be easily stripped out diff --git a/Code/Legacy/CryCommon/WinBase.cpp b/Code/Legacy/CryCommon/WinBase.cpp index 3445637d28..771cde324e 100644 --- a/Code/Legacy/CryCommon/WinBase.cpp +++ b/Code/Legacy/CryCommon/WinBase.cpp @@ -712,16 +712,6 @@ DWORD Sleep(DWORD dwMilliseconds) #endif } -////////////////////////////////////////////////////////////////////////// -DWORD SleepEx(DWORD dwMilliseconds, BOOL /*bAlertable*/) -{ - //TODO: implement - // CRY_ASSERT_MESSAGE(0, "SleepEx not implemented yet"); - printf("SleepEx not properly implemented yet\n"); - Sleep(dwMilliseconds); - return 0; -} - #if defined(LINUX) || defined(APPLE) BOOL GetComputerName(LPSTR lpBuffer, LPDWORD lpnSize) { diff --git a/Code/Legacy/CryCommon/crycommon_files.cmake b/Code/Legacy/CryCommon/crycommon_files.cmake index a4d87c207a..e1117b6f52 100644 --- a/Code/Legacy/CryCommon/crycommon_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_files.cmake @@ -85,11 +85,6 @@ set(FILES MathConversion.h AndroidSpecific.h AppleSpecific.h - CryAssert_Android.h - CryAssert_impl.h - CryAssert_iOS.h - CryAssert_Linux.h - CryAssert_Mac.h Linux32Specific.h Linux64Specific.h Linux_Win32Wrapper.h diff --git a/Code/Legacy/CryCommon/platform.h b/Code/Legacy/CryCommon/platform.h index d67c0b902c..d2251c7091 100644 --- a/Code/Legacy/CryCommon/platform.h +++ b/Code/Legacy/CryCommon/platform.h @@ -238,12 +238,6 @@ ILINE DestinationType alias_cast(SourceType pPtr) // Assert dialog box macros #include "CryAssert.h" -// Replace standard assert calls by our custom one -// Works only ifdef USE_CRY_ASSERT && _DEBUG && WIN32 -#ifndef assert -#define assert CRY_ASSERT -#endif - ////////////////////////////////////////////////////////////////////////// // Platform dependent functions that emulate Win32 API. // Mostly used only for debugging! diff --git a/Code/Legacy/CryCommon/platform_impl.cpp b/Code/Legacy/CryCommon/platform_impl.cpp index 64aa7ce1ca..8cbc58ad95 100644 --- a/Code/Legacy/CryCommon/platform_impl.cpp +++ b/Code/Legacy/CryCommon/platform_impl.cpp @@ -157,10 +157,6 @@ void __stl_debug_message(const char* format_str, ...) #include #endif -#if defined(APPLE) || defined(LINUX) -#include "CryAssert_impl.h" -#endif - #if defined(AZ_RESTRICTED_PLATFORM) #define AZ_RESTRICTED_SECTION PLATFORM_IMPL_H_SECTION_CRY_SYSTEM_FUNCTIONS #include AZ_RESTRICTED_FILE(platform_impl_h) @@ -168,8 +164,6 @@ void __stl_debug_message(const char* format_str, ...) #if defined (_WIN32) -#include "CryAssert_impl.h" - ////////////////////////////////////////////////////////////////////////// void CrySleep(unsigned int dwMilliseconds) { diff --git a/Code/Legacy/CrySystem/AZCoreLogSink.h b/Code/Legacy/CrySystem/AZCoreLogSink.h index 9d732b3dd4..6146de7560 100644 --- a/Code/Legacy/CrySystem/AZCoreLogSink.h +++ b/Code/Legacy/CrySystem/AZCoreLogSink.h @@ -77,64 +77,11 @@ public: bool OnPreAssert(const char* fileName, int line, const char* func, const char* message) override { -#if defined(USE_CRY_ASSERT) && AZ_LEGACY_CRYSYSTEM_TRAIT_DO_PREASSERT - AZ::Crc32 crc; - crc.Add(&line, sizeof(line)); - if (fileName) - { - crc.Add(fileName, strlen(fileName)); - } - - bool* ignore = nullptr; - auto foundIter = m_ignoredAsserts->find(crc); - if (foundIter == m_ignoredAsserts->end()) - { - ignore = &((*m_ignoredAsserts)[crc]); - *ignore = false; - } - else - { - ignore = &((*m_ignoredAsserts)[crc]); - } - - if (!(*ignore)) - { - using namespace AZ::Debug; - - Trace::Output(nullptr, "\n==================================================================\n"); - AZ::OSString outputMsg = AZ::OSString::format("Trace::Assert\n %s(%d): '%s'\n%s\n", fileName, line, func, message); - Trace::Output(nullptr, outputMsg.c_str()); - - // Suppress 3 in stack depth - this function, the bus broadcast that got us here, and Trace::Assert - Trace::Output(nullptr, "------------------------------------------------\n"); - Trace::PrintCallstack(nullptr, 3); - Trace::Output(nullptr, "\n==================================================================\n"); - - AZ::EnvironmentVariable inEditorBatchMode = AZ::Environment::FindVariable("InEditorBatchMode"); - if (!inEditorBatchMode.IsConstructed() || !inEditorBatchMode.Get()) - { - // Note - CryAssertTrace doesn't actually print any info to logging - // it just stores the message internally for the message box in CryAssert to use - CryAssertTrace("%s", message); - if (CryAssert("Assertion failed", fileName, line, ignore) || Trace::IsDebuggerPresent()) - { - Trace::Break(); - } - } - } - else - { - CryLogAlways("%s", message); - } - - return m_suppressSystemOutput; -#else AZ_UNUSED(fileName); AZ_UNUSED(line); AZ_UNUSED(func); AZ_UNUSED(message); return false; // allow AZCore to do its default behavior. This usually results in an application shutdown. -#endif } bool OnPreError(const char* window, const char* fileName, int line, const char* func, const char* message) override diff --git a/Code/Legacy/CrySystem/System.cpp b/Code/Legacy/CrySystem/System.cpp index 7cf066f72e..47a9cbd5ef 100644 --- a/Code/Legacy/CrySystem/System.cpp +++ b/Code/Legacy/CrySystem/System.cpp @@ -1280,10 +1280,7 @@ void CSystem::RegisterWindowMessageHandler(IWindowMessageHandler* pHandler) void CSystem::UnregisterWindowMessageHandler(IWindowMessageHandler* pHandler) { #if AZ_LEGACY_CRYSYSTEM_TRAIT_USE_MESSAGE_HANDLER -#if !defined(NDEBUG) - bool bRemoved = -#endif - stl::find_and_erase(m_windowMessageHandlers, pHandler); + [[maybe_unused]] bool bRemoved = stl::find_and_erase(m_windowMessageHandlers, pHandler); assert(pHandler && bRemoved && "This IWindowMessageHandler was not registered"); #else CRY_ASSERT(false && "This platform does not support window message handlers"); diff --git a/Code/Legacy/CrySystem/System.h b/Code/Legacy/CrySystem/System.h index 664f5385fa..9b76e94eb4 100644 --- a/Code/Legacy/CrySystem/System.h +++ b/Code/Legacy/CrySystem/System.h @@ -53,11 +53,6 @@ class CWatchdogThread; #define AZ_LEGACY_CRYSYSTEM_TRAIT_ALLOW_CREATE_BACKUP_LOG_FILE 1 #endif -////////////////////////////////////////////////////////////////////////// -#if defined(WIN32) || defined(APPLE) || defined(LINUX) -#define AZ_LEGACY_CRYSYSTEM_TRAIT_DO_PREASSERT 1 -#endif - #if defined(LINUX) || defined(APPLE) #define AZ_LEGACY_CRYSYSTEM_TRAIT_FORWARD_EXCEPTION_POINTERS 1 #endif @@ -72,9 +67,7 @@ class CWatchdogThread; #define AZ_LEGACY_CRYSYSTEM_TRAIT_DEBUGCALLSTACK_APPEND_MODULENAME 1 #endif -#if 1 #define AZ_LEGACY_CRYSYSTEM_TRAIT_USE_EXCLUDEUPDATE_ON_CONSOLE 0 -#endif #if defined(WIN32) #define AZ_LEGACY_CRYSYSTEM_TRAIT_USE_MESSAGE_HANDLER 1 #endif diff --git a/Gems/Maestro/Code/Source/Cinematics/Movie.cpp b/Gems/Maestro/Code/Source/Cinematics/Movie.cpp index 51be8a4c24..800b95a2e4 100644 --- a/Gems/Maestro/Code/Source/Cinematics/Movie.cpp +++ b/Gems/Maestro/Code/Source/Cinematics/Movie.cpp @@ -1554,8 +1554,8 @@ void CMovieSystem::ControlCapture() { #if !defined(NDEBUG) bool bBothStartAndEnd = m_bStartCapture && m_bEndCapture; -#endif assert(!bBothStartAndEnd); +#endif bool bAllCVarsReady = m_cvar_capture_frame_once && m_cvar_capture_folder && m_cvar_capture_frames; From e7683fa0f899699bc254ac3be30a6c4d75f5be4a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 15:45:57 -0800 Subject: [PATCH 183/620] =?UTF-8?q?=EF=BB=BFremoves=20BaseLibrary/Item/Man?= =?UTF-8?q?ager=20unused=20code=20from=20Code/Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/ErrorReport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Editor/ErrorReport.h b/Code/Editor/ErrorReport.h index 98d230e383..2ede92a8fe 100644 --- a/Code/Editor/ErrorReport.h +++ b/Code/Editor/ErrorReport.h @@ -17,7 +17,7 @@ // forward declarations. class CParticleItem; -#include +#include "BaseLibraryItem.h" #include #include "Objects/BaseObject.h" From 4ec420e62aac234f14f557d9a2fee08e6792608c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 15:48:42 -0800 Subject: [PATCH 184/620] =?UTF-8?q?=EF=BB=BFRemoves=20PrefabEntityOwnershi?= =?UTF-8?q?pService=20from=20AzFramework?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Entity/PrefabEntityOwnershipService.h | 20 ------------------- .../AzFramework/azframework_files.cmake | 1 - 2 files changed, 21 deletions(-) delete mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h deleted file mode 100644 index ac24af880a..0000000000 --- a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h +++ /dev/null @@ -1,20 +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 - * - */ - -#pragma once - -#include - -namespace AzFramework -{ - class PrefabEntityOwnershipService - : public EntityOwnershipService - { - - }; -} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 9693d75b06..511439ab10 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -120,7 +120,6 @@ set(FILES Entity/SliceGameEntityOwnershipService.h Entity/SliceGameEntityOwnershipService.cpp Entity/SliceGameEntityOwnershipServiceBus.h - Entity/PrefabEntityOwnershipService.h Components/ComponentAdapter.h Components/ComponentAdapter.inl Components/ComponentAdapterHelpers.h From 1d93290a1c3df1a2060f5b4beadcb90a0761410c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 11 Nov 2021 13:47:13 -0800 Subject: [PATCH 185/620] Revert "Removes PrefabEntityOwnershipService from AzFramework" This reverts commit e2d2cb07a0a1431f8fcdd20ee07ff2788ed603c0. Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Entity/PrefabEntityOwnershipService.cpp | 13 ++++++++++++ .../Entity/PrefabEntityOwnershipService.h | 20 +++++++++++++++++++ .../AzFramework/azframework_files.cmake | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp create mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp new file mode 100644 index 0000000000..9b2c432332 --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp @@ -0,0 +1,13 @@ +/* + * 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 + * + */ + +#include + +namespace AzFramework +{ +} diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h new file mode 100644 index 0000000000..ac24af880a --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +namespace AzFramework +{ + class PrefabEntityOwnershipService + : public EntityOwnershipService + { + + }; +} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 511439ab10..9af049a7c1 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -120,6 +120,8 @@ set(FILES Entity/SliceGameEntityOwnershipService.h Entity/SliceGameEntityOwnershipService.cpp Entity/SliceGameEntityOwnershipServiceBus.h + Entity/PrefabEntityOwnershipService.h + Entity/PrefabEntityOwnershipService.cpp Components/ComponentAdapter.h Components/ComponentAdapter.inl Components/ComponentAdapterHelpers.h From 4cc54941c71976f5c388311243ec5bab81141e18 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 12:25:29 -0800 Subject: [PATCH 186/620] =?UTF-8?q?=EF=BB=BFCleanup=20before=20merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Entity/PrefabEntityOwnershipService.cpp | 13 ------------- .../AzFramework/AzFramework/azframework_files.cmake | 1 - scripts/cleanup/unusued_compilation.py | 2 ++ 3 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp deleted file mode 100644 index 9b2c432332..0000000000 --- a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp +++ /dev/null @@ -1,13 +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 - * - */ - -#include - -namespace AzFramework -{ -} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 9af049a7c1..9693d75b06 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -121,7 +121,6 @@ set(FILES Entity/SliceGameEntityOwnershipService.cpp Entity/SliceGameEntityOwnershipServiceBus.h Entity/PrefabEntityOwnershipService.h - Entity/PrefabEntityOwnershipService.cpp Components/ComponentAdapter.h Components/ComponentAdapter.inl Components/ComponentAdapterHelpers.h diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 1f1a9894c7..65f4626a8c 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -68,6 +68,8 @@ def is_excluded(file): for path_exclusion in PATH_EXCLUSIONS: if fnmatch.fnmatch(file, path_exclusion): return True + if '\\Template\\' in normalized_file: + return True with open(file, 'r') as file: contents = file.read() for exclusion_term in EXCLUSIONS: From f0b86ab1df5d4f6c47631c194c7c625290cbdd94 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 17:25:14 -0800 Subject: [PATCH 187/620] =?UTF-8?q?=EF=BB=BFcleanup=20script=20updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 65f4626a8c..ee46d98b91 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -68,8 +68,6 @@ def is_excluded(file): for path_exclusion in PATH_EXCLUSIONS: if fnmatch.fnmatch(file, path_exclusion): return True - if '\\Template\\' in normalized_file: - return True with open(file, 'r') as file: contents = file.read() for exclusion_term in EXCLUSIONS: @@ -78,7 +76,7 @@ def is_excluded(file): return False def filter_from_processed(filelist, filter_file_path): - filelist = set([f for f in filelist if not is_excluded(f)]) + filelist = [f for f in filelist if not is_excluded(f)] if os.path.exists(filter_file_path): with open(filter_file_path, 'r') as filter_file: processed_files = [s.strip() for s in filter_file.readlines()] @@ -93,7 +91,6 @@ def cleanup_unused_compilation(path): # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') filelist = filter_from_processed(filelist, filter_file_path) - sorted_filelist = sorted(filelist) # 3. For each file total_files = len(sorted_filelist) current_files = 1 From 893f50355f9350917cc18a195e73f1e593573233 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 17:25:14 -0800 Subject: [PATCH 188/620] cleanup script updates Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index ee46d98b91..29a5a69648 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -39,6 +39,17 @@ PATH_EXCLUSIONS = ( 'install\\*', 'Code\\Framework\\AzCore\\AzCore\\Android\\*' ) +PATH_EXCLUSIONS = ( + '*\\Platform\\Android\\*', + '*\\Platform\\Common\\*', + '*\\Platform\\iOS\\*', + '*\\Platform\\Linux\\*', + '*\\Platform\\Mac\\*', + 'Templates\\*', + 'python\\*', + 'build\\*', + 'install\\*' +) def create_filelist(path): filelist = set() From 7ee0a0454ec6decb97f614f71b78272103a4bb4a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 19:03:29 -0800 Subject: [PATCH 189/620] =?UTF-8?q?=EF=BB=BFmore=20filters/using=20reverse?= =?UTF-8?q?=20on=20this=20node?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 29a5a69648..aa582d59ab 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -39,17 +39,7 @@ PATH_EXCLUSIONS = ( 'install\\*', 'Code\\Framework\\AzCore\\AzCore\\Android\\*' ) -PATH_EXCLUSIONS = ( - '*\\Platform\\Android\\*', - '*\\Platform\\Common\\*', - '*\\Platform\\iOS\\*', - '*\\Platform\\Linux\\*', - '*\\Platform\\Mac\\*', - 'Templates\\*', - 'python\\*', - 'build\\*', - 'install\\*' -) + def create_filelist(path): filelist = set() @@ -102,6 +92,7 @@ def cleanup_unused_compilation(path): # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') filelist = filter_from_processed(filelist, filter_file_path) + sorted_filelist = sorted(filelist, reverse=True) # 3. For each file total_files = len(sorted_filelist) current_files = 1 From b4cbffed068198ac5b574428779b06277caa98a3 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 19:02:07 -0800 Subject: [PATCH 190/620] =?UTF-8?q?=EF=BB=BFMore=20filters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index aa582d59ab..6ad1e2da4d 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -92,7 +92,7 @@ def cleanup_unused_compilation(path): # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') filelist = filter_from_processed(filelist, filter_file_path) - sorted_filelist = sorted(filelist, reverse=True) + sorted_filelist = sorted(filelist) # 3. For each file total_files = len(sorted_filelist) current_files = 1 From 4ca4bb3618487ec8e5fb260d3f59d327b1488bb6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 15 Nov 2021 14:04:05 -0800 Subject: [PATCH 191/620] some more exclussions Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 6ad1e2da4d..4515a663af 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -77,7 +77,7 @@ def is_excluded(file): return False def filter_from_processed(filelist, filter_file_path): - filelist = [f for f in filelist if not is_excluded(f)] + filelist = set([f for f in filelist if not is_excluded(f)]) if os.path.exists(filter_file_path): with open(filter_file_path, 'r') as filter_file: processed_files = [s.strip() for s in filter_file.readlines()] From 61948fdc995ec1d651ebc60b132e09acd3580a2b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:21:33 -0800 Subject: [PATCH 192/620] Removes TitleBarPage from AzQtComponents/Gallery Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Gallery/ComponentDemoWidget.cpp | 2 - .../AzQtComponents/Gallery/TitleBarPage.cpp | 74 -------- .../AzQtComponents/Gallery/TitleBarPage.h | 29 ---- .../AzQtComponents/Gallery/TitleBarPage.ui | 162 ------------------ .../azqtcomponents_gallery_files.cmake | 3 - 5 files changed, 270 deletions(-) delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.cpp delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.h delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.ui diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComponentDemoWidget.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComponentDemoWidget.cpp index 485803f9ae..fb775dfb88 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComponentDemoWidget.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComponentDemoWidget.cpp @@ -37,7 +37,6 @@ #include "SvgLabelPage.h" #include "TableViewPage.h" #include "TabWidgetPage.h" -#include "TitleBarPage.h" #include "ToggleSwitchPage.h" #include "ToolBarPage.h" #include "TreeViewPage.h" @@ -101,7 +100,6 @@ ComponentDemoWidget::ComponentDemoWidget(QWidget* parent) // Pages hidden in 1.25 release - unused components, still need work before being made public, or not interesting for external devs //sortedPages.insert("AssetBrowserFolder", new AssetBrowserFolderPage(this)); - //sortedPages.insert("Titlebar", new TitleBarPage(this)); for (const auto& title : sortedPages.keys()) { diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.cpp deleted file mode 100644 index 58ca3c101b..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.cpp +++ /dev/null @@ -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 - * - */ - -#include "TitleBarPage.h" -#include - -TitleBarPage::TitleBarPage(QWidget* parent) - : QWidget(parent) - , ui(new Ui::TitleBarPage) -{ - using namespace AzQtComponents; - - ui->setupUi(this); - - ui->activeSimpleTitleBar->setDrawSimple(true); - ui->activeSimpleButtonsTitleBar->setDrawSimple(true); - ui->inactiveSimpleTitleBar->setDrawSimple(true); - ui->inactiveSimpleButtonsTitleBar->setDrawSimple(true); - - ui->activeTearTitleBar->setTearEnabled(true); - ui->activeTearButtonsTitleBar->setTearEnabled(true); - ui->inactiveTearTitleBar->setTearEnabled(true); - ui->inactiveTearButtonsTitleBar->setTearEnabled(true); - - ui->inactiveTitleBar->setForceInactive(true); - ui->inactiveButtonsTitleBar->setForceInactive(true); - ui->inactiveSimpleTitleBar->setForceInactive(true); - ui->inactiveSimpleButtonsTitleBar->setForceInactive(true); - ui->inactiveTearTitleBar->setForceInactive(true); - ui->inactiveTearButtonsTitleBar->setForceInactive(true); - - ui->activeButtonsTitleBar->setButtons( - { DockBarButton::DividerButton, DockBarButton::MinimizeButton, - DockBarButton::DividerButton, DockBarButton::MaximizeButton, - DockBarButton::DividerButton, DockBarButton::CloseButton}); - ui->activeSimpleButtonsTitleBar->setButtons( - { DockBarButton::DividerButton, DockBarButton::MinimizeButton, - DockBarButton::DividerButton, DockBarButton::MaximizeButton, - DockBarButton::DividerButton, DockBarButton::CloseButton}); - ui->activeTearButtonsTitleBar->setButtons( - { DockBarButton::DividerButton, DockBarButton::MinimizeButton, - DockBarButton::DividerButton, DockBarButton::MaximizeButton, - DockBarButton::DividerButton, DockBarButton::CloseButton}); - ui->inactiveButtonsTitleBar->setButtons( - { DockBarButton::DividerButton, DockBarButton::MinimizeButton, - DockBarButton::DividerButton, DockBarButton::MaximizeButton, - DockBarButton::DividerButton, DockBarButton::CloseButton}); - ui->inactiveSimpleButtonsTitleBar->setButtons( - { DockBarButton::DividerButton, DockBarButton::MinimizeButton, - DockBarButton::DividerButton, DockBarButton::MaximizeButton, - DockBarButton::DividerButton, DockBarButton::CloseButton}); - ui->inactiveTearButtonsTitleBar->setButtons( - { DockBarButton::DividerButton, DockBarButton::MinimizeButton, - DockBarButton::DividerButton, DockBarButton::MaximizeButton, - DockBarButton::DividerButton, DockBarButton::CloseButton}); - - QString exampleText = R"( -
-    
- )"; - - ui->exampleText->setHtml(exampleText); -} - -TitleBarPage::~TitleBarPage() -{ -} - -#include "Gallery/moc_TitleBarPage.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.h b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.h deleted file mode 100644 index 3cc5a2741c..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.h +++ /dev/null @@ -1,29 +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 - * - */ -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#endif - -namespace Ui { - class TitleBarPage; -} - -class TitleBarPage : public QWidget -{ - Q_OBJECT - -public: - explicit TitleBarPage(QWidget* parent = nullptr); - ~TitleBarPage() override; - -private: - QScopedPointer ui; -}; diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.ui b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.ui deleted file mode 100644 index 00fb8cd7f3..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.ui +++ /dev/null @@ -1,162 +0,0 @@ - - - TitleBarPage - - - - 0 - 0 - 827 - 716 - - - - - 0 - 0 - - - - - - - false - - - true - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Normal - - - Qt::AlignCenter - - - - - - - Simple - - - Qt::AlignCenter - - - - - - - Tear - - - Qt::AlignCenter - - - - - - - Active - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Inactive - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - AzQtComponents::TitleBar - QWidget -
AzQtComponents/Components/Titlebar.h
- 1 -
-
- - -
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_gallery_files.cmake b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_gallery_files.cmake index 05eee70f06..c309e60e29 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_gallery_files.cmake +++ b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_gallery_files.cmake @@ -106,9 +106,6 @@ set(FILES Gallery/TabWidgetPage.ui Gallery/TabWidgetPage.cpp Gallery/TabWidgetPage.h - Gallery/TitleBarPage.ui - Gallery/TitleBarPage.cpp - Gallery/TitleBarPage.h Gallery/ToggleSwitchPage.ui Gallery/ToggleSwitchPage.cpp Gallery/ToggleSwitchPage.h From 8a2cfedf3468b0aadb8c06094f0491020679178d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 13:51:05 -0800 Subject: [PATCH 193/620] =?UTF-8?q?=EF=BB=BFRemoves=20IProcess=20from=20Cr?= =?UTF-8?q?yCommon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CryCommon/IProcess.h | 35 ------------------- Code/Legacy/CryCommon/ISystem.h | 1 - Code/Legacy/CryCommon/crycommon_files.cmake | 1 - Code/Legacy/CrySystem/CrySystem_precompiled.h | 1 - Code/Legacy/CrySystem/System.cpp | 4 --- Code/Legacy/CrySystem/SystemInit.cpp | 1 - 6 files changed, 43 deletions(-) delete mode 100644 Code/Legacy/CryCommon/IProcess.h diff --git a/Code/Legacy/CryCommon/IProcess.h b/Code/Legacy/CryCommon/IProcess.h deleted file mode 100644 index 098c0d80c9..0000000000 --- a/Code/Legacy/CryCommon/IProcess.h +++ /dev/null @@ -1,35 +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 : Process common interface - - -#ifndef CRYINCLUDE_CRYCOMMON_IPROCESS_H -#define CRYINCLUDE_CRYCOMMON_IPROCESS_H -#pragma once - - -// forward declaration -struct SRenderingPassInfo; -//////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////// -struct IProcess -{ - // - virtual ~IProcess(){} - virtual bool Init() = 0; - virtual void Update() = 0; - virtual void RenderWorld(int nRenderFlags, const SRenderingPassInfo& passInfo, const char* szDebugName) = 0; - virtual void ShutDown() = 0; - virtual void SetFlags(int flags) = 0; - virtual int GetFlags(void) = 0; - // -}; - -#endif // CRYINCLUDE_CRYCOMMON_IPROCESS_H diff --git a/Code/Legacy/CryCommon/ISystem.h b/Code/Legacy/CryCommon/ISystem.h index 50f7fccfcb..e0d84ae689 100644 --- a/Code/Legacy/CryCommon/ISystem.h +++ b/Code/Legacy/CryCommon/ISystem.h @@ -46,7 +46,6 @@ namespace AZ::IO struct IConsole; struct IRemoteConsole; struct IRenderer; -struct IProcess; struct ICryFont; struct IMovieSystem; namespace Audio diff --git a/Code/Legacy/CryCommon/crycommon_files.cmake b/Code/Legacy/CryCommon/crycommon_files.cmake index e1117b6f52..412be4c746 100644 --- a/Code/Legacy/CryCommon/crycommon_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_files.cmake @@ -22,7 +22,6 @@ set(FILES IMaterial.h IMiniLog.h IMovieSystem.h - IProcess.h IRenderAuxGeom.h IRenderer.h ISerialize.h diff --git a/Code/Legacy/CrySystem/CrySystem_precompiled.h b/Code/Legacy/CrySystem/CrySystem_precompiled.h index 41090ff321..ba212f2972 100644 --- a/Code/Legacy/CrySystem/CrySystem_precompiled.h +++ b/Code/Legacy/CrySystem/CrySystem_precompiled.h @@ -104,7 +104,6 @@ struct ITimer; struct IFFont; struct ICVar; struct IConsole; -struct IProcess; namespace AZ::IO { struct IArchive; diff --git a/Code/Legacy/CrySystem/System.cpp b/Code/Legacy/CrySystem/System.cpp index 47a9cbd5ef..a5cee3a6b6 100644 --- a/Code/Legacy/CrySystem/System.cpp +++ b/Code/Legacy/CrySystem/System.cpp @@ -116,7 +116,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) #include #include #include -#include #include @@ -462,9 +461,6 @@ bool CSystem::IsQuitting() const bool wasExitMainLoopRequested = false; AzFramework::ApplicationRequests::Bus::BroadcastResult(wasExitMainLoopRequested, &AzFramework::ApplicationRequests::WasExitMainLoopRequested); return wasExitMainLoopRequested; -} - -////////////////////////////////////////////////////////////////////////// ISystem* CSystem::GetCrySystem() { return this; diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index f3f9442322..19d94ba6ec 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -75,7 +75,6 @@ #include #include #include -#include #include #include "XConsole.h" From 9bc498775c9fe6966430a8a798eeef2b1ca1e5e2 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 13:57:33 -0800 Subject: [PATCH 194/620] Removes Synchronization from CryCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CryCommon/Synchronization.h | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 Code/Legacy/CryCommon/Synchronization.h diff --git a/Code/Legacy/CryCommon/Synchronization.h b/Code/Legacy/CryCommon/Synchronization.h deleted file mode 100644 index ddd020ffde..0000000000 --- a/Code/Legacy/CryCommon/Synchronization.h +++ /dev/null @@ -1,25 +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 - * - */ - -#pragma once - - -//--------------------------------------------------------------------------- -// Synchronization policies, for classes (e.g. containers, allocators) that may -// or may not be multithread-safe. -// -// Policies should be used as a template argument to such classes, -// and these class implementations should then utilise the policy, as a base-class or member. -// -//--------------------------------------------------------------------------- - -#include - -namespace stl -{ -}; From 1cc1681ff00520d64a4ff8829e3cabd04c91b5f4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 13:59:42 -0800 Subject: [PATCH 195/620] Removes Win32Specific.h from CryCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CryCommon/Win32specific.h | 111 -------------------------- 1 file changed, 111 deletions(-) delete mode 100644 Code/Legacy/CryCommon/Win32specific.h diff --git a/Code/Legacy/CryCommon/Win32specific.h b/Code/Legacy/CryCommon/Win32specific.h deleted file mode 100644 index 4fa116166b..0000000000 --- a/Code/Legacy/CryCommon/Win32specific.h +++ /dev/null @@ -1,111 +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 : Specific to Win32 declarations, inline functions etc. - - -#ifndef CRYINCLUDE_CRYCOMMON_WIN32SPECIFIC_H -#define CRYINCLUDE_CRYCOMMON_WIN32SPECIFIC_H -#pragma once - - -#define _CPU_X86 -#define _CPU_SSE -#ifdef _DEBUG -#define ILINE _inline -#else -#define ILINE __forceinline -#endif - -#define DEPRECATED __declspec(deprecated) - -#ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x501 -#endif - -////////////////////////////////////////////////////////////////////////// -// Standard includes. -////////////////////////////////////////////////////////////////////////// -#include -#include -#include -#include -#include -#include -#include -#include -////////////////////////////////////////////////////////////////////////// - -// Special intrinsics -#include // moved here to prevent assert from being redefined when included elsewhere - - -////////////////////////////////////////////////////////////////////////// -// Define platform independent types. -////////////////////////////////////////////////////////////////////////// -#include "BaseTypes.h" - -typedef unsigned char BYTE; -typedef unsigned int threadID; -typedef unsigned long DWORD; -typedef double real; // biggest float-type on this machine -typedef long LONG; - -#if defined(_WIN64) -typedef __int64 INT_PTR, * PINT_PTR; -typedef unsigned __int64 UINT_PTR, * PUINT_PTR; - -typedef __int64 LONG_PTR, * PLONG_PTR; -typedef unsigned __int64 ULONG_PTR, * PULONG_PTR; - -typedef ULONG_PTR DWORD_PTR, * PDWORD_PTR; -#else -typedef __w64 int INT_PTR, * PINT_PTR; -typedef __w64 unsigned int UINT_PTR, * PUINT_PTR; - -typedef __w64 long LONG_PTR, * PLONG_PTR; -typedef __w64 unsigned long ULONG_PTR, * PULONG_PTR; - -typedef ULONG_PTR DWORD_PTR, * PDWORD_PTR; -#endif - -typedef void* THREAD_HANDLE; -typedef void* EVENT_HANDLE; - -////////////////////////////////////////////////////////////////////////// -// Multi platform Hi resolution ticks function, should only be used for profiling. -////////////////////////////////////////////////////////////////////////// - - -int64 CryGetTicks(); -int64 CryGetTicksPerSec(); - -#ifndef SAFE_DELETE -#define SAFE_DELETE(p) { if (p) { delete (p); (p) = NULL; } \ -} -#endif - -#ifndef SAFE_DELETE_ARRAY -#define SAFE_DELETE_ARRAY(p) { if (p) { delete [] (p); (p) = NULL; } \ -} -#endif - -#ifndef SAFE_RELEASE -#define SAFE_RELEASE(p) { if (p) { (p)->Release(); (p) = NULL; } \ -} -#endif - -#ifndef FILE_ATTRIBUTE_NORMAL - #define FILE_ATTRIBUTE_NORMAL 0x00000080 -#endif - -#define TARGET_DEFAULT_ALIGN (0x4U) - - -#endif // CRYINCLUDE_CRYCOMMON_WIN32SPECIFIC_H From f6a72f80534982eb96ec40ce91145170a674aa74 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:26:13 -0800 Subject: [PATCH 196/620] Removes Win32Specific.h from CryCommon cmake file Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CryCommon/crycommon_files.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/Code/Legacy/CryCommon/crycommon_files.cmake b/Code/Legacy/CryCommon/crycommon_files.cmake index 412be4c746..384dd98ecc 100644 --- a/Code/Legacy/CryCommon/crycommon_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_files.cmake @@ -92,7 +92,6 @@ set(FILES MacSpecific.h platform.h platform_impl.cpp - Win32specific.h Win64specific.h LyShine/UiAssetTypes.h LyShine/Bus/UiCursorBus.h From 0af1adbf2fe55ac6e173e9a7b819d36bb3a25879 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:34:45 -0800 Subject: [PATCH 197/620] Removes newoverride.inl from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzToolsFramework/newoverride.inl | 165 ------------------ 1 file changed, 165 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/newoverride.inl diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/newoverride.inl b/Code/Framework/AzToolsFramework/AzToolsFramework/newoverride.inl deleted file mode 100644 index 39cfa6aaa0..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/newoverride.inl +++ /dev/null @@ -1,165 +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 - * - */ -// overrides all new and delete and forwards them to the AZ allocator system -// for tracking purposes. - -#include -#include -#include -#include - -void* operator new(std::size_t size, const AZ::Internal::AllocatorDummy*) -{ - if (!AZ::AllocatorInstance::IsReady()) - { - AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!"); - return malloc(size); - } - - return AZ::AllocatorInstance::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, "global operator aznew", 0, 0); -} -void* operator new[](std::size_t size, const AZ::Internal::AllocatorDummy*) -{ - if (!AZ::AllocatorInstance::IsReady()) - { - AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!"); - return malloc(size); - } - return AZ::AllocatorInstance::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, "global operator aznew[]", 0, 0); -} -void* operator new(std::size_t size, const char* fileName, int lineNum, const char* name, const AZ::Internal::AllocatorDummy*) -{ - if (!AZ::AllocatorInstance::IsReady()) - { - AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!"); - return malloc(size); - } - return AZ::AllocatorInstance::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, name ? name : "global operator aznew", fileName, lineNum); -} -void* operator new[](std::size_t size, const char* fileName, int lineNum, const char* name, const AZ::Internal::AllocatorDummy*) -{ - if (!AZ::AllocatorInstance::IsReady()) - { - AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!"); - return malloc(size); - } - return AZ::AllocatorInstance::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, name ? name : "global operator aznew[]", fileName, lineNum); -} - -void* operator new(std::size_t size) -{ - if (size == 0) - { - size = 1; - } - - if (!AZ::AllocatorInstance::IsReady()) - { - AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!"); - return malloc(size); - } - return AZ::AllocatorInstance::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, "global operator new", 0, 0); -} - -//----------------------------------- -void* operator new[](std::size_t size) -//----------------------------------- -{ - if (size == 0) - { - size = 1; - } - - if (!AZ::AllocatorInstance::IsReady()) - { - AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!"); - return _aligned_malloc(size, AZCORE_GLOBAL_NEW_ALIGNMENT); - } - - return AZ::AllocatorInstance::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, "global operator new[]", 0, 0); -} - -//----------------------------------- -void* operator new(std::size_t size, std::nothrow_t const&) -//----------------------------------- -{ - return operator new(size); -} - -//----------------------------------- -void* operator new[](std::size_t size, std::nothrow_t const&) -//----------------------------------- -{ - return operator new[](size); -} - -// these deletes have to be created to match the new() -// and will only happen during exception handling when allocation fails. -void operator delete(void* ptr, const AZ::Internal::AllocatorDummy*) -{ - if (ptr == 0) - { - return; - } - AZ::AllocatorInstance::Get().DeAllocate(ptr); -} - -void operator delete[](void* ptr, const AZ::Internal::AllocatorDummy*) -{ - if (ptr == 0) - { - return; - } - AZ::AllocatorInstance::Get().DeAllocate(ptr); -} - -void operator delete(void* ptr, const char* fileName, int lineNum, const char* name, const AZ::Internal::AllocatorDummy*) -{ - (void)fileName; - (void)lineNum; - (void)name; - if (ptr == 0) - { - return; - } - AZ::AllocatorInstance::Get().DeAllocate(ptr); -} - -void operator delete[](void* ptr, const char* fileName, int lineNum, const char* name, const AZ::Internal::AllocatorDummy*) -{ - (void)fileName; - (void)lineNum; - (void)name; - if (ptr == 0) - { - return; - } - AZ::AllocatorInstance::Get().DeAllocate(ptr); -} - -void operator delete(void* ptr) -{ - if (ptr == 0) - { - return; - } - - AZ::AllocatorInstance::Get().DeAllocate(ptr); -} - -//----------------------------------- -void operator delete[](void* ptr) -//----------------------------------- -{ - if (ptr == 0) - { - return; - } - AZ::AllocatorInstance::Get().DeAllocate(ptr); -} - From 223fe64d2568a1883547052f764a2249b26e0e32 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:37:40 -0800 Subject: [PATCH 198/620] =?UTF-8?q?=EF=BB=BFRemoves=20EditorVegetationRequ?= =?UTF-8?q?estsBus=20from=20AzToolsFramework?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../API/EditorVegetationRequestsBus.h | 43 ------------------- .../aztoolsframework_files.cmake | 1 - 2 files changed, 44 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorVegetationRequestsBus.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorVegetationRequestsBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorVegetationRequestsBus.h deleted file mode 100644 index 7bfc891476..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorVegetationRequestsBus.h +++ /dev/null @@ -1,43 +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 - * - */ - -#pragma once - -#include -#include -#include - -class CVegetationMap; -struct CVegetationInstance; - -namespace AzToolsFramework -{ - namespace EditorVegetation - { - /** - * Bus used to talk to VegetationMap across the application - */ - class EditorVegetationRequests - : public AZ::EBusTraits - { - public: - using Bus = AZ::EBus; - - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - typedef CVegetationMap* BusIdType; - - virtual ~EditorVegetationRequests() {} - - virtual AZStd::vector GetObjectInstances(const AZ::Vector2& min, const AZ::Vector2& max) = 0; - virtual void DeleteObjectInstance(CVegetationInstance* instance) = 0; - }; - - using EditorVegetationRequestsBus = AZ::EBus; - } -} diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 0d7bf05211..746fb6a445 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -38,7 +38,6 @@ set(FILES API/EditorLevelNotificationBus.h API/ViewportEditorModeTrackerNotificationBus.h API/ViewportEditorModeTrackerNotificationBus.cpp - API/EditorVegetationRequestsBus.h API/EditorPythonConsoleBus.h API/EditorPythonRunnerRequestsBus.h API/EditorPythonScriptNotificationsBus.h From 3c0fa8cb5cd987171e5f9ace8b39272d3ad04495 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:00:29 -0800 Subject: [PATCH 199/620] Removes NullArchiveComponent from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Archive/NullArchiveComponent.cpp | 86 ------------------- .../Archive/NullArchiveComponent.h | 62 ------------- .../aztoolsframework_files.cmake | 2 - 3 files changed, 150 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.cpp deleted file mode 100644 index 972e9d588f..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.cpp +++ /dev/null @@ -1,86 +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 - * - */ - -#include "NullArchiveComponent.h" - -#include -#include - -namespace AzToolsFramework -{ - - void NullArchiveComponent::Activate() - { - ArchiveCommandsBus::Handler::BusConnect(); - } - - void NullArchiveComponent::Deactivate() - { - ArchiveCommandsBus::Handler::BusDisconnect(); - } - - std::future DefaultFuture() - { - std::promise p; - p.set_value(false); - return p.get_future(); - } - - std::future NullArchiveComponent::CreateArchive( - const AZStd::string& /*archivePath*/, - const AZStd::string& /*dirToArchive*/) - { - return DefaultFuture(); - } - - std::future NullArchiveComponent::ExtractArchive( - const AZStd::string& /*archivePath*/, - const AZStd::string& /*destinationPath*/) - { - return DefaultFuture(); - } - - std::future NullArchiveComponent::ExtractFile( - const AZStd::string& /*archivePath*/, - const AZStd::string& /*fileInArchive*/, - const AZStd::string& /*destinationPath*/) - { - return DefaultFuture(); - } - - bool NullArchiveComponent::ListFilesInArchive(const AZStd::string& /*archivePath*/, AZStd::vector& /*outFileEntries*/) - { - return false; - } - - std::future NullArchiveComponent::AddFileToArchive( - const AZStd::string& /*archivePath*/, - const AZStd::string& /*fileToAdd*/, - const AZStd::string& /*pathInArchive*/) - { - return DefaultFuture(); - } - - std::future NullArchiveComponent::AddFilesToArchive( - const AZStd::string& /*archivePath*/, - const AZStd::string& /*workingDirectory*/, - const AZStd::string& /*listFilePath*/) - { - return DefaultFuture(); - } - - void NullArchiveComponent::Reflect(AZ::ReflectContext* context) - { - AZ::SerializeContext* serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ; - } - } -} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.h deleted file mode 100644 index 9ce33d0c85..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.h +++ /dev/null @@ -1,62 +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 - * - */ - -#pragma once - -#include -#include - -namespace AzToolsFramework -{ - class NullArchiveComponent - : public AZ::Component - , private ArchiveCommandsBus::Handler - { - public: - AZ_COMPONENT(NullArchiveComponent, "{D665B6B1-5FF4-4203-B19F-BBDB82587129}") - - NullArchiveComponent() = default; - ~NullArchiveComponent() override = default; - - ////////////////////////////////////////////////////////////////////////// - // AZ::Component overrides - void Activate() override; - void Deactivate() override; - ////////////////////////////////////////////////////////////////////////// - private: - static void Reflect(AZ::ReflectContext* context); - - ////////////////////////////////////////////////////////////////////////// - // ArchiveCommandsBus::Handler overrides - [[nodiscard]] std::future CreateArchive( - const AZStd::string& archivePath, - const AZStd::string& dirToArchive) override; - - [[nodiscard]] std::future ExtractArchive( - const AZStd::string& archivePath, - const AZStd::string& destinationPath) override; - - [[nodiscard]] std::future ExtractFile( - const AZStd::string& archivePath, - const AZStd::string& fileInArchive, - const AZStd::string& destinationPath) override; - - bool ListFilesInArchive(const AZStd::string& archivePath, AZStd::vector& outFileEntries) override; - - [[nodiscard]] std::future AddFileToArchive( - const AZStd::string& archivePath, - const AZStd::string& workingDirectory, - const AZStd::string& fileToAdd) override; - - [[nodiscard]] std::future AddFilesToArchive( - const AZStd::string& archivePath, - const AZStd::string& workingDirectory, - const AZStd::string& listFilePath) override; - ////////////////////////////////////////////////////////////////////////// - }; -} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 746fb6a445..497c64a638 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -642,8 +642,6 @@ set(FILES AssetBrowser/Previewer/PreviewerFrame.h Archive/ArchiveComponent.h Archive/ArchiveComponent.cpp - Archive/NullArchiveComponent.h - Archive/NullArchiveComponent.cpp Archive/ArchiveAPI.h UI/PropertyEditor/Model/AssetCompleterModel.h UI/PropertyEditor/Model/AssetCompleterModel.cpp From 7029135daa0174f451af172b5d17a1d0b9e80447 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:07:20 -0800 Subject: [PATCH 200/620] Removes AssetBrowserBus.inl from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AssetBrowser/AssetBrowserBus.inl | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.inl diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.inl b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.inl deleted file mode 100644 index 0e56a1fdeb..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.inl +++ /dev/null @@ -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 - * - */ - -#pragma once - -#include -#include -#include - -#include - -class QImage; - -namespace AzToolsFramework -{ - namespace AssetBrowser - { - class AssetBrowserModel; - - //! Sends requests to output preview image for texture assets. Used for internal only! - class AssetBrowserTexturePreviewRequests - : public AZ::EBusTraits - { - public: - - // Only a single handler is allowed - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - - //! Request to get a preview image for texture product - //@return whether the output image is valid or not - virtual bool GetProductTexturePreview(const char* /*fullProductFileName*/, QImage& /*previewImage*/, AZStd::string& /*productInfo*/, AZStd::string& /*productAlphaInfo*/) { return false; } - }; - - using AssetBrowserTexturePreviewRequestsBus = AZ::EBus; - } // namespace AssetBrowser -} // namespace AzToolsFramework From 30f7f711113f7d14708579322d7dbbde945962e4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:08:08 -0800 Subject: [PATCH 201/620] Remves AssetBrowserBus.inl from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzToolsFramework/AssetBrowser/AssetBrowserBus.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.h index 54fd142e76..7f0eb18fe3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.h @@ -286,5 +286,3 @@ namespace AzToolsFramework } // namespace AssetBrowser } // namespace AzToolsFramework - -#include From c62c63295ff4cc889235e13ffe2b372d9b08260b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:10:39 -0800 Subject: [PATCH 202/620] Removes SortFilterProxyModel from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AssetBrowser/SortFilterProxyModel.cpp | 186 ------------------ 1 file changed, 186 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/SortFilterProxyModel.cpp diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/SortFilterProxyModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/SortFilterProxyModel.cpp deleted file mode 100644 index d41bfe6e3b..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/SortFilterProxyModel.cpp +++ /dev/null @@ -1,186 +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 - * - */ -#include "SortFilterProxyModel.hxx" - -namespace AzToolsFramework -{ - namespace AssetBrowser - { - ////////////////////////////////////////////////////////////////////////// - //SortFilterProxyModel - SortFilterProxyModel::SortFilterProxyModel(QObject* parent) - : QSortFilterProxyModel(parent) - , m_assetMatchFiltersOperator(AzToolsFramework::FilterOperatorType::And) - { - //uncomment any column you want to see in the view - m_showColumn.insert(AssetBrowserEntry::Column::Name); - //m_showColumn.insert( Entry::Column_SourceID ); - //m_showColumn.insert( Entry::Column_FingerprintValue ); - //m_showColumn.insert( Entry::Colbumn_Guid ); - //m_showColumn.insert( Entry::Column_ScanFolderID ); - //m_showColumn.insert( Entry::Column_ProductID ); - //m_showColumn.insert( Entry::Column_JobID ); - //m_showColumn.insert( Entry::Column_JobKey ); - //m_showColumn.insert( Entry::Column_SubID ); - //m_showColumn.insert( Entry::Column_AssetType ); - //m_showColumn.insert( Entry::Column_Platform ); - //m_showColumn.insert( Entry::Column_ClassID ); - } - - void SortFilterProxyModel::OnSearchCriteriaChanged(QStringList& criteriaList, AzToolsFramework::FilterOperatorType filterOperator) - { - removeAllAssetMatchFilters(); - setAssetMatchFilterOperator(filterOperator); - - for (QString criteria : criteriaList) - { - auto parts = criteria.split(": ", QString::SkipEmptyParts); - addAssetMatchFilter(parts.last().toUtf8().constData()); - } - } - - void SortFilterProxyModel::addAssetTypeFilter(AZ::Data::AssetType assetType) - { - m_assetTypeFilters.push_back(assetType); - invalidateFilter(); - } - - void SortFilterProxyModel::addAssetPathFilter(const char* assetPathFilter) - { - m_assetPathFilters.push_back(assetPathFilter); - invalidateFilter(); - } - - void SortFilterProxyModel::removeAllAssetPathFilters() - { - m_assetPathFilters.clear(); - invalidateFilter(); - } - - void SortFilterProxyModel::setAssetMatchSubDirFilter(bool val) - { - m_includeSubdir = val; - invalidateFilter(); - } - - void SortFilterProxyModel::removeAllAssetMatchFilters() - { - m_assetMatchFilters.clear(); - invalidateFilter(); - } - - void SortFilterProxyModel::addAssetMatchFilter(const char* assetMatchFilter) - { - m_assetMatchFilters.push_back(assetMatchFilter); - invalidateFilter(); - } - - void SortFilterProxyModel::setAssetMatchFilterOperator(AzToolsFramework::FilterOperatorType type) - { - m_assetMatchFiltersOperator = type; - invalidateFilter(); - } - - bool SortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const - { - //get the source idx, if invalid early out - QModelIndex idx = sourceModel()->index(source_row, 0, source_parent); - if (!idx.isValid()) - { - return false; - } - - //the entry is the internal pointer of the index - auto entry = static_cast(idx.internalPointer()); - - if (!entry->isValid()) - { - return false; - } - - //////////////////////////////////////////////////////////////////////// - //we only want to see assets that have at least one child product that has a valid assetType - if (entry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Source) - { - //we have a asset with at least one valid child product assetType - //we only want to see assets that have at least one child product that matches the assetType filter - if (!m_assetTypeFilters.empty()) - { - for (int i = 0; i < entry->GetChildCount(); ++i) - { - auto product = static_cast(entry->GetChild(i)); - if (product->isValid()) - { - if (AZStd::find(m_assetTypeFilters.begin(), m_assetTypeFilters.end(), product->GetAssetType()) == m_assetTypeFilters.end()) - { - return false; - } - } - } - } - } - - ////////////////////////////////////////////////////////////////////////// - //we only want to see assets that match all the match filters - if (!m_assetMatchFilters.empty()) - { - if (m_assetMatchFiltersOperator == AzToolsFramework::FilterOperatorType::And) - { - for (const auto& item : m_assetMatchFilters) - { - if (!entry->Match(item.c_str())) - { - return false; - } - } - } - else if (m_assetMatchFiltersOperator == AzToolsFramework::FilterOperatorType::Or) - { - for (const auto& item : m_assetMatchFilters) - { - if (entry->Match(item.c_str())) - { - return true; - } - } - return false; - } - } - //////////////////////////////////////////////////////////////////////// - - return true; - } - - bool SortFilterProxyModel::filterAcceptsColumn(int source_column, const QModelIndex& source_parent) const - { - (void)source_parent; - - //if the column is in the set we want to show it - return m_showColumn.find(static_cast(source_column)) != m_showColumn.end(); - } - - bool SortFilterProxyModel::lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const - { - if (source_left.column() == source_right.column()) - { - QVariant leftData = sourceModel()->data(source_left); - QVariant rightData = sourceModel()->data(source_right); - if ((leftData.type() == QVariant::String) && - (rightData.type() == QVariant::String)) - { - QString leftString = leftData.toString(); - QString rightString = rightData.toString(); - return QString::compare(leftString, rightString, Qt::CaseInsensitive) > 0; - } - } - return QSortFilterProxyModel::lessThan(source_left, source_right); - } - } // namespace AssetBrowser -} // namespace AzToolsFramework// namespace AssetBrowser - -#include From 7f327324788db9e1ff2d7ca470907744605644cf Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:47:46 -0800 Subject: [PATCH 203/620] Removes AnimValue from CryCommon/Maestro/Types Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../CryCommon/Maestro/Types/AnimValue.h | 39 ------------------- Code/Legacy/CryCommon/crycommon_files.cmake | 1 - 2 files changed, 40 deletions(-) delete mode 100644 Code/Legacy/CryCommon/Maestro/Types/AnimValue.h diff --git a/Code/Legacy/CryCommon/Maestro/Types/AnimValue.h b/Code/Legacy/CryCommon/Maestro/Types/AnimValue.h deleted file mode 100644 index 77748a6ced..0000000000 --- a/Code/Legacy/CryCommon/Maestro/Types/AnimValue.h +++ /dev/null @@ -1,39 +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 - * - */ - - -#ifndef CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_ANIMVALUE_H -#define CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_ANIMVALUE_H -#pragma once - -//! Values that animation track can hold. -// Do not change values! they are serialized -// -// Attention: This should only be expanded if you add a completely new value type that tracks can control! -// If you just want to control a new parameter of an entity etc. extend EParamType -// -// Note: If the param type of a track is known and valid these can be derived from the node. -// These are serialized in case the parameter got invalid (for example for material nodes) -// -enum class AnimValue -{ - Float = 0, - Vector = 1, - Quat = 2, - Bool = 3, - Select = 5, - Vector4 = 15, - DiscreteFloat = 16, - RGB = 20, - CharacterAnim = 21, - - Unknown = static_cast(0xFFFFFFFF) -}; - - -#endif CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_ANIMVALUE_H diff --git a/Code/Legacy/CryCommon/crycommon_files.cmake b/Code/Legacy/CryCommon/crycommon_files.cmake index 384dd98ecc..7b2dc84807 100644 --- a/Code/Legacy/CryCommon/crycommon_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_files.cmake @@ -102,7 +102,6 @@ set(FILES Maestro/Bus/SequenceAgentComponentBus.h Maestro/Types/AnimNodeType.h Maestro/Types/AnimParamType.h - Maestro/Types/AnimValue.h Maestro/Types/AnimValueType.h Maestro/Types/AssetBlendKey.h Maestro/Types/AssetBlends.h From 56802a3cfa81b182dabaf3f789b17c809f8b4db0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:40:33 -0800 Subject: [PATCH 204/620] removes LegacyCommand from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzToolsFramework/Commands/LegacyCommand.h | 47 ------------------- .../aztoolsframework_files.cmake | 1 - 2 files changed, 48 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Commands/LegacyCommand.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/LegacyCommand.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/LegacyCommand.h deleted file mode 100644 index ca82b74265..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/LegacyCommand.h +++ /dev/null @@ -1,47 +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 - * - */ - -#pragma once - -#include -#include -#include -#include -#include -#include - -namespace AzToolsFramework -{ - /** - * AzToolsFramework URSequencePoint wrapper around legacy IUndoObject - * Allows using IUndoObject with AzToolsFramework undo system - */ - template - class LegacyCommand - : public AzToolsFramework::UndoSystem::URSequencePoint - { - public: - AZ_RTTI(LegacyCommand, "{9ED33CB6-04D0-4924-A121-D8C27DC09066}", AzToolsFramework::UndoSystem::URSequencePoint); - AZ_CLASS_ALLOCATOR(LegacyCommand, AZ::SystemAllocator, 0); - - explicit LegacyCommand(const AZStd::string& friendlyName, AZStd::unique_ptr&& legacyUndo) - : AzToolsFramework::UndoSystem::URSequencePoint(friendlyName) - { - m_legacyUndo = AZStd::move(legacyUndo); - } - virtual ~LegacyCommand() = default; - - void Undo() override { m_legacyUndo->Undo(); } - void Redo() override { m_legacyUndo->Redo(); } - - bool Changed() const override { return true; } - - protected: - AZStd::unique_ptr m_legacyUndo; - }; -} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 497c64a638..e0ab8d5b73 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -487,7 +487,6 @@ set(FILES Commands/EntityTransformCommand.h Commands/PreemptiveUndoCache.cpp Commands/PreemptiveUndoCache.h - Commands/LegacyCommand.h Commands/BaseSliceCommand.cpp Commands/BaseSliceCommand.h Commands/SliceDetachEntityCommand.cpp From 6a7553b6823451c8582cf31e07fab3123c9f6fbc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:44:20 -0800 Subject: [PATCH 205/620] Removes AssetBrowserProductThumbnail.cpp that is unused and duplicated by Code\Framework\AzToolsFramework\AzToolsFramework\AssetBrowser\Thumbnails\ProductThumbnail.cpp Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AssetBrowserProductThumbnail.cpp | 124 ------------------ 1 file changed, 124 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/AssetBrowserProductThumbnail.cpp diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/AssetBrowserProductThumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/AssetBrowserProductThumbnail.cpp deleted file mode 100644 index 8f042d2648..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/AssetBrowserProductThumbnail.cpp +++ /dev/null @@ -1,124 +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 - * - */ - -#include -#include -#include -#include -#include -#include - -namespace AzToolsFramework -{ - namespace AssetBrowser - { - ////////////////////////////////////////////////////////////////////////// - // ProductThumbnailKey - ////////////////////////////////////////////////////////////////////////// - ProductThumbnailKey::ProductThumbnailKey(const AZ::Data::AssetId& assetId) - : ThumbnailKey() - , m_assetId(assetId) - { - AZ::Data::AssetInfo info; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(info, &AZ::Data::AssetCatalogRequests::GetAssetInfoById, m_assetId); - m_assetType = info.m_assetType; - } - - const AZ::Data::AssetId& ProductThumbnailKey::GetAssetId() const { return m_assetId; } - - const AZ::Data::AssetType& ProductThumbnailKey::GetAssetType() const { return m_assetType; } - - size_t ProductThumbnailKey::GetHash() const - { - return m_assetType.GetHash(); - } - - bool ProductThumbnailKey::Equals(const ThumbnailKey* other) const - { - if (!ThumbnailKey::Equals(other)) - { - return false; - } - // products displayed in Asset Browser have icons based on asset type, so multiple different products with same asset type will have same thumbnail - return m_assetId == azrtti_cast(other)->GetAssetId(); - } - - ////////////////////////////////////////////////////////////////////////// - // ProductThumbnail - ////////////////////////////////////////////////////////////////////////// - static const char* DEFAULT_PRODUCT_ICON_PATH = "Editor/Icons/AssetBrowser/DefaultProduct_16.svg"; - - ProductThumbnail::ProductThumbnail(Thumbnailer::SharedThumbnailKey key, int thumbnailSize) - : Thumbnail(key, thumbnailSize) - {} - - void ProductThumbnail::LoadThread() - { - auto productKey = azrtti_cast(m_key.data()); - AZ_Assert(productKey, "Incorrect key type, excpected ProductThumbnailKey"); - - QString iconPath; - AZ::AssetTypeInfoBus::EventResult(iconPath, productKey->GetAssetType(), &AZ::AssetTypeInfo::GetBrowserIcon); - if (!iconPath.isEmpty()) - { - // is it an embedded resource or absolute path? - bool isUsablePath = (iconPath.startsWith(":") || (!AzFramework::StringFunc::Path::IsRelative(iconPath.toUtf8().constData()))); - - if (!isUsablePath) - { - // getting here means it needs resolution. Can we find the real path of the file? This also searches in gems for sources. - bool foundIt = false; - AZStd::string watchFolder; - AZ::Data::AssetInfo assetInfo; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(foundIt, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, iconPath.toUtf8().constData(), assetInfo, watchFolder); - - if (foundIt) - { - // the absolute path is join(watchfolder, relativepath); // since its relative to the watch folder. - AZStd::string finalPath; - AzFramework::StringFunc::Path::Join(watchFolder.c_str(), assetInfo.m_relativePath.c_str(), finalPath); - iconPath = QString::fromUtf8(finalPath.c_str()); - } - } - } - else - { - // no pixmap specified - use default. - iconPath = QString::fromUtf8(DEFAULT_PRODUCT_ICON_PATH); - } - - m_icon = QIcon(iconPath); - - if (m_icon.isNull()) - { - m_state = State::Failed; - } - } - - ////////////////////////////////////////////////////////////////////////// - // ProductThumbnailCache - ////////////////////////////////////////////////////////////////////////// - ProductThumbnailCache::ProductThumbnailCache() - : ThumbnailCache() {} - - ProductThumbnailCache::~ProductThumbnailCache() = default; - - const char* ProductThumbnailCache::GetProviderName() const - { - return ProviderName; - } - - bool ProductThumbnailCache::IsSupportedThumbnail(Thumbnailer::SharedThumbnailKey key) const - { - return azrtti_istypeof(key.data()); - } - - } // namespace AssetBrowser -} // namespace AzToolsFramework - -#include "AssetBrowser/Thumbnails/moc_AssetBrowserProductThumbnail.cpp" From 3d1560e5585bfdc2685be9e01f3a52169693e0b3 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:51:56 -0800 Subject: [PATCH 206/620] removes Commands/EntityTransformCommand from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Commands/EntityTransformCommand.cpp | 88 ------------------- .../Commands/EntityTransformCommand.h | 66 -------------- .../aztoolsframework_files.cmake | 2 - 3 files changed, 156 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.cpp deleted file mode 100644 index 72719a1bf3..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.cpp +++ /dev/null @@ -1,88 +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 - * - */ - -#if 0 - -#include "EntityTransformCommand.h" -#include -#include -#include - -namespace AzToolsFramework -{ - TransformCommand::TransformCommand(const AZ::u64& contextId, const AZStd::string& friendlyName, const EntityList& captureEntities) - : UndoSystem::URSequencePoint(friendlyName) - , m_contextId(contextId) - { - for (auto it = captureEntities.begin(); it != captureEntities.end(); ++it) - { - SRT current; - EBUS_EVENT_ID_RESULT(current, *it, TransformComponentMessages::Bus, GetLocalSRT); - m_priorTransforms[*it] = current; - m_nextTransforms[*it] = current; - } - - m_undoCacheInterface = AZ::Interface::Get(); - AZ_Assert(m_undoCacheInterface, "Could not get UndoCacheInterface on TransformCommand construction."); - } - - void TransformCommand::Post() - { - // add to undo stack - UndoSystem::UndoStack* undoStack = NULL; - EBUS_EVENT_ID_RESULT(undoStack, m_contextId, SelectionMessages::Bus, GetUndoStack); - - if (undoStack) - { - undoStack->Post(this); - } - - for (auto it = m_priorTransforms.begin(); it != m_priorTransforms.end(); ++it) - { - m_undoCacheInterface->UpdateCache(it->first); - } - } - - void TransformCommand::Undo() - { - for (auto it = m_priorTransforms.begin(); it != m_priorTransforms.end(); ++it) - { - EBUS_EVENT_ID(it->first, TransformComponentMessages::Bus, SetLocalSRT, it->second); - m_undoCacheInterface->UpdateCache(it->first); - } - } - - void TransformCommand::Redo() - { - for (auto it = m_nextTransforms.begin(); it != m_nextTransforms.end(); ++it) - { - EBUS_EVENT_ID(it->first, TransformComponentMessages::Bus, SetLocalSRT, it->second); - m_undoCacheInterface->UpdateCache(it->first); - } - } - - void TransformCommand::CaptureNewTransform(const AZ::EntityId entityId) - { - AZ_Assert(m_priorTransforms.find(entityId) != m_priorTransforms.end(), "You can't add new transforms during an operation"); - AZ_Assert(m_nextTransforms.find(entityId) != m_nextTransforms.end(), "You can't add new transforms during an operation"); - - SRT current; - EBUS_EVENT_ID_RESULT(current, entityId, TransformComponentMessages::Bus, GetLocalSRT); - m_nextTransforms[entityId] = current; - } - - void TransformCommand::RevertToPriorTransform(const AZ::EntityId entityId) - { - AZ_Assert(m_priorTransforms.find(entityId) != m_priorTransforms.end(), "No such entity!"); - - m_nextTransforms[entityId] = m_priorTransforms[entityId]; - EBUS_EVENT_ID(entityId, TransformComponentMessages::Bus, SetLocalSRT, m_priorTransforms[entityId]); - } -} - -#endif diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.h deleted file mode 100644 index 7448b2cac5..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.h +++ /dev/null @@ -1,66 +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 - * - */ -#ifndef TRANSFORM_COMMAND_H -#define TRANSFORM_COMMAND_H - -#if 0 - -#include -#include -#include -#include -#include -#include - -#pragma once - -namespace AzToolsFramework -{ - namespace UndoSystem - { - class UndoCacheInterface; - } - - typedef AZStd::vector EntityList; - - // transform command specializes undo to just care about the transform of an entity instead of the entire thing, for performance. - class TransformCommand - : public UndoSystem::URSequencePoint - { - public: - AZ_CLASS_ALLOCATOR(TransformCommand, AZ::SystemAllocator, 0); - AZ_RTTI(TransformCommand); - - TransformCommand(const AZ::u64& contextId, const AZStd::string& friendlyName, const EditorFramework::EntityList& captureEntities); - virtual ~TransformCommand() {} - - // the default will work for selections with out an undo stack(maybe move the undo stack here too - void CaptureNewTransform(const AZ::EntityId entityId); - void RevertToPriorTransform(const AZ::EntityId entityID); - - virtual void Undo(); - virtual void Redo(); - - virtual void Post(); - - protected: - AZ::u64 m_contextId; - - typedef AZStd::unordered_map CapturedTransforms; - - CapturedTransforms m_priorTransforms; - CapturedTransforms m_nextTransforms; - - private: - UndoCacheInterface* m_undoCacheInterface; - }; -} - -#endif // disabled - -#endif diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index e0ab8d5b73..dc2ceabfcc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -483,8 +483,6 @@ set(FILES Commands/EntityStateCommand.h Commands/SelectionCommand.cpp Commands/SelectionCommand.h - Commands/EntityTransformCommand.cpp - Commands/EntityTransformCommand.h Commands/PreemptiveUndoCache.cpp Commands/PreemptiveUndoCache.h Commands/BaseSliceCommand.cpp From bb129c3cd140cb850eb62b82fd9a7033c309357b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:56:44 -0800 Subject: [PATCH 207/620] Removes TraceContextBufferedFormatter from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Debug/TraceContextBufferedFormatter.cpp | 149 ------------------ .../Debug/TraceContextBufferedFormatter.h | 66 -------- .../Debug/TraceContextBufferedFormatter.inl | 19 --- .../aztoolsframework_files.cmake | 3 - 4 files changed, 237 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.h delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.inl diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.cpp deleted file mode 100644 index 305d4a8b1e..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.cpp +++ /dev/null @@ -1,149 +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 - * - */ - -#include -#include - -#ifdef AZ_ENABLE_TRACE_CONTEXT - -#include -#include -#include - -#include - -#endif // AZ_ENABLE_TRACE_CONTEXT - -namespace AzToolsFramework -{ - namespace Debug - { - -#ifdef AZ_ENABLE_TRACE_CONTEXT - - int TraceContextBufferedFormatter::Print(char* buffer, size_t bufferSize, const TraceContextStackInterface& stack, bool printUuids, size_t startIndex) - { - if (bufferSize == 0) - { - return -1; - } - - // Make sure there's always a terminator, even if nothing has been written. - buffer[0] = 0; - - size_t stackSize = stack.GetStackCount(); - for (size_t i = startIndex; i < stackSize; ++i) - { - int written = 0; - switch (stack.GetType(i)) - { - case TraceContextStackInterface::ContentType::StringType: - written = azsnprintf(buffer, bufferSize, "%s=%s\n", stack.GetKey(i), stack.GetStringValue(i)); - break; - case TraceContextStackInterface::ContentType::BoolType: - written = azsnprintf(buffer, bufferSize, "%s=%c\n", stack.GetKey(i), (stack.GetBoolValue(i) ? '1' : '0')); - break; - case TraceContextStackInterface::ContentType::IntType: - written = azsnprintf(buffer, bufferSize, "%s=%" PRIi64 "\n", stack.GetKey(i), stack.GetIntValue(i)); - break; - case TraceContextStackInterface::ContentType::UintType: - written = azsnprintf(buffer, bufferSize, "%s=%" PRIu64 "\n", stack.GetKey(i), stack.GetUIntValue(i)); - break; - case TraceContextStackInterface::ContentType::FloatType: - written = azsnprintf(buffer, bufferSize, "%s=%f\n", stack.GetKey(i), stack.GetFloatValue(i)); - break; - case TraceContextStackInterface::ContentType::DoubleType: - written = azsnprintf(buffer, bufferSize, "%s=%f\n", stack.GetKey(i), stack.GetDoubleValue(i)); - break; - case TraceContextStackInterface::ContentType::UuidType: - if (printUuids) - { - written = azsnprintf(buffer, bufferSize, "%s=", stack.GetKey(i)); - if (written > 0) - { - int uuidWritten = PrintUuid(buffer + written, bufferSize - written, stack.GetUuidValue(i)); - written = (uuidWritten < 0 ? -1 : (written + uuidWritten)); - } - break; - } - else - { - continue; - } - case TraceContextStackInterface::ContentType::Undefined: - written = azsnprintf(buffer, bufferSize, "\n"); - break; - default: - written = azsnprintf(buffer, bufferSize, "\n"); - break; - } - - // If successful azsnprintf will return the number of characters that were - // written, so move the buffer forward and reduce the available space. - // Otherwise see if there's anything written that needs to be recovered - // or to simply move to the next entry upon re-entry. - if (written > 0) - { - buffer += written; - bufferSize -= written; - } - else - { - // If the startIndex is the same as the current index, this is the first - // entry to be written. It means this is the largest the buffer will - // ever get, so leave whatever has been written in place. Do however - // add a newline. - if (startIndex == i) - { - if (bufferSize >= 2) - { - buffer[bufferSize - 2] = '\n'; - buffer[bufferSize - 1] = 0; - } - return aznumeric_caster(i + 1); - } - else - { - if (bufferSize > 0) - { - // Remove whatever part has been written as it's not complete. - *buffer = 0; - } - } - return aznumeric_caster(i); - } - } - return -1; - } - - int TraceContextBufferedFormatter::PrintUuid(char* buffer, size_t bufferSize, const AZ::Uuid& uuid) - { - int written = uuid.ToString(buffer, aznumeric_caster(bufferSize), false); - if (written > 0) - { - if (bufferSize > written) - { - buffer[written - 1] = '\n'; - buffer[written] = 0; - return written + 1; - } - } - return -1; - } - -#else // AZ_ENABLE_TRACE_CONTEXT - - int TraceContextBufferedFormatter::Print(char* /*buffer*/, size_t /*bufferSize*/, - const TraceContextStackInterface& /*stack*/, bool /*printUuids*/, size_t /*startIndex*/) - { - return -1; - } - -#endif // AZ_ENABLE_TRACE_CONTEXT - } // Debug -} // AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.h deleted file mode 100644 index 7de1ccfadb..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.h +++ /dev/null @@ -1,66 +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 - * - */ -#pragma once - -#include - -namespace AZ -{ - struct Uuid; -} - -namespace AzToolsFramework -{ - namespace Debug - { - class TraceContextStackInterface; - - // TraceContexBufferedFormatter takes a trace context stack and prints it to the given buffer. - // It's aimed to be used with small to micro sized character buffers. (At least 50-100 - // characters is advised.) If the entire context couldn't be written to the buffer, Build - // can be called repeatedly with the returned index to continue printing the buffer. If a - // single context entry doesn't fit in the buffer, TraceContexBufferedFormatter will attempt - // to write as much data as can be fitted in the buffer. - // - // Typical usage looks like: - // TraceContextSingleStackHandler stackHandler; - // ... - // TraceContexBufferedFormatter buffered; - // char buffer[64]; - // int index = 0; - // do - // { - // index = buffered.Build(buffer, stackHandler.GetStack(), true, index); - // Print(buffer); - // } while (index >= 0); - // - // Example output: - // String=text - // Integer=42 - // Float=3.141500 - // Uuid=E2C7EEFA-B1CA-465F-A4BC-30514F76B7B5 - - class TraceContextBufferedFormatter - { - public: - // Prints the trace context to the given buffer, tags. - // If printUuids is true, the uuid of objects and tags is printed as well. - // Use startIndex to continue from a specific entry. - // Returns the index of the next entry to be written or -1 if no entries are left. - static int Print(char* buffer, size_t bufferSize, const TraceContextStackInterface& stack, bool printUuids, size_t startIndex = 0); - - template - static inline int Print(char(&buffer)[size], const TraceContextStackInterface& stack, bool printUuids, size_t startIndex = 0); - - private: - static int PrintUuid(char* buffer, size_t bufferSize, const AZ::Uuid& uuid); - }; - } // Debug -} // AzToolsFramework - -#include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.inl b/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.inl deleted file mode 100644 index 8b4ebcbd48..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.inl +++ /dev/null @@ -1,19 +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 - * - */ - -namespace AzToolsFramework -{ - namespace Debug - { - template - inline int TraceContextBufferedFormatter::Print(char(&buffer)[size], const TraceContextStackInterface& stack, bool printUuids, size_t startIndex) - { - return Print(buffer, size, stack, printUuids, startIndex); - } - } // Debug -} // AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index dc2ceabfcc..b96eccad18 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -105,9 +105,6 @@ set(FILES Debug/TraceContextSingleStackHandler.cpp Debug/TraceContextMultiStackHandler.h Debug/TraceContextMultiStackHandler.cpp - Debug/TraceContextBufferedFormatter.cpp - Debug/TraceContextBufferedFormatter.inl - Debug/TraceContextBufferedFormatter.h Debug/TraceContextLogFormatter.cpp Debug/TraceContextLogFormatter.h Component/EditorComponentAPIBus.h From c13ceea767aeb5e72e35cd62e6fdabfc96c7a064 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 16:12:16 -0800 Subject: [PATCH 208/620] Some fixes for Windows non-unity builds Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/ColorUtils.cpp | 1 + Code/Editor/Util/GuidUtil.h | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Code/Editor/Util/ColorUtils.cpp b/Code/Editor/Util/ColorUtils.cpp index 3ca715e021..eaaea8a2ef 100644 --- a/Code/Editor/Util/ColorUtils.cpp +++ b/Code/Editor/Util/ColorUtils.cpp @@ -8,6 +8,7 @@ // Qt #include +#include ////////////////////////////////////////////////////////////////////////// QColor ColorLinearToGamma(ColorF col) diff --git a/Code/Editor/Util/GuidUtil.h b/Code/Editor/Util/GuidUtil.h index f42021ae2a..762b556f44 100644 --- a/Code/Editor/Util/GuidUtil.h +++ b/Code/Editor/Util/GuidUtil.h @@ -14,7 +14,12 @@ #define CRYINCLUDE_EDITOR_UTIL_GUIDUTIL_H #pragma once -#include "AzCore/Math/Uuid.h" +#include + +#ifndef _REFGUID_DEFINED +#define _REFGUID_DEFINED +typedef const GUID& REFGUID; +#endif struct GuidUtil { From b3ba73db3bd562f30e7e7e11b77ac16d2243c956 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 16:12:46 -0800 Subject: [PATCH 209/620] Removing unneded include form multiple files Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Plugins/EditorAssetImporter/AssetImporterDocument.cpp | 1 - .../AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp | 1 - .../AzToolsFramework/UI/PropertyEditor/GrowTextEdit.cpp | 2 +- .../UI/PropertyEditor/ThumbnailPropertyCtrl.cpp | 2 +- Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.cpp | 1 - .../SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp | 1 - Code/Tools/SceneAPI/SceneUI/RowWidgets/HeaderHandler.cpp | 1 - .../Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp | 1 - .../Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp | 1 - .../Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp | 1 - .../Code/EMotionFX/Pipeline/RCExt/Actor/MorphTargetExporter.cpp | 1 - .../Pipeline/SceneAPIExt/Behaviors/MorphTargetRuleBehavior.cpp | 1 - .../EMotionFX/Pipeline/SceneAPIExt/Rules/ExternalToolRule.inl | 1 - .../Source/Editor/PropertyWidgets/LODTreeSelectionHandler.cpp | 1 - .../Components/TangentGenerator/TangentGenerateComponent.cpp | 2 -- 15 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Code/Editor/Plugins/EditorAssetImporter/AssetImporterDocument.cpp b/Code/Editor/Plugins/EditorAssetImporter/AssetImporterDocument.cpp index 105a5b4954..4c65affd83 100644 --- a/Code/Editor/Plugins/EditorAssetImporter/AssetImporterDocument.cpp +++ b/Code/Editor/Plugins/EditorAssetImporter/AssetImporterDocument.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp index 2e8e4ef639..37d0c62206 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/GrowTextEdit.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/GrowTextEdit.cpp index 3aac294fe6..ef78543ea4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/GrowTextEdit.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/GrowTextEdit.cpp @@ -6,7 +6,7 @@ * */ -#include +#include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // 4251: 'QRawFont::d': class 'QExplicitlySharedDataPointer' needs to have dll-interface to be used by clients of class 'QRawFont' // 4800: 'QTextEngine *const ': forcing value to bool 'true' or 'false' (performance warning) #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ThumbnailPropertyCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ThumbnailPropertyCtrl.cpp index 0bbb898196..ec817f4ae1 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ThumbnailPropertyCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ThumbnailPropertyCtrl.cpp @@ -6,7 +6,7 @@ * */ -#include +#include // 4251: 'QRawFont::d': class 'QExplicitlySharedDataPointer' needs to have dll-interface to be used by clients of class // 'QRawFont' 4800: 'QTextEngine *const ': forcing value to bool 'true' or 'false' (performance warning) diff --git a/Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.cpp b/Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.cpp index c98fa63916..c3b4ac2889 100644 --- a/Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.cpp +++ b/Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp index 6046bfa620..5fd4dcd387 100644 --- a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp +++ b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/Code/Tools/SceneAPI/SceneUI/RowWidgets/HeaderHandler.cpp b/Code/Tools/SceneAPI/SceneUI/RowWidgets/HeaderHandler.cpp index 0a9fc06286..9aa9f8d1b6 100644 --- a/Code/Tools/SceneAPI/SceneUI/RowWidgets/HeaderHandler.cpp +++ b/Code/Tools/SceneAPI/SceneUI/RowWidgets/HeaderHandler.cpp @@ -7,7 +7,6 @@ */ #include -#include #include namespace AZ diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp index da77df898b..2adab92d0d 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp @@ -12,7 +12,6 @@ #include #include -#include #include diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp index 911981142b..ae1088e662 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp @@ -12,7 +12,6 @@ #include #include -#include #include #include diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp index 35a903dac0..07b48a78f1 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp @@ -13,7 +13,6 @@ #include #include -#include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/RCExt/Actor/MorphTargetExporter.cpp b/Gems/EMotionFX/Code/EMotionFX/Pipeline/RCExt/Actor/MorphTargetExporter.cpp index e4ae782782..265b003090 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/RCExt/Actor/MorphTargetExporter.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/RCExt/Actor/MorphTargetExporter.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/MorphTargetRuleBehavior.cpp b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/MorphTargetRuleBehavior.cpp index f6a11e3004..70abe37817 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/MorphTargetRuleBehavior.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/MorphTargetRuleBehavior.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/ExternalToolRule.inl b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/ExternalToolRule.inl index 511bab83d1..6aca774f62 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/ExternalToolRule.inl +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/ExternalToolRule.inl @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/LODTreeSelectionHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/LODTreeSelectionHandler.cpp index be916c8e3a..7c1e45e5ac 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/LODTreeSelectionHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/LODTreeSelectionHandler.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include #include diff --git a/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentGenerateComponent.cpp b/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentGenerateComponent.cpp index fdf58f2502..144638a351 100644 --- a/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentGenerateComponent.cpp +++ b/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentGenerateComponent.cpp @@ -27,8 +27,6 @@ #include #include -#include - #include #include From 8eebbd53a427e0744de4409c7094d10890be3afd Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 17:03:35 -0800 Subject: [PATCH 210/620] Removes IAudioSystemMock from CryCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Legacy/CryCommon/Mocks/IAudioSystemMock.h | 59 ------------------- .../CryCommon/crycommon_testing_files.cmake | 1 - .../Code/Tests/AudioSystemTest.cpp | 1 - 3 files changed, 61 deletions(-) delete mode 100644 Code/Legacy/CryCommon/Mocks/IAudioSystemMock.h diff --git a/Code/Legacy/CryCommon/Mocks/IAudioSystemMock.h b/Code/Legacy/CryCommon/Mocks/IAudioSystemMock.h deleted file mode 100644 index e93be4813f..0000000000 --- a/Code/Legacy/CryCommon/Mocks/IAudioSystemMock.h +++ /dev/null @@ -1,59 +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 - * - */ - -#pragma once - -#include - -namespace Audio -{ - struct AudioProxyMock - : public IAudioProxy - { - MOCK_METHOD2(Initialize, void(const char* const sObjectName, bool bInitAsync /* = true */)); - MOCK_METHOD0(Release, void()); - MOCK_METHOD0(Reset, void()); - MOCK_METHOD1(StopTrigger, void(TAudioControlID nTriggerID)); - MOCK_METHOD2(SetSwitchState, void(TAudioControlID nSwitchID, TAudioSwitchStateID nStateID)); - MOCK_METHOD2(SetRtpcValue, void(TAudioControlID nRtpcID, float fValue)); - MOCK_METHOD1(SetObstructionCalcType, void(EAudioObjectObstructionCalcType eObstructionType)); - MOCK_METHOD1(SetPosition, void(const SATLWorldPosition& rPosition)); - MOCK_METHOD1(SetPosition, void(const AZ::Vector3& rPosition)); - MOCK_METHOD2(SetEnvironmentAmount, void(TAudioEnvironmentID nEnvironmentID, float fAmount)); - MOCK_METHOD0(SetCurrentEnvironments, void()); - MOCK_CONST_METHOD0(GetAudioObjectID, TAudioObjectID()); - }; - - struct AudioSystemMock - : public IAudioSystem - { - MOCK_METHOD0(Initialize, bool()); - MOCK_METHOD0(Release, void()); - MOCK_METHOD1(PushRequest, void(const SAudioRequest& rAudioRequestData)); - MOCK_METHOD4(AddRequestListener, void(AudioRequestCallbackType func, void* pObjectToListenTo, EAudioRequestType requestType /* = eART_AUDIO_ALL_REQUESTS */, TATLEnumFlagsType specificRequestMask /* = ALL_AUDIO_REQUEST_SPECIFIC_TYPE_FLAGS */)); - MOCK_METHOD2(RemoveRequestListener, void(AudioRequestCallbackType func, void* pObjectToListenTo)); - MOCK_METHOD0(ExternalUpdate, void()); - MOCK_CONST_METHOD1(GetAudioTriggerID, TAudioControlID(const char* sAudioTriggerName)); - MOCK_CONST_METHOD1(GetAudioRtpcID, TAudioControlID(const char* sAudioRtpcName)); - MOCK_CONST_METHOD1(GetAudioSwitchID, TAudioControlID(const char* sAudioSwitchName)); - MOCK_CONST_METHOD2(GetAudioSwitchStateID, TAudioSwitchStateID(const TAudioControlID nSwitchID, const char* sAudioStateName)); - MOCK_CONST_METHOD1(GetAudioPreloadRequestID, TAudioPreloadRequestID(const char* sAudioPreloadRequestName)); - MOCK_CONST_METHOD1(GetAudioEnvironmentID, TAudioEnvironmentID(const char* sAudioEnvironmentName)); - MOCK_METHOD1(ReserveAudioListenerID, bool(TAudioObjectID& rAudioListenerID)); - MOCK_METHOD1(ReleaseAudioListenerID, bool(TAudioObjectID nAudioObjectID)); - MOCK_METHOD1(OnCVarChanged, void(ICVar* const pCVar)); - MOCK_METHOD1(GetInfo, void(SAudioSystemInfo& rAudioSystemInfo)); - MOCK_CONST_METHOD0(GetControlsPath, const char*()); - MOCK_METHOD0(UpdateControlsPath, void()); - MOCK_METHOD0(GetFreeAudioProxy, IAudioProxy*()); - MOCK_METHOD1(FreeAudioProxy, void(IAudioProxy* pIAudioProxy)); - MOCK_CONST_METHOD2(GetAudioControlName, const char*(EAudioControlType eAudioEntityType, TATLIDType nAudioEntityID)); - MOCK_CONST_METHOD2(GetAudioSwitchStateName, const char*(TAudioControlID switchID, TAudioSwitchStateID stateID)); - }; - -} // namespace Audio diff --git a/Code/Legacy/CryCommon/crycommon_testing_files.cmake b/Code/Legacy/CryCommon/crycommon_testing_files.cmake index 42deecd576..de7a764330 100644 --- a/Code/Legacy/CryCommon/crycommon_testing_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_testing_files.cmake @@ -7,7 +7,6 @@ # set(FILES - Mocks/IAudioSystemMock.h Mocks/IConsoleMock.h Mocks/ICryPakMock.h Mocks/ILogMock.h diff --git a/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp b/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp index 14e9f74fd2..1f03eec419 100644 --- a/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp +++ b/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp @@ -21,7 +21,6 @@ #include #include -#include #include #include From 4d2e4f437a6a1be91540e312609781c3c1988791 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 17:27:23 -0800 Subject: [PATCH 211/620] Removes ILogMock from CryCommon/Mocks Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Lib/Tests/test_EditorPythonBindings.cpp | 1 - Code/Legacy/CryCommon/Mocks/ILogMock.h | 57 ------------------- .../CryCommon/crycommon_testing_files.cmake | 1 - 3 files changed, 59 deletions(-) delete mode 100644 Code/Legacy/CryCommon/Mocks/ILogMock.h diff --git a/Code/Editor/Lib/Tests/test_EditorPythonBindings.cpp b/Code/Editor/Lib/Tests/test_EditorPythonBindings.cpp index 49b65f7ffc..0c5e221d21 100644 --- a/Code/Editor/Lib/Tests/test_EditorPythonBindings.cpp +++ b/Code/Editor/Lib/Tests/test_EditorPythonBindings.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include "IEditorMock.h" diff --git a/Code/Legacy/CryCommon/Mocks/ILogMock.h b/Code/Legacy/CryCommon/Mocks/ILogMock.h deleted file mode 100644 index ac2ba7f32c..0000000000 --- a/Code/Legacy/CryCommon/Mocks/ILogMock.h +++ /dev/null @@ -1,57 +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 - * - */ -#pragma once -#include - -class LogMock - : public ILog -{ -public: - MOCK_METHOD3(LogV, - void(ELogType nType, const char* szFormat, va_list args)); - MOCK_METHOD4(LogV, - void(ELogType nType, int flags, const char* szFormat, va_list args)); - MOCK_METHOD0(Release, - void()); - MOCK_METHOD2(SetFileName, - bool(const char* fileNameOrFullPath, bool doBackups)); - MOCK_METHOD0(GetFileName, - const char*()); - MOCK_METHOD0(GetBackupFileName, - const char*()); - - virtual void Log([[maybe_unused]] const char* szCommand, ...) override {} - virtual void LogWarning([[maybe_unused]] const char* szCommand, ...) override {} - virtual void LogError([[maybe_unused]] const char* szCommand, ...) override {} - virtual void LogAlways([[maybe_unused]] const char* szCommand, ...) override {} - virtual void LogPlus([[maybe_unused]] const char* command, ...) override {} - virtual void LogToFile([[maybe_unused]] const char* command, ...) override {} - virtual void LogToFilePlus([[maybe_unused]] const char* command, ...) override {} - virtual void LogToConsole([[maybe_unused]] const char* command, ...) override {} - virtual void LogToConsolePlus([[maybe_unused]] const char* command, ...) override {} - virtual void UpdateLoadingScreen([[maybe_unused]] const char* command, ...) override {} - - MOCK_METHOD1(SetVerbosity, - void(int verbosity)); - MOCK_METHOD0(GetVerbosityLevel, - int()); - MOCK_METHOD1(AddCallback, - void(ILogCallback * pCallback)); - MOCK_METHOD1(RemoveCallback, - void(ILogCallback * pCallback)); - MOCK_METHOD0(Update, - void()); - MOCK_METHOD0(GetModuleFilter, - const char*()); - MOCK_METHOD1(Indent, - void(class CLogIndenter * indenter)); - MOCK_METHOD1(Unindent, - void(class CLogIndenter * indenter)); - MOCK_METHOD0(FlushAndClose, - void()); -}; diff --git a/Code/Legacy/CryCommon/crycommon_testing_files.cmake b/Code/Legacy/CryCommon/crycommon_testing_files.cmake index de7a764330..5131e162f6 100644 --- a/Code/Legacy/CryCommon/crycommon_testing_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_testing_files.cmake @@ -9,7 +9,6 @@ set(FILES Mocks/IConsoleMock.h Mocks/ICryPakMock.h - Mocks/ILogMock.h Mocks/ISystemMock.h Mocks/ICVarMock.h ) From ef97c2d3b8327cc4391ebccfc738d367b37ab718 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 17:46:22 -0800 Subject: [PATCH 212/620] Removes XMLBinaryWriter from CrySystem Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CrySystem/XML/XMLBinaryWriter.cpp | 284 ------------------ Code/Legacy/CrySystem/XML/XMLBinaryWriter.h | 53 ---- Code/Legacy/CrySystem/XML/XmlUtils.cpp | 1 - .../XML/crysystem_xmlbinary_files.cmake | 2 - 4 files changed, 340 deletions(-) delete mode 100644 Code/Legacy/CrySystem/XML/XMLBinaryWriter.cpp delete mode 100644 Code/Legacy/CrySystem/XML/XMLBinaryWriter.h diff --git a/Code/Legacy/CrySystem/XML/XMLBinaryWriter.cpp b/Code/Legacy/CrySystem/XML/XMLBinaryWriter.cpp deleted file mode 100644 index 63bf4adef2..0000000000 --- a/Code/Legacy/CrySystem/XML/XMLBinaryWriter.cpp +++ /dev/null @@ -1,284 +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 - * - */ - - -#include -#include "XMLBinaryWriter.h" -#include "CryEndian.h" -#include // memcpy() - -////////////////////////////////////////////////////////////////////////// -XMLBinary::CXMLBinaryWriter::CXMLBinaryWriter() -{ - m_nStringDataSize = 0; -} - -static void align(size_t& nPosition, const size_t nAlignment) -{ - const size_t nPadSize = ((nPosition + (nAlignment - 1)) & ~(nAlignment - 1)) - nPosition; - nPosition += nPadSize; -} - -static void alignWrite(XMLBinary::IDataWriter* const pFile, size_t& nPosition, const size_t nAlignment) -{ - size_t nPadSize = ((nPosition + (nAlignment - 1)) & ~(nAlignment - 1)) - nPosition; - - if (nPadSize > 0) - { - nPosition += nPadSize; - - static const char zeroes[32] = { 0 }; - - while (nPadSize > 0) - { - const size_t n = (nPadSize <= sizeof(zeroes)) ? nPadSize : sizeof(zeroes); - nPadSize -= n; - pFile->Write(zeroes, n); - } - } -} - -static void write(XMLBinary::IDataWriter* const pFile, size_t& nPosition, const void* const pData, const size_t nDataSize) -{ - pFile->Write(pData, nDataSize); - nPosition += nDataSize; -} - -////////////////////////////////////////////////////////////////////////// -bool XMLBinary::CXMLBinaryWriter::WriteNode(IDataWriter* pFile, XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string& error) -{ - error = ""; - - // Scan the node tree, building a flat node list, attribute list and string table. - m_nStringDataSize = 0; - - if (!CompileTables(node, pFilter, error)) - { - return false; - } - - static const uint nMaxNodeCount = (NodeIndex) ~0; - if (m_nodes.size() > nMaxNodeCount) - { - error = AZStd::string::format("XMLBinary: Too many nodes: %zu (max is %i)", m_nodes.size(), nMaxNodeCount); - return false; - } - - // Initialize the file header. - size_t nTheoreticalPosition = 0; - static const size_t nAlignment = sizeof(uint32); - - BinaryFileHeader header; - static const char signature[] = "CryXmlB"; - static_assert(sizeof(signature) == sizeof(header.szSignature)); - memcpy(header.szSignature, signature, sizeof(header.szSignature)); - nTheoreticalPosition += sizeof(header); - align(nTheoreticalPosition, nAlignment); - - header.nNodeTablePosition = static_cast(nTheoreticalPosition); - header.nNodeCount = int(m_nodes.size()); - nTheoreticalPosition += header.nNodeCount * sizeof(Node); - align(nTheoreticalPosition, nAlignment); - - header.nChildTablePosition = static_cast(nTheoreticalPosition); - header.nChildCount = int(m_childs.size()); - nTheoreticalPosition += header.nChildCount * sizeof(NodeIndex); - align(nTheoreticalPosition, nAlignment); - - header.nAttributeTablePosition = static_cast(nTheoreticalPosition); - header.nAttributeCount = int(m_attributes.size()); - nTheoreticalPosition += header.nAttributeCount * sizeof(Attribute); - align(nTheoreticalPosition, nAlignment); - - header.nStringDataPosition = static_cast(nTheoreticalPosition); - header.nStringDataSize = m_nStringDataSize; - nTheoreticalPosition += header.nStringDataSize; - - header.nXMLSize = static_cast(nTheoreticalPosition); - - // Write file - { - nTheoreticalPosition = 0; - - // Write out the file header. - write(pFile, nTheoreticalPosition, &header, sizeof(header)); - alignWrite(pFile, nTheoreticalPosition, nAlignment); - - // Write out the node table. - if (!m_nodes.empty()) - { - write(pFile, nTheoreticalPosition, &m_nodes[0], sizeof(m_nodes[0]) * m_nodes.size()); - alignWrite(pFile, nTheoreticalPosition, nAlignment); - } - - // Write out the children table. - if (!m_childs.empty()) - { - write(pFile, nTheoreticalPosition, &m_childs[0], sizeof(m_childs[0]) * m_childs.size()); - alignWrite(pFile, nTheoreticalPosition, nAlignment); - } - - // Write out the attribute table. - if (!m_attributes.empty()) - { - write(pFile, nTheoreticalPosition, &m_attributes[0], sizeof(m_attributes[0]) * m_attributes.size()); - alignWrite(pFile, nTheoreticalPosition, nAlignment); - } - - // Write out the data of all the m_strings. - for (size_t nString = 0; nString < m_strings.size(); ++nString) - { - pFile->Write(m_strings[nString].c_str(), m_strings[nString].size() + 1); - } - } - - return true; -} - -bool XMLBinary::CXMLBinaryWriter::CompileTables(XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string& error) -{ - bool ok = CompileTablesForNode(node, -1, pFilter, error); - ok = ok && CompileChildTable(node, pFilter, error); - return ok; -} - -////////////////////////////////////////////////////////////////////////// -bool XMLBinary::CXMLBinaryWriter::CompileTablesForNode(XmlNodeRef node, int nParentIndex, XMLBinary::IFilter* pFilter, AZStd::string& error) -{ - // Add the tag to the string table. - int nTagStringOffset = AddString(node->getTag()); - - // Add the content string to the string table. - int nContentStringOffset = AddString(node->getContent()); - - // Add all the attributes to the attributes table. - const char* szKey; - const char* szValue; - const int nFirstAttributeIndex = int(m_attributes.size()); - for (int i = 0, attrCount = node->getNumAttributes(); i < attrCount; ++i) - { - if (node->getAttributeByIndex(i, &szKey, &szValue) && - (!pFilter || pFilter->IsAccepted(IFilter::eType_AttributeName, szKey))) - { - // Add the key and the value to the string table. - Attribute attribute; - attribute.nKeyStringOffset = AddString(szKey); - attribute.nValueStringOffset = AddString(szValue); - - // Add the attribute to the attribute table. - m_attributes.push_back(attribute); - } - } - const int nAttributeCount = int(m_attributes.size()) - nFirstAttributeIndex; - - static const int nMaxAttributeCount = (uint16) ~0; - if (nAttributeCount > nMaxAttributeCount) - { - error = AZStd::string::format("XMLBinary: Too many attributes in a node: %d (max is %i)", nAttributeCount, nMaxAttributeCount); - return false; - } - - // Add ourselves to the node list. - const int nIndex = int(m_nodes.size()); - { - Node nd; - memset(&nd, 0, sizeof(nd)); - nd.nTagStringOffset = nTagStringOffset; - nd.nContentStringOffset = nContentStringOffset; - nd.nParentIndex = nParentIndex; - nd.nFirstAttributeIndex = nFirstAttributeIndex; - nd.nAttributeCount = static_cast(nAttributeCount); - - m_nodes.push_back(nd); - } - - m_nodesMap.insert(NodesMap::value_type(node, nIndex)); - - // Recurse to the child nodes. - int nChildCount = 0; - static const int nMaxChildCount = (uint16) ~0; - for (int nChild = 0, numChilds = node->getChildCount(); nChild < numChilds; ++nChild) - { - XmlNodeRef childNode = node->getChild(nChild); - if (!pFilter || pFilter->IsAccepted(IFilter::eType_ElementName, childNode->getTag())) - { - if (++nChildCount > nMaxChildCount) - { - error = AZStd::string::format("XMLBinary: Too many children in node '%s': %d (max is %i)", childNode->getTag(), nChildCount, nMaxChildCount); - return false; - } - if (!CompileTablesForNode(childNode, nIndex, pFilter, error)) - { - return false; - } - } - } - - m_nodes[nIndex].nChildCount = static_cast(nChildCount); - - return true; -} - -////////////////////////////////////////////////////////////////////////// -bool XMLBinary::CXMLBinaryWriter::CompileChildTable(XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string& error) -{ - const int nIndex = m_nodesMap.find(node)->second; // Assume node always exist in map. - const int nFirstChildIndex = (int)m_childs.size(); - - Node& nd = m_nodes[nIndex]; - nd.nFirstChildIndex = nFirstChildIndex; - - int nChildCount = 0; - for (int nChild = 0, numChilds = node->getChildCount(); nChild < numChilds; ++nChild) - { - XmlNodeRef childNode = node->getChild(nChild); - if (!pFilter || pFilter->IsAccepted(IFilter::eType_ElementName, childNode->getTag())) - { - ++nChildCount; - const int nChildIndex = m_nodesMap.find(childNode)->second; // Assume node always exist in map. - m_childs.push_back(nChildIndex); - } - } - if (nChildCount != nd.nChildCount) - { - error = AZStd::string::format("XMLBinary: Internal error in CompileChildTable()"); - return false; - } - - // Recurse to the child nodes. - for (int nChild = 0, numChilds = node->getChildCount(); nChild < numChilds; ++nChild) - { - XmlNodeRef childNode = node->getChild(nChild); - if (!pFilter || pFilter->IsAccepted(IFilter::eType_ElementName, childNode->getTag())) - { - if (!CompileChildTable(childNode, pFilter, error)) - { - return false; - } - } - } - - return true; -} - -////////////////////////////////////////////////////////////////////////// -int XMLBinary::CXMLBinaryWriter::AddString(const XmlString& sString) -{ - // If we have such string already, then we will re-use its data. - StringMap::const_iterator itStringEntry = m_stringMap.find(sString); - if (itStringEntry == m_stringMap.end()) - { - // We don't have such string yet, so we should add it to the tables. - m_strings.push_back(sString); - itStringEntry = m_stringMap.insert(StringMap::value_type(sString, m_nStringDataSize)).first; - m_nStringDataSize += static_cast(sString.length() + 1); - } - - // Return offset of the string in the string data buffer. - return (*itStringEntry).second; -} diff --git a/Code/Legacy/CrySystem/XML/XMLBinaryWriter.h b/Code/Legacy/CrySystem/XML/XMLBinaryWriter.h deleted file mode 100644 index 4b0d19fe26..0000000000 --- a/Code/Legacy/CrySystem/XML/XMLBinaryWriter.h +++ /dev/null @@ -1,53 +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 - * - */ - - -#ifndef CRYINCLUDE_CRYSYSTEM_XML_XMLBINARYWRITER_H -#define CRYINCLUDE_CRYSYSTEM_XML_XMLBINARYWRITER_H -#pragma once - - -#include "IXml.h" -#include "XMLBinaryHeaders.h" -#include -#include - -class IXMLDataSink; - -namespace XMLBinary -{ - class CXMLBinaryWriter - { - public: - CXMLBinaryWriter(); - bool WriteNode(IDataWriter* pFile, XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string & error); - - private: - bool CompileTables(XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string& error); - - bool CompileTablesForNode(XmlNodeRef node, int nParentIndex, XMLBinary::IFilter* pFilter, AZStd::string& error); - bool CompileChildTable(XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string& error); - int AddString(const XmlString& sString); - - private: - // tables. - typedef std::map NodesMap; - typedef std::map StringMap; - - std::vector m_nodes; - NodesMap m_nodesMap; - std::vector m_attributes; - std::vector m_childs; - std::vector m_strings; - StringMap m_stringMap; - - uint m_nStringDataSize; - }; -} - -#endif // CRYINCLUDE_CRYSYSTEM_XML_XMLBINARYWRITER_H diff --git a/Code/Legacy/CrySystem/XML/XmlUtils.cpp b/Code/Legacy/CrySystem/XML/XmlUtils.cpp index 26d6f2336b..1eae548dfd 100644 --- a/Code/Legacy/CrySystem/XML/XmlUtils.cpp +++ b/Code/Legacy/CrySystem/XML/XmlUtils.cpp @@ -16,7 +16,6 @@ #include "SerializeXMLReader.h" #include "SerializeXMLWriter.h" -#include "XMLBinaryWriter.h" #include "XMLBinaryReader.h" #include diff --git a/Code/Legacy/CrySystem/XML/crysystem_xmlbinary_files.cmake b/Code/Legacy/CrySystem/XML/crysystem_xmlbinary_files.cmake index 14931fdec1..72d83b5344 100644 --- a/Code/Legacy/CrySystem/XML/crysystem_xmlbinary_files.cmake +++ b/Code/Legacy/CrySystem/XML/crysystem_xmlbinary_files.cmake @@ -11,6 +11,4 @@ set(FILES XMLBinaryNode.h XMLBinaryReader.cpp XMLBinaryReader.h - XMLBinaryWriter.cpp - XMLBinaryWriter.h ) From fc30667795ed8bd6f1108abb5d9c89d0ec07438e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 11:04:03 -0800 Subject: [PATCH 213/620] Removes ThumbnailDelegate from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Thumbnails/ThumbnailDelegate.h | 48 ------------------- .../Thumbnails/ThumbnailWidget.h | 2 +- 2 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailDelegate.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailDelegate.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailDelegate.h deleted file mode 100644 index d21b6d7699..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailDelegate.h +++ /dev/null @@ -1,48 +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 - * - */ - -#pragma once - -#include - -#include - -class QWidget; -class QPainter; -class QStyleOptionViewItem; -class QAbstractItemModel; -class QModelIndex; - -namespace AzToolsFramework -{ - namespace Thumbnailer - { - //! Thumbnail delegate can be used as within item views to draw thumbnails - class ThumbnailDelegate - : public QStyledItemDelegate - { - Q_OBJECT - public: - explicit ThumbnailDelegate(QWidget* parent = nullptr); - ~ThumbnailDelegate() override; - - ////////////////////////////////////////////////////////////////////////// - // QStyledItemDelegate - ////////////////////////////////////////////////////////////////////////// - void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; - QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override; - void setEditorData(QWidget* editor, const QModelIndex& index) const override; - void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; - //! Set location where thumbnails are searched - void SetThumbnailContext(const char* thumbnailContext); - - private: - AZStd::string m_thumbnailContext; - }; - } // namespace Thumbnailer -} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailWidget.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailWidget.h index 0674726155..6dab575af5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailWidget.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailWidget.h @@ -22,7 +22,7 @@ namespace AzToolsFramework { namespace Thumbnailer { - //! A widget used to display thumbnail. To display thumbnails within item views, use ThumbnailDelegate + //! A widget used to display thumbnail class ThumbnailWidget : public QWidget { From 9aa2cbeabac2f28011420ec2c5c685bc5f3a8c58 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 11:44:18 -0800 Subject: [PATCH 214/620] Removes EditorOutlinerComponent from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ToolsComponents/EditorOutlinerComponent.h | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorOutlinerComponent.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorOutlinerComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorOutlinerComponent.h deleted file mode 100644 index 196f0931e0..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorOutlinerComponent.h +++ /dev/null @@ -1,7 +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 - * - */ From f8f9b79f7c0c01903fee2304b252f34ecfb31fdd Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 11:45:59 -0800 Subject: [PATCH 215/620] Removes ToolFileUtils_generic.cpp from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ToolsFileUtils/ToolsFileUtils_generic.cpp | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp deleted file mode 100644 index 8357a265ba..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp +++ /dev/null @@ -1,47 +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 - * - */ - -#include "ToolsFileUtils.h" -#include -#include - -#include - -namespace AzToolsFramework -{ - namespace ToolsFileUtils - { - bool SetModificationTime(const char* const filename, AZ::u64 modificationTime) - { - struct stat statResult; - if (stat(filename, &statResult) != 0) - { - return false; - } - - struct utimbuf puttime; - puttime.modtime = modificationTime; - puttime.actime = static_cast(statResult.st_ctime); - - if (utime(filename, &puttime) == 0) - { - return true; - } - - return false; - } - - bool GetFreeDiskSpace(const QString& path, qint64& outFreeDiskSpace) - { - QStorageInfo storageInfo(path); - outFreeDiskSpace = storageInfo.bytesFree(); - - return outFreeDiskSpace >= 0; - } - } -} From 643bc70c1e1c5fa13a1f53f250d716230b294817 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 11:52:12 -0800 Subject: [PATCH 216/620] Remove ComponentPaletteModelFilter from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ComponentPaletteModelFilter.cpp | 53 ------------------- .../ComponentPaletteModelFilter.hxx | 29 ---------- .../aztoolsframework_files.cmake | 2 - 3 files changed, 84 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.hxx diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.cpp deleted file mode 100644 index abc66d1a66..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.cpp +++ /dev/null @@ -1,53 +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 - * - */ - -#include "ComponentPaletteModelFilter.hxx" -#include - -namespace AzToolsFramework -{ - - ComponentPaletteModelFilter::ComponentPaletteModelFilter(QObject* parent) - : QSortFilterProxyModel(parent) - { - } - - bool ComponentPaletteModelFilter::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const - { - const QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); - if (!index.isValid()) - { - return false; - } - - if (!filterRegExp().isValid()) - { - return true; - } - - auto componentClass = reinterpret_cast(sourceModel()->data(index, Qt::ItemDataRole::UserRole + 1).toULongLong()); - if (componentClass) - { - const QString componentName = sourceModel()->data(index, Qt::DisplayRole).toString(); - return componentName.contains(filterRegExp()); - } - - const int childRowCount = sourceModel()->rowCount(index); - for (int childRow = 0; childRow < childRowCount; ++childRow) - { - if (filterAcceptsRow(childRow, index)) - { - return true; - } - } - - return false; - } -} - -#include "UI/ComponentPalette/moc_ComponentPaletteModelFilter.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.hxx deleted file mode 100644 index 19a6c72fe9..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.hxx +++ /dev/null @@ -1,29 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace AzToolsFramework -{ - class ComponentPaletteModelFilter : public QSortFilterProxyModel - { - Q_OBJECT - - public: - ComponentPaletteModelFilter(QObject* parent = nullptr); - - bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; - - protected: - QRegExp m_filterRegExp; - }; -} diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index b96eccad18..b28a62a27f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -356,8 +356,6 @@ set(FILES UI/ComponentPalette/ComponentPaletteWidget.cpp UI/ComponentPalette/ComponentPaletteModel.hxx UI/ComponentPalette/ComponentPaletteModel.cpp - UI/ComponentPalette/ComponentPaletteModelFilter.hxx - UI/ComponentPalette/ComponentPaletteModelFilter.cpp UI/ComponentPalette/ComponentPaletteUtil.hxx UI/ComponentPalette/ComponentPaletteUtil.cpp UI/Layer/NameConflictWarning.hxx From e2091f245130b61caa4170cce0c4a51f7deeaf2e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 12:15:20 -0800 Subject: [PATCH 217/620] Removes UIFrameworkAPI.cpp from AzToolsFramework Removes aztoolsframework_win_files.cmake (aztoolsframework_windows_files.cmake is the actual used one) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UI/LegacyFramework/UIFrameworkAPI.cpp | 67 ------------------- .../aztoolsframework_win_files.cmake | 34 ---------- .../aztoolsframework_windows_files.cmake | 1 - 3 files changed, 102 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/UIFrameworkAPI.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_win_files.cmake diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/UIFrameworkAPI.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/UIFrameworkAPI.cpp deleted file mode 100644 index e4192b6a90..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/UIFrameworkAPI.cpp +++ /dev/null @@ -1,67 +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 - * - */ - -#include "UIFrameworkAPI.h" -#include -#include - -#ifdef Q_OS_WIN -# include -#endif - -#include - -#include -#include - -namespace AzToolsFramework -{ - namespace - { - // an aggregator utility which essentially provides the operation of returning the last result of an ebus event - // which returned something which returns a non-false value (like for example if its a pointer, then the last non-null value) - template - struct EBusLastNonNullResult - { - T value; - EBusLastNonNullResult() { value = NULL; } - AZ_FORCE_INLINE void operator=(const T& rhs) - { - if (rhs) - { - value = rhs; - } - } - AZ_FORCE_INLINE T& operator->() { return value; } - }; - - template - struct EBusAnyTrueResult - { - T value; - AZ_FORCE_INLINE void operator=(const T& rhs) { value = rhs || value; } - AZ_FORCE_INLINE T& operator->() { return value; } - }; - } - - bool GetOverwritePromptResult(QWidget* pParentWidget, const char* assetNameToOvewrite) - { - OverwritePromptDialog dlg(pParentWidget); - if (assetNameToOvewrite) - { - dlg.UpdateLabel(QString::fromUtf8(assetNameToOvewrite)); - } - - if (!dlg.exec() == QDialog::Accepted) - { - return false; - } - - return dlg.m_result; - } -} diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_win_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_win_files.cmake deleted file mode 100644 index 5f3ff425fa..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_win_files.cmake +++ /dev/null @@ -1,34 +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 -# -# - -set(FILES - UI/LegacyFramework/MainWindowSavedState.h - UI/LegacyFramework/MainWindowSavedState.cpp - UI/LegacyFramework/UIFramework.hxx - UI/LegacyFramework/UIFramework.cpp - UI/LegacyFramework/UIFrameworkAPI.h - UI/LegacyFramework/UIFrameworkAPI.cpp - UI/LegacyFramework/UIFrameworkPreferences.cpp - UI/LegacyFramework/Resources/sharedResources.qrc - UI/LegacyFramework/Core/EditorContextBus.h - UI/LegacyFramework/Core/EditorFrameworkAPI.h - UI/LegacyFramework/Core/EditorFrameworkAPI.cpp - UI/LegacyFramework/Core/EditorFrameworkApplication.h - UI/LegacyFramework/Core/EditorFrameworkApplication.cpp - UI/LegacyFramework/Core/IPCComponent.h - UI/LegacyFramework/Core/IPCComponent.cpp - UI/LegacyFramework/CustomMenus/CustomMenusAPI.h - UI/LegacyFramework/CustomMenus/CustomMenusComponent.cpp - UI/UICore/OverwritePromptDialog.hxx - UI/UICore/OverwritePromptDialog.cpp - UI/UICore/OverwritePromptDialog.ui - UI/UICore/SaveChangesDialog.hxx - UI/UICore/SaveChangesDialog.cpp - UI/UICore/SaveChangesDialog.ui - ToolsFileUtils/ToolsFileUtils_win.cpp -) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_windows_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_windows_files.cmake index 5f3ff425fa..67b93a5100 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_windows_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_windows_files.cmake @@ -12,7 +12,6 @@ set(FILES UI/LegacyFramework/UIFramework.hxx UI/LegacyFramework/UIFramework.cpp UI/LegacyFramework/UIFrameworkAPI.h - UI/LegacyFramework/UIFrameworkAPI.cpp UI/LegacyFramework/UIFrameworkPreferences.cpp UI/LegacyFramework/Resources/sharedResources.qrc UI/LegacyFramework/Core/EditorContextBus.h From 234ff3dca26b20fc7d297cdc45aa51240ebc0447 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 14:06:37 -0800 Subject: [PATCH 218/620] Removes DHQSlider from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UI/PropertyEditor/DHQSlider.cpp | 56 ------------------- .../UI/PropertyEditor/DHQSlider.hxx | 42 -------------- .../PropertyDoubleSliderCtrl.cpp | 1 - .../PropertyEditor/PropertyIntSliderCtrl.cpp | 1 - .../aztoolsframework_files.cmake | 2 - 5 files changed, 102 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.hxx diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.cpp deleted file mode 100644 index 76cc168a69..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.cpp +++ /dev/null @@ -1,56 +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 - * - */ -#include "DHQSlider.hxx" -#include "PropertyQTConstants.h" -#include -AZ_PUSH_DISABLE_WARNING(4244 4251, "-Wunknown-warning-option") // 4244: conversion from 'int' to 'float', possible loss of data - // 4251: 'QInputEvent::modState': class 'QFlags' needs to have dll-interface to be used by clients of class 'QInputEvent' -#include -AZ_POP_DISABLE_WARNING - -namespace AzToolsFramework -{ - void DHQSlider::wheelEvent(QWheelEvent* e) - { - if (hasFocus()) - { - QSlider::wheelEvent(e); - } - else - { - e->ignore(); - } - } - - void InitializeSliderPropertyWidgets(QSlider* slider, QAbstractSpinBox* spinbox) - { - if (slider == nullptr || spinbox == nullptr) - { - return; - } - - // A 2:1 ratio between spinbox and slider gives the slider more room, - // but leaves some space for the spin box to expand. - const int spinBoxStretch = 1; - const int sliderStretch = 2; - - QSizePolicy sizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(spinBoxStretch); - spinbox->setSizePolicy(sizePolicy); - spinbox->setMinimumWidth(PropertyQTConstant_MinimumWidth); - spinbox->setFixedHeight(PropertyQTConstant_DefaultHeight); - spinbox->setFocusPolicy(Qt::StrongFocus); - - sizePolicy.setHorizontalStretch(sliderStretch); - slider->setSizePolicy(sizePolicy); - slider->setMinimumWidth(PropertyQTConstant_MinimumWidth); - slider->setFixedHeight(PropertyQTConstant_DefaultHeight); - slider->setFocusPolicy(Qt::StrongFocus); - slider->setFocusProxy(spinbox); - } -} diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.hxx deleted file mode 100644 index 01aeed0300..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.hxx +++ /dev/null @@ -1,42 +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 - * - */ - -#ifndef AZ_Q_SLIDER_HXX -#define AZ_Q_SLIDER_HXX - -#include -#include -#include - - -#pragma once - -class QAbstractSpinBox; - -namespace AzToolsFramework -{ - class DHQSlider - : public QSlider - { - public: - AZ_CLASS_ALLOCATOR(DHQSlider, AZ::SystemAllocator, 0); - - explicit DHQSlider(QWidget* parent = 0) - : QSlider(parent) {} - - DHQSlider(Qt::Orientation orientation, QWidget* parent = 0) - : QSlider(orientation, parent) {} - - void wheelEvent(QWheelEvent* e); - }; - - // Share widget initialization code between double and int based slider properties. - void InitializeSliderPropertyWidgets(QSlider*, QAbstractSpinBox*); -} - -#endif diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyDoubleSliderCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyDoubleSliderCtrl.cpp index 64ba3b604b..cac6b6867b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyDoubleSliderCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyDoubleSliderCtrl.cpp @@ -7,7 +7,6 @@ */ #include #include "PropertyDoubleSliderCtrl.hxx" -#include "DHQSlider.hxx" #include "PropertyQTConstants.h" AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags' needs to have dll-interface to be used by clients of class 'QLayoutItem' #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntSliderCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntSliderCtrl.cpp index 5fa767d060..7d544cd4f0 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntSliderCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntSliderCtrl.cpp @@ -6,7 +6,6 @@ * */ #include "PropertyIntSliderCtrl.hxx" -#include "DHQSlider.hxx" #include "PropertyQTConstants.h" #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index b28a62a27f..460c47aa81 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -368,8 +368,6 @@ set(FILES UI/PropertyEditor/QtWidgetLimits.h UI/PropertyEditor/DHQComboBox.hxx UI/PropertyEditor/DHQComboBox.cpp - UI/PropertyEditor/DHQSlider.hxx - UI/PropertyEditor/DHQSlider.cpp UI/PropertyEditor/EntityIdQLabel.hxx UI/PropertyEditor/EntityIdQLabel.cpp UI/PropertyEditor/EntityIdQLineEdit.h From 6b457567c7c691009cd90bb376698df1a3a6ced9 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 14:23:17 -0800 Subject: [PATCH 219/620] Removes PropertyEditor_UITypes.h from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../PropertyEditor/PropertyEditor_UITypes.h | 346 ------------------ .../aztoolsframework_files.cmake | 1 - 2 files changed, 347 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditor_UITypes.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditor_UITypes.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditor_UITypes.h deleted file mode 100644 index 2d6d4239ef..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditor_UITypes.h +++ /dev/null @@ -1,346 +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 - * - */ -#ifndef PROPERTYEDITOR_UITYPES_H -#define PROPERTYEDITOR_UITYPES_H - -#include -#include -#include "PropertyEditor/EditorClassReflectionTest.h" - -#pragma once - -namespace AzToolsFramework -{ - namespace PropertySystem - { - typedef AZStd::function < void(const AZStd::string& FieldName, AZStd::vector& dEnumNames) > - EnumNamesCallback; - - class EditorUIInfo_Enum - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Enum, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Enum, AZ::SystemAllocator, 0); - - EnumNamesCallback m_enumNamesCallBack; - - EditorUIInfo_Enum(EnumNamesCallback enumNamesCallBack, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_enumNamesCallBack(enumNamesCallBack) - { - } - }; - - class EditorUIInfo_EnumComboBox - : public EditorUIInfo_Enum - { - public: - AZ_RTTI(EditorUIInfo_EnumComboBox, EditorUIInfo_Enum); - AZ_CLASS_ALLOCATOR(EditorUIInfo_EnumComboBox, AZ::SystemAllocator, 0); - - EditorUIInfo_EnumComboBox(EnumNamesCallback enumNamesCallBack, AZ::u32 inFlags = 0) - : EditorUIInfo_Enum(enumNamesCallBack, inFlags) - { - } - }; - - typedef AZStd::function < void(const AZStd::string& FieldName, AZStd::vector& dEnumNames) > - ChoiceNamesCallback; - - class EditorUIInfo_Choice - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Choice, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Choice, AZ::SystemAllocator, 0); - - ChoiceNamesCallback m_choiceNamesCallBack; - - EditorUIInfo_Choice(ChoiceNamesCallback choiceNamesCallBack, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_choiceNamesCallBack(choiceNamesCallBack) - { - } - }; - - class EditorUIInfo_ChoiceComboBox - : public EditorUIInfo_Choice - { - public: - AZ_RTTI(EditorUIInfo_ChoiceComboBox, EditorUIInfo_Choice); - AZ_CLASS_ALLOCATOR(EditorUIInfo_ChoiceComboBox, AZ::SystemAllocator, 0); - - EditorUIInfo_ChoiceComboBox(ChoiceNamesCallback choiceNamesCallBack, AZ::u32 inFlags = 0) - : EditorUIInfo_Choice(choiceNamesCallBack, inFlags) - { - } - }; - - class EditorUIInfo_Bool - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Bool, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Bool, AZ::SystemAllocator, 0); - - EditorUIInfo_Bool(AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - { - } - }; - - class EditorUIInfo_BoolComboBox - : public EditorUIInfo_Bool - { - public: - AZ_RTTI(EditorUIInfo_BoolComboBox, EditorUIInfo_Bool); - AZ_CLASS_ALLOCATOR(EditorUIInfo_BoolComboBox, AZ::SystemAllocator, 0); - - EditorUIInfo_BoolComboBox(AZ::u32 inFlags = 0) - : EditorUIInfo_Bool(inFlags) - { - } - }; - - class EditorUIInfo_BoolDialogBox - : public EditorUIInfo_Bool - { - public: - AZ_RTTI(EditorUIInfo_BoolDialogBox, EditorUIInfo_Bool); - AZ_CLASS_ALLOCATOR(EditorUIInfo_BoolDialogBox, AZ::SystemAllocator, 0); - - EditorUIInfo_BoolDialogBox(AZ::u32 inFlags = 0) - : EditorUIInfo_Bool(inFlags) - { - } - }; - - - class EditorUIInfo_Int - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Int, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Int, AZ::SystemAllocator, 0); - - int m_minVal; - int m_maxVal; - - EditorUIInfo_Int(int minVal = INT_MIN, int maxVal = INT_MAX, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_minVal(minVal) - , m_maxVal(maxVal) - { - } - }; - - class EditorUIInfo_IntSpinBox - : public EditorUIInfo_Int - { - public: - AZ_RTTI(EditorUIInfo_IntSpinBox, EditorUIInfo_Int); - AZ_CLASS_ALLOCATOR(EditorUIInfo_IntSpinBox, AZ::SystemAllocator, 0); - - EditorUIInfo_IntSpinBox(int minVal = INT_MIN, int maxVal = INT_MAX, AZ::u32 inFlags = 0) - : EditorUIInfo_Int(minVal, maxVal, inFlags) - { - } - }; - - class EditorUIInfo_IntSlider - : public EditorUIInfo_Int - { - public: - AZ_RTTI(EditorUIInfo_IntSlider, EditorUIInfo_Int); - AZ_CLASS_ALLOCATOR(EditorUIInfo_IntSlider, AZ::SystemAllocator, 0); - - int m_step; - - EditorUIInfo_IntSlider(int step = 1, int minVal = INT_MIN, int maxVal = INT_MAX, AZ::u32 inFlags = 0) - : EditorUIInfo_Int(minVal, maxVal, inFlags) - , m_step(step) - { - } - }; - - class EditorUIInfo_Float - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Float, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Float, AZ::SystemAllocator, 0); - - float m_minVal; - float m_maxVal; - - EditorUIInfo_Float(float minVal = std::numeric_limits::min(), float maxVal = std::numeric_limits::max(), AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_minVal(minVal) - , m_maxVal(maxVal) - { - } - }; - - class EditorUIInfo_FloatSpinBox - : public EditorUIInfo_Float - { - public: - AZ_RTTI(EditorUIInfo_FloatSpinBox, EditorUIInfo_Float); - AZ_CLASS_ALLOCATOR(EditorUIInfo_FloatSpinBox, AZ::SystemAllocator, 0); - - EditorUIInfo_FloatSpinBox(float minVal = std::numeric_limits::min(), float maxVal = std::numeric_limits::max(), AZ::u32 inFlags = 0) - : EditorUIInfo_Float(minVal, maxVal, inFlags) - { - } - }; - - class EditorUIInfo_FloatSlider - : public EditorUIInfo_Float - { - public: - AZ_RTTI(EditorUIInfo_FloatSlider, EditorUIInfo_Float); - AZ_CLASS_ALLOCATOR(EditorUIInfo_FloatSlider, AZ::SystemAllocator, 0); - - float m_step; - - EditorUIInfo_FloatSlider(float step = 1.f, float minVal = std::numeric_limits::min(), float maxVal = std::numeric_limits::max(), AZ::u32 inFlags = 0) - : EditorUIInfo_Float(minVal, maxVal, inFlags) - , m_step(step) - { - } - }; - - class EditorUIInfo_Double - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Double, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Double, AZ::SystemAllocator, 0); - - double m_minVal; - double m_maxVal; - - EditorUIInfo_Double(double minVal = DBL_MIN, double maxVal = DBL_MAX, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_minVal(minVal) - , m_maxVal(maxVal) - { - } - }; - - class EditorUIInfo_DoubleSpinBox - : public EditorUIInfo_Double - { - public: - AZ_RTTI(EditorUIInfo_DoubleSpinBox, EditorUIInfo_Double); - AZ_CLASS_ALLOCATOR(EditorUIInfo_DoubleSpinBox, AZ::SystemAllocator, 0); - - EditorUIInfo_DoubleSpinBox(double minVal = DBL_MIN, double maxVal = DBL_MAX, AZ::u32 inFlags = 0) - : EditorUIInfo_Double(minVal, maxVal, inFlags) - { - } - }; - - class EditorUIInfo_DoubleSlider - : public EditorUIInfo_Double - { - public: - AZ_RTTI(EditorUIInfo_DoubleSlider, EditorUIInfo_Double); - AZ_CLASS_ALLOCATOR(EditorUIInfo_DoubleSlider, AZ::SystemAllocator, 0); - - double m_step; - - EditorUIInfo_DoubleSlider(double step = 1.0, double minVal = DBL_MIN, double maxVal = DBL_MAX, AZ::u32 inFlags = 0) - : EditorUIInfo_Double(minVal, maxVal, inFlags) - , m_step(step) - { - } - }; - - class EditorUIInfo_String - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_String, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_String, AZ::SystemAllocator, 0); - - int m_maxChars; - - EditorUIInfo_String(int maxchars = -1, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_maxChars(maxchars) - { - } - }; - - class EditorUIInfo_StringLineEdit - : public EditorUIInfo_String - { - public: - AZ_RTTI(EditorUIInfo_StringLineEdit, EditorUIInfo_String); - AZ_CLASS_ALLOCATOR(EditorUIInfo_StringLineEdit, AZ::SystemAllocator, 0); - - EditorUIInfo_StringLineEdit(int maxchars = -1, AZ::u32 inFlags = 0) - : EditorUIInfo_String(maxchars, inFlags) - { - } - }; - - typedef AZStd::function DropListInfoCallback; - - class EditorUIInfo_DropdownList - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_DropdownList, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_DropdownList, AZ::SystemAllocator, 0); - EditorUIInfo_DropdownList(DropListInfoCallback info, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - { - } - }; - - // this function, if you supply it, will be called by the UI and other system to determine whether or not to show - // your property at all. This allows you to make properties which only show up when certain other properties are set. - typedef AZStd::function < bool(const AZStd::string& /*property name*/, void* /* propertyOwner */, const EditorDataContext::ToolsComponentInfo* /* component info */) > - GroupDisplayBooleanFunction; - - // a group is special in that it has children and uses a function to determine what to write for the group and whether to show the group - class EditorUIInfo_Group - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Group, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Group, AZ::SystemAllocator, 0); - EditorUIInfo_Group(GroupDisplayBooleanFunction displayBoolFn = 0, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_displayBoolFn(displayBoolFn) - { - } - GroupDisplayBooleanFunction m_displayBoolFn; - }; - - class EditorUIInfo_Class - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Class, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Class, AZ::SystemAllocator, 0); - - AZ::Uuid m_classID; - - EditorUIInfo_Class(const AZ::Uuid& classID = AZ::Uuid::CreateNull()) - : m_classID(classID) - { - } - }; - } -} // namespace AzToolsFramework - -#endif diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 460c47aa81..b0226b04af 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -398,7 +398,6 @@ set(FILES UI/PropertyEditor/PropertyDoubleSliderCtrl.cpp UI/PropertyEditor/PropertyDoubleSpinCtrl.hxx UI/PropertyEditor/PropertyDoubleSpinCtrl.cpp - UI/PropertyEditor/PropertyEditor_UITypes.h UI/PropertyEditor/PropertyEditorAPI.h UI/PropertyEditor/PropertyEditorApi.cpp UI/PropertyEditor/PropertyEditorAPI_Internals.h From acfd0d72aab0a89f169f492fbc3fff22dc378ddf Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 14:37:21 -0800 Subject: [PATCH 220/620] =?UTF-8?q?=EF=BB=BFRemoves=20AZAutoSizingScrollAr?= =?UTF-8?q?ea=20from=20AzToolsFramework?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UI/UICore/AZAutoSizingScrollArea.cpp | 55 ------------------- .../UI/UICore/AZAutoSizingScrollArea.hxx | 41 -------------- .../aztoolsframework_files.cmake | 2 - 3 files changed, 98 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.hxx diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.cpp deleted file mode 100644 index c8a3b28173..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.cpp +++ /dev/null @@ -1,55 +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 - * - */ - - -#include "AZAutoSizingScrollArea.hxx" - -#include - -namespace AzToolsFramework -{ - - AZAutoSizingScrollArea::AZAutoSizingScrollArea(QWidget* parent) - : QScrollArea(parent) - { - } - - // this code was copied from the regular implementation of the same function in QScrollArea, but converted - // the private calls to public calls and removed the cache. - QSize AZAutoSizingScrollArea::sizeHint() const - { - int initialSize = 2 * frameWidth(); - QSize sizeHint(initialSize, initialSize); - - if (widget()) - { - sizeHint += this->widgetResizable() ? widget()->sizeHint() : widget()->size(); - } - else - { - // If we don't have a widget, we want to reserve some space visually for ourselves. - int fontHeight = fontMetrics().height(); - sizeHint += QSize(2 * fontHeight, 2 * fontHeight); - } - - if (verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOn) - { - sizeHint.setWidth(sizeHint.width() + verticalScrollBar()->sizeHint().width()); - } - - if (horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOn) - { - sizeHint.setHeight(sizeHint.height() + horizontalScrollBar()->sizeHint().height()); - } - - return sizeHint; - } - -} - -#include "UI/UICore/moc_AZAutoSizingScrollArea.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.hxx deleted file mode 100644 index e5e5ef59ac..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.hxx +++ /dev/null @@ -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 - * - */ - -#ifndef AZAUTOSIZINGSCROLLAREA_HXX -#define AZAUTOSIZINGSCROLLAREA_HXX - -#if !defined(Q_MOC_RUN) -#include -#include - -#pragma once - -#include -#endif - -namespace AzToolsFramework -{ - // This fixes a bug in QScrollArea which makes it so that you can dynamically add and remove elements from inside it, and the scroll - // area will take up as much room as it needs to, to prevent the need for scroll bars. Scroll bars will still appear if there is not enough - // room, but the view will scale up to eat all available room before that happens. - - // QScrollArea was supposed to do this, but it appears to cache the size of its embedded widget on startup, and never clears that cache. - class AZAutoSizingScrollArea - : public QScrollArea - { - Q_OBJECT - public: - AZ_CLASS_ALLOCATOR(AZAutoSizingScrollArea, AZ::SystemAllocator, 0); - - explicit AZAutoSizingScrollArea(QWidget* parent = 0); - - QSize sizeHint() const; - }; -} - -#endif diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index b0226b04af..24963d24c0 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -444,8 +444,6 @@ set(FILES UI/Slice/SliceRelationshipWidget.hxx UI/UICore/AspectRatioAwarePixmapWidget.hxx UI/UICore/AspectRatioAwarePixmapWidget.cpp - UI/UICore/AZAutoSizingScrollArea.hxx - UI/UICore/AZAutoSizingScrollArea.cpp UI/UICore/ColorPickerDelegate.hxx UI/UICore/ColorPickerDelegate.cpp UI/UICore/ClickableLabel.hxx From 87c5c76ae8feef148d8601b8688b8d2e6d6e960d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 14:46:25 -0800 Subject: [PATCH 221/620] Removes ColorPickerDelegate from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UI/PropertyEditor/PropertyColorCtrl.cpp | 2 - .../UI/UICore/ColorPickerDelegate.cpp | 75 ------------------- .../UI/UICore/ColorPickerDelegate.hxx | 41 ---------- .../aztoolsframework_files.cmake | 2 - 4 files changed, 120 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.hxx diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp index 13c5c8bfac..3562c8ff11 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp @@ -19,8 +19,6 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") AZ_POP_DISABLE_WARNING #include -#include "../UICore/ColorPickerDelegate.hxx" - namespace AzToolsFramework { PropertyColorCtrl::PropertyColorCtrl(QWidget* pParent) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.cpp deleted file mode 100644 index ca5e89f6f1..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.cpp +++ /dev/null @@ -1,75 +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 - * - */ -#include -#include "ColorPickerDelegate.hxx" - -#include -#include - -namespace AzToolsFramework -{ - ColorPickerDelegate::ColorPickerDelegate(QObject* pParent) - : QStyledItemDelegate(pParent) - { - } - - QWidget* ColorPickerDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const - { - (void)index; - (void)option; - AzQtComponents::ColorPicker* ptrDialog = new AzQtComponents::ColorPicker(AzQtComponents::ColorPicker::Configuration::RGB, - tr("Select Color"), parent); - ptrDialog->setWindowFlags(Qt::Tool); - return ptrDialog; - } - - void ColorPickerDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const - { - AzQtComponents::ColorPicker* colorEditor = qobject_cast(editor); - - if (!editor) - { - return; - } - - QVariant colorResult = index.data(COLOR_PICKER_ROLE); - if (colorResult == QVariant()) - { - return; - } - - const QColor pickedColor = qvariant_cast(colorResult); - colorEditor->setCurrentColor(AzQtComponents::fromQColor(pickedColor)); - } - - void ColorPickerDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const - { - AzQtComponents::ColorPicker* colorEditor = qobject_cast(editor); - - if (!editor) - { - return; - } - - const QVariant colorVariant = AzQtComponents::toQColor(colorEditor->currentColor()); - model->setData(index, colorVariant, COLOR_PICKER_ROLE); - } - - void ColorPickerDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const - { - (void)index; - QRect pickerpos = option.rect; - - pickerpos.setTopLeft(editor->parentWidget()->mapToGlobal(pickerpos.topLeft())); - pickerpos.adjust(64, 0, 0, 0); - editor->setGeometry(pickerpos); - } - -} // namespace AzToolsFramework - -#include "UI/UICore/moc_ColorPickerDelegate.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.hxx deleted file mode 100644 index 7bb5cd25e2..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.hxx +++ /dev/null @@ -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 - * - */ - -#ifndef COLOR_PICKER_DELEGATE_HXX -#define COLOR_PICKER_DELEGATE_HXX - -#if !defined(Q_MOC_RUN) -#include -#include -#endif - -#pragma once - -namespace AzToolsFramework -{ - /** - * A delegate which handles the double clicking to pop open a color picker dialog, as long as the role is COLOR_PICKER_ROLE. - * To use it, just add a setData() and a data() function to your model which returns a QColor (or accepts one) whenever the COLOR_PICKER_ROLE is queried. - **/ - class ColorPickerDelegate - : public QStyledItemDelegate - { - Q_OBJECT; - public: - static const int COLOR_PICKER_ROLE = Qt::UserRole + 1; - - AZ_CLASS_ALLOCATOR(ColorPickerDelegate, AZ::SystemAllocator, 0); - ColorPickerDelegate(QObject* pParent); - virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; - virtual void setEditorData(QWidget* editor, const QModelIndex& index) const; - virtual void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; - virtual void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const; - }; -} // namespace AzToolsFramework - -#endif //COLOR_PICKER_DELEGATE_HXX diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 24963d24c0..a21885f058 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -444,8 +444,6 @@ set(FILES UI/Slice/SliceRelationshipWidget.hxx UI/UICore/AspectRatioAwarePixmapWidget.hxx UI/UICore/AspectRatioAwarePixmapWidget.cpp - UI/UICore/ColorPickerDelegate.hxx - UI/UICore/ColorPickerDelegate.cpp UI/UICore/ClickableLabel.hxx UI/UICore/ClickableLabel.cpp UI/UICore/IconButton.hxx From ac221223a5e9829342ea9fd7aa92171325a75001 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 14:46:46 -0800 Subject: [PATCH 222/620] Adds missing header from previous commit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp index 3562c8ff11..fd6580225f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp @@ -18,6 +18,7 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") #include AZ_POP_DISABLE_WARNING #include +#include namespace AzToolsFramework { From 7ea2b34e917b95bff8fe44c5cbe9282acee56876 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 16:29:46 -0800 Subject: [PATCH 223/620] Removes Cripter.h from GridMate Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GridMate/GridMate/Carrier/Carrier.cpp | 1 - .../GridMate/GridMate/Carrier/Cripter.h | 25 ------------------- .../GridMate/GridMate/gridmate_files.cmake | 1 - 3 files changed, 27 deletions(-) delete mode 100644 Code/Framework/GridMate/GridMate/Carrier/Cripter.h diff --git a/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp b/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp index 2724bee1a7..a4f6f286a8 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp +++ b/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp @@ -12,7 +12,6 @@ #include #include -#include #include #include #include diff --git a/Code/Framework/GridMate/GridMate/Carrier/Cripter.h b/Code/Framework/GridMate/GridMate/Carrier/Cripter.h deleted file mode 100644 index 07fae7f026..0000000000 --- a/Code/Framework/GridMate/GridMate/Carrier/Cripter.h +++ /dev/null @@ -1,25 +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 - * - */ -#ifndef GM_CRIPTER_INTERFACE_H -#define GM_CRIPTER_INTERFACE_H - -#include - -namespace GridMate -{ - /** - * Traffic control interface - */ - class Cripter - { - public: - }; -} - -#endif // GM_CRIPTER_INTERFACE_H - diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index 7fac75a442..5fb565b5ae 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -19,7 +19,6 @@ set(FILES Carrier/Carrier.cpp Carrier/Carrier.h Carrier/Compressor.h - Carrier/Cripter.h Carrier/DefaultHandshake.cpp Carrier/DefaultHandshake.h Carrier/DefaultSimulator.cpp From a55773f9c37f7320b2e973dee564ad9b4f914746 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 18:39:26 -0800 Subject: [PATCH 224/620] Removes some unused files from gridmate (Containers/set and slist) also Doc.h Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GridMate/GridMate/Containers/set.h | 23 -------------- .../GridMate/GridMate/Containers/slist.h | 20 ------------ Code/Framework/GridMate/GridMate/Docs.h | 31 ------------------- .../GridMate/GridMate/gridmate_files.cmake | 2 -- 4 files changed, 76 deletions(-) delete mode 100644 Code/Framework/GridMate/GridMate/Containers/set.h delete mode 100644 Code/Framework/GridMate/GridMate/Containers/slist.h delete mode 100644 Code/Framework/GridMate/GridMate/Docs.h diff --git a/Code/Framework/GridMate/GridMate/Containers/set.h b/Code/Framework/GridMate/GridMate/Containers/set.h deleted file mode 100644 index d7edec8a46..0000000000 --- a/Code/Framework/GridMate/GridMate/Containers/set.h +++ /dev/null @@ -1,23 +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 - * - */ -#ifndef GM_CONTAINERS_SET_H -#define GM_CONTAINERS_SET_H - -#include -#include - -namespace GridMate -{ - template, class Allocator = SysContAlloc> - using set = AZStd::set; - - template, class Allocator = SysContAlloc> - using multiset = AZStd::multiset; -} - -#endif // GM_CONTAINERS_SET_H diff --git a/Code/Framework/GridMate/GridMate/Containers/slist.h b/Code/Framework/GridMate/GridMate/Containers/slist.h deleted file mode 100644 index 6e4d77b604..0000000000 --- a/Code/Framework/GridMate/GridMate/Containers/slist.h +++ /dev/null @@ -1,20 +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 - * - */ -#ifndef GM_CONTAINERS_SLIST_H -#define GM_CONTAINERS_SLIST_H - -#include -#include - -namespace GridMate -{ - template - using forward_list = AZStd::forward_list; -} - -#endif // GM_CONTAINERS_SLIST_H diff --git a/Code/Framework/GridMate/GridMate/Docs.h b/Code/Framework/GridMate/GridMate/Docs.h deleted file mode 100644 index c3a8c00776..0000000000 --- a/Code/Framework/GridMate/GridMate/Docs.h +++ /dev/null @@ -1,31 +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 - * - */ -/** - * \mainpage - * Welcome to the GridMate network library. - * - * Check the latest \ref ReleaseNotes "release notes" for this version of GridMate. - * - * You can start learning by looking at the \ref Library "Library overview". - * - * Or if you can't wait, jump to the \ref GMExamples "code examples" to see how GridMate is used. - */ - -/** - * \page Library Library Overview - * - * \subpage Fundamentals "Fundamental Concepts" - * - * \ref GMExamples "Code examples" - * - */ - -/** - * \namespace GridMate - * \brief The main namespace for the GridMate library. - */ diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index 5fb565b5ae..f9ecfc1cf8 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -37,8 +37,6 @@ set(FILES Carrier/Utils.h Containers/list.h Containers/queue.h - Containers/set.h - Containers/slist.h Containers/unordered_map.h Containers/unordered_set.h Containers/vector.h From dda3dec7356b6f4e6975f000d4e360813b04d4c5 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 18:39:58 -0800 Subject: [PATCH 225/620] missed this file Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/GridMate/GridMate/gridmate_files.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index f9ecfc1cf8..e38a238baf 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -8,7 +8,6 @@ set(FILES EBus.h - Docs.h GridMate.cpp GridMate.h GridMateEventsBus.h From ce4ebc57c9daa85a84351aa3501573ddb34f75ce Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 3 Dec 2021 18:35:12 -0800 Subject: [PATCH 226/620] Removes OnlineUtilityThread.h and UserServiceTypes.h from GridMate Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GridMate/Online/OnlineUtilityThread.h | 93 -------------- .../GridMate/Online/UserServiceTypes.h | 114 ------------------ .../GridMate/GridMate/gridmate_files.cmake | 2 - 3 files changed, 209 deletions(-) delete mode 100644 Code/Framework/GridMate/GridMate/Online/OnlineUtilityThread.h delete mode 100644 Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h diff --git a/Code/Framework/GridMate/GridMate/Online/OnlineUtilityThread.h b/Code/Framework/GridMate/GridMate/Online/OnlineUtilityThread.h deleted file mode 100644 index fd6ce8edb4..0000000000 --- a/Code/Framework/GridMate/GridMate/Online/OnlineUtilityThread.h +++ /dev/null @@ -1,93 +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 - * - */ -/** - * @file - * Provides EBus definitions for getting the utility thread tick - */ -#ifndef ONLINE_UTILITY_THREAD_H -#define ONLINE_UTILITY_THREAD_H - -#include -#include - -/** - * IMPORTANT NOTE TO SERVICES THAT USE THE UTILITY THREAD: - * The online service will start ticking the utility thread at construction - * time, but you have have to let it know when you need to be ticked. This - * is done two ways: first, send the NotifyOfNewWork event to the - * OnlineUtilityThreadCommandBus; second, return whether you still have - * work to do in OnlineUtilityThreadNotificationBus's event - * IsThereUtilityThreadWork. There, however, caveats the service - * must be aware of. - * - For those that derive from OnlineUtilityNotificationBus::Handler, - * do your BusConnect and BusDisConnect calls in your Init and Shutdown - * calls, instead of at construction and destruction time. You shouldn't - * be trying to use this utility thread outside of the time between these - * calls to your service anyway, so this shouldn't cause any amount of - * headache to conform to. - * - When you call BusConnect and BusDiscconect, the online manager may - * already be ticking that event - you may or may not receive your first - * and/or last tick events the way you might expect, so be careful about - * how you do you initialization and shutdown procedures. - * - Your Init call should do as little work as possible. Set yourself up for - * being ready to do actual initialization the first time you receive the - * OnUtilityThreadTick event instead of doing it all in Init and blocking - * the main thread. - * - Your Shutdown call should abort any pending operations, including ones - * it's already in the middle of. - * - In your OnUtilityThreadTick event response, make sure you haven't already - * been told to shut down. This is because the Shutdown call may have been - * made soon after the OnUtilityThreadTick event was fired, and other - * services took up a fair amount of time before the event got to you (with - * the Shutdown call to your service being made between event-firing and - * when the event reached you). - * - Be VERY careful about Shutdown getting called before you finish - * initializing in the utility thread (or even get a change to)! If you - * use this utility thread, be sure to test whether you can shutdown - * immediately after being initialized without breaking anything. - */ -namespace GridMate -{ - //------------------------------------------------------------------------- - // For ticking services that need a separate thread (outbound) - // - BusConnect to OnlineUtilityThreadNotificationBus::Handler to receive OnUtilityThreadTick - // - Return whether you have work left to do in IsThereWork - //------------------------------------------------------------------------- - class OnlineUtilityThreadNotifications - : public GridMateEBusTraits - { - public: - virtual ~OnlineUtilityThreadNotifications() {} - - // Called on each iteration of the online manager's utility thread loop - virtual void OnUtilityThreadTick() = 0; - - // Return whether there's work left to do here to keep the thread from doing busy waiting - virtual bool IsThereUtilityThreadWork() = 0; - }; - typedef AZ::EBus OnlineUtilityThreadNotificationBus; - //------------------------------------------------------------------------- - - //------------------------------------------------------------------------- - // For services that need a separate thread (inbound) - // - Fire the NotifyOfNewWork event to notify the thread that you have a new - // request you'd like to take care of - //------------------------------------------------------------------------- - class OnlineUtilityThreadCommands - : public GridMateEBusTraits - { - public: - virtual ~OnlineUtilityThreadCommands() {} - - virtual void NotifyOfNewWork() = 0; - }; - typedef AZ::EBus OnlineUtilityThreadCommandBus; - //------------------------------------------------------------------------- -} // namespace GridMate - -#endif // ONLINE_UTILITY_THREAD_H diff --git a/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h b/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h deleted file mode 100644 index c1753b3bb2..0000000000 --- a/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h +++ /dev/null @@ -1,114 +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 - * - */ -#ifndef GM_USER_SERVICE_TYPES_H -#define GM_USER_SERVICE_TYPES_H - -#include - -namespace GridMate -{ - /** - * User signin state - */ - enum OLSSigninState - { - OLS_SigninUnknown, - OLS_NotSignedIn, // There is no user signed in - OLS_SignedInOffline, // User signed in without online capabilities - OLS_SignedInOnline, // User signed in with online capabilities - OLS_SigningOut, // User is in the process of signing out - }; - - /** - * service network state - */ - enum OLSOnlineState - { - OLS_OnlineUnknown, - OLS_NoNetwork, // No NIC or network is unplugged - OLS_Offline, // No online access - OLS_Online, // Has online access - }; - - /** - * Supported privilege types - */ - enum OLSUserPrivilege - { - OLS_UserPrivilegeMP, - OLS_UserPrivilegeRecordDVR, - OLS_UserPrivilegePurchaseContent, - OLS_UserPrivilegeVoiceChat, - OLS_UserPrivilegeLeaderboards - }; - - /** - * Base class for platform dependent player id. - */ - struct PlayerId - { - PlayerId(ServiceType serviceType) - : m_serviceType(serviceType) {} - virtual ~PlayerId() {} - - // Compare 2 PlayerId IDs - virtual bool Compare(const PlayerId& userId) const = 0; - - // Returns a printable string representation of the id. - virtual gridmate_string ToString() const = 0; - - ServiceType GetType() const { return m_serviceType; } - - protected: - ServiceType m_serviceType; - }; - - /** - * Interface class for a local player/member. - */ - class ILocalMember - { - public: - virtual ~ILocalMember() {} - // SignIn - virtual OLSSigninState GetSigninState() const = 0; - - virtual const PlayerId* GetPlayerId() const = 0; - - // Pad number / info ??? - virtual unsigned int GetControllerIndex() const = 0; - virtual const char* GetName() const = 0; - virtual bool IsGuest() const = 0; - - // Friends List - virtual void RefreshFriends() = 0; - virtual bool IsFriendsListRefreshing() const = 0; - virtual unsigned int GetFriendsCount() const = 0; - virtual const char* GetFriendName(unsigned int idx) const = 0; - virtual const PlayerId* GetFriendPlayerId(unsigned int idx) const = 0; - virtual OLSSigninState GetFriendSigninState(unsigned int idx) const = 0; - virtual bool IsFriendPlayingTitle(unsigned int idx) const = 0; - virtual const char* GetFriendPresenceDetails(unsigned int idx) const = 0; - virtual bool IsFriendsWith(const PlayerId* playerId) const = 0; - }; - - /** - * Generic invite structure - * pPlatformSpecific contains the native structure used by each platform - */ - struct InviteInfo - { - InviteInfo() - : m_localMember(nullptr) {} - - ILocalMember* m_localMember; - }; -} // namespace GridMate - -#endif // GM_USER_SERVICE_TYPES_H -#pragma once diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index e38a238baf..758b217112 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -39,8 +39,6 @@ set(FILES Containers/unordered_map.h Containers/unordered_set.h Containers/vector.h - Online/OnlineUtilityThread.h - Online/UserServiceTypes.h Replica/BasicHostChunkDescriptor.h Replica/DeltaCompressedDataSet.h Replica/DataSet.cpp From 10ecb525fe5d8e92c0600067b64db7e74e510e02 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 13 Dec 2021 14:12:02 -0800 Subject: [PATCH 227/620] Removes DeltaCompressedDataSet, ReplicaFunctions.inl and BitmaskInterestHandler from GridMate Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GridMate/Replica/DeltaCompressedDataSet.h | 257 ----------- .../Interest/BitmaskInterestHandler.cpp | 421 ------------------ .../Replica/Interest/BitmaskInterestHandler.h | 237 ---------- .../GridMate/Replica/ReplicaFunctions.inl | 98 ---- .../GridMate/GridMate/gridmate_files.cmake | 4 - 5 files changed, 1017 deletions(-) delete mode 100644 Code/Framework/GridMate/GridMate/Replica/DeltaCompressedDataSet.h delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.cpp delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.h delete mode 100644 Code/Framework/GridMate/GridMate/Replica/ReplicaFunctions.inl diff --git a/Code/Framework/GridMate/GridMate/Replica/DeltaCompressedDataSet.h b/Code/Framework/GridMate/GridMate/Replica/DeltaCompressedDataSet.h deleted file mode 100644 index d84a777024..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/DeltaCompressedDataSet.h +++ /dev/null @@ -1,257 +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 - * - */ -#ifndef GM_DELTACOMPRESSED_DATASET_H -#define GM_DELTACOMPRESSED_DATASET_H - -#pragma once - -#include -#include -#include - -namespace GridMate -{ - namespace Helper - { - template - AZ::u8 GetQuantized(float value) - { - /* - * Quantizing into a single byte, thus 255 values. - * [-DeltaRange V +DeltaRange] - * [0 Q 255] - * Given V, solve for Q. - */ - const float quantized = (value + DeltaRange) * 255.f / (2.f * DeltaRange); - const int clamped = AZ::GetClamp(static_cast(quantized), 0, 255); - return static_cast(clamped); - } - - template - float GetUnquantized(AZ::u8 quantized) - { - /* - * Unquantizing from a single byte, out of 255 values. - * [0 Q 255] - * [-DeltaRange V +DeltaRange] - * Given Q, solve for V. - */ - return 2 * DeltaRange * quantized / 255.f - DeltaRange; - } - - template - struct DeltaHelper; - - /** - * \brief Works for integer and floating points numbers - */ - template - struct DeltaHelper - { - static bool IsWithinDelta(const FieldType& base, const FieldType& another, AZ::u32 deltaRange) - { - return abs(base - another) < deltaRange; - } - }; - - /** - * \brief Specialization for AZ::Vector3 - */ - template<> - struct DeltaHelper - { - static bool IsWithinDelta(const AZ::Vector3& base, const AZ::Vector3& another, AZ::u32 deltaRange) - { - const AZ::Vector3 absDiff = (base - another).GetAbs(); - return absDiff.GetX() < deltaRange && absDiff.GetY() < deltaRange && absDiff.GetZ() < deltaRange; - } - }; - } - - /** - * \brief Packing a value into a single byte within +/- @DeltaRange - */ - template - class DeltaMarshaller; - - // float specialization - template - class DeltaMarshaller - { - public: - void Marshal(WriteBuffer& wb, const float &value) - { - wb.Write(Helper::GetQuantized(value)); - } - - void Unmarshal(float& value, ReadBuffer &rb) - { - AZ::u8 delta; - rb.Read(delta); - value = Helper::GetUnquantized(delta); - } - }; - - // AZ::Vector3 specialization - template - class DeltaMarshaller - { - public: - void Marshal(WriteBuffer& wb, const AZ::Vector3& value) - { - wb.Write(Helper::GetQuantized(value.GetX())); - wb.Write(Helper::GetQuantized(value.GetY())); - wb.Write(Helper::GetQuantized(value.GetZ())); - } - - void Unmarshal(AZ::Vector3& value, ReadBuffer& rb) - { - AZ::u8 delta[3]; - rb.Read(delta[0]); - rb.Read(delta[1]); - rb.Read(delta[2]); - - value = AZ::Vector3(Helper::GetUnquantized(delta[0]), Helper::GetUnquantized(delta[1]), Helper::GetUnquantized(delta[2])); - } - }; - - /** - * \brief Delta compressed DataSet, stateless and cacheless. Stateless - because it does not keep per-player state of any kind. - * Cacheless - because it does not keep a history of its values. - * This approach requires only one extra copy of a field, because the field is split into two portions: absolute and relative portions. - * The value is always the sum of two portions. We leverage existing DataSets to omit sending the larger absolute value, thus achieving compression. - * - * \tparam FieldType - * \tparam DeltaRange - * \tparam MarshalerType - * \tparam DeltaMarshalerType - */ - template, typename DeltaMarshalerType = DeltaMarshaller> - class DeltaCompressedDataSet - { - public: - virtual ~DeltaCompressedDataSet() = default; - - template - class BindInterface; - - /** - Constructs a DataSet. - **/ - explicit DeltaCompressedDataSet(const char* debugName, const FieldType& value = FieldType()) - : m_absolutePortion(debugName, value) - , m_relativePortion(debugName) - { - static_assert(DeltaRange > 0, "Delta range cannot be zero!"); - - // We need to intercept changes to our two DataSets, in order to calculate the combined value and report back to Replica Chunk on our time. - m_absolutePortion.SetDispatchOverride([this](const TimeContext& tc) {OnAbsolutePortionChanged(tc); }); - m_relativePortion.SetDispatchOverride([this](const TimeContext& tc) {OnRelativePortionChanged(tc); }); - } - - /** - Modify the DataSet. Call this on the Primary node to change the data, - which will be propagated to all proxies. - **/ - void Set(const FieldType& v) - { - m_combinedValue = v; - - if (Helper::DeltaHelper::IsWithinDelta(m_absolutePortion.Get(), v, DeltaRange)) - { - // within bounds, so only the relative portion needs to be updated - m_relativePortion.Set(v - m_absolutePortion.Get()); - } - else - { - // relative out of range, reset absolute - m_absolutePortion.Set(v); - m_relativePortion.Set(static_cast(0)); - } - } - - /** - Returns the current value of the DataSet. - **/ - const FieldType& Get() const - { - return m_combinedValue; - } - - protected: - virtual void OnAbsolutePortionChanged(const TimeContext& /*tc*/) - { - m_combinedValue = m_absolutePortion.Get() + m_relativePortion.Get(); - } - - virtual void OnRelativePortionChanged(const TimeContext& /*tc*/) - { - m_combinedValue = m_absolutePortion.Get() + m_relativePortion.Get(); - } - - private: - DataSet m_absolutePortion; - DataSet m_relativePortion; - FieldType m_combinedValue; // the latest value on either primary or proxy - }; - - //----------------------------------------------------------------------------- - - /** - Declares a DeltaCompressedDataSet with an event handler that is called when the value is changed. - Use BindInterface to dispatch to a method on the ReplicaChunk's - ReplicaChunkInterface event handler instance. - **/ - template - template - class DeltaCompressedDataSet::BindInterface - : public DeltaCompressedDataSet - { - public: - explicit BindInterface(const char* debugName) : DeltaCompressedDataSet(debugName) { } - - protected: - void OnAbsolutePortionChanged(const GridMate::TimeContext& tc) override - { - DeltaCompressedDataSet::OnAbsolutePortionChanged(tc); - - m_lastUpdateTime = m_absolutePortion.GetLastUpdateTime(); - if (m_relativePortion.GetLastUpdateTime() < m_lastUpdateTime) - { - // relative portion wasn't updated, so its callback won't be invoked this tick, therefore we need to dispatch change event now - DispatchChangedEvent(tc); - } - } - - void OnRelativePortionChanged(const GridMate::TimeContext& tc) override - { - DeltaCompressedDataSet::OnRelativePortionChanged(tc); - - m_lastUpdateTime = m_relativePortion.GetLastUpdateTime(); - // Assuming that relative portion DataSet is dispatched after absolute portion by construction in DeltaCompressedDataSet - DispatchChangedEvent(tc); - } - - void DispatchChangedEvent(const TimeContext& tc) - { - AZ_Assert(m_relativePortion.GetReplicaChunkBase(), "DataSets should be attached to replica chunks!"); - - if (C* c = static_cast(m_relativePortion.GetReplicaChunkBase()->GetHandler())) - { - const TimeContext changeTime{ m_lastUpdateTime, m_lastUpdateTime - (tc.m_realTime - tc.m_localTime) }; - (*c.*FuncPtr)(Get(), changeTime); - } - } - - private: - AZ::u32 m_lastUpdateTime = 0; // the latest update time among m_absolutePortion and m_relativePortion - }; - //----------------------------------------------------------------------------- -} // namespace GridMate - -#endif // GM_DELTACOMPRESSED_DATASET_H diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.cpp b/Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.cpp deleted file mode 100644 index d4748e554d..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.cpp +++ /dev/null @@ -1,421 +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 - * - */ - -#include - -#include -#include -#include -#include - -#include - -namespace GridMate -{ - - void BitmaskInterestChunk::OnReplicaActivate(const ReplicaContext& rc) - { - m_interestHandler = static_cast(rc.m_rm->GetUserContext(AZ_CRC("BitmaskInterestHandler", 0x5bf5d75b))); - AZ_Warning("GridMate", m_interestHandler != nullptr, "No bitmask interest handler in the user context"); - if (m_interestHandler) - { - m_interestHandler->OnNewRulesChunk(this, rc.m_peer); - } - } - - void BitmaskInterestChunk::OnReplicaDeactivate(const ReplicaContext& rc) - { - if (m_interestHandler) - { - // even if rc.m_peer is null, we still need to call OnDeleteRulesChunk so that the interest handler can clear m_rulesReplica - m_interestHandler->OnDeleteRulesChunk(this, rc.m_peer); - } - } - - bool BitmaskInterestChunk::AddRuleFn(RuleNetworkId netId, InterestBitmask bits, const RpcContext& ctx) - { - if (IsProxy()) - { - auto rulePtr = m_interestHandler->CreateRule(ctx.m_sourcePeer); - rulePtr->Set(bits); - m_rules.insert(AZStd::make_pair(netId, rulePtr)); - } - - return true; - } - - bool BitmaskInterestChunk::RemoveRuleFn(RuleNetworkId netId, const RpcContext&) - { - if (IsProxy()) - { - m_rules.erase(netId); - } - - return true; - } - - bool BitmaskInterestChunk::UpdateRuleFn(RuleNetworkId netId, InterestBitmask bits, const RpcContext&) - { - if (IsProxy()) - { - auto it = m_rules.find(netId); - if (it != m_rules.end()) - { - it->second->Set(bits); - } - } - - return true; - } - - bool BitmaskInterestChunk::AddRuleForPeerFn(RuleNetworkId netId, PeerId peerId, InterestBitmask bitmask, const RpcContext&) - { - BitmaskInterestChunk::Ptr peerChunk = m_interestHandler->FindRulesChunkByPeerId(peerId); - if (peerChunk) - { - auto it = peerChunk->m_rules.find(netId); - if (it == peerChunk->m_rules.end()) - { - auto rulePtr = m_interestHandler->CreateRule(peerId); - peerChunk->m_rules.insert(AZStd::make_pair(netId, rulePtr)); - rulePtr->Set(bitmask); - } - } - return false; - } - /////////////////////////////////////////////////////////////////////////// - - - /* - * BitmaskInterest - */ - BitmaskInterest::BitmaskInterest(BitmaskInterestHandler* handler) - : m_handler(handler) - , m_bits(0) - { - AZ_Assert(m_handler, "Invalid interest handler"); - } - /////////////////////////////////////////////////////////////////////////// - - - /* - * BitmaskInterestRule - */ - void BitmaskInterestRule::Set(InterestBitmask newBitmask) - { - m_bits = newBitmask; - m_handler->UpdateRule(this); - } - - void BitmaskInterestRule::Destroy() - { - m_handler->DestroyRule(this); - } - /////////////////////////////////////////////////////////////////////////// - - - /* - * BitmaskInterestAttribute - */ - void BitmaskInterestAttribute::Set(InterestBitmask newBitmask) - { - m_bits = newBitmask; - m_handler->UpdateAttribute(this); - } - - void BitmaskInterestAttribute::Destroy() - { - m_handler->DestroyAttribute(this); - } - /////////////////////////////////////////////////////////////////////////// - - - /* - * BitmaskInterestHandler - */ - BitmaskInterestHandler::BitmaskInterestHandler() - : m_im(nullptr) - , m_rm(nullptr) - , m_lastRuleNetId(0) - , m_rulesReplica(nullptr) - { - } - - BitmaskInterestRule::Ptr BitmaskInterestHandler::CreateRule(PeerId peerId) - { - BitmaskInterestRule* rulePtr = aznew BitmaskInterestRule(this, peerId, GetNewRuleNetId()); - m_rules.insert(rulePtr); - - if (peerId == m_rm->GetLocalPeerId() && m_rulesReplica) - { - m_rulesReplica->AddRuleRpc(rulePtr->GetNetworkId(), rulePtr->Get()); - m_localRules.insert(rulePtr); - } - - return rulePtr; - } - - void BitmaskInterestHandler::FreeRule(BitmaskInterestRule* rule) - { - //TODO: should be pool-allocated - m_rules.erase(rule); - delete rule; - } - - void BitmaskInterestHandler::DestroyRule(BitmaskInterestRule* rule) - { - if (m_rm && rule->GetPeerId() == m_rm->GetLocalPeerId() && m_rulesReplica) - { - m_rulesReplica->RemoveRuleRpc(rule->GetNetworkId()); - } - - rule->m_bits = 0; - m_dirtyRules.insert(rule); - m_localRules.erase(rule); - } - - void BitmaskInterestHandler::UpdateRule(BitmaskInterestRule* rule) - { - if (m_rm && m_rulesReplica && rule->GetPeerId() == m_rm->GetLocalPeerId()) - { - m_rulesReplica->UpdateRuleRpc(rule->GetNetworkId(), rule->Get()); - } - - m_dirtyRules.insert(rule); - } - - BitmaskInterestAttribute::Ptr BitmaskInterestHandler::CreateAttribute(ReplicaId replicaId) - { - auto ptr = aznew BitmaskInterestAttribute(this, replicaId); - m_attrs.insert(ptr); - return ptr; - } - - void BitmaskInterestHandler::FreeAttribute(BitmaskInterestAttribute* attrib) - { - //TODO: should be pool-allocated - m_attrs.erase(attrib); - delete attrib; - } - - void BitmaskInterestHandler::DestroyAttribute(BitmaskInterestAttribute* attrib) - { - attrib->m_bits = 0; - m_dirtyAttributes.insert(attrib); - } - - void BitmaskInterestHandler::UpdateAttribute(BitmaskInterestAttribute* attrib) - { - m_dirtyAttributes.insert(attrib); - } - - void BitmaskInterestHandler::OnNewRulesChunk(BitmaskInterestChunk::Ptr chunk, ReplicaPeer* peer) - { - if (chunk != m_rulesReplica) // non-local - { - m_peerChunks.insert(AZStd::make_pair(peer->GetId(), chunk)); - - for (auto& rule : m_localRules) - { - chunk->AddRuleForPeerRpc(rule->GetNetworkId(), rule->GetPeerId(), rule->Get()); - } - } - } - - void BitmaskInterestHandler::OnDeleteRulesChunk(BitmaskInterestChunk::Ptr chunk, ReplicaPeer* peer) - { - AZ_UNUSED(chunk); - m_rulesReplica = nullptr; - - if (peer) - { - m_peerChunks.erase(peer->GetId()); - } - } - - RuleNetworkId BitmaskInterestHandler::GetNewRuleNetId() - { - ++m_lastRuleNetId; - if (m_rulesReplica) - { - return m_rulesReplica->GetReplicaId() | (static_cast(m_lastRuleNetId) << 32); - } - - return (static_cast(m_lastRuleNetId) << 32); - } - - BitmaskInterestChunk::Ptr BitmaskInterestHandler::FindRulesChunkByPeerId(PeerId peerId) - { - auto it = m_peerChunks.find(peerId); - if (it == m_peerChunks.end()) - { - return nullptr; - } - else - { - return it->second; - } - } - - const InterestMatchResult& BitmaskInterestHandler::GetLastResult() - { - return m_resultCache; - } - - void BitmaskInterestHandler::Update() - { - m_resultCache.clear(); - - for (BitmaskInterestRule* rule : m_dirtyRules) - { - InterestBitmask j = 1; - for (size_t i = 0; i < k_numGroups; ++i, j <<= 1) - { - auto ruleIt = m_ruleGroups[i].find(rule); - bool isMatch = !!(rule->m_bits & j); - if (isMatch && ruleIt == m_ruleGroups[i].end()) - { - m_ruleGroups[i].insert(rule); - - // recalculate all the attributes in this bucket - for (BitmaskInterestAttribute* attr : m_attrGroups[i]) - { - m_dirtyAttributes.insert(attr); - } - } - else if (!isMatch && ruleIt != m_ruleGroups[i].end()) - { - m_ruleGroups[i].erase(ruleIt); - - // recalculate all the attributes in this bucket - for (BitmaskInterestAttribute* attr : m_attrGroups[i]) - { - m_dirtyAttributes.insert(attr); - } - } - } - - if (rule->IsDeleted()) - { - FreeRule(rule); - } - } - - m_dirtyRules.clear(); - - for (BitmaskInterestAttribute* attr : m_dirtyAttributes) - { - InterestBitmask j = 1; - for (size_t i = 0; i < k_numGroups; ++i, j <<= 1) - { - auto attrIt = m_attrGroups[i].find(attr); - bool isMatch = !!(attr->m_bits & j); - if (isMatch && attrIt == m_attrGroups[i].end()) - { - m_attrGroups[i].insert(attr); - } - else if (!isMatch && attrIt != m_attrGroups[i].end()) - { - m_attrGroups[i].erase(attrIt); - } - } - } - - for (BitmaskInterestAttribute* attr : m_dirtyAttributes) - { - auto repIt = m_resultCache.insert(attr->GetReplicaId()); - - InterestBitmask j = 1; - for (size_t i = 0; i < k_numGroups; ++i, j <<= 1) - { - if (!!(attr->m_bits & j)) - { - for (BitmaskInterestRule* rule : m_ruleGroups[i]) - { - repIt.first->second.insert(rule->GetPeerId()); - } - } - } - - if (attr->IsDeleted()) - { - FreeAttribute(attr); - } - } - - m_dirtyAttributes.clear(); - } - - void BitmaskInterestHandler::OnRulesHandlerRegistered(InterestManager* manager) - { - AZ_Assert(m_im == nullptr, "Handler is already registered with manager %p (%p)\n", m_im, manager); - AZ_Assert(m_rulesReplica == nullptr, "Rules replica is already created\n"); - AZ_TracePrintf("GridMate", "Bitmask interest handler is registered\n"); - m_im = manager; - m_rm = m_im->GetReplicaManager(); - m_rm->RegisterUserContext(AZ_CRC("BitmaskInterestHandler", 0x5bf5d75b), this); - - auto replica = Replica::CreateReplica("BitmaskInterestHandlerRules"); - m_rulesReplica = CreateAndAttachReplicaChunk(replica); - m_rm->AddPrimary(replica); - } - - void BitmaskInterestHandler::OnRulesHandlerUnregistered(InterestManager* manager) - { - (void)manager; - - AZ_Assert(m_im == manager, "Handler was not registered with manager %p (%p)\n", manager, m_im); - AZ_TracePrintf("GridMate", "Bitmask interest handler is unregistered\n"); - - if (m_rulesReplica) - { - m_rulesReplica->m_rules.clear(); - m_rulesReplica->m_interestHandler = nullptr; - } - - for (auto& chunk : m_peerChunks) - { - chunk.second->m_rules.clear(); - chunk.second->m_interestHandler = nullptr; - } - - m_rulesReplica = nullptr; - m_im = nullptr; - m_rm->UnregisterUserContext(AZ_CRC("BitmaskInterestHandler", 0x5bf5d75b)); - m_rm = nullptr; - - m_peerChunks.clear(); - m_localRules.clear(); - - for (auto& a : m_attrs) - { - delete a; - } - - for (auto& r : m_rules) - { - delete r; - } - - m_dirtyAttributes.clear(); - m_dirtyRules.clear(); - - for (auto& group : m_attrGroups) - { - group.clear(); - } - - for (auto& group : m_ruleGroups) - { - group.clear(); - } - - m_resultCache.clear(); - } - /////////////////////////////////////////////////////////////////////////// -} diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.h b/Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.h deleted file mode 100644 index 6b91859c95..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.h +++ /dev/null @@ -1,237 +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 - * - */ - -#ifndef GM_REPLICA_BITMASKINTERESTHANDLER_H -#define GM_REPLICA_BITMASKINTERESTHANDLER_H - -#include -#include -#include -#include - -#include -#include -#include - - -namespace GridMate -{ - class BitmaskInterestHandler; - using InterestBitmask = AZ::u32; - - /* - * Base interest - */ - class BitmaskInterest - { - friend class BitmaskInterestHandler; - - public: - InterestBitmask Get() const { return m_bits; } - - protected: - explicit BitmaskInterest(BitmaskInterestHandler* handler); - - BitmaskInterestHandler* m_handler; - InterestBitmask m_bits; - }; - /////////////////////////////////////////////////////////////////////////// - - - /* - * Bitmask rule - */ - class BitmaskInterestRule - : public InterestRule - , public BitmaskInterest - { - friend class BitmaskInterestHandler; - - public: - using Ptr = AZStd::intrusive_ptr; - - GM_CLASS_ALLOCATOR(BitmaskInterestRule); - - void Set(InterestBitmask newBitmask); - - private: - - // Intrusive ptr - template - friend struct AZStd::IntrusivePtrCountPolicy; - unsigned int m_refCount = 0; - AZ_FORCE_INLINE void add_ref() { ++m_refCount; } - AZ_FORCE_INLINE void release() { --m_refCount; if (!m_refCount) Destroy(); } - AZ_FORCE_INLINE bool IsDeleted() const { return m_refCount == 0; } - /////////////////////////////////////////////////////////////////////////// - - BitmaskInterestRule(BitmaskInterestHandler* handler, PeerId peerId, RuleNetworkId netId) - : InterestRule(peerId, netId) - , BitmaskInterest(handler) - {} - - void Destroy(); - }; - /////////////////////////////////////////////////////////////////////////// - - - /* - * Bitmask attribute - */ - class BitmaskInterestAttribute - : public InterestAttribute - , public BitmaskInterest - { - friend class BitmaskInterestHandler; - template friend class InterestPtr; - - public: - using Ptr = AZStd::intrusive_ptr; - - GM_CLASS_ALLOCATOR(BitmaskInterestAttribute); - - void Set(InterestBitmask newBitmask); - - private: - - // Intrusive ptr - template - friend struct AZStd::IntrusivePtrCountPolicy; - unsigned int m_refCount = 0; - AZ_FORCE_INLINE void add_ref() { ++m_refCount; } - AZ_FORCE_INLINE void release() { Destroy(); } - AZ_FORCE_INLINE bool IsDeleted() const { return m_refCount == 0; } - /////////////////////////////////////////////////////////////////////////// - - BitmaskInterestAttribute(BitmaskInterestHandler* handler, ReplicaId repId) - : InterestAttribute(repId) - , BitmaskInterest(handler) - {} - - void Destroy(); - }; - /////////////////////////////////////////////////////////////////////////// - - class BitmaskInterestChunk - : public ReplicaChunk - { - public: - GM_CLASS_ALLOCATOR(BitmaskInterestChunk); - - BitmaskInterestChunk() - : AddRuleRpc("AddRule") - , RemoveRuleRpc("RemoveRule") - , UpdateRuleRpc("UpdateRule") - , AddRuleForPeerRpc("AddRuleForPeerRpc") - , m_interestHandler(nullptr) - {} - - typedef AZStd::intrusive_ptr Ptr; - bool IsReplicaMigratable() override { return false; } - bool IsBroadcast() override { return true; } - static const char* GetChunkName() { return "BitmaskInterestChunk"; } - - void OnReplicaActivate(const ReplicaContext& rc) override; - void OnReplicaDeactivate(const ReplicaContext& rc) override; - - bool AddRuleFn(RuleNetworkId netId, InterestBitmask bits, const RpcContext& ctx); - bool RemoveRuleFn(RuleNetworkId netId, const RpcContext&); - bool UpdateRuleFn(RuleNetworkId netId, InterestBitmask bits, const RpcContext&); - bool AddRuleForPeerFn(RuleNetworkId netId, PeerId peerId, InterestBitmask bitmask, const RpcContext&); - - Rpc, RpcArg>::BindInterface AddRuleRpc; - Rpc>::BindInterface RemoveRuleRpc; - Rpc, RpcArg>::BindInterface UpdateRuleRpc; - - Rpc, RpcArg, RpcArg>::BindInterface AddRuleForPeerRpc; - - unordered_map m_rules; - BitmaskInterestHandler* m_interestHandler; - }; - - /* - * Rules handler - */ - class BitmaskInterestHandler - : public BaseRulesHandler - { - friend class BitmaskInterestRule; - friend class BitmaskInterestAttribute; - friend class BitmaskInterestChunk; - - public: - - GM_CLASS_ALLOCATOR(BitmaskInterestHandler); - - BitmaskInterestHandler(); - - // Creates new bitmask rule and binds it to the peer - BitmaskInterestRule::Ptr CreateRule(PeerId peerId); - - // Creates new bitmask attribute and binds it to the replica - BitmaskInterestAttribute::Ptr CreateAttribute(ReplicaId replicaId); - - // Calculates rules and attributes matches - void Update() override; - - // Returns last recalculated results - const InterestMatchResult& GetLastResult() override; - - InterestManager* GetManager() override { return m_im; } - private: - - // BaseRulesHandler - void OnRulesHandlerRegistered(InterestManager* manager) override; - void OnRulesHandlerUnregistered(InterestManager* manager) override; - - void DestroyRule(BitmaskInterestRule* rule); - void FreeRule(BitmaskInterestRule* rule); - void UpdateRule(BitmaskInterestRule* rule); - - void DestroyAttribute(BitmaskInterestAttribute* attrib); - void FreeAttribute(BitmaskInterestAttribute* attrib); - void UpdateAttribute(BitmaskInterestAttribute* attrib); - - - void OnNewRulesChunk(BitmaskInterestChunk::Ptr chunk, ReplicaPeer* peer); - void OnDeleteRulesChunk(BitmaskInterestChunk::Ptr chunk, ReplicaPeer* peer); - - RuleNetworkId GetNewRuleNetId(); - - BitmaskInterestChunk::Ptr FindRulesChunkByPeerId(PeerId peerId); - - typedef unordered_set AttributeSet; - typedef unordered_set RuleSet; - static const size_t k_numGroups = sizeof(InterestBitmask) * CHAR_BIT; - - InterestManager* m_im; - ReplicaManager* m_rm; - - AZ::u32 m_lastRuleNetId; - - unordered_map m_peerChunks; - - RuleSet m_localRules; - - AttributeSet m_dirtyAttributes; - RuleSet m_dirtyRules; - - AZStd::array m_attrGroups; - AZStd::array m_ruleGroups; - - InterestMatchResult m_resultCache; - - BitmaskInterestChunk* m_rulesReplica; - - AttributeSet m_attrs; - RuleSet m_rules; - }; - /////////////////////////////////////////////////////////////////////////// -} - -#endif diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaFunctions.inl b/Code/Framework/GridMate/GridMate/Replica/ReplicaFunctions.inl deleted file mode 100644 index da54d88ef7..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaFunctions.inl +++ /dev/null @@ -1,98 +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 - * - */ -#if (GM_FUNCTION_NUM_ARGS == 0) - #define GM_FUNCTION_TEMPLATE_PARMS - #define GM_FUNCTION_ARGS - #define GM_FUNCTION_ARGS_CONCAT - #define GM_FUNCTION_FORWARD - #define GM_FUNCTION_FORWARD_CONCAT -#elif (GM_FUNCTION_NUM_ARGS == 1) - #define GM_FUNCTION_TEMPLATE_PARMS , typename T0 - #define GM_FUNCTION_ARGS T0 && t0 - #define GM_FUNCTION_ARGS_CONCAT , GM_FUNCTION_ARGS - #define GM_FUNCTION_FORWARD AZStd::forward(t0) - #define GM_FUNCTION_FORWARD_CONCAT , GM_FUNCTION_FORWARD -#elif (GM_FUNCTION_NUM_ARGS == 2) - #define GM_FUNCTION_TEMPLATE_PARMS , typename T0, typename T1 - #define GM_FUNCTION_ARGS T0 && t0, T1 && t1 - #define GM_FUNCTION_ARGS_CONCAT , GM_FUNCTION_ARGS - #define GM_FUNCTION_FORWARD AZStd::forward(t0), AZStd::forward(t1) - #define GM_FUNCTION_FORWARD_CONCAT , GM_FUNCTION_FORWARD -#elif (GM_FUNCTION_NUM_ARGS == 3) - #define GM_FUNCTION_TEMPLATE_PARMS , typename T0, typename T1, typename T2 - #define GM_FUNCTION_ARGS T0 && t0, T1 && t1, T2 && t2 - #define GM_FUNCTION_ARGS_CONCAT , GM_FUNCTION_ARGS - #define GM_FUNCTION_FORWARD AZStd::forward(t0), AZStd::forward(t1), AZStd::forward(t2) - #define GM_FUNCTION_FORWARD_CONCAT , GM_FUNCTION_FORWARD -#elif (GM_FUNCTION_NUM_ARGS == 4) - #define GM_FUNCTION_TEMPLATE_PARMS , typename T0, typename T1, typename T2, typename T3 - #define GM_FUNCTION_ARGS T0 && t0, T1 && t1, T2 && t2, T3 && t3 - #define GM_FUNCTION_ARGS_CONCAT , GM_FUNCTION_ARGS - #define GM_FUNCTION_FORWARD AZStd::forward(t0), AZStd::forward(t1), AZStd::forward(t2), AZStd::forward(t3) - #define GM_FUNCTION_FORWARD_CONCAT , GM_FUNCTION_FORWARD -#elif (GM_FUNCTION_NUM_ARGS == 5) - #define GM_FUNCTION_TEMPLATE_PARMS , typename T0, typename T1, typename T2, typename T3, typename T4 - #define GM_FUNCTION_ARGS T0 && t0, T1 && t1, T2 && t2, T3 && t3, T4 && t4 - #define GM_FUNCTION_ARGS_CONCAT , GM_FUNCTION_ARGS - #define GM_FUNCTION_FORWARD AZStd::forward(t0), AZStd::forward(t1), AZStd::forward(t2), AZStd::forward(t3), AZStd::forward(t4) - #define GM_FUNCTION_FORWARD_CONCAT , GM_FUNCTION_FORWARD -#else - #error Unsupported argument count -#endif - -/** - Create a ReplicaChunk that isn't attached to a Replica. To attach it to a replica, - call replica->AttachReplicaChunk(chunk). -**/ -template -ChunkType* CreateReplicaChunk(GM_FUNCTION_ARGS) -{ - static_assert(AZStd::is_base_of::value, "Class must inherit from ReplicaChunk"); - - ReplicaChunkDescriptor* descriptor = ReplicaChunkDescriptorTable::Get().FindReplicaChunkDescriptor(ReplicaChunkClassId(ChunkType::GetChunkName())); - AZ_Assert(descriptor, "Cannot find replica chunk descriptor for %s. Did you remember to register the chunk type?", ChunkType::GetChunkName()); - ReplicaChunkDescriptorTable::Get().BeginConstructReplicaChunk(descriptor); - ChunkType* chunk = aznew ChunkType(GM_FUNCTION_FORWARD); - ReplicaChunkDescriptorTable::Get().EndConstructReplicaChunk(); - chunk->Init(descriptor); - - return chunk; -} - -/** - Create a ReplicaChunk that is automatically attached to the replica. -**/ -template -ChunkType* CreateAndAttachReplicaChunk(const ReplicaPtr& replica GM_FUNCTION_ARGS_CONCAT) -{ - return CreateAndAttachReplicaChunk(replica.get() GM_FUNCTION_FORWARD_CONCAT); -} - -/** - Create a ReplicaChunk that is automatically attached to the replica. -**/ -template -ChunkType* CreateAndAttachReplicaChunk(Replica* replica GM_FUNCTION_ARGS_CONCAT) -{ - // Chunks cannot be attached while active - if (replica->IsActive()) - { - AZ_Warning("GridMate", false, "Cannot attach chunk %s while replica is active", ChunkType::GetChunkName()); - return nullptr; - } - - ChunkType* chunk = CreateReplicaChunk(GM_FUNCTION_FORWARD); - replica->AttachReplicaChunk(chunk); - return chunk; -} - -#undef GM_FUNCTION_TEMPLATE_PARMS -#undef GM_FUNCTION_ARGS -#undef GM_FUNCTION_ARGS_CONCAT -#undef GM_FUNCTION_FORWARD -#undef GM_FUNCTION_FORWARD_CONCAT diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index 758b217112..2646660eba 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -40,7 +40,6 @@ set(FILES Containers/unordered_set.h Containers/vector.h Replica/BasicHostChunkDescriptor.h - Replica/DeltaCompressedDataSet.h Replica/DataSet.cpp Replica/DataSet.h Replica/Interpolators.h @@ -58,7 +57,6 @@ set(FILES Replica/ReplicaCommon.h Replica/ReplicaDefs.h Replica/ReplicaFunctions.h - Replica/ReplicaFunctions.inl Replica/ReplicaInline.inl Replica/ReplicaMgr.cpp Replica/ReplicaMgr.h @@ -80,8 +78,6 @@ set(FILES Replica/Tasks/ReplicaProcessPolicy.cpp Replica/Tasks/ReplicaProcessPolicy.h Replica/Tasks/ReplicaPriorityPolicy.h - Replica/Interest/BitmaskInterestHandler.cpp - Replica/Interest/BitmaskInterestHandler.h Replica/Interest/InterestDefs.h Replica/Interest/InterestManager.cpp Replica/Interest/InterestManager.h From e28a0eaec75e10351cdd351bde8f8aa4141bbfae Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 13 Dec 2021 15:06:20 -0800 Subject: [PATCH 228/620] Removes interest stuff from GridMate Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GridMate/Replica/Interest/InterestDefs.h | 132 ---------- .../Replica/Interest/InterestEvents.h | 53 ---- .../Replica/Interest/InterestManager.cpp | 243 ------------------ .../Replica/Interest/InterestManager.h | 91 ------- .../Replica/Interest/InterestQueryResult.cpp | 25 -- .../Replica/Interest/InterestQueryResult.h | 25 -- .../GridMate/Replica/Interest/RulesHandler.h | 65 ----- .../GridMate/GridMate/Replica/Replica.h | 4 +- .../GridMate/GridMate/Replica/ReplicaMgr.h | 1 - .../GridMate/GridMate/Replica/ReplicaTarget.h | 2 - .../GridMate/GridMate/gridmate_files.cmake | 5 - 11 files changed, 1 insertion(+), 645 deletions(-) delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/InterestDefs.h delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/InterestEvents.h delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.cpp delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.h delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.cpp delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.h delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/RulesHandler.h diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestDefs.h b/Code/Framework/GridMate/GridMate/Replica/Interest/InterestDefs.h deleted file mode 100644 index 7695ee6b08..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestDefs.h +++ /dev/null @@ -1,132 +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 - * - */ -#ifndef GM_REPLICA_INTERESTDEFS_H -#define GM_REPLICA_INTERESTDEFS_H - -#include -#include -#include -#include -#include -#include - -namespace GridMate -{ - /** - * Bitmask used internally in InterestManager to check which handler is responsible for a given interest match - */ - using InterestHandlerSlot = AZ::u32; - - /** - * Rule identifier (unique within the session) - */ - using RuleNetworkId = AZ::u64; - /////////////////////////////////////////////////////////////////////////// - - using InterestPeerSet = unordered_set; - - /** - * InterestMatchResult: a structure to gather new matches from handlers. - * Passed to handler within matching context when handler's Match method is invoked. - * User must fill the structure with changes that handler recalculated. - * - * Specifically, the changes should have all the replicas that had their list of associated peers modified. - * Each entry replica - new full list of associated peers. - */ - class InterestMatchResult : public unordered_map - { - public: - using unordered_map::unordered_map; - - /* - * An expensive debug trace helper, prints sorted mapping between replica id's and associated peers. - */ - void PrintMatchResult(const char* name) const; - }; - /////////////////////////////////////////////////////////////////////////// - - /** - * Base class for interest rules - */ - class InterestRule - { - public: - explicit InterestRule(PeerId peerId, RuleNetworkId netId) - : m_peerId(peerId) - , m_netId(netId) - {} - - PeerId GetPeerId() const { return m_peerId; } - RuleNetworkId GetNetworkId() const { return m_netId; } - - protected: - PeerId m_peerId; ///< the peer this rule is bound to - RuleNetworkId m_netId; ///< network id - }; - /////////////////////////////////////////////////////////////////////////// - - - /** - * Base class for interest attributes - */ - class InterestAttribute - { - public: - explicit InterestAttribute(ReplicaId replicaId) - : m_replicaId(replicaId) - {} - - ReplicaId GetReplicaId() const { return m_replicaId; } - - protected: - ReplicaId m_replicaId; ///< Replica id this attribute is bound to - }; - /////////////////////////////////////////////////////////////////////////// - -#if !defined(AZ_DEBUG_BUILD) - AZ_INLINE void InterestMatchResult::PrintMatchResult(const char*) const {} -#else - AZ_INLINE void InterestMatchResult::PrintMatchResult(const char* name) const - { - if (size() == 0) - { - AZ_TracePrintf("GridMate", "InterestMatchResult %s empty \n", name); - return; - } - - AZStd::vector sorted; - for (auto& r : *this) - { - sorted.push_back(r); - } - - auto sortByReplicaId = [](const value_type& one, const value_type& another) - { - return one.first < another.first; - }; - AZStd::sort(sorted.begin(), sorted.end(), sortByReplicaId); - - AZ_TracePrintf("GridMate", "InterestMatchResult %s \n", name); - for (auto& match : sorted) - { - auto repId = match.first; - AZ_TracePrintf("GridMate", "\t\t\t for repId %d ", repId); - - // unsorted list of peers - for (auto& peerId : match.second) - { - AZ_TracePrintf("", "peer %d", peerId); - } - - AZ_TracePrintf("", "\n"); - } - } -#endif -} // GridMate - -#endif // GM_REPLICA_INTERESTDEFS_H diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestEvents.h b/Code/Framework/GridMate/GridMate/Replica/Interest/InterestEvents.h deleted file mode 100644 index cf7771cb32..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestEvents.h +++ /dev/null @@ -1,53 +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 - * - */ - -#ifndef GM_REPLICA_INTERESTEVENTS_H -#define GM_REPLICA_INTERESTEVENTS_H - -#if defined(GM_INTEREST_MANAGER) - -#include -#include - -#include -#include -#include - -namespace GridMate -{ - /** - * EBus for interest manager's events. - * Notifies subscribers about new interest matches and new mismatches happened. - */ - class InterestManagerEvents - : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - typedef AZStd::recursive_mutex MutexType; - typedef void* BusIdType; - typedef SysContAlloc AllocatorType; - - virtual ~InterestManagerEvents() {} - - /** - * Called when new pair of replica and peer matched their interest - */ - virtual void OnInterestMatched(ReplicaId replicaId, PeerId peerId) { (void) replicaId; (void) peerId; } - - /** - * Called when pair of replica and peer mismatched interest (only called if the pair was previously matching) - */ - virtual void OnInterestUnmatched(ReplicaId replicaId, PeerId peerId) { (void) replicaId; (void) peerId; } - }; - - typedef AZ::EBus InterestManagerEventsBus; -} - -#endif // GM_INTEREST_MANAGER -#endif diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.cpp b/Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.cpp deleted file mode 100644 index 2d77a3ec8c..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.cpp +++ /dev/null @@ -1,243 +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 - * - */ - -#include -#include -#include - -#include - -#include - -namespace GridMate -{ - static const unsigned k_maxHandlers = sizeof(GridMate::InterestHandlerSlot) * CHAR_BIT; - - /** - * Hashing utils - */ - struct ReplicaHashByPeer - { - AZ_FORCE_INLINE AZStd::size_t operator()(const ReplicaTarget* t) const - { - static_assert(sizeof(AZStd::size_t) >= sizeof(ReplicaPeer*), "Types sizes mismatch"); - return reinterpret_cast(t->GetPeer()); - } - }; - - struct ReplicaEqualToByPeer - { - AZ_FORCE_INLINE bool operator()(const ReplicaTarget* left, const ReplicaTarget* right) const - { - return left->GetPeer() == right->GetPeer(); - } - }; - - struct ReplicaHashByPeerId - { - AZ_FORCE_INLINE AZStd::size_t operator()(PeerId peerId) const - { - static_assert(sizeof(AZStd::size_t) >= sizeof(PeerId), "Types sizes mismatch"); - return static_cast(peerId); - } - }; - - struct ReplicaEqualToByPeerId - { - AZ_FORCE_INLINE bool operator()(PeerId peerId, const ReplicaTarget* right) const - { - return peerId == right->GetPeer()->GetId(); - } - }; - /////////////////////////////////////////////////////////////////////////// - - /** - * InterestManager - */ - InterestManager::InterestManager() - : m_rm(nullptr) - , m_freeSlots(~0u) - { - } - - void InterestManager::Init(const InterestManagerDesc& desc) - { - m_rm = desc.m_rm; - AZ_Assert(m_rm, "Invalid replica manager"); - } - - bool InterestManager::IsReady() const - { - return m_rm != nullptr; - } - - InterestManager::~InterestManager() - { - while (!m_handlers.empty()) - { - m_handlers.back()->OnRulesHandlerUnregistered(this); - m_handlers.pop_back(); - } - } - - void InterestManager::RegisterHandler(BaseRulesHandler* handler) - { - AZ_Assert(handler, "Invalid rules handler"); - - for (BaseRulesHandler* h : m_handlers) - { - if (h == handler) - { - AZ_TracePrintf("GridMate", "Rules handler %p is already registered", handler); - return; - } - } - - InterestHandlerSlot slot = GetNewSlot(); - if (!slot) - { - AZ_TracePrintf("GridMate", "Too many rules handlers, max=%u\n", k_maxHandlers); - return; - } - - handler->m_slot = slot; - m_handlers.push_back(handler); - handler->OnRulesHandlerRegistered(this); - } - - void InterestManager::UnregisterHandler(BaseRulesHandler* handler) - { - AZ_Assert(handler, "Invalid rules handler"); - - for (auto it = m_handlers.begin(); it != m_handlers.end(); ++it) - { - if (*it == handler) - { - handler->OnRulesHandlerUnregistered(this); - m_handlers.erase(it); - return; - } - } - - AZ_Assert(false, "Handler was not registered"); - } - - void InterestManager::Update() - { - // Updating all handlers - for (BaseRulesHandler* handler : m_handlers) - { - handler->Update(); - } - - // merging results from every handler - for (BaseRulesHandler* handler : m_handlers) - { - const InterestMatchResult& result = handler->GetLastResult(); - - for (auto& match : result) - { - ReplicaPtr replica = m_rm->FindReplica(match.first); - if (!replica) // replica was destroyed: ignoring this match - { - continue; - } - - unordered_set targets; - - for (ReplicaTarget& targetObj : replica->m_targets) - { - targets.insert(&targetObj); - if (!match.second.count(targetObj.GetPeer()->GetId())) - { - targetObj.m_slotMask &= ~handler->m_slot; - if (!targetObj.m_slotMask) - { - targetObj.m_flags |= ReplicaTarget::TargetRemoved; - m_rm->OnReplicaChanged(replica); - } - } - } - - for (const PeerId& peerId : match.second) - { - ReplicaTarget* rt = nullptr; - - auto it = targets.find_as(peerId, ReplicaHashByPeerId(), ReplicaEqualToByPeerId()); - if (it == targets.end()) - { - ReplicaPeer* peer = m_rm->FindPeer(peerId); - - if (!ShouldForward(replica.get(), peer)) - { - continue; - } - - rt = ReplicaTarget::AddReplicaTarget(peer, replica.get()); - rt->SetNew(true); - m_rm->OnReplicaChanged(replica); - } - else - { - rt = *it; - } - - rt->m_slotMask |= handler->m_slot; - rt->m_flags &= ~ReplicaTarget::TargetRemoved; - } - } - } - } - - - bool InterestManager::ShouldForward(Replica* replica, ReplicaPeer* peer) const - { - if (!peer) // invalid peer - { - return false; - } - - if (replica->IsPrimary()) // own the replica? - { - return true; - } - - if (m_rm->GetLocalPeerId() == peer->GetId() || peer->GetId() == replica->m_upstreamHop->GetId()) // forwarding to local peer or to owner? - { - return false; - } - - if (m_rm->IsSyncHost() && !(replica->m_upstreamHop->GetMode() == Mode_Peer && peer->GetMode() == Mode_Peer)) // we are host and replica' owner and target are not connected - { - return true; - } - - return false; - } - - InterestHandlerSlot InterestManager::GetNewSlot() - { - InterestHandlerSlot s = m_freeSlots; - for (unsigned i = 0; s && i < k_maxHandlers; ++i, s >>= 1) - { - if (s & 1) - { - InterestHandlerSlot slot = (1 << i); - m_freeSlots &= ~slot; - return slot; - } - } - return 0; - } - - void InterestManager::FreeSlot(InterestHandlerSlot slot) - { - m_freeSlots |= slot; - } - /////////////////////////////////////////////////////////////////////////// -} diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.h b/Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.h deleted file mode 100644 index e7ff19129c..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.h +++ /dev/null @@ -1,91 +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 - * - */ -#ifndef GM_REPLICA_INTERESTMANAGER_H -#define GM_REPLICA_INTERESTMANAGER_H - -#include - -#include - -namespace GridMate -{ - class BaseRulesHandler; - - /** - * Interest manager initialization parameters - */ - struct InterestManagerDesc - { - ReplicaManager* m_rm; ///< Replica manager instance - - InterestManagerDesc() - : m_rm(nullptr) - { - - } - }; - - /** - * InterestManager: responsible for matching of replicas and peers pairs based on rules and attribute provided. - * InterestManager allows registration of up to 32 custom rules handler. Each rules handler is responsible of matching attributes - * and rules that user provides. InterestManager is responsible for merging results of matching from every registered handler and - * maintaining valid forwarding targets cache on every Replica. - */ - class InterestManager - { - public: - - GM_CLASS_ALLOCATOR(InterestManager); - - InterestManager(); - ~InterestManager(); - - /** - * Initialize manager with a descriptor - */ - void Init(const InterestManagerDesc& desc); - - /** - * Returns true if InterestManager is initialized and is ready to use - */ - bool IsReady() const; - - /** - * Register new handler with a given type and instance - */ - void RegisterHandler(BaseRulesHandler* handler); - - /** - * Unregister handler - */ - void UnregisterHandler(BaseRulesHandler* handler); - - /** - * Call to update current replica->peers cache - */ - void Update(); - - /** - * Returns replica manager IM is bount to - */ - ReplicaManager* GetReplicaManager() { return m_rm; } - private: - InterestManager(const InterestManager&) = delete; - InterestManager& operator=(const InterestManager&) = delete; - - InterestHandlerSlot GetNewSlot(); - void FreeSlot(InterestHandlerSlot slot); - bool ShouldForward(Replica* replica, ReplicaPeer* peer) const; - - ReplicaManager* m_rm; - vector m_handlers; - InterestHandlerSlot m_freeSlots; - }; -} // namespace GridMate - -#endif // GM_REPLICA_INTERESTMANAGER_H diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.cpp b/Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.cpp deleted file mode 100644 index 7c69b45794..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.cpp +++ /dev/null @@ -1,25 +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 - * - */ -/* -#include - -namespace GridMate -{ - InterestQueryResult::InterestQueryResult() - { - - } - - InterestQueryResult::PeerList& InterestQueryResult::Insert(ReplicaId repId) - { - auto it = m_matches.insert_key(repId); - return it.first->second; - } -} // namespace GridMate - -*/ diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.h b/Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.h deleted file mode 100644 index 45213bd855..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.h +++ /dev/null @@ -1,25 +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 - * - */ -#ifndef GM_REPLICA_INTERESTQUERYRESULT_H -#define GM_REPLICA_INTERESTQUERYRESULT_H -/* -#include - -#include -#include -#include -#include - -namespace GridMate -{ - - using InterestPeerList = vector; - using InterestQueryResult = unordered_map; -} // GridMate -*/ -#endif // GM_REPLICA_INTERESTQUERYRESULT_H diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/RulesHandler.h b/Code/Framework/GridMate/GridMate/Replica/Interest/RulesHandler.h deleted file mode 100644 index 0c20063908..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/RulesHandler.h +++ /dev/null @@ -1,65 +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 - * - */ -#ifndef GM_REPLICA_RULES_HANDLER_H -#define GM_REPLICA_RULES_HANDLER_H - -#include - -#include - -namespace GridMate -{ - class InterestManager; - - /** - * BaseRulesHandler: base handler class - * RulesHandler's job is to provide InterestManager with matching pairs of attributes and rules. - */ - class BaseRulesHandler - { - public: - BaseRulesHandler() - : m_slot(0) - {} - - virtual ~BaseRulesHandler() { }; - - /** - * Ticked by interest manager to retrieve new matches or mismatches of interests - */ - virtual void Update() = 0; - - /** - * Returns result of a previous update - * This only returns changes that happened on the previous tick not the whole world state - */ - virtual const InterestMatchResult& GetLastResult() = 0; - - /** - * Called by InterestManager when the given handler instance is registered - */ - virtual void OnRulesHandlerRegistered(InterestManager* manager) = 0; - - /** - * Called by InterestManager when the given handler is unregistered - */ - virtual void OnRulesHandlerUnregistered(InterestManager* manager) = 0; - - /** - * Returns interest mananger this handler is bound to, or nullptr if it's unbound - */ - virtual InterestManager* GetManager() = 0; - - private: - friend class InterestManager; - - InterestHandlerSlot m_slot; - }; -} // namespace GridMate - -#endif // GM_REPLICA_RULES_HANDLER_H diff --git a/Code/Framework/GridMate/GridMate/Replica/Replica.h b/Code/Framework/GridMate/GridMate/Replica/Replica.h index a70acd5201..9f4e5488fa 100644 --- a/Code/Framework/GridMate/GridMate/Replica/Replica.h +++ b/Code/Framework/GridMate/GridMate/Replica/Replica.h @@ -29,8 +29,7 @@ namespace GridMate class ReplicaStatus; class ReplicaTask; - class InterestManager; - + //------------------------------------------------------------------------- // Replica //------------------------------------------------------------------------- @@ -55,7 +54,6 @@ namespace GridMate friend class ReplicaMarshalNewTask; - friend class InterestManager; friend class ReplicaTarget; enum Flags diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.h b/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.h index bd9f1a1ee9..30317d4227 100644 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.h +++ b/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.h @@ -329,7 +329,6 @@ namespace GridMate friend class ReplicaUpdateTaskBase; friend class ReplicaDestroyPeerTask; friend class SendLimitProcessPolicy; - friend class InterestManager; typedef unordered_map UserContextMapType; typedef unordered_map ReplicaMap; diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaTarget.h b/Code/Framework/GridMate/GridMate/Replica/ReplicaTarget.h index be1a86b627..af914fb504 100644 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaTarget.h +++ b/Code/Framework/GridMate/GridMate/Replica/ReplicaTarget.h @@ -46,8 +46,6 @@ namespace GridMate */ class ReplicaTarget { - friend class InterestManager; - public: static ReplicaTarget* AddReplicaTarget(ReplicaPeer* peer, Replica* replica); diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index 2646660eba..a95250a66c 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -78,11 +78,6 @@ set(FILES Replica/Tasks/ReplicaProcessPolicy.cpp Replica/Tasks/ReplicaProcessPolicy.h Replica/Tasks/ReplicaPriorityPolicy.h - Replica/Interest/InterestDefs.h - Replica/Interest/InterestManager.cpp - Replica/Interest/InterestManager.h - Replica/Interest/InterestQueryResult.h - Replica/Interest/RulesHandler.h Serialize/Buffer.cpp Serialize/Buffer.h Serialize/PackedSize.h From 583020b3ae3e5721f4673c8e940381eda53352fc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 14 Dec 2021 10:43:31 -0800 Subject: [PATCH 229/620] =?UTF-8?q?=EF=BB=BFRemoves=20unused=20files=20fro?= =?UTF-8?q?m=20AsetProcessor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/AssetBuilderApplicationTests.cpp | 1 + .../AssetBuilderSDK/AssetBuilderEBusHelper.h | 67 --------- .../assetprocessor_windows_files.cmake | 1 - .../Platform/Windows/native/resource.h | 26 ---- .../assetprocessor_test_files.cmake | 1 - .../native/AssetManager/AssetData.h | 134 ------------------ .../native/AssetManager/assetdata.cpp | 16 --- .../tests/resourcecompiler/RCJobTest.cpp | 2 - .../native/tests/resourcecompiler/RCJobTest.h | 13 -- 9 files changed, 1 insertion(+), 260 deletions(-) delete mode 100644 Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderEBusHelper.h delete mode 100644 Code/Tools/AssetProcessor/Platform/Windows/native/resource.h delete mode 100644 Code/Tools/AssetProcessor/native/AssetManager/AssetData.h delete mode 100644 Code/Tools/AssetProcessor/native/AssetManager/assetdata.cpp delete mode 100644 Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.h diff --git a/Code/Tools/AssetProcessor/AssetBuilder/Tests/AssetBuilderApplicationTests.cpp b/Code/Tools/AssetProcessor/AssetBuilder/Tests/AssetBuilderApplicationTests.cpp index 679b4a0a04..1b86c3aa2c 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/Tests/AssetBuilderApplicationTests.cpp +++ b/Code/Tools/AssetProcessor/AssetBuilder/Tests/AssetBuilderApplicationTests.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include diff --git a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderEBusHelper.h b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderEBusHelper.h deleted file mode 100644 index 6a29e0c36a..0000000000 --- a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderEBusHelper.h +++ /dev/null @@ -1,67 +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 - * - */ -#ifndef ASSETBUILDERUTILEBUSHELPER_H -#define ASSETBUILDERUTILEBUSHELPER_H - -#include -#include -#include -#include -#include - -namespace AssetBuilderSDK -{ - //!This EBUS is used to send commands from the assetprocessor to the builder - class AssetBuilderCommandBusTraits - : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - typedef AZ::Uuid BusIdType; - typedef AZStd::recursive_mutex MutexType; - - virtual ~AssetBuilderCommandBusTraits() {} - - //Shutdown the builder. - virtual void ShutDown() {} - }; - - typedef AZ::EBus AssetBuilderCommandBus; - - //!Information that builders will send to the assetprocessor - struct AssetBuilderDesc - { - AZStd::string m_name;//builder name - AZStd::string m_regex;//builder regex - AZ::Uuid m_busId;// builder id - }; - - //!This EBUS is used to send information from the builder to the AssetProcessor - class AssetBuilderBusTraits - : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - typedef AZStd::recursive_mutex MutexType; - - virtual ~AssetBuilderBusTraits() {} - - //Use this function to send AssetBuilderDesc info to the assetprocessor - virtual void RegisterBuilderInformation(AssetBuilderDesc builderDesc) {} - - //Use this function to register all the component descriptors - virtual void RegisterComponentDescriptor(AZ::ComponentDescriptor* descriptor) {} - }; - - typedef AZ::EBus AssetBuilderBus; -} - - -#endif //ASSETBUILDERUTILEBUSHELPER_H diff --git a/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake b/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake index 96dd7434c1..39e697bf40 100644 --- a/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake +++ b/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake @@ -10,5 +10,4 @@ set(FILES native/FileWatcher/FileWatcher_platform.h native/FileWatcher/FileWatcher_windows.cpp native/FileWatcher/FileWatcher_windows.h - native/resource.h ) diff --git a/Code/Tools/AssetProcessor/Platform/Windows/native/resource.h b/Code/Tools/AssetProcessor/Platform/Windows/native/resource.h deleted file mode 100644 index 38259ae0f0..0000000000 --- a/Code/Tools/AssetProcessor/Platform/Windows/native/resource.h +++ /dev/null @@ -1,26 +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 - * - */ - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Editor.rc -// -#define IDI_ICON1 2 -#define IDC_STATIC -1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 3 -#define _APS_NEXT_COMMAND_VALUE 32769 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 110 -#endif -#endif diff --git a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake index a7a46ad62c..20ab4b706d 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake @@ -25,7 +25,6 @@ set(FILES native/tests/resourcecompiler/RCControllerTest.cpp native/tests/resourcecompiler/RCControllerTest.h native/tests/resourcecompiler/RCJobTest.cpp - native/tests/resourcecompiler/RCJobTest.h native/tests/assetBuilderSDK/assetBuilderSDKTest.h native/tests/assetBuilderSDK/assetBuilderSDKTest.cpp native/tests/assetBuilderSDK/SerializationDependenciesTests.cpp diff --git a/Code/Tools/AssetProcessor/native/AssetManager/AssetData.h b/Code/Tools/AssetProcessor/native/AssetManager/AssetData.h deleted file mode 100644 index a03d831283..0000000000 --- a/Code/Tools/AssetProcessor/native/AssetManager/AssetData.h +++ /dev/null @@ -1,134 +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 - * - */ -#ifndef ASSETPROCESSOR_ASSETDATA_H -#define ASSETPROCESSOR_ASSETDATA_H - -#include -#include -#include -#include -#include -#include -#include - -namespace AssetProcessor -{ - using namespace AzToolsFramework::AssetDatabase; - - //Check the extension of all the products - //return true if any one of the product extension matches the input extension, else return false - bool CheckProductsExtension( const ProductDatabseEntryContainer& products, const char* ext ); - - //! this is the interface which we use to speak to the legacy database tables. - // its known as the legacy database interface because the forthcoming tables will completely replace these - // but this layer exits for compatibility with the previous version and allows us to upgrade in place. - class AssetDatabaseInterface - { - public: - - AssetDatabaseInterface() - { - qRegisterMetaType( "SourceEntry" ); - qRegisterMetaType( "ProductEntry" ); - qRegisterMetaType( "SourceEntryContainer" ); - qRegisterMetaType( "ProductEntryContainer" ); - } - - virtual ~AssetDatabaseInterface() - { - } - - //! Returns true if the database or file exists already - virtual bool DataExists() = 0; - - //! Actually connects to the database, loads it, or creates empty database depending on above. - virtual void LoadData() = 0; - - //! Use with care. Resets all data! This causes an immediate commit and save! - virtual void ClearData() = 0; - - //! Retrieve the scan folders - virtual void GetScanFolders(QStringList& scanFolderList) = 0; - - //! Retrieves a specific scan folder by id, return false if not found - virtual bool GetScanFolder(AZ::s64 scanFolderID, QString& scanFolder) = 0; - - //! Adds a scan folder - virtual AZ::s64 AddScanFolder(QString scanFolder) = 0; - - // ! remove a scanfolder - virtual void RemoveScanFolder(AZ::s64 scanFolderID) = 0; - virtual void RemoveScanFolder(QString scanFolder) = 0; - - //! query the scanFolder ID for a given folder, return false if not found - virtual bool GetScanFolderID(QString scanfolder, AZ::s64& scanFolderID) = 0; - - //! query the sourceID of a source - virtual bool GetSourceID(QString sourceName, QString jobDescription, AZ::s64& sourceID) = 0; - - //! Retrieve the fingerprint for a given source name on a given platform for a particular jobDescription - //! This could return zero if its never seen this file before. - virtual bool GetFingerprintForSource(QString sourceName, QString jobDescription, AZ::u32& fingerprint) = 0; - - //! Set the fingerprint for the given source name, platform and jobDescription to the value provided - //! If updating a existing fingerprint you do not have to supply guid or scanfolderid - virtual void SetSource(QString sourceName, QString jobDescription, AZ::u32 fingerprint, AZ::Uuid guid = AZ::Uuid::CreateNull(), AZ::s64 scanFolderID = 0) = 0; - - //! Removing a fingerprint will destroy its entry in the database - //! and any entries that refer to it (products, etc). if you want to merely set it dirty - //! Then instead call SetSource to zero - virtual void RemoveSource(QString sourceName, QString jobDescription) = 0; - virtual void RemoveSource(AZ::s64 sourceID) = 0; - - //! Given a source name, jobDescription, and platform return the list of products by the last compile of that file - //! returns false if it doesn't know about source or if the source did not emitted any products. - virtual bool GetProductsForSource(QString sourceName, QString jobDescription, ProductDatabseEntryContainer& products, QString platform = QString()) = 0; - - //! Given a source name and platform return the list of all jobDescriptions associated with them from the last compile of that file - //! returns false if it doesn't know about any job description for that source and platform. - virtual bool GetJobDescriptionsForSource(QString sourceName, QStringList& jobDescription) = 0; - - //! Given an product file name, compute source file name - //! False is returned if its never heard of that product. - virtual bool GetSourceFromProductName(QString productName, SourceDatabaseEntry& source) = 0; - - //! For a given source, set the list of products for that source. - //! Removes any data that's present and overwrites it with the new list - //! Note that an empty list is acceptable data, it means the source emitted no products - virtual void SetProductsForSource(QString sourceName, QString jobDescription, const ProductDatabseEntryContainer& productList = ProductDatabseEntryContainer(), QString platform = QString()) = 0; - - //! Clear the products for a given source. This removes the entry entirely, not just sets it to empty. - virtual void RemoveProducts(QString sourceName, QString jobDescription, QString platform = QString()) = 0; - virtual void RemoveProduct(AZ::s64 productID) = 0; - - //! GetMatchingProductFiles - checks the database for all products that begin with the given match check - //! Note that the input string is expected to not include the cache folder - //! so it probably starts with platform name. - virtual void GetMatchingProducts(QString matchCheck, ProductDatabseEntryContainer& products, QString platform = QString()) = 0; - - //! GetMatchingSourceFiles - checks the database for all source files that begin with the given match check - //! note that the input string is expected to be the relative path name - //! and the output is the relative name (so to convert it to a full path, you will need to call the appropriate function) - virtual void GetMatchingSources(QString matchCheck, SourceDatabaseEntryContainer& sources) = 0; - - //! Get a giant list of ALL known source files in the database. - virtual void GetSources(SourceDatabaseEntryContainer& sources) = 0; - - //! Get a giant list of ALL known products in the database. - virtual void GetProducts(ProductDatabseEntryContainer& products, QString platform = QString()) = 0; - - //! finds all elements in the database that ends with the given input. (Used to look things up by extensions, in general) - virtual void GetSourcesByExtension(QString extension, SourceDatabaseEntryContainer& sources) = 0; - - //! SetJobLogForSource updates the Job Log table to record the status of a particular job. - //! It also sets all prior jobs that match that job exactly to not be the "latest one" but keeps them in the database. - virtual void SetJobLogForSource(AZ::s64 jobId, const AZStd::string& sourceName, const AZStd::string& platform, const AZ::Uuid& builderUuid, const AZStd::string& jobKey, AzToolsFramework::AssetProcessor::JobStatus status) = 0; - }; -} // namespace AssetProcessor - -#endif // ASSETPROCESSOR_ASSETDATA_H diff --git a/Code/Tools/AssetProcessor/native/AssetManager/assetdata.cpp b/Code/Tools/AssetProcessor/native/AssetManager/assetdata.cpp deleted file mode 100644 index aa433ebb3e..0000000000 --- a/Code/Tools/AssetProcessor/native/AssetManager/assetdata.cpp +++ /dev/null @@ -1,16 +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 - * - */ -#include "AssetData.h" -#include -#include - -namespace AssetProcessor -{ - -} - diff --git a/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.cpp b/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.cpp index e639e75351..aad990ac72 100644 --- a/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.cpp @@ -6,8 +6,6 @@ * */ -#include "RCJobTest.h" - #include #include diff --git a/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.h b/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.h deleted file mode 100644 index cd9c8a108e..0000000000 --- a/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.h +++ /dev/null @@ -1,13 +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 - * - */ - -#pragma once - -#include - - From a9d8a5dcb3b43816105089e7c001fac7a8796249 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:35:16 -0800 Subject: [PATCH 230/620] Removes BufferedDataStream and FileStreamDataSource from CrashHandler Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../include/Uploader/BufferedDataStream.h | 32 ----------------- .../include/Uploader/FileStreamDataSource.h | 30 ---------------- .../Uploader/src/BufferedDataStream.cpp | 34 ------------------- .../Uploader/src/FileStreamDataSource.cpp | 29 ---------------- 4 files changed, 125 deletions(-) delete mode 100644 Code/Tools/CrashHandler/Uploader/include/Uploader/BufferedDataStream.h delete mode 100644 Code/Tools/CrashHandler/Uploader/include/Uploader/FileStreamDataSource.h delete mode 100644 Code/Tools/CrashHandler/Uploader/src/BufferedDataStream.cpp delete mode 100644 Code/Tools/CrashHandler/Uploader/src/FileStreamDataSource.cpp diff --git a/Code/Tools/CrashHandler/Uploader/include/Uploader/BufferedDataStream.h b/Code/Tools/CrashHandler/Uploader/include/Uploader/BufferedDataStream.h deleted file mode 100644 index 944fde999d..0000000000 --- a/Code/Tools/CrashHandler/Uploader/include/Uploader/BufferedDataStream.h +++ /dev/null @@ -1,32 +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 - * - */ - - -#pragma once - -#include -#include - -namespace O3de -{ - class BufferedDataStream : public crashpad::MinidumpUserExtensionStreamDataSource - { - public: - BufferedDataStream(uint32_t stream_type, const void* data, size_t data_size); - - size_t StreamDataSize() override; - bool ReadStreamData(Delegate* delegate) override; - - private: - std::vector data_; - - BufferedDataStream(const BufferedDataStream& rhs) = delete; - BufferedDataStream& operator=(const BufferedDataStream& rhs) = delete; - }; - -} diff --git a/Code/Tools/CrashHandler/Uploader/include/Uploader/FileStreamDataSource.h b/Code/Tools/CrashHandler/Uploader/include/Uploader/FileStreamDataSource.h deleted file mode 100644 index 6a3e11728c..0000000000 --- a/Code/Tools/CrashHandler/Uploader/include/Uploader/FileStreamDataSource.h +++ /dev/null @@ -1,30 +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 - * - */ - - -#pragma once - -#include -#include "base/files/file_path.h" - -namespace O3de -{ - class FileStreamDataSource : public crashpad::UserStreamDataSource - { - public: - FileStreamDataSource(const base::FilePath& filePath); - - std::unique_ptr ProduceStreamData(crashpad::ProcessSnapshot* process_snapshot) override; - - private: - FileStreamDataSource(const FileStreamDataSource& rhs) = delete; - FileStreamDataSource& operator=(const FileStreamDataSource& rhs) = delete; - - base::FilePath m_filePath; - }; -} diff --git a/Code/Tools/CrashHandler/Uploader/src/BufferedDataStream.cpp b/Code/Tools/CrashHandler/Uploader/src/BufferedDataStream.cpp deleted file mode 100644 index b4350b29d5..0000000000 --- a/Code/Tools/CrashHandler/Uploader/src/BufferedDataStream.cpp +++ /dev/null @@ -1,34 +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 - * - */ - -#include - -namespace O3de -{ - BufferedDataStream::BufferedDataStream(uint32_t stream_type, const void* data, size_t data_size) - : crashpad::MinidumpUserExtensionStreamDataSource(stream_type) - { - data_.resize(data_size); - - if (data_size) - { - memcpy(data_.data(), data, data_size); - } - } - - size_t BufferedDataStream::StreamDataSize() - { - return data_.size(); - } - - bool BufferedDataStream::ReadStreamData(Delegate* delegate) - { - return delegate->ExtensionStreamDataSourceRead(data_.size() ? data_.data() : nullptr, data_.size()); - } -} - diff --git a/Code/Tools/CrashHandler/Uploader/src/FileStreamDataSource.cpp b/Code/Tools/CrashHandler/Uploader/src/FileStreamDataSource.cpp deleted file mode 100644 index f490189057..0000000000 --- a/Code/Tools/CrashHandler/Uploader/src/FileStreamDataSource.cpp +++ /dev/null @@ -1,29 +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 - * - */ - -#include -#include - -#include - -namespace O3de -{ - FileStreamDataSource::FileStreamDataSource(const base::FilePath& filePath) : - m_filePath{ filePath } - { - - } - - std::unique_ptr FileStreamDataSource::ProduceStreamData(crashpad::ProcessSnapshot* process_snapshot) - { - static constexpr char testBuffer[] = "Test Data From buffer."; - - return std::make_unique( 0xCAFEBABE, testBuffer, sizeof(testBuffer)); - } -} - From f9f427bd9ceb0bb800cca1b77470abf3d3747835 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:47:37 -0800 Subject: [PATCH 231/620] Remove unused test files from SceneAPI/SceneBuilder Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../SceneBuilder/Tests/TestFbxMesh.cpp | 181 ------------------ .../SceneAPI/SceneBuilder/Tests/TestFbxMesh.h | 86 --------- .../SceneBuilder/Tests/TestFbxNode.cpp | 34 ---- .../SceneAPI/SceneBuilder/Tests/TestFbxNode.h | 37 ---- .../SceneBuilder/Tests/TestFbxSkin.cpp | 91 --------- .../SceneAPI/SceneBuilder/Tests/TestFbxSkin.h | 50 ----- 6 files changed, 479 deletions(-) delete mode 100644 Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.cpp delete mode 100644 Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.h delete mode 100644 Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.cpp delete mode 100644 Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.h delete mode 100644 Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.cpp delete mode 100644 Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.h diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.cpp deleted file mode 100644 index 4451f0ae93..0000000000 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.cpp +++ /dev/null @@ -1,181 +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 - * - */ - -#include -#include -#include -#include -#include - -namespace AZ -{ - namespace FbxSDKWrapper - { - TestFbxMesh::TestFbxMesh() - : m_vertexControlPoints(nullptr) - , m_vertexCount(0) - , m_polygonVertexIndices(nullptr) - , m_materialIndices(new FbxLayerElementArrayTemplate(eFbxInt)) - , m_uvElements(FbxGeometryElementUV::Create(nullptr, "TestElements_UV")) - , m_vertexColorElements(FbxGeometryElementVertexColor::Create(nullptr, "TestElements_VertexColors")) - , m_expectedVertexCount(0) - { - } - - int TestFbxMesh::GetDeformerCount() const - { - // For current test need, only have one skin for the mesh - return m_skin ? 1 : 0; - } - - AZStd::shared_ptr TestFbxMesh::GetSkin(int index) const - { - // For current test need, only have one skin for the mesh - return m_skin; - } - - bool TestFbxMesh::GetMaterialIndices(FbxLayerElementArrayTemplate** lockableArray) const - { - *lockableArray = m_materialIndices; - return true; - } - - int TestFbxMesh::GetControlPointsCount() const - { - return static_cast(m_vertexCount); - } - - AZStd::vector TestFbxMesh::GetControlPoints() const - { - return m_vertexControlPoints; - } - - int TestFbxMesh::GetPolygonCount() const - { - return static_cast(m_polygonInfo.size()); - } - - int TestFbxMesh::GetPolygonSize(int polygonIndex) const - { - if (m_polygonInfo.find(polygonIndex) != m_polygonInfo.end()) - { - return aznumeric_caster(m_polygonInfo.find(polygonIndex)->second.m_vertexCount); - } - return -1; - } - - int* TestFbxMesh::GetPolygonVertices() const - { - return m_polygonVertexIndices; - } - - int TestFbxMesh::GetPolygonVertexIndex(int polygonIndex) const - { - if (m_polygonInfo.find(polygonIndex) != m_polygonInfo.end()) - { - return aznumeric_caster(m_polygonInfo.find(polygonIndex)->second.m_startVertexIndex); - } - return -1; - } - - FbxUVWrapper TestFbxMesh::GetElementUV(int index) - { - (void)index; - return m_uvElements; - } - - int TestFbxMesh::GetElementUVCount() const - { - return 1; - } - - FbxVertexColorWrapper TestFbxMesh::GetElementVertexColor(int index) - { - (void)index; - return m_vertexColorElements; - } - - int TestFbxMesh::GetElementVertexColorCount() const - { - return 1; - } - - bool TestFbxMesh::GetPolygonVertexNormal(int polyIndex, int vertexIndex, Vector3& normal) const - { - normal = Vector3(1.0f, 0.0f, 0.0f); - return true; - } - - void TestFbxMesh::CreateMesh(std::vector& points, std::vector >& polygonVertexIndices) - { - m_vertexControlPoints.clear(); - m_materialIndices->Clear(); - m_polygonInfo.clear(); - - // Create fbx control point (position) data, and associated material index data - m_vertexCount = aznumeric_caster(points.size()); - m_vertexControlPoints.reserve(points.size()); - for (unsigned int i = 0; i < points.size(); ++i) - { - m_vertexControlPoints.push_back(Vector3(points[i].GetX(), points[i].GetY(), points[i].GetZ())); - m_materialIndices->Add(i); - } - - // Create fbx face data - m_expectedVertexCount = 0; - for (const std::vector& onePolygonIndices : polygonVertexIndices) - { - for (const int& index : onePolygonIndices) - { - m_expectedVertexCount++; - } - } - if (m_polygonVertexIndices) - { - delete m_polygonVertexIndices; - } - m_polygonVertexIndices = new int[m_expectedVertexCount]; - size_t i = 0; - for (const std::vector& onePolygonIndices : polygonVertexIndices) - { - m_polygonInfo.insert(std::make_pair(aznumeric_caster(m_polygonInfo.size()), - TestFbxPolygon(i, aznumeric_caster(onePolygonIndices.size())))); - for (const int& index : onePolygonIndices) - { - m_polygonVertexIndices[i] = index; - i++; - } - } - } - - void TestFbxMesh::SetSkin(const AZStd::shared_ptr& skin) - { - m_skin = skin; - } - - void TestFbxMesh::CreateExpectMeshInfo(std::vector >& expectedFaceVertexIndices) - { - m_expectedFaceVertexIndices = expectedFaceVertexIndices; - } - - size_t TestFbxMesh::GetExpectedVetexCount() const - { - return m_expectedVertexCount; - } - - size_t TestFbxMesh::GetExpectedFaceCount() const - { - return m_expectedFaceVertexIndices.size(); - } - - AZ::Vector3 TestFbxMesh::GetExpectedFaceVertexPosition(unsigned int faceIndex, unsigned int vertexIndex) const - { - return m_vertexControlPoints[m_expectedFaceVertexIndices[faceIndex][vertexIndex]]; - } - } -} diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.h b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.h deleted file mode 100644 index 68f2e1f19b..0000000000 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.h +++ /dev/null @@ -1,86 +0,0 @@ -#pragma once - -/* - * 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 - * - */ - -#include -#include -#include -#include -#include - -namespace AZ -{ - namespace FbxSDKWrapper - { - struct TestFbxPolygon - { - size_t m_startVertexIndex; - size_t m_vertexCount; - - TestFbxPolygon(size_t startVertexIndex, size_t vertexCount) - : m_startVertexIndex(startVertexIndex) - , m_vertexCount(vertexCount) - { - } - }; - - // TestFbxMesh - // FbxMesh Test Data creation - class TestFbxMesh - : public FbxMeshWrapper - { - public: - TestFbxMesh(); - ~TestFbxMesh() override = default; - - int GetDeformerCount() const override; - AZStd::shared_ptr GetSkin(int index) const override; - bool GetMaterialIndices(FbxLayerElementArrayTemplate** lockableArray) const override; - - int GetControlPointsCount() const; - AZStd::vector GetControlPoints() const override; - - int GetPolygonCount() const override; - int GetPolygonSize(int polygonIndex) const override; - int* GetPolygonVertices() const override; - int GetPolygonVertexIndex(int polygonIndex) const; - - FbxUVWrapper GetElementUV(int index = 0) override; - int GetElementUVCount() const override; - FbxVertexColorWrapper GetElementVertexColor(int index = 0) override; - int GetElementVertexColorCount() const override; - - bool GetPolygonVertexNormal(int polyIndex, int vertexIndex, Vector3& normal) const override; - - // Create test data APIs - void CreateMesh(std::vector& points, std::vector >& polygonVertexIndices); - void CreateExpectMeshInfo(std::vector >& expectedFaceVertexIndices); - void SetSkin(const AZStd::shared_ptr& skin); - - size_t GetExpectedVetexCount() const; - size_t GetExpectedFaceCount() const; - AZ::Vector3 GetExpectedFaceVertexPosition(unsigned int faceIndex, unsigned int vertexIndex) const; - - protected: - AZStd::vector m_vertexControlPoints; // vertex positions - size_t m_vertexCount; - int* m_polygonVertexIndices; // store all polygons' vertex indices in sequence. Each index maps to a control point. - FbxLayerElementArrayTemplate* m_materialIndices; - std::unordered_map m_polygonInfo; - - FbxUVWrapper m_uvElements; - FbxVertexColorWrapper m_vertexColorElements; - AZStd::shared_ptr m_skin; - - // Expected converted data - unsigned int m_expectedVertexCount; - std::vector > m_expectedFaceVertexIndices; - }; - } -} diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.cpp deleted file mode 100644 index 0217044515..0000000000 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.cpp +++ /dev/null @@ -1,34 +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 - * - */ -#include - -namespace AZ -{ - namespace FbxSDKWrapper - { - const std::shared_ptr TestFbxNode::GetMesh() const - { - return m_testFbxMesh; - } - - const char* TestFbxNode::GetName() const - { - return m_name.c_str(); - } - - void TestFbxNode::SetMesh(std::shared_ptr testFbxMesh) - { - m_testFbxMesh = testFbxMesh; - } - - void TestFbxNode::SetName(const char* name) - { - m_name = name; - } - } -} diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.h b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.h deleted file mode 100644 index ede0eb801c..0000000000 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -/* - * 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 - * - */ - -#include -#include - -namespace AZ -{ - namespace FbxSDKWrapper - { - // TestFbxNode - // FbxNode Test Data creation - class TestFbxNode - : public FbxNodeWrapper - { - public: - ~TestFbxNode() override = default; - - const std::shared_ptr GetMesh() const override; - const char* GetName() const override; - - void SetMesh(std::shared_ptr testFbxMesh); - void SetName(const char* name); - - protected: - std::shared_ptr m_testFbxMesh; - AZStd::string m_name; - }; - } -} diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.cpp deleted file mode 100644 index 9225f907b1..0000000000 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.cpp +++ /dev/null @@ -1,91 +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 - * - */ - -#include -#include -#include -#include - -namespace AZ -{ - namespace FbxSDKWrapper - { - const char* TestFbxSkin::GetName() const - { - return m_name.c_str(); - } - - int TestFbxSkin::GetClusterCount() const - { - return aznumeric_caster(m_links.size()); - } - - int TestFbxSkin::GetClusterControlPointIndicesCount(int index) const - { - return aznumeric_caster(m_controlPointIndices[index].size()); - } - - int TestFbxSkin::GetClusterControlPointIndex(int clusterIndex, int pointIndex) const - { - return m_controlPointIndices[clusterIndex][pointIndex]; - } - - double TestFbxSkin::GetClusterControlPointWeight(int clusterIndex, int pointIndex) const - { - return m_weights[clusterIndex][pointIndex]; - } - - AZStd::shared_ptr TestFbxSkin::GetClusterLink(int index) const - { - return m_links[index]; - } - - void TestFbxSkin::SetName(const char* name) - { - m_name = name; - } - - void TestFbxSkin::CreateSkinWeightData(AZStd::vector& boneNames, AZStd::vector>& weights, AZStd::vector>& controlPointIndices) - { - m_links.resize(boneNames.size()); - for (size_t linkIndex = 0; linkIndex < boneNames.size(); ++linkIndex) - { - m_links[linkIndex] = AZStd::make_shared(); - m_links[linkIndex]->SetName(boneNames[linkIndex].c_str()); - } - m_weights = weights; - m_controlPointIndices = controlPointIndices; - } - - void TestFbxSkin::CreateExpectSkinWeightData(AZStd::vector>& boneIds, AZStd::vector>& weights) - { - m_expectedBoneIds = boneIds; - m_expectedWeights = weights; - } - - size_t TestFbxSkin::GetExpectedVertexCount() const - { - return m_expectedBoneIds.size(); - } - - size_t TestFbxSkin::GetExpectedLinkCount(size_t vertexIndex) const - { - return m_expectedBoneIds[vertexIndex].size(); - } - - int TestFbxSkin::GetExpectedSkinLinkBoneId(size_t vertexIndex, size_t linkIndex) const - { - return m_expectedBoneIds[vertexIndex][linkIndex]; - } - - float TestFbxSkin::GetExpectedSkinLinkWeight(size_t vertextIndex, size_t linkIndex) const - { - return m_expectedWeights[vertextIndex][linkIndex]; - } - } -} diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.h b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.h deleted file mode 100644 index b90353e6a7..0000000000 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -/* - * 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 - * - */ - -#include -#include - -namespace AZ -{ - namespace FbxSDKWrapper - { - class TestFbxSkin - : public FbxSkinWrapper - { - public: - ~TestFbxSkin() override = default; - - const char* GetName() const override; - int GetClusterCount() const override; - int GetClusterControlPointIndicesCount(int index) const override; - int GetClusterControlPointIndex(int clusterIndex, int pointIndex) const override; - double GetClusterControlPointWeight(int clusterIndex, int pointIndex) const override; - AZStd::shared_ptr GetClusterLink(int index) const override; - - void SetName(const char* name); - void CreateSkinWeightData(AZStd::vector& boneNames, AZStd::vector>& weights, AZStd::vector>& controlPointIndices); - void CreateExpectSkinWeightData(AZStd::vector>& boneIds, AZStd::vector>& weights); - - size_t GetExpectedVertexCount() const; - size_t GetExpectedLinkCount(size_t vertexIndex) const; - int GetExpectedSkinLinkBoneId(size_t vertexIndex, size_t linkIndex) const; - float GetExpectedSkinLinkWeight(size_t vertexIndex, size_t linkIndex) const; - - protected: - AZStd::string m_name; - AZStd::vector> m_links; - AZStd::vector> m_weights; - AZStd::vector> m_controlPointIndices; - - AZStd::vector> m_expectedBoneIds; - AZStd::vector> m_expectedWeights; - }; - } -} From 7d2e53ca7a7d81b8fb1b059cc2ae57721e54bc36 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 14 Dec 2021 13:27:17 -0800 Subject: [PATCH 232/620] Remove unused files from SceneCore Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GraphData/MockIMeshVertexColorData.h | 38 --------------- .../GraphData/MockIMeshVertexUVData.h | 39 --------------- .../DataTypes/GraphData/MockITransform.h | 36 -------------- .../Mocks/DataTypes/Groups/MockIMeshGroup.h | 48 ------------------- .../DataTypes/Rules/MockIBlendShapeRule.h | 30 ------------ .../DataTypes/Rules/MockIMeshAdvancedRule.h | 48 ------------------- .../SceneCore/scenecore_testing_files.cmake | 1 - 7 files changed, 240 deletions(-) delete mode 100644 Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexColorData.h delete mode 100644 Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexUVData.h delete mode 100644 Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockITransform.h delete mode 100644 Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Groups/MockIMeshGroup.h delete mode 100644 Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIBlendShapeRule.h delete mode 100644 Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIMeshAdvancedRule.h diff --git a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexColorData.h b/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexColorData.h deleted file mode 100644 index 122152ae41..0000000000 --- a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexColorData.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -/* - * 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 - * - */ - -#include -#include - -namespace AZ -{ - namespace SceneAPI - { - namespace DataTypes - { - class MockIMeshVertexColorData - : public IMeshVertexColorData - { - public: - AZ_RTTI(MockIMeshVertexColorData, "{15AD4D4A-BFCC-41C3-B9BB-F7EFBA0AE0CC}", IMeshVertexColorData) - - virtual ~MockIMeshVertexColorData() = default; - - MOCK_CONST_METHOD0(GetCustomName, - const AZ::Name& ()); - - MOCK_CONST_METHOD0(GetCount, - size_t()); - MOCK_CONST_METHOD1(GetColor, - const Color&(size_t index)); - }; - } // namespace DataTypes - } //namespace SceneAPI -} // namespace AZ diff --git a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexUVData.h b/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexUVData.h deleted file mode 100644 index 28b2039fa5..0000000000 --- a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexUVData.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -/* - * 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 - * - */ - -#include -#include -#include - -namespace AZ -{ - namespace SceneAPI - { - namespace DataTypes - { - class MockIMeshVertexUVData - : public IMeshVertexUVData - { - public: - AZ_RTTI(MockIMeshVertexUVData, "{34528E85-2EE0-4999-B838-113BEDB1A258}", IMeshVertexUVData); - - ~MockIMeshVertexUVData() override = default; - - MOCK_CONST_METHOD0(GetCustomName, - const AZ::Name& ()); - - MOCK_CONST_METHOD0(GetCount, - size_t()); - MOCK_CONST_METHOD1(GetUV, - const AZ::Vector2&(size_t index)); - }; - } // DataTypes - } // SceneAPI -} // AZ diff --git a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockITransform.h b/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockITransform.h deleted file mode 100644 index ce396e4d63..0000000000 --- a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockITransform.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -/* - * 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 - * - */ - -#include -#include - -namespace AZ -{ - class Transform; - namespace SceneAPI - { - namespace DataTypes - { - class MockITransform - : public ITransform - { - public: - AZ_RTTI(MockITransform, "{1D4A832F-823C-4A80-97E1-A95D1B2BF18F}", ITransform); - - virtual ~MockITransform() override = default; - - MOCK_METHOD0(GetMatrix, - AZ::SceneAPI::DataTypes::MatrixType&()); - MOCK_CONST_METHOD0(GetMatrix, - const AZ::SceneAPI::DataTypes::MatrixType&()); - }; - } // DataTypes - } // SceneAPI -} // AZ diff --git a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Groups/MockIMeshGroup.h b/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Groups/MockIMeshGroup.h deleted file mode 100644 index e4bb07ace1..0000000000 --- a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Groups/MockIMeshGroup.h +++ /dev/null @@ -1,48 +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 - * - */ - -#pragma once - -#include -#include -#include - -namespace AZ -{ - namespace SceneAPI - { - namespace DataTypes - { - class MockIMeshGroup - : public IMeshGroup - { - public: - AZ_RTTI(MockIMeshGroup, "{AB119B84-E6D8-4CF3-9456-E44B23EDCDFE}", IMeshGroup); - - // IMeshGroup - MOCK_METHOD0(GetSceneNodeSelectionList, - ISceneNodeSelectionList&()); - MOCK_CONST_METHOD0(GetSceneNodeSelectionList, - const ISceneNodeSelectionList&()); - MOCK_CONST_METHOD0(GetId, - const Uuid&()); - MOCK_METHOD1(SetName, - void(AZStd::string&&)); - MOCK_METHOD1(OverrideId, - void(const Uuid&)); - - // IGroup - MOCK_CONST_METHOD0(GetName, - const AZStd::string&()); - - MOCK_METHOD0(GetRuleContainer, Containers::RuleContainer&()); - MOCK_CONST_METHOD0(GetRuleContainerConst, const Containers::RuleContainer&()); - }; - } // namespace DataTypes - } // namespace SceneAPI -} // namespace AZ diff --git a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIBlendShapeRule.h b/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIBlendShapeRule.h deleted file mode 100644 index e32e858041..0000000000 --- a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIBlendShapeRule.h +++ /dev/null @@ -1,30 +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 - * - */ - -#pragma once - -#include - -#include - -namespace AZ::SceneAPI::DataTypes { class IMockSceneNodeSelectionList; } - -namespace AZ::SceneAPI::DataTypes -{ - class MockIBlendShapeRule - : public IBlendShapeRule - { - public: - ISceneNodeSelectionList& GetSceneNodeSelectionList() override - { - return const_cast(static_cast(this)->GetSceneNodeSelectionList()); - } - - MOCK_CONST_METHOD0(GetSceneNodeSelectionList, const ISceneNodeSelectionList&()); - }; -} // namespace AZ::SceneAPI::DataTypes diff --git a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIMeshAdvancedRule.h b/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIMeshAdvancedRule.h deleted file mode 100644 index d729e6f59b..0000000000 --- a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIMeshAdvancedRule.h +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once - -/* - * 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 - * - */ - -#include -#include -#include - -namespace AZ -{ - namespace SceneAPI - { - namespace DataTypes - { - class MockIMeshAdvancedRule - : public IMeshAdvancedRule - { - public: - AZ_RTTI(MockIMeshAdvancedRule, "{6F67873D-778C-4D11-8818-B1906E60B67D}", IMeshAdvancedRule); - - virtual ~MockIMeshAdvancedRule() override = default; - - MOCK_CONST_METHOD0(Use32bitVertices, - bool()); - MOCK_CONST_METHOD0(MergeMeshes, - bool()); - MOCK_CONST_METHOD0(GetVertexColorStreamName, - const AZStd::string&()); - MOCK_CONST_METHOD0(IsVertexColorStreamDisabled, - bool()); - MOCK_CONST_METHOD1(GetUVStreamName, - AZStd::string&(size_t index)); - MOCK_CONST_METHOD1(IsUVStreamDisabled, - bool(size_t index)); - MOCK_CONST_METHOD0(GetUVStreamCount, - size_t()); - MOCK_CONST_METHOD0(UseCustomNormals, - bool()); - }; - } // DataTypes - } // SceneAPI -} // AZ diff --git a/Code/Tools/SceneAPI/SceneCore/scenecore_testing_files.cmake b/Code/Tools/SceneAPI/SceneCore/scenecore_testing_files.cmake index 1346af63f6..91b543e5e9 100644 --- a/Code/Tools/SceneAPI/SceneCore/scenecore_testing_files.cmake +++ b/Code/Tools/SceneAPI/SceneCore/scenecore_testing_files.cmake @@ -11,7 +11,6 @@ set(FILES Mocks/DataTypes/GraphData/MockIMeshData.h Mocks/DataTypes/MockIGraphObject.h Mocks/DataTypes/Groups/MockIGroup.h - Mocks/DataTypes/Groups/MockIMeshGroup.h Mocks/DataTypes/ManifestBase/MockISceneNodeSelectionList.h Mocks/Events/MockAssetImportRequest.h Tests/TestsMain.cpp From fdd75bbbf50f95e36094795b0a2d7b55d7be247d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:53:44 -0800 Subject: [PATCH 233/620] Removes SceneUIStandaloneAllocator from SceneUI Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../SceneUI/SceneUIStandaloneAllocator.cpp | 36 ------------------- .../SceneUI/SceneUIStandaloneAllocator.h | 27 -------------- .../SceneAPI/SceneUI/SceneUI_files.cmake | 2 -- 3 files changed, 65 deletions(-) delete mode 100644 Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.cpp delete mode 100644 Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.h diff --git a/Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.cpp b/Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.cpp deleted file mode 100644 index 615d4cc47c..0000000000 --- a/Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.cpp +++ /dev/null @@ -1,36 +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 - * - */ - -#include - -#include - -namespace AZ -{ - namespace SceneAPI - { - bool SceneUIStandaloneAllocator::m_allocatorInitialized = false; - - void SceneUIStandaloneAllocator::Initialize() - { - if (!AZ::AllocatorInstance().IsReady()) - { - AZ::AllocatorInstance().Create(); - m_allocatorInitialized = true; - } - } - - void SceneUIStandaloneAllocator::TearDown() - { - if (m_allocatorInitialized) - { - AZ::AllocatorInstance().Destroy(); - } - } - } -} diff --git a/Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.h b/Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.h deleted file mode 100644 index 919b3de234..0000000000 --- a/Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -/* - * 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 - * - */ - -#include - -namespace AZ -{ - namespace SceneAPI - { - class SceneUIStandaloneAllocator - { - public: - SCENE_UI_API static void Initialize(); - SCENE_UI_API static void TearDown(); - - private: - static bool m_allocatorInitialized; - }; - } // namespace SceneAPI -} // namespace AZ diff --git a/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake b/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake index 15adb433fe..992098ae4f 100644 --- a/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake +++ b/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake @@ -13,8 +13,6 @@ set(FILES ManifestMetaInfoHandler.cpp GraphMetaInfoHandler.h GraphMetaInfoHandler.cpp - SceneUIStandaloneAllocator.h - SceneUIStandaloneAllocator.cpp CommonWidgets/OverlayWidget.h CommonWidgets/OverlayWidgetLayer.h CommonWidgets/JobWatcher.h From 65516e5bd1e7a6ea13a3dd65103a75c6973bb7d0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:58:17 -0800 Subject: [PATCH 234/620] Removes OverlayWidgetLayer from SceneUI Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../CommonWidgets/OverlayWidgetLayer.h | 29 ----- .../CommonWidgets/OverlayWidgetLayer.ui | 106 ------------------ .../SceneAPI/SceneUI/SceneUI_files.cmake | 1 - 3 files changed, 136 deletions(-) delete mode 100644 Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.h delete mode 100644 Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.ui diff --git a/Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.h b/Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.h deleted file mode 100644 index 374f91a8ed..0000000000 --- a/Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -/* - * 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 - * - */ - -#include - -namespace AZ -{ - namespace SceneAPI - { - namespace UI - { - // left in for backwards compatibility with original SceneAPI code - class OverlayWidgetLayer : public AzQtComponents::OverlayWidgetLayer - { - public: - AZ_CLASS_ALLOCATOR(OverlayWidgetLayer, SystemAllocator, 0) - - using AzQtComponents::OverlayWidgetLayer::OverlayWidgetLayer; - }; - } // namespace UI - } // namespace SceneAPI -} // namespace AZ diff --git a/Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.ui b/Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.ui deleted file mode 100644 index 5084f436e3..0000000000 --- a/Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.ui +++ /dev/null @@ -1,106 +0,0 @@ - - - AZ::SceneAPI::UI::OverlayWidgetLayer - - - - 0 - 0 - 64 - 75 - - - - - 0 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - 0 - 30 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - QLayout::SetDefaultConstraint - - - 2 - - - 2 - - - 2 - - - 2 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - diff --git a/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake b/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake index 992098ae4f..724f4f0673 100644 --- a/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake +++ b/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake @@ -14,7 +14,6 @@ set(FILES GraphMetaInfoHandler.h GraphMetaInfoHandler.cpp CommonWidgets/OverlayWidget.h - CommonWidgets/OverlayWidgetLayer.h CommonWidgets/JobWatcher.h CommonWidgets/JobWatcher.cpp CommonWidgets/ProcessingOverlayWidget.h From d62438188572c86eb40a8e6d2284f7b4bcc92e73 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 15 Dec 2021 11:41:34 -0800 Subject: [PATCH 235/620] Removes resource/targetver files from LuaIDE Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Tools/LuaIDE/Source/Editor/LuaEditor.cpp | 5 ---- Code/Tools/LuaIDE/Source/Editor/LuaEditor.h | 9 ------ Code/Tools/LuaIDE/Source/Editor/Resource.h | 29 ------------------- Code/Tools/LuaIDE/Source/Editor/targetver.h | 16 ---------- Code/Tools/LuaIDE/lua_ide_files.cmake | 4 --- Code/Tools/LuaIDE/targetver.h | 16 ---------- 6 files changed, 79 deletions(-) delete mode 100644 Code/Tools/LuaIDE/Source/Editor/LuaEditor.h delete mode 100644 Code/Tools/LuaIDE/Source/Editor/Resource.h delete mode 100644 Code/Tools/LuaIDE/Source/Editor/targetver.h delete mode 100644 Code/Tools/LuaIDE/targetver.h diff --git a/Code/Tools/LuaIDE/Source/Editor/LuaEditor.cpp b/Code/Tools/LuaIDE/Source/Editor/LuaEditor.cpp index f6d905515b..19d2069b17 100644 --- a/Code/Tools/LuaIDE/Source/Editor/LuaEditor.cpp +++ b/Code/Tools/LuaIDE/Source/Editor/LuaEditor.cpp @@ -6,13 +6,8 @@ * */ -#include "LuaEditor.h" #include -#if defined(AZ_COMPILER_MSVC) -#include "resource.h" -#endif - #include #if defined(EXTERNAL_CRASH_REPORTING) diff --git a/Code/Tools/LuaIDE/Source/Editor/LuaEditor.h b/Code/Tools/LuaIDE/Source/Editor/LuaEditor.h deleted file mode 100644 index d2963c0bf0..0000000000 --- a/Code/Tools/LuaIDE/Source/Editor/LuaEditor.h +++ /dev/null @@ -1,9 +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 - * - */ - -#pragma once diff --git a/Code/Tools/LuaIDE/Source/Editor/Resource.h b/Code/Tools/LuaIDE/Source/Editor/Resource.h deleted file mode 100644 index 96dfe0315c..0000000000 --- a/Code/Tools/LuaIDE/Source/Editor/Resource.h +++ /dev/null @@ -1,29 +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 - * - */ - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Editor.rc -// -#define IDC_MYICON 2 -#define IDD_EDITOR_DIALOG 102 -#define IDR_MAINFRAME 128 -#define IDI_ICON1 129 -#define IDC_STATIC -1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 131 -#define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 110 -#endif -#endif diff --git a/Code/Tools/LuaIDE/Source/Editor/targetver.h b/Code/Tools/LuaIDE/Source/Editor/targetver.h deleted file mode 100644 index 13641a9302..0000000000 --- a/Code/Tools/LuaIDE/Source/Editor/targetver.h +++ /dev/null @@ -1,16 +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 - * - */ - -#pragma once - -// Including SDKDDKVer.h defines the highest available Windows platform. - -// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and -// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. - -#include diff --git a/Code/Tools/LuaIDE/lua_ide_files.cmake b/Code/Tools/LuaIDE/lua_ide_files.cmake index e5a7948d97..1506e45c88 100644 --- a/Code/Tools/LuaIDE/lua_ide_files.cmake +++ b/Code/Tools/LuaIDE/lua_ide_files.cmake @@ -7,11 +7,8 @@ # set(FILES - targetver.h Source/StandaloneToolsApplication.cpp Source/StandaloneToolsApplication.h - Source/Editor/Resource.h - Source/Editor/targetver.h Source/Telemetry/TelemetryBus.h Source/Telemetry/TelemetryComponent.cpp Source/Telemetry/TelemetryComponent.h @@ -21,7 +18,6 @@ set(FILES Source/LuaIDEApplication.cpp Source/AssetDatabaseLocationListener.h Source/AssetDatabaseLocationListener.cpp - Source/Editor/LuaEditor.h Source/Editor/LuaEditor.cpp Source/LUA/BasicScriptChecker.h Source/LUA/BreakpointPanel.cpp diff --git a/Code/Tools/LuaIDE/targetver.h b/Code/Tools/LuaIDE/targetver.h deleted file mode 100644 index 13641a9302..0000000000 --- a/Code/Tools/LuaIDE/targetver.h +++ /dev/null @@ -1,16 +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 - * - */ - -#pragma once - -// Including SDKDDKVer.h defines the highest available Windows platform. - -// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and -// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. - -#include From 92d77c2b4a700b4695f37d7700da167368b3be4d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 15 Dec 2021 11:53:26 -0800 Subject: [PATCH 236/620] Removes unused files from LuaIDE, Telemetry is not being used, the only ebus called is Initialized, but no "LogEvents are being called. Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../LuaIDE/Source/LUA/BasicScriptChecker.h | 27 ------- .../LuaIDE/Source/LUA/LUADebuggerMessages.h | 35 -------- .../LUA/LUATargetContextTrackerMessages.cpp | 15 ---- .../LuaIDE/Source/LUA/ScriptCheckerAPI.h | 40 ---------- .../Source/StandaloneToolsApplication.cpp | 13 +-- .../LuaIDE/Source/Telemetry/TelemetryBus.h | 31 ------- .../Source/Telemetry/TelemetryComponent.cpp | 48 ----------- .../Source/Telemetry/TelemetryComponent.h | 41 ---------- .../Source/Telemetry/TelemetryEvent.cpp | 80 ------------------- .../LuaIDE/Source/Telemetry/TelemetryEvent.h | 45 ----------- Code/Tools/LuaIDE/lua_ide_files.cmake | 9 --- 11 files changed, 1 insertion(+), 383 deletions(-) delete mode 100644 Code/Tools/LuaIDE/Source/LUA/BasicScriptChecker.h delete mode 100644 Code/Tools/LuaIDE/Source/LUA/LUADebuggerMessages.h delete mode 100644 Code/Tools/LuaIDE/Source/LUA/LUATargetContextTrackerMessages.cpp delete mode 100644 Code/Tools/LuaIDE/Source/LUA/ScriptCheckerAPI.h delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryBus.h delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.cpp delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.h delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.cpp delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.h diff --git a/Code/Tools/LuaIDE/Source/LUA/BasicScriptChecker.h b/Code/Tools/LuaIDE/Source/LUA/BasicScriptChecker.h deleted file mode 100644 index c24bba2aaa..0000000000 --- a/Code/Tools/LuaIDE/Source/LUA/BasicScriptChecker.h +++ /dev/null @@ -1,27 +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 - * - */ - -#ifndef BASICSCRIPTCHECKER_H -#define BASICSCRIPTCHECKER_H - -#include -#include - -namespace LUAEditor -{ - class BasicScriptChecker - { - public: - AZ_CLASS_ALLOCATOR(BasicScriptChecker, AZ::SystemAllocator, 0); - - // eat a script and export any errors: - void ConsumeScript ( - }; - } - -#endif diff --git a/Code/Tools/LuaIDE/Source/LUA/LUADebuggerMessages.h b/Code/Tools/LuaIDE/Source/LUA/LUADebuggerMessages.h deleted file mode 100644 index d35be7574a..0000000000 --- a/Code/Tools/LuaIDE/Source/LUA/LUADebuggerMessages.h +++ /dev/null @@ -1,35 +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 - * - */ - -#ifndef LUADEBUGGER_API_H -#define LUADEBUGGER_API_H - -#include -#include - -#pragma once - -namespace LUADebugger -{ - class Messages - : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // Bus configuration - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; // we have one bus that we always broadcast to - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ:: EBusHandlerPolicy::Multiple; // we can have multiple listeners. - ////////////////////////////////////////////////////////////////////////// - typedef AZ::EBus Bus; - typedef Bus::Handler Handler; - - virtual ~Messages() {} - }; -}; - -#endif//LUADEBUGGER_API_H diff --git a/Code/Tools/LuaIDE/Source/LUA/LUATargetContextTrackerMessages.cpp b/Code/Tools/LuaIDE/Source/LUA/LUATargetContextTrackerMessages.cpp deleted file mode 100644 index a54135993d..0000000000 --- a/Code/Tools/LuaIDE/Source/LUA/LUATargetContextTrackerMessages.cpp +++ /dev/null @@ -1,15 +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 - * - */ - -#include -#include "LUATargetContextTrackerMessages.h" - - -namespace LUAEditor -{ -} diff --git a/Code/Tools/LuaIDE/Source/LUA/ScriptCheckerAPI.h b/Code/Tools/LuaIDE/Source/LUA/ScriptCheckerAPI.h deleted file mode 100644 index 30f912d4d2..0000000000 --- a/Code/Tools/LuaIDE/Source/LUA/ScriptCheckerAPI.h +++ /dev/null @@ -1,40 +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 - * - */ - -#ifndef SCRIPTCHECKER_H -#define SCRIPTCHECKER_H - -#include -#include - - -namespace LUAEditor -{ - class ScriptCheckerRequests - : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // Bus configuration - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ:: EBusHandlerPolicy::Single; - ////////////////////////////////////////////////////////////////////////// - typedef AZ::EBus Bus; - typedef Bus::Handler Handler; - - virtual void StartScriptingCheck(const BreakpointMap& uniqueBreakpoints) = 0; - virtual void BreakpointHit(const Breakpoint& bp) = 0; - virtual void BreakpointResume() = 0; - - virtual ~ScriptCheckerRequests() {} - }; -} - -#pragma once - -#endif diff --git a/Code/Tools/LuaIDE/Source/StandaloneToolsApplication.cpp b/Code/Tools/LuaIDE/Source/StandaloneToolsApplication.cpp index 6f7f2e8705..f9dac47dc5 100644 --- a/Code/Tools/LuaIDE/Source/StandaloneToolsApplication.cpp +++ b/Code/Tools/LuaIDE/Source/StandaloneToolsApplication.cpp @@ -8,9 +8,6 @@ #include "StandaloneToolsApplication.h" -#include -#include - #include #include #include @@ -38,7 +35,6 @@ namespace StandaloneTools { LegacyFramework::Application::RegisterCoreComponents(); - RegisterComponentDescriptor(Telemetry::TelemetryComponent::CreateDescriptor()); RegisterComponentDescriptor(LegacyFramework::IPCComponent::CreateDescriptor()); RegisterComponentDescriptor(AZ::UserSettingsComponent::CreateDescriptor()); @@ -62,7 +58,6 @@ namespace StandaloneTools EnsureComponentCreated(AZ::StreamerComponent::RTTI_Type()); EnsureComponentCreated(AZ::JobManagerComponent::RTTI_Type()); - EnsureComponentCreated(Telemetry::TelemetryComponent::RTTI_Type()); EnsureComponentCreated(AzFramework::TargetManagementComponent::RTTI_Type()); EnsureComponentCreated(LegacyFramework::IPCComponent::RTTI_Type()); @@ -90,14 +85,8 @@ namespace StandaloneTools void BaseApplication::OnApplicationEntityActivated() { - const int k_processIntervalInSecs = 2; - const bool doSDKInitShutdown = true; - EBUS_EVENT(Telemetry::TelemetryEventsBus, Initialize, "O3DE_IDE", k_processIntervalInSecs, doSDKInitShutdown); - - bool launched = LaunchDiscoveryService(); - + [[maybe_unused]] bool launched = LaunchDiscoveryService(); AZ_Warning("EditorApplication", launched, "Could not launch GridHub; Only replay is available."); - (void)launched; } void BaseApplication::SetSettingsRegistrySpecializations(AZ::SettingsRegistryInterface::Specializations& specializations) diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryBus.h b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryBus.h deleted file mode 100644 index 9c7e9aa10d..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryBus.h +++ /dev/null @@ -1,31 +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 - * - */ -#pragma once -#ifndef TELEMETRY_TELEMETRYBUS_H -#define TELEMETRY_TELEMETRYBUS_H - -#include - -#include "Source/Telemetry/TelemetryEvent.h" - -namespace Telemetry -{ - class TelemetryComponent; - - class TelemetryEvents - : public AZ::EBusTraits - { - public: - virtual void Initialize(const char* applicationName, AZ::u32 processIntervalInSecs, bool doSDKInitShutdown) = 0; - virtual void LogEvent(const TelemetryEvent& event) = 0; - virtual void Shutdown() = 0; - }; - - typedef AZ::EBus TelemetryEventsBus; -} -#endif diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.cpp b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.cpp deleted file mode 100644 index 84519b8114..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.cpp +++ /dev/null @@ -1,48 +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 - * - */ -#include "TelemetryComponent.h" - -#include - -namespace Telemetry -{ - void TelemetryComponent::Reflect(AZ::ReflectContext* context) - { - AZ::SerializeContext* serialize = azrtti_cast(context); - - if (serialize) - { - serialize->Class() - ->Version(1) - ; - } - } - - void TelemetryComponent::Activate() - { - TelemetryEventsBus::Handler::BusConnect(); - } - - void TelemetryComponent::Deactivate() - { - Shutdown(); - TelemetryEventsBus::Handler::BusDisconnect(); - } - - void TelemetryComponent::Initialize([[maybe_unused]] const char* applicationName, [[maybe_unused]] AZ::u32 processInterval, [[maybe_unused]] bool doAPIInitShutdown) - { - } - - void TelemetryComponent::LogEvent([[maybe_unused]] const TelemetryEvent& telemetryEvent) - { - } - - void TelemetryComponent::Shutdown() - { - } -} diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.h b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.h deleted file mode 100644 index f924908ea2..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.h +++ /dev/null @@ -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 - * - */ - -#pragma once - -#include -#include - -#include "TelemetryBus.h" - -namespace Telemetry -{ - class TelemetryComponent - : public AZ::Component - , public TelemetryEventsBus::Handler - { - public: - AZ_COMPONENT(TelemetryComponent, "{CE41EE3C-AF98-4B22-BA7C-2D425D1F468A}") - - TelemetryComponent() = default; - - ////////////////// - // AZ::Component - void Activate() override; - void Deactivate() override; - static void Reflect(AZ::ReflectContext* context); - ////////////////// - - ////////////////////////////////////////// - // Telemetry::TelemetryEventBus::Handler - void Initialize(const char* applicationName, AZ::u32 processIntervalInSeconds, bool doSDKInitShutdown) override; - void LogEvent(const TelemetryEvent& event) override; - void Shutdown() override; - ////////////////////////////////////////// - }; -} diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.cpp b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.cpp deleted file mode 100644 index 24dc381ad7..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.cpp +++ /dev/null @@ -1,80 +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 - * - */ -#include "TelemetryEvent.h" - -#include "TelemetryBus.h" - -namespace Telemetry -{ - TelemetryEvent::TelemetryEvent(const char* eventName) - : m_eventName(eventName) - { - } - - void TelemetryEvent::SetAttribute(const AZStd::string& name, const AZStd::string& value) - { - m_attributes[name] = value; - } - - const AZStd::string& TelemetryEvent::GetAttribute(const AZStd::string& name) - { - static AZStd::string k_emptyString; - - AZStd::unordered_map< AZStd::string, AZStd::string >::iterator attributeIter = m_attributes.find(name); - - if (attributeIter != m_attributes.end()) - { - return attributeIter->second; - } - - return k_emptyString; - } - - void TelemetryEvent::SetMetric(const AZStd::string& name, double metric) - { - m_metrics[name] = metric; - } - - double TelemetryEvent::GetMetric(const AZStd::string& name) - { - AZStd::unordered_map< AZStd::string, double >::iterator metricIter = m_metrics.find(name); - - if (metricIter != m_metrics.end()) - { - return metricIter->second; - } - - return 0.0; - } - - void TelemetryEvent::Log() - { - EBUS_EVENT(TelemetryEventsBus, LogEvent, (*this)); - } - - void TelemetryEvent::ResetEvent() - { - m_metrics.clear(); - m_attributes.clear(); - } - - const char* TelemetryEvent::GetEventName() const - { - return m_eventName.c_str(); - } - - const TelemetryEvent::AttributesMap& TelemetryEvent::GetAttributes() const - { - return m_attributes; - } - - const TelemetryEvent::MetricsMap& TelemetryEvent::GetMetrics() const - { - return m_metrics; - } -} diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.h b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.h deleted file mode 100644 index f7ffed824b..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.h +++ /dev/null @@ -1,45 +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 - * - */ - -#ifndef TELEMETRY_TELEMETRYEVENT_H -#define TELEMETRY_TELEMETRYEVENT_H - -#include -#include - -namespace Telemetry -{ - class TelemetryEvent - { - public: - typedef AZStd::unordered_map< AZStd::string, AZStd::string > AttributesMap; - typedef AZStd::unordered_map< AZStd::string, double > MetricsMap; - - TelemetryEvent(const char* eventName); - - void SetAttribute(const AZStd::string& name, const AZStd::string& value); - const AZStd::string& GetAttribute(const AZStd::string& name); - - void SetMetric(const AZStd::string& name, double metric); - double GetMetric(const AZStd::string& name); - - void Log(); - void ResetEvent(); - - const char* GetEventName() const; - const AttributesMap& GetAttributes() const; - const MetricsMap& GetMetrics() const; - - private: - AZStd::string m_eventName; - AttributesMap m_attributes; - MetricsMap m_metrics; - }; -} - -#endif diff --git a/Code/Tools/LuaIDE/lua_ide_files.cmake b/Code/Tools/LuaIDE/lua_ide_files.cmake index 1506e45c88..26b40372d3 100644 --- a/Code/Tools/LuaIDE/lua_ide_files.cmake +++ b/Code/Tools/LuaIDE/lua_ide_files.cmake @@ -9,17 +9,11 @@ set(FILES Source/StandaloneToolsApplication.cpp Source/StandaloneToolsApplication.h - Source/Telemetry/TelemetryBus.h - Source/Telemetry/TelemetryComponent.cpp - Source/Telemetry/TelemetryComponent.h - Source/Telemetry/TelemetryEvent.cpp - Source/Telemetry/TelemetryEvent.h Source/LuaIDEApplication.h Source/LuaIDEApplication.cpp Source/AssetDatabaseLocationListener.h Source/AssetDatabaseLocationListener.cpp Source/Editor/LuaEditor.cpp - Source/LUA/BasicScriptChecker.h Source/LUA/BreakpointPanel.cpp Source/LUA/BreakpointPanel.hxx Source/LUA/ClassReferenceFilter.cpp @@ -33,7 +27,6 @@ set(FILES Source/LUA/LUAContextControlMessages.h Source/LUA/LUADebuggerComponent.cpp Source/LUA/LUADebuggerComponent.h - Source/LUA/LUADebuggerMessages.h Source/LUA/LUAEditorBlockState.h Source/LUA/LUAEditorBreakpointWidget.cpp Source/LUA/LUAEditorBreakpointWidget.hxx @@ -71,10 +64,8 @@ set(FILES Source/LUA/LUAEditorViewMessages.h Source/LUA/LUALocalsTrackerMessages.h Source/LUA/LUAStackTrackerMessages.h - Source/LUA/LUATargetContextTrackerMessages.cpp Source/LUA/LUATargetContextTrackerMessages.h Source/LUA/LUAWatchesDebuggerMessages.h - Source/LUA/ScriptCheckerAPI.h Source/LUA/StackPanel.cpp Source/LUA/StackPanel.hxx Source/LUA/TargetContextButton.cpp From e4122bff2277778a3961340a78c8ae4216a8d574 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 15 Dec 2021 13:52:32 -0800 Subject: [PATCH 237/620] Removes unused files from TestImpactFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../TestImpactTestTargetMetaArtifactFactory.h | 21 -- .../TestImpactBuildTargetDescriptor.cpp | 18 -- .../Static/TestImpactBuildTargetDescriptor.h | 1 - .../Run/TestImpactInstrumentedTestRunner.cpp | 1 - .../Run/TestImpactTestRunSerializer.cpp | 180 ------------------ .../Run/TestImpactTestRunSerializer.h | 22 --- .../TestEngine/Run/TestImpactTestRunner.cpp | 1 - .../testimpactframework_runtime_files.cmake | 3 - 8 files changed, 247 deletions(-) delete mode 100644 Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Factory/TestImpactTestTargetMetaArtifactFactory.h delete mode 100644 Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.cpp delete mode 100644 Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.cpp delete mode 100644 Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.h diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Factory/TestImpactTestTargetMetaArtifactFactory.h b/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Factory/TestImpactTestTargetMetaArtifactFactory.h deleted file mode 100644 index d9d844805e..0000000000 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Factory/TestImpactTestTargetMetaArtifactFactory.h +++ /dev/null @@ -1,21 +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 - * - */ - -#pragma once - -#include - -#include - -namespace TestImpact -{ - //! Constructs a list of test target meta-data artifacts from the specified master test list data. - //! @param masterTestListData The raw master test list data in JSON format. - //! @return The constructed list of test target meta-data artifacts. - TestTargetMetas TestTargetMetaMapFactory(const AZStd::string& masterTestListData); -} // namespace TestImpact diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.cpp deleted file mode 100644 index f0cf8fadae..0000000000 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.cpp +++ /dev/null @@ -1,18 +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 - * - */ - -#include - -namespace TestImpact -{ - BuildTargetDescriptor::BuildTargetDescriptor(BuildMetaData&& buildMetaData, TargetSources&& sources) - : m_buildMetaData(AZStd::move(buildMetaData)) - , m_sources(AZStd::move(sources)) - { - } -} // namespace TestImpact diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.h b/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.h index 20012835aa..c42c36d624 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.h +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.h @@ -44,7 +44,6 @@ namespace TestImpact struct BuildTargetDescriptor { BuildTargetDescriptor() = default; - BuildTargetDescriptor(BuildMetaData&& buildMetaData, TargetSources&& sources); BuildMetaData m_buildMetaData; TargetSources m_sources; diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactInstrumentedTestRunner.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactInstrumentedTestRunner.cpp index 51a3445a53..c4cb7fa779 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactInstrumentedTestRunner.cpp +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactInstrumentedTestRunner.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.cpp deleted file mode 100644 index 5e385c9c12..0000000000 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.cpp +++ /dev/null @@ -1,180 +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 - * - */ - -#include -#include - -#include -#include -#include -#include - -namespace TestImpact -{ - namespace TestRunFields - { - // Keys for pertinent JSON node and attribute names - constexpr const char* Keys[] = - { - "suites", - "name", - "enabled", - "tests", - "duration", - "status", - "result" - }; - - enum - { - SuitesKey, - NameKey, - EnabledKey, - TestsKey, - DurationKey, - StatusKey, - ResultKey - }; - } // namespace - - AZStd::string SerializeTestRun(const TestRun& testRun) - { - rapidjson::StringBuffer stringBuffer; - rapidjson::PrettyWriter writer(stringBuffer); - - // Run - writer.StartObject(); - - // Run duration - writer.Key(TestRunFields::Keys[TestRunFields::DurationKey]); - writer.Uint(static_cast(testRun.GetDuration().count())); - - // Suites - writer.Key(TestRunFields::Keys[TestRunFields::SuitesKey]); - writer.StartArray(); - - for (const auto& suite : testRun.GetTestSuites()) - { - // Suite - writer.StartObject(); - - // Suite name - writer.Key(TestRunFields::Keys[TestRunFields::NameKey]); - writer.String(suite.m_name.c_str()); - - // Suite duration - writer.Key(TestRunFields::Keys[TestRunFields::DurationKey]); - writer.Uint(static_cast(suite.m_duration.count())); - - // Suite enabled - writer.Key(TestRunFields::Keys[TestRunFields::EnabledKey]); - writer.Bool(suite.m_enabled); - - // Suite tests - writer.Key(TestRunFields::Keys[TestRunFields::TestsKey]); - writer.StartArray(); - for (const auto& test : suite.m_tests) - { - // Test - writer.StartObject(); - - // Test name - writer.Key(TestRunFields::Keys[TestRunFields::NameKey]); - writer.String(test.m_name.c_str()); - - // Test enabled - writer.Key(TestRunFields::Keys[TestRunFields::EnabledKey]); - writer.Bool(test.m_enabled); - - // Test duration - writer.Key(TestRunFields::Keys[TestRunFields::DurationKey]); - writer.Uint(static_cast(test.m_duration.count())); - - // Test status - writer.Key(TestRunFields::Keys[TestRunFields::StatusKey]); - writer.Bool(static_cast(test.m_status)); - - // Test result - if (test.m_status == TestRunStatus::Run) - { - writer.Key(TestRunFields::Keys[TestRunFields::ResultKey]); - writer.Bool(static_cast(test.m_result.value())); - } - else - { - writer.Key(TestRunFields::Keys[TestRunFields::ResultKey]); - writer.Null(); - } - - // End test - writer.EndObject(); - } - - // End tests - writer.EndArray(); - - // End suite - writer.EndObject(); - } - - // End suites - writer.EndArray(); - - // End run - writer.EndObject(); - - return stringBuffer.GetString(); - } - - TestRun DeserializeTestRun(const AZStd::string& testEnumString) - { - AZStd::vector testSuites; - rapidjson::Document doc; - - if (doc.Parse<0>(testEnumString.c_str()).HasParseError()) - { - throw TestEngineException("Could not parse enumeration data"); - } - - // Run duration - const AZStd::chrono::milliseconds runDuration = AZStd::chrono::milliseconds{doc[TestRunFields::Keys[TestRunFields::DurationKey]].GetUint()}; - - // Suites - for (const auto& suite : doc[TestRunFields::Keys[TestRunFields::SuitesKey]].GetArray()) - { - // Suite name - const AZStd::string name = suite[TestRunFields::Keys[TestRunFields::NameKey]].GetString(); - - // Suite duration - const AZStd::chrono::milliseconds suiteDuration = AZStd::chrono::milliseconds{suite[TestRunFields::Keys[TestRunFields::DurationKey]].GetUint()}; - - // Suite enabled - testSuites.emplace_back(TestRunSuite{ - suite[TestRunFields::Keys[TestRunFields::NameKey]].GetString(), - suite[TestRunFields::Keys[TestRunFields::EnabledKey]].GetBool(), - {}, - AZStd::chrono::milliseconds{suite[TestRunFields::Keys[TestRunFields::DurationKey]].GetUint()}}); - - // Suite tests - for (const auto& test : suite[TestRunFields::Keys[TestRunFields::TestsKey]].GetArray()) - { - AZStd::optional result; - TestRunStatus status = static_cast(test[TestRunFields::Keys[TestRunFields::StatusKey]].GetBool()); - if (status == TestRunStatus::Run) - { - result = static_cast(test[TestRunFields::Keys[TestRunFields::ResultKey]].GetBool()); - } - const AZStd::chrono::milliseconds testDuration = AZStd::chrono::milliseconds{test[TestRunFields::Keys[TestRunFields::DurationKey]].GetUint()}; - testSuites.back().m_tests.emplace_back( - TestRunCase{test[TestRunFields::Keys[TestRunFields::NameKey]].GetString(), test[TestRunFields::Keys[TestRunFields::EnabledKey]].GetBool(), result, testDuration, status}); - } - } - - return TestRun(std::move(testSuites), runDuration); - } -} // namespace TestImpact diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.h b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.h deleted file mode 100644 index cf39249bb6..0000000000 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.h +++ /dev/null @@ -1,22 +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 - * - */ - -#pragma once - -#include - -#include - -namespace TestImpact -{ - //! Serializes the specified test run to JSON format. - AZStd::string SerializeTestRun(const TestRun& testRun); - - //! Deserializes a test run from the specified test run data in JSON format. - TestRun DeserializeTestRun(const AZStd::string& testRunString); -} // namespace TestImpact diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunner.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunner.cpp index 28c38d05d4..c27a26ca4c 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunner.cpp +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunner.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_files.cmake b/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_files.cmake index 75f253ad27..a55df20d34 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_files.cmake +++ b/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_files.cmake @@ -35,7 +35,6 @@ set(FILES Source/Artifact/Factory/TestImpactTestTargetMetaMapFactory.h Source/Artifact/Factory/TestImpactModuleCoverageFactory.cpp Source/Artifact/Factory/TestImpactModuleCoverageFactory.h - Source/Artifact/Static/TestImpactBuildTargetDescriptor.cpp Source/Artifact/Static/TestImpactBuildTargetDescriptor.h Source/Artifact/Static/TestImpactTargetDescriptorCompiler.cpp Source/Artifact/Static/TestImpactTargetDescriptorCompiler.h @@ -90,8 +89,6 @@ set(FILES Source/TestEngine/Enumeration/TestImpactTestEnumerationSerializer.h Source/TestEngine/Enumeration/TestImpactTestEnumerator.cpp Source/TestEngine/Enumeration/TestImpactTestEnumerator.h - Source/TestEngine/Run/TestImpactTestRunSerializer.cpp - Source/TestEngine/Run/TestImpactTestRunSerializer.h Source/TestEngine/Run/TestImpactTestRunner.cpp Source/TestEngine/Run/TestImpactTestRunner.h Source/TestEngine/Run/TestImpactInstrumentedTestRunner.cpp From df0b97591a9bd904705297a06486dafe9c87d9e9 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 21 Dec 2021 15:38:27 -0800 Subject: [PATCH 238/620] removes unused files from AtomFont Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AtomLyIntegration/AtomFont/FBitmap.h | 65 ------------------- .../AtomLyIntegration/AtomFont/resource.h | 21 ------ .../AtomFont/Code/atomfont_files.cmake | 2 - .../Code/Source/ImguiAtomSystemComponent.cpp | 1 - 4 files changed, 89 deletions(-) delete mode 100644 Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/FBitmap.h delete mode 100644 Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/resource.h diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/FBitmap.h b/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/FBitmap.h deleted file mode 100644 index 2570fd2b17..0000000000 --- a/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/FBitmap.h +++ /dev/null @@ -1,65 +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 - * - */ - - -#pragma once - -namespace AZ -{ - class FontBitmap - { - public: - FontBitmap(); - ~FontBitmap(); - - int Blur(int iterationCount); - int Scale(float scaleX, float scaleY); - - int BlitFrom(FontBitmap* source, int srcX, int srcY, int destX, int destY, int width, int height); - int BlitTo(FontBitmap* destination, int destX, int destY, int srcX, int srcY, int width, int height); - - int Create(int width, int height); - int Release(); - - int SaveBitmap(const AZStd::string& fileName); - int Get32Bpp(unsigned int** buffer) - { - (*buffer) = new unsigned int[m_width * m_height]; - - if (!(*buffer)) - { - return 0; - } - - int dataSize = m_width * m_height; - - for (int i = 0; i < dataSize; i++) - { - (*buffer)[i] = (m_data[i] << 24) | (m_data[i] << 16) | (m_data[i] << 8) | (m_data[i]); - } - - return 1; - } - - int GetWidth() { return m_width; } - int GetHeight() { return m_height; } - - void SetRenderData(void* renderData) { m_renderData = renderData; }; - void* GetRenderData() { return m_renderData; }; - - unsigned char* GetData() { return m_data; } - - public: - - int m_width; - int m_height; - - unsigned char* m_data; - void* m_renderData; - }; -} diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/resource.h b/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/resource.h deleted file mode 100644 index eb3d76bc60..0000000000 --- a/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/resource.h +++ /dev/null @@ -1,21 +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 - * - */ - - -#define VS_VERSION_INFO 1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/Gems/AtomLyIntegration/AtomFont/Code/atomfont_files.cmake b/Gems/AtomLyIntegration/AtomFont/Code/atomfont_files.cmake index f12dc84f90..bf1f819d6b 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/atomfont_files.cmake +++ b/Gems/AtomLyIntegration/AtomFont/Code/atomfont_files.cmake @@ -20,7 +20,6 @@ set(FILES Source/AtomNullFont.cpp Source/Module.cpp Include/AtomLyIntegration/AtomFont/AtomFont.h - Include/AtomLyIntegration/AtomFont/FBitmap.h Include/AtomLyIntegration/AtomFont/FFont.h Include/AtomLyIntegration/AtomFont/FontRenderer.h Include/AtomLyIntegration/AtomFont/FontCommon.h @@ -28,5 +27,4 @@ set(FILES Include/AtomLyIntegration/AtomFont/GlyphBitmap.h Include/AtomLyIntegration/AtomFont/GlyphCache.h Include/AtomLyIntegration/AtomFont/AtomNullFont.h - Include/AtomLyIntegration/AtomFont/resource.h ) diff --git a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp index 700d930482..2c2963c5af 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp +++ b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include From bba337df5ea1577ef482901bd67350eff2d13d56 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:00:27 -0800 Subject: [PATCH 239/620] Removes unused files from Gems/AudioSystem Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Tests/AudioSystemTest.cpp | 1 - .../Mocks/IAudioSystemImplementationMock.h | 136 - .../Code/Tests/WaveTable48000Sine.h | 48015 ---------------- .../Code/audiosystem_tests_files.cmake | 1 - 4 files changed, 48153 deletions(-) delete mode 100644 Gems/AudioSystem/Code/Tests/Mocks/IAudioSystemImplementationMock.h delete mode 100644 Gems/AudioSystem/Code/Tests/WaveTable48000Sine.h diff --git a/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp b/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp index 1f03eec419..32179b2120 100644 --- a/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp +++ b/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include diff --git a/Gems/AudioSystem/Code/Tests/Mocks/IAudioSystemImplementationMock.h b/Gems/AudioSystem/Code/Tests/Mocks/IAudioSystemImplementationMock.h deleted file mode 100644 index b6f68fc896..0000000000 --- a/Gems/AudioSystem/Code/Tests/Mocks/IAudioSystemImplementationMock.h +++ /dev/null @@ -1,136 +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 - * - */ - -#pragma once - -#include -#include - - -namespace Audio -{ - struct AudioSystemImplementationMock - : public AudioSystemImplementation - { - public: - MOCK_METHOD1(Update, void(float)); - - MOCK_METHOD0(Initialize, EAudioRequestStatus()); - - MOCK_METHOD0(ShutDown, EAudioRequestStatus()); - - MOCK_METHOD0(Release, EAudioRequestStatus()); - - MOCK_METHOD0(OnAudioSystemRefresh, void()); - - MOCK_METHOD0(OnLoseFocus, EAudioRequestStatus()); - - MOCK_METHOD0(OnGetFocus, EAudioRequestStatus()); - - MOCK_METHOD0(MuteAll, EAudioRequestStatus()); - - MOCK_METHOD0(UnmuteAll, EAudioRequestStatus()); - - MOCK_METHOD0(StopAllSounds, EAudioRequestStatus()); - - MOCK_METHOD2(RegisterAudioObject, EAudioRequestStatus(IATLAudioObjectData*, const char*)); - - MOCK_METHOD1(RegisterAudioObject, EAudioRequestStatus(IATLAudioObjectData*)); - - MOCK_METHOD1(UnregisterAudioObject, EAudioRequestStatus(IATLAudioObjectData*)); - - MOCK_METHOD1(ResetAudioObject, EAudioRequestStatus(IATLAudioObjectData*)); - - MOCK_METHOD1(UpdateAudioObject, EAudioRequestStatus(IATLAudioObjectData*)); - - MOCK_METHOD2(PrepareTriggerSync, EAudioRequestStatus(IATLAudioObjectData*, const IATLTriggerImplData*)); - - MOCK_METHOD2(UnprepareTriggerSync, EAudioRequestStatus(IATLAudioObjectData*, const IATLTriggerImplData*)); - - MOCK_METHOD3(PrepareTriggerAsync, EAudioRequestStatus(IATLAudioObjectData*, const IATLTriggerImplData*, IATLEventData*)); - - MOCK_METHOD3(UnprepareTriggerAsync, EAudioRequestStatus(IATLAudioObjectData*, const IATLTriggerImplData*, IATLEventData*)); - - MOCK_METHOD4(ActivateTrigger, EAudioRequestStatus(IATLAudioObjectData*, const IATLTriggerImplData*, IATLEventData*, const SATLSourceData*)); - - MOCK_METHOD2(StopEvent, EAudioRequestStatus(IATLAudioObjectData*, const IATLEventData*)); - - MOCK_METHOD1(StopAllEvents, EAudioRequestStatus(IATLAudioObjectData*)); - - MOCK_METHOD2(SetPosition, EAudioRequestStatus(IATLAudioObjectData*, const SATLWorldPosition&)); - - MOCK_METHOD2(SetMultiplePositions, EAudioRequestStatus(IATLAudioObjectData*, const MultiPositionParams&)); - - MOCK_METHOD3(SetRtpc, EAudioRequestStatus(IATLAudioObjectData*, const IATLRtpcImplData*, float)); - - MOCK_METHOD2(SetSwitchState, EAudioRequestStatus(IATLAudioObjectData*, const IATLSwitchStateImplData*)); - - MOCK_METHOD3(SetObstructionOcclusion, EAudioRequestStatus(IATLAudioObjectData*, float, float)); - - MOCK_METHOD3(SetEnvironment, EAudioRequestStatus(IATLAudioObjectData*, const IATLEnvironmentImplData*, float)); - - MOCK_METHOD2(SetListenerPosition, EAudioRequestStatus(IATLListenerData*, const SATLWorldPosition&)); - - MOCK_METHOD1(RegisterInMemoryFile, EAudioRequestStatus(SATLAudioFileEntryInfo*)); - - MOCK_METHOD1(UnregisterInMemoryFile, EAudioRequestStatus(SATLAudioFileEntryInfo*)); - - MOCK_METHOD2(ParseAudioFileEntry, EAudioRequestStatus(const AZ::rapidxml::xml_node*, SATLAudioFileEntryInfo*)); - - MOCK_METHOD1(DeleteAudioFileEntryData, void(IATLAudioFileEntryData*)); - - MOCK_METHOD1(GetAudioFileLocation, const char* const(SATLAudioFileEntryInfo*)); - - MOCK_METHOD1(NewAudioTriggerImplData, IATLTriggerImplData*(const AZ::rapidxml::xml_node*)); - - MOCK_METHOD1(DeleteAudioTriggerImplData, void(IATLTriggerImplData*)); - - MOCK_METHOD1(NewAudioRtpcImplData, IATLRtpcImplData*(const AZ::rapidxml::xml_node*)); - - MOCK_METHOD1(DeleteAudioRtpcImplData, void(IATLRtpcImplData*)); - - MOCK_METHOD1(NewAudioSwitchStateImplData, IATLSwitchStateImplData*(const AZ::rapidxml::xml_node*)); - - MOCK_METHOD1(DeleteAudioSwitchStateImplData, void(IATLSwitchStateImplData*)); - - MOCK_METHOD1(NewAudioEnvironmentImplData, IATLEnvironmentImplData*(const AZ::rapidxml::xml_node*)); - - MOCK_METHOD1(DeleteAudioEnvironmentImplData, void(IATLEnvironmentImplData*)); - - MOCK_METHOD1(NewGlobalAudioObjectData, IATLAudioObjectData*(TAudioObjectID)); - - MOCK_METHOD1(NewAudioObjectData, IATLAudioObjectData*(TAudioObjectID)); - - MOCK_METHOD1(DeleteAudioObjectData, void(IATLAudioObjectData*)); - - MOCK_METHOD1(NewDefaultAudioListenerObjectData, IATLListenerData*(TATLIDType)); - - MOCK_METHOD1(NewAudioListenerObjectData, IATLListenerData*(TATLIDType)); - - MOCK_METHOD1(DeleteAudioListenerObjectData, void(IATLListenerData*)); - - MOCK_METHOD1(NewAudioEventData, IATLEventData*(TAudioEventID)); - - MOCK_METHOD1(DeleteAudioEventData, void(IATLEventData*)); - - MOCK_METHOD1(ResetAudioEventData, void(IATLEventData*)); - - MOCK_METHOD1(SetLanguage, void(const char*)); - - MOCK_CONST_METHOD0(GetImplSubPath, const char* const()); - - MOCK_CONST_METHOD0(GetImplementationNameString, const char* const()); - - MOCK_CONST_METHOD1(GetMemoryInfo, void(SAudioImplMemoryInfo&)); - - MOCK_METHOD1(CreateAudioSource, bool(const SAudioInputConfig&)); - - MOCK_METHOD1(DestroyAudioSource, void(TAudioSourceId)); - }; - -} // namespace Audio diff --git a/Gems/AudioSystem/Code/Tests/WaveTable48000Sine.h b/Gems/AudioSystem/Code/Tests/WaveTable48000Sine.h deleted file mode 100644 index bc2cc6ee74..0000000000 --- a/Gems/AudioSystem/Code/Tests/WaveTable48000Sine.h +++ /dev/null @@ -1,48015 +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 - * - */ - -#pragma once -namespace WaveTable -{ - static const std::size_t TABLE_SIZE = 48000; - static const float g_sineTable[TABLE_SIZE] = { - 0.0f, - 0.00013089969352575288f, - 0.0002617993848085749f, - 0.00039269907160553524f, - 0.0005235987516737029f, - 0.0006544984227701477f, - 0.0007853980826519387f, - 0.0009162977290761456f, - 0.0010471973597998385f, - 0.0011780969725800877f, - 0.0013089965651739636f, - 0.0014398961353385368f, - 0.001570795680830879f, - 0.001701695199408061f, - 0.001832594688827156f, - 0.001963494146845236f, - 0.002094393571219374f, - 0.0022252929597066447f, - 0.002356192310064121f, - 0.002487091620048879f, - 0.002617990887417994f, - 0.002748890109928542f, - 0.002879789285337601f, - 0.003010688411402248f, - 0.0031415874858795635f, - 0.003272486506526625f, - 0.003403385471100515f, - 0.0035342843773583143f, - 0.003665183223057106f, - 0.003796082005953973f, - 0.003926980723806f, - 0.004057879374370274f, - 0.0041887779554038804f, - 0.004319676464663909f, - 0.004450574899907449f, - 0.004581473258891589f, - 0.004712371539373423f, - 0.004843269739110043f, - 0.004974167855858545f, - 0.005105065887376025f, - 0.0052359638314195805f, - 0.005366861685746309f, - 0.0054977594481133134f, - 0.005628657116277695f, - 0.005759554687996557f, - 0.005890452161027005f, - 0.006021349533126148f, - 0.006152246802051093f, - 0.006283143965558951f, - 0.0064140410214068334f, - 0.006544937967351858f, - 0.006675834801151138f, - 0.0068067315205617915f, - 0.00693762812334094f, - 0.007068524607245704f, - 0.007199420970033209f, - 0.007330317209460581f, - 0.007461213323284948f, - 0.007592109309263441f, - 0.0077230051651531895f, - 0.007853900888711334f, - 0.007984796477695006f, - 0.008115691929861349f, - 0.008246587242967505f, - 0.008377482414770612f, - 0.008508377443027825f, - 0.008639272325496288f, - 0.008770167059933153f, - 0.008901061644095577f, - 0.009031956075740713f, - 0.009162850352625722f, - 0.009293744472507763f, - 0.009424638433144006f, - 0.009555532232291615f, - 0.009686425867707762f, - 0.009817319337149617f, - 0.009948212638374358f, - 0.010079105769139163f, - 0.010209998727201214f, - 0.010340891510317696f, - 0.010471784116245794f, - 0.0106026765427427f, - 0.010733568787565609f, - 0.010864460848471714f, - 0.010995352723218221f, - 0.011126244409562329f, - 0.011257135905261244f, - 0.011388027208072178f, - 0.01151891831575234f, - 0.01164980922605895f, - 0.011780699936749225f, - 0.011911590445580392f, - 0.012042480750309672f, - 0.012173370848694298f, - 0.012304260738491505f, - 0.012435150417458529f, - 0.012566039883352607f, - 0.012696929133930989f, - 0.012827818166950918f, - 0.012958706980169652f, - 0.01308959557134444f, - 0.013220483938232544f, - 0.01335137207859123f, - 0.013482259990177761f, - 0.013613147670749408f, - 0.013744035118063451f, - 0.013874922329877162f, - 0.014005809303947826f, - 0.014136696038032732f, - 0.014267582529889175f, - 0.014398468777274442f, - 0.01452935477794584f, - 0.014660240529660666f, - 0.014791126030176233f, - 0.014922011277249849f, - 0.015052896268638833f, - 0.01518378100210051f, - 0.015314665475392198f, - 0.01544554968627123f, - 0.015576433632494946f, - 0.015707317311820675f, - 0.015838200722005768f, - 0.015969083860807566f, - 0.016099966725983433f, - 0.016230849315290716f, - 0.01636173162648678f, - 0.016492613657328997f, - 0.01662349540557473f, - 0.01675437686898136f, - 0.01688525804530627f, - 0.01701613893230685f, - 0.01714701952774048f, - 0.017277899829364566f, - 0.017408779834936508f, - 0.017539659542213707f, - 0.017670538948953582f, - 0.017801418052913544f, - 0.017932296851851017f, - 0.018063175343523426f, - 0.018194053525688206f, - 0.018324931396102796f, - 0.018455808952524636f, - 0.018586686192711175f, - 0.018717563114419872f, - 0.018848439715408175f, - 0.018979315993433558f, - 0.01911019194625349f, - 0.01924106757162545f, - 0.019371942867306906f, - 0.01950281783105536f, - 0.0196336924606283f, - 0.019764566753783224f, - 0.01989544070827764f, - 0.020026314321869045f, - 0.02015718759231497f, - 0.02028806051737293f, - 0.020418933094800456f, - 0.020549805322355078f, - 0.020680677197794338f, - 0.02081154871887578f, - 0.02094241988335696f, - 0.02107329068899543f, - 0.021204161133548758f, - 0.021335031214774515f, - 0.021465900930430278f, - 0.02159677027827362f, - 0.021727639256062144f, - 0.021858507861553442f, - 0.021989376092505106f, - 0.022120243946674754f, - 0.022251111421820003f, - 0.022381978515698467f, - 0.022512845226067772f, - 0.022643711550685557f, - 0.022774577487309464f, - 0.02290544303369714f, - 0.02303630818760623f, - 0.02316717294679441f, - 0.023298037309019342f, - 0.023428901272038692f, - 0.02355976483361015f, - 0.02369062799149141f, - 0.02382149074344015f, - 0.023952353087214086f, - 0.02408321502057092f, - 0.02421407654126838f, - 0.02434493764706417f, - 0.024475798335716035f, - 0.024606658604981707f, - 0.024737518452618935f, - 0.02486837787638546f, - 0.024999236874039054f, - 0.02513009544333748f, - 0.025260953582038507f, - 0.025391811287899916f, - 0.025522668558679504f, - 0.025653525392135054f, - 0.025784381786024383f, - 0.025915237738105296f, - 0.026046093246135604f, - 0.02617694830787315f, - 0.02630780292107576f, - 0.026438657083501262f, - 0.02656951079290753f, - 0.026700364047052408f, - 0.026831216843693755f, - 0.026962069180589455f, - 0.02709292105549738f, - 0.02722377246617542f, - 0.027354623410381484f, - 0.02748547388587346f, - 0.027616323890409262f, - 0.02774717342174682f, - 0.02787802247764405f, - 0.02800887105585891f, - 0.028139719154149326f, - 0.02827056677027325f, - 0.028401413901988654f, - 0.02853226054705351f, - 0.028663106703225777f, - 0.028793952368263466f, - 0.02892479753992456f, - 0.029055642215967056f, - 0.02918648639414897f, - 0.029317330072228334f, - 0.02944817324796316f, - 0.029579015919111502f, - 0.029709858083431386f, - 0.029840699738680886f, - 0.02997154088261806f, - 0.03010238151300097f, - 0.03023322162758771f, - 0.030364061224136367f, - 0.03049490030040503f, - 0.030625738854151822f, - 0.030756576883134854f, - 0.030887414385112243f, - 0.031018251357842138f, - 0.031149087799082674f, - 0.031279923706592f, - 0.03141075907812829f, - 0.031541593911449714f, - 0.031672428204314436f, - 0.03180326195448067f, - 0.03193409515970659f, - 0.03206492781775042f, - 0.03219575992637039f, - 0.032326591483324695f, - 0.03245742248637159f, - 0.03258825293326932f, - 0.03271908282177614f, - 0.03284991214965032f, - 0.03298074091465013f, - 0.03311156911453385f, - 0.033242396747059776f, - 0.033373223809986224f, - 0.03350405030107149f, - 0.03363487621807391f, - 0.033765701558751804f, - 0.03389652632086353f, - 0.034027350502167444f, - 0.03415817410042189f, - 0.034288997113385254f, - 0.03441981953881592f, - 0.034550641374472266f, - 0.03468146261811272f, - 0.03481228326749567f, - 0.03494310332037955f, - 0.0350739227745228f, - 0.03520474162768387f, - 0.035335559877621193f, - 0.03546637752209324f, - 0.0355971945588585f, - 0.035728010985675435f, - 0.035858826800302564f, - 0.035989642000498374f, - 0.0361204565840214f, - 0.03625127054863016f, - 0.03638208389208319f, - 0.03651289661213904f, - 0.036643708706556276f, - 0.036774520173093454f, - 0.03690533100950918f, - 0.03703614121356202f, - 0.03716695078301058f, - 0.037297759715613485f, - 0.03742856800912936f, - 0.03755937566131683f, - 0.03769018266993454f, - 0.03782098903274115f, - 0.03795179474749534f, - 0.03808259981195578f, - 0.03821340422388115f, - 0.03834420798103017f, - 0.038475011081161546f, - 0.038605813522034f, - 0.03873661530140627f, - 0.03886741641703711f, - 0.03899821686668525f, - 0.0391290166481095f, - 0.03925981575906861f, - 0.03939061419732138f, - 0.039521411960626626f, - 0.03965220904674316f, - 0.03978300545342979f, - 0.039913801178445375f, - 0.04004459621954876f, - 0.04017539057449881f, - 0.0403061842410544f, - 0.0404369772169744f, - 0.04056776950001773f, - 0.040698561087943286f, - 0.040829351978509995f, - 0.040960142169476785f, - 0.041090931658602614f, - 0.041221720443646415f, - 0.04135250852236719f, - 0.04148329589252389f, - 0.04161408255187552f, - 0.0417448684981811f, - 0.04187565372919963f, - 0.042006438242690146f, - 0.042137222036411695f, - 0.04226800510812332f, - 0.0423987874555841f, - 0.04252956907655312f, - 0.04266034996878945f, - 0.04279113013005222f, - 0.04292190955810053f, - 0.04305268825069351f, - 0.04318346620559032f, - 0.043314243420550104f, - 0.043445019893332014f, - 0.04357579562169526f, - 0.04370657060339901f, - 0.04383734483620249f, - 0.0439681183178649f, - 0.044098891046145484f, - 0.04422966301880348f, - 0.044360434233598166f, - 0.04449120468828878f, - 0.04462197438063463f, - 0.044752743308395f, - 0.0448835114693292f, - 0.04501427886119656f, - 0.04514504548175642f, - 0.045275811328768116f, - 0.04540657639999101f, - 0.0455373406931845f, - 0.045668104206107944f, - 0.04579886693652077f, - 0.04592962888218238f, - 0.0460603900408522f, - 0.04619115041028969f, - 0.0463219099882543f, - 0.04645266877250549f, - 0.04658342676080276f, - 0.04671418395090559f, - 0.046844940340573495f, - 0.04697569592756601f, - 0.04710645070964266f, - 0.04723720468456301f, - 0.047367957850086614f, - 0.04749871020397305f, - 0.04762946174398193f, - 0.047760212467872855f, - 0.04789096237340543f, - 0.04802171145833931f, - 0.04815245972043413f, - 0.048283207157449576f, - 0.0484139537671453f, - 0.04854469954728101f, - 0.04867544449561641f, - 0.04880618860991122f, - 0.04893693188792517f, - 0.049067674327418015f, - 0.049198415926149514f, - 0.049329156681879455f, - 0.04945989659236761f, - 0.0495906356553738f, - 0.04972137386865785f, - 0.049852111229979595f, - 0.04998284773709888f, - 0.05011358338777558f, - 0.050244318179769556f, - 0.050375052110840715f, - 0.05050578517874898f, - 0.05063651738125424f, - 0.05076724871611646f, - 0.0508979791810956f, - 0.05102870877395161f, - 0.051159437492444476f, - 0.0512901653343342f, - 0.05142089229738081f, - 0.05155161837934431f, - 0.05168234357798477f, - 0.051813067891062235f, - 0.05194379131633677f, - 0.05207451385156847f, - 0.052205235494517464f, - 0.05233595624294383f, - 0.05246667609460773f, - 0.05259739504726932f, - 0.052728113098688745f, - 0.052858830246626194f, - 0.05298954648884189f, - 0.053120261823095996f, - 0.05325097624714877f, - 0.053381689758760474f, - 0.053512402355691324f, - 0.05364311403570163f, - 0.05377382479655166f, - 0.053904534636001734f, - 0.05403524355181216f, - 0.05416595154174331f, - 0.054296658603555495f, - 0.0544273647350091f, - 0.05455806993386453f, - 0.054688774197882165f, - 0.05481947752482241f, - 0.05495017991244575f, - 0.055080881358512586f, - 0.0552115818607834f, - 0.05534228141701868f, - 0.05547298002497891f, - 0.055603677682424614f, - 0.05573437438711633f, - 0.055865070136814604f, - 0.05599576492927998f, - 0.05612645876227306f, - 0.056257151633554436f, - 0.05638784354088471f, - 0.05651853448202452f, - 0.05664922445473452f, - 0.05677991345677535f, - 0.05691060148590771f, - 0.057041288539892286f, - 0.0571719746164898f, - 0.057302659713460956f, - 0.05743334382856654f, - 0.05756402695956728f, - 0.057694709104223973f, - 0.05782539026029742f, - 0.05795607042554842f, - 0.05808674959773781f, - 0.05821742777462645f, - 0.05834810495397517f, - 0.05847878113354489f, - 0.05860945631109649f, - 0.0587401304843909f, - 0.05887080365118903f, - 0.05900147580925186f, - 0.05913214695634033f, - 0.05926281709021543f, - 0.05939348620863818f, - 0.059524154309369595f, - 0.0596548213901707f, - 0.05978548744880254f, - 0.05991615248302624f, - 0.060046816490602825f, - 0.06017747946929344f, - 0.060308141416859216f, - 0.06043880233106127f, - 0.06056946220966077f, - 0.06070012105041891f, - 0.06083077885109687f, - 0.060961435609455855f, - 0.06109209132325713f, - 0.061222745990261916f, - 0.06135339960823149f, - 0.06148405217492714f, - 0.06161470368811016f, - 0.06174535414554187f, - 0.06187600354498365f, - 0.062006651884196795f, - 0.062137299160942724f, - 0.06226794537298282f, - 0.062398590518078494f, - 0.06252923459399116f, - 0.06265987759848231f, - 0.06279051952931337f, - 0.06292116038424585f, - 0.06305180016104124f, - 0.06318243885746107f, - 0.06331307647126688f, - 0.06344371300022023f, - 0.06357434844208269f, - 0.06370498279461588f, - 0.06383561605558138f, - 0.06396624822274087f, - 0.06409687929385596f, - 0.06422750926668835f, - 0.06435813813899972f, - 0.06448876590855177f, - 0.06461939257310625f, - 0.0647500181304249f, - 0.06488064257826946f, - 0.06501126591440175f, - 0.06514188813658356f, - 0.06527250924257672f, - 0.06540312923014306f, - 0.06553374809704446f, - 0.0656643658410428f, - 0.06579498245989994f, - 0.06592559795137785f, - 0.06605621231323845f, - 0.0661868255432437f, - 0.06631743763915558f, - 0.06644804859873607f, - 0.0665786584197472f, - 0.06670926709995102f, - 0.06683987463710955f, - 0.06697048102898488f, - 0.06710108627333913f, - 0.0672316903679344f, - 0.06736229331053281f, - 0.06749289509889651f, - 0.0676234957307877f, - 0.06775409520396856f, - 0.0678846935162013f, - 0.06801529066524817f, - 0.06814588664887139f, - 0.06827648146483326f, - 0.06840707511089607f, - 0.06853766758482212f, - 0.06866825888437376f, - 0.06879884900731334f, - 0.06892943795140322f, - 0.06906002571440578f, - 0.0691906122940835f, - 0.06932119768819875f, - 0.069451781894514f, - 0.06958236491079174f, - 0.06971294673479446f, - 0.06984352736428466f, - 0.0699741067970249f, - 0.07010468503077771f, - 0.07023526206330569f, - 0.07036583789237144f, - 0.07049641251573754f, - 0.07062698593116667f, - 0.0707575581364215f, - 0.07088812912926466f, - 0.07101869890745888f, - 0.0711492674687669f, - 0.07127983481095142f, - 0.07141040093177523f, - 0.07154096582900113f, - 0.0716715295003919f, - 0.07180209194371036f, - 0.07193265315671939f, - 0.07206321313718184f, - 0.0721937718828606f, - 0.07232432939151857f, - 0.07245488566091872f, - 0.07258544068882397f, - 0.07271599447299729f, - 0.0728465470112017f, - 0.0729770983012002f, - 0.07310764834075585f, - 0.07323819712763169f, - 0.0733687446595908f, - 0.07349929093439629f, - 0.07362983594981132f, - 0.07376037970359897f, - 0.07389092219352245f, - 0.07402146341734493f, - 0.07415200337282965f, - 0.0742825420577398f, - 0.07441307946983869f, - 0.07454361560688955f, - 0.07467415046665571f, - 0.07480468404690047f, - 0.07493521634538716f, - 0.07506574735987918f, - 0.0751962770881399f, - 0.07532680552793272f, - 0.07545733267702107f, - 0.07558785853316843f, - 0.07571838309413825f, - 0.07584890635769402f, - 0.07597942832159926f, - 0.07610994898361757f, - 0.07624046834151242f, - 0.07637098639304746f, - 0.07650150313598628f, - 0.07663201856809251f, - 0.0767625326871298f, - 0.07689304549086184f, - 0.07702355697705233f, - 0.07715406714346495f, - 0.07728457598786351f, - 0.0774150835080117f, - 0.07754558970167338f, - 0.07767609456661233f, - 0.07780659810059236f, - 0.07793710030137735f, - 0.07806760116673121f, - 0.07819810069441781f, - 0.07832859888220106f, - 0.07845909572784494f, - 0.07858959122911342f, - 0.07872008538377047f, - 0.07885057818958013f, - 0.07898106964430644f, - 0.07911155974571346f, - 0.07924204849156528f, - 0.07937253587962599f, - 0.07950302190765976f, - 0.07963350657343073f, - 0.07976398987470307f, - 0.07989447180924097f, - 0.08002495237480871f, - 0.08015543156917052f, - 0.08028590939009063f, - 0.08041638583533338f, - 0.08054686090266312f, - 0.08067733458984412f, - 0.0808078068946408f, - 0.08093827781481755f, - 0.08106874734813876f, - 0.0811992154923689f, - 0.08132968224527241f, - 0.08146014760461379f, - 0.08159061156815754f, - 0.08172107413366822f, - 0.08185153529891036f, - 0.08198199506164856f, - 0.08211245341964743f, - 0.08224291037067158f, - 0.08237336591248569f, - 0.08250382004285442f, - 0.0826342727595425f, - 0.08276472406031463f, - 0.08289517394293557f, - 0.0830256224051701f, - 0.08315606944478302f, - 0.08328651505953917f, - 0.08341695924720335f, - 0.0835474020055405f, - 0.0836778433323155f, - 0.08380828322529323f, - 0.08393872168223869f, - 0.0840691587009168f, - 0.08419959427909263f, - 0.08433002841453112f, - 0.08446046110499739f, - 0.08459089234825647f, - 0.08472132214207344f, - 0.08485175048421345f, - 0.08498217737244167f, - 0.08511260280452321f, - 0.08524302677822329f, - 0.08537344929130715f, - 0.08550387034154003f, - 0.08563428992668717f, - 0.0857647080445139f, - 0.08589512469278551f, - 0.08602553986926739f, - 0.08615595357172488f, - 0.08628636579792337f, - 0.08641677654562831f, - 0.08654718581260512f, - 0.08667759359661928f, - 0.08680799989543628f, - 0.08693840470682167f, - 0.08706880802854099f, - 0.08719920985835979f, - 0.0873296101940437f, - 0.08746000903335832f, - 0.08759040637406931f, - 0.08772080221394238f, - 0.08785119655074317f, - 0.08798158938223746f, - 0.08811198070619097f, - 0.08824237052036951f, - 0.08837275882253885f, - 0.08850314561046486f, - 0.08863353088191339f, - 0.08876391463465029f, - 0.08889429686644151f, - 0.08902467757505297f, - 0.08915505675825063f, - 0.08928543441380046f, - 0.08941581053946852f, - 0.0895461851330208f, - 0.0896765581922234f, - 0.0898069297148424f, - 0.08993729969864393f, - 0.09006766814139411f, - 0.09019803504085915f, - 0.0903284003948052f, - 0.09045876420099855f, - 0.09058912645720539f, - 0.09071948716119202f, - 0.09084984631072475f, - 0.09098020390356992f, - 0.09111055993749385f, - 0.09124091441026297f, - 0.09137126731964366f, - 0.09150161866340238f, - 0.09163196843930557f, - 0.09176231664511976f, - 0.09189266327861144f, - 0.09202300833754715f, - 0.09215335181969346f, - 0.092283693722817f, - 0.09241403404468439f, - 0.09254437278306224f, - 0.0926747099357173f, - 0.09280504550041621f, - 0.09293537947492576f, - 0.09306571185701269f, - 0.09319604264444378f, - 0.09332637183498588f, - 0.09345669942640579f, - 0.0935870254164704f, - 0.09371734980294662f, - 0.09384767258360137f, - 0.09397799375620161f, - 0.09410831331851431f, - 0.09423863126830649f, - 0.09436894760334519f, - 0.09449926232139745f, - 0.09462957542023039f, - 0.09475988689761111f, - 0.09489019675130679f, - 0.09502050497908457f, - 0.09515081157871166f, - 0.09528111654795532f, - 0.09541141988458278f, - 0.09554172158636133f, - 0.09567202165105829f, - 0.09580232007644102f, - 0.09593261686027688f, - 0.09606291200033325f, - 0.09619320549437757f, - 0.09632349734017734f, - 0.09645378753549996f, - 0.09658407607811301f, - 0.09671436296578402f, - 0.09684464819628054f, - 0.09697493176737017f, - 0.09710521367682055f, - 0.09723549392239932f, - 0.09736577250187418f, - 0.09749604941301283f, - 0.09762632465358302f, - 0.0977565982213525f, - 0.0978868701140891f, - 0.0980171403295606f, - 0.0981474088655349f, - 0.09827767571977984f, - 0.09840794089006338f, - 0.09853820437415343f, - 0.09866846616981796f, - 0.09879872627482501f, - 0.09892898468694256f, - 0.09905924140393867f, - 0.09918949642358145f, - 0.09931974974363901f, - 0.09945000136187948f, - 0.09958025127607106f, - 0.09971049948398193f, - 0.09984074598338033f, - 0.09997099077203452f, - 0.1001012338477128f, - 0.10023147520818346f, - 0.1003617148512149f, - 0.10049195277457545f, - 0.10062218897603352f, - 0.1007524234533576f, - 0.10088265620431612f, - 0.10101288722667755f, - 0.10114311651821048f, - 0.10127334407668342f, - 0.10140356989986497f, - 0.10153379398552376f, - 0.10166401633142841f, - 0.10179423693534759f, - 0.10192445579505004f, - 0.10205467290830447f, - 0.10218488827287965f, - 0.10231510188654439f, - 0.10244531374706746f, - 0.10257552385221778f, - 0.10270573219976423f, - 0.10283593878747568f, - 0.10296614361312112f, - 0.1030963466744695f, - 0.10322654796928983f, - 0.10335674749535115f, - 0.10348694525042253f, - 0.10361714123227304f, - 0.10374733543867186f, - 0.1038775278673881f, - 0.10400771851619094f, - 0.10413790738284966f, - 0.10426809446513347f, - 0.1043982797608116f, - 0.10452846326765346f, - 0.10465864498342833f, - 0.10478882490590559f, - 0.10491900303285465f, - 0.10504917936204494f, - 0.10517935389124591f, - 0.10530952661822708f, - 0.10543969754075797f, - 0.10556986665660809f, - 0.1057000339635471f, - 0.10583019945934458f, - 0.10596036314177015f, - 0.10609052500859356f, - 0.10622068505758449f, - 0.10635084328651265f, - 0.10648099969314787f, - 0.10661115427525991f, - 0.10674130703061863f, - 0.10687145795699389f, - 0.1070016070521556f, - 0.10713175431387366f, - 0.10726189973991807f, - 0.1073920433280588f, - 0.10752218507606585f, - 0.10765232498170936f, - 0.10778246304275935f, - 0.10791259925698593f, - 0.1080427336221593f, - 0.10817286613604961f, - 0.10830299679642708f, - 0.10843312560106197f, - 0.10856325254772455f, - 0.1086933776341851f, - 0.10882350085821402f, - 0.10895362221758163f, - 0.10908374171005837f, - 0.10921385933341467f, - 0.10934397508542099f, - 0.10947408896384782f, - 0.10960420096646573f, - 0.10973431109104528f, - 0.10986441933535702f, - 0.10999452569717164f, - 0.11012463017425977f, - 0.11025473276439213f, - 0.11038483346533942f, - 0.1105149322748724f, - 0.11064502919076188f, - 0.11077512421077869f, - 0.11090521733269364f, - 0.11103530855427768f, - 0.11116539787330172f, - 0.11129548528753666f, - 0.11142557079475356f, - 0.11155565439272339f, - 0.11168573607921722f, - 0.11181581585200615f, - 0.11194589370886128f, - 0.11207596964755374f, - 0.11220604366585477f, - 0.11233611576153554f, - 0.1124661859323673f, - 0.11259625417612139f, - 0.11272632049056906f, - 0.11285638487348167f, - 0.11298644732263063f, - 0.11311650783578736f, - 0.11324656641072324f, - 0.11337662304520983f, - 0.11350667773701863f, - 0.11363673048392113f, - 0.11376678128368899f, - 0.11389683013409377f, - 0.11402687703290713f, - 0.11415692197790078f, - 0.1142869649668464f, - 0.11441700599751572f, - 0.11454704506768061f, - 0.11467708217511281f, - 0.11480711731758417f, - 0.1149371504928666f, - 0.11506718169873202f, - 0.11519721093295235f, - 0.11532723819329961f, - 0.1154572634775458f, - 0.11558728678346294f, - 0.11571730810882319f, - 0.11584732745139861f, - 0.11597734480896137f, - 0.11610736017928366f, - 0.1162373735601377f, - 0.11636738494929574f, - 0.11649739434453009f, - 0.11662740174361308f, - 0.116757407144317f, - 0.11688741054441433f, - 0.11701741194167745f, - 0.11714741133387882f, - 0.11727740871879096f, - 0.11740740409418637f, - 0.11753739745783764f, - 0.11766738880751736f, - 0.11779737814099817f, - 0.11792736545605269f, - 0.11805735075045372f, - 0.11818733402197391f, - 0.11831731526838604f, - 0.11844729448746297f, - 0.11857727167697749f, - 0.1187072468347025f, - 0.11883721995841091f, - 0.11896719104587565f, - 0.11909716009486973f, - 0.11922712710316614f, - 0.11935709206853792f, - 0.11948705498875821f, - 0.11961701586160008f, - 0.11974697468483667f, - 0.11987693145624123f, - 0.12000688617358696f, - 0.12013683883464708f, - 0.12026678943719496f, - 0.12039673797900388f, - 0.12052668445784721f, - 0.12065662887149839f, - 0.12078657121773083f, - 0.12091651149431798f, - 0.12104644969903339f, - 0.12117638582965058f, - 0.12130631988394312f, - 0.12143625185968468f, - 0.12156618175464885f, - 0.12169610956660931f, - 0.12182603529333985f, - 0.12195595893261418f, - 0.12208588048220609f, - 0.12221579993988943f, - 0.12234571730343806f, - 0.12247563257062587f, - 0.1226055457392268f, - 0.12273545680701484f, - 0.12286536577176398f, - 0.12299527263124826f, - 0.12312517738324179f, - 0.12325508002551865f, - 0.12338498055585302f, - 0.1235148789720191f, - 0.12364477527179106f, - 0.12377466945294323f, - 0.12390456151324988f, - 0.12403445145048532f, - 0.12416433926242397f, - 0.1242942249468402f, - 0.12442410850150845f, - 0.12455398992420325f, - 0.12468386921269904f, - 0.12481374636477043f, - 0.12494362137819202f, - 0.12507349425073838f, - 0.12520336498018422f, - 0.12533323356430426f, - 0.12546310000087316f, - 0.12559296428766573f, - 0.12572282642245683f, - 0.12585268640302122f, - 0.12598254422713384f, - 0.12611239989256962f, - 0.1262422533971035f, - 0.12637210473851046f, - 0.12650195391456553f, - 0.1266318009230438f, - 0.12676164576172042f, - 0.12689148842837042f, - 0.1270213289207691f, - 0.1271511672366916f, - 0.1272810033739132f, - 0.1274108373302092f, - 0.1275406691033549f, - 0.12767049869112573f, - 0.12780032609129705f, - 0.12793015130164428f, - 0.12805997431994295f, - 0.12818979514396855f, - 0.12831961377149664f, - 0.12844943020030286f, - 0.12857924442816274f, - 0.12870905645285202f, - 0.1288388662721464f, - 0.1289686738838216f, - 0.1290984792856534f, - 0.12922828247541768f, - 0.1293580834508902f, - 0.12948788220984694f, - 0.12961767875006383f, - 0.12974747306931675f, - 0.1298772651653818f, - 0.13000705503603502f, - 0.13013684267905243f, - 0.13026662809221023f, - 0.13039641127328455f, - 0.13052619222005157f, - 0.13065597093028758f, - 0.13078574740176882f, - 0.13091552163227158f, - 0.1310452936195723f, - 0.13117506336144727f, - 0.13130483085567296f, - 0.13143459610002586f, - 0.1315643590922825f, - 0.13169411983021936f, - 0.13182387831161305f, - 0.13195363453424022f, - 0.1320833884958775f, - 0.1322131401943016f, - 0.13234288962728927f, - 0.13247263679261728f, - 0.13260238168806243f, - 0.1327321243114016f, - 0.13286186466041167f, - 0.1329916027328696f, - 0.13312133852655236f, - 0.13325107203923692f, - 0.1333808032687004f, - 0.1335105322127198f, - 0.1336402588690723f, - 0.13376998323553513f, - 0.13389970530988538f, - 0.13402942508990037f, - 0.13415914257335737f, - 0.1342888577580337f, - 0.13441857064170676f, - 0.13454828122215393f, - 0.13467798949715257f, - 0.13480769546448032f, - 0.1349373991219146f, - 0.13506710046723303f, - 0.13519679949821317f, - 0.13532649621263265f, - 0.13545619060826922f, - 0.13558588268290053f, - 0.13571557243430438f, - 0.13584525986025855f, - 0.13597494495854093f, - 0.13610462772692933f, - 0.1362343081632017f, - 0.136363986265136f, - 0.13649366203051028f, - 0.13662333545710248f, - 0.13675300654269076f, - 0.13688267528505324f, - 0.13701234168196802f, - 0.13714200573121338f, - 0.1372716674305675f, - 0.1374013267778087f, - 0.13753098377071526f, - 0.1376606384070656f, - 0.13779029068463805f, - 0.13791994060121113f, - 0.1380495881545633f, - 0.138179233342473f, - 0.13830887616271895f, - 0.13843851661307963f, - 0.13856815469133374f, - 0.13869779039525995f, - 0.138827423722637f, - 0.13895705467124364f, - 0.13908668323885873f, - 0.13921630942326102f, - 0.1393459332222295f, - 0.13947555463354305f, - 0.13960517365498062f, - 0.1397347902843213f, - 0.13986440451934407f, - 0.13999401635782807f, - 0.14012362579755241f, - 0.14025323283629626f, - 0.1403828374718389f, - 0.14051243970195954f, - 0.14064203952443746f, - 0.14077163693705205f, - 0.14090123193758267f, - 0.14103082452380872f, - 0.14116041469350973f, - 0.14129000244446516f, - 0.14141958777445454f, - 0.14154917068125755f, - 0.1416787511626537f, - 0.14180832921642275f, - 0.1419379048403444f, - 0.14206747803219835f, - 0.1421970487897645f, - 0.14232661711082262f, - 0.1424561829931526f, - 0.1425857464345344f, - 0.1427153074327479f, - 0.1428448659855732f, - 0.1429744220907903f, - 0.14310397574617928f, - 0.14323352694952035f, - 0.14336307569859363f, - 0.1434926219911793f, - 0.14362216582505768f, - 0.14375170719800903f, - 0.14388124610781372f, - 0.14401078255225216f, - 0.14414031652910472f, - 0.1442698480361519f, - 0.14439937707117423f, - 0.14452890363195223f, - 0.1446584277162665f, - 0.1447879493218977f, - 0.1449174684466265f, - 0.14504698508823363f, - 0.14517649924449985f, - 0.14530601091320602f, - 0.1454355200921329f, - 0.14556502677906144f, - 0.14569453097177262f, - 0.14582403266804733f, - 0.14595353186566662f, - 0.14608302856241162f, - 0.14621252275606336f, - 0.14634201444440303f, - 0.14647150362521183f, - 0.14660099029627094f, - 0.14673047445536175f, - 0.1468599561002655f, - 0.14698943522876354f, - 0.14711891183863737f, - 0.14724838592766837f, - 0.14737785749363805f, - 0.147507326534328f, - 0.1476367930475197f, - 0.14776625703099486f, - 0.14789571848253516f, - 0.14802517739992224f, - 0.1481546337809379f, - 0.14828408762336395f, - 0.1484135389249822f, - 0.14854298768357457f, - 0.14867243389692297f, - 0.1488018775628094f, - 0.14893131867901585f, - 0.14906075724332438f, - 0.14919019325351712f, - 0.1493196267073762f, - 0.1494490576026838f, - 0.1495784859372222f, - 0.14970791170877362f, - 0.14983733491512044f, - 0.149966755554045f, - 0.1500961736233297f, - 0.15022558912075706f, - 0.1503550020441095f, - 0.1504844123911696f, - 0.15061382015971997f, - 0.15074322534754322f, - 0.150872627952422f, - 0.1510020279721391f, - 0.15113142540447722f, - 0.1512608202472192f, - 0.1513902124981479f, - 0.15151960215504617f, - 0.15164898921569706f, - 0.15177837367788347f, - 0.15190775553938837f, - 0.15203713479799502f, - 0.15216651145148638f, - 0.1522958854976457f, - 0.15242525693425618f, - 0.15255462575910103f, - 0.1526839919699636f, - 0.15281335556462725f, - 0.15294271654087527f, - 0.1530720748964912f, - 0.15320143062925848f, - 0.15333078373696063f, - 0.15346013421738122f, - 0.1535894820683039f, - 0.15371882728751224f, - 0.15384816987279004f, - 0.153977509821921f, - 0.15410684713268896f, - 0.15423618180287768f, - 0.1543655138302711f, - 0.1544948432126532f, - 0.15462416994780787f, - 0.15475349403351912f, - 0.15488281546757113f, - 0.15501213424774787f, - 0.1551414503718336f, - 0.1552707638376125f, - 0.15540007464286879f, - 0.1555293827853868f, - 0.15565868826295087f, - 0.15578799107334532f, - 0.1559172912143547f, - 0.15604658868376334f, - 0.15617588347935588f, - 0.15630517559891685f, - 0.15643446504023087f, - 0.15656375180108256f, - 0.1566930358792567f, - 0.15682231727253798f, - 0.15695159597871122f, - 0.1570808719955613f, - 0.15721014532087305f, - 0.15733941595243142f, - 0.1574686838880214f, - 0.15759794912542807f, - 0.15772721166243642f, - 0.1578564714968316f, - 0.15798572862639884f, - 0.15811498304892327f, - 0.15824423476219016f, - 0.15837348376398488f, - 0.1585027300520927f, - 0.1586319736242991f, - 0.15876121447838948f, - 0.1588904526121493f, - 0.1590196880233642f, - 0.15914892070981965f, - 0.15927815066930137f, - 0.15940737789959503f, - 0.1595366023984863f, - 0.159665824163761f, - 0.15979504319320495f, - 0.15992425948460398f, - 0.16005347303574405f, - 0.16018268384441112f, - 0.1603118919083911f, - 0.1604410972254702f, - 0.16057029979343443f, - 0.1606994996100699f, - 0.16082869667316294f, - 0.16095789098049965f, - 0.1610870825298664f, - 0.16121627131904953f, - 0.16134545734583539f, - 0.16147464060801042f, - 0.16160382110336113f, - 0.161732998829674f, - 0.16186217378473564f, - 0.1619913459663327f, - 0.16212051537225175f, - 0.1622496820002796f, - 0.16237884584820295f, - 0.16250800691380868f, - 0.16263716519488358f, - 0.16276632068921462f, - 0.16289547339458874f, - 0.16302462330879292f, - 0.1631537704296142f, - 0.16328291475483975f, - 0.1634120562822566f, - 0.16354119500965206f, - 0.16367033093481334f, - 0.16379946405552764f, - 0.16392859436958246f, - 0.16405772187476508f, - 0.16418684656886293f, - 0.16431596844966354f, - 0.16444508751495443f, - 0.16457420376252316f, - 0.16470331719015738f, - 0.16483242779564475f, - 0.16496153557677298f, - 0.1650906405313299f, - 0.1652197426571033f, - 0.16534884195188101f, - 0.16547793841345101f, - 0.16560703203960123f, - 0.1657361228281197f, - 0.1658652107767945f, - 0.1659942958834137f, - 0.16612337814576547f, - 0.16625245756163806f, - 0.1663815341288197f, - 0.1665106078450987f, - 0.1666396787082634f, - 0.16676874671610228f, - 0.1668978118664037f, - 0.1670268741569562f, - 0.16715593358554834f, - 0.16728499014996873f, - 0.16741404384800598f, - 0.16754309467744885f, - 0.16767214263608604f, - 0.16780118772170638f, - 0.1679302299320987f, - 0.16805926926505185f, - 0.16818830571835489f, - 0.16831733928979672f, - 0.1684463699771664f, - 0.16857539777825306f, - 0.16870442269084582f, - 0.16883344471273387f, - 0.16896246384170646f, - 0.16909148007555286f, - 0.16922049341206247f, - 0.1693495038490246f, - 0.16947851138422873f, - 0.16960751601546442f, - 0.1697365177405211f, - 0.16986551655718837f, - 0.16999451246325598f, - 0.1701235054565135f, - 0.1702524955347507f, - 0.17038148269575742f, - 0.17051046693732344f, - 0.17063944825723867f, - 0.17076842665329311f, - 0.17089740212327664f, - 0.17102637466497936f, - 0.17115534427619136f, - 0.17128431095470278f, - 0.1714132746983038f, - 0.17154223550478467f, - 0.1716711933719357f, - 0.17180014829754717f, - 0.17192910027940952f, - 0.17205804931531324f, - 0.17218699540304871f, - 0.17231593854040655f, - 0.17244487872517736f, - 0.1725738159551517f, - 0.17270275022812037f, - 0.1728316815418741f, - 0.17296060989420356f, - 0.1730895352828998f, - 0.17321845770575356f, - 0.17334737716055584f, - 0.1734762936450977f, - 0.1736052071571701f, - 0.17373411769456415f, - 0.17386302525507108f, - 0.173991929836482f, - 0.17412083143658824f, - 0.17424973005318106f, - 0.17437862568405185f, - 0.17450751832699196f, - 0.1746364079797929f, - 0.1747652946402462f, - 0.17489417830614337f, - 0.17502305897527604f, - 0.17515193664543588f, - 0.17528081131441461f, - 0.175409682980004f, - 0.17553855163999585f, - 0.17566741729218205f, - 0.1757962799343545f, - 0.1759251395643052f, - 0.17605399617982614f, - 0.17618284977870943f, - 0.1763117003587472f, - 0.1764405479177316f, - 0.1765693924534549f, - 0.17669823396370934f, - 0.1768270724462873f, - 0.17695590789898114f, - 0.1770847403195833f, - 0.17721356970588625f, - 0.1773423960556826f, - 0.17747121936676488f, - 0.17760003963692578f, - 0.17772885686395798f, - 0.1778576710456542f, - 0.1779864821798073f, - 0.17811529026421014f, - 0.17824409529665555f, - 0.17837289727493658f, - 0.1785016961968462f, - 0.17863049206017745f, - 0.17875928486272352f, - 0.1788880746022775f, - 0.17901686127663266f, - 0.1791456448835823f, - 0.17927442542091968f, - 0.1794032028864382f, - 0.17953197727793135f, - 0.17966074859319253f, - 0.17978951683001534f, - 0.17991828198619333f, - 0.1800470440595202f, - 0.1801758030477896f, - 0.1803045589487953f, - 0.1804333117603311f, - 0.18056206148019083f, - 0.1806908081061684f, - 0.1808195516360578f, - 0.18094829206765306f, - 0.18107702939874817f, - 0.18120576362713736f, - 0.1813344947506147f, - 0.1814632227669745f, - 0.181591947674011f, - 0.18172066946951848f, - 0.18184938815129142f, - 0.18197810371712422f, - 0.18210681616481136f, - 0.18223552549214747f, - 0.182364231696927f, - 0.18249293477694473f, - 0.18262163472999535f, - 0.18275033155387355f, - 0.1828790252463742f, - 0.18300771580529218f, - 0.18313640322842234f, - 0.18326508751355977f, - 0.1833937686584994f, - 0.18352244666103634f, - 0.1836511215189658f, - 0.18377979323008284f, - 0.1839084617921828f, - 0.18403712720306095f, - 0.18416578946051265f, - 0.1842944485623333f, - 0.18442310450631838f, - 0.18455175729026335f, - 0.18468040691196383f, - 0.18480905336921544f, - 0.18493769665981385f, - 0.1850663367815548f, - 0.18519497373223404f, - 0.18532360750964746f, - 0.18545223811159092f, - 0.1855808655358604f, - 0.18570948978025187f, - 0.1858381108425614f, - 0.18596672872058512f, - 0.1860953434121192f, - 0.18622395491495977f, - 0.18635256322690327f, - 0.18648116834574593f, - 0.1866097702692841f, - 0.18673836899531432f, - 0.186866964521633f, - 0.18699555684603675f, - 0.18712414596632218f, - 0.18725273188028588f, - 0.1873813145857246f, - 0.18750989408043517f, - 0.18763847036221432f, - 0.18776704342885897f, - 0.1878956132781661f, - 0.18802417990793263f, - 0.18815274331595563f, - 0.1882813035000322f, - 0.18840986045795952f, - 0.18853841418753478f, - 0.18866696468655522f, - 0.18879551195281824f, - 0.18892405598412113f, - 0.18905259677826136f, - 0.18918113433303646f, - 0.18930966864624388f, - 0.1894381997156813f, - 0.18956672753914636f, - 0.18969525211443672f, - 0.1898237734393502f, - 0.18995229151168463f, - 0.1900808063292378f, - 0.19020931788980777f, - 0.19033782619119247f, - 0.19046633123118986f, - 0.1905948330075982f, - 0.19072333151821552f, - 0.19085182676084012f, - 0.1909803187332702f, - 0.19110880743330413f, - 0.19123729285874028f, - 0.1913657750073771f, - 0.19149425387701297f, - 0.19162272946544662f, - 0.19175120177047658f, - 0.19187967078990142f, - 0.19200813652152002f, - 0.19213659896313104f, - 0.19226505811253333f, - 0.19239351396752583f, - 0.19252196652590742f, - 0.19265041578547712f, - 0.19277886174403402f, - 0.1929073043993772f, - 0.19303574374930582f, - 0.19316417979161915f, - 0.1932926125241164f, - 0.19342104194459697f, - 0.19354946805086023f, - 0.1936778908407057f, - 0.1938063103119328f, - 0.1939347264623411f, - 0.19406313928973032f, - 0.1941915487919f, - 0.19431995496665f, - 0.1944483578117801f, - 0.19457675732509006f, - 0.1947051535043799f, - 0.1948335463474495f, - 0.1949619358520989f, - 0.19509032201612825f, - 0.19521870483733764f, - 0.19534708431352724f, - 0.19547546044249733f, - 0.19560383322204822f, - 0.19573220264998029f, - 0.1958605687240939f, - 0.1959889314421896f, - 0.19611729080206794f, - 0.19624564680152945f, - 0.19637399943837477f, - 0.19650234871040478f, - 0.19663069461542007f, - 0.19675903715122148f, - 0.19688737631561004f, - 0.19701571210638652f, - 0.19714404452135204f, - 0.19727237355830765f, - 0.19740069921505438f, - 0.19752902148939344f, - 0.19765734037912616f, - 0.19778565588205368f, - 0.19791396799597746f, - 0.19804227671869887f, - 0.19817058204801935f, - 0.19829888398174045f, - 0.19842718251766375f, - 0.19855547765359088f, - 0.19868376938732354f, - 0.19881205771666352f, - 0.19894034263941257f, - 0.1990686241533726f, - 0.19919690225634556f, - 0.1993251769461334f, - 0.19945344822053815f, - 0.199581716077362f, - 0.19970998051440703f, - 0.19983824152947546f, - 0.1999664991203697f, - 0.20009475328489196f, - 0.20022300402084464f, - 0.20035125132603032f, - 0.20047949519825137f, - 0.20060773563531045f, - 0.20073597263501022f, - 0.20086420619515324f, - 0.2009924363135424f, - 0.2011206629879805f, - 0.20124888621627032f, - 0.20137710599621486f, - 0.20150532232561713f, - 0.2016335352022801f, - 0.20176174462400692f, - 0.2018899505886008f, - 0.20201815309386487f, - 0.20214635213760246f, - 0.20227454771761694f, - 0.2024027398317117f, - 0.20253092847769016f, - 0.20265911365335593f, - 0.2027872953565125f, - 0.20291547358496353f, - 0.20304364833651278f, - 0.20317181960896397f, - 0.2032999874001209f, - 0.2034281517077874f, - 0.20355631252976764f, - 0.20368446986386532f, - 0.2038126237078847f, - 0.20394077405962985f, - 0.20406892091690487f, - 0.2041970642775141f, - 0.2043252041392618f, - 0.20445334049995234f, - 0.2045814733573901f, - 0.2047096027093796f, - 0.20483772855372537f, - 0.20496585088823197f, - 0.20509396971070412f, - 0.2052220850189465f, - 0.20535019681076389f, - 0.20547830508396114f, - 0.20560640983634315f, - 0.20573451106571486f, - 0.20586260876988133f, - 0.2059907029466476f, - 0.2061187935938188f, - 0.2062468807092002f, - 0.20637496429059698f, - 0.20650304433581448f, - 0.2066311208426582f, - 0.20675919380893343f, - 0.2068872632324457f, - 0.20701532911100068f, - 0.20714339144240385f, - 0.207271450224461f, - 0.2073995054549779f, - 0.20752755713176022f, - 0.20765560525261395f, - 0.207783649815345f, - 0.20791169081775931f, - 0.20803972825766298f, - 0.20816776213286214f, - 0.20829579244116292f, - 0.20842381918037156f, - 0.20855184234829438f, - 0.20867986194273772f, - 0.208807877961508f, - 0.2089358904024117f, - 0.20906389926325536f, - 0.20919190454184558f, - 0.20931990623598906f, - 0.20944790434349247f, - 0.20957589886216263f, - 0.20970388978980642f, - 0.20983187712423065f, - 0.20995986086324236f, - 0.21008784100464864f, - 0.21021581754625648f, - 0.21034379048587304f, - 0.21047175982130567f, - 0.21059972555036147f, - 0.2107276876708479f, - 0.21085564618057237f, - 0.21098360107734224f, - 0.21111155235896514f, - 0.21123950002324865f, - 0.21136744406800034f, - 0.211495384491028f, - 0.21162332129013942f, - 0.21175125446314239f, - 0.21187918400784478f, - 0.21200710992205463f, - 0.21213503220357993f, - 0.21226295085022873f, - 0.21239086585980926f, - 0.21251877723012966f, - 0.21264668495899822f, - 0.21277458904422328f, - 0.21290248948361323f, - 0.21303038627497656f, - 0.2131582794161218f, - 0.21328616890485746f, - 0.21341405473899222f, - 0.2135419369163349f, - 0.21366981543469413f, - 0.21379769029187876f, - 0.2139255614856978f, - 0.2140534290139601f, - 0.21418129287447468f, - 0.21430915306505077f, - 0.21443700958349732f, - 0.21456486242762368f, - 0.21469271159523914f, - 0.21482055708415293f, - 0.2149483988921745f, - 0.21507623701711337f, - 0.215204071456779f, - 0.21533190220898102f, - 0.21545972927152907f, - 0.21558755264223287f, - 0.21571537231890217f, - 0.21584318829934687f, - 0.21597100058137683f, - 0.21609880916280205f, - 0.2162266140414326f, - 0.21635441521507848f, - 0.2164822126815499f, - 0.21661000643865713f, - 0.2167377964842104f, - 0.21686558281602009f, - 0.2169933654318966f, - 0.2171211443296504f, - 0.21724891950709205f, - 0.21737669096203222f, - 0.21750445869228147f, - 0.21763222269565052f, - 0.21775998296995036f, - 0.21788773951299162f, - 0.21801549232258535f, - 0.21814324139654256f, - 0.21827098673267423f, - 0.21839872832879148f, - 0.21852646618270558f, - 0.2186542002922277f, - 0.21878193065516915f, - 0.21890965726934136f, - 0.21903738013255572f, - 0.21916509924262373f, - 0.21929281459735697f, - 0.21942052619456712f, - 0.2195482340320658f, - 0.21967593810766478f, - 0.21980363841917597f, - 0.21993133496441117f, - 0.2200590277411823f, - 0.22018671674730156f, - 0.22031440198058083f, - 0.22044208343883234f, - 0.22056976111986837f, - 0.22069743502150108f, - 0.22082510514154285f, - 0.22095277147780618f, - 0.22108043402810337f, - 0.22120809279024709f, - 0.22133574776204992f, - 0.2214633989413245f, - 0.22159104632588356f, - 0.22171868991353993f, - 0.2218463297021064f, - 0.22197396568939598f, - 0.22210159787322165f, - 0.2222292262513964f, - 0.2223568508217334f, - 0.22248447158204587f, - 0.222612088530147f, - 0.22273970166385013f, - 0.22286731098096865f, - 0.22299491647931602f, - 0.2231225181567057f, - 0.22325011601095138f, - 0.2233777100398666f, - 0.22350530024126505f, - 0.22363288661296066f, - 0.22376046915276712f, - 0.22388804785849836f, - 0.2240156227279685f, - 0.22414319375899133f, - 0.22427076094938114f, - 0.2243983242969521f, - 0.22452588379951835f, - 0.22465343945489424f, - 0.22478099126089418f, - 0.22490853921533252f, - 0.2250360833160238f, - 0.22516362356078262f, - 0.22529115994742355f, - 0.2254186924737613f, - 0.22554622113761072f, - 0.22567374593678652f, - 0.22580126686910368f, - 0.22592878393237714f, - 0.2260562971244219f, - 0.22618380644305308f, - 0.2263113118860859f, - 0.22643881345133546f, - 0.22656631113661713f, - 0.2266938049397463f, - 0.22682129485853836f, - 0.2269487808908088f, - 0.22707626303437323f, - 0.22720374128704718f, - 0.2273312156466464f, - 0.22745868611098674f, - 0.2275861526778839f, - 0.22771361534515377f, - 0.22784107411061244f, - 0.22796852897207578f, - 0.22809597992736f, - 0.2282234269742813f, - 0.22835087011065572f, - 0.22847830933429972f, - 0.22860574464302963f, - 0.22873317603466184f, - 0.2288606035070129f, - 0.22898802705789933f, - 0.22911544668513778f, - 0.22924286238654495f, - 0.22937027415993763f, - 0.2294976820031326f, - 0.22962508591394679f, - 0.2297524858901972f, - 0.2298798819297008f, - 0.23000727403027474f, - 0.2301346621897362f, - 0.23026204640590237f, - 0.23038942667659057f, - 0.23051680299961824f, - 0.2306441753728027f, - 0.23077154379396153f, - 0.2308989082609124f, - 0.23102626877147278f, - 0.23115362532346043f, - 0.23128097791469324f, - 0.2314083265429889f, - 0.23153567120616542f, - 0.23166301190204083f, - 0.23179034862843303f, - 0.23191768138316027f, - 0.2320450101640407f, - 0.23217233496889256f, - 0.23229965579553416f, - 0.23242697264178397f, - 0.23255428550546037f, - 0.23268159438438188f, - 0.2328088992763672f, - 0.2329362001792349f, - 0.2330634970908037f, - 0.2331907900088925f, - 0.23331807893132006f, - 0.2334453638559054f, - 0.23357264478046752f, - 0.23369992170282544f, - 0.23382719462079835f, - 0.23395446353220545f, - 0.23408172843486602f, - 0.2342089893265994f, - 0.23433624620522506f, - 0.23446349906856243f, - 0.23459074791443105f, - 0.23471799274065067f, - 0.2348452335450408f, - 0.23497247032542132f, - 0.23509970307961206f, - 0.23522693180543292f, - 0.23535415650070385f, - 0.23548137716324485f, - 0.23560859379087612f, - 0.23573580638141778f, - 0.23586301493269005f, - 0.23599021944251333f, - 0.2361174199087079f, - 0.2362446163290943f, - 0.23637180870149305f, - 0.23649899702372468f, - 0.23662618129360988f, - 0.23675336150896942f, - 0.23688053766762407f, - 0.23700770976739466f, - 0.23713487780610223f, - 0.2372620417815677f, - 0.23738920169161218f, - 0.23751635753405687f, - 0.2376435093067229f, - 0.23777065700743158f, - 0.23789780063400434f, - 0.2380249401842625f, - 0.23815207565602764f, - 0.23827920704712136f, - 0.23840633435536515f, - 0.23853345757858085f, - 0.23866057671459023f, - 0.23878769176121506f, - 0.2389148027162773f, - 0.23904190957759897f, - 0.23916901234300209f, - 0.2392961110103088f, - 0.23942320557734129f, - 0.23955029604192182f, - 0.23967738240187275f, - 0.23980446465501654f, - 0.23993154279917553f, - 0.2400586168321724f, - 0.24018568675182975f, - 0.24031275255597018f, - 0.24043981424241656f, - 0.2405668718089917f, - 0.24069392525351843f, - 0.24082097457381976f, - 0.24094801976771885f, - 0.24107506083303865f, - 0.2412020977676024f, - 0.24132913056923344f, - 0.24145615923575492f, - 0.2415831837649904f, - 0.24171020415476335f, - 0.24183722040289715f, - 0.24196423250721555f, - 0.24209124046554223f, - 0.24221824427570088f, - 0.24234524393551535f, - 0.24247223944280955f, - 0.2425992307954074f, - 0.242726217991133f, - 0.24285320102781044f, - 0.24298017990326387f, - 0.24310715461531757f, - 0.24323412516179588f, - 0.24336109154052313f, - 0.2434880537493238f, - 0.24361501178602252f, - 0.24374196564844378f, - 0.24386891533441232f, - 0.2439958608417529f, - 0.2441228021682903f, - 0.2442497393118494f, - 0.24437667227025528f, - 0.24450360104133287f, - 0.24463052562290727f, - 0.24475744601280378f, - 0.24488436220884752f, - 0.24501127420886387f, - 0.2451381820106783f, - 0.2452650856121161f, - 0.24539198501100298f, - 0.24551888020516452f, - 0.24564577119242634f, - 0.2457726579706142f, - 0.24589954053755403f, - 0.24602641889107163f, - 0.24615329302899303f, - 0.24628016294914426f, - 0.2464070286493514f, - 0.24653389012744067f, - 0.2466607473812384f, - 0.2467876004085708f, - 0.24691444920726435f, - 0.24704129377514555f, - 0.24716813411004088f, - 0.24729497020977703f, - 0.24742180207218067f, - 0.24754862969507857f, - 0.24767545307629757f, - 0.24780227221366466f, - 0.2479290871050067f, - 0.24805589774815082f, - 0.24818270414092414f, - 0.2483095062811539f, - 0.24843630416666732f, - 0.24856309779529184f, - 0.2486898871648548f, - 0.24881667227318371f, - 0.24894345311810617f, - 0.24907022969744982f, - 0.24919700200904238f, - 0.24932377005071168f, - 0.24945053382028548f, - 0.24957729331559173f, - 0.24970404853445857f, - 0.24983079947471395f, - 0.2499575461341861f, - 0.25008428851070325f, - 0.2502110266020936f, - 0.25033776040618566f, - 0.2504644899208079f, - 0.2505912151437886f, - 0.25071793607295667f, - 0.2508446527061406f, - 0.2509713650411691f, - 0.2510980730758712f, - 0.25122477680807553f, - 0.25135147623561127f, - 0.25147817135630735f, - 0.2516048621679929f, - 0.25173154866849706f, - 0.2518582308556492f, - 0.2519849087272786f, - 0.25211158228121466f, - 0.25223825151528684f, - 0.25236491642732467f, - 0.25249157701515795f, - 0.2526182332766162f, - 0.2527448852095293f, - 0.25287153281172714f, - 0.2529981760810394f, - 0.2531248150152964f, - 0.2532514496123281f, - 0.2533780798699646f, - 0.2535047057860361f, - 0.25363132735837296f, - 0.2537579445848056f, - 0.2538845574631644f, - 0.25401116599127993f, - 0.2541377701669827f, - 0.2542643699881034f, - 0.2543909654524729f, - 0.2545175565579219f, - 0.2546441433022813f, - 0.25477072568338216f, - 0.25489730369905544f, - 0.2550238773471323f, - 0.25515044662544384f, - 0.2552770115318215f, - 0.2554035720640965f, - 0.2555301282201003f, - 0.2556566799976644f, - 0.2557832273946203f, - 0.25590977040879975f, - 0.25603630903803437f, - 0.25616284328015604f, - 0.25628937313299666f, - 0.256415898594388f, - 0.25654241966216224f, - 0.25666893633415144f, - 0.25679544860818776f, - 0.2569219564821034f, - 0.2570484599537308f, - 0.2571749590209022f, - 0.2573014536814502f, - 0.25742794393320734f, - 0.25755442977400617f, - 0.2576809112016794f, - 0.25780738821405985f, - 0.25793386080898034f, - 0.25806032898427383f, - 0.25818679273777334f, - 0.25831325206731187f, - 0.2584397069707226f, - 0.2585661574458388f, - 0.25869260349049367f, - 0.25881904510252074f, - 0.25894548227975345f, - 0.2590719150200252f, - 0.25919834332116964f, - 0.25932476718102054f, - 0.2594511865974116f, - 0.25957760156817666f, - 0.25970401209114974f, - 0.25983041816416463f, - 0.2599568197850555f, - 0.2600832169516566f, - 0.26020960966180195f, - 0.26033599791332596f, - 0.260462381704063f, - 0.2605887610318474f, - 0.26071513589451384f, - 0.26084150628989694f, - 0.26096787221583123f, - 0.2610942336701515f, - 0.26122059065069264f, - 0.26134694315528956f, - 0.2614732911817772f, - 0.2615996347279907f, - 0.26172597379176504f, - 0.26185230837093554f, - 0.26197863846333747f, - 0.2621049640668062f, - 0.2622312851791772f, - 0.26235760179828604f, - 0.2624839139219682f, - 0.2626102215480594f, - 0.2627365246743954f, - 0.262862823298812f, - 0.26298911741914516f, - 0.26311540703323094f, - 0.2632416921389052f, - 0.26336797273400414f, - 0.26349424881636413f, - 0.2636205203838213f, - 0.26374678743421204f, - 0.2638730499653729f, - 0.26399930797514026f, - 0.26412556146135086f, - 0.26425181042184137f, - 0.26437805485444843f, - 0.26450429475700893f, - 0.2646305301273598f, - 0.26475676096333806f, - 0.2648829872627807f, - 0.265009209023525f, - 0.265135426243408f, - 0.26526163892026716f, - 0.2653878470519398f, - 0.2655140506362634f, - 0.2656402496710754f, - 0.2657664441542136f, - 0.2658926340835155f, - 0.26601881945681893f, - 0.2661450002719618f, - 0.26627117652678195f, - 0.2663973482191174f, - 0.2665235153468064f, - 0.2666496779076869f, - 0.26677583589959714f, - 0.2669019893203755f, - 0.2670281381678605f, - 0.2671542824398904f, - 0.26728042213430386f, - 0.2674065572489395f, - 0.267532687781636f, - 0.26765881373023226f, - 0.267784935092567f, - 0.26791105186647923f, - 0.268037164049808f, - 0.2681632716403923f, - 0.2682893746360714f, - 0.26841547303468455f, - 0.26854156683407115f, - 0.26866765603207055f, - 0.26879374062652217f, - 0.2689198206152657f, - 0.26904589599614076f, - 0.269171966766987f, - 0.26929803292564447f, - 0.2694240944699528f, - 0.269550151397752f, - 0.2696762037068823f, - 0.26980225139518366f, - 0.2699282944604963f, - 0.2700543329006606f, - 0.2701803667135168f, - 0.2703063958969054f, - 0.27043242044866705f, - 0.2705584403666421f, - 0.27068445564867144f, - 0.27081046629259575f, - 0.27093647229625584f, - 0.27106247365749275f, - 0.2711884703741474f, - 0.2713144624440608f, - 0.27144044986507426f, - 0.2715664326350289f, - 0.2716924107517661f, - 0.2718183842131272f, - 0.2719443530169538f, - 0.2720703171610873f, - 0.2721962766433695f, - 0.272322231461642f, - 0.27244818161374657f, - 0.2725741270975252f, - 0.27270006791081985f, - 0.2728260040514725f, - 0.27295193551732516f, - 0.2730778623062203f, - 0.27320378441599996f, - 0.2733297018445066f, - 0.2734556145895827f, - 0.2735815226490706f, - 0.2737074260208131f, - 0.2738333247026528f, - 0.27395921869243245f, - 0.2740851079879949f, - 0.27421099258718307f, - 0.27433687248783994f, - 0.27446274768780865f, - 0.27458861818493235f, - 0.2747144839770542f, - 0.2748403450620176f, - 0.274966201437666f, - 0.2750920531018427f, - 0.2752179000523915f, - 0.2753437422871559f, - 0.2754695798039797f, - 0.27559541260070664f, - 0.2757212406751806f, - 0.2758470640252456f, - 0.2759728826487457f, - 0.2760986965435251f, - 0.2762245057074278f, - 0.2763503101382982f, - 0.2764761098339808f, - 0.27660190479231994f, - 0.2767276950111601f, - 0.27685348048834607f, - 0.27697926122172234f, - 0.2771050372091338f, - 0.2772308084484254f, - 0.2773565749374419f, - 0.2774823366740285f, - 0.2776080936560302f, - 0.2777338458812922f, - 0.27785959334765975f, - 0.2779853360529783f, - 0.2781110739950932f, - 0.27823680717185f, - 0.27836253558109425f, - 0.2784882592206716f, - 0.2786139780884279f, - 0.27873969218220906f, - 0.27886540149986083f, - 0.2789911060392293f, - 0.27911680579816045f, - 0.2792425007745006f, - 0.27936819096609594f, - 0.27949387637079287f, - 0.27961955698643765f, - 0.2797452328108769f, - 0.2798709038419571f, - 0.27999657007752504f, - 0.28012223151542737f, - 0.280247888153511f, - 0.28037353998962267f, - 0.2804991870216095f, - 0.28062482924731863f, - 0.280750466664597f, - 0.2808760992712921f, - 0.28100172706525106f, - 0.2811273500443213f, - 0.2812529682063504f, - 0.2813785815491859f, - 0.2815041900706754f, - 0.2816297937686666f, - 0.2817553926410074f, - 0.2818809866855457f, - 0.2820065759001294f, - 0.2821321602826067f, - 0.2822577398308256f, - 0.2823833145426343f, - 0.2825088844158813f, - 0.2826344494484148f, - 0.28276000963808345f, - 0.2828855649827357f, - 0.28301111548022023f, - 0.28313666112838576f, - 0.283262201925081f, - 0.2833877378681551f, - 0.28351326895545675f, - 0.28363879518483515f, - 0.2837643165541395f, - 0.2838898330612188f, - 0.2840153447039226f, - 0.2841408514801002f, - 0.28426635338760103f, - 0.28439185042427473f, - 0.2845173425879709f, - 0.28464282987653927f, - 0.2847683122878297f, - 0.284893789819692f, - 0.2850192624699761f, - 0.2851447302365322f, - 0.2852701931172104f, - 0.28539565110986087f, - 0.285521104212334f, - 0.28564655242248016f, - 0.28577199573814976f, - 0.28589743415719343f, - 0.2860228676774618f, - 0.28614829629680566f, - 0.2862737200130757f, - 0.286399138824123f, - 0.2865245527277983f, - 0.2866499617219528f, - 0.28677536580443774f, - 0.2869007649731042f, - 0.2870261592258036f, - 0.2871515485603873f, - 0.28727693297470674f, - 0.2874023124666136f, - 0.2875276870339595f, - 0.28765305667459606f, - 0.28777842138637527f, - 0.287903781167149f, - 0.28802913601476915f, - 0.2881544859270879f, - 0.28827983090195747f, - 0.28840517093722995f, - 0.2885305060307577f, - 0.2886558361803932f, - 0.28878116138398896f, - 0.2889064816393975f, - 0.2890317969444716f, - 0.2891571072970639f, - 0.28928241269502725f, - 0.28940771313621466f, - 0.2895330086184791f, - 0.2896582991396736f, - 0.2897835846976515f, - 0.2899088652902659f, - 0.2900341409153701f, - 0.2901594115708178f, - 0.29028467725446233f, - 0.29040993796415737f, - 0.2905351936977566f, - 0.2906604444531137f, - 0.2907856902280826f, - 0.29091093102051735f, - 0.2910361668282718f, - 0.29116139764920024f, - 0.29128662348115675f, - 0.29141184432199563f, - 0.2915370601695713f, - 0.2916622710217383f, - 0.291787476876351f, - 0.2919126777312641f, - 0.29203787358433236f, - 0.2921630644334105f, - 0.2922882502763535f, - 0.29241343111101636f, - 0.292538606935254f, - 0.29266377774692165f, - 0.2927889435438746f, - 0.29291410432396797f, - 0.2930392600850574f, - 0.2931644108249983f, - 0.2932895565416462f, - 0.2934146972328567f, - 0.2935398328964857f, - 0.29366496353038896f, - 0.2937900891324224f, - 0.29391520970044205f, - 0.29404032523230395f, - 0.2941654357258643f, - 0.29429054117897946f, - 0.29441564158950567f, - 0.29454073695529936f, - 0.29466582727421714f, - 0.29479091254411555f, - 0.29491599276285135f, - 0.29504106792828133f, - 0.29516613803826225f, - 0.2952912030906511f, - 0.29541626308330504f, - 0.29554131801408107f, - 0.29566636788083644f, - 0.2957914126814286f, - 0.2959164524137147f, - 0.2960414870755524f, - 0.2961665166647991f, - 0.2962915411793126f, - 0.2964165606169506f, - 0.296541574975571f, - 0.2966665842530315f, - 0.2967915884471902f, - 0.29691658755590533f, - 0.2970415815770349f, - 0.2971665705084372f, - 0.29729155434797067f, - 0.2974165330934936f, - 0.29754150674286456f, - 0.29766647529394225f, - 0.2977914387445853f, - 0.2979163970926525f, - 0.29804135033600265f, - 0.2981662984724949f, - 0.29829124149998804f, - 0.2984161794163414f, - 0.2985411122194142f, - 0.2986660399070657f, - 0.29879096247715525f, - 0.29891587992754237f, - 0.29904079225608665f, - 0.29916569946064775f, - 0.29929060153908543f, - 0.2994154984892595f, - 0.29954039030902985f, - 0.2996652769962566f, - 0.29979015854879976f, - 0.29991503496451954f, - 0.30003990624127624f, - 0.3001647723769301f, - 0.30028963336934184f, - 0.30041448921637176f, - 0.3005393399158806f, - 0.300664185465729f, - 0.3007890258637778f, - 0.300913861107888f, - 0.30103869119592036f, - 0.3011635161257362f, - 0.3012883358951965f, - 0.3014131505021625f, - 0.30153795994449567f, - 0.30166276422005733f, - 0.30178756332670903f, - 0.3019123572623124f, - 0.30203714602472903f, - 0.3021619296118208f, - 0.3022867080214495f, - 0.30241148125147715f, - 0.30253624929976575f, - 0.30266101216417757f, - 0.3027857698425746f, - 0.30291052233281923f, - 0.30303526963277394f, - 0.3031600117403012f, - 0.30328474865326355f, - 0.3034094803695237f, - 0.3035342068869443f, - 0.30365892820338825f, - 0.3037836443167186f, - 0.3039083552247982f, - 0.30403306092549026f, - 0.304157761416658f, - 0.3042824566961646f, - 0.3044071467618735f, - 0.3045318316116483f, - 0.30465651124335236f, - 0.3047811856548494f, - 0.3049058548440031f, - 0.3050305188086775f, - 0.30515517754673627f, - 0.30527983105604356f, - 0.30540447933446335f, - 0.30552912237985996f, - 0.30565376019009755f, - 0.3057783927630406f, - 0.30590302009655346f, - 0.30602764218850076f, - 0.30615225903674703f, - 0.30627687063915704f, - 0.30640147699359566f, - 0.3065260780979277f, - 0.3066506739500182f, - 0.30677526454773235f, - 0.30689984988893515f, - 0.3070244299714919f, - 0.30714900479326807f, - 0.30727357435212893f, - 0.3073981386459402f, - 0.3075226976725674f, - 0.30764725142987615f, - 0.30777179991573245f, - 0.3078963431280021f, - 0.3080208810645511f, - 0.3081454137232455f, - 0.3082699411019515f, - 0.3083944631985353f, - 0.3085189800108633f, - 0.308643491536802f, - 0.30876799777421776f, - 0.30889249872097735f, - 0.3090169943749474f, - 0.3091414847339948f, - 0.30926596979598625f, - 0.309390449558789f, - 0.3095149240202699f, - 0.3096393931782962f, - 0.30976385703073517f, - 0.3098883155754541f, - 0.3100127688103205f, - 0.3101372167332019f, - 0.3102616593419658f, - 0.31038609663447997f, - 0.31051052860861234f, - 0.3106349552622306f, - 0.31075937659320285f, - 0.3108837925993972f, - 0.3110082032786816f, - 0.31113260862892456f, - 0.3112570086479944f, - 0.31138140333375935f, - 0.3115057926840881f, - 0.31163017669684934f, - 0.3117545553699116f, - 0.3118789287011438f, - 0.31200329668841487f, - 0.3121276593295937f, - 0.31225201662254937f, - 0.31237636856515116f, - 0.3125007151552682f, - 0.31262505639077f, - 0.31274939226952586f, - 0.3128737227894054f, - 0.3129980479482782f, - 0.31312236774401403f, - 0.31324668217448265f, - 0.313370991237554f, - 0.3134952949310981f, - 0.31361959325298505f, - 0.3137438862010849f, - 0.3138681737732681f, - 0.31399245596740494f, - 0.31411673278136587f, - 0.3142410042130214f, - 0.31436527026024225f, - 0.3144895309208991f, - 0.31461378619286284f, - 0.31473803607400436f, - 0.3148622805621946f, - 0.3149865196553048f, - 0.31511075335120603f, - 0.31523498164776964f, - 0.315359204542867f, - 0.31548342203436963f, - 0.315607634120149f, - 0.31573184079807687f, - 0.3158560420660249f, - 0.315980237921865f, - 0.3161044283634691f, - 0.3162286133887093f, - 0.3163527929954575f, - 0.3164769671815861f, - 0.31660113594496736f, - 0.3167252992834737f, - 0.31684945719497765f, - 0.3169736096773517f, - 0.31709775672846857f, - 0.31722189834620107f, - 0.3173460345284221f, - 0.3174701652730045f, - 0.3175942905778214f, - 0.3177184104407459f, - 0.3178425248596513f, - 0.3179666338324109f, - 0.3180907373568982f, - 0.31821483543098655f, - 0.3183389280525497f, - 0.31846301521946135f, - 0.3185870969295952f, - 0.31871117318082526f, - 0.31883524397102553f, - 0.31895930929807f, - 0.3190833691598328f, - 0.3192074235541883f, - 0.3193314724790109f, - 0.3194555159321749f, - 0.319579553911555f, - 0.3197035864150258f, - 0.3198276134404619f, - 0.3199516349857384f, - 0.32007565104873f, - 0.3201996616273118f, - 0.3203236667193589f, - 0.32044766632274646f, - 0.3205716604353499f, - 0.32069564905504455f, - 0.3208196321797059f, - 0.3209436098072095f, - 0.321067581935431f, - 0.3211915485622463f, - 0.32131550968553113f, - 0.3214394653031616f, - 0.3215634154130136f, - 0.32168736001296333f, - 0.32181129910088707f, - 0.3219352326746612f, - 0.322059160732162f, - 0.3221830832712662f, - 0.32230700028985027f, - 0.3224309117857909f, - 0.322554817756965f, - 0.32267871820124944f, - 0.32280261311652125f, - 0.3229265025006575f, - 0.3230503863515353f, - 0.32317426466703203f, - 0.3232981374450251f, - 0.3234220046833919f, - 0.32354586638001f, - 0.3236697225327571f, - 0.3237935731395109f, - 0.32391741819814934f, - 0.3240412577065504f, - 0.324165091662592f, - 0.32428892006415233f, - 0.3244127429091096f, - 0.32453656019534216f, - 0.3246603719207285f, - 0.3247841780831471f, - 0.32490797868047644f, - 0.3250317737105954f, - 0.3251555631713827f, - 0.3252793470607173f, - 0.32540312537647814f, - 0.32552689811654445f, - 0.32565066527879516f, - 0.32577442686110974f, - 0.32589818286136757f, - 0.32602193327744805f, - 0.3261456781072308f, - 0.32626941734859544f, - 0.3263931509994218f, - 0.32651687905758964f, - 0.326640601520979f, - 0.3267643183874699f, - 0.32688802965494246f, - 0.32701173532127703f, - 0.32713543538435375f, - 0.3272591298420532f, - 0.3273828186922559f, - 0.3275065019328424f, - 0.3276301795616935f, - 0.32775385157669f, - 0.32787751797571274f, - 0.32800117875664286f, - 0.3281248339173614f, - 0.32824848345574953f, - 0.32837212736968857f, - 0.3284957656570599f, - 0.32861939831574505f, - 0.3287430253436256f, - 0.32886664673858323f, - 0.3289902624984997f, - 0.3291138726212569f, - 0.32923747710473683f, - 0.3293610759468215f, - 0.32948466914539315f, - 0.329608256698334f, - 0.32973183860352645f, - 0.3298554148588529f, - 0.32997898546219584f, - 0.33010255041143816f, - 0.33022610970446237f, - 0.33034966333915144f, - 0.3304732113133883f, - 0.33059675362505586f, - 0.3307202902720374f, - 0.33084382125221623f, - 0.33096734656347543f, - 0.3310908662036986f, - 0.33121438017076926f, - 0.33133788846257095f, - 0.33146139107698747f, - 0.3315848880119026f, - 0.33170837926520025f, - 0.33183186483476446f, - 0.33195534471847926f, - 0.3320788189142289f, - 0.3322022874198977f, - 0.3323257502333702f, - 0.3324492073525306f, - 0.33257265877526365f, - 0.3326961044994541f, - 0.3328195445229866f, - 0.3329429788437462f, - 0.3330664074596178f, - 0.3331898303684865f, - 0.3333132475682373f, - 0.3334366590567559f, - 0.3335600648319273f, - 0.3336834648916371f, - 0.33380685923377096f, - 0.33393024785621434f, - 0.3340536307568532f, - 0.3341770079335734f, - 0.33430037938426077f, - 0.3344237451068015f, - 0.3345471050990817f, - 0.3346704593589876f, - 0.3347938078844056f, - 0.33491715067322225f, - 0.3350404877233239f, - 0.33516381903259734f, - 0.3352871445989293f, - 0.33541046442020656f, - 0.3355337784943162f, - 0.3356570868191452f, - 0.33578038939258065f, - 0.3359036862125099f, - 0.3360269772768201f, - 0.336150262583399f, - 0.33627354213013383f, - 0.33639681591491244f, - 0.3365200839356225f, - 0.33664334619015174f, - 0.3367666026763883f, - 0.33688985339222005f, - 0.33701309833553517f, - 0.33713633750422195f, - 0.3372595708961686f, - 0.3373827985092636f, - 0.3375060203413956f, - 0.33762923639045306f, - 0.3377524466543248f, - 0.33787565113089957f, - 0.3379988498180663f, - 0.33812204271371415f, - 0.3382452298157322f, - 0.3383684111220095f, - 0.3384915866304355f, - 0.3386147563388996f, - 0.33873792024529137f, - 0.33886107834750034f, - 0.3389842306434164f, - 0.33910737713092914f, - 0.3392305178079286f, - 0.3393536526723048f, - 0.33947678172194784f, - 0.3395999049547479f, - 0.3397230223685954f, - 0.3398461339613807f, - 0.3399692397309942f, - 0.34009233967532676f, - 0.3402154337922689f, - 0.34033852207971144f, - 0.34046160453554547f, - 0.3405846811576618f, - 0.3407077519439516f, - 0.3408308168923062f, - 0.3409538760006168f, - 0.34107692926677485f, - 0.3411999766886718f, - 0.3413230182641994f, - 0.3414460539912493f, - 0.34156908386771334f, - 0.3416921078914833f, - 0.3418151260604514f, - 0.3419381383725096f, - 0.34206114482555017f, - 0.34218414541746545f, - 0.34230714014614794f, - 0.34243012900948994f, - 0.34255311200538424f, - 0.3426760891317235f, - 0.3427990603864005f, - 0.3429220257673083f, - 0.34304498527233984f, - 0.3431679388993882f, - 0.34329088664634655f, - 0.3434138285111084f, - 0.34353676449156706f, - 0.34365969458561607f, - 0.3437826187911491f, - 0.3439055371060597f, - 0.3440284495282419f, - 0.3441513560555896f, - 0.3442742566859968f, - 0.34439715141735755f, - 0.3445200402475662f, - 0.34464292317451706f, - 0.3447658001961045f, - 0.34488867131022305f, - 0.3450115365147675f, - 0.34513439580763244f, - 0.34525724918671274f, - 0.3453800966499033f, - 0.3455029381950993f, - 0.3456257738201957f, - 0.345748603523088f, - 0.34587142730167125f, - 0.34599424515384103f, - 0.34611705707749296f, - 0.34623986307052257f, - 0.3463626631308257f, - 0.3464854572562982f, - 0.3466082454448359f, - 0.346731027694335f, - 0.3468538040026917f, - 0.3469765743678021f, - 0.34709933878756266f, - 0.3472220972598698f, - 0.3473448497826201f, - 0.3474675963537102f, - 0.34759033697103703f, - 0.34771307163249726f, - 0.347835800335988f, - 0.34795852307940617f, - 0.34808123986064915f, - 0.34820395067761406f, - 0.3483266555281984f, - 0.3484493544102996f, - 0.3485720473218152f, - 0.34869473426064296f, - 0.3488174152246807f, - 0.3489400902118262f, - 0.3490627592199776f, - 0.34918542224703286f, - 0.34930807929089025f, - 0.34943073034944805f, - 0.3495533754206047f, - 0.3496760145022587f, - 0.3497986475923088f, - 0.3499212746886534f, - 0.3500438957891915f, - 0.3501665108918221f, - 0.35028911999444406f, - 0.35041172309495666f, - 0.350534320191259f, - 0.3506569112812504f, - 0.3507794963628305f, - 0.3509020754338987f, - 0.35102464849235454f, - 0.3511472155360979f, - 0.35126977656302855f, - 0.3513923315710465f, - 0.3515148805580518f, - 0.3516374235219446f, - 0.35175996046062513f, - 0.35188249137199373f, - 0.352005016253951f, - 0.3521275351043973f, - 0.3522500479212335f, - 0.3523725547023603f, - 0.3524950554456785f, - 0.3526175501490892f, - 0.35274003881049343f, - 0.3528625214277924f, - 0.3529849979988874f, - 0.35310746852167985f, - 0.3532299329940712f, - 0.35335239141396296f, - 0.35347484377925714f, - 0.3535972900878553f, - 0.35371973033765935f, - 0.3538421645265715f, - 0.35396459265249364f, - 0.35408701471332815f, - 0.3542094307069774f, - 0.3543318406313437f, - 0.3544542444843296f, - 0.35457664226383784f, - 0.354699033967771f, - 0.3548214195940322f, - 0.35494379914052415f, - 0.35506617260515f, - 0.3551885399858129f, - 0.3553109012804161f, - 0.355433256486863f, - 0.3555556056030571f, - 0.35567794862690205f, - 0.35580028555630133f, - 0.35592261638915884f, - 0.3560449411233785f, - 0.35616725975686425f, - 0.35628957228752023f, - 0.35641187871325075f, - 0.3565341790319599f, - 0.3566564732415522f, - 0.35677876133993225f, - 0.3569010433250046f, - 0.357023319194674f, - 0.35714558894684534f, - 0.35726785257942334f, - 0.3573901100903133f, - 0.3575123614774203f, - 0.35763460673864955f, - 0.3577568458719064f, - 0.3578790788750964f, - 0.35800130574612504f, - 0.358123526482898f, - 0.35824574108332113f, - 0.35836794954530027f, - 0.3584901518667414f, - 0.3586123480455506f, - 0.3587345380796341f, - 0.3588567219668983f, - 0.35897889970524943f, - 0.3591010712925941f, - 0.359223236726839f, - 0.35934539600589066f, - 0.3594675491276561f, - 0.3595896960900422f, - 0.3597118368909561f, - 0.35983397152830476f, - 0.35995609999999545f, - 0.3600782223039357f, - 0.36020033843803295f, - 0.3603224484001947f, - 0.36044455218832855f, - 0.3605666498003424f, - 0.36068874123414413f, - 0.36081082648764173f, - 0.36093290555874336f, - 0.3610549784453571f, - 0.36117704514539134f, - 0.36129910565675444f, - 0.361421159977355f, - 0.36154320810510165f, - 0.3616652500379031f, - 0.3617872857736682f, - 0.3619093153103059f, - 0.36203133864572523f, - 0.3621533557778354f, - 0.36227536670454563f, - 0.36239737142376544f, - 0.36251936993340406f, - 0.3626413622313712f, - 0.3627633483155767f, - 0.36288532818393016f, - 0.36300730183434154f, - 0.36312926926472094f, - 0.3632512304729783f, - 0.363373185457024f, - 0.3634951342147684f, - 0.3636170767441219f, - 0.36373901304299494f, - 0.3638609431092983f, - 0.3639828669409427f, - 0.364104784535839f, - 0.3642266958918982f, - 0.36434860100703137f, - 0.36447049987914965f, - 0.3645923925061644f, - 0.364714278885987f, - 0.36483615901652894f, - 0.36495803289570194f, - 0.3650799005214176f, - 0.3652017618915878f, - 0.36532361700412447f, - 0.36544546585693966f, - 0.3655673084479455f, - 0.3656891447750543f, - 0.3658109748361784f, - 0.36593279862923017f, - 0.3660546161521225f, - 0.36617642740276773f, - 0.3662982323790788f, - 0.3664200310789687f, - 0.36654182350035025f, - 0.36666360964113676f, - 0.3667853894992414f, - 0.3669071630725774f, - 0.36702893035905837f, - 0.3671506913565977f, - 0.36727244606310916f, - 0.36739419447650645f, - 0.36751593659470355f, - 0.36763767241561435f, - 0.3677594019371529f, - 0.3678811251572335f, - 0.3680028420737703f, - 0.3681245526846779f, - 0.36824625698787083f, - 0.3683679549812635f, - 0.36848964666277084f, - 0.3686113320303076f, - 0.3687330110817888f, - 0.3688546838151295f, - 0.3689763502282448f, - 0.36909801031905004f, - 0.36921966408546053f, - 0.3693413115253919f, - 0.36946295263675966f, - 0.3695845874174795f, - 0.36970621586546737f, - 0.36982783797863905f, - 0.3699494537549106f, - 0.3700710631921983f, - 0.3701926662884183f, - 0.3703142630414869f, - 0.3704358534493207f, - 0.3705574375098362f, - 0.37067901522095015f, - 0.37080058658057935f, - 0.3709221515866406f, - 0.371043710237051f, - 0.3711652625297277f, - 0.3712868084625879f, - 0.3714083480335489f, - 0.37152988124052827f, - 0.3716514080814434f, - 0.3717729285542121f, - 0.37189444265675214f, - 0.3720159503869814f, - 0.37213745174281776f, - 0.3722589467221795f, - 0.37238043532298476f, - 0.3725019175431518f, - 0.3726233933805992f, - 0.37274486283324537f, - 0.372866325899009f, - 0.37298778257580895f, - 0.37310923286156394f, - 0.37323067675419297f, - 0.3733521142516153f, - 0.37347354535175f, - 0.37359497005251635f, - 0.3737163883518339f, - 0.373837800247622f, - 0.3739592057378004f, - 0.37408060482028893f, - 0.37420199749300725f, - 0.3743233837538755f, - 0.3744447636008137f, - 0.374566137031742f, - 0.37468750404458073f, - 0.3748088646372504f, - 0.37493021880767136f, - 0.3750515665537643f, - 0.37517290787345f, - 0.37529424276464923f, - 0.3754155712252831f, - 0.37553689325327244f, - 0.3756582088465387f, - 0.37577951800300297f, - 0.3759008207205867f, - 0.3760221169972115f, - 0.3761434068307989f, - 0.37626469021927056f, - 0.3763859671605485f, - 0.3765072376525545f, - 0.3766285016932107f, - 0.3767497592804394f, - 0.37687101041216264f, - 0.37699225508630296f, - 0.37711349330078286f, - 0.3772347250535249f, - 0.37735595034245184f, - 0.37747716916548657f, - 0.377598381520552f, - 0.37771958740557104f, - 0.3778407868184671f, - 0.37796197975716334f, - 0.37808316621958316f, - 0.3782043462036501f, - 0.3783255197072877f, - 0.37844668672841975f, - 0.37856784726497006f, - 0.37868900131486255f, - 0.3788101488760214f, - 0.37893128994637065f, - 0.3790524245238346f, - 0.37917355260633756f, - 0.3792946741918043f, - 0.37941578927815917f, - 0.37953689786332706f, - 0.37965799994523275f, - 0.37977909552180106f, - 0.37990018459095726f, - 0.38002126715062645f, - 0.38014234319873386f, - 0.3802634127332049f, - 0.38038447575196516f, - 0.3805055322529401f, - 0.3806265822340556f, - 0.3807476256932375f, - 0.3808686626284116f, - 0.38098969303750413f, - 0.3811107169184412f, - 0.381231734269149f, - 0.38135274508755407f, - 0.38147374937158296f, - 0.38159474711916214f, - 0.3817157383282184f, - 0.3818367229966787f, - 0.38195770112246985f, - 0.382078672703519f, - 0.3821996377377533f, - 0.38232059622310005f, - 0.38244154815748665f, - 0.3825624935388407f, - 0.3826834323650898f, - 0.38280436463416156f, - 0.38292529034398404f, - 0.3830462094924851f, - 0.3831671220775929f, - 0.3832880280972355f, - 0.3834089275493413f, - 0.3835298204318387f, - 0.3836507067426563f, - 0.38377158647972265f, - 0.3838924596409666f, - 0.3840133262243169f, - 0.38413418622770257f, - 0.3842550396490528f, - 0.3843758864862967f, - 0.3844967267373636f, - 0.38461756040018313f, - 0.3847383874726845f, - 0.3848592079527976f, - 0.38498002183845215f, - 0.385100829127578f, - 0.38522162981810515f, - 0.3853424239079639f, - 0.3854632113950842f, - 0.38558399227739654f, - 0.3857047665528313f, - 0.3858255342193191f, - 0.38594629527479063f, - 0.38606704971717676f, - 0.3861877975444082f, - 0.38630853875441595f, - 0.3864292733451314f, - 0.3865500013144856f, - 0.3866707226604099f, - 0.38679143738083605f, - 0.3869121454736952f, - 0.3870328469369193f, - 0.38715354176844013f, - 0.38727422996618965f, - 0.38739491152809985f, - 0.387515586452103f, - 0.3876362547361311f, - 0.3877569163781168f, - 0.3878775713759925f, - 0.3879982197276907f, - 0.3881188614311443f, - 0.38823949648428613f, - 0.388360124885049f, - 0.38848074663136606f, - 0.3886013617211705f, - 0.38872197015239557f, - 0.38884257192297467f, - 0.38896316703084144f, - 0.38908375547392937f, - 0.3892043372501723f, - 0.389324912357504f, - 0.3894454807938585f, - 0.3895660425571699f, - 0.3896865976453725f, - 0.38980714605640043f, - 0.38992768778818826f, - 0.3900482228386705f, - 0.3901687512057818f, - 0.390289272887457f, - 0.39040978788163094f, - 0.39053029618623863f, - 0.3906507977992152f, - 0.39077129271849587f, - 0.39089178094201604f, - 0.39101226246771104f, - 0.3911327372935168f, - 0.3912532054173686f, - 0.3913736668372024f, - 0.3914941215509542f, - 0.39161456955656f, - 0.3917350108519559f, - 0.3918554454350784f, - 0.3919758733038635f, - 0.392096294456248f, - 0.39221670889016835f, - 0.3923371166035614f, - 0.392457517594364f, - 0.3925779118605131f, - 0.39269829939994566f, - 0.3928186802105989f, - 0.39293905429041026f, - 0.39305942163731705f, - 0.3931797822492568f, - 0.39330013612416737f, - 0.39342048325998624f, - 0.3935408236546514f, - 0.39366115730610085f, - 0.39378148421227277f, - 0.3939018043711053f, - 0.394022117780537f, - 0.39414242443850594f, - 0.39426272434295095f, - 0.39438301749181076f, - 0.39450330388302407f, - 0.3946235835145299f, - 0.39474385638426723f, - 0.3948641224901752f, - 0.39498438183019313f, - 0.39510463440226035f, - 0.39522488020431645f, - 0.39534511923430093f, - 0.3954653514901537f, - 0.39558557696981445f, - 0.3957057956712232f, - 0.3958260075923201f, - 0.39594621273104524f, - 0.396066411085339f, - 0.3961866026531419f, - 0.3963067874323943f, - 0.39642696542103695f, - 0.3965471366170107f, - 0.39666730101825637f, - 0.39678745862271503f, - 0.39690760942832776f, - 0.39702775343303587f, - 0.3971478906347806f, - 0.3972680210315036f, - 0.39738814462114636f, - 0.3975082614016506f, - 0.3976283713709582f, - 0.39774847452701106f, - 0.3978685708677513f, - 0.397988660391121f, - 0.39810874309506256f, - 0.39822881897751833f, - 0.39834888803643087f, - 0.398468950269743f, - 0.3985890056753972f, - 0.3987090542513364f, - 0.3988290959955037f, - 0.3989491309058422f, - 0.39906915898029516f, - 0.39918918021680594f, - 0.39930919461331793f, - 0.39942920216777467f, - 0.39954920287811996f, - 0.3996691967422976f, - 0.39978918375825157f, - 0.39990916392392595f, - 0.40002913723726474f, - 0.40014910369621237f, - 0.4002690632987132f, - 0.40038901604271177f, - 0.4005089619261527f, - 0.40062890094698084f, - 0.40074883310314097f, - 0.4008687583925781f, - 0.4009886768132373f, - 0.4011085883630639f, - 0.4012284930400032f, - 0.4013483908420007f, - 0.40146828176700194f, - 0.4015881658129526f, - 0.40170804297779855f, - 0.4018279132594857f, - 0.4019477766559601f, - 0.402067633165168f, - 0.4021874827850556f, - 0.40230732551356935f, - 0.40242716134865575f, - 0.4025469902882614f, - 0.4026668123303332f, - 0.40278662747281796f, - 0.40290643571366264f, - 0.4030262370508144f, - 0.4031460314822205f, - 0.40326581900582825f, - 0.4033855996195851f, - 0.40350537332143877f, - 0.4036251401093368f, - 0.4037448999812271f, - 0.40386465293505763f, - 0.4039843989687764f, - 0.40410413808033163f, - 0.40422387026767176f, - 0.404343595528745f, - 0.4044633138615f, - 0.4045830252638853f, - 0.40470272973384974f, - 0.4048224272693423f, - 0.4049421178683121f, - 0.4050618015287079f, - 0.4051814782484793f, - 0.4053011480255754f, - 0.40542081085794585f, - 0.4055404667435402f, - 0.4056601156803084f, - 0.4057797576662f, - 0.40589939269916503f, - 0.4060190207771536f, - 0.40613864189811605f, - 0.40625825606000254f, - 0.4063778632607637f, - 0.40649746349834975f, - 0.4066170567707117f, - 0.40673664307580015f, - 0.40685622241156616f, - 0.40697579477596074f, - 0.40709536016693504f, - 0.4072149185824403f, - 0.4073344700204279f, - 0.40745401447884944f, - 0.40757355195565653f, - 0.40769308244880087f, - 0.4078126059562345f, - 0.40793212247590915f, - 0.40805163200577715f, - 0.4081711345437907f, - 0.4082906300879021f, - 0.4084101186360639f, - 0.40852960018622864f, - 0.40864907473634904f, - 0.4087685422843779f, - 0.4088880028282683f, - 0.4090074563659732f, - 0.40912690289544584f, - 0.4092463424146396f, - 0.4093657749215077f, - 0.40948520041400394f, - 0.4096046188900819f, - 0.4097240303476953f, - 0.4098434347847982f, - 0.40996283219934454f, - 0.4100822225892885f, - 0.41020160595258437f, - 0.41032098228718655f, - 0.4104403515910495f, - 0.4105597138621279f, - 0.4106790690983767f, - 0.4107984172977505f, - 0.4109177584582044f, - 0.4110370925776935f, - 0.411156419654173f, - 0.4112757396855984f, - 0.41139505266992515f, - 0.4115143586051088f, - 0.4116336574891051f, - 0.4117529493198698f, - 0.41187223409535895f, - 0.4119915118135287f, - 0.4121107824723353f, - 0.41223004606973485f, - 0.4123493026036839f, - 0.4124685520721391f, - 0.4125877944730571f, - 0.41270702980439467f, - 0.41282625806410883f, - 0.4129454792501566f, - 0.4130646933604951f, - 0.4131839003930817f, - 0.4133031003458738f, - 0.41342229321682894f, - 0.4135414790039047f, - 0.41366065770505905f, - 0.41377982931824975f, - 0.4138989938414348f, - 0.41401815127257247f, - 0.414137301609621f, - 0.41425644485053864f, - 0.41437558099328414f, - 0.41449471003581595f, - 0.41461383197609286f, - 0.4147329468120738f, - 0.4148520545417177f, - 0.4149711551629838f, - 0.4150902486738312f, - 0.41520933507221935f, - 0.41532841435610773f, - 0.4154474865234559f, - 0.41556655157222366f, - 0.4156856095003708f, - 0.4158046603058574f, - 0.4159237039866434f, - 0.4160427405406891f, - 0.4161617699659549f, - 0.41628079226040116f, - 0.41639980742198845f, - 0.4165188154486777f, - 0.41663781633842945f, - 0.4167568100892048f, - 0.4168757966989648f, - 0.4169947761656706f, - 0.4171137484872836f, - 0.4172327136617653f, - 0.4173516716870771f, - 0.4174706225611807f, - 0.417589566282038f, - 0.4177085028476109f, - 0.41782743225586144f, - 0.417946354504752f, - 0.4180652695922445f, - 0.41818417751630155f, - 0.41830307827488566f, - 0.4184219718659596f, - 0.41854085828748605f, - 0.41865973753742813f, - 0.4187786096137486f, - 0.4188974745144106f, - 0.4190163322373777f, - 0.4191351827806131f, - 0.4192540261420804f, - 0.4193728623197433f, - 0.4194916913115654f, - 0.4196105131155107f, - 0.41972932772954324f, - 0.4198481351516271f, - 0.4199669353797266f, - 0.42008572841180625f, - 0.42020451424583033f, - 0.4203232928797636f, - 0.4204420643115708f, - 0.4205608285392168f, - 0.4206795855606666f, - 0.42079833537388545f, - 0.4209170779768384f, - 0.421035813367491f, - 0.42115454154380866f, - 0.421273262503757f, - 0.42139197624530184f, - 0.4215106827664091f, - 0.4216293820650445f, - 0.4217480741391745f, - 0.42186675898676507f, - 0.42198543660578275f, - 0.422104106994194f, - 0.42222277014996545f, - 0.42234142607106373f, - 0.4224600747554558f, - 0.4225787162011086f, - 0.42269735040598927f, - 0.42281597736806503f, - 0.4229345970853033f, - 0.42305320955567144f, - 0.42317181477713717f, - 0.42329041274766815f, - 0.42340900346523225f, - 0.42352758692779746f, - 0.423646163133332f, - 0.4237647320798039f, - 0.4238832937651816f, - 0.4240018481874336f, - 0.4241203953445284f, - 0.42423893523443484f, - 0.4243574678551219f, - 0.42447599320455826f, - 0.4245945112807131f, - 0.42471302208155576f, - 0.4248315256050555f, - 0.42495002184918185f, - 0.42506851081190444f, - 0.4251869924911929f, - 0.425305466885017f, - 0.4254239339913469f, - 0.4255423938081526f, - 0.4256608463334044f, - 0.4257792915650727f, - 0.4258977295011277f, - 0.4260161601395402f, - 0.42613458347828087f, - 0.42625299951532064f, - 0.42637140824863035f, - 0.4264898096761813f, - 0.42660820379594444f, - 0.4267265906058913f, - 0.4268449701039933f, - 0.4269633422882221f, - 0.42708170715654936f, - 0.427200064706947f, - 0.42731841493738687f, - 0.4274367578458412f, - 0.4275550934302821f, - 0.427673421688682f, - 0.42779174261901337f, - 0.42791005621924877f, - 0.42802836248736104f, - 0.4281466614213229f, - 0.4282649530191074f, - 0.4283832372786876f, - 0.4285015141980368f, - 0.4286197837751283f, - 0.42873804600793564f, - 0.4288563008944324f, - 0.42897454843259225f, - 0.4290927886203891f, - 0.4292110214557969f, - 0.42932924693678987f, - 0.42944746506134224f, - 0.4295656758274283f, - 0.4296838792330225f, - 0.4298020752760995f, - 0.429920263954634f, - 0.430038445266601f, - 0.4301566192099755f, - 0.4302747857827325f, - 0.43039294498284725f, - 0.4305110968082951f, - 0.43062924125705165f, - 0.43074737832709253f, - 0.43086550801639356f, - 0.43098363032293036f, - 0.4311017452446791f, - 0.43121985277961594f, - 0.4313379529257171f, - 0.4314560456809589f, - 0.4315741310433181f, - 0.431692209010771f, - 0.43181027958129453f, - 0.4319283427528656f, - 0.4320463985234612f, - 0.43216444689105854f, - 0.4322824878536348f, - 0.43240052140916746f, - 0.43251854755563396f, - 0.432636566291012f, - 0.43275457761327935f, - 0.4328725815204139f, - 0.4329905780103938f, - 0.43310856708119705f, - 0.433226548730802f, - 0.4333445229571871f, - 0.4334624897583309f, - 0.433580449132212f, - 0.4336984010768093f, - 0.4338163455901016f, - 0.43393428267006806f, - 0.4340522123146878f, - 0.4341701345219402f, - 0.4342880492898046f, - 0.4344059566162606f, - 0.4345238564992879f, - 0.4346417489368663f, - 0.43475963392697575f, - 0.4348775114675963f, - 0.43499538155670825f, - 0.43511324419229186f, - 0.4352310993723275f, - 0.4353489470947959f, - 0.43546678735767763f, - 0.43558462015895366f, - 0.43570244549660486f, - 0.4358202633686125f, - 0.43593807377295757f, - 0.4360558767076215f, - 0.43617367217058584f, - 0.43629146015983206f, - 0.436409240673342f, - 0.43652701370909763f, - 0.4366447792650807f, - 0.4367625373392735f, - 0.4368802879296581f, - 0.4369980310342171f, - 0.4371157666509328f, - 0.43723349477778817f, - 0.43735121541276556f, - 0.43746892855384795f, - 0.4375866341990185f, - 0.4377043323462603f, - 0.43782202299355666f, - 0.437939706138891f, - 0.43805738178024667f, - 0.4381750499156074f, - 0.43829271054295715f, - 0.43841036366027963f, - 0.438528009265559f, - 0.4386456473567795f, - 0.4387632779319252f, - 0.43888090098898075f, - 0.4389985165259306f, - 0.43911612454075943f, - 0.43923372503145214f, - 0.4393513179959937f, - 0.43946890343236905f, - 0.4395864813385635f, - 0.43970405171256227f, - 0.43982161455235097f, - 0.4399391698559151f, - 0.4400567176212405f, - 0.4401742578463128f, - 0.4402917905291182f, - 0.4404093156676427f, - 0.4405268332598725f, - 0.4406443433037941f, - 0.4407618457973939f, - 0.44087934073865853f, - 0.4409968281255748f, - 0.4411143079561295f, - 0.4412317802283098f, - 0.44134924494010264f, - 0.4414667020894955f, - 0.4415841516744756f, - 0.44170159369303064f, - 0.44181902814314816f, - 0.441936455022816f, - 0.4420538743300221f, - 0.44217128606275447f, - 0.4422886902190013f, - 0.4424060867967509f, - 0.44252347579399176f, - 0.4426408572087124f, - 0.44275823103890144f, - 0.44287559728254794f, - 0.44299295593764076f, - 0.4431103070021689f, - 0.4432276504741216f, - 0.4433449863514882f, - 0.4434623146322584f, - 0.4435796353144215f, - 0.44369694839596757f, - 0.44381425387488616f, - 0.4439315517491674f, - 0.44404884201680145f, - 0.44416612467577854f, - 0.4442833997240891f, - 0.44440066715972376f, - 0.4445179269806729f, - 0.44463517918492745f, - 0.44475242377047836f, - 0.44486966073531664f, - 0.4449868900774335f, - 0.44510411179482023f, - 0.4452213258854682f, - 0.44533853234736903f, - 0.44545573117851445f, - 0.4455729223768963f, - 0.4456901059405064f, - 0.44580728186733704f, - 0.4459244501553803f, - 0.44604161080262855f, - 0.44615876380707437f, - 0.4462759091667102f, - 0.446393046879529f, - 0.4465101769435236f, - 0.4466272993566868f, - 0.44674441411701193f, - 0.44686152122249223f, - 0.4469786206711211f, - 0.447095712460892f, - 0.4472127965897988f, - 0.447329873055835f, - 0.44744694185699474f, - 0.44756400299127197f, - 0.44768105645666095f, - 0.447798102251156f, - 0.44791514037275154f, - 0.4480321708194422f, - 0.44814919358922256f, - 0.4482662086800876f, - 0.44838321609003223f, - 0.4485002158170516f, - 0.448617207859141f, - 0.4487341922142957f, - 0.44885116888051124f, - 0.44896813785578327f, - 0.4490850991381075f, - 0.4492020527254799f, - 0.44931899861589664f, - 0.4494359368073536f, - 0.44955286729784716f, - 0.44966979008537383f, - 0.4497867051679301f, - 0.44990361254351274f, - 0.4500205122101186f, - 0.4501374041657445f, - 0.4502542884083875f, - 0.45037116493604495f, - 0.4504880337467142f, - 0.45060489483839267f, - 0.4507217482090781f, - 0.450838593856768f, - 0.45095543177946046f, - 0.4510722619751534f, - 0.451189084441845f, - 0.45130589917753355f, - 0.45142270618021746f, - 0.45153950544789523f, - 0.4516562969785656f, - 0.45177308077022726f, - 0.4518898568208793f, - 0.4520066251285207f, - 0.45212338569115074f, - 0.45224013850676864f, - 0.452356883573374f, - 0.4524736208889663f, - 0.45259035045154544f, - 0.4527070722591111f, - 0.4528237863096635f, - 0.45294049260120256f, - 0.4530571911317287f, - 0.45317388189924224f, - 0.45329056490174374f, - 0.4534072401372339f, - 0.45352390760371347f, - 0.4536405672991834f, - 0.4537572192216448f, - 0.4538738633690988f, - 0.45399049973954675f, - 0.4541071283309902f, - 0.4542237491414307f, - 0.4543403621688699f, - 0.4544569674113098f, - 0.45457356486675227f, - 0.45469015453319955f, - 0.4548067364086538f, - 0.4549233104911177f, - 0.4550398767785934f, - 0.45515643526908384f, - 0.4552729859605917f, - 0.45538952885111983f, - 0.4555060639386715f, - 0.45562259122124993f, - 0.45573911069685824f, - 0.4558556223635f, - 0.4559721262191788f, - 0.45608862226189845f, - 0.4562051104896628f, - 0.45632159090047586f, - 0.45643806349234173f, - 0.4565545282632646f, - 0.456670985211249f, - 0.45678743433429947f, - 0.4569038756304206f, - 0.4570203090976173f, - 0.45713673473389455f, - 0.4572531525372573f, - 0.4573695625057108f, - 0.4574859646372604f, - 0.4576023589299116f, - 0.45771874538167f, - 0.4578351239905414f, - 0.4579514947545316f, - 0.45806785767164665f, - 0.45818421273989274f, - 0.4583005599572761f, - 0.4584168993218032f, - 0.4585332308314806f, - 0.45864955448431494f, - 0.45876587027831306f, - 0.4588821782114819f, - 0.45899847828182866f, - 0.4591147704873605f, - 0.4592310548260848f, - 0.45934733129600896f, - 0.45946359989514074f, - 0.4595798606214878f, - 0.4596961134730582f, - 0.45981235844785984f, - 0.459928595543901f, - 0.4600448247591899f, - 0.46016104609173497f, - 0.46027725953954485f, - 0.4603934651006283f, - 0.460509662772994f, - 0.46062585255465116f, - 0.46074203444360873f, - 0.46085820843787595f, - 0.46097437453546236f, - 0.4610905327343773f, - 0.46120668303263057f, - 0.46132282542823205f, - 0.4614389599191914f, - 0.46155508650351895f, - 0.4616712051792247f, - 0.46178731594431904f, - 0.4619034187968125f, - 0.46201951373471584f, - 0.4621356007560395f, - 0.46225167985879445f, - 0.46236775104099176f, - 0.46248381430064256f, - 0.46259986963575817f, - 0.4627159170443501f, - 0.4628319565244297f, - 0.4629479880740087f, - 0.46306401169109906f, - 0.4631800273737127f, - 0.46329603511986167f, - 0.46341203492755834f, - 0.46352802679481486f, - 0.46364401071964395f, - 0.46375998670005814f, - 0.46387595473407023f, - 0.46399191481969315f, - 0.46410786695494005f, - 0.46422381113782396f, - 0.4643397473663583f, - 0.4644556756385565f, - 0.4645715959524322f, - 0.4646875083059991f, - 0.4648034126972711f, - 0.46491930912426216f, - 0.46503519758498646f, - 0.4651510780774583f, - 0.4652669505996921f, - 0.46538281514970237f, - 0.4654986717255039f, - 0.4656145203251114f, - 0.46573036094653986f, - 0.46584619358780444f, - 0.46596201824692035f, - 0.4660778349219029f, - 0.4661936436107678f, - 0.4663094443115305f, - 0.4664252370222068f, - 0.4665410217408127f, - 0.46665679846536423f, - 0.4667725671938776f, - 0.4668883279243692f, - 0.4670040806548553f, - 0.4671198253833527f, - 0.46723556210787814f, - 0.4673512908264484f, - 0.46746701153708053f, - 0.46758272423779185f, - 0.46769842892659935f, - 0.4678141256015207f, - 0.4679298142605734f, - 0.46804549490177505f, - 0.4681611675231437f, - 0.4682768321226973f, - 0.46839248869845374f, - 0.46850813724843143f, - 0.4686237777706488f, - 0.4687394102631243f, - 0.4688550347238767f, - 0.46897065115092484f, - 0.46908625954228744f, - 0.4692018598959837f, - 0.46931745221003285f, - 0.46943303648245427f, - 0.46954861271126747f, - 0.4696641808944921f, - 0.46977974103014775f, - 0.4698952931162545f, - 0.47001083715083236f, - 0.4701263731319015f, - 0.4702419010574822f, - 0.47035742092559507f, - 0.4704729327342605f, - 0.4705884364814994f, - 0.4707039321653325f, - 0.47081941978378095f, - 0.4709348993348658f, - 0.4710503708166085f, - 0.47116583422703023f, - 0.4712812895641527f, - 0.47139673682599764f, - 0.4715121760105868f, - 0.4716276071159422f, - 0.471743030140086f, - 0.47185844508104047f, - 0.4719738519368279f, - 0.47208925070547086f, - 0.47220464138499213f, - 0.4723200239734144f, - 0.47243539846876065f, - 0.472550764869054f, - 0.47266612317231765f, - 0.47278147337657495f, - 0.47289681547984946f, - 0.4730121494801648f, - 0.47312747537554467f, - 0.47324279316401324f, - 0.4733581028435943f, - 0.4734734044123121f, - 0.47358869786819113f, - 0.47370398320925566f, - 0.47381926043353045f, - 0.47393452953904036f, - 0.47404979052381f, - 0.47416504338586457f, - 0.4742802881232292f, - 0.4743955247339292f, - 0.4745107532159901f, - 0.4746259735674376f, - 0.47474118578629704f, - 0.47485638987059453f, - 0.47497158581835613f, - 0.47508677362760793f, - 0.4752019532963762f, - 0.47531712482268745f, - 0.47543228820456807f, - 0.4755474434400449f, - 0.4756625905271448f, - 0.4757777294638947f, - 0.4758928602483217f, - 0.4760079828784532f, - 0.4761230973523165f, - 0.47623820366793906f, - 0.47635330182334873f, - 0.47646839181657324f, - 0.47658347364564063f, - 0.4766985473085789f, - 0.4768136128034164f, - 0.4769286701281814f, - 0.4770437192809025f, - 0.4771587602596084f, - 0.4772737930623278f, - 0.47738881768708974f, - 0.4775038341319232f, - 0.4776188423948575f, - 0.477733842473922f, - 0.4778488343671461f, - 0.47796381807255955f, - 0.47807879358819216f, - 0.4781937609120738f, - 0.47830872004223446f, - 0.47842367097670446f, - 0.4785386137135141f, - 0.47865354825069384f, - 0.4787684745862744f, - 0.4788833927182865f, - 0.478998302644761f, - 0.479113204363729f, - 0.47922809787322174f, - 0.4793429831712704f, - 0.4794578602559066f, - 0.47957272912516186f, - 0.479687589777068f, - 0.47980244220965684f, - 0.4799172864209605f, - 0.4800321224090111f, - 0.48014695017184106f, - 0.48026176970748263f, - 0.4803765810139686f, - 0.48049138408933156f, - 0.48060617893160446f, - 0.4807209655388204f, - 0.4808357439090124f, - 0.48095051404021383f, - 0.48106527593045817f, - 0.48118002957777894f, - 0.4812947749802099f, - 0.4814095121357849f, - 0.48152424104253816f, - 0.48163896169850345f, - 0.4817536741017153f, - 0.48186837825020806f, - 0.48198307414201635f, - 0.4820977617751749f, - 0.48221244114771855f, - 0.48232711225768227f, - 0.4824417751031012f, - 0.48255642968201073f, - 0.48267107599244613f, - 0.4827857140324431f, - 0.4829003438000374f, - 0.4830149652932646f, - 0.4831295785101609f, - 0.4832441834487624f, - 0.48335878010710526f, - 0.4834733684832261f, - 0.48358794857516146f, - 0.48370252038094796f, - 0.4838170838986224f, - 0.4839316391262218f, - 0.4840461860617833f, - 0.4841607247033442f, - 0.484275255048942f, - 0.48438977709661396f, - 0.4845042908443979f, - 0.48461879629033183f, - 0.4847332934324536f, - 0.4848477822688013f, - 0.4849622627974134f, - 0.48507673501632803f, - 0.4851911989235838f, - 0.4853056545172195f, - 0.48542010179527395f, - 0.48553454075578606f, - 0.485648971396795f, - 0.48576339371634003f, - 0.48587780771246053f, - 0.48599221338319604f, - 0.4861066107265863f, - 0.4862209997406711f, - 0.48633538042349045f, - 0.4864497527730845f, - 0.4865641167874934f, - 0.48667847246475754f, - 0.4867928198029176f, - 0.4869071588000142f, - 0.4870214894540882f, - 0.4871358117631805f, - 0.4872501257253323f, - 0.4873644313385848f, - 0.48747872860097946f, - 0.48759301751055784f, - 0.4877072980653615f, - 0.48782157026343254f, - 0.48793583410281266f, - 0.48805008958154406f, - 0.48816433669766907f, - 0.48827857544923f, - 0.48839280583426936f, - 0.48850702785083017f, - 0.4886212414969549f, - 0.4887354467706867f, - 0.48884964367006867f, - 0.488963832193144f, - 0.4890780123379562f, - 0.4891921841025489f, - 0.48930634748496554f, - 0.48942050248325014f, - 0.4895346490954466f, - 0.48964878731959915f, - 0.489762917153752f, - 0.48987703859594967f, - 0.48999115164423657f, - 0.49010525629665747f, - 0.4902193525512572f, - 0.49033344040608073f, - 0.49044751985917323f, - 0.49056159090858015f, - 0.49067565355234644f, - 0.49078970778851816f, - 0.49090375361514077f, - 0.4910177910302602f, - 0.4911318200319224f, - 0.4912458406181737f, - 0.4913598527870601f, - 0.49147385653662823f, - 0.49158785186492454f, - 0.49170183876999585f, - 0.491815817249889f, - 0.49192978730265097f, - 0.49204374892632896f, - 0.4921577021189702f, - 0.49227164687862224f, - 0.49238558320333253f, - 0.4924995110911489f, - 0.4926134305401193f, - 0.49272734154829156f, - 0.49284124411371394f, - 0.49295513823443476f, - 0.4930690239085025f, - 0.4931829011339656f, - 0.49329676990887306f, - 0.4934106302312736f, - 0.49352448209921623f, - 0.49363832551075026f, - 0.4937521604639249f, - 0.4938659869567897f, - 0.4939798049873943f, - 0.4940936145537883f, - 0.49420741565402176f, - 0.4943212082861446f, - 0.4944349924482071f, - 0.4945487681382596f, - 0.49466253535435256f, - 0.4947762940945366f, - 0.4948900443568625f, - 0.49500378613938123f, - 0.4951175194401438f, - 0.49523124425720144f, - 0.4953449605886056f, - 0.4954586684324076f, - 0.49557236778665914f, - 0.495686058649412f, - 0.49579974101871815f, - 0.49591341489262974f, - 0.49602708026919906f, - 0.4961407371464782f, - 0.49625438552251994f, - 0.49636802539537683f, - 0.4964816567631017f, - 0.4965952796237475f, - 0.4967088939753674f, - 0.49682249981601456f, - 0.49693609714374226f, - 0.4970496859566043f, - 0.4971632662526543f, - 0.49727683802994604f, - 0.49739040128653356f, - 0.49750395602047087f, - 0.49761750222981227f, - 0.4977310399126122f, - 0.49784456906692526f, - 0.4979580896908061f, - 0.49807160178230964f, - 0.4981851053394908f, - 0.4982986003604048f, - 0.4984120868431069f, - 0.4985255647856525f, - 0.4986390341860973f, - 0.498752495042497f, - 0.4988659473529074f, - 0.49897939111538453f, - 0.4990928263279846f, - 0.4992062529887639f, - 0.49931967109577896f, - 0.49943308064708636f, - 0.49954648164074283f, - 0.49965987407480533f, - 0.49977325794733085f, - 0.4998866332563766f, - 0.49999999999999994f, - 0.5001133581762583f, - 0.5002267077832097f, - 0.5003400488189113f, - 0.5004533812814214f, - 0.500566705168798f, - 0.5006800204790993f, - 0.5007933272103837f, - 0.5009066253607098f, - 0.5010199149281362f, - 0.5011331959107218f, - 0.5012464683065254f, - 0.5013597321136062f, - 0.5014729873300233f, - 0.5015862339538365f, - 0.5016994719831049f, - 0.5018127014158884f, - 0.5019259222502468f, - 0.5020391344842402f, - 0.5021523381159286f, - 0.5022655331433725f, - 0.5023787195646321f, - 0.502491897377768f, - 0.502605066580841f, - 0.5027182271719121f, - 0.5028313791490421f, - 0.5029445225102923f, - 0.5030576572537239f, - 0.5031707833773984f, - 0.5032839008793776f, - 0.5033970097577231f, - 0.5035101100104967f, - 0.5036232016357608f, - 0.5037362846315774f, - 0.5038493589960087f, - 0.5039624247271174f, - 0.5040754818229661f, - 0.5041885302816177f, - 0.504301570101135f, - 0.504414601279581f, - 0.5045276238150193f, - 0.5046406377055128f, - 0.5047536429491255f, - 0.5048666395439209f, - 0.5049796274879629f, - 0.5050926067793152f, - 0.5052055774160422f, - 0.5053185393962082f, - 0.5054314927178775f, - 0.5055444373791147f, - 0.5056573733779846f, - 0.5057703007125519f, - 0.5058832193808819f, - 0.5059961293810394f, - 0.5061090307110901f, - 0.5062219233690992f, - 0.5063348073531325f, - 0.5064476826612556f, - 0.5065605492915346f, - 0.5066734072420352f, - 0.5067862565108241f, - 0.5068990970959671f, - 0.5070119289955314f, - 0.507124752207583f, - 0.507237566730189f, - 0.5073503725614165f, - 0.5074631696993323f, - 0.5075759581420037f, - 0.5076887378874984f, - 0.5078015089338836f, - 0.5079142712792272f, - 0.5080270249215968f, - 0.5081397698590607f, - 0.508252506089687f, - 0.5083652336115438f, - 0.5084779524226998f, - 0.5085906625212233f, - 0.5087033639051833f, - 0.5088160565726486f, - 0.5089287405216881f, - 0.5090414157503713f, - 0.5091540822567673f, - 0.5092667400389456f, - 0.5093793890949759f, - 0.509492029422928f, - 0.5096046610208719f, - 0.5097172838868775f, - 0.5098298980190152f, - 0.5099425034153554f, - 0.5100551000739685f, - 0.5101676879929252f, - 0.5102802671702964f, - 0.5103928376041531f, - 0.5105053992925664f, - 0.5106179522336077f, - 0.5107304964253483f, - 0.5108430318658598f, - 0.510955558553214f, - 0.5110680764854828f, - 0.5111805856607381f, - 0.511293086077052f, - 0.5114055777324973f, - 0.5115180606251459f, - 0.511630534753071f, - 0.5117430001143449f, - 0.5118554567070408f, - 0.5119679045292318f, - 0.512080343578991f, - 0.5121927738543919f, - 0.5123051953535079f, - 0.5124176080744131f, - 0.5125300120151807f, - 0.5126424071738851f, - 0.5127547935486003f, - 0.5128671711374007f, - 0.5129795399383605f, - 0.5130918999495547f, - 0.5132042511690578f, - 0.5133165935949446f, - 0.5134289272252903f, - 0.51354125205817f, - 0.5136535680916592f, - 0.5137658753238332f, - 0.5138781737527678f, - 0.5139904633765386f, - 0.5141027441932217f, - 0.5142150162008932f, - 0.5143272793976292f, - 0.5144395337815063f, - 0.5145517793506011f, - 0.5146640161029901f, - 0.5147762440367502f, - 0.5148884631499584f, - 0.5150006734406919f, - 0.5151128749070281f, - 0.5152250675470443f, - 0.515337251358818f, - 0.5154494263404272f, - 0.5155615924899498f, - 0.5156737498054638f, - 0.5157858982850474f, - 0.515898037926779f, - 0.5160101687287371f, - 0.5161222906890003f, - 0.5162344038056476f, - 0.5163465080767576f, - 0.51645860350041f, - 0.5165706900746835f, - 0.5166827677976579f, - 0.5167948366674127f, - 0.5169068966820275f, - 0.5170189478395824f, - 0.5171309901381571f, - 0.5172430235758322f, - 0.5173550481506878f, - 0.5174670638608043f, - 0.5175790707042626f, - 0.5176910686791433f, - 0.5178030577835273f, - 0.5179150380154959f, - 0.5180270093731302f, - 0.5181389718545116f, - 0.5182509254577218f, - 0.5183628701808424f, - 0.5184748060219552f, - 0.5185867329791424f, - 0.5186986510504858f, - 0.5188105602340681f, - 0.5189224605279716f, - 0.5190343519302789f, - 0.5191462344390728f, - 0.5192581080524363f, - 0.5193699727684524f, - 0.5194818285852042f, - 0.5195936755007753f, - 0.5197055135132491f, - 0.5198173426207094f, - 0.51992916282124f, - 0.5200409741129248f, - 0.5201527764938481f, - 0.5202645699620938f, - 0.5203763545157469f, - 0.5204881301528917f, - 0.5205998968716131f, - 0.5207116546699958f, - 0.520823403546125f, - 0.5209351434980859f, - 0.5210468745239638f, - 0.5211585966218443f, - 0.5212703097898131f, - 0.5213820140259559f, - 0.5214937093283587f, - 0.5216053956951078f, - 0.5217170731242893f, - 0.5218287416139896f, - 0.5219404011622957f, - 0.5220520517672937f, - 0.522163693427071f, - 0.5222753261397145f, - 0.5223869499033112f, - 0.5224985647159488f, - 0.5226101705757147f, - 0.5227217674806964f, - 0.5228333554289819f, - 0.5229449344186591f, - 0.523056504447816f, - 0.5231680655145411f, - 0.5232796176169229f, - 0.5233911607530496f, - 0.5235026949210103f, - 0.5236142201188937f, - 0.5237257363447888f, - 0.523837243596785f, - 0.5239487418729715f, - 0.524060231171438f, - 0.5241717114902739f, - 0.524283182827569f, - 0.5243946451814137f, - 0.5245060985498976f, - 0.5246175429311113f, - 0.5247289783231451f, - 0.5248404047240897f, - 0.5249518221320356f, - 0.525063230545074f, - 0.5251746299612956f, - 0.525286020378792f, - 0.5253974017956543f, - 0.525508774209974f, - 0.5256201376198429f, - 0.5257314920233527f, - 0.5258428374185955f, - 0.5259541738036633f, - 0.5260655011766484f, - 0.5261768195356432f, - 0.5262881288787403f, - 0.5263994292040327f, - 0.526510720509613f, - 0.5266220027935744f, - 0.52673327605401f, - 0.5268445402890132f, - 0.5269557954966776f, - 0.5270670416750967f, - 0.5271782788223645f, - 0.527289506936575f, - 0.527400726015822f, - 0.5275119360582002f, - 0.527623137061804f, - 0.5277343290247277f, - 0.5278455119450663f, - 0.5279566858209148f, - 0.528067850650368f, - 0.5281790064315213f, - 0.52829015316247f, - 0.5284012908413095f, - 0.5285124194661358f, - 0.5286235390350444f, - 0.5287346495461317f, - 0.5288457509974935f, - 0.5289568433872263f, - 0.5290679267134264f, - 0.5291790009741906f, - 0.5292900661676155f, - 0.5294011222917983f, - 0.5295121693448357f, - 0.5296232073248252f, - 0.529734236229864f, - 0.5298452560580499f, - 0.5299562668074804f, - 0.5300672684762535f, - 0.5301782610624672f, - 0.5302892445642196f, - 0.530400218979609f, - 0.530511184306734f, - 0.5306221405436932f, - 0.5307330876885854f, - 0.5308440257395095f, - 0.5309549546945646f, - 0.53106587455185f, - 0.531176785309465f, - 0.5312876869655093f, - 0.5313985795180829f, - 0.5315094629652852f, - 0.5316203373052164f, - 0.5317312025359768f, - 0.5318420586556667f, - 0.5319529056623866f, - 0.5320637435542374f, - 0.5321745723293194f, - 0.5322853919857339f, - 0.532396202521582f, - 0.5325070039349651f, - 0.5326177962239845f, - 0.532728579386742f, - 0.532839353421339f, - 0.5329501183258778f, - 0.5330608740984603f, - 0.5331716207371886f, - 0.5332823582401652f, - 0.5333930866054928f, - 0.533503805831274f, - 0.5336145159156115f, - 0.5337252168566085f, - 0.533835908652368f, - 0.5339465913009935f, - 0.5340572648005885f, - 0.5341679291492565f, - 0.5342785843451012f, - 0.5343892303862268f, - 0.5344998672707373f, - 0.534610494996737f, - 0.5347211135623303f, - 0.5348317229656218f, - 0.5349423232047161f, - 0.5350529142777183f, - 0.5351634961827334f, - 0.5352740689178664f, - 0.5353846324812231f, - 0.5354951868709087f, - 0.5356057320850288f, - 0.5357162681216895f, - 0.5358267949789967f, - 0.5359373126550564f, - 0.5360478211479751f, - 0.5361583204558592f, - 0.5362688105768153f, - 0.5363792915089503f, - 0.5364897632503709f, - 0.5366002257991844f, - 0.5367106791534981f, - 0.5368211233114193f, - 0.5369315582710555f, - 0.5370419840305145f, - 0.5371524005879043f, - 0.5372628079413326f, - 0.5373732060889082f, - 0.5374835950287388f, - 0.5375939747589332f, - 0.5377043452776002f, - 0.5378147065828485f, - 0.5379250586727871f, - 0.5380354015455252f, - 0.538145735199172f, - 0.538256059631837f, - 0.5383663748416296f, - 0.5384766808266601f, - 0.5385869775850382f, - 0.5386972651148738f, - 0.5388075434142774f, - 0.5389178124813592f, - 0.5390280723142299f, - 0.5391383229110002f, - 0.5392485642697811f, - 0.5393587963886834f, - 0.5394690192658185f, - 0.5395792328992977f, - 0.5396894372872324f, - 0.5397996324277345f, - 0.5399098183189157f, - 0.5400199949588882f, - 0.5401301623457638f, - 0.540240320477655f, - 0.5403504693526743f, - 0.5404606089689343f, - 0.5405707393245477f, - 0.5406808604176276f, - 0.540790972246287f, - 0.5409010748086391f, - 0.5410111681027976f, - 0.5411212521268758f, - 0.5412313268789876f, - 0.5413413923572468f, - 0.5414514485597675f, - 0.5415614954846638f, - 0.5416715331300502f, - 0.5417815614940413f, - 0.5418915805747517f, - 0.5420015903702963f, - 0.54211159087879f, - 0.542221582098348f, - 0.5423315640270858f, - 0.5424415366631187f, - 0.5425515000045624f, - 0.5426614540495328f, - 0.5427713987961459f, - 0.5428813342425175f, - 0.5429912603867642f, - 0.5431011772270024f, - 0.5432110847613484f, - 0.5433209829879193f, - 0.5434308719048322f, - 0.5435407515102038f, - 0.5436506218021514f, - 0.5437604827787924f, - 0.5438703344382446f, - 0.5439801767786254f, - 0.544090009798053f, - 0.5441998334946452f, - 0.5443096478665201f, - 0.5444194529117965f, - 0.5445292486285925f, - 0.544639035015027f, - 0.5447488120692189f, - 0.5448585797892869f, - 0.5449683381733503f, - 0.5450780872195286f, - 0.545187826925941f, - 0.5452975572907074f, - 0.5454072783119474f, - 0.545516989987781f, - 0.5456266923163284f, - 0.5457363852957098f, - 0.5458460689240457f, - 0.5459557431994567f, - 0.5460654081200635f, - 0.5461750636839872f, - 0.5462847098893486f, - 0.5463943467342691f, - 0.54650397421687f, - 0.5466135923352731f, - 0.5467232010875999f, - 0.5468328004719724f, - 0.5469423904865125f, - 0.5470519711293425f, - 0.5471615423985848f, - 0.5472711042923619f, - 0.5473806568087966f, - 0.5474901999460114f, - 0.5475997337021298f, - 0.5477092580752745f, - 0.5478187730635691f, - 0.5479282786651369f, - 0.5480377748781018f, - 0.5481472617005875f, - 0.5482567391307179f, - 0.5483662071666172f, - 0.5484756658064097f, - 0.5485851150482199f, - 0.5486945548901724f, - 0.5488039853303919f, - 0.5489134063670033f, - 0.5490228179981318f, - 0.5491322202219024f, - 0.5492416130364411f, - 0.5493509964398732f, - 0.5494603704303241f, - 0.5495697350059202f, - 0.5496790901647873f, - 0.5497884359050517f, - 0.5498977722248397f, - 0.5500070991222781f, - 0.5501164165954934f, - 0.5502257246426123f, - 0.5503350232617623f, - 0.5504443124510703f, - 0.5505535922086636f, - 0.55066286253267f, - 0.5507721234212171f, - 0.5508813748724325f, - 0.5509906168844443f, - 0.5510998494553808f, - 0.5512090725833704f, - 0.5513182862665412f, - 0.5514274905030223f, - 0.5515366852909424f, - 0.5516458706284302f, - 0.5517550465136151f, - 0.5518642129446264f, - 0.5519733699195936f, - 0.552082517436646f, - 0.5521916554939137f, - 0.5523007840895265f, - 0.5524099032216148f, - 0.5525190128883084f, - 0.5526281130877381f, - 0.5527372038180344f, - 0.5528462850773279f, - 0.5529553568637499f, - 0.553064419175431f, - 0.5531734720105028f, - 0.5532825153670967f, - 0.5533915492433441f, - 0.5535005736373768f, - 0.5536095885473267f, - 0.5537185939713258f, - 0.5538275899075065f, - 0.553936576354001f, - 0.5540455533089419f, - 0.554154520770462f, - 0.554263478736694f, - 0.5543724272057712f, - 0.5544813661758264f, - 0.5545902956449934f, - 0.5546992156114054f, - 0.5548081260731963f, - 0.5549170270284998f, - 0.5550259184754498f, - 0.5551348004121808f, - 0.555243672836827f, - 0.5553525357475227f, - 0.555461389142403f, - 0.5555702330196022f, - 0.5556790673772557f, - 0.5557878922134984f, - 0.5558967075264658f, - 0.5560055133142934f, - 0.5561143095751165f, - 0.5562230963070712f, - 0.5563318735082935f, - 0.5564406411769194f, - 0.5565493993110853f, - 0.5566581479089276f, - 0.5567668869685829f, - 0.556875616488188f, - 0.5569843364658799f, - 0.5570930468997956f, - 0.5572017477880724f, - 0.5573104391288479f, - 0.5574191209202596f, - 0.5575277931604451f, - 0.5576364558475426f, - 0.5577451089796901f, - 0.5578537525550258f, - 0.5579623865716883f, - 0.5580710110278159f, - 0.5581796259215475f, - 0.558288231251022f, - 0.5583968270143785f, - 0.5585054132097562f, - 0.5586139898352945f, - 0.5587225568891331f, - 0.5588311143694116f, - 0.5589396622742699f, - 0.5590482006018481f, - 0.5591567293502865f, - 0.5592652485177254f, - 0.5593737581023053f, - 0.559482258102167f, - 0.5595907485154513f, - 0.5596992293402994f, - 0.5598077005748523f, - 0.5599161622172515f, - 0.5600246142656385f, - 0.5601330567181552f, - 0.5602414895729432f, - 0.5603499128281446f, - 0.5604583264819016f, - 0.5605667305323568f, - 0.5606751249776524f, - 0.5607835098159312f, - 0.5608918850453359f, - 0.5610002506640097f, - 0.561108606670096f, - 0.5612169530617378f, - 0.5613252898370787f, - 0.5614336169942624f, - 0.5615419345314329f, - 0.5616502424467339f, - 0.5617585407383098f, - 0.5618668294043049f, - 0.5619751084428636f, - 0.5620833778521306f, - 0.5621916376302508f, - 0.5622998877753692f, - 0.5624081282856309f, - 0.5625163591591814f, - 0.562624580394166f, - 0.5627327919887303f, - 0.5628409939410203f, - 0.5629491862491819f, - 0.5630573689113614f, - 0.5631655419257048f, - 0.5632737052903589f, - 0.5633818590034703f, - 0.5634900030631856f, - 0.5635981374676521f, - 0.5637062622150166f, - 0.5638143773034268f, - 0.5639224827310299f, - 0.5640305784959735f, - 0.5641386645964056f, - 0.564246741030474f, - 0.564354807796327f, - 0.5644628648921128f, - 0.56457091231598f, - 0.564678950066077f, - 0.5647869781405529f, - 0.5648949965375564f, - 0.5650030052552367f, - 0.5651110042917433f, - 0.5652189936452255f, - 0.5653269733138329f, - 0.5654349432957153f, - 0.5655429035890227f, - 0.5656508541919053f, - 0.5657587951025133f, - 0.5658667263189971f, - 0.5659746478395076f, - 0.5660825596621953f, - 0.5661904617852113f, - 0.5662983542067067f, - 0.5664062369248328f, - 0.5665141099377411f, - 0.5666219732435831f, - 0.5667298268405107f, - 0.5668376707266757f, - 0.5669455049002304f, - 0.5670533293593273f, - 0.5671611441021184f, - 0.5672689491267565f, - 0.5673767444313944f, - 0.5674845300141851f, - 0.5675923058732817f, - 0.5677000720068376f, - 0.5678078284130059f, - 0.5679155750899405f, - 0.5680233120357953f, - 0.568131039248724f, - 0.5682387567268808f, - 0.5683464644684202f, - 0.5684541624714963f, - 0.5685618507342639f, - 0.5686695292548779f, - 0.5687771980314931f, - 0.5688848570622647f, - 0.5689925063453478f, - 0.5691001458788982f, - 0.5692077756610713f, - 0.5693153956900229f, - 0.569423005963909f, - 0.5695306064808858f, - 0.5696381972391096f, - 0.5697457782367367f, - 0.5698533494719238f, - 0.5699609109428276f, - 0.5700684626476054f, - 0.570176004584414f, - 0.5702835367514107f, - 0.5703910591467531f, - 0.5704985717685989f, - 0.5706060746151057f, - 0.5707135676844316f, - 0.5708210509747348f, - 0.5709285244841734f, - 0.5710359882109061f, - 0.5711434421530912f, - 0.5712508863088879f, - 0.5713583206764549f, - 0.5714657452539514f, - 0.5715731600395367f, - 0.5716805650313705f, - 0.5717879602276122f, - 0.5718953456264217f, - 0.572002721225959f, - 0.572110087024384f, - 0.5722174430198573f, - 0.5723247892105395f, - 0.5724321255945909f, - 0.5725394521701724f, - 0.5726467689354452f, - 0.5727540758885702f, - 0.5728613730277089f, - 0.5729686603510229f, - 0.5730759378566735f, - 0.5731832055428228f, - 0.5732904634076327f, - 0.5733977114492653f, - 0.5735049496658832f, - 0.5736121780556487f, - 0.5737193966167243f, - 0.5738266053472733f, - 0.5739338042454583f, - 0.5740409933094426f, - 0.5741481725373896f, - 0.5742553419274629f, - 0.5743625014778259f, - 0.5744696511866426f, - 0.5745767910520772f, - 0.5746839210722935f, - 0.5747910412454561f, - 0.5748981515697296f, - 0.5750052520432786f, - 0.5751123426642678f, - 0.5752194234308625f, - 0.5753264943412277f, - 0.5754335553935289f, - 0.5755406065859318f, - 0.5756476479166016f, - 0.5757546793837045f, - 0.5758617009854066f, - 0.575968712719874f, - 0.5760757145852731f, - 0.5761827065797704f, - 0.5762896887015329f, - 0.5763966609487271f, - 0.5765036233195202f, - 0.5766105758120796f, - 0.5767175184245725f, - 0.5768244511551666f, - 0.5769313740020295f, - 0.5770382869633292f, - 0.5771451900372336f, - 0.5772520832219112f, - 0.5773589665155303f, - 0.5774658399162595f, - 0.5775727034222675f, - 0.5776795570317234f, - 0.5777864007427961f, - 0.5778932345536548f, - 0.5780000584624692f, - 0.5781068724674087f, - 0.5782136765666431f, - 0.5783204707583424f, - 0.5784272550406766f, - 0.578534029411816f, - 0.5786407938699312f, - 0.5787475484131928f, - 0.5788542930397714f, - 0.5789610277478381f, - 0.579067752535564f, - 0.5791744674011204f, - 0.5792811723426788f, - 0.5793878673584109f, - 0.5794945524464883f, - 0.579601227605083f, - 0.5797078928323673f, - 0.5798145481265136f, - 0.5799211934856942f, - 0.5800278289080819f, - 0.5801344543918494f, - 0.5802410699351697f, - 0.580347675536216f, - 0.5804542711931617f, - 0.5805608569041804f, - 0.5806674326674455f, - 0.5807739984811311f, - 0.5808805543434111f, - 0.5809871002524597f, - 0.5810936362064514f, - 0.5812001622035605f, - 0.581306678241962f, - 0.5814131843198306f, - 0.5815196804353413f, - 0.5816261665866693f, - 0.5817326427719902f, - 0.5818391089894793f, - 0.5819455652373126f, - 0.5820520115136658f, - 0.582158447816715f, - 0.5822648741446365f, - 0.5823712904956067f, - 0.5824776968678022f, - 0.5825840932593995f, - 0.5826904796685761f, - 0.5827968560935086f, - 0.5829032225323744f, - 0.5830095789833509f, - 0.5831159254446159f, - 0.5832222619143469f, - 0.5833285883907221f, - 0.5834349048719195f, - 0.5835412113561175f, - 0.5836475078414944f, - 0.583753794326229f, - 0.5838600708085f, - 0.5839663372864865f, - 0.5840725937583675f, - 0.5841788402223225f, - 0.5842850766765307f, - 0.5843913031191721f, - 0.5844975195484263f, - 0.5846037259624736f, - 0.5847099223594939f, - 0.5848161087376677f, - 0.5849222850951753f, - 0.5850284514301977f, - 0.5851346077409155f, - 0.5852407540255101f, - 0.5853468902821624f, - 0.5854530165090538f, - 0.5855591327043659f, - 0.5856652388662805f, - 0.5857713349929795f, - 0.5858774210826451f, - 0.5859834971334591f, - 0.5860895631436043f, - 0.586195619111263f, - 0.5863016650346183f, - 0.586407700911853f, - 0.5865137267411501f, - 0.586619742520693f, - 0.5867257482486651f, - 0.5868317439232499f, - 0.5869377295426313f, - 0.5870437051049934f, - 0.5871496706085203f, - 0.587255626051396f, - 0.5873615714318053f, - 0.5874675067479328f, - 0.5875734319979632f, - 0.5876793471800815f, - 0.5877852522924731f, - 0.5878911473333231f, - 0.5879970323008172f, - 0.588102907193141f, - 0.5882087720084803f, - 0.5883146267450213f, - 0.5884204714009501f, - 0.5885263059744531f, - 0.5886321304637168f, - 0.5887379448669279f, - 0.5888437491822734f, - 0.5889495434079404f, - 0.5890553275421161f, - 0.5891611015829878f, - 0.5892668655287433f, - 0.5893726193775701f, - 0.5894783631276564f, - 0.5895840967771903f, - 0.5896898203243599f, - 0.5897955337673537f, - 0.5899012371043605f, - 0.5900069303335688f, - 0.5901126134531678f, - 0.5902182864613466f, - 0.5903239493562945f, - 0.5904296021362011f, - 0.5905352447992559f, - 0.5906408773436488f, - 0.5907464997675699f, - 0.5908521120692093f, - 0.5909577142467575f, - 0.5910633062984046f, - 0.5911688882223418f, - 0.5912744600167599f, - 0.5913800216798498f, - 0.5914855732098028f, - 0.5915911146048104f, - 0.5916966458630639f, - 0.5918021669827553f, - 0.5919076779620766f, - 0.5920131787992196f, - 0.5921186694923767f, - 0.5922241500397403f, - 0.5923296204395032f, - 0.5924350806898581f, - 0.5925405307889978f, - 0.5926459707351157f, - 0.592751400526405f, - 0.5928568201610592f, - 0.592962229637272f, - 0.5930676289532372f, - 0.5931730181071486f, - 0.5932783970972008f, - 0.5933837659215878f, - 0.5934891245785043f, - 0.5935944730661451f, - 0.5936998113827049f, - 0.5938051395263788f, - 0.5939104574953621f, - 0.59401576528785f, - 0.5941210629020386f, - 0.594226350336123f, - 0.5943316275882995f, - 0.5944368946567642f, - 0.5945421515397132f, - 0.594647398235343f, - 0.5947526347418505f, - 0.5948578610574321f, - 0.5949630771802851f, - 0.5950682831086064f, - 0.5951734788405934f, - 0.5952786643744437f, - 0.595383839708355f, - 0.5954890048405249f, - 0.5955941597691516f, - 0.5956993044924334f, - 0.5958044390085684f, - 0.5959095633157553f, - 0.5960146774121929f, - 0.5961197812960801f, - 0.5962248749656158f, - 0.5963299584189994f, - 0.5964350316544301f, - 0.5965400946701078f, - 0.5966451474642321f, - 0.5967501900350032f, - 0.5968552223806207f, - 0.5969602444992854f, - 0.5970652563891975f, - 0.5971702580485577f, - 0.597275249475567f, - 0.5973802306684263f, - 0.5974852016253366f, - 0.5975901623444994f, - 0.5976951128241161f, - 0.5978000530623887f, - 0.5979049830575188f, - 0.5980099028077086f, - 0.5981148123111603f, - 0.5982197115660762f, - 0.598324600570659f, - 0.5984294793231114f, - 0.5985343478216364f, - 0.598639206064437f, - 0.5987440540497165f, - 0.5988488917756785f, - 0.5989537192405264f, - 0.5990585364424642f, - 0.5991633433796958f, - 0.5992681400504254f, - 0.5993729264528573f, - 0.5994777025851961f, - 0.5995824684456463f, - 0.5996872240324129f, - 0.599791969343701f, - 0.5998967043777158f, - 0.6000014291326625f, - 0.600106143606747f, - 0.6002108477981747f, - 0.6003155417051517f, - 0.6004202253258839f, - 0.600524898658578f, - 0.6006295617014402f, - 0.600734214452677f, - 0.6008388569104954f, - 0.6009434890731024f, - 0.6010481109387049f, - 0.6011527225055106f, - 0.6012573237717266f, - 0.6013619147355609f, - 0.6014664953952211f, - 0.6015710657489155f, - 0.6016756257948522f, - 0.6017801755312397f, - 0.6018847149562864f, - 0.6019892440682011f, - 0.6020937628651928f, - 0.6021982713454704f, - 0.6023027695072435f, - 0.6024072573487212f, - 0.6025117348681134f, - 0.6026162020636296f, - 0.6027206589334803f, - 0.6028251054758751f, - 0.6029295416890247f, - 0.6030339675711395f, - 0.6031383831204301f, - 0.6032427883351075f, - 0.6033471832133827f, - 0.6034515677534668f, - 0.6035559419535714f, - 0.603660305811908f, - 0.6037646593266883f, - 0.6038690024961243f, - 0.6039733353184281f, - 0.604077657791812f, - 0.6041819699144884f, - 0.6042862716846701f, - 0.6043905631005696f, - 0.6044948441604001f, - 0.6045991148623748f, - 0.6047033752047071f, - 0.6048076251856103f, - 0.6049118648032983f, - 0.6050160940559849f, - 0.6051203129418842f, - 0.6052245214592104f, - 0.6053287196061778f, - 0.6054329073810013f, - 0.6055370847818956f, - 0.6056412518070754f, - 0.605745408454756f, - 0.6058495547231526f, - 0.6059536906104808f, - 0.6060578161149561f, - 0.6061619312347947f, - 0.6062660359682123f, - 0.606370130313425f, - 0.6064742142686494f, - 0.6065782878321021f, - 0.6066823510019996f, - 0.6067864037765591f, - 0.6068904461539973f, - 0.6069944781325318f, - 0.6070984997103797f, - 0.6072025108857589f, - 0.6073065116568872f, - 0.6074105020219825f, - 0.6075144819792629f, - 0.6076184515269468f, - 0.6077224106632527f, - 0.6078263593863993f, - 0.6079302976946054f, - 0.6080342255860901f, - 0.6081381430590725f, - 0.6082420501117722f, - 0.6083459467424087f, - 0.6084498329492019f, - 0.6085537087303713f, - 0.6086575740841376f, - 0.6087614290087207f, - 0.6088652735023411f, - 0.6089691075632195f, - 0.6090729311895768f, - 0.6091767443796341f, - 0.6092805471316124f, - 0.609384339443733f, - 0.6094881213142177f, - 0.6095918927412881f, - 0.609695653723166f, - 0.6097994042580738f, - 0.6099031443442333f, - 0.6100068739798674f, - 0.6101105931631985f, - 0.6102143018924493f, - 0.6103180001658429f, - 0.6104216879816026f, - 0.6105253653379514f, - 0.610629032233113f, - 0.6107326886653113f, - 0.6108363346327698f, - 0.6109399701337128f, - 0.6110435951663644f, - 0.6111472097289492f, - 0.6112508138196917f, - 0.6113544074368165f, - 0.6114579905785488f, - 0.6115615632431135f, - 0.611665125428736f, - 0.6117686771336419f, - 0.6118722183560569f, - 0.6119757490942067f, - 0.6120792693463173f, - 0.612182779110615f, - 0.6122862783853261f, - 0.6123897671686774f, - 0.6124932454588955f, - 0.6125967132542072f, - 0.6127001705528395f, - 0.6128036173530202f, - 0.6129070536529764f, - 0.6130104794509358f, - 0.6131138947451263f, - 0.6132172995337759f, - 0.6133206938151127f, - 0.6134240775873651f, - 0.6135274508487616f, - 0.6136308135975309f, - 0.6137341658319021f, - 0.6138375075501042f, - 0.6139408387503664f, - 0.6140441594309183f, - 0.6141474695899892f, - 0.6142507692258092f, - 0.6143540583366084f, - 0.6144573369206167f, - 0.6145606049760645f, - 0.6146638625011823f, - 0.6147671094942009f, - 0.6148703459533512f, - 0.6149735718768642f, - 0.6150767872629712f, - 0.6151799921099037f, - 0.6152831864158932f, - 0.6153863701791714f, - 0.6154895433979706f, - 0.6155927060705226f, - 0.61569585819506f, - 0.6157989997698151f, - 0.6159021307930208f, - 0.6160052512629098f, - 0.6161083611777153f, - 0.6162114605356704f, - 0.6163145493350087f, - 0.6164176275739637f, - 0.6165206952507691f, - 0.616623752363659f, - 0.6167267989108675f, - 0.6168298348906289f, - 0.6169328603011778f, - 0.6170358751407486f, - 0.6171388794075766f, - 0.6172418730998965f, - 0.6173448562159436f, - 0.6174478287539535f, - 0.6175507907121617f, - 0.6176537420888039f, - 0.617756682882116f, - 0.6178596130903343f, - 0.6179625327116951f, - 0.6180654417444349f, - 0.6181683401867902f, - 0.618271228036998f, - 0.6183741052932953f, - 0.6184769719539194f, - 0.6185798280171078f, - 0.618682673481098f, - 0.6187855083441275f, - 0.6188883326044347f, - 0.6189911462602573f, - 0.619093949309834f, - 0.619196741751403f, - 0.6192995235832034f, - 0.6194022948034734f, - 0.6195050554104526f, - 0.61960780540238f, - 0.6197105447774951f, - 0.6198132735340375f, - 0.6199159916702468f, - 0.6200186991843631f, - 0.6201213960746266f, - 0.6202240823392773f, - 0.620326757976556f, - 0.6204294229847033f, - 0.62053207736196f, - 0.6206347211065673f, - 0.6207373542167662f, - 0.6208399766907984f, - 0.6209425885269052f, - 0.6210451897233286f, - 0.6211477802783104f, - 0.6212503601900927f, - 0.6213529294569181f, - 0.6214554880770288f, - 0.6215580360486677f, - 0.6216605733700774f, - 0.6217631000395012f, - 0.6218656160551823f, - 0.6219681214153641f, - 0.6220706161182901f, - 0.6221731001622042f, - 0.6222755735453502f, - 0.6223780362659725f, - 0.6224804883223153f, - 0.6225829297126231f, - 0.6226853604351406f, - 0.6227877804881126f, - 0.6228901898697841f, - 0.6229925885784007f, - 0.6230949766122075f, - 0.6231973539694503f, - 0.6232997206483747f, - 0.6234020766472268f, - 0.6235044219642528f, - 0.6236067565976989f, - 0.6237090805458119f, - 0.6238113938068381f, - 0.6239136963790246f, - 0.6240159882606185f, - 0.624118269449867f, - 0.6242205399450177f, - 0.624322799744318f, - 0.6244250488460158f, - 0.624527287248359f, - 0.624629514949596f, - 0.6247317319479749f, - 0.6248339382417444f, - 0.6249361338291533f, - 0.6250383187084502f, - 0.6251404928778843f, - 0.6252426563357051f, - 0.6253448090801619f, - 0.6254469511095043f, - 0.6255490824219823f, - 0.6256512030158455f, - 0.6257533128893445f, - 0.6258554120407296f, - 0.6259575004682513f, - 0.6260595781701602f, - 0.6261616451447074f, - 0.6262637013901441f, - 0.6263657469047214f, - 0.6264677816866908f, - 0.626569805734304f, - 0.6266718190458129f, - 0.6267738216194696f, - 0.626875813453526f, - 0.6269777945462348f, - 0.6270797648958485f, - 0.6271817245006197f, - 0.6272836733588016f, - 0.6273856114686472f, - 0.6274875388284098f, - 0.627589455436343f, - 0.6276913612907005f, - 0.6277932563897359f, - 0.6278951407317036f, - 0.6279970143148578f, - 0.6280988771374527f, - 0.6282007291977431f, - 0.6283025704939835f, - 0.6284044010244292f, - 0.6285062207873353f, - 0.6286080297809572f, - 0.6287098280035502f, - 0.6288116154533703f, - 0.6289133921286731f, - 0.6290151580277149f, - 0.6291169131487518f, - 0.6292186574900406f, - 0.6293203910498375f, - 0.6294221138263995f, - 0.6295238258179836f, - 0.6296255270228471f, - 0.6297272174392473f, - 0.6298288970654419f, - 0.6299305658996883f, - 0.6300322239402446f, - 0.6301338711853691f, - 0.6302355076333199f, - 0.6303371332823555f, - 0.6304387481307346f, - 0.6305403521767162f, - 0.6306419454185591f, - 0.6307435278545227f, - 0.6308450994828663f, - 0.6309466603018495f, - 0.6310482103097323f, - 0.6311497495047745f, - 0.6312512778852362f, - 0.6313527954493777f, - 0.6314543021954597f, - 0.6315557981217428f, - 0.631657283226488f, - 0.6317587575079561f, - 0.6318602209644087f, - 0.6319616735941072f, - 0.632063115395313f, - 0.6321645463662882f, - 0.6322659665052947f, - 0.6323673758105945f, - 0.6324687742804502f, - 0.6325701619131244f, - 0.6326715387068799f, - 0.6327729046599793f, - 0.632874259770686f, - 0.6329756040372632f, - 0.6330769374579744f, - 0.6331782600310835f, - 0.6332795717548539f, - 0.6333808726275502f, - 0.6334821626474363f, - 0.6335834418127766f, - 0.6336847101218358f, - 0.6337859675728786f, - 0.6338872141641702f, - 0.6339884498939755f, - 0.6340896747605602f, - 0.6341908887621895f, - 0.6342920918971293f, - 0.6343932841636455f, - 0.6344944655600041f, - 0.6345956360844714f, - 0.634696795735314f, - 0.6347979445107985f, - 0.6348990824091918f, - 0.6350002094287606f, - 0.6351013255677724f, - 0.6352024308244947f, - 0.6353035251971949f, - 0.635404608684141f, - 0.6355056812836005f, - 0.635606742993842f, - 0.6357077938131337f, - 0.6358088337397441f, - 0.6359098627719418f, - 0.6360108809079958f, - 0.6361118881461753f, - 0.6362128844847493f, - 0.6363138699219876f, - 0.6364148444561595f, - 0.636515808085535f, - 0.6366167608083841f, - 0.636717702622977f, - 0.636818633527584f, - 0.6369195535204759f, - 0.6370204625999233f, - 0.6371213607641971f, - 0.6372222480115685f, - 0.6373231243403089f, - 0.6374239897486896f, - 0.6375248442349826f, - 0.6376256877974597f, - 0.6377265204343927f, - 0.6378273421440542f, - 0.6379281529247165f, - 0.6380289527746521f, - 0.6381297416921341f, - 0.6382305196754353f, - 0.638331286722829f, - 0.6384320428325886f, - 0.6385327880029876f, - 0.6386335222322997f, - 0.6387342455187991f, - 0.6388349578607596f, - 0.6389356592564558f, - 0.6390363497041621f, - 0.6391370292021531f, - 0.6392376977487039f, - 0.6393383553420893f, - 0.6394390019805847f, - 0.6395396376624656f, - 0.6396402623860077f, - 0.6397408761494866f, - 0.6398414789511784f, - 0.6399420707893594f, - 0.6400426516623058f, - 0.6401432215682944f, - 0.6402437805056018f, - 0.640344328472505f, - 0.640444865467281f, - 0.6405453914882073f, - 0.6406459065335615f, - 0.6407464106016211f, - 0.6408469036906641f, - 0.6409473857989685f, - 0.6410478569248126f, - 0.6411483170664748f, - 0.6412487662222338f, - 0.6413492043903685f, - 0.6414496315691578f, - 0.641550047756881f, - 0.6416504529518174f, - 0.6417508471522467f, - 0.6418512303564486f, - 0.6419516025627031f, - 0.6420519637692903f, - 0.6421523139744906f, - 0.6422526531765844f, - 0.6423529813738525f, - 0.6424532985645758f, - 0.6425536047470355f, - 0.6426538999195126f, - 0.6427541840802888f, - 0.6428544572276458f, - 0.6429547193598653f, - 0.6430549704752294f, - 0.6431552105720203f, - 0.6432554396485205f, - 0.6433556577030124f, - 0.6434558647337789f, - 0.6435560607391031f, - 0.643656245717268f, - 0.6437564196665571f, - 0.6438565825852537f, - 0.6439567344716418f, - 0.6440568753240052f, - 0.6441570051406281f, - 0.6442571239197947f, - 0.6443572316597895f, - 0.6444573283588975f, - 0.644557414015403f, - 0.6446574886275913f, - 0.6447575521937479f, - 0.6448576047121578f, - 0.644957646181107f, - 0.6450576765988812f, - 0.6451576959637664f, - 0.6452577042740486f, - 0.6453577015280145f, - 0.6454576877239505f, - 0.6455576628601434f, - 0.6456576269348803f, - 0.645757579946448f, - 0.6458575218931341f, - 0.6459574527732259f, - 0.6460573725850114f, - 0.6461572813267784f, - 0.6462571789968149f, - 0.6463570655934093f, - 0.6464569411148499f, - 0.6465568055594255f, - 0.6466566589254249f, - 0.6467565012111371f, - 0.6468563324148515f, - 0.6469561525348573f, - 0.6470559615694442f, - 0.6471557595169022f, - 0.6472555463755209f, - 0.6473553221435907f, - 0.647455086819402f, - 0.6475548404012453f, - 0.6476545828874114f, - 0.6477543142761911f, - 0.6478540345658756f, - 0.6479537437547563f, - 0.6480534418411247f, - 0.6481531288232724f, - 0.6482528046994913f, - 0.6483524694680736f, - 0.6484521231273114f, - 0.6485517656754973f, - 0.648651397110924f, - 0.6487510174318842f, - 0.648850626636671f, - 0.6489502247235776f, - 0.6490498116908974f, - 0.649149387536924f, - 0.649248952259951f, - 0.649348505858273f, - 0.6494480483301837f, - 0.6495475796739774f, - 0.6496470998879489f, - 0.6497466089703928f, - 0.6498461069196041f, - 0.6499455937338781f, - 0.6500450694115097f, - 0.6501445339507947f, - 0.6502439873500288f, - 0.6503434296075078f, - 0.6504428607215278f, - 0.6505422806903853f, - 0.6506416895123764f, - 0.650741087185798f, - 0.6508404737089468f, - 0.65093984908012f, - 0.6510392132976147f, - 0.6511385663597284f, - 0.6512379082647587f, - 0.6513372390110033f, - 0.6514365585967603f, - 0.6515358670203278f, - 0.6516351642800043f, - 0.6517344503740885f, - 0.6518337253008788f, - 0.6519329890586743f, - 0.6520322416457741f, - 0.6521314830604776f, - 0.6522307133010844f, - 0.6523299323658942f, - 0.6524291402532068f, - 0.6525283369613222f, - 0.652627522488541f, - 0.6527266968331633f, - 0.6528258599934902f, - 0.6529250119678224f, - 0.6530241527544608f, - 0.6531232823517068f, - 0.6532224007578618f, - 0.6533215079712273f, - 0.6534206039901054f, - 0.653519688812798f, - 0.6536187624376072f, - 0.6537178248628356f, - 0.6538168760867856f, - 0.65391591610776f, - 0.654014944924062f, - 0.6541139625339946f, - 0.6542129689358611f, - 0.6543119641279651f, - 0.6544109481086103f, - 0.6545099208761008f, - 0.6546088824287407f, - 0.6547078327648341f, - 0.6548067718826858f, - 0.6549056997806002f, - 0.6550046164568826f, - 0.6551035219098377f, - 0.6552024161377709f, - 0.6553012991389878f, - 0.6554001709117939f, - 0.6554990314544952f, - 0.6555978807653977f, - 0.6556967188428074f, - 0.6557955456850312f, - 0.6558943612903755f, - 0.6559931656571472f, - 0.656091958783653f, - 0.6561907406682004f, - 0.6562895113090967f, - 0.6563882707046497f, - 0.656487018853167f, - 0.6565857557529565f, - 0.6566844814023264f, - 0.6567831957995851f, - 0.6568818989430413f, - 0.6569805908310036f, - 0.657079271461781f, - 0.6571779408336825f, - 0.6572765989450177f, - 0.6573752457940958f, - 0.6574738813792266f, - 0.6575725056987202f, - 0.6576711187508865f, - 0.6577697205340358f, - 0.6578683110464788f, - 0.6579668902865259f, - 0.6580654582524882f, - 0.6581640149426765f, - 0.6582625603554024f, - 0.6583610944889771f, - 0.6584596173417123f, - 0.6585581289119198f, - 0.6586566291979117f, - 0.6587551181980003f, - 0.6588535959104977f, - 0.658952062333717f, - 0.6590505174659704f, - 0.6591489613055715f, - 0.6592473938508332f, - 0.6593458151000688f, - 0.6594442250515921f, - 0.6595426237037167f, - 0.6596410110547567f, - 0.6597393871030262f, - 0.6598377518468393f, - 0.659936105284511f, - 0.6600344474143557f, - 0.6601327782346886f, - 0.6602310977438246f, - 0.6603294059400792f, - 0.6604277028217677f, - 0.660525988387206f, - 0.6606242626347099f, - 0.6607225255625956f, - 0.6608207771691793f, - 0.6609190174527775f, - 0.6610172464117068f, - 0.6611154640442842f, - 0.6612136703488268f, - 0.6613118653236518f, - 0.6614100489670767f, - 0.661508221277419f, - 0.6616063822529966f, - 0.6617045318921277f, - 0.6618026701931303f, - 0.6619007971543232f, - 0.6619989127740245f, - 0.6620970170505532f, - 0.6621951099822285f, - 0.6622931915673695f, - 0.6623912618042956f, - 0.6624893206913265f, - 0.6625873682267818f, - 0.6626854044089815f, - 0.6627834292362458f, - 0.6628814427068951f, - 0.66297944481925f, - 0.6630774355716312f, - 0.6631754149623597f, - 0.6632733829897566f, - 0.6633713396521433f, - 0.6634692849478413f, - 0.6635672188751723f, - 0.6636651414324585f, - 0.6637630526180216f, - 0.6638609524301842f, - 0.6639588408672686f, - 0.6640567179275978f, - 0.6641545836094944f, - 0.6642524379112816f, - 0.6643502808312829f, - 0.6644481123678215f, - 0.6645459325192213f, - 0.664643741283806f, - 0.6647415386598998f, - 0.664839324645827f, - 0.6649370992399118f, - 0.6650348624404793f, - 0.6651326142458539f, - 0.6652303546543609f, - 0.6653280836643253f, - 0.665425801274073f, - 0.6655235074819292f, - 0.66562120228622f, - 0.6657188856852714f, - 0.6658165576774094f, - 0.6659142182609606f, - 0.6660118674342517f, - 0.6661095051956092f, - 0.6662071315433603f, - 0.6663047464758322f, - 0.6664023499913523f, - 0.6664999420882481f, - 0.6665975227648477f, - 0.6666950920194786f, - 0.6667926498504694f, - 0.6668901962561481f, - 0.6669877312348436f, - 0.6670852547848845f, - 0.6671827669045997f, - 0.6672802675923184f, - 0.66737775684637f, - 0.6674752346650841f, - 0.6675727010467903f, - 0.6676701559898188f, - 0.6677675994924995f, - 0.6678650315531627f, - 0.667962452170139f, - 0.6680598613417592f, - 0.6681572590663541f, - 0.668254645342255f, - 0.668352020167793f, - 0.6684493835412997f, - 0.6685467354611069f, - 0.6686440759255462f, - 0.6687414049329501f, - 0.6688387224816505f, - 0.6689360285699804f, - 0.6690333231962718f, - 0.6691306063588582f, - 0.6692278780560724f, - 0.6693251382862476f, - 0.6694223870477175f, - 0.6695196243388155f, - 0.6696168501578758f, - 0.6697140645032321f, - 0.6698112673732189f, - 0.6699084587661707f, - 0.670005638680422f, - 0.6701028071143077f, - 0.6701999640661628f, - 0.6702971095343225f, - 0.6703942435171224f, - 0.6704913660128979f, - 0.6705884770199851f, - 0.67068557653672f, - 0.6707826645614386f, - 0.6708797410924776f, - 0.6709768061281735f, - 0.671073859666863f, - 0.6711709017068831f, - 0.6712679322465713f, - 0.6713649512842649f, - 0.6714619588183013f, - 0.6715589548470183f, - 0.6716559393687542f, - 0.6717529123818471f, - 0.6718498738846351f, - 0.6719468238754573f, - 0.6720437623526522f, - 0.6721406893145586f, - 0.6722376047595159f, - 0.6723345086858635f, - 0.672431401091941f, - 0.672528281976088f, - 0.6726251513366446f, - 0.672722009171951f, - 0.6728188554803475f, - 0.6729156902601746f, - 0.6730125135097732f, - 0.6731093252274843f, - 0.6732061254116489f, - 0.6733029140606084f, - 0.6733996911727044f, - 0.6734964567462786f, - 0.6735932107796729f, - 0.6736899532712296f, - 0.6737866842192909f, - 0.6738834036221993f, - 0.6739801114782978f, - 0.6740768077859292f, - 0.6741734925434364f, - 0.6742701657491632f, - 0.6743668274014527f, - 0.6744634774986489f, - 0.6745601160390955f, - 0.6746567430211369f, - 0.6747533584431171f, - 0.6748499623033809f, - 0.6749465546002729f, - 0.675043135332138f, - 0.6751397044973214f, - 0.6752362620941683f, - 0.6753328081210244f, - 0.6754293425762352f, - 0.6755258654581467f, - 0.6756223767651051f, - 0.6757188764954564f, - 0.6758153646475473f, - 0.6759118412197246f, - 0.6760083062103351f, - 0.676104759617726f, - 0.6762012014402444f, - 0.6762976316762379f, - 0.6763940503240542f, - 0.6764904573820412f, - 0.6765868528485469f, - 0.6766832367219198f, - 0.6767796090005082f, - 0.6768759696826606f, - 0.6769723187667264f, - 0.6770686562510543f, - 0.6771649821339938f, - 0.6772612964138942f, - 0.6773575990891053f, - 0.677453890157977f, - 0.6775501696188592f, - 0.6776464374701022f, - 0.6777426937100568f, - 0.6778389383370732f, - 0.6779351713495027f, - 0.678031392745696f, - 0.6781276025240047f, - 0.6782238006827802f, - 0.6783199872203741f, - 0.6784161621351382f, - 0.6785123254254246f, - 0.6786084770895857f, - 0.6787046171259739f, - 0.6788007455329417f, - 0.6788968623088422f, - 0.6789929674520284f, - 0.6790890609608535f, - 0.679185142833671f, - 0.6792812130688346f, - 0.6793772716646981f, - 0.6794733186196157f, - 0.6795693539319414f, - 0.6796653776000299f, - 0.6797613896222358f, - 0.6798573899969138f, - 0.6799533787224191f, - 0.6800493557971071f, - 0.680145321219333f, - 0.6802412749874527f, - 0.6803372170998218f, - 0.6804331475547964f, - 0.6805290663507331f, - 0.680624973485988f, - 0.6807208689589178f, - 0.6808167527678795f, - 0.68091262491123f, - 0.6810084853873266f, - 0.6811043341945268f, - 0.6812001713311883f, - 0.6812959967956689f, - 0.6813918105863266f, - 0.6814876127015197f, - 0.6815834031396066f, - 0.6816791818989462f, - 0.6817749489778971f, - 0.6818707043748186f, - 0.6819664480880696f, - 0.6820621801160097f, - 0.6821579004569986f, - 0.6822536091093964f, - 0.6823493060715629f, - 0.6824449913418582f, - 0.6825406649186431f, - 0.682636326800278f, - 0.6827319769851238f, - 0.6828276154715418f, - 0.682923242257893f, - 0.6830188573425389f, - 0.6831144607238412f, - 0.6832100524001619f, - 0.6833056323698627f, - 0.6834012006313063f, - 0.683496757182855f, - 0.6835923020228712f, - 0.6836878351497182f, - 0.6837833565617587f, - 0.6838788662573562f, - 0.683974364234874f, - 0.6840698504926759f, - 0.6841653250291257f, - 0.6842607878425875f, - 0.6843562389314256f, - 0.6844516782940044f, - 0.6845471059286886f, - 0.6846425218338431f, - 0.684737926007833f, - 0.6848333184490235f, - 0.68492869915578f, - 0.6850240681264684f, - 0.6851194253594544f, - 0.6852147708531041f, - 0.6853101046057839f, - 0.6854054266158602f, - 0.6855007368816997f, - 0.6855960354016691f, - 0.6856913221741359f, - 0.6857865971974669f, - 0.6858818604700301f, - 0.6859771119901927f, - 0.686072351756323f, - 0.6861675797667888f, - 0.6862627960199583f, - 0.6863580005142005f, - 0.6864531932478837f, - 0.6865483742193769f, - 0.686643543427049f, - 0.6867387008692697f, - 0.6868338465444082f, - 0.6869289804508343f, - 0.687024102586918f, - 0.6871192129510292f, - 0.6872143115415383f, - 0.6873093983568158f, - 0.6874044733952326f, - 0.6874995366551594f, - 0.6875945881349674f, - 0.6876896278330278f, - 0.6877846557477123f, - 0.6878796718773925f, - 0.6879746762204404f, - 0.688069668775228f, - 0.6881646495401278f, - 0.6882596185135121f, - 0.6883545756937539f, - 0.688449521079226f, - 0.6885444546683015f, - 0.6886393764593539f, - 0.6887342864507566f, - 0.6888291846408834f, - 0.6889240710281082f, - 0.689018945610805f, - 0.6891138083873485f, - 0.689208659356113f, - 0.6893034985154732f, - 0.6893983258638043f, - 0.6894931413994814f, - 0.6895879451208796f, - 0.6896827370263748f, - 0.6897775171143427f, - 0.6898722853831591f, - 0.6899670418312003f, - 0.6900617864568426f, - 0.6901565192584627f, - 0.6902512402344372f, - 0.6903459493831431f, - 0.6904406467029578f, - 0.6905353321922585f, - 0.6906300058494228f, - 0.6907246676728286f, - 0.6908193176608538f, - 0.6909139558118766f, - 0.6910085821242756f, - 0.691103196596429f, - 0.691197799226716f, - 0.6912923900135154f, - 0.6913869689552063f, - 0.6914815360501684f, - 0.6915760912967813f, - 0.6916706346934246f, - 0.6917651662384784f, - 0.691859685930323f, - 0.6919541937673388f, - 0.6920486897479065f, - 0.6921431738704068f, - 0.6922376461332208f, - 0.6923321065347298f, - 0.6924265550733151f, - 0.6925209917473585f, - 0.6926154165552417f, - 0.6927098294953471f, - 0.6928042305660566f, - 0.6928986197657526f, - 0.6929929970928181f, - 0.6930873625456359f, - 0.6931817161225888f, - 0.6932760578220605f, - 0.693370387642434f, - 0.6934647055820933f, - 0.6935590116394222f, - 0.6936533058128049f, - 0.6937475881006255f, - 0.6938418585012688f, - 0.6939361170131192f, - 0.6940303636345616f, - 0.6941245983639813f, - 0.6942188211997635f, - 0.6943130321402938f, - 0.6944072311839579f, - 0.6945014183291416f, - 0.6945955935742312f, - 0.6946897569176129f, - 0.6947839083576733f, - 0.6948780478927992f, - 0.6949721755213775f, - 0.6950662912417952f, - 0.6951603950524399f, - 0.6952544869516989f, - 0.6953485669379602f, - 0.6954426350096116f, - 0.6955366911650414f, - 0.6956307354026379f, - 0.6957247677207896f, - 0.6958187881178854f, - 0.6959127965923143f, - 0.6960067931424654f, - 0.6961007777667281f, - 0.6961947504634921f, - 0.6962887112311471f, - 0.6963826600680832f, - 0.6964765969726905f, - 0.6965705219433594f, - 0.6966644349784806f, - 0.6967583360764451f, - 0.6968522252356436f, - 0.6969461024544675f, - 0.6970399677313083f, - 0.6971338210645576f, - 0.697227662452607f, - 0.697321491893849f, - 0.6974153093866755f, - 0.697509114929479f, - 0.6976029085206524f, - 0.6976966901585884f, - 0.6977904598416801f, - 0.6978842175683209f, - 0.697977963336904f, - 0.6980716971458233f, - 0.6981654189934726f, - 0.6982591288782461f, - 0.6983528267985382f, - 0.6984465127527432f, - 0.6985401867392559f, - 0.6986338487564712f, - 0.6987274988027843f, - 0.6988211368765903f, - 0.6989147629762851f, - 0.6990083771002643f, - 0.6991019792469237f, - 0.6991955694146595f, - 0.6992891476018682f, - 0.6993827138069463f, - 0.6994762680282904f, - 0.6995698102642978f, - 0.6996633405133653f, - 0.6997568587738907f, - 0.6998503650442712f, - 0.6999438593229048f, - 0.7000373416081895f, - 0.7001308118985237f, - 0.7002242701923053f, - 0.7003177164879333f, - 0.7004111507838063f, - 0.7005045730783236f, - 0.7005979833698842f, - 0.7006913816568877f, - 0.7007847679377337f, - 0.7008781422108219f, - 0.7009715044745526f, - 0.7010648547273258f, - 0.7011581929675422f, - 0.7012515191936025f, - 0.7013448334039074f, - 0.7014381355968581f, - 0.7015314257708557f, - 0.7016247039243019f, - 0.7017179700555983f, - 0.701811224163147f, - 0.70190446624535f, - 0.7019976963006095f, - 0.7020909143273281f, - 0.7021841203239086f, - 0.702277314288754f, - 0.7023704962202673f, - 0.7024636661168517f, - 0.7025568239769111f, - 0.7026499697988492f, - 0.7027431035810697f, - 0.7028362253219772f, - 0.7029293350199758f, - 0.7030224326734701f, - 0.7031155182808649f, - 0.7032085918405654f, - 0.7033016533509765f, - 0.7033947028105039f, - 0.703487740217553f, - 0.7035807655705297f, - 0.7036737788678402f, - 0.7037667801078905f, - 0.7038597692890872f, - 0.7039527464098368f, - 0.7040457114685466f, - 0.704138664463623f, - 0.7042316053934737f, - 0.7043245342565062f, - 0.704417451051128f, - 0.704510355775747f, - 0.7046032484287715f, - 0.7046961290086097f, - 0.7047889975136701f, - 0.7048818539423614f, - 0.7049746982930926f, - 0.7050675305642727f, - 0.7051603507543113f, - 0.7052531588616178f, - 0.7053459548846018f, - 0.7054387388216735f, - 0.705531510671243f, - 0.7056242704317206f, - 0.7057170181015171f, - 0.7058097536790431f, - 0.7059024771627096f, - 0.7059951885509279f, - 0.7060878878421093f, - 0.7061805750346656f, - 0.7062732501270086f, - 0.7063659131175501f, - 0.7064585640047025f, - 0.7065512027868784f, - 0.7066438294624902f, - 0.706736444029951f, - 0.7068290464876738f, - 0.7069216368340717f, - 0.7070142150675583f, - 0.7071067811865476f, - 0.707199335189453f, - 0.7072918770746889f, - 0.7073844068406696f, - 0.7074769244858096f, - 0.7075694300085236f, - 0.7076619234072266f, - 0.7077544046803337f, - 0.7078468738262603f, - 0.707939330843422f, - 0.7080317757302345f, - 0.7081242084851137f, - 0.708216629106476f, - 0.7083090375927377f, - 0.7084014339423154f, - 0.7084938181536258f, - 0.7085861902250861f, - 0.7086785501551135f, - 0.7087708979421253f, - 0.7088632335845394f, - 0.7089555570807734f, - 0.7090478684292455f, - 0.709140167628374f, - 0.7092324546765771f, - 0.7093247295722739f, - 0.709416992313883f, - 0.7095092428998236f, - 0.709601481328515f, - 0.7096937075983767f, - 0.7097859217078285f, - 0.7098781236552902f, - 0.7099703134391823f, - 0.7100624910579247f, - 0.7101546565099381f, - 0.7102468097936434f, - 0.7103389509074615f, - 0.7104310798498135f, - 0.7105231966191209f, - 0.7106153012138052f, - 0.7107073936322884f, - 0.7107994738729924f, - 0.7108915419343395f, - 0.710983597814752f, - 0.7110756415126528f, - 0.7111676730264644f, - 0.7112596923546102f, - 0.7113516994955131f, - 0.711443694447597f, - 0.7115356772092853f, - 0.7116276477790021f, - 0.7117196061551713f, - 0.7118115523362174f, - 0.7119034863205648f, - 0.7119954081066383f, - 0.7120873176928628f, - 0.7121792150776638f, - 0.712271100259466f, - 0.7123629732366955f, - 0.7124548340077779f, - 0.7125466825711391f, - 0.7126385189252054f, - 0.7127303430684032f, - 0.7128221549991591f, - 0.7129139547159f, - 0.7130057422170529f, - 0.7130975175010451f, - 0.7131892805663039f, - 0.7132810314112572f, - 0.7133727700343326f, - 0.7134644964339584f, - 0.7135562106085627f, - 0.713647912556574f, - 0.7137396022764213f, - 0.7138312797665333f, - 0.7139229450253392f, - 0.7140145980512682f, - 0.71410623884275f, - 0.7141978673982143f, - 0.7142894837160911f, - 0.7143810877948109f, - 0.7144726796328034f, - 0.7145642592284996f, - 0.7146558265803303f, - 0.7147473816867265f, - 0.7148389245461194f, - 0.7149304551569403f, - 0.7150219735176212f, - 0.7151134796265938f, - 0.71520497348229f, - 0.7152964550831421f, - 0.7153879244275828f, - 0.7154793815140448f, - 0.7155708263409608f, - 0.7156622589067639f, - 0.7157536792098877f, - 0.7158450872487655f, - 0.7159364830218311f, - 0.7160278665275186f, - 0.7161192377642619f, - 0.7162105967304956f, - 0.7163019434246541f, - 0.7163932778451726f, - 0.7164845999904855f, - 0.7165759098590286f, - 0.7166672074492371f, - 0.7167584927595464f, - 0.7168497657883927f, - 0.7169410265342119f, - 0.7170322749954402f, - 0.7171235111705143f, - 0.7172147350578707f, - 0.7173059466559465f, - 0.7173971459631786f, - 0.7174883329780044f, - 0.7175795076988615f, - 0.7176706701241876f, - 0.7177618202524206f, - 0.7178529580819988f, - 0.7179440836113604f, - 0.7180351968389442f, - 0.7181262977631888f, - 0.7182173863825334f, - 0.718308462695417f, - 0.7183995267002792f, - 0.7184905783955595f, - 0.718581617779698f, - 0.7186726448511346f, - 0.7187636596083096f, - 0.7188546620496634f, - 0.7189456521736368f, - 0.7190366299786707f, - 0.7191275954632061f, - 0.7192185486256845f, - 0.7193094894645474f, - 0.7194004179782365f, - 0.7194913341651938f, - 0.7195822380238615f, - 0.7196731295526819f, - 0.7197640087500976f, - 0.7198548756145515f, - 0.7199457301444868f, - 0.7200365723383464f, - 0.7201274021945737f, - 0.7202182197116126f, - 0.7203090248879069f, - 0.7203998177219006f, - 0.7204905982120382f, - 0.7205813663567638f, - 0.7206721221545225f, - 0.7207628656037591f, - 0.7208535967029187f, - 0.7209443154504467f, - 0.7210350218447887f, - 0.7211257158843903f, - 0.7212163975676976f, - 0.7213070668931567f, - 0.7213977238592142f, - 0.7214883684643165f, - 0.7215790007069105f, - 0.7216696205854433f, - 0.7217602280983622f, - 0.7218508232441144f, - 0.7219414060211479f, - 0.7220319764279104f, - 0.7221225344628502f, - 0.7222130801244154f, - 0.7223036134110545f, - 0.7223941343212164f, - 0.7224846428533498f, - 0.7225751390059041f, - 0.7226656227773287f, - 0.722756094166073f, - 0.722846553170587f, - 0.7229369997893205f, - 0.7230274340207238f, - 0.7231178558632474f, - 0.7232082653153421f, - 0.7232986623754584f, - 0.7233890470420474f, - 0.7234794193135605f, - 0.7235697791884493f, - 0.7236601266651654f, - 0.7237504617421607f, - 0.7238407844178875f, - 0.7239310946907979f, - 0.7240213925593446f, - 0.7241116780219803f, - 0.7242019510771581f, - 0.7242922117233312f, - 0.7243824599589528f, - 0.7244726957824766f, - 0.7245629191923566f, - 0.7246531301870466f, - 0.7247433287650011f, - 0.7248335149246744f, - 0.7249236886645213f, - 0.7250138499829966f, - 0.7251039988785554f, - 0.7251941353496532f, - 0.7252842593947453f, - 0.7253743710122876f, - 0.725464470200736f, - 0.7255545569585468f, - 0.7256446312841762f, - 0.7257346931760809f, - 0.7258247426327177f, - 0.7259147796525436f, - 0.7260048042340158f, - 0.7260948163755919f, - 0.7261848160757295f, - 0.7262748033328864f, - 0.7263647781455208f, - 0.726454740512091f, - 0.7265446904310554f, - 0.7266346279008729f, - 0.7267245529200023f, - 0.7268144654869028f, - 0.7269043656000338f, - 0.7269942532578549f, - 0.7270841284588259f, - 0.7271739912014068f, - 0.7272638414840578f, - 0.7273536793052393f, - 0.727443504663412f, - 0.7275333175570369f, - 0.7276231179845749f, - 0.7277129059444872f, - 0.7278026814352356f, - 0.7278924444552817f, - 0.7279821950030874f, - 0.7280719330771148f, - 0.7281616586758263f, - 0.7282513717976846f, - 0.7283410724411523f, - 0.7284307606046926f, - 0.7285204362867684f, - 0.7286100994858437f, - 0.7286997502003816f, - 0.728789388428846f, - 0.7288790141697012f, - 0.7289686274214116f, - 0.7290582281824413f, - 0.7291478164512553f, - 0.7292373922263184f, - 0.7293269555060958f, - 0.729416506289053f, - 0.7295060445736552f, - 0.7295955703583684f, - 0.729685083641659f, - 0.7297745844219925f, - 0.7298640726978357f, - 0.7299535484676551f, - 0.7300430117299178f, - 0.7301324624830907f, - 0.7302219007256411f, - 0.7303113264560365f, - 0.7304007396727447f, - 0.7304901403742333f, - 0.7305795285589709f, - 0.7306689042254256f, - 0.7307582673720661f, - 0.7308476179973611f, - 0.7309369560997796f, - 0.7310262816777908f, - 0.7311155947298641f, - 0.7312048952544693f, - 0.7312941832500761f, - 0.7313834587151545f, - 0.7314727216481751f, - 0.7315619720476083f, - 0.7316512099119247f, - 0.7317404352395952f, - 0.7318296480290911f, - 0.7319188482788838f, - 0.7320080359874447f, - 0.7320972111532456f, - 0.7321863737747585f, - 0.7322755238504557f, - 0.7323646613788097f, - 0.7324537863582931f, - 0.7325428987873787f, - 0.7326319986645397f, - 0.7327210859882493f, - 0.732810160756981f, - 0.7328992229692086f, - 0.7329882726234062f, - 0.7330773097180476f, - 0.7331663342516073f, - 0.7332553462225601f, - 0.7333443456293804f, - 0.7334333324705435f, - 0.7335223067445248f, - 0.7336112684497994f, - 0.7337002175848432f, - 0.7337891541481318f, - 0.7338780781381417f, - 0.7339669895533488f, - 0.7340558883922301f, - 0.7341447746532619f, - 0.7342336483349213f, - 0.7343225094356856f, - 0.7344113579540319f, - 0.7345001938884381f, - 0.7345890172373819f, - 0.7346778279993413f, - 0.7347666261727948f, - 0.7348554117562205f, - 0.7349441847480972f, - 0.7350329451469039f, - 0.7351216929511197f, - 0.7352104281592239f, - 0.735299150769696f, - 0.7353878607810158f, - 0.7354765581916634f, - 0.7355652430001187f, - 0.7356539152048623f, - 0.7357425748043749f, - 0.7358312217971372f, - 0.7359198561816302f, - 0.7360084779563355f, - 0.7360970871197343f, - 0.7361856836703083f, - 0.7362742676065396f, - 0.7363628389269102f, - 0.7364513976299025f, - 0.736539943713999f, - 0.7366284771776825f, - 0.7367169980194362f, - 0.7368055062377431f, - 0.7368940018310867f, - 0.7369824847979507f, - 0.737070955136819f, - 0.7371594128461754f, - 0.7372478579245046f, - 0.7373362903702909f, - 0.7374247101820189f, - 0.7375131173581739f, - 0.7376015118972408f, - 0.7376898937977051f, - 0.7377782630580524f, - 0.7378666196767684f, - 0.7379549636523393f, - 0.7380432949832512f, - 0.7381316136679905f, - 0.7382199197050442f, - 0.7383082130928991f, - 0.738396493830042f, - 0.7384847619149606f, - 0.7385730173461422f, - 0.7386612601220749f, - 0.7387494902412463f, - 0.7388377077021447f, - 0.7389259125032587f, - 0.7390141046430768f, - 0.7391022841200879f, - 0.7391904509327809f, - 0.7392786050796453f, - 0.7393667465591708f, - 0.7394548753698466f, - 0.7395429915101628f, - 0.7396310949786097f, - 0.7397191857736777f, - 0.7398072638938572f, - 0.739895329337639f, - 0.7399833821035144f, - 0.7400714221899743f, - 0.7401594495955105f, - 0.7402474643186144f, - 0.740335466357778f, - 0.7404234557114936f, - 0.7405114323782531f, - 0.7405993963565493f, - 0.7406873476448749f, - 0.7407752862417228f, - 0.7408632121455865f, - 0.7409511253549591f, - 0.7410390258683343f, - 0.741126913684206f, - 0.7412147888010684f, - 0.7413026512174156f, - 0.741390500931742f, - 0.7414783379425426f, - 0.7415661622483123f, - 0.741653973847546f, - 0.7417417727387392f, - 0.7418295589203876f, - 0.7419173323909868f, - 0.7420050931490331f, - 0.7420928411930224f, - 0.7421805765214515f, - 0.7422682991328169f, - 0.7423560090256155f, - 0.7424437061983444f, - 0.7425313906495011f, - 0.7426190623775831f, - 0.742706721381088f, - 0.7427943676585137f, - 0.7428820012083587f, - 0.7429696220291213f, - 0.7430572301193002f, - 0.7431448254773941f, - 0.7432324081019024f, - 0.743319977991324f, - 0.7434075351441586f, - 0.7434950795589059f, - 0.743582611234066f, - 0.743670130168139f, - 0.7437576363596251f, - 0.7438451298070251f, - 0.7439326105088396f, - 0.74402007846357f, - 0.7441075336697173f, - 0.744194976125783f, - 0.7442824058302687f, - 0.7443698227816766f, - 0.7444572269785088f, - 0.7445446184192673f, - 0.7446319971024551f, - 0.7447193630265748f, - 0.7448067161901294f, - 0.744894056591622f, - 0.7449813842295563f, - 0.7450686991024358f, - 0.7451560012087645f, - 0.7452432905470463f, - 0.7453305671157857f, - 0.7454178309134872f, - 0.7455050819386556f, - 0.7455923201897958f, - 0.7456795456654131f, - 0.7457667583640127f, - 0.7458539582841005f, - 0.7459411454241821f, - 0.7460283197827638f, - 0.7461154813583517f, - 0.7462026301494524f, - 0.7462897661545728f, - 0.7463768893722195f, - 0.7464639998008998f, - 0.7465510974391213f, - 0.7466381822853914f, - 0.7467252543382178f, - 0.7468123135961089f, - 0.7468993600575726f, - 0.7469863937211177f, - 0.7470734145852527f, - 0.7471604226484866f, - 0.7472474179093285f, - 0.7473344003662876f, - 0.7474213700178738f, - 0.7475083268625967f, - 0.7475952708989664f, - 0.7476822021254932f, - 0.7477691205406873f, - 0.7478560261430597f, - 0.7479429189311211f, - 0.7480297989033825f, - 0.7481166660583555f, - 0.7482035203945515f, - 0.7482903619104824f, - 0.74837719060466f, - 0.7484640064755966f, - 0.7485508095218047f, - 0.748637599741797f, - 0.7487243771340861f, - 0.7488111416971853f, - 0.7488978934296082f, - 0.7489846323298677f, - 0.749071358396478f, - 0.7491580716279529f, - 0.7492447720228066f, - 0.7493314595795536f, - 0.7494181342967084f, - 0.749504796172786f, - 0.7495914452063014f, - 0.7496780813957699f, - 0.749764704739707f, - 0.7498513152366284f, - 0.7499379128850503f, - 0.7500244976834886f, - 0.7501110696304596f, - 0.7501976287244801f, - 0.750284174964067f, - 0.7503707083477371f, - 0.7504572288740079f, - 0.7505437365413969f, - 0.7506302313484218f, - 0.7507167132936003f, - 0.7508031823754509f, - 0.7508896385924917f, - 0.7509760819432415f, - 0.751062512426219f, - 0.7511489300399432f, - 0.7512353347829335f, - 0.7513217266537091f, - 0.75140810565079f, - 0.751494471772696f, - 0.7515808250179473f, - 0.7516671653850642f, - 0.7517534928725673f, - 0.7518398074789773f, - 0.7519261092028154f, - 0.7520123980426028f, - 0.752098673996861f, - 0.7521849370641114f, - 0.7522711872428762f, - 0.7523574245316774f, - 0.7524436489290375f, - 0.7525298604334788f, - 0.7526160590435244f, - 0.7527022447576971f, - 0.7527884175745201f, - 0.7528745774925171f, - 0.7529607245102115f, - 0.7530468586261273f, - 0.7531329798387888f, - 0.7532190881467199f, - 0.7533051835484456f, - 0.7533912660424904f, - 0.7534773356273794f, - 0.7535633923016378f, - 0.7536494360637911f, - 0.7537354669123649f, - 0.7538214848458852f, - 0.7539074898628778f, - 0.7539934819618694f, - 0.7540794611413864f, - 0.7541654273999556f, - 0.7542513807361038f, - 0.7543373211483584f, - 0.7544232486352468f, - 0.7545091631952967f, - 0.7545950648270359f, - 0.7546809535289924f, - 0.7547668292996949f, - 0.7548526921376715f, - 0.7549385420414512f, - 0.755024379009563f, - 0.7551102030405359f, - 0.7551960141328996f, - 0.7552818122851837f, - 0.7553675974959178f, - 0.7554533697636322f, - 0.7555391290868573f, - 0.7556248754641235f, - 0.7557106088939616f, - 0.7557963293749026f, - 0.7558820369054777f, - 0.7559677314842183f, - 0.756053413109656f, - 0.7561390817803227f, - 0.7562247374947506f, - 0.7563103802514719f, - 0.7563960100490192f, - 0.7564816268859252f, - 0.7565672307607229f, - 0.7566528216719454f, - 0.7567383996181263f, - 0.7568239645977991f, - 0.7569095166094978f, - 0.7569950556517564f, - 0.7570805817231092f, - 0.7571660948220907f, - 0.757251594947236f, - 0.7573370820970796f, - 0.757422556270157f, - 0.7575080174650034f, - 0.7575934656801546f, - 0.7576789009141465f, - 0.757764323165515f, - 0.7578497324327966f, - 0.7579351287145278f, - 0.7580205120092454f, - 0.7581058823154861f, - 0.7581912396317875f, - 0.758276583956687f, - 0.7583619152887219f, - 0.7584472336264302f, - 0.7585325389683502f, - 0.75861783131302f, - 0.7587031106589781f, - 0.7587883770047635f, - 0.7588736303489151f, - 0.7589588706899718f, - 0.7590440980264735f, - 0.7591293123569597f, - 0.7592145136799701f, - 0.7592997019940451f, - 0.7593848772977247f, - 0.7594700395895496f, - 0.7595551888680605f, - 0.7596403251317985f, - 0.7597254483793048f, - 0.7598105586091206f, - 0.7598956558197879f, - 0.7599807400098484f, - 0.7600658111778442f, - 0.7601508693223177f, - 0.7602359144418114f, - 0.7603209465348683f, - 0.760405965600031f, - 0.7604909716358429f, - 0.7605759646408475f, - 0.7606609446135884f, - 0.7607459115526094f, - 0.7608308654564548f, - 0.760915806323669f, - 0.7610007341527963f, - 0.7610856489423817f, - 0.7611705506909701f, - 0.7612554393971067f, - 0.7613403150593372f, - 0.7614251776762069f, - 0.7615100272462618f, - 0.7615948637680483f, - 0.7616796872401125f, - 0.761764497661001f, - 0.7618492950292607f, - 0.7619340793434385f, - 0.7620188506020816f, - 0.7621036088037377f, - 0.7621883539469544f, - 0.7622730860302794f, - 0.7623578050522613f, - 0.7624425110114479f, - 0.7625272039063881f, - 0.7626118837356307f, - 0.7626965504977247f, - 0.7627812041912193f, - 0.7628658448146641f, - 0.7629504723666087f, - 0.7630350868456032f, - 0.7631196882501975f, - 0.7632042765789422f, - 0.7632888518303877f, - 0.763373414003085f, - 0.7634579630955851f, - 0.7635424991064392f, - 0.763627022034199f, - 0.7637115318774159f, - 0.7637960286346421f, - 0.7638805123044298f, - 0.7639649828853312f, - 0.764049440375899f, - 0.764133884774686f, - 0.7642183160802454f, - 0.7643027342911304f, - 0.7643871394058945f, - 0.7644715314230917f, - 0.7645559103412755f, - 0.7646402761590003f, - 0.7647246288748206f, - 0.7648089684872911f, - 0.7648932949949664f, - 0.7649776083964018f, - 0.7650619086901526f, - 0.7651461958747742f, - 0.7652304699488225f, - 0.7653147309108533f, - 0.7653989787594231f, - 0.7654832134930881f, - 0.7655674351104051f, - 0.765651643609931f, - 0.7657358389902227f, - 0.7658200212498376f, - 0.7659041903873335f, - 0.7659883464012679f, - 0.766072489290199f, - 0.766156619052685f, - 0.7662407356872842f, - 0.7663248391925555f, - 0.7664089295670575f, - 0.7664930068093498f, - 0.7665770709179914f, - 0.7666611218915421f, - 0.7667451597285615f, - 0.7668291844276097f, - 0.766913195987247f, - 0.766997194406034f, - 0.7670811796825312f, - 0.7671651518152995f, - 0.7672491108029003f, - 0.7673330566438948f, - 0.7674169893368448f, - 0.7675009088803121f, - 0.7675848152728585f, - 0.7676687085130465f, - 0.7677525885994386f, - 0.7678364555305974f, - 0.7679203093050861f, - 0.7680041499214677f, - 0.7680879773783057f, - 0.7681717916741636f, - 0.7682555928076056f, - 0.7683393807771954f, - 0.7684231555814975f, - 0.7685069172190767f, - 0.7685906656884972f, - 0.7686744009883244f, - 0.7687581231171233f, - 0.7688418320734596f, - 0.7689255278558986f, - 0.7690092104630065f, - 0.7690928798933494f, - 0.7691765361454935f, - 0.7692601792180056f, - 0.7693438091094522f, - 0.7694274258184006f, - 0.769511029343418f, - 0.7695946196830717f, - 0.7696781968359295f, - 0.7697617608005592f, - 0.7698453115755293f, - 0.7699288491594078f, - 0.7700123735507636f, - 0.7700958847481653f, - 0.7701793827501822f, - 0.7702628675553833f, - 0.7703463391623383f, - 0.7704297975696169f, - 0.7705132427757893f, - 0.7705966747794252f, - 0.7706800935790953f, - 0.7707634991733702f, - 0.7708468915608208f, - 0.7709302707400181f, - 0.7710136367095335f, - 0.7710969894679386f, - 0.7711803290138051f, - 0.771263655345705f, - 0.7713469684622104f, - 0.771430268361894f, - 0.7715135550433284f, - 0.7715968285050864f, - 0.7716800887457412f, - 0.7717633357638662f, - 0.7718465695580349f, - 0.7719297901268212f, - 0.772012997468799f, - 0.7720961915825428f, - 0.7721793724666268f, - 0.772262540119626f, - 0.7723456945401151f, - 0.7724288357266694f, - 0.7725119636778645f, - 0.7725950783922756f, - 0.7726781798684788f, - 0.77276126810505f, - 0.7728443431005658f, - 0.7729274048536025f, - 0.7730104533627369f, - 0.7730934886265461f, - 0.7731765106436073f, - 0.7732595194124977f, - 0.7733425149317952f, - 0.7734254972000777f, - 0.7735084662159232f, - 0.7735914219779101f, - 0.773674364484617f, - 0.7737572937346227f, - 0.7738402097265062f, - 0.7739231124588467f, - 0.7740060019302238f, - 0.7740888781392172f, - 0.7741717410844068f, - 0.7742545907643728f, - 0.7743374271776954f, - 0.7744202503229555f, - 0.7745030601987338f, - 0.7745858568036115f, - 0.7746686401361697f, - 0.77475141019499f, - 0.7748341669786543f, - 0.7749169104857444f, - 0.7749996407148426f, - 0.7750823576645314f, - 0.7751650613333934f, - 0.7752477517200114f, - 0.7753304288229687f, - 0.7754130926408485f, - 0.7754957431722344f, - 0.7755783804157104f, - 0.7756610043698603f, - 0.7757436150332685f, - 0.7758262124045193f, - 0.7759087964821977f, - 0.7759913672648884f, - 0.7760739247511768f, - 0.776156468939648f, - 0.7762389998288878f, - 0.776321517417482f, - 0.7764040217040168f, - 0.7764865126870785f, - 0.7765689903652537f, - 0.7766514547371288f, - 0.7767339058012912f, - 0.7768163435563279f, - 0.7768987680008265f, - 0.7769811791333745f, - 0.7770635769525599f, - 0.7771459614569708f, - 0.7772283326451958f, - 0.777310690515823f, - 0.7773930350674417f, - 0.7774753662986408f, - 0.7775576842080096f, - 0.7776399887941375f, - 0.7777222800556143f, - 0.7778045579910298f, - 0.7778868225989745f, - 0.7779690738780384f, - 0.7780513118268125f, - 0.7781335364438876f, - 0.7782157477278548f, - 0.7782979456773055f, - 0.7783801302908311f, - 0.7784623015670233f, - 0.7785444595044746f, - 0.7786266041017768f, - 0.7787087353575223f, - 0.7787908532703041f, - 0.778872957838715f, - 0.7789550490613482f, - 0.779037126936797f, - 0.7791191914636553f, - 0.7792012426405166f, - 0.7792832804659752f, - 0.7793653049386253f, - 0.7794473160570614f, - 0.7795293138198784f, - 0.7796112982256712f, - 0.779693269273035f, - 0.7797752269605652f, - 0.7798571712868576f, - 0.7799391022505081f, - 0.7800210198501127f, - 0.780102924084268f, - 0.7801848149515703f, - 0.7802666924506166f, - 0.780348556580004f, - 0.7804304073383297f, - 0.7805122447241912f, - 0.7805940687361862f, - 0.7806758793729128f, - 0.780757676632969f, - 0.7808394605149535f, - 0.7809212310174646f, - 0.7810029881391015f, - 0.7810847318784632f, - 0.781166462234149f, - 0.7812481792047585f, - 0.7813298827888916f, - 0.7814115729851481f, - 0.7814932497921285f, - 0.7815749132084333f, - 0.781656563232663f, - 0.7817381998634186f, - 0.7818198230993014f, - 0.7819014329389127f, - 0.7819830293808543f, - 0.7820646124237278f, - 0.7821461820661356f, - 0.7822277383066798f, - 0.782309281143963f, - 0.7823908105765881f, - 0.782472326603158f, - 0.782553829222276f, - 0.7826353184325455f, - 0.7827167942325703f, - 0.7827982566209543f, - 0.7828797055963016f, - 0.7829611411572166f, - 0.7830425633023042f, - 0.7831239720301687f, - 0.7832053673394157f, - 0.7832867492286504f, - 0.7833681176964781f, - 0.7834494727415048f, - 0.7835308143623365f, - 0.7836121425575794f, - 0.7836934573258398f, - 0.7837747586657247f, - 0.7838560465758406f, - 0.7839373210547951f, - 0.7840185821011953f, - 0.784099829713649f, - 0.7841810638907639f, - 0.7842622846311482f, - 0.78434349193341f, - 0.784424685796158f, - 0.7845058662180011f, - 0.784587033197548f, - 0.784668186733408f, - 0.7847493268241906f, - 0.7848304534685056f, - 0.7849115666649628f, - 0.7849926664121722f, - 0.7850737527087446f, - 0.7851548255532901f, - 0.7852358849444198f, - 0.7853169308807448f, - 0.7853979633608764f, - 0.7854789823834262f, - 0.7855599879470057f, - 0.7856409800502271f, - 0.7857219586917025f, - 0.7858029238700444f, - 0.7858838755838654f, - 0.7859648138317786f, - 0.786045738612397f, - 0.7861266499243341f, - 0.7862075477662034f, - 0.7862884321366188f, - 0.7863693030341944f, - 0.7864501604575445f, - 0.7865310044052833f, - 0.786611834876026f, - 0.7866926518683874f, - 0.7867734553809828f, - 0.7868542454124274f, - 0.7869350219613372f, - 0.7870157850263281f, - 0.787096534606016f, - 0.7871772706990176f, - 0.7872579933039491f, - 0.7873387024194277f, - 0.7874193980440705f, - 0.7875000801764944f, - 0.7875807488153173f, - 0.7876614039591567f, - 0.7877420456066309f, - 0.7878226737563578f, - 0.7879032884069561f, - 0.7879838895570445f, - 0.7880644772052418f, - 0.7881450513501671f, - 0.78822561199044f, - 0.7883061591246798f, - 0.7883866927515069f, - 0.7884672128695407f, - 0.7885477194774019f, - 0.7886282125737109f, - 0.7887086921570886f, - 0.7887891582261559f, - 0.7888696107795341f, - 0.7889500498158446f, - 0.7890304753337092f, - 0.7891108873317497f, - 0.7891912858085884f, - 0.7892716707628477f, - 0.78935204219315f, - 0.7894324000981184f, - 0.7895127444763759f, - 0.7895930753265458f, - 0.7896733926472517f, - 0.7897536964371172f, - 0.7898339866947666f, - 0.789914263418824f, - 0.7899945266079139f, - 0.790074776260661f, - 0.7901550123756903f, - 0.790235234951627f, - 0.7903154439870963f, - 0.7903956394807241f, - 0.790475821431136f, - 0.7905559898369584f, - 0.7906361446968174f, - 0.7907162860093397f, - 0.790796413773152f, - 0.7908765279868815f, - 0.7909566286491553f, - 0.7910367157586009f, - 0.7911167893138462f, - 0.791196849313519f, - 0.7912768957562476f, - 0.7913569286406602f, - 0.7914369479653858f, - 0.791516953729053f, - 0.791596945930291f, - 0.7916769245677292f, - 0.7917568896399972f, - 0.7918368411457248f, - 0.7919167790835422f, - 0.7919967034520793f, - 0.792076614249967f, - 0.7921565114758359f, - 0.792236395128317f, - 0.7923162652060415f, - 0.7923961217076407f, - 0.7924759646317465f, - 0.7925557939769908f, - 0.7926356097420056f, - 0.7927154119254235f, - 0.7927952005258769f, - 0.7928749755419987f, - 0.792954736972422f, - 0.7930344848157802f, - 0.7931142190707066f, - 0.7931939397358354f, - 0.7932736468098001f, - 0.7933533402912352f, - 0.7934330201787752f, - 0.7935126864710547f, - 0.7935923391667087f, - 0.7936719782643723f, - 0.7937516037626811f, - 0.7938312156602706f, - 0.7939108139557766f, - 0.7939903986478353f, - 0.794069969735083f, - 0.7941495272161564f, - 0.7942290710896922f, - 0.7943086013543273f, - 0.7943881180086994f, - 0.7944676210514454f, - 0.7945471104812034f, - 0.7946265862966114f, - 0.7947060484963074f, - 0.7947854970789301f, - 0.7948649320431179f, - 0.79494435338751f, - 0.7950237611107452f, - 0.7951031552114631f, - 0.7951825356883034f, - 0.7952619025399057f, - 0.7953412557649101f, - 0.7954205953619569f, - 0.7954999213296866f, - 0.7955792336667402f, - 0.7956585323717585f, - 0.7957378174433829f, - 0.7958170888802548f, - 0.7958963466810158f, - 0.7959755908443079f, - 0.7960548213687734f, - 0.7961340382530546f, - 0.7962132414957941f, - 0.7962924310956347f, - 0.7963716070512197f, - 0.7964507693611923f, - 0.7965299180241963f, - 0.7966090530388752f, - 0.7966881744038732f, - 0.7967672821178347f, - 0.7968463761794039f, - 0.7969254565872258f, - 0.7970045233399453f, - 0.7970835764362076f, - 0.7971626158746583f, - 0.7972416416539427f, - 0.7973206537727071f, - 0.7973996522295975f, - 0.7974786370232603f, - 0.797557608152342f, - 0.7976365656154896f, - 0.7977155094113502f, - 0.797794439538571f, - 0.7978733559957996f, - 0.7979522587816837f, - 0.7980311478948717f, - 0.7981100233340114f, - 0.7981888850977515f, - 0.7982677331847406f, - 0.7983465675936279f, - 0.7984253883230624f, - 0.7985041953716935f, - 0.798582988738171f, - 0.7986617684211448f, - 0.7987405344192648f, - 0.7988192867311816f, - 0.7988980253555458f, - 0.7989767502910082f, - 0.7990554615362198f, - 0.7991341590898319f, - 0.7992128429504961f, - 0.7992915131168641f, - 0.799370169587588f, - 0.7994488123613199f, - 0.7995274414367125f, - 0.7996060568124184f, - 0.7996846584870905f, - 0.799763246459382f, - 0.7998418207279464f, - 0.7999203812914373f, - 0.7999989281485086f, - 0.8000774612978142f, - 0.8001559807380089f, - 0.8002344864677469f, - 0.8003129784856832f, - 0.8003914567904727f, - 0.800469921380771f, - 0.8005483722552333f, - 0.8006268094125156f, - 0.8007052328512739f, - 0.8007836425701643f, - 0.8008620385678433f, - 0.8009404208429677f, - 0.8010187893941942f, - 0.8010971442201803f, - 0.8011754853195833f, - 0.8012538126910607f, - 0.8013321263332704f, - 0.8014104262448708f, - 0.8014887124245199f, - 0.8015669848708765f, - 0.8016452435825994f, - 0.8017234885583475f, - 0.8018017197967805f, - 0.8018799372965575f, - 0.8019581410563383f, - 0.8020363310747831f, - 0.8021145073505521f, - 0.8021926698823056f, - 0.8022708186687045f, - 0.8023489537084096f, - 0.8024270750000823f, - 0.8025051825423837f, - 0.8025832763339755f, - 0.8026613563735199f, - 0.8027394226596789f, - 0.8028174751911146f, - 0.8028955139664897f, - 0.8029735389844671f, - 0.8030515502437099f, - 0.8031295477428814f, - 0.8032075314806448f, - 0.8032855014556644f, - 0.8033634576666039f, - 0.8034414001121275f, - 0.8035193287908998f, - 0.8035972437015856f, - 0.8036751448428496f, - 0.8037530322133574f, - 0.8038309058117739f, - 0.8039087656367649f, - 0.8039866116869965f, - 0.8040644439611346f, - 0.8041422624578458f, - 0.8042200671757965f, - 0.8042978581136537f, - 0.8043756352700844f, - 0.8044533986437559f, - 0.8045311482333357f, - 0.8046088840374916f, - 0.8046866060548918f, - 0.8047643142842044f, - 0.8048420087240977f, - 0.8049196893732407f, - 0.8049973562303022f, - 0.8050750092939516f, - 0.8051526485628582f, - 0.8052302740356917f, - 0.8053078857111219f, - 0.8053854835878191f, - 0.8054630676644536f, - 0.8055406379396961f, - 0.8056181944122174f, - 0.8056957370806885f, - 0.805773265943781f, - 0.805850781000166f, - 0.8059282822485158f, - 0.806005769687502f, - 0.8060832433157973f, - 0.8061607031320739f, - 0.8062381491350047f, - 0.8063155813232625f, - 0.8063929996955208f, - 0.8064704042504528f, - 0.8065477949867325f, - 0.8066251719030334f, - 0.80670253499803f, - 0.8067798842703966f, - 0.8068572197188077f, - 0.8069345413419385f, - 0.8070118491384639f, - 0.8070891431070593f, - 0.8071664232464002f, - 0.8072436895551626f, - 0.8073209420320224f, - 0.8073981806756559f, - 0.80747540548474f, - 0.8075526164579508f, - 0.8076298135939659f, - 0.8077069968914623f, - 0.8077841663491175f, - 0.8078613219656092f, - 0.8079384637396154f, - 0.8080155916698144f, - 0.8080927057548845f, - 0.8081698059935044f, - 0.8082468923843529f, - 0.8083239649261094f, - 0.8084010236174531f, - 0.8084780684570637f, - 0.8085550994436209f, - 0.8086321165758049f, - 0.8087091198522962f, - 0.8087861092717751f, - 0.8088630848329226f, - 0.8089400465344195f, - 0.8090169943749475f, - 0.8090939283531876f, - 0.809170848467822f, - 0.8092477547175324f, - 0.8093246471010013f, - 0.8094015256169109f, - 0.8094783902639441f, - 0.8095552410407837f, - 0.809632077946113f, - 0.8097089009786154f, - 0.8097857101369745f, - 0.8098625054198743f, - 0.8099392868259987f, - 0.8100160543540323f, - 0.8100928080026597f, - 0.8101695477705656f, - 0.8102462736564353f, - 0.810322985658954f, - 0.8103996837768072f, - 0.8104763680086807f, - 0.8105530383532606f, - 0.8106296948092333f, - 0.8107063373752851f, - 0.8107829660501028f, - 0.8108595808323734f, - 0.8109361817207842f, - 0.8110127687140226f, - 0.8110893418107763f, - 0.8111659010097334f, - 0.8112424463095818f, - 0.8113189777090101f, - 0.8113954952067067f, - 0.8114719988013609f, - 0.8115484884916616f, - 0.811624964276298f, - 0.8117014261539602f, - 0.8117778741233376f, - 0.8118543081831205f, - 0.8119307283319991f, - 0.8120071345686641f, - 0.8120835268918063f, - 0.8121599053001165f, - 0.8122362697922862f, - 0.8123126203670068f, - 0.8123889570229701f, - 0.8124652797588682f, - 0.8125415885733931f, - 0.8126178834652374f, - 0.812694164433094f, - 0.8127704314756554f, - 0.8128466845916151f, - 0.8129229237796666f, - 0.8129991490385032f, - 0.8130753603668194f, - 0.8131515577633086f, - 0.8132277412266656f, - 0.8133039107555851f, - 0.8133800663487617f, - 0.8134562080048906f, - 0.8135323357226671f, - 0.8136084495007869f, - 0.8136845493379458f, - 0.8137606352328397f, - 0.8138367071841649f, - 0.8139127651906181f, - 0.8139888092508959f, - 0.8140648393636953f, - 0.8141408555277136f, - 0.8142168577416484f, - 0.8142928460041973f, - 0.8143688203140582f, - 0.8144447806699294f, - 0.8145207270705094f, - 0.8145966595144967f, - 0.8146725780005903f, - 0.8147484825274894f, - 0.8148243730938933f, - 0.8149002496985018f, - 0.8149761123400148f, - 0.8150519610171321f, - 0.8151277957285542f, - 0.8152036164729818f, - 0.8152794232491157f, - 0.8153552160556569f, - 0.8154309948913068f, - 0.8155067597547668f, - 0.815582510644739f, - 0.815658247559925f, - 0.8157339704990273f, - 0.8158096794607486f, - 0.8158853744437913f, - 0.8159610554468585f, - 0.8160367224686536f, - 0.8161123755078797f, - 0.8161880145632409f, - 0.8162636396334408f, - 0.8163392507171839f, - 0.8164148478131745f, - 0.8164904309201172f, - 0.816566000036717f, - 0.8166415551616789f, - 0.8167170962937085f, - 0.8167926234315112f, - 0.816868136573793f, - 0.8169436357192599f, - 0.8170191208666183f, - 0.8170945920145749f, - 0.8171700491618364f, - 0.8172454923071099f, - 0.8173209214491025f, - 0.8173963365865221f, - 0.8174717377180762f, - 0.8175471248424729f, - 0.8176224979584207f, - 0.8176978570646277f, - 0.8177732021598029f, - 0.8178485332426552f, - 0.8179238503118937f, - 0.8179991533662282f, - 0.8180744424043681f, - 0.8181497174250234f, - 0.8182249784269044f, - 0.8183002254087214f, - 0.8183754583691851f, - 0.8184506773070064f, - 0.8185258822208966f, - 0.8186010731095669f, - 0.8186762499717289f, - 0.8187514128060945f, - 0.8188265616113759f, - 0.8189016963862854f, - 0.8189768171295355f, - 0.8190519238398392f, - 0.8191270165159092f, - 0.8192020951564594f, - 0.8192771597602028f, - 0.8193522103258535f, - 0.8194272468521255f, - 0.819502269337733f, - 0.8195772777813903f, - 0.8196522721818125f, - 0.8197272525377145f, - 0.8198022188478113f, - 0.8198771711108187f, - 0.8199521093254523f, - 0.8200270334904279f, - 0.820101943604462f, - 0.8201768396662708f, - 0.8202517216745709f, - 0.8203265896280796f, - 0.8204014435255137f, - 0.8204762833655906f, - 0.8205511091470281f, - 0.820625920868544f, - 0.8207007185288565f, - 0.8207755021266838f, - 0.8208502716607448f, - 0.820925027129758f, - 0.8209997685324427f, - 0.8210744958675181f, - 0.8211492091337039f, - 0.82122390832972f, - 0.8212985934542861f, - 0.8213732645061228f, - 0.8214479214839504f, - 0.8215225643864899f, - 0.821597193212462f, - 0.8216718079605884f, - 0.8217464086295901f, - 0.8218209952181893f, - 0.8218955677251077f, - 0.8219701261490676f, - 0.8220446704887915f, - 0.822119200743002f, - 0.8221937169104222f, - 0.8222682189897751f, - 0.8223427069797842f, - 0.8224171808791731f, - 0.822491640686666f, - 0.8225660864009867f, - 0.8226405180208598f, - 0.8227149355450097f, - 0.8227893389721617f, - 0.8228637283010405f, - 0.8229381035303717f, - 0.8230124646588808f, - 0.8230868116852936f, - 0.8231611446083363f, - 0.8232354634267353f, - 0.8233097681392169f, - 0.823384058744508f, - 0.8234583352413357f, - 0.8235325976284275f, - 0.8236068459045105f, - 0.8236810800683128f, - 0.8237553001185622f, - 0.8238295060539872f, - 0.8239036978733162f, - 0.8239778755752779f, - 0.8240520391586014f, - 0.8241261886220157f, - 0.8242003239642504f, - 0.8242744451840353f, - 0.8243485522801002f, - 0.8244226452511754f, - 0.8244967240959913f, - 0.8245707888132785f, - 0.824644839401768f, - 0.8247188758601911f, - 0.824792898187279f, - 0.8248669063817634f, - 0.8249409004423763f, - 0.8250148803678496f, - 0.8250888461569159f, - 0.8251627978083077f, - 0.8252367353207579f, - 0.8253106586929996f, - 0.825384567923766f, - 0.8254584630117909f, - 0.8255323439558081f, - 0.8256062107545517f, - 0.8256800634067557f, - 0.825753901911155f, - 0.8258277262664844f, - 0.8259015364714786f, - 0.8259753325248732f, - 0.8260491144254036f, - 0.8261228821718056f, - 0.8261966357628152f, - 0.8262703751971686f, - 0.8263441004736024f, - 0.8264178115908533f, - 0.8264915085476582f, - 0.8265651913427544f, - 0.8266388599748795f, - 0.8267125144427709f, - 0.8267861547451668f, - 0.8268597808808053f, - 0.8269333928484247f, - 0.827006990646764f, - 0.8270805742745618f, - 0.8271541437305574f, - 0.8272276990134904f, - 0.8273012401221f, - 0.8273747670551265f, - 0.82744827981131f, - 0.8275217783893907f, - 0.8275952627881092f, - 0.8276687330062066f, - 0.8277421890424237f, - 0.8278156308955021f, - 0.8278890585641832f, - 0.8279624720472091f, - 0.8280358713433216f, - 0.8281092564512632f, - 0.8281826273697764f, - 0.828255984097604f, - 0.8283293266334892f, - 0.8284026549761753f, - 0.8284759691244055f, - 0.8285492690769237f, - 0.828622554832474f, - 0.8286958263898009f, - 0.8287690837476486f, - 0.8288423269047619f, - 0.8289155558598859f, - 0.8289887706117658f, - 0.829061971159147f, - 0.8291351575007754f, - 0.8292083296353968f, - 0.8292814875617577f, - 0.8293546312786041f, - 0.829427760784683f, - 0.8295008760787413f, - 0.8295739771595263f, - 0.8296470640257853f, - 0.8297201366762659f, - 0.8297931951097162f, - 0.8298662393248841f, - 0.8299392693205183f, - 0.8300122850953674f, - 0.8300852866481803f, - 0.8301582739777059f, - 0.8302312470826938f, - 0.8303042059618936f, - 0.8303771506140551f, - 0.8304500810379285f, - 0.8305229972322642f, - 0.8305958991958126f, - 0.8306687869273247f, - 0.8307416604255515f, - 0.8308145196892445f, - 0.8308873647171551f, - 0.8309601955080351f, - 0.8310330120606368f, - 0.8311058143737122f, - 0.8311786024460142f, - 0.8312513762762952f, - 0.8313241358633086f, - 0.8313968812058073f, - 0.8314696123025452f, - 0.8315423291522759f, - 0.8316150317537535f, - 0.8316877201057321f, - 0.8317603942069663f, - 0.831833054056211f, - 0.8319056996522209f, - 0.8319783309937515f, - 0.8320509480795582f, - 0.8321235509083965f, - 0.8321961394790227f, - 0.8322687137901928f, - 0.8323412738406634f, - 0.8324138196291911f, - 0.832486351154533f, - 0.832558868415446f, - 0.8326313714106878f, - 0.832703860139016f, - 0.8327763345991885f, - 0.8328487947899635f, - 0.8329212407100995f, - 0.832993672358355f, - 0.833066089733489f, - 0.8331384928342604f, - 0.833210881659429f, - 0.8332832562077542f, - 0.8333556164779959f, - 0.8334279624689144f, - 0.8335002941792697f, - 0.8335726116078228f, - 0.8336449147533342f, - 0.8337172036145656f, - 0.8337894781902777f, - 0.8338617384792323f, - 0.8339339844801914f, - 0.8340062161919168f, - 0.8340784336131711f, - 0.8341506367427168f, - 0.8342228255793167f, - 0.8342950001217339f, - 0.8343671603687316f, - 0.8344393063190734f, - 0.8345114379715232f, - 0.834583555324845f, - 0.834655658377803f, - 0.8347277471291618f, - 0.8347998215776861f, - 0.8348718817221409f, - 0.8349439275612917f, - 0.8350159590939038f, - 0.835087976318743f, - 0.8351599792345754f, - 0.8352319678401672f, - 0.8353039421342848f, - 0.8353759021156951f, - 0.8354478477831652f, - 0.8355197791354618f, - 0.8355916961713529f, - 0.835663598889606f, - 0.835735487288989f, - 0.8358073613682702f, - 0.8358792211262182f, - 0.8359510665616015f, - 0.836022897673189f, - 0.8360947144597501f, - 0.8361665169200543f, - 0.836238305052871f, - 0.8363100788569704f, - 0.8363818383311223f, - 0.8364535834740975f, - 0.8365253142846665f, - 0.8365970307616002f, - 0.8366687329036697f, - 0.8367404207096467f, - 0.8368120941783026f, - 0.8368837533084093f, - 0.836955398098739f, - 0.837027028548064f, - 0.837098644655157f, - 0.8371702464187911f, - 0.837241833837739f, - 0.8373134069107743f, - 0.8373849656366705f, - 0.8374565100142016f, - 0.8375280400421417f, - 0.837599555719265f, - 0.8376710570443463f, - 0.8377425440161603f, - 0.8378140166334822f, - 0.8378854748950871f, - 0.837956918799751f, - 0.8380283483462494f, - 0.8380997635333584f, - 0.8381711643598543f, - 0.8382425508245138f, - 0.8383139229261137f, - 0.838385280663431f, - 0.838456624035243f, - 0.8385279530403272f, - 0.8385992676774615f, - 0.8386705679454239f, - 0.8387418538429928f, - 0.8388131253689466f, - 0.8388843825220641f, - 0.8389556253011243f, - 0.8390268537049065f, - 0.8390980677321903f, - 0.8391692673817553f, - 0.8392404526523817f, - 0.8393116235428496f, - 0.8393827800519397f, - 0.8394539221784325f, - 0.8395250499211092f, - 0.839596163278751f, - 0.8396672622501393f, - 0.839738346834056f, - 0.8398094170292829f, - 0.8398804728346023f, - 0.8399515142487968f, - 0.840022541270649f, - 0.8400935538989419f, - 0.8401645521324587f, - 0.8402355359699828f, - 0.8403065054102982f, - 0.8403774604521884f, - 0.840448401094438f, - 0.8405193273358312f, - 0.840590239175153f, - 0.840661136611188f, - 0.8407320196427216f, - 0.8408028882685391f, - 0.8408737424874263f, - 0.840944582298169f, - 0.8410154076995536f, - 0.8410862186903664f, - 0.841157015269394f, - 0.8412277974354234f, - 0.8412985651872419f, - 0.8413693185236365f, - 0.8414400574433953f, - 0.8415107819453062f, - 0.8415814920281569f, - 0.8416521876907362f, - 0.8417228689318327f, - 0.8417935357502352f, - 0.841864188144733f, - 0.8419348261141152f, - 0.8420054496571717f, - 0.8420760587726923f, - 0.842146653459467f, - 0.8422172337162864f, - 0.8422877995419411f, - 0.842358350935222f, - 0.84242888789492f, - 0.8424994104198266f, - 0.8425699185087334f, - 0.8426404121604323f, - 0.8427108913737154f, - 0.8427813561473749f, - 0.8428518064802037f, - 0.8429222423709944f, - 0.8429926638185403f, - 0.8430630708216347f, - 0.843133463379071f, - 0.8432038414896432f, - 0.8432742051521455f, - 0.8433445543653719f, - 0.8434148891281174f, - 0.8434852094391766f, - 0.8435555152973445f, - 0.8436258067014166f, - 0.8436960836501886f, - 0.8437663461424559f, - 0.8438365941770148f, - 0.8439068277526618f, - 0.8439770468681932f, - 0.8440472515224061f, - 0.8441174417140972f, - 0.844187617442064f, - 0.844257778705104f, - 0.8443279255020151f, - 0.8443980578315953f, - 0.8444681756926429f, - 0.8445382790839564f, - 0.8446083680043347f, - 0.8446784424525767f, - 0.8447485024274819f, - 0.8448185479278496f, - 0.8448885789524799f, - 0.8449585955001726f, - 0.845028597569728f, - 0.8450985851599467f, - 0.8451685582696294f, - 0.8452385168975773f, - 0.8453084610425915f, - 0.8453783907034736f, - 0.8454483058790254f, - 0.8455182065680489f, - 0.8455880927693462f, - 0.8456579644817201f, - 0.8457278217039733f, - 0.8457976644349087f, - 0.8458674926733296f, - 0.8459373064180395f, - 0.8460071056678422f, - 0.8460768904215418f, - 0.8461466606779423f, - 0.8462164164358484f, - 0.8462861576940648f, - 0.8463558844513966f, - 0.846425596706649f, - 0.8464952944586275f, - 0.8465649777061378f, - 0.8466346464479859f, - 0.846704300682978f, - 0.8467739404099207f, - 0.8468435656276206f, - 0.8469131763348849f, - 0.8469827725305208f, - 0.8470523542133356f, - 0.8471219213821372f, - 0.8471914740357335f, - 0.8472610121729327f, - 0.8473305357925435f, - 0.8474000448933744f, - 0.8474695394742345f, - 0.847539019533933f, - 0.8476084850712794f, - 0.8476779360850831f, - 0.8477473725741547f, - 0.847816794537304f, - 0.8478862019733416f, - 0.8479555948810782f, - 0.8480249732593247f, - 0.8480943371068925f, - 0.8481636864225929f, - 0.8482330212052378f, - 0.8483023414536389f, - 0.8483716471666085f, - 0.8484409383429592f, - 0.8485102149815037f, - 0.8485794770810549f, - 0.8486487246404258f, - 0.8487179576584303f, - 0.8487871761338818f, - 0.8488563800655943f, - 0.8489255694523822f, - 0.8489947442930597f, - 0.8490639045864417f, - 0.8491330503313429f, - 0.8492021815265789f, - 0.8492712981709648f, - 0.8493404002633165f, - 0.8494094878024498f, - 0.8494785607871812f, - 0.8495476192163268f, - 0.8496166630887035f, - 0.8496856924031283f, - 0.8497547071584183f, - 0.8498237073533909f, - 0.8498926929868639f, - 0.8499616640576553f, - 0.850030620564583f, - 0.8500995625064658f, - 0.8501684898821222f, - 0.8502374026903713f, - 0.8503063009300321f, - 0.8503751845999242f, - 0.8504440536988672f, - 0.8505129082256812f, - 0.8505817481791862f, - 0.8506505735582028f, - 0.8507193843615516f, - 0.8507881805880536f, - 0.85085696223653f, - 0.8509257293058021f, - 0.8509944817946918f, - 0.851063219702021f, - 0.8511319430266118f, - 0.8512006517672868f, - 0.8512693459228684f, - 0.8513380254921799f, - 0.8514066904740443f, - 0.851475340867285f, - 0.8515439766707258f, - 0.8516125978831908f, - 0.8516812045035038f, - 0.8517497965304895f, - 0.8518183739629726f, - 0.8518869367997779f, - 0.8519554850397307f, - 0.8520240186816564f, - 0.8520925377243809f, - 0.8521610421667298f, - 0.8522295320075295f, - 0.8522980072456064f, - 0.8523664678797871f, - 0.8524349139088989f, - 0.8525033453317686f, - 0.8525717621472239f, - 0.8526401643540922f, - 0.8527085519512018f, - 0.8527769249373806f, - 0.8528452833114573f, - 0.8529136270722604f, - 0.8529819562186188f, - 0.853050270749362f, - 0.8531185706633193f, - 0.8531868559593203f, - 0.8532551266361951f, - 0.8533233826927737f, - 0.8533916241278867f, - 0.8534598509403649f, - 0.853528063129039f, - 0.8535962606927403f, - 0.8536644436303004f, - 0.8537326119405507f, - 0.8538007656223234f, - 0.8538689046744508f, - 0.853937029095765f, - 0.854005138885099f, - 0.8540732340412859f, - 0.8541413145631583f, - 0.8542093804495503f, - 0.8542774316992952f, - 0.854345468311227f, - 0.8544134902841802f, - 0.854481497616989f, - 0.8545494903084883f, - 0.8546174683575127f, - 0.8546854317628978f, - 0.8547533805234789f, - 0.8548213146380919f, - 0.8548892341055726f, - 0.8549571389247571f, - 0.8550250290944821f, - 0.855092904613584f, - 0.8551607654809001f, - 0.8552286116952675f, - 0.8552964432555238f, - 0.8553642601605066f, - 0.8554320624090538f, - 0.8554998500000037f, - 0.8555676229321949f, - 0.855635381204466f, - 0.8557031248156561f, - 0.8557708537646042f, - 0.8558385680501499f, - 0.855906267671133f, - 0.8559739526263934f, - 0.8560416229147714f, - 0.8561092785351074f, - 0.8561769194862423f, - 0.8562445457670169f, - 0.8563121573762726f, - 0.8563797543128508f, - 0.8564473365755934f, - 0.8565149041633421f, - 0.8565824570749393f, - 0.8566499953092276f, - 0.8567175188650495f, - 0.8567850277412484f, - 0.8568525219366672f, - 0.8569200014501496f, - 0.8569874662805391f, - 0.8570549164266801f, - 0.8571223518874166f, - 0.8571897726615931f, - 0.8572571787480544f, - 0.8573245701456458f, - 0.8573919468532121f, - 0.857459308869599f, - 0.8575266561936523f, - 0.857593988824218f, - 0.8576613067601424f, - 0.8577286100002721f, - 0.8577958985434537f, - 0.8578631723885344f, - 0.8579304315343613f, - 0.8579976759797822f, - 0.8580649057236446f, - 0.8581321207647966f, - 0.8581993211020866f, - 0.8582665067343631f, - 0.8583336776604749f, - 0.858400833879271f, - 0.8584679753896007f, - 0.8585351021903136f, - 0.8586022142802594f, - 0.8586693116582883f, - 0.8587363943232506f, - 0.8588034622739966f, - 0.8588705155093773f, - 0.8589375540282439f, - 0.8590045778294476f, - 0.8590715869118398f, - 0.8591385812742725f, - 0.8592055609155976f, - 0.8592725258346676f, - 0.859339476030335f, - 0.8594064115014527f, - 0.8594733322468736f, - 0.8595402382654513f, - 0.8596071295560391f, - 0.8596740061174911f, - 0.859740867948661f, - 0.8598077150484037f, - 0.8598745474155735f, - 0.859941365049025f, - 0.8600081679476136f, - 0.8600749561101947f, - 0.8601417295356236f, - 0.8602084882227565f, - 0.8602752321704493f, - 0.8603419613775584f, - 0.8604086758429405f, - 0.8604753755654523f, - 0.860542060543951f, - 0.860608730777294f, - 0.860675386264339f, - 0.8607420270039436f, - 0.8608086529949662f, - 0.8608752642362651f, - 0.860941860726699f, - 0.8610084424651265f, - 0.8610750094504069f, - 0.8611415616813999f, - 0.8612080991569648f, - 0.8612746218759616f, - 0.8613411298372504f, - 0.8614076230396918f, - 0.8614741014821461f, - 0.8615405651634744f, - 0.861607014082538f, - 0.8616734482381981f, - 0.8617398676293164f, - 0.861806272254755f, - 0.861872662113376f, - 0.8619390372040416f, - 0.8620053975256148f, - 0.8620717430769583f, - 0.8621380738569354f, - 0.8622043898644096f, - 0.8622706910982445f, - 0.862336977557304f, - 0.8624032492404523f, - 0.8624695061465539f, - 0.8625357482744737f, - 0.8626019756230764f, - 0.8626681881912273f, - 0.8627343859777917f, - 0.8628005689816356f, - 0.8628667372016249f, - 0.8629328906366257f, - 0.8629990292855046f, - 0.8630651531471283f, - 0.8631312622203637f, - 0.8631973565040781f, - 0.8632634359971391f, - 0.8633295006984143f, - 0.8633955506067716f, - 0.8634615857210796f, - 0.8635276060402065f, - 0.8635936115630212f, - 0.8636596022883926f, - 0.8637255782151901f, - 0.8637915393422831f, - 0.8638574856685415f, - 0.8639234171928353f, - 0.8639893339140347f, - 0.8640552358310103f, - 0.8641211229426328f, - 0.8641869952477733f, - 0.8642528527453032f, - 0.8643186954340939f, - 0.8643845233130173f, - 0.8644503363809454f, - 0.8645161346367506f, - 0.8645819180793054f, - 0.8646476867074825f, - 0.8647134405201551f, - 0.8647791795161965f, - 0.8648449036944803f, - 0.8649106130538804f, - 0.8649763075932707f, - 0.8650419873115257f, - 0.86510765220752f, - 0.8651733022801282f, - 0.8652389375282258f, - 0.865304557950688f, - 0.8653701635463902f, - 0.8654357543142085f, - 0.865501330253019f, - 0.865566891361698f, - 0.8656324376391221f, - 0.8656979690841683f, - 0.8657634856957137f, - 0.8658289874726356f, - 0.8658944744138118f, - 0.86595994651812f, - 0.8660254037844386f, - 0.8660908462116458f, - 0.8661562737986204f, - 0.8662216865442413f, - 0.8662870844473874f, - 0.8663524675069385f, - 0.8664178357217741f, - 0.8664831890907742f, - 0.8665485276128189f, - 0.8666138512867886f, - 0.8666791601115642f, - 0.8667444540860265f, - 0.8668097332090567f, - 0.8668749974795362f, - 0.866940246896347f, - 0.8670054814583709f, - 0.86707070116449f, - 0.8671359060135869f, - 0.8672010960045444f, - 0.8672662711362453f, - 0.8673314314075731f, - 0.867396576817411f, - 0.8674617073646429f, - 0.8675268230481528f, - 0.867591923866825f, - 0.867657009819544f, - 0.8677220809051944f, - 0.8677871371226616f, - 0.8678521784708306f, - 0.8679172049485868f, - 0.8679822165548163f, - 0.8680472132884051f, - 0.8681121951482392f, - 0.8681771621332054f, - 0.8682421142421906f, - 0.8683070514740816f, - 0.868371973827766f, - 0.8684368813021311f, - 0.868501773896065f, - 0.8685666516084556f, - 0.8686315144381913f, - 0.8686963623841606f, - 0.8687611954452524f, - 0.8688260136203558f, - 0.8688908169083602f, - 0.8689556053081553f, - 0.8690203788186308f, - 0.8690851374386769f, - 0.8691498811671838f, - 0.8692146100030426f, - 0.8692793239451436f, - 0.8693440229923785f, - 0.8694087071436383f, - 0.8694733763978147f, - 0.8695380307537997f, - 0.8696026702104855f, - 0.8696672947667645f, - 0.8697319044215294f, - 0.869796499173673f, - 0.8698610790220885f, - 0.8699256439656696f, - 0.8699901940033097f, - 0.8700547291339029f, - 0.8701192493563434f, - 0.8701837546695257f, - 0.8702482450723443f, - 0.8703127205636945f, - 0.8703771811424711f, - 0.8704416268075701f, - 0.8705060575578868f, - 0.8705704733923174f, - 0.8706348743097583f, - 0.8706992603091056f, - 0.8707636313892565f, - 0.8708279875491077f, - 0.8708923287875566f, - 0.8709566551035008f, - 0.871020966495838f, - 0.8710852629634662f, - 0.8711495445052839f, - 0.8712138111201894f, - 0.8712780628070816f, - 0.8713422995648596f, - 0.8714065213924227f, - 0.8714707282886704f, - 0.8715349202525028f, - 0.8715990972828196f, - 0.8716632593785215f, - 0.8717274065385089f, - 0.8717915387616827f, - 0.8718556560469439f, - 0.871919758393194f, - 0.8719838457993347f, - 0.8720479182642678f, - 0.8721119757868953f, - 0.8721760183661197f, - 0.8722400460008437f, - 0.8723040586899701f, - 0.8723680564324022f, - 0.8724320392270433f, - 0.8724960070727971f, - 0.8725599599685675f, - 0.8726238979132588f, - 0.8726878209057753f, - 0.8727517289450217f, - 0.8728156220299031f, - 0.8728795001593247f, - 0.8729433633321917f, - 0.8730072115474101f, - 0.8730710448038858f, - 0.873134863100525f, - 0.8731986664362342f, - 0.8732624548099202f, - 0.8733262282204899f, - 0.8733899866668506f, - 0.8734537301479098f, - 0.8735174586625755f, - 0.8735811722097554f, - 0.8736448707883578f, - 0.8737085543972916f, - 0.8737722230354652f, - 0.8738358767017879f, - 0.8738995153951687f, - 0.8739631391145178f, - 0.8740267478587445f, - 0.8740903416267588f, - 0.8741539204174714f, - 0.8742174842297927f, - 0.8742810330626336f, - 0.8743445669149051f, - 0.8744080857855189f, - 0.8744715896733861f, - 0.8745350785774191f, - 0.8745985524965296f, - 0.8746620114296303f, - 0.8747254553756337f, - 0.8747888843334528f, - 0.8748522983020006f, - 0.8749156972801907f, - 0.8749790812669367f, - 0.8750424502611525f, - 0.8751058042617523f, - 0.8751691432676505f, - 0.8752324672777618f, - 0.8752957762910014f, - 0.8753590703062843f, - 0.875422349322526f, - 0.8754856133386423f, - 0.8755488623535492f, - 0.8756120963661629f, - 0.8756753153753997f, - 0.8757385193801767f, - 0.8758017083794106f, - 0.875864882372019f, - 0.8759280413569192f, - 0.875991185333029f, - 0.8760543142992665f, - 0.8761174282545501f, - 0.8761805271977982f, - 0.8762436111279296f, - 0.8763066800438637f, - 0.8763697339445193f, - 0.8764327728288164f, - 0.8764957966956747f, - 0.8765588055440142f, - 0.8766217993727555f, - 0.8766847781808191f, - 0.8767477419671259f, - 0.8768106907305969f, - 0.8768736244701537f, - 0.8769365431847178f, - 0.8769994468732112f, - 0.877062335534556f, - 0.8771252091676746f, - 0.8771880677714897f, - 0.8772509113449243f, - 0.8773137398869014f, - 0.8773765533963447f, - 0.8774393518721777f, - 0.8775021353133245f, - 0.8775649037187093f, - 0.8776276570872565f, - 0.877690395417891f, - 0.8777531187095375f, - 0.8778158269611217f, - 0.8778785201715686f, - 0.8779411983398044f, - 0.878003861464755f, - 0.8780665095453465f, - 0.8781291425805056f, - 0.8781917605691592f, - 0.878254363510234f, - 0.8783169514026578f, - 0.8783795242453578f, - 0.8784420820372619f, - 0.8785046247772983f, - 0.8785671524643954f, - 0.8786296650974816f, - 0.8786921626754859f, - 0.8787546451973374f, - 0.8788171126619654f, - 0.8788795650682996f, - 0.8789420024152699f, - 0.8790044247018064f, - 0.8790668319268397f, - 0.8791292240893002f, - 0.8791916011881189f, - 0.8792539632222272f, - 0.8793163101905562f, - 0.8793786420920379f, - 0.8794409589256041f, - 0.8795032606901871f, - 0.8795655473847193f, - 0.8796278190081335f, - 0.8796900755593626f, - 0.87975231703734f, - 0.8798145434409991f, - 0.8798767547692736f, - 0.8799389510210978f, - 0.8800011321954057f, - 0.880063298291132f, - 0.8801254493072114f, - 0.8801875852425789f, - 0.88024970609617f, - 0.8803118118669202f, - 0.8803739025537654f, - 0.8804359781556415f, - 0.880498038671485f, - 0.8805600841002325f, - 0.8806221144408208f, - 0.8806841296921871f, - 0.8807461298532688f, - 0.8808081149230036f, - 0.8808700849003293f, - 0.8809320397841839f, - 0.8809939795735061f, - 0.8810559042672345f, - 0.8811178138643079f, - 0.8811797083636657f, - 0.8812415877642472f, - 0.8813034520649922f, - 0.8813653012648406f, - 0.8814271353627328f, - 0.881488954357609f, - 0.8815507582484103f, - 0.8816125470340774f, - 0.8816743207135517f, - 0.8817360792857747f, - 0.8817978227496882f, - 0.8818595511042342f, - 0.8819212643483549f, - 0.8819829624809932f, - 0.8820446455010916f, - 0.8821063134075935f, - 0.8821679661994418f, - 0.8822296038755805f, - 0.8822912264349532f, - 0.8823528338765042f, - 0.8824144261991776f, - 0.8824760034019183f, - 0.8825375654836711f, - 0.8825991124433811f, - 0.8826606442799938f, - 0.8827221609924547f, - 0.88278366257971f, - 0.8828451490407057f, - 0.8829066203743882f, - 0.8829680765797043f, - 0.883029517655601f, - 0.8830909436010256f, - 0.8831523544149253f, - 0.8832137500962479f, - 0.8832751306439417f, - 0.8833364960569546f, - 0.8833978463342355f, - 0.8834591814747328f, - 0.8835205014773957f, - 0.8835818063411736f, - 0.8836430960650159f, - 0.8837043706478724f, - 0.8837656300886934f, - 0.883826874386429f, - 0.88388810354003f, - 0.883949317548447f, - 0.8840105164106312f, - 0.8840717001255342f, - 0.8841328686921074f, - 0.8841940221093026f, - 0.8842551603760723f, - 0.8843162834913687f, - 0.8843773914541444f, - 0.8844384842633525f, - 0.8844995619179461f, - 0.8845606244168785f, - 0.8846216717591038f, - 0.8846827039435756f, - 0.8847437209692485f, - 0.8848047228350765f, - 0.8848657095400148f, - 0.8849266810830181f, - 0.8849876374630418f, - 0.8850485786790414f, - 0.8851095047299729f, - 0.8851704156147919f, - 0.8852313113324551f, - 0.8852921918819191f, - 0.8853530572621403f, - 0.8854139074720762f, - 0.8854747425106839f, - 0.8855355623769212f, - 0.8855963670697459f, - 0.885657156588116f, - 0.8857179309309899f, - 0.8857786900973266f, - 0.8858394340860846f, - 0.8859001628962232f, - 0.8859608765267019f, - 0.8860215749764803f, - 0.8860822582445184f, - 0.8861429263297763f, - 0.8862035792312147f, - 0.8862642169477941f, - 0.8863248394784756f, - 0.8863854468222204f, - 0.8864460389779901f, - 0.8865066159447463f, - 0.8865671777214513f, - 0.8866277243070672f, - 0.8866882557005564f, - 0.8867487719008821f, - 0.8868092729070071f, - 0.8868697587178948f, - 0.8869302293325086f, - 0.8869906847498127f, - 0.887051124968771f, - 0.887111549988348f, - 0.8871719598075082f, - 0.8872323544252165f, - 0.8872927338404382f, - 0.8873530980521384f, - 0.8874134470592832f, - 0.8874737808608383f, - 0.8875340994557699f, - 0.8875944028430445f, - 0.8876546910216288f, - 0.8877149639904898f, - 0.8877752217485947f, - 0.887835464294911f, - 0.8878956916284064f, - 0.8879559037480491f, - 0.8880161006528072f, - 0.8880762823416495f, - 0.8881364488135445f, - 0.8881966000674615f, - 0.8882567361023695f, - 0.8883168569172385f, - 0.888376962511038f, - 0.8884370528827384f, - 0.8884971280313099f, - 0.8885571879557229f, - 0.8886172326549487f, - 0.8886772621279584f, - 0.8887372763737231f, - 0.8887972753912148f, - 0.8888572591794053f, - 0.8889172277372669f, - 0.8889771810637719f, - 0.889037119157893f, - 0.8890970420186032f, - 0.8891569496448759f, - 0.8892168420356844f, - 0.8892767191900025f, - 0.8893365811068044f, - 0.8893964277850641f, - 0.8894562592237565f, - 0.889516075421856f, - 0.8895758763783379f, - 0.8896356620921776f, - 0.8896954325623505f, - 0.8897551877878325f, - 0.8898149277675997f, - 0.8898746525006286f, - 0.8899343619858956f, - 0.8899940562223779f, - 0.8900537352090524f, - 0.8901133989448966f, - 0.8901730474288883f, - 0.8902326806600052f, - 0.8902922986372256f, - 0.890351901359528f, - 0.8904114888258913f, - 0.8904710610352942f, - 0.890530617986716f, - 0.8905901596791361f, - 0.8906496861115346f, - 0.8907091972828913f, - 0.8907686931921865f, - 0.8908281738384008f, - 0.8908876392205151f, - 0.8909470893375103f, - 0.8910065241883678f, - 0.8910659437720693f, - 0.8911253480875966f, - 0.8911847371339318f, - 0.8912441109100572f, - 0.8913034694149555f, - 0.8913628126476099f, - 0.8914221406070031f, - 0.8914814532921188f, - 0.8915407507019406f, - 0.8916000328354525f, - 0.8916592996916388f, - 0.8917185512694839f, - 0.8917777875679724f, - 0.8918370085860897f, - 0.8918962143228206f, - 0.8919554047771509f, - 0.8920145799480662f, - 0.8920737398345527f, - 0.8921328844355967f, - 0.8921920137501848f, - 0.8922511277773036f, - 0.8923102265159405f, - 0.8923693099650827f, - 0.8924283781237179f, - 0.8924874309908339f, - 0.892546468565419f, - 0.8926054908464613f, - 0.8926644978329498f, - 0.8927234895238733f, - 0.8927824659182209f, - 0.8928414270149821f, - 0.8929003728131468f, - 0.8929593033117048f, - 0.8930182185096464f, - 0.8930771184059619f, - 0.8931360029996425f, - 0.8931948722896789f, - 0.8932537262750625f, - 0.8933125649547847f, - 0.8933713883278376f, - 0.893430196393213f, - 0.8934889891499034f, - 0.8935477665969013f, - 0.8936065287331997f, - 0.8936652755577916f, - 0.8937240070696704f, - 0.8937827232678297f, - 0.8938414241512637f, - 0.8939001097189663f, - 0.8939587799699321f, - 0.8940174349031557f, - 0.894076074517632f, - 0.8941346988123563f, - 0.8941933077863242f, - 0.8942519014385313f, - 0.8943104797679736f, - 0.8943690427736475f, - 0.8944275904545494f, - 0.8944861228096763f, - 0.894544639838025f, - 0.8946031415385931f, - 0.8946616279103781f, - 0.8947200989523777f, - 0.8947785546635901f, - 0.8948369950430137f, - 0.8948954200896473f, - 0.8949538298024895f, - 0.8950122241805395f, - 0.895070603222797f, - 0.8951289669282615f, - 0.8951873152959329f, - 0.8952456483248116f, - 0.895303966013898f, - 0.8953622683621928f, - 0.895420555368697f, - 0.8954788270324119f, - 0.895537083352339f, - 0.8955953243274801f, - 0.8956535499568372f, - 0.8957117602394129f, - 0.8957699551742094f, - 0.8958281347602298f, - 0.8958862989964771f, - 0.8959444478819547f, - 0.8960025814156662f, - 0.8960606995966157f, - 0.8961188024238071f, - 0.8961768898962448f, - 0.8962349620129337f, - 0.8962930187728786f, - 0.8963510601750848f, - 0.8964090862185577f, - 0.8964670969023032f, - 0.8965250922253272f, - 0.8965830721866358f, - 0.8966410367852358f, - 0.8966989860201339f, - 0.8967569198903371f, - 0.8968148383948527f, - 0.8968727415326884f, - 0.8969306293028518f, - 0.8969885017043513f, - 0.8970463587361952f, - 0.897104200397392f, - 0.8971620266869508f, - 0.8972198376038805f, - 0.8972776331471908f, - 0.8973354133158912f, - 0.8973931781089917f, - 0.8974509275255026f, - 0.8975086615644342f, - 0.8975663802247975f, - 0.8976240835056033f, - 0.8976817714058629f, - 0.8977394439245879f, - 0.8977971010607901f, - 0.8978547428134815f, - 0.8979123691816745f, - 0.8979699801643816f, - 0.8980275757606155f, - 0.8980851559693898f, - 0.8981427207897174f, - 0.8982002702206122f, - 0.898257804261088f, - 0.898315322910159f, - 0.8983728261668397f, - 0.8984303140301446f, - 0.8984877864990889f, - 0.8985452435726876f, - 0.8986026852499563f, - 0.8986601115299109f, - 0.8987175224115672f, - 0.8987749178939415f, - 0.8988322979760505f, - 0.8988896626569108f, - 0.8989470119355396f, - 0.8990043458109542f, - 0.8990616642821723f, - 0.8991189673482116f, - 0.8991762550080903f, - 0.8992335272608268f, - 0.8992907841054398f, - 0.8993480255409481f, - 0.899405251566371f, - 0.8994624621807279f, - 0.8995196573830384f, - 0.8995768371723228f, - 0.899634001547601f, - 0.8996911505078936f, - 0.8997482840522215f, - 0.8998054021796056f, - 0.8998625048890672f, - 0.8999195921796278f, - 0.8999766640503094f, - 0.900033720500134f, - 0.9000907615281238f, - 0.9001477871333017f, - 0.9002047973146905f, - 0.9002617920713133f, - 0.9003187714021935f, - 0.9003757353063547f, - 0.900432683782821f, - 0.9004896168306166f, - 0.9005465344487658f, - 0.9006034366362934f, - 0.9006603233922243f, - 0.9007171947155841f, - 0.9007740506053981f, - 0.900830891060692f, - 0.900887716080492f, - 0.9009445256638244f, - 0.9010013198097157f, - 0.9010580985171928f, - 0.9011148617852828f, - 0.9011716096130131f, - 0.9012283419994113f, - 0.9012850589435053f, - 0.9013417604443235f, - 0.901398446500894f, - 0.9014551171122456f, - 0.9015117722774074f, - 0.9015684119954085f, - 0.9016250362652786f, - 0.9016816450860471f, - 0.9017382384567442f, - 0.9017948163764002f, - 0.9018513788440458f, - 0.9019079258587115f, - 0.9019644574194285f, - 0.9020209735252284f, - 0.9020774741751425f, - 0.9021339593682028f, - 0.9021904291034415f, - 0.9022468833798908f, - 0.9023033221965837f, - 0.9023597455525527f, - 0.9024161534468313f, - 0.902472545878453f, - 0.9025289228464514f, - 0.9025852843498605f, - 0.9026416303877147f, - 0.9026979609590483f, - 0.9027542760628964f, - 0.9028105756982937f, - 0.9028668598642757f, - 0.902923128559878f, - 0.9029793817841365f, - 0.9030356195360872f, - 0.9030918418147665f, - 0.903148048619211f, - 0.9032042399484579f, - 0.9032604158015439f, - 0.9033165761775068f, - 0.9033727210753842f, - 0.9034288504942142f, - 0.9034849644330348f, - 0.9035410628908846f, - 0.9035971458668025f, - 0.9036532133598274f, - 0.9037092653689985f, - 0.9037653018933556f, - 0.9038213229319384f, - 0.903877328483787f, - 0.9039333185479418f, - 0.9039892931234433f, - 0.9040452522093325f, - 0.9041011958046506f, - 0.9041571239084389f, - 0.9042130365197393f, - 0.9042689336375934f, - 0.9043248152610438f, - 0.9043806813891327f, - 0.904436532020903f, - 0.9044923671553977f, - 0.9045481867916599f, - 0.9046039909287334f, - 0.9046597795656619f, - 0.9047155527014895f, - 0.9047713103352605f, - 0.9048270524660196f, - 0.9048827790928115f, - 0.9049384902146814f, - 0.9049941858306748f, - 0.9050498659398374f, - 0.905105530541215f, - 0.9051611796338539f, - 0.9052168132168005f, - 0.9052724312891015f, - 0.905328033849804f, - 0.9053836208979552f, - 0.9054391924326027f, - 0.9054947484527942f, - 0.9055502889575779f, - 0.905605813946002f, - 0.9056613234171151f, - 0.9057168173699662f, - 0.9057722958036043f, - 0.9058277587170788f, - 0.9058832061094394f, - 0.905938637979736f, - 0.9059940543270186f, - 0.906049455150338f, - 0.9061048404487447f, - 0.9061602102212899f, - 0.9062155644670244f, - 0.9062709031850003f, - 0.9063262263742691f, - 0.9063815340338829f, - 0.9064368261628938f, - 0.9064921027603547f, - 0.9065473638253183f, - 0.9066026093568377f, - 0.9066578393539664f, - 0.9067130538157578f, - 0.9067682527412662f, - 0.9068234361295453f, - 0.90687860397965f, - 0.9069337562906348f, - 0.9069888930615547f, - 0.907044014291465f, - 0.907099119979421f, - 0.9071542101244788f, - 0.9072092847256943f, - 0.9072643437821237f, - 0.9073193872928236f, - 0.907374415256851f, - 0.907429427673263f, - 0.9074844245411169f, - 0.9075394058594702f, - 0.9075943716273812f, - 0.9076493218439077f, - 0.9077042565081084f, - 0.9077591756190417f, - 0.907814079175767f, - 0.9078689671773431f, - 0.9079238396228299f, - 0.9079786965112868f, - 0.9080335378417741f, - 0.9080883636133521f, - 0.9081431738250813f, - 0.9081979684760225f, - 0.908252747565237f, - 0.9083075110917859f, - 0.9083622590547311f, - 0.9084169914531343f, - 0.9084717082860578f, - 0.908526409552564f, - 0.9085810952517157f, - 0.9086357653825757f, - 0.9086904199442074f, - 0.9087450589356743f, - 0.90879968235604f, - 0.9088542902043688f, - 0.9089088824797248f, - 0.9089634591811726f, - 0.9090180203077772f, - 0.9090725658586036f, - 0.9091270958327171f, - 0.9091816102291834f, - 0.9092361090470685f, - 0.9092905922854385f, - 0.9093450599433599f, - 0.9093995120198993f, - 0.9094539485141238f, - 0.9095083694251005f, - 0.9095627747518971f, - 0.9096171644935812f, - 0.909671538649221f, - 0.9097258972178848f, - 0.909780240198641f, - 0.9098345675905586f, - 0.9098888793927067f, - 0.9099431756041547f, - 0.9099974562239722f, - 0.9100517212512291f, - 0.9101059706849957f, - 0.9101602045243422f, - 0.9102144227683396f, - 0.9102686254160588f, - 0.9103228124665711f, - 0.9103769839189478f, - 0.9104311397722609f, - 0.9104852800255823f, - 0.9105394046779844f, - 0.9105935137285399f, - 0.9106476071763215f, - 0.9107016850204024f, - 0.9107557472598559f, - 0.9108097938937557f, - 0.9108638249211758f, - 0.9109178403411904f, - 0.9109718401528738f, - 0.9110258243553009f, - 0.9110797929475465f, - 0.9111337459286861f, - 0.9111876832977951f, - 0.9112416050539494f, - 0.9112955111962248f, - 0.9113494017236979f, - 0.9114032766354452f, - 0.9114571359305436f, - 0.9115109796080703f, - 0.9115648076671025f, - 0.9116186201067179f, - 0.9116724169259948f, - 0.911726198124011f, - 0.911779963699845f, - 0.9118337136525758f, - 0.9118874479812822f, - 0.9119411666850435f, - 0.9119948697629394f, - 0.9120485572140494f, - 0.9121022290374539f, - 0.912155885232233f, - 0.9122095257974676f, - 0.9122631507322384f, - 0.9123167600356266f, - 0.9123703537067135f, - 0.9124239317445809f, - 0.9124774941483107f, - 0.9125310409169852f, - 0.9125845720496868f, - 0.9126380875454984f, - 0.9126915874035028f, - 0.9127450716227835f, - 0.9127985402024239f, - 0.912851993141508f, - 0.9129054304391199f, - 0.9129588520943438f, - 0.9130122581062644f, - 0.9130656484739665f, - 0.9131190231965356f, - 0.9131723822730567f, - 0.9132257257026158f, - 0.9132790534842989f, - 0.9133323656171922f, - 0.9133856621003821f, - 0.9134389429329554f, - 0.9134922081139992f, - 0.9135454576426009f, - 0.9135986915178479f, - 0.9136519097388281f, - 0.9137051123046298f, - 0.9137582992143412f, - 0.9138114704670509f, - 0.9138646260618479f, - 0.9139177659978216f, - 0.9139708902740612f, - 0.9140239988896565f, - 0.9140770918436976f, - 0.9141301691352746f, - 0.9141832307634781f, - 0.9142362767273989f, - 0.9142893070261281f, - 0.9143423216587571f, - 0.9143953206243773f, - 0.9144483039220809f, - 0.9145012715509597f, - 0.9145542235101064f, - 0.9146071597986135f, - 0.914660080415574f, - 0.9147129853600812f, - 0.9147658746312284f, - 0.9148187482281096f, - 0.9148716061498187f, - 0.91492444839545f, - 0.9149772749640979f, - 0.9150300858548575f, - 0.9150828810668237f, - 0.915135660599092f, - 0.915188424450758f, - 0.9152411726209175f, - 0.9152939051086669f, - 0.9153466219131025f, - 0.9153993230333209f, - 0.9154520084684193f, - 0.9155046782174949f, - 0.9155573322796452f, - 0.9156099706539679f, - 0.915662593339561f, - 0.9157152003355231f, - 0.9157677916409526f, - 0.9158203672549483f, - 0.9158729271766095f, - 0.9159254714050356f, - 0.915977999939326f, - 0.9160305127785809f, - 0.9160830099219006f, - 0.9161354913683853f, - 0.916187957117136f, - 0.9162404071672534f, - 0.916292841517839f, - 0.9163452601679942f, - 0.9163976631168211f, - 0.9164500503634215f, - 0.916502421906898f, - 0.916554777746353f, - 0.9166071178808896f, - 0.9166594423096107f, - 0.9167117510316201f, - 0.9167640440460211f, - 0.916816321351918f, - 0.9168685829484149f, - 0.9169208288346163f, - 0.9169730590096271f, - 0.9170252734725522f, - 0.917077472222497f, - 0.9171296552585672f, - 0.9171818225798684f, - 0.9172339741855068f, - 0.9172861100745889f, - 0.9173382302462213f, - 0.9173903346995111f, - 0.9174424234335653f, - 0.9174944964474914f, - 0.9175465537403971f, - 0.9175985953113905f, - 0.91765062115958f, - 0.9177026312840739f, - 0.9177546256839811f, - 0.9178066043584109f, - 0.9178585673064723f, - 0.9179105145272752f, - 0.9179624460199294f, - 0.9180143617835451f, - 0.9180662618172328f, - 0.9181181461201031f, - 0.918170014691267f, - 0.9182218675298357f, - 0.9182737046349209f, - 0.9183255260056341f, - 0.9183773316410876f, - 0.9184291215403936f, - 0.9184808957026647f, - 0.9185326541270138f, - 0.918584396812554f, - 0.9186361237583988f, - 0.9186878349636618f, - 0.9187395304274569f, - 0.9187912101488983f, - 0.9188428741271006f, - 0.9188945223611784f, - 0.9189461548502469f, - 0.9189977715934213f, - 0.9190493725898171f, - 0.9191009578385503f, - 0.9191525273387368f, - 0.9192040810894931f, - 0.9192556190899358f, - 0.9193071413391819f, - 0.9193586478363485f, - 0.9194101385805529f, - 0.919461613570913f, - 0.9195130728065468f, - 0.9195645162865724f, - 0.9196159440101086f, - 0.9196673559762739f, - 0.9197187521841876f, - 0.919770132632969f, - 0.9198214973217376f, - 0.9198728462496134f, - 0.9199241794157164f, - 0.9199754968191671f, - 0.9200267984590863f, - 0.9200780843345948f, - 0.920129354444814f, - 0.9201806087888652f, - 0.9202318473658703f, - 0.9202830701749513f, - 0.9203342772152305f, - 0.9203854684858305f, - 0.9204366439858741f, - 0.9204878037144846f, - 0.9205389476707853f, - 0.9205900758538996f, - 0.9206411882629518f, - 0.920692284897066f, - 0.9207433657553665f, - 0.9207944308369783f, - 0.9208454801410263f, - 0.9208965136666357f, - 0.9209475314129321f, - 0.9209985333790414f, - 0.9210495195640896f, - 0.9211004899672032f, - 0.9211514445875087f, - 0.9212023834241331f, - 0.9212533064762035f, - 0.9213042137428473f, - 0.9213551052231924f, - 0.9214059809163667f, - 0.9214568408214984f, - 0.9215076849377161f, - 0.9215585132641485f, - 0.9216093257999248f, - 0.9216601225441744f, - 0.9217109034960267f, - 0.9217616686546117f, - 0.9218124180190594f, - 0.9218631515885005f, - 0.9219138693620655f, - 0.9219645713388854f, - 0.9220152575180915f, - 0.9220659278988153f, - 0.9221165824801885f, - 0.9221672212613431f, - 0.9222178442414115f, - 0.9222684514195263f, - 0.9223190427948204f, - 0.9223696183664268f, - 0.922420178133479f, - 0.9224707220951107f, - 0.9225212502504557f, - 0.9225717625986485f, - 0.9226222591388232f, - 0.9226727398701148f, - 0.9227232047916583f, - 0.9227736539025889f, - 0.9228240872020423f, - 0.9228745046891543f, - 0.9229249063630609f, - 0.9229752922228988f, - 0.9230256622678042f, - 0.9230760164969143f, - 0.9231263549093662f, - 0.9231766775042974f, - 0.9232269842808457f, - 0.923277275238149f, - 0.9233275503753456f, - 0.923377809691574f, - 0.9234280531859732f, - 0.9234782808576822f, - 0.9235284927058404f, - 0.9235786887295874f, - 0.923628868928063f, - 0.9236790333004073f, - 0.9237291818457611f, - 0.9237793145632649f, - 0.9238294314520596f, - 0.9238795325112867f, - 0.9239296177400876f, - 0.9239796871376041f, - 0.9240297407029783f, - 0.9240797784353525f, - 0.9241298003338693f, - 0.9241798063976717f, - 0.9242297966259029f, - 0.9242797710177061f, - 0.924329729572225f, - 0.924379672288604f, - 0.9244295991659868f, - 0.9244795102035182f, - 0.924529405400343f, - 0.9245792847556061f, - 0.9246291482684531f, - 0.9246789959380294f, - 0.9247288277634809f, - 0.9247786437439538f, - 0.9248284438785945f, - 0.9248782281665496f, - 0.9249279966069661f, - 0.9249777491989913f, - 0.9250274859417728f, - 0.925077206834458f, - 0.9251269118761953f, - 0.9251766010661329f, - 0.9252262744034193f, - 0.9252759318872036f, - 0.9253255735166347f, - 0.9253751992908621f, - 0.9254248092090354f, - 0.9254744032703046f, - 0.92552398147382f, - 0.925573543818732f, - 0.9256230903041914f, - 0.9256726209293492f, - 0.9257221356933567f, - 0.9257716345953655f, - 0.9258211176345275f, - 0.9258705848099947f, - 0.9259200361209196f, - 0.9259694715664548f, - 0.9260188911457534f, - 0.9260682948579684f, - 0.9261176827022533f, - 0.926167054677762f, - 0.9262164107836482f, - 0.9262657510190666f, - 0.9263150753831717f, - 0.9263643838751181f, - 0.926413676494061f, - 0.926462953239156f, - 0.9265122141095584f, - 0.9265614591044244f, - 0.9266106882229103f, - 0.9266599014641722f, - 0.9267090988273671f, - 0.9267582803116519f, - 0.9268074459161839f, - 0.9268565956401208f, - 0.9269057294826203f, - 0.9269548474428405f, - 0.9270039495199399f, - 0.927053035713077f, - 0.9271021060214109f, - 0.9271511604441005f, - 0.9272001989803056f, - 0.9272492216291858f, - 0.927298228389901f, - 0.9273472192616116f, - 0.9273961942434781f, - 0.9274451533346614f, - 0.9274940965343225f, - 0.9275430238416228f, - 0.927591935255724f, - 0.9276408307757881f, - 0.9276897104009771f, - 0.9277385741304536f, - 0.9277874219633802f, - 0.92783625389892f, - 0.9278850699362362f, - 0.9279338700744925f, - 0.9279826543128525f, - 0.9280314226504806f, - 0.9280801750865408f, - 0.9281289116201981f, - 0.9281776322506171f, - 0.9282263369769632f, - 0.9282750257984018f, - 0.9283236987140986f, - 0.9283723557232197f, - 0.9284209968249313f, - 0.9284696220183998f, - 0.9285182313027922f, - 0.9285668246772757f, - 0.9286154021410173f, - 0.928663963693185f, - 0.9287125093329466f, - 0.92876103905947f, - 0.9288095528719241f, - 0.9288580507694775f, - 0.9289065327512991f, - 0.9289549988165583f, - 0.9290034489644244f, - 0.9290518831940675f, - 0.9291003015046575f, - 0.9291487038953649f, - 0.9291970903653602f, - 0.9292454609138144f, - 0.9292938155398988f, - 0.9293421542427845f, - 0.9293904770216437f, - 0.929438783875648f, - 0.92948707480397f, - 0.929535349805782f, - 0.9295836088802568f, - 0.9296318520265677f, - 0.929680079243888f, - 0.9297282905313912f, - 0.9297764858882513f, - 0.9298246653136426f, - 0.9298728288067395f, - 0.9299209763667167f, - 0.929969107992749f, - 0.9300172236840121f, - 0.9300653234396812f, - 0.9301134072589323f, - 0.9301614751409415f, - 0.930209527084885f, - 0.9302575630899397f, - 0.9303055831552822f, - 0.93035358728009f, - 0.9304015754635404f, - 0.9304495477048111f, - 0.9304975040030803f, - 0.9305454443575261f, - 0.930593368767327f, - 0.930641277231662f, - 0.9306891697497102f, - 0.9307370463206508f, - 0.9307849069436637f, - 0.9308327516179286f, - 0.9308805803426258f, - 0.9309283931169356f, - 0.9309761899400391f, - 0.931023970811117f, - 0.9310717357293506f, - 0.9311194846939218f, - 0.931167217704012f, - 0.9312149347588035f, - 0.9312626358574787f, - 0.9313103209992203f, - 0.9313579901832111f, - 0.9314056434086343f, - 0.9314532806746735f, - 0.9315009019805123f, - 0.9315485073253348f, - 0.9315960967083253f, - 0.9316436701286684f, - 0.9316912275855489f, - 0.931738769078152f, - 0.9317862946056629f, - 0.9318338041672674f, - 0.9318812977621515f, - 0.9319287753895011f, - 0.9319762370485031f, - 0.932023682738344f, - 0.932071112458211f, - 0.9321185262072912f, - 0.9321659239847722f, - 0.932213305789842f, - 0.9322606716216887f, - 0.9323080214795005f, - 0.9323553553624664f, - 0.9324026732697751f, - 0.932449975200616f, - 0.9324972611541784f, - 0.9325445311296522f, - 0.9325917851262273f, - 0.9326390231430941f, - 0.9326862451794433f, - 0.9327334512344656f, - 0.9327806413073523f, - 0.9328278153972945f, - 0.9328749735034843f, - 0.9329221156251134f, - 0.932969241761374f, - 0.9330163519114588f, - 0.9330634460745605f, - 0.9331105242498721f, - 0.9331575864365869f, - 0.9332046326338985f, - 0.933251662841001f, - 0.9332986770570884f, - 0.9333456752813549f, - 0.9333926575129956f, - 0.9334396237512051f, - 0.933486573995179f, - 0.9335335082441126f, - 0.9335804264972017f, - 0.9336273287536425f, - 0.9336742150126313f, - 0.9337210852733645f, - 0.9337679395350391f, - 0.9338147777968525f, - 0.9338616000580019f, - 0.9339084063176851f, - 0.9339551965751f, - 0.9340019708294449f, - 0.9340487290799184f, - 0.9340954713257194f, - 0.9341421975660468f, - 0.9341889078001f, - 0.9342356020270786f, - 0.9342822802461825f, - 0.934328942456612f, - 0.9343755886575675f, - 0.9344222188482497f, - 0.9344688330278597f, - 0.9345154311955987f, - 0.9345620133506681f, - 0.93460857949227f, - 0.9346551296196064f, - 0.9347016637318797f, - 0.9347481818282924f, - 0.9347946839080477f, - 0.9348411699703485f, - 0.9348876400143983f, - 0.9349340940394011f, - 0.9349805320445608f, - 0.9350269540290816f, - 0.9350733599921682f, - 0.9351197499330254f, - 0.9351661238508583f, - 0.9352124817448724f, - 0.9352588236142733f, - 0.9353051494582668f, - 0.9353514592760592f, - 0.9353977530668571f, - 0.9354440308298673f, - 0.9354902925642967f, - 0.9355365382693527f, - 0.9355827679442428f, - 0.935628981588175f, - 0.9356751792003573f, - 0.9357213607799982f, - 0.9357675263263063f, - 0.9358136758384908f, - 0.9358598093157607f, - 0.9359059267573256f, - 0.9359520281623954f, - 0.9359981135301799f, - 0.9360441828598897f, - 0.9360902361507353f, - 0.9361362734019276f, - 0.9361822946126777f, - 0.9362282997821971f, - 0.9362742889096975f, - 0.9363202619943911f, - 0.9363662190354898f, - 0.9364121600322064f, - 0.9364580849837536f, - 0.9365039938893445f, - 0.9365498867481924f, - 0.936595763559511f, - 0.9366416243225143f, - 0.9366874690364163f, - 0.9367332977004317f, - 0.936779110313775f, - 0.9368249068756614f, - 0.9368706873853062f, - 0.9369164518419247f, - 0.9369622002447331f, - 0.9370079325929472f, - 0.9370536488857836f, - 0.9370993491224588f, - 0.9371450333021899f, - 0.9371907014241939f, - 0.9372363534876885f, - 0.9372819894918915f, - 0.9373276094360207f, - 0.9373732133192946f, - 0.9374188011409317f, - 0.9374643729001508f, - 0.9375099285961714f, - 0.9375554682282125f, - 0.9376009917954939f, - 0.9376464992972356f, - 0.937691990732658f, - 0.9377374661009813f, - 0.9377829254014265f, - 0.9378283686332147f, - 0.9378737957955671f, - 0.9379192068877054f, - 0.9379646019088514f, - 0.9380099808582274f, - 0.938055343735056f, - 0.9381006905385595f, - 0.9381460212679611f, - 0.9381913359224842f, - 0.9382366345013521f, - 0.9382819170037887f, - 0.9383271834290182f, - 0.938372433776265f, - 0.9384176680447536f, - 0.938462886233709f, - 0.9385080883423563f, - 0.9385532743699211f, - 0.9385984443156292f, - 0.9386435981787065f, - 0.9386887359583792f, - 0.9387338576538741f, - 0.9387789632644179f, - 0.9388240527892379f, - 0.9388691262275612f, - 0.9389141835786158f, - 0.9389592248416295f, - 0.9390042500158305f, - 0.9390492591004475f, - 0.9390942520947091f, - 0.9391392289978444f, - 0.9391841898090827f, - 0.9392291345276536f, - 0.939274063152787f, - 0.9393189756837131f, - 0.9393638721196624f, - 0.9394087524598655f, - 0.9394536167035534f, - 0.9394984648499574f, - 0.9395432968983091f, - 0.93958811284784f, - 0.9396329126977826f, - 0.9396776964473692f, - 0.9397224640958322f, - 0.9397672156424046f, - 0.9398119510863197f, - 0.9398566704268109f, - 0.9399013736631119f, - 0.9399460607944569f, - 0.9399907318200801f, - 0.9400353867392159f, - 0.9400800255510995f, - 0.9401246482549658f, - 0.9401692548500502f, - 0.9402138453355885f, - 0.9402584197108165f, - 0.9403029779749704f, - 0.940347520127287f, - 0.9403920461670027f, - 0.9404365560933549f, - 0.9404810499055807f, - 0.9405255276029177f, - 0.940569989184604f, - 0.9406144346498777f, - 0.940658863997977f, - 0.940703277228141f, - 0.9407476743396084f, - 0.9407920553316185f, - 0.9408364202034109f, - 0.9408807689542255f, - 0.9409251015833022f, - 0.9409694180898815f, - 0.9410137184732041f, - 0.9410580027325108f, - 0.941102270867043f, - 0.941146522876042f, - 0.9411907587587495f, - 0.9412349785144076f, - 0.9412791821422588f, - 0.9413233696415454f, - 0.9413675410115103f, - 0.9414116962513969f, - 0.9414558353604482f, - 0.9414999583379082f, - 0.9415440651830208f, - 0.9415881558950302f, - 0.9416322304731809f, - 0.9416762889167177f, - 0.9417203312248857f, - 0.9417643573969303f, - 0.9418083674320971f, - 0.9418523613296318f, - 0.9418963390887809f, - 0.9419403007087906f, - 0.9419842461889077f, - 0.9420281755283794f, - 0.9420720887264526f, - 0.9421159857823752f, - 0.9421598666953949f, - 0.9422037314647598f, - 0.9422475800897183f, - 0.9422914125695191f, - 0.942335228903411f, - 0.9423790290906435f, - 0.9424228131304659f, - 0.942466581022128f, - 0.9425103327648798f, - 0.9425540683579717f, - 0.9425977878006543f, - 0.9426414910921784f, - 0.9426851782317952f, - 0.9427288492187562f, - 0.942772504052313f, - 0.9428161427317178f, - 0.9428597652562225f, - 0.9429033716250801f, - 0.942946961837543f, - 0.9429905358928644f, - 0.9430340937902979f, - 0.9430776355290968f, - 0.9431211611085153f, - 0.9431646705278075f, - 0.9432081637862278f, - 0.9432516408830312f, - 0.9432951018174723f, - 0.9433385465888069f, - 0.9433819751962903f, - 0.9434253876391784f, - 0.9434687839167274f, - 0.9435121640281936f, - 0.9435555279728338f, - 0.943598875749905f, - 0.9436422073586643f, - 0.9436855227983694f, - 0.9437288220682778f, - 0.943772105167648f, - 0.9438153720957381f, - 0.9438586228518068f, - 0.9439018574351129f, - 0.9439450758449158f, - 0.9439882780804748f, - 0.9440314641410498f, - 0.9440746340259005f, - 0.9441177877342875f, - 0.9441609252654712f, - 0.9442040466187126f, - 0.9442471517932728f, - 0.9442902407884131f, - 0.9443333136033951f, - 0.944376370237481f, - 0.944419410689933f, - 0.9444624349600135f, - 0.9445054430469854f, - 0.9445484349501115f, - 0.9445914106686555f, - 0.9446343702018808f, - 0.9446773135490514f, - 0.9447202407094314f, - 0.9447631516822854f, - 0.9448060464668779f, - 0.9448489250624742f, - 0.9448917874683394f, - 0.944934633683739f, - 0.9449774637079391f, - 0.9450202775402056f, - 0.9450630751798048f, - 0.9451058566260037f, - 0.945148621878069f, - 0.945191370935268f, - 0.9452341037968682f, - 0.9452768204621375f, - 0.9453195209303438f, - 0.9453622052007554f, - 0.9454048732726411f, - 0.9454475251452698f, - 0.9454901608179104f, - 0.9455327802898326f, - 0.9455753835603061f, - 0.9456179706286009f, - 0.945660541493987f, - 0.9457030961557354f, - 0.9457456346131168f, - 0.9457881568654022f, - 0.945830662911863f, - 0.9458731527517709f, - 0.9459156263843979f, - 0.9459580838090162f, - 0.9460005250248984f, - 0.946042950031317f, - 0.9460853588275453f, - 0.9461277514128567f, - 0.9461701277865244f, - 0.9462124879478228f, - 0.9462548318960258f, - 0.9462971596304078f, - 0.9463394711502437f, - 0.9463817664548085f, - 0.9464240455433773f, - 0.9464663084152258f, - 0.9465085550696299f, - 0.9465507855058656f, - 0.9465929997232092f, - 0.9466351977209375f, - 0.9466773794983274f, - 0.9467195450546563f, - 0.9467616943892014f, - 0.9468038275012408f, - 0.9468459443900523f, - 0.9468880450549144f, - 0.9469301294951056f, - 0.9469721977099049f, - 0.9470142496985914f, - 0.9470562854604447f, - 0.9470983049947443f, - 0.9471403083007703f, - 0.9471822953778031f, - 0.947224266225123f, - 0.9472662208420111f, - 0.9473081592277484f, - 0.9473500813816162f, - 0.9473919873028965f, - 0.947433876990871f, - 0.9474757504448218f, - 0.9475176076640317f, - 0.9475594486477835f, - 0.94760127339536f, - 0.9476430819060447f, - 0.9476848741791213f, - 0.9477266502138736f, - 0.9477684100095857f, - 0.9478101535655421f, - 0.9478518808810277f, - 0.9478935919553273f, - 0.9479352867877264f, - 0.9479769653775104f, - 0.9480186277239652f, - 0.9480602738263769f, - 0.948101903684032f, - 0.9481435172962172f, - 0.9481851146622192f, - 0.9482266957813255f, - 0.9482682606528235f, - 0.9483098092760011f, - 0.9483513416501462f, - 0.9483928577745474f, - 0.9484343576484932f, - 0.9484758412712724f, - 0.9485173086421743f, - 0.9485587597604885f, - 0.9486001946255046f, - 0.9486416132365126f, - 0.9486830155928029f, - 0.9487244016936659f, - 0.9487657715383927f, - 0.9488071251262743f, - 0.948848462456602f, - 0.9488897835286678f, - 0.9489310883417635f, - 0.9489723768951813f, - 0.9490136491882138f, - 0.949054905220154f, - 0.9490961449902946f, - 0.9491373684979292f, - 0.9491785757423513f, - 0.9492197667228551f, - 0.9492609414387346f, - 0.9493020998892844f, - 0.949343242073799f, - 0.9493843679915738f, - 0.9494254776419038f, - 0.9494665710240848f, - 0.9495076481374126f, - 0.9495487089811835f, - 0.9495897535546937f, - 0.9496307818572399f, - 0.9496717938881194f, - 0.9497127896466291f, - 0.9497537691320669f, - 0.9497947323437304f, - 0.9498356792809176f, - 0.9498766099429272f, - 0.9499175243290576f, - 0.949958422438608f, - 0.9499993042708774f, - 0.9500401698251654f, - 0.9500810191007717f, - 0.9501218520969964f, - 0.9501626688131399f, - 0.9502034692485029f, - 0.9502442534023859f, - 0.9502850212740905f, - 0.950325772862918f, - 0.95036650816817f, - 0.9504072271891487f, - 0.9504479299251564f, - 0.9504886163754955f, - 0.950529286539469f, - 0.95056994041638f, - 0.9506105780055318f, - 0.9506511993062282f, - 0.9506918043177731f, - 0.9507323930394708f, - 0.9507729654706257f, - 0.9508135216105429f, - 0.9508540614585271f, - 0.9508945850138839f, - 0.9509350922759189f, - 0.950975583243938f, - 0.9510160579172474f, - 0.9510565162951535f, - 0.9510969583769633f, - 0.9511373841619836f, - 0.9511777936495217f, - 0.9512181868388853f, - 0.9512585637293822f, - 0.9512989243203207f, - 0.9513392686110091f, - 0.9513795966007562f, - 0.9514199082888709f, - 0.9514602036746626f, - 0.9515004827574406f, - 0.951540745536515f, - 0.9515809920111957f, - 0.9516212221807933f, - 0.9516614360446183f, - 0.9517016336019816f, - 0.9517418148521947f, - 0.9517819797945687f, - 0.9518221284284157f, - 0.9518622607530478f, - 0.9519023767677771f, - 0.9519424764719163f, - 0.9519825598647785f, - 0.9520226269456766f, - 0.9520626777139243f, - 0.9521027121688351f, - 0.9521427303097232f, - 0.9521827321359029f, - 0.9522227176466886f, - 0.9522626868413954f, - 0.9523026397193383f, - 0.9523425762798328f, - 0.9523824965221944f, - 0.9524224004457393f, - 0.9524622880497836f, - 0.9525021593336441f, - 0.9525420142966373f, - 0.9525818529380805f, - 0.9526216752572909f, - 0.9526614812535863f, - 0.9527012709262845f, - 0.9527410442747039f, - 0.9527808012981629f, - 0.9528205419959802f, - 0.952860266367475f, - 0.9528999744119666f, - 0.9529396661287746f, - 0.9529793415172189f, - 0.9530190005766195f, - 0.953058643306297f, - 0.9530982697055722f, - 0.953137879773766f, - 0.9531774735101997f, - 0.953217050914195f, - 0.9532566119850735f, - 0.9532961567221576f, - 0.9533356851247696f, - 0.9533751971922322f, - 0.9534146929238683f, - 0.9534541723190013f, - 0.9534936353769545f, - 0.9535330820970519f, - 0.9535725124786176f, - 0.9536119265209759f, - 0.9536513242234514f, - 0.9536907055853693f, - 0.9537300706060544f, - 0.9537694192848325f, - 0.9538087516210293f, - 0.9538480676139708f, - 0.9538873672629833f, - 0.9539266505673936f, - 0.9539659175265284f, - 0.9540051681397148f, - 0.9540444024062804f, - 0.954083620325553f, - 0.9541228218968605f, - 0.9541620071195313f, - 0.9542011759928938f, - 0.9542403285162768f, - 0.9542794646890098f, - 0.9543185845104218f, - 0.9543576879798428f, - 0.9543967750966026f, - 0.9544358458600315f, - 0.95447490026946f, - 0.954513938324219f, - 0.9545529600236395f, - 0.954591965367053f, - 0.954630954353791f, - 0.9546699269831855f, - 0.9547088832545687f, - 0.9547478231672731f, - 0.9547867467206316f, - 0.9548256539139771f, - 0.954864544746643f, - 0.9549034192179628f, - 0.9549422773272706f, - 0.9549811190739003f, - 0.9550199444571866f, - 0.9550587534764642f, - 0.955097546131068f, - 0.9551363224203335f, - 0.955175082343596f, - 0.9552138259001917f, - 0.9552525530894564f, - 0.9552912639107268f, - 0.9553299583633393f, - 0.9553686364466313f, - 0.9554072981599396f, - 0.955445943502602f, - 0.9554845724739565f, - 0.9555231850733408f, - 0.9555617813000934f, - 0.9556003611535531f, - 0.9556389246330588f, - 0.9556774717379497f, - 0.9557160024675653f, - 0.9557545168212455f, - 0.9557930147983301f, - 0.9558314963981597f, - 0.9558699616200749f, - 0.9559084104634163f, - 0.9559468429275256f, - 0.9559852590117439f, - 0.9560236587154131f, - 0.9560620420378751f, - 0.9561004089784724f, - 0.9561387595365474f, - 0.956177093711443f, - 0.9562154115025026f, - 0.9562537129090695f, - 0.9562919979304871f, - 0.9563302665660999f, - 0.9563685188152519f, - 0.9564067546772876f, - 0.956444974151552f, - 0.9564831772373903f, - 0.9565213639341476f, - 0.9565595342411698f, - 0.9565976881578028f, - 0.9566358256833928f, - 0.9566739468172865f, - 0.9567120515588305f, - 0.956750139907372f, - 0.9567882118622583f, - 0.956826267422837f, - 0.9568643065884562f, - 0.956902329358464f, - 0.9569403357322089f, - 0.9569783257090396f, - 0.9570162992883052f, - 0.9570542564693553f, - 0.957092197251539f, - 0.9571301216342066f, - 0.9571680296167082f, - 0.9572059211983942f, - 0.9572437963786153f, - 0.9572816551567226f, - 0.9573194975320672f, - 0.957357323504001f, - 0.9573951330718756f, - 0.9574329262350434f, - 0.9574707029928565f, - 0.9575084633446679f, - 0.9575462072898304f, - 0.9575839348276973f, - 0.9576216459576222f, - 0.957659340678959f, - 0.9576970189910616f, - 0.9577346808932845f, - 0.9577723263849824f, - 0.9578099554655104f, - 0.9578475681342234f, - 0.9578851643904772f, - 0.9579227442336274f, - 0.9579603076630302f, - 0.957997854678042f, - 0.9580353852780193f, - 0.9580728994623191f, - 0.9581103972302987f, - 0.9581478785813154f, - 0.9581853435147271f, - 0.9582227920298917f, - 0.9582602241261677f, - 0.9582976398029137f, - 0.9583350390594885f, - 0.9583724218952513f, - 0.9584097883095615f, - 0.958447138301779f, - 0.9584844718712636f, - 0.9585217890173758f, - 0.9585590897394761f, - 0.9585963740369254f, - 0.9586336419090848f, - 0.9586708933553157f, - 0.9587081283749799f, - 0.9587453469674392f, - 0.9587825491320561f, - 0.958819734868193f, - 0.9588569041752129f, - 0.9588940570524785f, - 0.9589311934993537f, - 0.958968313515202f, - 0.9590054170993874f, - 0.9590425042512739f, - 0.9590795749702262f, - 0.959116629255609f, - 0.9591536671067876f, - 0.9591906885231273f, - 0.9592276935039936f, - 0.9592646820487525f, - 0.9593016541567703f, - 0.9593386098274134f, - 0.9593755490600485f, - 0.9594124718540429f, - 0.9594493782087636f, - 0.9594862681235786f, - 0.9595231415978556f, - 0.9595599986309626f, - 0.9595968392222685f, - 0.9596336633711416f, - 0.9596704710769512f, - 0.9597072623390667f, - 0.9597440371568574f, - 0.9597807955296933f, - 0.9598175374569445f, - 0.9598542629379817f, - 0.9598909719721753f, - 0.9599276645588964f, - 0.9599643406975163f, - 0.9600010003874067f, - 0.9600376436279392f, - 0.960074270418486f, - 0.9601108807584197f, - 0.9601474746471127f, - 0.9601840520839382f, - 0.9602206130682693f, - 0.9602571575994796f, - 0.960293685676943f, - 0.9603301973000336f, - 0.9603666924681256f, - 0.9604031711805938f, - 0.9604396334368132f, - 0.9604760792361589f, - 0.9605125085780064f, - 0.9605489214617315f, - 0.9605853178867105f, - 0.9606216978523195f, - 0.9606580613579353f, - 0.9606944084029347f, - 0.960730738986695f, - 0.9607670531085937f, - 0.9608033507680084f, - 0.9608396319643172f, - 0.9608758966968985f, - 0.9609121449651311f, - 0.9609483767683935f, - 0.9609845921060651f, - 0.9610207909775254f, - 0.961056973382154f, - 0.961093139319331f, - 0.9611292887884368f, - 0.9611654217888519f, - 0.9612015383199571f, - 0.9612376383811337f, - 0.961273721971763f, - 0.9613097890912268f, - 0.961345839738907f, - 0.961381873914186f, - 0.9614178916164463f, - 0.9614538928450708f, - 0.9614898775994426f, - 0.9615258458789451f, - 0.9615617976829619f, - 0.9615977330108771f, - 0.9616336518620751f, - 0.9616695542359401f, - 0.9617054401318572f, - 0.9617413095492113f, - 0.961777162487388f, - 0.9618129989457728f, - 0.9618488189237516f, - 0.9618846224207109f, - 0.961920409436037f, - 0.9619561799691168f, - 0.9619919340193372f, - 0.9620276715860858f, - 0.9620633926687502f, - 0.9620990972667183f, - 0.9621347853793782f, - 0.9621704570061185f, - 0.962206112146328f, - 0.9622417507993957f, - 0.9622773729647109f, - 0.9623129786416633f, - 0.9623485678296428f, - 0.9623841405280397f, - 0.9624196967362442f, - 0.9624552364536473f, - 0.9624907596796398f, - 0.9625262664136134f, - 0.9625617566549592f, - 0.9625972304030695f, - 0.9626326876573363f, - 0.9626681284171521f, - 0.9627035526819095f, - 0.9627389604510016f, - 0.9627743517238219f, - 0.9628097264997636f, - 0.9628450847782207f, - 0.9628804265585875f, - 0.9629157518402583f, - 0.962951060622628f, - 0.9629863529050913f, - 0.9630216286870436f, - 0.9630568879678804f, - 0.9630921307469976f, - 0.9631273570237915f, - 0.9631625667976582f, - 0.9631977600679945f, - 0.9632329368341974f, - 0.9632680970956643f, - 0.9633032408517924f, - 0.9633383681019799f, - 0.9633734788456246f, - 0.963408573082125f, - 0.9634436508108799f, - 0.963478712031288f, - 0.9635137567427488f, - 0.9635487849446616f, - 0.9635837966364262f, - 0.9636187918174428f, - 0.9636537704871119f, - 0.9636887326448338f, - 0.9637236782900097f, - 0.9637586074220407f, - 0.9637935200403284f, - 0.9638284161442745f, - 0.963863295733281f, - 0.9638981588067503f, - 0.9639330053640852f, - 0.9639678354046883f, - 0.9640026489279632f, - 0.964037445933313f, - 0.9640722264201416f, - 0.964106990387853f, - 0.9641417378358517f, - 0.9641764687635421f, - 0.9642111831703293f, - 0.9642458810556184f, - 0.9642805624188147f, - 0.9643152272593241f, - 0.9643498755765526f, - 0.9643845073699066f, - 0.9644191226387925f, - 0.9644537213826173f, - 0.9644883036007882f, - 0.9645228692927125f, - 0.9645574184577981f, - 0.9645919510954528f, - 0.9646264672050852f, - 0.9646609667861036f, - 0.9646954498379169f, - 0.9647299163599343f, - 0.9647643663515653f, - 0.9647987998122195f, - 0.9648332167413067f, - 0.9648676171382377f, - 0.9649020010024225f, - 0.9649363683332723f, - 0.9649707191301982f, - 0.9650050533926114f, - 0.9650393711199239f, - 0.9650736723115474f, - 0.9651079569668942f, - 0.965142225085377f, - 0.9651764766664084f, - 0.9652107117094015f, - 0.96524493021377f, - 0.9652791321789275f, - 0.9653133176042876f, - 0.9653474864892649f, - 0.9653816388332739f, - 0.9654157746357293f, - 0.9654498938960462f, - 0.9654839966136399f, - 0.9655180827879262f, - 0.965552152418321f, - 0.9655862055042406f, - 0.9656202420451013f, - 0.9656542620403201f, - 0.9656882654893141f, - 0.9657222523915004f, - 0.9657562227462969f, - 0.9657901765531214f, - 0.9658241138113921f, - 0.9658580345205277f, - 0.9658919386799467f, - 0.9659258262890683f, - 0.9659596973473118f, - 0.9659935518540969f, - 0.9660273898088434f, - 0.9660612112109715f, - 0.9660950160599019f, - 0.9661288043550551f, - 0.9661625760958522f, - 0.9661963312817147f, - 0.9662300699120641f, - 0.9662637919863222f, - 0.9662974975039113f, - 0.9663311864642539f, - 0.9663648588667726f, - 0.9663985147108904f, - 0.966432153996031f, - 0.9664657767216176f, - 0.9664993828870742f, - 0.966532972491825f, - 0.9665665455352944f, - 0.9666001020169073f, - 0.9666336419360885f, - 0.9666671652922634f, - 0.9667006720848577f, - 0.966734162313297f, - 0.9667676359770075f, - 0.966801093075416f, - 0.9668345336079488f, - 0.9668679575740331f, - 0.9669013649730962f, - 0.9669347558045656f, - 0.9669681300678692f, - 0.967001487762435f, - 0.9670348288876918f, - 0.9670681534430678f, - 0.9671014614279925f, - 0.9671347528418948f, - 0.9671680276842043f, - 0.9672012859543511f, - 0.9672345276517651f, - 0.9672677527758767f, - 0.9673009613261169f, - 0.9673341533019163f, - 0.9673673287027063f, - 0.9674004875279185f, - 0.9674336297769847f, - 0.967466755449337f, - 0.967499864544408f, - 0.96753295706163f, - 0.9675660330004362f, - 0.9675990923602598f, - 0.9676321351405344f, - 0.9676651613406938f, - 0.9676981709601721f, - 0.9677311639984035f, - 0.9677641404548231f, - 0.9677971003288655f, - 0.9678300436199659f, - 0.9678629703275602f, - 0.9678958804510839f, - 0.9679287739899732f, - 0.9679616509436644f, - 0.9679945113115943f, - 0.9680273550931997f, - 0.9680601822879179f, - 0.9680929928951864f, - 0.968125786914443f, - 0.9681585643451258f, - 0.9681913251866732f, - 0.9682240694385238f, - 0.9682567971001165f, - 0.9682895081708907f, - 0.9683222026502856f, - 0.9683548805377412f, - 0.9683875418326976f, - 0.968420186534595f, - 0.9684528146428742f, - 0.9684854261569761f, - 0.9685180210763418f, - 0.9685505994004129f, - 0.9685831611286311f, - 0.9686157062604385f, - 0.9686482347952775f, - 0.9686807467325907f, - 0.968713242071821f, - 0.9687457208124116f, - 0.968778182953806f, - 0.968810628495448f, - 0.9688430574367815f, - 0.968875469777251f, - 0.9689078655163011f, - 0.9689402446533767f, - 0.9689726071879229f, - 0.9690049531193854f, - 0.9690372824472097f, - 0.969069595170842f, - 0.9691018912897286f, - 0.969134170803316f, - 0.9691664337110514f, - 0.9691986800123816f, - 0.9692309097067544f, - 0.9692631227936174f, - 0.9692953192724185f, - 0.9693274991426063f, - 0.9693596624036293f, - 0.9693918090549363f, - 0.9694239390959766f, - 0.9694560525261995f, - 0.969488149345055f, - 0.9695202295519929f, - 0.9695522931464635f, - 0.9695843401279176f, - 0.969616370495806f, - 0.9696483842495798f, - 0.9696803813886905f, - 0.9697123619125898f, - 0.9697443258207298f, - 0.9697762731125628f, - 0.9698082037875413f, - 0.9698401178451183f, - 0.9698720152847468f, - 0.9699038961058803f, - 0.9699357603079727f, - 0.9699676078904779f, - 0.9699994388528501f, - 0.970031253194544f, - 0.9700630509150144f, - 0.9700948320137165f, - 0.9701265964901058f, - 0.9701583443436379f, - 0.9701900755737689f, - 0.9702217901799551f, - 0.970253488161653f, - 0.9702851695183196f, - 0.9703168342494118f, - 0.9703484823543873f, - 0.9703801138327036f, - 0.9704117286838189f, - 0.9704433269071914f, - 0.9704749085022796f, - 0.9705064734685425f, - 0.9705380218054391f, - 0.9705695535124289f, - 0.9706010685889717f, - 0.9706325670345273f, - 0.9706640488485562f, - 0.9706955140305188f, - 0.970726962579876f, - 0.9707583944960889f, - 0.9707898097786191f, - 0.9708212084269281f, - 0.9708525904404779f, - 0.970883955818731f, - 0.9709153045611497f, - 0.970946636667197f, - 0.970977952136336f, - 0.9710092509680301f, - 0.9710405331617431f, - 0.9710717987169388f, - 0.9711030476330816f, - 0.9711342799096361f, - 0.971165495546067f, - 0.9711966945418395f, - 0.971227876896419f, - 0.9712590426092713f, - 0.9712901916798622f, - 0.9713213241076581f, - 0.9713524398921256f, - 0.9713835390327314f, - 0.9714146215289428f, - 0.971445687380227f, - 0.9714767365860517f, - 0.9715077691458851f, - 0.9715387850591953f, - 0.9715697843254509f, - 0.9716007669441208f, - 0.9716317329146739f, - 0.9716626822365798f, - 0.9716936149093082f, - 0.971724530932329f, - 0.9717554303051126f, - 0.9717863130271293f, - 0.97181717909785f, - 0.971848028516746f, - 0.9718788612832886f, - 0.9719096773969493f, - 0.9719404768572004f, - 0.971971259663514f, - 0.9720020258153627f, - 0.9720327753122192f, - 0.9720635081535567f, - 0.9720942243388486f, - 0.9721249238675687f, - 0.9721556067391908f, - 0.9721862729531892f, - 0.9722169225090385f, - 0.9722475554062133f, - 0.9722781716441892f, - 0.9723087712224411f, - 0.9723393541404449f, - 0.9723699203976766f, - 0.9724004699936124f, - 0.9724310029277289f, - 0.9724615191995027f, - 0.9724920188084113f, - 0.9725225017539318f, - 0.9725529680355419f, - 0.9725834176527198f, - 0.9726138506049435f, - 0.9726442668916916f, - 0.972674666512443f, - 0.9727050494666768f, - 0.9727354157538723f, - 0.9727657653735093f, - 0.9727960983250677f, - 0.9728264146080278f, - 0.9728567142218701f, - 0.9728869971660754f, - 0.9729172634401249f, - 0.9729475130434998f, - 0.972977745975682f, - 0.9730079622361534f, - 0.9730381618243962f, - 0.973068344739893f, - 0.9730985109821265f, - 0.97312866055058f, - 0.9731587934447369f, - 0.9731889096640807f, - 0.9732190092080953f, - 0.9732490920762653f, - 0.973279158268075f, - 0.9733092077830092f, - 0.9733392406205531f, - 0.9733692567801921f, - 0.9733992562614119f, - 0.9734292390636983f, - 0.9734592051865377f, - 0.9734891546294167f, - 0.9735190873918219f, - 0.9735490034732407f, - 0.9735789028731603f, - 0.9736087855910683f, - 0.9736386516264529f, - 0.9736685009788023f, - 0.9736983336476048f, - 0.9737281496323495f, - 0.9737579489325255f, - 0.973787731547622f, - 0.9738174974771289f, - 0.973847246720536f, - 0.9738769792773336f, - 0.9739066951470123f, - 0.973936394329063f, - 0.9739660768229765f, - 0.9739957426282445f, - 0.9740253917443586f, - 0.9740550241708108f, - 0.9740846399070933f, - 0.9741142389526986f, - 0.9741438213071195f, - 0.9741733869698493f, - 0.9742029359403813f, - 0.9742324682182092f, - 0.9742619838028269f, - 0.9742914826937288f, - 0.9743209648904093f, - 0.9743504303923634f, - 0.9743798791990859f, - 0.9744093113100726f, - 0.9744387267248188f, - 0.9744681254428208f, - 0.9744975074635748f, - 0.9745268727865771f, - 0.9745562214113248f, - 0.974585553337315f, - 0.974614868564045f, - 0.9746441670910124f, - 0.9746734489177156f, - 0.9747027140436524f, - 0.9747319624683215f, - 0.9747611941912218f, - 0.9747904092118523f, - 0.9748196075297125f, - 0.9748487891443022f, - 0.9748779540551212f, - 0.9749071022616699f, - 0.9749362337634486f, - 0.9749653485599585f, - 0.9749944466507005f, - 0.9750235280351761f, - 0.9750525927128869f, - 0.9750816406833349f, - 0.9751106719460225f, - 0.9751396865004521f, - 0.9751686843461267f, - 0.9751976654825493f, - 0.9752266299092234f, - 0.9752555776256526f, - 0.975284508631341f, - 0.9753134229257928f, - 0.9753423205085127f, - 0.9753712013790053f, - 0.9754000655367759f, - 0.9754289129813299f, - 0.9754577437121731f, - 0.9754865577288113f, - 0.9755153550307509f, - 0.9755441356174984f, - 0.9755728994885607f, - 0.975601646643445f, - 0.9756303770816586f, - 0.9756590908027092f, - 0.975687787806105f, - 0.975716468091354f, - 0.9757451316579651f, - 0.9757737785054468f, - 0.9758024086333085f, - 0.9758310220410595f, - 0.9758596187282096f, - 0.9758881986942688f, - 0.9759167619387473f, - 0.9759453084611559f, - 0.9759738382610051f, - 0.9760023513378064f, - 0.9760308476910711f, - 0.9760593273203109f, - 0.9760877902250377f, - 0.976116236404764f, - 0.9761446658590023f, - 0.9761730785872654f, - 0.9762014745890666f, - 0.9762298538639191f, - 0.976258216411337f, - 0.976286562230834f, - 0.9763148913219246f, - 0.9763432036841232f, - 0.9763714993169449f, - 0.9763997782199046f, - 0.976428040392518f, - 0.9764562858343007f, - 0.9764845145447686f, - 0.9765127265234382f, - 0.9765409217698262f, - 0.9765691002834492f, - 0.9765972620638246f, - 0.9766254071104696f, - 0.9766535354229022f, - 0.9766816470006403f, - 0.9767097418432023f, - 0.9767378199501068f, - 0.9767658813208725f, - 0.9767939259550187f, - 0.9768219538520648f, - 0.9768499650115308f, - 0.9768779594329364f, - 0.9769059371158022f, - 0.9769338980596487f, - 0.9769618422639967f, - 0.9769897697283675f, - 0.9770176804522825f, - 0.9770455744352636f, - 0.9770734516768327f, - 0.9771013121765122f, - 0.9771291559338247f, - 0.977156982948293f, - 0.9771847932194404f, - 0.9772125867467903f, - 0.9772403635298668f, - 0.9772681235681935f, - 0.9772958668612949f, - 0.9773235934086957f, - 0.9773513032099207f, - 0.9773789962644952f, - 0.9774066725719447f, - 0.9774343321317949f, - 0.9774619749435719f, - 0.9774896010068019f, - 0.9775172103210118f, - 0.9775448028857284f, - 0.9775723787004789f, - 0.9775999377647907f, - 0.9776274800781917f, - 0.9776550056402099f, - 0.9776825144503738f, - 0.9777100065082119f, - 0.9777374818132533f, - 0.9777649403650269f, - 0.9777923821630625f, - 0.9778198072068899f, - 0.9778472154960389f, - 0.9778746070300401f, - 0.9779019818084241f, - 0.9779293398307218f, - 0.9779566810964645f, - 0.9779840056051836f, - 0.9780113133564111f, - 0.9780386043496789f, - 0.9780658785845194f, - 0.9780931360604654f, - 0.9781203767770498f, - 0.9781476007338057f, - 0.9781748079302667f, - 0.9782019983659666f, - 0.9782291720404396f, - 0.97825632895322f, - 0.9782834691038425f, - 0.978310592491842f, - 0.9783376991167538f, - 0.9783647889781135f, - 0.9783918620754569f, - 0.9784189184083201f, - 0.9784459579762393f, - 0.9784729807787514f, - 0.9784999868153933f, - 0.9785269760857024f, - 0.978553948589216f, - 0.9785809043254721f, - 0.9786078432940087f, - 0.9786347654943645f, - 0.9786616709260778f, - 0.9786885595886878f, - 0.9787154314817338f, - 0.9787422866047552f, - 0.978769124957292f, - 0.9787959465388842f, - 0.9788227513490724f, - 0.978849539387397f, - 0.9788763106533994f, - 0.9789030651466206f, - 0.9789298028666022f, - 0.9789565238128861f, - 0.9789832279850146f, - 0.9790099153825298f, - 0.9790365860049746f, - 0.9790632398518921f, - 0.9790898769228255f, - 0.9791164972173182f, - 0.9791431007349144f, - 0.979169687475158f, - 0.9791962574375935f, - 0.9792228106217657f, - 0.9792493470272197f, - 0.9792758666535006f, - 0.9793023695001541f, - 0.9793288555667261f, - 0.9793553248527628f, - 0.9793817773578104f, - 0.979408213081416f, - 0.9794346320231264f, - 0.979461034182489f, - 0.9794874195590514f, - 0.9795137881523615f, - 0.9795401399619674f, - 0.9795664749874177f, - 0.979592793228261f, - 0.9796190946840465f, - 0.9796453793543235f, - 0.9796716472386415f, - 0.9796978983365506f, - 0.9797241326476009f, - 0.9797503501713428f, - 0.9797765509073272f, - 0.979802734855105f, - 0.9798289020142277f, - 0.9798550523842469f, - 0.9798811859647144f, - 0.9799073027551826f, - 0.9799334027552039f, - 0.979959485964331f, - 0.9799855523821172f, - 0.9800116020081155f, - 0.98003763484188f, - 0.9800636508829642f, - 0.9800896501309226f, - 0.9801156325853096f, - 0.9801415982456801f, - 0.980167547111589f, - 0.9801934791825919f, - 0.9802193944582444f, - 0.9802452929381023f, - 0.9802711746217219f, - 0.9802970395086597f, - 0.9803228875984726f, - 0.9803487188907177f, - 0.9803745333849524f, - 0.9804003310807343f, - 0.9804261119776214f, - 0.9804518760751719f, - 0.9804776233729444f, - 0.9805033538704977f, - 0.9805290675673909f, - 0.9805547644631835f, - 0.9805804445574351f, - 0.9806061078497057f, - 0.9806317543395556f, - 0.9806573840265452f, - 0.9806829969102356f, - 0.9807085929901878f, - 0.980734172265963f, - 0.9807597347371233f, - 0.9807852804032304f, - 0.9808108092638468f, - 0.9808363213185349f, - 0.9808618165668576f, - 0.9808872950083781f, - 0.9809127566426598f, - 0.9809382014692664f, - 0.980963629487762f, - 0.9809890406977108f, - 0.9810144350986774f, - 0.9810398126902266f, - 0.9810651734719237f, - 0.9810905174433341f, - 0.9811158446040235f, - 0.981141154953558f, - 0.9811664484915039f, - 0.9811917252174278f, - 0.9812169851308965f, - 0.9812422282314772f, - 0.9812674545187376f, - 0.9812926639922451f, - 0.981317856651568f, - 0.9813430324962745f, - 0.9813681915259334f, - 0.9813933337401133f, - 0.9814184591383835f, - 0.9814435677203137f, - 0.9814686594854735f, - 0.9814937344334329f, - 0.9815187925637623f, - 0.9815438338760324f, - 0.9815688583698141f, - 0.9815938660446786f, - 0.9816188569001975f, - 0.9816438309359423f, - 0.9816687881514853f, - 0.9816937285463988f, - 0.9817186521202556f, - 0.9817435588726284f, - 0.9817684488030906f, - 0.9817933219112157f, - 0.9818181781965774f, - 0.9818430176587499f, - 0.9818678402973076f, - 0.981892646111825f, - 0.9819174351018772f, - 0.9819422072670395f, - 0.9819669626068873f, - 0.9819917011209965f, - 0.9820164228089433f, - 0.9820411276703039f, - 0.9820658157046551f, - 0.9820904869115739f, - 0.9821151412906375f, - 0.9821397788414234f, - 0.9821643995635096f, - 0.9821890034564742f, - 0.9822135905198955f, - 0.9822381607533524f, - 0.9822627141564236f, - 0.9822872507286886f, - 0.9823117704697271f, - 0.9823362733791187f, - 0.9823607594564435f, - 0.9823852287012823f, - 0.9824096811132155f, - 0.9824341166918242f, - 0.9824585354366898f, - 0.9824829373473939f, - 0.9825073224235181f, - 0.9825316906646449f, - 0.9825560420703565f, - 0.9825803766402359f, - 0.982604694373866f, - 0.98262899527083f, - 0.9826532793307118f, - 0.9826775465530949f, - 0.9827017969375639f, - 0.9827260304837031f, - 0.9827502471910972f, - 0.9827744470593314f, - 0.9827986300879908f, - 0.9828227962766614f, - 0.9828469456249287f, - 0.9828710781323792f, - 0.9828951937985994f, - 0.9829192926231758f, - 0.9829433746056958f, - 0.9829674397457466f, - 0.9829914880429159f, - 0.9830155194967916f, - 0.983039534106962f, - 0.9830635318730154f, - 0.983087512794541f, - 0.9831114768711275f, - 0.9831354241023644f, - 0.9831593544878415f, - 0.9831832680271487f, - 0.9832071647198762f, - 0.9832310445656145f, - 0.9832549075639545f, - 0.9832787537144874f, - 0.9833025830168044f, - 0.9833263954704974f, - 0.9833501910751581f, - 0.9833739698303791f, - 0.9833977317357526f, - 0.9834214767908719f, - 0.9834452049953297f, - 0.9834689163487196f, - 0.9834926108506353f, - 0.983516288500671f, - 0.9835399492984206f, - 0.983563593243479f, - 0.9835872203354409f, - 0.9836108305739015f, - 0.9836344239584563f, - 0.983658000488701f, - 0.9836815601642315f, - 0.9837051029846443f, - 0.9837286289495358f, - 0.9837521380585031f, - 0.9837756303111433f, - 0.9837991057070539f, - 0.9838225642458326f, - 0.9838460059270774f, - 0.9838694307503867f, - 0.983892838715359f, - 0.9839162298215935f, - 0.9839396040686892f, - 0.9839629614562455f, - 0.9839863019838624f, - 0.9840096256511397f, - 0.984032932457678f, - 0.9840562224030779f, - 0.9840794954869402f, - 0.9841027517088662f, - 0.9841259910684574f, - 0.9841492135653157f, - 0.9841724191990431f, - 0.9841956079692419f, - 0.9842187798755149f, - 0.984241934917465f, - 0.9842650730946955f, - 0.9842881944068098f, - 0.9843112988534118f, - 0.9843343864341056f, - 0.9843574571484958f, - 0.9843805109961867f, - 0.9844035479767836f, - 0.9844265680898916f, - 0.9844495713351163f, - 0.9844725577120637f, - 0.9844955272203396f, - 0.9845184798595508f, - 0.9845414156293036f, - 0.9845643345292053f, - 0.9845872365588633f, - 0.9846101217178848f, - 0.9846329900058779f, - 0.9846558414224508f, - 0.9846786759672118f, - 0.9847014936397698f, - 0.9847242944397336f, - 0.9847470783667127f, - 0.9847698454203168f, - 0.9847925956001554f, - 0.9848153289058391f, - 0.9848380453369782f, - 0.9848607448931833f, - 0.9848834275740658f, - 0.9849060933792367f, - 0.9849287423083078f, - 0.9849513743608911f, - 0.9849739895365985f, - 0.9849965878350428f, - 0.9850191692558368f, - 0.9850417337985934f, - 0.9850642814629259f, - 0.9850868122484481f, - 0.985109326154774f, - 0.9851318231815176f, - 0.9851543033282936f, - 0.9851767665947168f, - 0.9851992129804021f, - 0.9852216424849652f, - 0.9852440551080216f, - 0.9852664508491873f, - 0.9852888297080786f, - 0.9853111916843119f, - 0.9853335367775041f, - 0.9853558649872725f, - 0.9853781763132342f, - 0.9854004707550071f, - 0.9854227483122092f, - 0.9854450089844587f, - 0.9854672527713741f, - 0.9854894796725745f, - 0.9855116896876789f, - 0.9855338828163067f, - 0.9855560590580777f, - 0.985578218412612f, - 0.9856003608795296f, - 0.9856224864584513f, - 0.985644595148998f, - 0.985666686950791f, - 0.9856887618634513f, - 0.9857108198866013f, - 0.9857328610198625f, - 0.9857548852628574f, - 0.9857768926152087f, - 0.9857988830765393f, - 0.9858208566464723f, - 0.9858428133246314f, - 0.9858647531106401f, - 0.9858866760041226f, - 0.9859085820047033f, - 0.9859304711120068f, - 0.9859523433256581f, - 0.9859741986452822f, - 0.9859960370705049f, - 0.9860178586009518f, - 0.9860396632362491f, - 0.9860614509760233f, - 0.9860832218199008f, - 0.9861049757675088f, - 0.9861267128184743f, - 0.986148432972425f, - 0.9861701362289889f, - 0.9861918225877937f, - 0.9862134920484682f, - 0.9862351446106409f, - 0.9862567802739409f, - 0.9862783990379974f, - 0.98630000090244f, - 0.9863215858668984f, - 0.986343153931003f, - 0.9863647050943842f, - 0.9863862393566726f, - 0.9864077567174993f, - 0.9864292571764954f, - 0.9864507407332929f, - 0.9864722073875234f, - 0.9864936571388191f, - 0.9865150899868125f, - 0.9865365059311363f, - 0.9865579049714237f, - 0.9865792871073078f, - 0.9866006523384224f, - 0.9866220006644014f, - 0.986643332084879f, - 0.9866646465994896f, - 0.986685944207868f, - 0.9867072249096495f, - 0.986728488704469f, - 0.9867497355919626f, - 0.986770965571766f, - 0.9867921786435155f, - 0.9868133748068476f, - 0.9868345540613992f, - 0.9868557164068072f, - 0.9868768618427093f, - 0.9868979903687428f, - 0.9869191019845459f, - 0.9869401966897569f, - 0.9869612744840142f, - 0.9869823353669567f, - 0.9870033793382235f, - 0.987024406397454f, - 0.9870454165442881f, - 0.9870664097783656f, - 0.9870873860993268f, - 0.9871083455068123f, - 0.987129288000463f, - 0.98715021357992f, - 0.9871711222448248f, - 0.9871920139948192f, - 0.987212888829545f, - 0.9872337467486447f, - 0.987254587751761f, - 0.9872754118385365f, - 0.9872962190086146f, - 0.9873170092616387f, - 0.9873377825972526f, - 0.9873585390151003f, - 0.9873792785148262f, - 0.987400001096075f, - 0.9874207067584915f, - 0.9874413955017208f, - 0.9874620673254088f, - 0.9874827222292009f, - 0.9875033602127433f, - 0.9875239812756824f, - 0.987544585417665f, - 0.9875651726383378f, - 0.9875857429373482f, - 0.9876062963143437f, - 0.9876268327689722f, - 0.9876473523008817f, - 0.9876678549097206f, - 0.9876883405951378f, - 0.987708809356782f, - 0.9877292611943025f, - 0.987749696107349f, - 0.9877701140955714f, - 0.9877905151586197f, - 0.9878108992961444f, - 0.9878312665077962f, - 0.9878516167932261f, - 0.9878719501520854f, - 0.9878922665840258f, - 0.987912566088699f, - 0.9879328486657574f, - 0.9879531143148533f, - 0.9879733630356394f, - 0.9879935948277689f, - 0.9880138096908951f, - 0.9880340076246716f, - 0.9880541886287523f, - 0.9880743527027913f, - 0.9880944998464434f, - 0.9881146300593631f, - 0.9881347433412055f, - 0.9881548396916261f, - 0.9881749191102805f, - 0.9881949815968246f, - 0.9882150271509147f, - 0.9882350557722072f, - 0.9882550674603591f, - 0.9882750622150273f, - 0.9882950400358693f, - 0.9883150009225429f, - 0.9883349448747059f, - 0.9883548718920167f, - 0.9883747819741338f, - 0.9883946751207159f, - 0.9884145513314222f, - 0.9884344106059124f, - 0.9884542529438459f, - 0.9884740783448829f, - 0.9884938868086836f, - 0.9885136783349084f, - 0.9885334529232186f, - 0.988553210573275f, - 0.9885729512847394f, - 0.9885926750572733f, - 0.9886123818905387f, - 0.9886320717841981f, - 0.9886517447379141f, - 0.9886714007513494f, - 0.9886910398241674f, - 0.9887106619560315f, - 0.9887302671466056f, - 0.9887498553955536f, - 0.98876942670254f, - 0.9887889810672295f, - 0.9888085184892867f, - 0.9888280389683773f, - 0.9888475425041665f, - 0.9888670290963202f, - 0.9888864987445045f, - 0.9889059514483859f, - 0.9889253872076309f, - 0.9889448060219066f, - 0.9889642078908802f, - 0.9889835928142193f, - 0.9890029607915917f, - 0.9890223118226655f, - 0.9890416459071093f, - 0.9890609630445917f, - 0.9890802632347816f, - 0.9890995464773484f, - 0.9891188127719618f, - 0.9891380621182915f, - 0.9891572945160078f, - 0.989176509964781f, - 0.989195708464282f, - 0.9892148900141817f, - 0.9892340546141515f, - 0.9892532022638632f, - 0.9892723329629883f, - 0.9892914467111994f, - 0.9893105435081687f, - 0.9893296233535692f, - 0.989348686247074f, - 0.9893677321883562f, - 0.9893867611770896f, - 0.9894057732129481f, - 0.989424768295606f, - 0.9894437464247379f, - 0.9894627076000184f, - 0.9894816518211228f, - 0.9895005790877264f, - 0.9895194893995048f, - 0.9895383827561343f, - 0.9895572591572908f, - 0.9895761186026509f, - 0.9895949610918917f, - 0.9896137866246902f, - 0.9896325952007238f, - 0.9896513868196702f, - 0.9896701614812075f, - 0.9896889191850139f, - 0.9897076599307681f, - 0.9897263837181489f, - 0.9897450905468355f, - 0.9897637804165074f, - 0.9897824533268442f, - 0.9898011092775262f, - 0.9898197482682336f, - 0.989838370298647f, - 0.9898569753684473f, - 0.9898755634773158f, - 0.9898941346249338f, - 0.9899126888109834f, - 0.9899312260351465f, - 0.9899497462971054f, - 0.9899682495965428f, - 0.9899867359331419f, - 0.9900052053065856f, - 0.9900236577165575f, - 0.9900420931627416f, - 0.9900605116448219f, - 0.9900789131624829f, - 0.990097297715409f, - 0.9901156653032854f, - 0.9901340159257975f, - 0.9901523495826307f, - 0.9901706662734708f, - 0.9901889659980042f, - 0.9902072487559171f, - 0.9902255145468963f, - 0.9902437633706288f, - 0.990261995226802f, - 0.9902802101151034f, - 0.990298408035221f, - 0.9903165889868428f, - 0.9903347529696575f, - 0.9903528999833537f, - 0.9903710300276205f, - 0.9903891431021473f, - 0.9904072392066237f, - 0.9904253183407397f, - 0.9904433805041853f, - 0.9904614256966512f, - 0.9904794539178282f, - 0.9904974651674073f, - 0.9905154594450799f, - 0.9905334367505377f, - 0.9905513970834728f, - 0.9905693404435773f, - 0.9905872668305437f, - 0.9906051762440649f, - 0.990623068683834f, - 0.9906409441495444f, - 0.99065880264089f, - 0.9906766441575645f, - 0.9906944686992625f, - 0.9907122762656784f, - 0.990730066856507f, - 0.9907478404714436f, - 0.9907655971101836f, - 0.9907833367724228f, - 0.9908010594578572f, - 0.9908187651661832f, - 0.9908364538970972f, - 0.9908541256502963f, - 0.9908717804254776f, - 0.9908894182223387f, - 0.9909070390405773f, - 0.9909246428798915f, - 0.9909422297399796f, - 0.9909597996205404f, - 0.9909773525212727f, - 0.9909948884418758f, - 0.9910124073820492f, - 0.9910299093414927f, - 0.9910473943199065f, - 0.991064862316991f, - 0.9910823133324467f, - 0.9910997473659748f, - 0.9911171644172765f, - 0.9911345644860533f, - 0.9911519475720071f, - 0.9911693136748401f, - 0.9911866627942546f, - 0.9912039949299534f, - 0.9912213100816396f, - 0.9912386082490164f, - 0.9912558894317876f, - 0.9912731536296567f, - 0.9912904008423282f, - 0.9913076310695066f, - 0.9913248443108964f, - 0.9913420405662029f, - 0.9913592198351313f, - 0.9913763821173873f, - 0.991393527412677f, - 0.9914106557207062f, - 0.9914277670411817f, - 0.9914448613738104f, - 0.9914619387182991f, - 0.9914789990743554f, - 0.991496042441687f, - 0.9915130688200017f, - 0.9915300782090078f, - 0.9915470706084138f, - 0.9915640460179288f, - 0.9915810044372617f, - 0.9915979458661219f, - 0.9916148703042194f, - 0.9916317777512638f, - 0.9916486682069655f, - 0.9916655416710354f, - 0.991682398143184f, - 0.9916992376231227f, - 0.9917160601105629f, - 0.9917328656052162f, - 0.9917496541067949f, - 0.9917664256150112f, - 0.9917831801295777f, - 0.9917999176502074f, - 0.9918166381766134f, - 0.9918333417085092f, - 0.9918500282456088f, - 0.991866697787626f, - 0.9918833503342753f, - 0.9918999858852715f, - 0.9919166044403294f, - 0.9919332059991641f, - 0.9919497905614914f, - 0.9919663581270269f, - 0.991982908695487f, - 0.9919994422665879f, - 0.9920159588400463f, - 0.9920324584155794f, - 0.9920489409929042f, - 0.9920654065717385f, - 0.9920818551518f, - 0.992098286732807f, - 0.9921147013144779f, - 0.9921310988965313f, - 0.9921474794786864f, - 0.9921638430606625f, - 0.9921801896421792f, - 0.9921965192229564f, - 0.9922128318027144f, - 0.9922291273811734f, - 0.9922454059580544f, - 0.9922616675330785f, - 0.992277912105967f, - 0.9922941396764415f, - 0.9923103502442241f, - 0.9923265438090368f, - 0.9923427203706023f, - 0.9923588799286435f, - 0.9923750224828832f, - 0.9923911480330451f, - 0.9924072565788528f, - 0.9924233481200302f, - 0.9924394226563017f, - 0.9924554801873917f, - 0.9924715207130252f, - 0.9924875442329275f, - 0.9925035507468237f, - 0.9925195402544398f, - 0.9925355127555017f, - 0.9925514682497356f, - 0.9925674067368684f, - 0.9925833282166266f, - 0.9925992326887378f, - 0.9926151201529294f, - 0.992630990608929f, - 0.9926468440564647f, - 0.992662680495265f, - 0.9926784999250583f, - 0.9926943023455738f, - 0.9927100877565406f, - 0.9927258561576882f, - 0.9927416075487465f, - 0.9927573419294455f, - 0.9927730592995156f, - 0.9927887596586877f, - 0.9928044430066926f, - 0.9928201093432615f, - 0.992835758668126f, - 0.9928513909810182f, - 0.9928670062816699f, - 0.9928826045698137f, - 0.9928981858451823f, - 0.9929137501075087f, - 0.9929292973565262f, - 0.9929448275919686f, - 0.9929603408135695f, - 0.9929758370210633f, - 0.9929913162141845f, - 0.9930067783926675f, - 0.9930222235562478f, - 0.9930376517046605f, - 0.9930530628376414f, - 0.9930684569549263f, - 0.9930838340562514f, - 0.9930991941413535f, - 0.993114537209969f, - 0.9931298632618353f, - 0.9931451722966897f, - 0.9931604643142699f, - 0.9931757393143138f, - 0.9931909972965598f, - 0.9932062382607463f, - 0.9932214622066123f, - 0.9932366691338969f, - 0.9932518590423394f, - 0.9932670319316798f, - 0.9932821878016578f, - 0.9932973266520139f, - 0.9933124484824886f, - 0.993327553292823f, - 0.9933426410827579f, - 0.9933577118520353f, - 0.9933727656003964f, - 0.9933878023275837f, - 0.9934028220333393f, - 0.993417824717406f, - 0.9934328103795266f, - 0.9934477790194444f, - 0.9934627306369029f, - 0.9934776652316459f, - 0.9934925828034175f, - 0.9935074833519622f, - 0.9935223668770244f, - 0.9935372333783493f, - 0.9935520828556822f, - 0.9935669153087685f, - 0.9935817307373542f, - 0.9935965291411853f, - 0.9936113105200084f, - 0.9936260748735701f, - 0.9936408222016174f, - 0.9936555525038977f, - 0.9936702657801585f, - 0.9936849620301478f, - 0.9936996412536137f, - 0.9937143034503048f, - 0.9937289486199696f, - 0.9937435767623575f, - 0.9937581878772176f, - 0.9937727819642996f, - 0.9937873590233535f, - 0.9938019190541295f, - 0.9938164620563781f, - 0.99383098802985f, - 0.9938454969742966f, - 0.993859988889469f, - 0.993874463775119f, - 0.9938889216309986f, - 0.9939033624568601f, - 0.9939177862524559f, - 0.9939321930175389f, - 0.9939465827518624f, - 0.9939609554551797f, - 0.9939753111272446f, - 0.993989649767811f, - 0.9940039713766333f, - 0.9940182759534661f, - 0.9940325634980643f, - 0.9940468340101831f, - 0.9940610874895779f, - 0.9940753239360045f, - 0.9940895433492191f, - 0.9941037457289779f, - 0.9941179310750375f, - 0.9941320993871551f, - 0.9941462506650875f, - 0.9941603849085927f, - 0.9941745021174282f, - 0.9941886022913522f, - 0.994202685430123f, - 0.9942167515334995f, - 0.9942308006012406f, - 0.9942448326331054f, - 0.9942588476288536f, - 0.9942728455882452f, - 0.9942868265110402f, - 0.9943007903969989f, - 0.9943147372458823f, - 0.9943286670574512f, - 0.994342579831467f, - 0.9943564755676915f, - 0.9943703542658863f, - 0.9943842159258137f, - 0.9943980605472362f, - 0.9944118881299167f, - 0.9944256986736181f, - 0.9944394921781038f, - 0.9944532686431374f, - 0.994467028068483f, - 0.9944807704539047f, - 0.994494495799167f, - 0.9945082041040348f, - 0.9945218953682733f, - 0.9945355695916478f, - 0.994549226773924f, - 0.9945628669148678f, - 0.9945764900142456f, - 0.9945900960718239f, - 0.9946036850873697f, - 0.9946172570606501f, - 0.9946308119914323f, - 0.9946443498794845f, - 0.9946578707245742f, - 0.9946713745264703f, - 0.9946848612849409f, - 0.9946983309997552f, - 0.9947117836706824f, - 0.9947252192974918f, - 0.9947386378799533f, - 0.9947520394178371f, - 0.9947654239109133f, - 0.9947787913589528f, - 0.9947921417617265f, - 0.9948054751190055f, - 0.9948187914305615f, - 0.9948320906961663f, - 0.9948453729155919f, - 0.9948586380886109f, - 0.9948718862149959f, - 0.9948851172945199f, - 0.9948983313269562f, - 0.9949115283120783f, - 0.9949247082496602f, - 0.994937871139476f, - 0.9949510169813002f, - 0.9949641457749074f, - 0.9949772575200729f, - 0.9949903522165718f, - 0.99500342986418f, - 0.9950164904626732f, - 0.9950295340118275f, - 0.9950425605114196f, - 0.9950555699612262f, - 0.9950685623610246f, - 0.9950815377105919f, - 0.9950944960097059f, - 0.9951074372581447f, - 0.9951203614556862f, - 0.9951332686021092f, - 0.9951461586971925f, - 0.9951590317407152f, - 0.9951718877324568f, - 0.9951847266721968f, - 0.9951975485597155f, - 0.9952103533947931f, - 0.9952231411772101f, - 0.9952359119067475f, - 0.9952486655831865f, - 0.9952614022063083f, - 0.995274121775895f, - 0.9952868242917284f, - 0.995299509753591f, - 0.9953121781612654f, - 0.9953248295145346f, - 0.9953374638131817f, - 0.9953500810569902f, - 0.9953626812457439f, - 0.9953752643792271f, - 0.995387830457224f, - 0.9954003794795193f, - 0.9954129114458982f, - 0.9954254263561456f, - 0.9954379242100473f, - 0.995450405007389f, - 0.9954628687479571f, - 0.9954753154315378f, - 0.9954877450579179f, - 0.9955001576268845f, - 0.9955125531382248f, - 0.9955249315917265f, - 0.9955372929871774f, - 0.9955496373243657f, - 0.99556196460308f, - 0.995574274823109f, - 0.9955865679842417f, - 0.9955988440862675f, - 0.9956111031289763f, - 0.9956233451121576f, - 0.9956355700356019f, - 0.9956477778990998f, - 0.9956599687024419f, - 0.9956721424454194f, - 0.9956842991278237f, - 0.9956964387494467f, - 0.9957085613100801f, - 0.9957206668095163f, - 0.995732755247548f, - 0.9957448266239678f, - 0.9957568809385691f, - 0.9957689181911452f, - 0.99578093838149f, - 0.9957929415093973f, - 0.9958049275746618f, - 0.9958168965770776f, - 0.9958288485164402f, - 0.9958407833925443f, - 0.9958527012051857f, - 0.99586460195416f, - 0.9958764856392636f, - 0.9958883522602925f, - 0.9959002018170436f, - 0.9959120343093137f, - 0.9959238497369003f, - 0.9959356480996007f, - 0.9959474293972128f, - 0.9959591936295349f, - 0.9959709407963652f, - 0.9959826708975025f, - 0.9959943839327459f, - 0.9960060799018945f, - 0.996017758804748f, - 0.9960294206411063f, - 0.9960410654107695f, - 0.9960526931135383f, - 0.9960643037492132f, - 0.9960758973175954f, - 0.9960874738184862f, - 0.9960990332516871f, - 0.9961105756170003f, - 0.9961221009142279f, - 0.9961336091431725f, - 0.9961451003036367f, - 0.9961565743954237f, - 0.996168031418337f, - 0.9961794713721802f, - 0.9961908942567572f, - 0.9962023000718725f, - 0.9962136888173304f, - 0.996225060492936f, - 0.9962364150984943f, - 0.9962477526338107f, - 0.996259073098691f, - 0.9962703764929413f, - 0.9962816628163678f, - 0.9962929320687772f, - 0.9963041842499764f, - 0.9963154193597725f, - 0.996326637397973f, - 0.9963378383643858f, - 0.996349022258819f, - 0.9963601890810808f, - 0.99637133883098f, - 0.9963824715083254f, - 0.9963935871129264f, - 0.9964046856445924f, - 0.9964157671031334f, - 0.9964268314883593f, - 0.9964378788000807f, - 0.9964489090381083f, - 0.996459922202253f, - 0.9964709182923261f, - 0.9964818973081393f, - 0.9964928592495044f, - 0.9965038041162334f, - 0.9965147319081391f, - 0.9965256426250341f, - 0.9965365362667313f, - 0.9965474128330444f, - 0.9965582723237866f, - 0.9965691147387721f, - 0.9965799400778151f, - 0.99659074834073f, - 0.9966015395273318f, - 0.9966123136374353f, - 0.9966230706708561f, - 0.9966338106274099f, - 0.9966445335069125f, - 0.9966552393091803f, - 0.9966659280340299f, - 0.996676599681278f, - 0.9966872542507419f, - 0.9966978917422389f, - 0.9967085121555869f, - 0.9967191154906037f, - 0.9967297017471077f, - 0.9967402709249177f, - 0.9967508230238523f, - 0.9967613580437309f, - 0.9967718759843729f, - 0.9967823768455981f, - 0.9967928606272266f, - 0.9968033273290787f, - 0.9968137769509751f, - 0.9968242094927366f, - 0.9968346249541847f, - 0.9968450233351408f, - 0.9968554046354268f, - 0.9968657688548647f, - 0.9968761159932769f, - 0.9968864460504862f, - 0.9968967590263156f, - 0.9969070549205883f, - 0.996917333733128f, - 0.9969275954637584f, - 0.9969378401123039f, - 0.9969480676785889f, - 0.996958278162438f, - 0.9969684715636763f, - 0.9969786478821293f, - 0.9969888071176224f, - 0.9969989492699817f, - 0.9970090743390333f, - 0.9970191823246038f, - 0.99702927322652f, - 0.997039347044609f, - 0.9970494037786981f, - 0.997059443428615f, - 0.9970694659941878f, - 0.9970794714752446f, - 0.9970894598716139f, - 0.9970994311831248f, - 0.9971093854096064f, - 0.997119322550888f, - 0.9971292426067994f, - 0.9971391455771705f, - 0.9971490314618319f, - 0.9971589002606139f, - 0.9971687519733476f, - 0.9971785865998641f, - 0.997188404139995f, - 0.997198204593572f, - 0.9972079879604271f, - 0.9972177542403927f, - 0.9972275034333016f, - 0.9972372355389866f, - 0.9972469505572809f, - 0.9972566484880182f, - 0.9972663293310322f, - 0.9972759930861571f, - 0.9972856397532273f, - 0.9972952693320775f, - 0.9973048818225426f, - 0.9973144772244581f, - 0.9973240555376595f, - 0.9973336167619825f, - 0.9973431608972635f, - 0.9973526879433389f, - 0.9973621979000453f, - 0.99737169076722f, - 0.9973811665447002f, - 0.9973906252323236f, - 0.9974000668299281f, - 0.9974094913373519f, - 0.9974188987544336f, - 0.9974282890810118f, - 0.9974376623169258f, - 0.9974470184620149f, - 0.9974563575161188f, - 0.9974656794790775f, - 0.9974749843507313f, - 0.9974842721309207f, - 0.9974935428194865f, - 0.99750279641627f, - 0.9975120329211127f, - 0.997521252333856f, - 0.9975304546543423f, - 0.9975396398824137f, - 0.9975488080179128f, - 0.9975579590606826f, - 0.9975670930105662f, - 0.9975762098674072f, - 0.9975853096310494f, - 0.9975943923013368f, - 0.9976034578781139f, - 0.9976125063612252f, - 0.9976215377505157f, - 0.9976305520458307f, - 0.9976395492470157f, - 0.9976485293539166f, - 0.9976574923663794f, - 0.9976664382842505f, - 0.9976753671073768f, - 0.9976842788356053f, - 0.9976931734687832f, - 0.997702051006758f, - 0.9977109114493777f, - 0.9977197547964906f, - 0.997728581047945f, - 0.9977373902035896f, - 0.9977461822632737f, - 0.9977549572268465f, - 0.9977637150941577f, - 0.9977724558650571f, - 0.9977811795393952f, - 0.9977898861170221f, - 0.9977985755977891f, - 0.9978072479815469f, - 0.9978159032681472f, - 0.9978245414574415f, - 0.9978331625492818f, - 0.9978417665435205f, - 0.9978503534400102f, - 0.9978589232386035f, - 0.9978674759391538f, - 0.9978760115415145f, - 0.9978845300455393f, - 0.9978930314510823f, - 0.9979015157579979f, - 0.9979099829661405f, - 0.9979184330753651f, - 0.997926866085527f, - 0.9979352819964817f, - 0.9979436808080849f, - 0.9979520625201928f, - 0.9979604271326616f, - 0.9979687746453482f, - 0.9979771050581093f, - 0.9979854183708025f, - 0.9979937145832851f, - 0.998001993695415f, - 0.9980102557070504f, - 0.9980185006180496f, - 0.9980267284282716f, - 0.9980349391375751f, - 0.9980431327458196f, - 0.9980513092528646f, - 0.9980594686585701f, - 0.9980676109627962f, - 0.9980757361654035f, - 0.9980838442662526f, - 0.9980919352652047f, - 0.9981000091621212f, - 0.9981080659568636f, - 0.998116105649294f, - 0.9981241282392745f, - 0.9981321337266679f, - 0.9981401221113367f, - 0.9981480933931443f, - 0.9981560475719538f, - 0.9981639846476291f, - 0.9981719046200344f, - 0.9981798074890336f, - 0.9981876932544914f, - 0.9981955619162729f, - 0.9982034134742431f, - 0.9982112479282674f, - 0.9982190652782118f, - 0.9982268655239421f, - 0.9982346486653247f, - 0.9982424147022264f, - 0.9982501636345139f, - 0.9982578954620546f, - 0.9982656101847159f, - 0.9982733078023657f, - 0.998280988314872f, - 0.9982886517221033f, - 0.9982962980239283f, - 0.9983039272202159f, - 0.9983115393108354f, - 0.9983191342956564f, - 0.9983267121745487f, - 0.9983342729473825f, - 0.9983418166140283f, - 0.9983493431743568f, - 0.998356852628239f, - 0.9983643449755462f, - 0.9983718202161501f, - 0.9983792783499226f, - 0.9983867193767358f, - 0.9983941432964624f, - 0.998401550108975f, - 0.9984089398141468f, - 0.9984163124118512f, - 0.9984236679019618f, - 0.9984310062843526f, - 0.9984383275588977f, - 0.998445631725472f, - 0.99845291878395f, - 0.998460188734207f, - 0.9984674415761184f, - 0.99847467730956f, - 0.9984818959344077f, - 0.9984890974505379f, - 0.9984962818578272f, - 0.9985034491561524f, - 0.9985105993453908f, - 0.9985177324254199f, - 0.9985248483961172f, - 0.9985319472573612f, - 0.9985390290090299f, - 0.9985460936510022f, - 0.998553141183157f, - 0.9985601716053734f, - 0.998567184917531f, - 0.9985741811195097f, - 0.9985811602111896f, - 0.9985881221924512f, - 0.9985950670631749f, - 0.9986019948232421f, - 0.9986089054725338f, - 0.9986157990109317f, - 0.9986226754383176f, - 0.9986295347545738f, - 0.9986363769595828f, - 0.9986432020532272f, - 0.9986500100353901f, - 0.998656800905955f, - 0.9986635746648053f, - 0.998670331311825f, - 0.9986770708468985f, - 0.9986837932699102f, - 0.9986904985807448f, - 0.9986971867792875f, - 0.9987038578654238f, - 0.9987105118390394f, - 0.99871714870002f, - 0.9987237684482522f, - 0.9987303710836224f, - 0.9987369566060175f, - 0.9987435250153247f, - 0.9987500763114314f, - 0.9987566104942254f, - 0.9987631275635946f, - 0.9987696275194275f, - 0.9987761103616126f, - 0.9987825760900391f, - 0.9987890247045957f, - 0.9987954562051724f, - 0.9988018705916587f, - 0.9988082678639448f, - 0.9988146480219211f, - 0.9988210110654783f, - 0.9988273569945072f, - 0.9988336858088992f, - 0.9988399975085459f, - 0.9988462920933391f, - 0.9988525695631708f, - 0.9988588299179337f, - 0.9988650731575204f, - 0.9988712992818238f, - 0.9988775082907375f, - 0.998883700184155f, - 0.99888987496197f, - 0.9988960326240769f, - 0.9989021731703701f, - 0.9989082966007445f, - 0.998914402915095f, - 0.9989204921133172f, - 0.9989265641953067f, - 0.9989326191609592f, - 0.9989386570101713f, - 0.9989446777428392f, - 0.9989506813588601f, - 0.9989566678581309f, - 0.9989626372405491f, - 0.9989685895060123f, - 0.9989745246544187f, - 0.9989804426856664f, - 0.9989863435996542f, - 0.9989922273962809f, - 0.9989980940754456f, - 0.9990039436370479f, - 0.9990097760809875f, - 0.9990155914071644f, - 0.9990213896154791f, - 0.9990271707058322f, - 0.9990329346781247f, - 0.9990386815322577f, - 0.9990444112681328f, - 0.9990501238856518f, - 0.9990558193847169f, - 0.9990614977652303f, - 0.999067159027095f, - 0.9990728031702137f, - 0.9990784301944899f, - 0.9990840400998271f, - 0.9990896328861292f, - 0.9990952085533004f, - 0.999100767101245f, - 0.9991063085298679f, - 0.9991118328390742f, - 0.9991173400287691f, - 0.9991228300988584f, - 0.9991283030492478f, - 0.9991337588798437f, - 0.9991391975905526f, - 0.9991446191812813f, - 0.9991500236519368f, - 0.9991554110024266f, - 0.9991607812326584f, - 0.9991661343425401f, - 0.9991714703319801f, - 0.9991767892008868f, - 0.9991820909491692f, - 0.9991873755767364f, - 0.999192643083498f, - 0.9991978934693634f, - 0.9992031267342429f, - 0.9992083428780468f, - 0.9992135419006857f, - 0.9992187238020704f, - 0.9992238885821124f, - 0.9992290362407229f, - 0.9992341667778138f, - 0.9992392801932973f, - 0.9992443764870856f, - 0.9992494556590916f, - 0.999254517709228f, - 0.9992595626374083f, - 0.9992645904435459f, - 0.9992696011275547f, - 0.9992745946893489f, - 0.9992795711288428f, - 0.9992845304459512f, - 0.9992894726405892f, - 0.9992943977126721f, - 0.9992993056621154f, - 0.9993041964888351f, - 0.9993090701927474f, - 0.9993139267737686f, - 0.9993187662318158f, - 0.9993235885668059f, - 0.9993283937786562f, - 0.9993331818672846f, - 0.9993379528326087f, - 0.9993427066745472f, - 0.9993474433930183f, - 0.9993521629879408f, - 0.9993568654592342f, - 0.9993615508068175f, - 0.9993662190306108f, - 0.9993708701305338f, - 0.999375504106507f, - 0.999380120958451f, - 0.9993847206862865f, - 0.9993893032899348f, - 0.9993938687693175f, - 0.9993984171243561f, - 0.9994029483549729f, - 0.9994074624610901f, - 0.9994119594426306f, - 0.9994164392995171f, - 0.9994209020316729f, - 0.9994253476390215f, - 0.9994297761214869f, - 0.9994341874789929f, - 0.9994385817114643f, - 0.9994429588188255f, - 0.9994473188010017f, - 0.999451661657918f, - 0.9994559873895001f, - 0.999460295995674f, - 0.9994645874763657f, - 0.9994688618315016f, - 0.9994731190610087f, - 0.9994773591648138f, - 0.9994815821428444f, - 0.9994857879950282f, - 0.999489976721293f, - 0.999494148321567f, - 0.9994983027957789f, - 0.9995024401438574f, - 0.9995065603657316f, - 0.9995106634613309f, - 0.9995147494305849f, - 0.9995188182734238f, - 0.9995228699897778f, - 0.9995269045795775f, - 0.9995309220427536f, - 0.9995349223792375f, - 0.9995389055889605f, - 0.9995428716718544f, - 0.9995468206278512f, - 0.9995507524568833f, - 0.9995546671588833f, - 0.999558564733784f, - 0.9995624451815189f, - 0.9995663085020212f, - 0.999570154695225f, - 0.9995739837610642f, - 0.9995777956994731f, - 0.9995815905103866f, - 0.9995853681937397f, - 0.9995891287494675f, - 0.9995928721775056f, - 0.9995965984777899f, - 0.9996003076502565f, - 0.9996039996948419f, - 0.9996076746114829f, - 0.9996113324001163f, - 0.9996149730606797f, - 0.9996185965931106f, - 0.9996222029973468f, - 0.9996257922733267f, - 0.9996293644209887f, - 0.9996329194402717f, - 0.9996364573311145f, - 0.9996399780934567f, - 0.999643481727238f, - 0.9996469682323983f, - 0.9996504376088778f, - 0.9996538898566172f, - 0.9996573249755573f, - 0.9996607429656391f, - 0.9996641438268042f, - 0.9996675275589942f, - 0.9996708941621513f, - 0.9996742436362176f, - 0.9996775759811358f, - 0.9996808911968489f, - 0.9996841892832999f, - 0.9996874702404326f, - 0.9996907340681903f, - 0.9996939807665175f, - 0.9996972103353584f, - 0.9997004227746578f, - 0.9997036180843604f, - 0.9997067962644115f, - 0.9997099573147569f, - 0.9997131012353422f, - 0.9997162280261135f, - 0.9997193376870174f, - 0.9997224302180006f, - 0.99972550561901f, - 0.9997285638899929f, - 0.999731605030897f, - 0.9997346290416701f, - 0.9997376359222604f, - 0.9997406256726165f, - 0.9997435982926869f, - 0.9997465537824209f, - 0.9997494921417679f, - 0.9997524133706773f, - 0.9997553174690993f, - 0.999758204436984f, - 0.999761074274282f, - 0.9997639269809441f, - 0.9997667625569213f, - 0.9997695810021652f, - 0.9997723823166274f, - 0.99977516650026f, - 0.9997779335530151f, - 0.9997806834748455f, - 0.999783416265704f, - 0.9997861319255437f, - 0.9997888304543181f, - 0.9997915118519811f, - 0.9997941761184866f, - 0.999796823253789f, - 0.9997994532578429f, - 0.9998020661306034f, - 0.9998046618720255f, - 0.9998072404820648f, - 0.9998098019606773f, - 0.9998123463078188f, - 0.9998148735234459f, - 0.9998173836075153f, - 0.9998198765599838f, - 0.999822352380809f, - 0.9998248110699482f, - 0.9998272526273595f, - 0.9998296770530009f, - 0.9998320843468308f, - 0.999834474508808f, - 0.9998368475388918f, - 0.9998392034370412f, - 0.999841542203216f, - 0.9998438638373761f, - 0.9998461683394817f, - 0.9998484557094933f, - 0.9998507259473718f, - 0.9998529790530782f, - 0.9998552150265739f, - 0.9998574338678207f, - 0.9998596355767804f, - 0.9998618201534154f, - 0.9998639875976882f, - 0.9998661379095618f, - 0.9998682710889991f, - 0.9998703871359639f, - 0.9998724860504196f, - 0.9998745678323304f, - 0.9998766324816606f, - 0.9998786799983749f, - 0.999880710382438f, - 0.9998827236338154f, - 0.9998847197524724f, - 0.9998866987383749f, - 0.9998886605914888f, - 0.9998906053117809f, - 0.9998925328992174f, - 0.9998944433537655f, - 0.9998963366753925f, - 0.9998982128640659f, - 0.9999000719197535f, - 0.9999019138424236f, - 0.9999037386320444f, - 0.999905546288585f, - 0.9999073368120139f, - 0.999909110202301f, - 0.9999108664594155f, - 0.9999126055833274f, - 0.999914327574007f, - 0.9999160324314248f, - 0.9999177201555515f, - 0.999919390746358f, - 0.9999210442038161f, - 0.9999226805278972f, - 0.9999242997185733f, - 0.9999259017758166f, - 0.9999274866995999f, - 0.9999290544898957f, - 0.9999306051466773f, - 0.9999321386699181f, - 0.999933655059592f, - 0.9999351543156727f, - 0.9999366364381348f, - 0.9999381014269527f, - 0.9999395492821014f, - 0.999940980003556f, - 0.9999423935912921f, - 0.9999437900452854f, - 0.9999451693655121f, - 0.9999465315519485f, - 0.9999478766045711f, - 0.999949204523357f, - 0.9999505153082835f, - 0.999951808959328f, - 0.9999530854764684f, - 0.9999543448596829f, - 0.9999555871089498f, - 0.9999568122242479f, - 0.9999580202055561f, - 0.9999592110528538f, - 0.9999603847661206f, - 0.9999615413453363f, - 0.9999626807904812f, - 0.9999638031015358f, - 0.9999649082784806f, - 0.999965996321297f, - 0.9999670672299661f, - 0.9999681210044697f, - 0.9999691576447897f, - 0.9999701771509083f, - 0.9999711795228081f, - 0.9999721647604719f, - 0.9999731328638829f, - 0.9999740838330242f, - 0.9999750176678799f, - 0.9999759343684338f, - 0.9999768339346702f, - 0.9999777163665737f, - 0.9999785816641292f, - 0.9999794298273218f, - 0.9999802608561371f, - 0.9999810747505607f, - 0.9999818715105789f, - 0.9999826511361778f, - 0.9999834136273441f, - 0.9999841589840648f, - 0.999984887206327f, - 0.9999855982941185f, - 0.9999862922474267f, - 0.9999869690662402f, - 0.9999876287505469f, - 0.999988271300336f, - 0.999988896715596f, - 0.9999895049963164f, - 0.9999900961424869f, - 0.9999906701540973f, - 0.9999912270311376f, - 0.9999917667735985f, - 0.9999922893814706f, - 0.999992794854745f, - 0.999993283193413f, - 0.9999937543974662f, - 0.9999942084668966f, - 0.9999946454016965f, - 0.9999950652018582f, - 0.9999954678673746f, - 0.9999958533982388f, - 0.9999962217944444f, - 0.9999965730559848f, - 0.999996907182854f, - 0.9999972241750464f, - 0.9999975240325565f, - 0.9999978067553793f, - 0.9999980723435097f, - 0.9999983207969434f, - 0.999998552115676f, - 0.9999987662997035f, - 0.9999989633490224f, - 0.9999991432636292f, - 0.9999993060435208f, - 0.9999994516886945f, - 0.9999995801991477f, - 0.9999996915748783f, - 0.9999997858158843f, - 0.9999998629221643f, - 0.9999999228937166f, - 0.9999999657305405f, - 0.9999999914326351f, - 1.0f, - 0.9999999914326351f, - 0.9999999657305405f, - 0.9999999228937166f, - 0.9999998629221643f, - 0.9999997858158843f, - 0.9999996915748783f, - 0.9999995801991477f, - 0.9999994516886945f, - 0.9999993060435208f, - 0.9999991432636292f, - 0.9999989633490224f, - 0.9999987662997035f, - 0.999998552115676f, - 0.9999983207969434f, - 0.9999980723435097f, - 0.9999978067553793f, - 0.9999975240325565f, - 0.9999972241750464f, - 0.999996907182854f, - 0.9999965730559848f, - 0.9999962217944444f, - 0.9999958533982388f, - 0.9999954678673746f, - 0.9999950652018582f, - 0.9999946454016965f, - 0.9999942084668966f, - 0.9999937543974662f, - 0.999993283193413f, - 0.999992794854745f, - 0.9999922893814706f, - 0.9999917667735985f, - 0.9999912270311376f, - 0.9999906701540973f, - 0.9999900961424869f, - 0.9999895049963164f, - 0.999988896715596f, - 0.999988271300336f, - 0.9999876287505469f, - 0.9999869690662402f, - 0.9999862922474267f, - 0.9999855982941185f, - 0.999984887206327f, - 0.9999841589840648f, - 0.9999834136273441f, - 0.9999826511361778f, - 0.9999818715105789f, - 0.9999810747505607f, - 0.9999802608561371f, - 0.9999794298273218f, - 0.9999785816641292f, - 0.9999777163665737f, - 0.9999768339346702f, - 0.9999759343684338f, - 0.9999750176678799f, - 0.9999740838330242f, - 0.9999731328638829f, - 0.9999721647604719f, - 0.9999711795228081f, - 0.9999701771509083f, - 0.9999691576447897f, - 0.9999681210044697f, - 0.9999670672299661f, - 0.999965996321297f, - 0.9999649082784806f, - 0.9999638031015358f, - 0.9999626807904812f, - 0.9999615413453363f, - 0.9999603847661206f, - 0.9999592110528538f, - 0.9999580202055561f, - 0.9999568122242479f, - 0.9999555871089498f, - 0.9999543448596829f, - 0.9999530854764684f, - 0.999951808959328f, - 0.9999505153082835f, - 0.999949204523357f, - 0.9999478766045711f, - 0.9999465315519485f, - 0.9999451693655121f, - 0.9999437900452854f, - 0.9999423935912921f, - 0.999940980003556f, - 0.9999395492821014f, - 0.9999381014269527f, - 0.9999366364381348f, - 0.9999351543156727f, - 0.999933655059592f, - 0.9999321386699181f, - 0.9999306051466773f, - 0.9999290544898957f, - 0.9999274866995999f, - 0.9999259017758166f, - 0.9999242997185733f, - 0.9999226805278972f, - 0.9999210442038161f, - 0.999919390746358f, - 0.9999177201555515f, - 0.9999160324314248f, - 0.999914327574007f, - 0.9999126055833274f, - 0.9999108664594155f, - 0.999909110202301f, - 0.9999073368120139f, - 0.999905546288585f, - 0.9999037386320445f, - 0.9999019138424236f, - 0.9999000719197535f, - 0.9998982128640659f, - 0.9998963366753925f, - 0.9998944433537655f, - 0.9998925328992174f, - 0.9998906053117809f, - 0.9998886605914888f, - 0.9998866987383749f, - 0.9998847197524724f, - 0.9998827236338154f, - 0.9998807103824381f, - 0.9998786799983749f, - 0.9998766324816606f, - 0.9998745678323304f, - 0.9998724860504196f, - 0.9998703871359639f, - 0.9998682710889991f, - 0.9998661379095618f, - 0.9998639875976882f, - 0.9998618201534154f, - 0.9998596355767804f, - 0.9998574338678207f, - 0.9998552150265739f, - 0.9998529790530782f, - 0.9998507259473718f, - 0.9998484557094933f, - 0.9998461683394817f, - 0.9998438638373761f, - 0.999841542203216f, - 0.9998392034370412f, - 0.9998368475388918f, - 0.9998344745088081f, - 0.9998320843468308f, - 0.9998296770530009f, - 0.9998272526273595f, - 0.9998248110699482f, - 0.999822352380809f, - 0.9998198765599838f, - 0.9998173836075153f, - 0.9998148735234459f, - 0.9998123463078188f, - 0.9998098019606773f, - 0.9998072404820648f, - 0.9998046618720255f, - 0.9998020661306034f, - 0.9997994532578429f, - 0.999796823253789f, - 0.9997941761184866f, - 0.9997915118519811f, - 0.9997888304543181f, - 0.9997861319255437f, - 0.999783416265704f, - 0.9997806834748455f, - 0.9997779335530151f, - 0.99977516650026f, - 0.9997723823166275f, - 0.9997695810021652f, - 0.9997667625569213f, - 0.9997639269809441f, - 0.999761074274282f, - 0.999758204436984f, - 0.9997553174690993f, - 0.9997524133706773f, - 0.9997494921417679f, - 0.9997465537824209f, - 0.9997435982926869f, - 0.9997406256726165f, - 0.9997376359222604f, - 0.9997346290416701f, - 0.999731605030897f, - 0.9997285638899929f, - 0.99972550561901f, - 0.9997224302180006f, - 0.9997193376870174f, - 0.9997162280261135f, - 0.9997131012353422f, - 0.9997099573147569f, - 0.9997067962644115f, - 0.9997036180843604f, - 0.9997004227746578f, - 0.9996972103353584f, - 0.9996939807665175f, - 0.9996907340681903f, - 0.9996874702404326f, - 0.9996841892832999f, - 0.9996808911968489f, - 0.9996775759811358f, - 0.9996742436362176f, - 0.9996708941621513f, - 0.9996675275589942f, - 0.9996641438268042f, - 0.9996607429656391f, - 0.9996573249755573f, - 0.9996538898566173f, - 0.9996504376088778f, - 0.9996469682323983f, - 0.999643481727238f, - 0.9996399780934567f, - 0.9996364573311145f, - 0.9996329194402717f, - 0.9996293644209887f, - 0.9996257922733267f, - 0.9996222029973468f, - 0.9996185965931106f, - 0.9996149730606797f, - 0.9996113324001163f, - 0.9996076746114829f, - 0.9996039996948419f, - 0.9996003076502565f, - 0.9995965984777899f, - 0.9995928721775056f, - 0.9995891287494675f, - 0.9995853681937397f, - 0.9995815905103866f, - 0.9995777956994731f, - 0.9995739837610642f, - 0.999570154695225f, - 0.9995663085020212f, - 0.9995624451815189f, - 0.999558564733784f, - 0.9995546671588833f, - 0.9995507524568833f, - 0.9995468206278512f, - 0.9995428716718544f, - 0.9995389055889605f, - 0.9995349223792375f, - 0.9995309220427536f, - 0.9995269045795775f, - 0.9995228699897779f, - 0.9995188182734239f, - 0.9995147494305849f, - 0.9995106634613309f, - 0.9995065603657316f, - 0.9995024401438574f, - 0.9994983027957789f, - 0.999494148321567f, - 0.999489976721293f, - 0.9994857879950282f, - 0.9994815821428444f, - 0.9994773591648138f, - 0.9994731190610087f, - 0.9994688618315016f, - 0.9994645874763657f, - 0.999460295995674f, - 0.9994559873895001f, - 0.999451661657918f, - 0.9994473188010017f, - 0.9994429588188255f, - 0.9994385817114643f, - 0.9994341874789929f, - 0.9994297761214869f, - 0.9994253476390215f, - 0.9994209020316729f, - 0.9994164392995171f, - 0.9994119594426306f, - 0.9994074624610901f, - 0.9994029483549729f, - 0.9993984171243561f, - 0.9993938687693175f, - 0.9993893032899348f, - 0.9993847206862865f, - 0.999380120958451f, - 0.999375504106507f, - 0.9993708701305338f, - 0.9993662190306108f, - 0.9993615508068175f, - 0.9993568654592342f, - 0.9993521629879409f, - 0.9993474433930183f, - 0.9993427066745472f, - 0.9993379528326088f, - 0.9993331818672846f, - 0.9993283937786562f, - 0.9993235885668059f, - 0.9993187662318158f, - 0.9993139267737686f, - 0.9993090701927474f, - 0.9993041964888351f, - 0.9992993056621154f, - 0.9992943977126721f, - 0.9992894726405892f, - 0.9992845304459512f, - 0.9992795711288428f, - 0.9992745946893489f, - 0.9992696011275547f, - 0.9992645904435459f, - 0.9992595626374083f, - 0.999254517709228f, - 0.9992494556590916f, - 0.9992443764870856f, - 0.9992392801932973f, - 0.9992341667778138f, - 0.9992290362407229f, - 0.9992238885821124f, - 0.9992187238020706f, - 0.9992135419006857f, - 0.9992083428780468f, - 0.9992031267342429f, - 0.9991978934693634f, - 0.999192643083498f, - 0.9991873755767364f, - 0.9991820909491692f, - 0.9991767892008868f, - 0.9991714703319801f, - 0.9991661343425401f, - 0.9991607812326584f, - 0.9991554110024267f, - 0.9991500236519368f, - 0.9991446191812813f, - 0.9991391975905526f, - 0.9991337588798437f, - 0.9991283030492478f, - 0.9991228300988584f, - 0.9991173400287692f, - 0.9991118328390742f, - 0.9991063085298679f, - 0.999100767101245f, - 0.9990952085533004f, - 0.9990896328861292f, - 0.9990840400998271f, - 0.9990784301944899f, - 0.9990728031702137f, - 0.999067159027095f, - 0.9990614977652303f, - 0.9990558193847169f, - 0.9990501238856518f, - 0.9990444112681328f, - 0.9990386815322577f, - 0.9990329346781247f, - 0.9990271707058324f, - 0.9990213896154791f, - 0.9990155914071644f, - 0.9990097760809875f, - 0.9990039436370479f, - 0.9989980940754456f, - 0.9989922273962809f, - 0.9989863435996542f, - 0.9989804426856664f, - 0.9989745246544187f, - 0.9989685895060123f, - 0.9989626372405491f, - 0.9989566678581309f, - 0.9989506813588601f, - 0.9989446777428392f, - 0.9989386570101713f, - 0.9989326191609592f, - 0.9989265641953067f, - 0.9989204921133172f, - 0.998914402915095f, - 0.9989082966007445f, - 0.9989021731703701f, - 0.9988960326240769f, - 0.99888987496197f, - 0.998883700184155f, - 0.9988775082907375f, - 0.9988712992818238f, - 0.9988650731575204f, - 0.9988588299179337f, - 0.9988525695631708f, - 0.9988462920933391f, - 0.9988399975085459f, - 0.9988336858088992f, - 0.9988273569945072f, - 0.9988210110654783f, - 0.9988146480219211f, - 0.9988082678639448f, - 0.9988018705916587f, - 0.9987954562051724f, - 0.9987890247045957f, - 0.9987825760900391f, - 0.9987761103616126f, - 0.9987696275194275f, - 0.9987631275635946f, - 0.9987566104942254f, - 0.9987500763114314f, - 0.9987435250153247f, - 0.9987369566060175f, - 0.9987303710836224f, - 0.9987237684482522f, - 0.99871714870002f, - 0.9987105118390394f, - 0.9987038578654238f, - 0.9986971867792875f, - 0.9986904985807448f, - 0.9986837932699102f, - 0.9986770708468985f, - 0.998670331311825f, - 0.9986635746648053f, - 0.998656800905955f, - 0.9986500100353901f, - 0.9986432020532272f, - 0.9986363769595828f, - 0.9986295347545738f, - 0.9986226754383176f, - 0.9986157990109317f, - 0.9986089054725338f, - 0.9986019948232421f, - 0.9985950670631749f, - 0.9985881221924512f, - 0.9985811602111897f, - 0.9985741811195098f, - 0.998567184917531f, - 0.9985601716053734f, - 0.998553141183157f, - 0.9985460936510022f, - 0.9985390290090299f, - 0.9985319472573612f, - 0.9985248483961172f, - 0.9985177324254199f, - 0.9985105993453908f, - 0.9985034491561524f, - 0.9984962818578272f, - 0.9984890974505379f, - 0.9984818959344077f, - 0.9984746773095601f, - 0.9984674415761184f, - 0.998460188734207f, - 0.99845291878395f, - 0.998445631725472f, - 0.9984383275588977f, - 0.9984310062843526f, - 0.9984236679019618f, - 0.9984163124118512f, - 0.9984089398141469f, - 0.998401550108975f, - 0.9983941432964624f, - 0.9983867193767358f, - 0.9983792783499226f, - 0.9983718202161501f, - 0.9983643449755462f, - 0.998356852628239f, - 0.9983493431743568f, - 0.9983418166140283f, - 0.9983342729473825f, - 0.9983267121745487f, - 0.9983191342956564f, - 0.9983115393108354f, - 0.9983039272202159f, - 0.9982962980239283f, - 0.9982886517221033f, - 0.998280988314872f, - 0.9982733078023657f, - 0.9982656101847159f, - 0.9982578954620546f, - 0.9982501636345139f, - 0.9982424147022264f, - 0.9982346486653247f, - 0.9982268655239421f, - 0.9982190652782118f, - 0.9982112479282674f, - 0.9982034134742431f, - 0.9981955619162729f, - 0.9981876932544915f, - 0.9981798074890336f, - 0.9981719046200344f, - 0.9981639846476291f, - 0.9981560475719538f, - 0.9981480933931443f, - 0.9981401221113367f, - 0.9981321337266679f, - 0.9981241282392745f, - 0.998116105649294f, - 0.9981080659568636f, - 0.9981000091621212f, - 0.9980919352652047f, - 0.9980838442662526f, - 0.9980757361654035f, - 0.9980676109627962f, - 0.9980594686585701f, - 0.9980513092528646f, - 0.9980431327458196f, - 0.9980349391375751f, - 0.9980267284282716f, - 0.9980185006180496f, - 0.9980102557070504f, - 0.998001993695415f, - 0.9979937145832851f, - 0.9979854183708025f, - 0.9979771050581093f, - 0.9979687746453482f, - 0.9979604271326616f, - 0.9979520625201928f, - 0.9979436808080849f, - 0.9979352819964817f, - 0.997926866085527f, - 0.9979184330753651f, - 0.9979099829661405f, - 0.9979015157579979f, - 0.9978930314510823f, - 0.9978845300455393f, - 0.9978760115415145f, - 0.9978674759391538f, - 0.9978589232386035f, - 0.9978503534400102f, - 0.9978417665435205f, - 0.9978331625492818f, - 0.9978245414574415f, - 0.9978159032681472f, - 0.9978072479815469f, - 0.9977985755977891f, - 0.9977898861170221f, - 0.9977811795393952f, - 0.9977724558650571f, - 0.9977637150941577f, - 0.9977549572268466f, - 0.9977461822632737f, - 0.9977373902035898f, - 0.997728581047945f, - 0.9977197547964907f, - 0.9977109114493777f, - 0.997702051006758f, - 0.9976931734687832f, - 0.9976842788356053f, - 0.9976753671073768f, - 0.9976664382842505f, - 0.9976574923663794f, - 0.9976485293539165f, - 0.9976395492470157f, - 0.9976305520458307f, - 0.9976215377505158f, - 0.9976125063612252f, - 0.9976034578781139f, - 0.9975943923013368f, - 0.9975853096310495f, - 0.9975762098674072f, - 0.9975670930105662f, - 0.9975579590606826f, - 0.9975488080179128f, - 0.9975396398824137f, - 0.9975304546543422f, - 0.997521252333856f, - 0.9975120329211127f, - 0.9975027964162702f, - 0.9974935428194865f, - 0.9974842721309207f, - 0.9974749843507313f, - 0.9974656794790776f, - 0.9974563575161188f, - 0.9974470184620149f, - 0.9974376623169258f, - 0.9974282890810118f, - 0.9974188987544336f, - 0.9974094913373519f, - 0.9974000668299281f, - 0.9973906252323237f, - 0.9973811665447003f, - 0.9973716907672201f, - 0.9973621979000453f, - 0.9973526879433389f, - 0.9973431608972635f, - 0.9973336167619825f, - 0.9973240555376595f, - 0.9973144772244581f, - 0.9973048818225426f, - 0.9972952693320775f, - 0.9972856397532273f, - 0.9972759930861571f, - 0.9972663293310322f, - 0.9972566484880182f, - 0.9972469505572809f, - 0.9972372355389866f, - 0.9972275034333016f, - 0.9972177542403927f, - 0.9972079879604271f, - 0.9971982045935719f, - 0.997188404139995f, - 0.9971785865998641f, - 0.9971687519733476f, - 0.9971589002606139f, - 0.9971490314618319f, - 0.9971391455771705f, - 0.9971292426067994f, - 0.997119322550888f, - 0.9971093854096064f, - 0.9970994311831248f, - 0.9970894598716139f, - 0.9970794714752446f, - 0.9970694659941878f, - 0.997059443428615f, - 0.9970494037786981f, - 0.9970393470446091f, - 0.99702927322652f, - 0.9970191823246038f, - 0.9970090743390334f, - 0.9969989492699818f, - 0.9969888071176224f, - 0.9969786478821293f, - 0.9969684715636763f, - 0.996958278162438f, - 0.9969480676785889f, - 0.9969378401123039f, - 0.9969275954637584f, - 0.996917333733128f, - 0.9969070549205883f, - 0.9968967590263156f, - 0.9968864460504863f, - 0.9968761159932769f, - 0.9968657688548647f, - 0.9968554046354268f, - 0.9968450233351408f, - 0.9968346249541847f, - 0.9968242094927366f, - 0.9968137769509751f, - 0.9968033273290787f, - 0.9967928606272266f, - 0.9967823768455981f, - 0.996771875984373f, - 0.9967613580437309f, - 0.9967508230238523f, - 0.9967402709249177f, - 0.9967297017471077f, - 0.9967191154906037f, - 0.9967085121555869f, - 0.9966978917422389f, - 0.9966872542507419f, - 0.9966765996812781f, - 0.9966659280340299f, - 0.9966552393091803f, - 0.9966445335069125f, - 0.9966338106274099f, - 0.9966230706708561f, - 0.9966123136374353f, - 0.9966015395273318f, - 0.99659074834073f, - 0.9965799400778151f, - 0.9965691147387721f, - 0.9965582723237866f, - 0.9965474128330444f, - 0.9965365362667314f, - 0.9965256426250341f, - 0.9965147319081391f, - 0.9965038041162335f, - 0.9964928592495044f, - 0.9964818973081393f, - 0.9964709182923261f, - 0.996459922202253f, - 0.9964489090381082f, - 0.9964378788000807f, - 0.9964268314883593f, - 0.9964157671031334f, - 0.9964046856445924f, - 0.9963935871129264f, - 0.9963824715083254f, - 0.99637133883098f, - 0.9963601890810808f, - 0.996349022258819f, - 0.9963378383643858f, - 0.996326637397973f, - 0.9963154193597725f, - 0.9963041842499764f, - 0.9962929320687772f, - 0.9962816628163678f, - 0.9962703764929413f, - 0.996259073098691f, - 0.9962477526338107f, - 0.9962364150984943f, - 0.996225060492936f, - 0.9962136888173304f, - 0.9962023000718725f, - 0.9961908942567573f, - 0.9961794713721802f, - 0.996168031418337f, - 0.9961565743954237f, - 0.9961451003036367f, - 0.9961336091431725f, - 0.996122100914228f, - 0.9961105756170003f, - 0.9960990332516872f, - 0.9960874738184862f, - 0.9960758973175954f, - 0.9960643037492132f, - 0.9960526931135383f, - 0.9960410654107695f, - 0.9960294206411063f, - 0.996017758804748f, - 0.9960060799018945f, - 0.9959943839327459f, - 0.9959826708975025f, - 0.9959709407963652f, - 0.9959591936295349f, - 0.9959474293972129f, - 0.9959356480996007f, - 0.9959238497369003f, - 0.9959120343093137f, - 0.9959002018170435f, - 0.9958883522602925f, - 0.9958764856392636f, - 0.99586460195416f, - 0.9958527012051857f, - 0.9958407833925443f, - 0.9958288485164402f, - 0.9958168965770777f, - 0.9958049275746618f, - 0.9957929415093973f, - 0.99578093838149f, - 0.9957689181911452f, - 0.9957568809385692f, - 0.9957448266239679f, - 0.995732755247548f, - 0.9957206668095163f, - 0.9957085613100801f, - 0.9956964387494467f, - 0.9956842991278239f, - 0.9956721424454195f, - 0.9956599687024419f, - 0.9956477778990998f, - 0.9956355700356019f, - 0.9956233451121576f, - 0.9956111031289762f, - 0.9955988440862676f, - 0.9955865679842417f, - 0.995574274823109f, - 0.99556196460308f, - 0.9955496373243657f, - 0.9955372929871774f, - 0.9955249315917265f, - 0.9955125531382248f, - 0.9955001576268846f, - 0.9954877450579179f, - 0.9954753154315379f, - 0.9954628687479571f, - 0.9954504050073891f, - 0.9954379242100473f, - 0.9954254263561456f, - 0.9954129114458982f, - 0.9954003794795193f, - 0.995387830457224f, - 0.9953752643792271f, - 0.995362681245744f, - 0.9953500810569902f, - 0.9953374638131816f, - 0.9953248295145346f, - 0.9953121781612654f, - 0.995299509753591f, - 0.9952868242917284f, - 0.995274121775895f, - 0.9952614022063083f, - 0.9952486655831865f, - 0.9952359119067475f, - 0.9952231411772102f, - 0.9952103533947931f, - 0.9951975485597157f, - 0.9951847266721969f, - 0.9951718877324568f, - 0.9951590317407152f, - 0.9951461586971925f, - 0.9951332686021092f, - 0.9951203614556862f, - 0.9951074372581447f, - 0.9950944960097059f, - 0.9950815377105919f, - 0.9950685623610246f, - 0.9950555699612263f, - 0.9950425605114196f, - 0.9950295340118275f, - 0.9950164904626732f, - 0.99500342986418f, - 0.994990352216572f, - 0.9949772575200729f, - 0.9949641457749074f, - 0.9949510169813002f, - 0.994937871139476f, - 0.9949247082496602f, - 0.9949115283120783f, - 0.9948983313269562f, - 0.9948851172945199f, - 0.9948718862149959f, - 0.9948586380886109f, - 0.9948453729155919f, - 0.9948320906961663f, - 0.9948187914305615f, - 0.9948054751190055f, - 0.9947921417617265f, - 0.9947787913589529f, - 0.9947654239109134f, - 0.9947520394178371f, - 0.9947386378799533f, - 0.9947252192974918f, - 0.9947117836706824f, - 0.9946983309997552f, - 0.9946848612849408f, - 0.9946713745264703f, - 0.9946578707245742f, - 0.9946443498794845f, - 0.9946308119914323f, - 0.9946172570606501f, - 0.9946036850873697f, - 0.9945900960718239f, - 0.9945764900142456f, - 0.9945628669148678f, - 0.994549226773924f, - 0.9945355695916478f, - 0.9945218953682734f, - 0.9945082041040348f, - 0.994494495799167f, - 0.9944807704539047f, - 0.994467028068483f, - 0.9944532686431374f, - 0.9944394921781038f, - 0.9944256986736181f, - 0.9944118881299168f, - 0.9943980605472362f, - 0.9943842159258137f, - 0.9943703542658863f, - 0.9943564755676915f, - 0.994342579831467f, - 0.9943286670574512f, - 0.9943147372458823f, - 0.9943007903969989f, - 0.9942868265110402f, - 0.9942728455882452f, - 0.9942588476288537f, - 0.9942448326331055f, - 0.9942308006012406f, - 0.9942167515334995f, - 0.994202685430123f, - 0.9941886022913522f, - 0.9941745021174282f, - 0.9941603849085927f, - 0.9941462506650875f, - 0.9941320993871551f, - 0.9941179310750375f, - 0.9941037457289779f, - 0.9940895433492191f, - 0.9940753239360046f, - 0.9940610874895779f, - 0.9940468340101831f, - 0.9940325634980643f, - 0.9940182759534661f, - 0.9940039713766333f, - 0.993989649767811f, - 0.9939753111272446f, - 0.9939609554551797f, - 0.9939465827518624f, - 0.9939321930175389f, - 0.9939177862524559f, - 0.9939033624568601f, - 0.9938889216309986f, - 0.993874463775119f, - 0.993859988889469f, - 0.9938454969742966f, - 0.99383098802985f, - 0.9938164620563781f, - 0.9938019190541295f, - 0.9937873590233535f, - 0.9937727819642996f, - 0.9937581878772176f, - 0.9937435767623575f, - 0.9937289486199696f, - 0.9937143034503048f, - 0.9936996412536138f, - 0.9936849620301478f, - 0.9936702657801585f, - 0.9936555525038977f, - 0.9936408222016174f, - 0.9936260748735701f, - 0.9936113105200084f, - 0.9935965291411853f, - 0.9935817307373542f, - 0.9935669153087686f, - 0.9935520828556822f, - 0.9935372333783493f, - 0.9935223668770244f, - 0.993507483351962f, - 0.9934925828034176f, - 0.9934776652316458f, - 0.9934627306369029f, - 0.9934477790194444f, - 0.9934328103795266f, - 0.9934178247174059f, - 0.9934028220333393f, - 0.9933878023275837f, - 0.9933727656003964f, - 0.9933577118520353f, - 0.9933426410827579f, - 0.993327553292823f, - 0.9933124484824886f, - 0.9932973266520139f, - 0.9932821878016578f, - 0.9932670319316798f, - 0.9932518590423394f, - 0.9932366691338969f, - 0.9932214622066123f, - 0.9932062382607464f, - 0.9931909972965598f, - 0.9931757393143139f, - 0.99316046431427f, - 0.9931451722966897f, - 0.9931298632618354f, - 0.993114537209969f, - 0.9930991941413535f, - 0.9930838340562514f, - 0.9930684569549263f, - 0.9930530628376414f, - 0.9930376517046605f, - 0.9930222235562478f, - 0.9930067783926676f, - 0.9929913162141845f, - 0.9929758370210634f, - 0.9929603408135695f, - 0.9929448275919686f, - 0.9929292973565264f, - 0.9929137501075087f, - 0.9928981858451823f, - 0.9928826045698137f, - 0.9928670062816699f, - 0.9928513909810182f, - 0.9928357586681261f, - 0.9928201093432615f, - 0.9928044430066926f, - 0.9927887596586877f, - 0.9927730592995158f, - 0.9927573419294455f, - 0.9927416075487465f, - 0.9927258561576883f, - 0.9927100877565406f, - 0.9926943023455738f, - 0.9926784999250583f, - 0.992662680495265f, - 0.9926468440564647f, - 0.992630990608929f, - 0.9926151201529294f, - 0.992599232688738f, - 0.9925833282166268f, - 0.9925674067368683f, - 0.9925514682497356f, - 0.9925355127555016f, - 0.9925195402544398f, - 0.9925035507468237f, - 0.9924875442329275f, - 0.9924715207130254f, - 0.9924554801873918f, - 0.9924394226563017f, - 0.9924233481200302f, - 0.9924072565788528f, - 0.9923911480330452f, - 0.9923750224828832f, - 0.9923588799286435f, - 0.9923427203706023f, - 0.9923265438090368f, - 0.9923103502442241f, - 0.9922941396764415f, - 0.992277912105967f, - 0.9922616675330785f, - 0.9922454059580544f, - 0.9922291273811734f, - 0.9922128318027144f, - 0.9921965192229565f, - 0.9921801896421792f, - 0.9921638430606625f, - 0.9921474794786864f, - 0.9921310988965313f, - 0.9921147013144778f, - 0.992098286732807f, - 0.9920818551518f, - 0.9920654065717385f, - 0.9920489409929042f, - 0.9920324584155794f, - 0.9920159588400463f, - 0.991999442266588f, - 0.991982908695487f, - 0.9919663581270269f, - 0.9919497905614914f, - 0.9919332059991641f, - 0.9919166044403294f, - 0.9918999858852715f, - 0.9918833503342754f, - 0.991866697787626f, - 0.9918500282456089f, - 0.9918333417085092f, - 0.9918166381766135f, - 0.9917999176502074f, - 0.9917831801295777f, - 0.9917664256150112f, - 0.9917496541067949f, - 0.9917328656052162f, - 0.9917160601105628f, - 0.9916992376231227f, - 0.991682398143184f, - 0.9916655416710354f, - 0.9916486682069656f, - 0.9916317777512638f, - 0.9916148703042194f, - 0.9915979458661219f, - 0.9915810044372617f, - 0.9915640460179288f, - 0.991547070608414f, - 0.9915300782090077f, - 0.9915130688200017f, - 0.991496042441687f, - 0.9914789990743555f, - 0.9914619387182991f, - 0.9914448613738105f, - 0.9914277670411819f, - 0.9914106557207063f, - 0.991393527412677f, - 0.9913763821173874f, - 0.9913592198351313f, - 0.9913420405662029f, - 0.9913248443108964f, - 0.9913076310695066f, - 0.9912904008423282f, - 0.9912731536296567f, - 0.9912558894317876f, - 0.9912386082490164f, - 0.9912213100816396f, - 0.9912039949299535f, - 0.9911866627942546f, - 0.9911693136748401f, - 0.9911519475720071f, - 0.9911345644860533f, - 0.9911171644172765f, - 0.9910997473659748f, - 0.9910823133324467f, - 0.991064862316991f, - 0.9910473943199065f, - 0.9910299093414928f, - 0.9910124073820492f, - 0.9909948884418758f, - 0.9909773525212727f, - 0.9909597996205404f, - 0.9909422297399797f, - 0.9909246428798915f, - 0.9909070390405773f, - 0.9908894182223387f, - 0.9908717804254776f, - 0.9908541256502963f, - 0.9908364538970972f, - 0.9908187651661832f, - 0.9908010594578572f, - 0.9907833367724228f, - 0.9907655971101836f, - 0.9907478404714436f, - 0.990730066856507f, - 0.9907122762656784f, - 0.9906944686992625f, - 0.9906766441575646f, - 0.99065880264089f, - 0.9906409441495445f, - 0.990623068683834f, - 0.9906051762440649f, - 0.9905872668305437f, - 0.9905693404435773f, - 0.9905513970834728f, - 0.9905334367505378f, - 0.9905154594450799f, - 0.9904974651674073f, - 0.9904794539178282f, - 0.9904614256966512f, - 0.9904433805041853f, - 0.9904253183407397f, - 0.9904072392066238f, - 0.9903891431021473f, - 0.9903710300276206f, - 0.9903528999833537f, - 0.9903347529696576f, - 0.9903165889868428f, - 0.990298408035221f, - 0.9902802101151035f, - 0.990261995226802f, - 0.9902437633706288f, - 0.9902255145468963f, - 0.9902072487559171f, - 0.9901889659980042f, - 0.990170666273471f, - 0.9901523495826308f, - 0.9901340159257975f, - 0.9901156653032854f, - 0.990097297715409f, - 0.9900789131624829f, - 0.9900605116448219f, - 0.9900420931627417f, - 0.9900236577165575f, - 0.9900052053065856f, - 0.9899867359331419f, - 0.989968249596543f, - 0.9899497462971054f, - 0.9899312260351465f, - 0.9899126888109834f, - 0.9898941346249339f, - 0.9898755634773158f, - 0.9898569753684473f, - 0.989838370298647f, - 0.9898197482682336f, - 0.9898011092775263f, - 0.9897824533268442f, - 0.9897637804165074f, - 0.9897450905468355f, - 0.9897263837181489f, - 0.9897076599307681f, - 0.9896889191850139f, - 0.9896701614812076f, - 0.9896513868196702f, - 0.9896325952007238f, - 0.9896137866246902f, - 0.9895949610918917f, - 0.9895761186026509f, - 0.9895572591572908f, - 0.9895383827561343f, - 0.989519489399505f, - 0.9895005790877264f, - 0.9894816518211228f, - 0.9894627076000184f, - 0.9894437464247379f, - 0.9894247682956061f, - 0.9894057732129481f, - 0.9893867611770896f, - 0.9893677321883562f, - 0.989348686247074f, - 0.9893296233535692f, - 0.9893105435081687f, - 0.9892914467111994f, - 0.9892723329629883f, - 0.9892532022638632f, - 0.9892340546141516f, - 0.9892148900141817f, - 0.989195708464282f, - 0.989176509964781f, - 0.9891572945160078f, - 0.9891380621182916f, - 0.9891188127719618f, - 0.9890995464773485f, - 0.9890802632347816f, - 0.9890609630445917f, - 0.9890416459071093f, - 0.9890223118226656f, - 0.9890029607915917f, - 0.9889835928142193f, - 0.9889642078908802f, - 0.9889448060219067f, - 0.9889253872076309f, - 0.9889059514483859f, - 0.9888864987445046f, - 0.9888670290963203f, - 0.9888475425041665f, - 0.9888280389683773f, - 0.9888085184892869f, - 0.9887889810672295f, - 0.9887694267025401f, - 0.9887498553955536f, - 0.9887302671466056f, - 0.9887106619560315f, - 0.9886910398241674f, - 0.9886714007513494f, - 0.988651744737914f, - 0.9886320717841981f, - 0.9886123818905387f, - 0.9885926750572733f, - 0.9885729512847394f, - 0.9885532105732752f, - 0.9885334529232186f, - 0.9885136783349086f, - 0.9884938868086836f, - 0.9884740783448829f, - 0.9884542529438459f, - 0.9884344106059124f, - 0.9884145513314223f, - 0.9883946751207159f, - 0.9883747819741338f, - 0.9883548718920167f, - 0.988334944874706f, - 0.9883150009225429f, - 0.9882950400358694f, - 0.9882750622150273f, - 0.9882550674603591f, - 0.9882350557722072f, - 0.9882150271509146f, - 0.9881949815968246f, - 0.9881749191102804f, - 0.9881548396916261f, - 0.9881347433412055f, - 0.9881146300593631f, - 0.9880944998464434f, - 0.9880743527027914f, - 0.9880541886287523f, - 0.9880340076246716f, - 0.9880138096908951f, - 0.9879935948277689f, - 0.9879733630356394f, - 0.9879531143148532f, - 0.9879328486657575f, - 0.987912566088699f, - 0.9878922665840258f, - 0.9878719501520854f, - 0.9878516167932261f, - 0.9878312665077962f, - 0.9878108992961444f, - 0.9877905151586197f, - 0.9877701140955715f, - 0.9877496961073491f, - 0.9877292611943025f, - 0.987708809356782f, - 0.9876883405951377f, - 0.9876678549097206f, - 0.9876473523008817f, - 0.9876268327689722f, - 0.9876062963143437f, - 0.9875857429373482f, - 0.9875651726383379f, - 0.987544585417665f, - 0.9875239812756824f, - 0.9875033602127433f, - 0.9874827222292009f, - 0.9874620673254086f, - 0.9874413955017208f, - 0.9874207067584914f, - 0.987400001096075f, - 0.9873792785148262f, - 0.9873585390151004f, - 0.9873377825972526f, - 0.9873170092616388f, - 0.9872962190086146f, - 0.9872754118385366f, - 0.987254587751761f, - 0.9872337467486447f, - 0.987212888829545f, - 0.9871920139948192f, - 0.9871711222448248f, - 0.98715021357992f, - 0.9871292880004631f, - 0.9871083455068124f, - 0.9870873860993268f, - 0.9870664097783656f, - 0.9870454165442881f, - 0.9870244063974541f, - 0.9870033793382236f, - 0.9869823353669567f, - 0.9869612744840142f, - 0.9869401966897569f, - 0.9869191019845459f, - 0.9868979903687428f, - 0.9868768618427093f, - 0.9868557164068074f, - 0.9868345540613992f, - 0.9868133748068477f, - 0.9867921786435155f, - 0.986770965571766f, - 0.9867497355919627f, - 0.986728488704469f, - 0.9867072249096495f, - 0.986685944207868f, - 0.9866646465994896f, - 0.986643332084879f, - 0.9866220006644014f, - 0.9866006523384224f, - 0.9865792871073079f, - 0.9865579049714237f, - 0.9865365059311364f, - 0.9865150899868125f, - 0.9864936571388191f, - 0.9864722073875234f, - 0.9864507407332929f, - 0.9864292571764955f, - 0.9864077567174993f, - 0.9863862393566726f, - 0.9863647050943842f, - 0.9863431539310031f, - 0.9863215858668984f, - 0.98630000090244f, - 0.9862783990379974f, - 0.9862567802739409f, - 0.986235144610641f, - 0.9862134920484683f, - 0.9861918225877938f, - 0.9861701362289889f, - 0.9861484329724252f, - 0.9861267128184743f, - 0.9861049757675088f, - 0.9860832218199008f, - 0.9860614509760234f, - 0.9860396632362493f, - 0.9860178586009519f, - 0.985996037070505f, - 0.9859741986452824f, - 0.9859523433256581f, - 0.9859304711120068f, - 0.9859085820047033f, - 0.9858866760041226f, - 0.9858647531106401f, - 0.9858428133246314f, - 0.9858208566464725f, - 0.9857988830765393f, - 0.9857768926152087f, - 0.9857548852628574f, - 0.9857328610198625f, - 0.9857108198866013f, - 0.9856887618634514f, - 0.985666686950791f, - 0.985644595148998f, - 0.9856224864584513f, - 0.9856003608795295f, - 0.985578218412612f, - 0.9855560590580777f, - 0.9855338828163068f, - 0.9855116896876789f, - 0.9854894796725746f, - 0.9854672527713743f, - 0.9854450089844587f, - 0.9854227483122092f, - 0.9854004707550071f, - 0.9853781763132342f, - 0.9853558649872725f, - 0.9853335367775041f, - 0.9853111916843119f, - 0.9852888297080786f, - 0.9852664508491873f, - 0.9852440551080217f, - 0.9852216424849652f, - 0.9851992129804021f, - 0.9851767665947168f, - 0.9851543033282936f, - 0.9851318231815176f, - 0.9851093261547739f, - 0.9850868122484482f, - 0.9850642814629259f, - 0.9850417337985934f, - 0.9850191692558368f, - 0.984996587835043f, - 0.9849739895365986f, - 0.9849513743608911f, - 0.9849287423083078f, - 0.9849060933792367f, - 0.9848834275740658f, - 0.9848607448931833f, - 0.9848380453369782f, - 0.9848153289058391f, - 0.9847925956001554f, - 0.9847698454203168f, - 0.9847470783667127f, - 0.9847242944397336f, - 0.9847014936397698f, - 0.9846786759672118f, - 0.9846558414224508f, - 0.984632990005878f, - 0.9846101217178849f, - 0.9845872365588633f, - 0.9845643345292053f, - 0.9845414156293036f, - 0.9845184798595507f, - 0.9844955272203396f, - 0.9844725577120637f, - 0.9844495713351165f, - 0.9844265680898916f, - 0.9844035479767836f, - 0.9843805109961867f, - 0.9843574571484958f, - 0.9843343864341058f, - 0.9843112988534118f, - 0.9842881944068098f, - 0.9842650730946955f, - 0.984241934917465f, - 0.984218779875515f, - 0.984195607969242f, - 0.9841724191990431f, - 0.9841492135653158f, - 0.9841259910684574f, - 0.9841027517088663f, - 0.9840794954869402f, - 0.9840562224030779f, - 0.9840329324576781f, - 0.9840096256511397f, - 0.9839863019838624f, - 0.9839629614562455f, - 0.9839396040686892f, - 0.9839162298215935f, - 0.9838928387153592f, - 0.9838694307503867f, - 0.9838460059270775f, - 0.9838225642458326f, - 0.983799105707054f, - 0.9837756303111433f, - 0.9837521380585033f, - 0.9837286289495358f, - 0.9837051029846443f, - 0.9836815601642316f, - 0.9836580004887009f, - 0.9836344239584563f, - 0.9836108305739015f, - 0.983587220335441f, - 0.983563593243479f, - 0.9835399492984207f, - 0.983516288500671f, - 0.9834926108506354f, - 0.9834689163487197f, - 0.9834452049953296f, - 0.9834214767908719f, - 0.9833977317357526f, - 0.9833739698303791f, - 0.9833501910751581f, - 0.9833263954704974f, - 0.9833025830168044f, - 0.9832787537144875f, - 0.9832549075639546f, - 0.9832310445656146f, - 0.9832071647198762f, - 0.9831832680271487f, - 0.9831593544878416f, - 0.9831354241023644f, - 0.9831114768711275f, - 0.983087512794541f, - 0.9830635318730155f, - 0.983039534106962f, - 0.9830155194967917f, - 0.9829914880429159f, - 0.9829674397457466f, - 0.9829433746056958f, - 0.9829192926231759f, - 0.9828951937985994f, - 0.9828710781323792f, - 0.9828469456249287f, - 0.9828227962766612f, - 0.9827986300879908f, - 0.9827744470593314f, - 0.9827502471910973f, - 0.9827260304837031f, - 0.982701796937564f, - 0.982677546553095f, - 0.9826532793307118f, - 0.98262899527083f, - 0.982604694373866f, - 0.9825803766402359f, - 0.9825560420703565f, - 0.982531690664645f, - 0.9825073224235181f, - 0.9824829373473939f, - 0.9824585354366898f, - 0.9824341166918243f, - 0.9824096811132156f, - 0.9823852287012823f, - 0.9823607594564436f, - 0.9823362733791187f, - 0.9823117704697271f, - 0.9822872507286886f, - 0.9822627141564236f, - 0.9822381607533524f, - 0.9822135905198955f, - 0.9821890034564742f, - 0.9821643995635096f, - 0.9821397788414234f, - 0.9821151412906375f, - 0.9820904869115739f, - 0.9820658157046551f, - 0.9820411276703039f, - 0.9820164228089433f, - 0.9819917011209967f, - 0.9819669626068873f, - 0.9819422072670395f, - 0.9819174351018772f, - 0.981892646111825f, - 0.9818678402973076f, - 0.9818430176587499f, - 0.9818181781965774f, - 0.9817933219112157f, - 0.9817684488030907f, - 0.9817435588726284f, - 0.9817186521202556f, - 0.9816937285463989f, - 0.9816687881514853f, - 0.9816438309359423f, - 0.9816188569001975f, - 0.9815938660446787f, - 0.9815688583698141f, - 0.9815438338760325f, - 0.9815187925637624f, - 0.9814937344334329f, - 0.9814686594854736f, - 0.9814435677203137f, - 0.9814184591383837f, - 0.9813933337401133f, - 0.9813681915259334f, - 0.9813430324962745f, - 0.981317856651568f, - 0.9812926639922452f, - 0.9812674545187375f, - 0.9812422282314773f, - 0.9812169851308965f, - 0.9811917252174278f, - 0.9811664484915039f, - 0.981141154953558f, - 0.9811158446040236f, - 0.9810905174433341f, - 0.9810651734719237f, - 0.9810398126902266f, - 0.9810144350986774f, - 0.9809890406977108f, - 0.980963629487762f, - 0.9809382014692665f, - 0.9809127566426599f, - 0.9808872950083781f, - 0.9808618165668577f, - 0.9808363213185349f, - 0.9808108092638469f, - 0.9807852804032304f, - 0.9807597347371233f, - 0.980734172265963f, - 0.9807085929901876f, - 0.9806829969102356f, - 0.9806573840265452f, - 0.9806317543395556f, - 0.9806061078497057f, - 0.9805804445574352f, - 0.9805547644631836f, - 0.980529067567391f, - 0.9805033538704978f, - 0.9804776233729444f, - 0.9804518760751719f, - 0.9804261119776214f, - 0.9804003310807343f, - 0.9803745333849524f, - 0.9803487188907178f, - 0.9803228875984726f, - 0.9802970395086598f, - 0.9802711746217219f, - 0.9802452929381023f, - 0.9802193944582444f, - 0.980193479182592f, - 0.9801675471115892f, - 0.9801415982456801f, - 0.9801156325853096f, - 0.9800896501309226f, - 0.9800636508829642f, - 0.9800376348418799f, - 0.9800116020081155f, - 0.9799855523821172f, - 0.979959485964331f, - 0.9799334027552039f, - 0.9799073027551827f, - 0.9798811859647144f, - 0.9798550523842469f, - 0.9798289020142277f, - 0.9798027348551049f, - 0.9797765509073272f, - 0.9797503501713428f, - 0.9797241326476009f, - 0.9796978983365506f, - 0.9796716472386416f, - 0.9796453793543235f, - 0.9796190946840466f, - 0.9795927932282611f, - 0.9795664749874177f, - 0.9795401399619674f, - 0.9795137881523615f, - 0.9794874195590514f, - 0.979461034182489f, - 0.9794346320231264f, - 0.979408213081416f, - 0.9793817773578104f, - 0.9793553248527628f, - 0.9793288555667261f, - 0.9793023695001541f, - 0.9792758666535006f, - 0.9792493470272198f, - 0.9792228106217659f, - 0.9791962574375935f, - 0.979169687475158f, - 0.9791431007349144f, - 0.9791164972173182f, - 0.9790898769228255f, - 0.979063239851892f, - 0.9790365860049747f, - 0.9790099153825298f, - 0.9789832279850146f, - 0.9789565238128862f, - 0.9789298028666022f, - 0.9789030651466206f, - 0.9788763106533994f, - 0.9788495393873972f, - 0.9788227513490724f, - 0.9787959465388842f, - 0.978769124957292f, - 0.9787422866047553f, - 0.9787154314817338f, - 0.9786885595886878f, - 0.9786616709260778f, - 0.9786347654943645f, - 0.9786078432940089f, - 0.9785809043254722f, - 0.9785539485892161f, - 0.9785269760857024f, - 0.9784999868153934f, - 0.9784729807787513f, - 0.9784459579762393f, - 0.97841891840832f, - 0.9783918620754569f, - 0.9783647889781135f, - 0.978337699116754f, - 0.978310592491842f, - 0.9782834691038426f, - 0.97825632895322f, - 0.9782291720404396f, - 0.9782019983659667f, - 0.9781748079302667f, - 0.9781476007338057f, - 0.9781203767770498f, - 0.9780931360604654f, - 0.9780658785845194f, - 0.9780386043496789f, - 0.9780113133564111f, - 0.9779840056051837f, - 0.9779566810964645f, - 0.9779293398307218f, - 0.9779019818084241f, - 0.97787460703004f, - 0.9778472154960389f, - 0.9778198072068898f, - 0.9777923821630625f, - 0.9777649403650269f, - 0.9777374818132533f, - 0.9777100065082119f, - 0.9776825144503739f, - 0.97765500564021f, - 0.9776274800781918f, - 0.9775999377647907f, - 0.9775723787004789f, - 0.9775448028857284f, - 0.9775172103210118f, - 0.977489601006802f, - 0.9774619749435719f, - 0.977434332131795f, - 0.9774066725719447f, - 0.9773789962644953f, - 0.9773513032099207f, - 0.9773235934086958f, - 0.9772958668612949f, - 0.9772681235681935f, - 0.9772403635298668f, - 0.9772125867467903f, - 0.9771847932194404f, - 0.9771569829482929f, - 0.9771291559338247f, - 0.9771013121765122f, - 0.9770734516768327f, - 0.9770455744352636f, - 0.9770176804522827f, - 0.9769897697283676f, - 0.9769618422639967f, - 0.9769338980596487f, - 0.9769059371158023f, - 0.9768779594329365f, - 0.9768499650115308f, - 0.9768219538520649f, - 0.9767939259550187f, - 0.9767658813208725f, - 0.9767378199501067f, - 0.9767097418432024f, - 0.9766816470006403f, - 0.9766535354229023f, - 0.9766254071104696f, - 0.9765972620638246f, - 0.9765691002834492f, - 0.9765409217698262f, - 0.9765127265234383f, - 0.9764845145447687f, - 0.9764562858343007f, - 0.976428040392518f, - 0.9763997782199046f, - 0.9763714993169449f, - 0.9763432036841233f, - 0.9763148913219246f, - 0.9762865622308341f, - 0.976258216411337f, - 0.9762298538639193f, - 0.9762014745890666f, - 0.9761730785872653f, - 0.9761446658590023f, - 0.976116236404764f, - 0.9760877902250377f, - 0.9760593273203108f, - 0.9760308476910711f, - 0.9760023513378064f, - 0.9759738382610053f, - 0.9759453084611559f, - 0.9759167619387474f, - 0.9758881986942688f, - 0.9758596187282097f, - 0.9758310220410595f, - 0.9758024086333085f, - 0.9757737785054468f, - 0.9757451316579651f, - 0.975716468091354f, - 0.975687787806105f, - 0.9756590908027093f, - 0.9756303770816586f, - 0.9756016466434451f, - 0.9755728994885607f, - 0.9755441356174985f, - 0.9755153550307509f, - 0.9754865577288113f, - 0.9754577437121731f, - 0.9754289129813299f, - 0.975400065536776f, - 0.9753712013790053f, - 0.9753423205085128f, - 0.9753134229257928f, - 0.9752845086313411f, - 0.9752555776256526f, - 0.9752266299092235f, - 0.9751976654825494f, - 0.9751686843461267f, - 0.9751396865004521f, - 0.9751106719460225f, - 0.975081640683335f, - 0.9750525927128869f, - 0.9750235280351761f, - 0.9749944466507005f, - 0.9749653485599585f, - 0.9749362337634486f, - 0.9749071022616699f, - 0.9748779540551212f, - 0.9748487891443023f, - 0.9748196075297126f, - 0.9747904092118523f, - 0.9747611941912218f, - 0.9747319624683215f, - 0.9747027140436524f, - 0.9746734489177156f, - 0.9746441670910125f, - 0.974614868564045f, - 0.974585553337315f, - 0.9745562214113248f, - 0.9745268727865772f, - 0.9744975074635748f, - 0.9744681254428208f, - 0.9744387267248189f, - 0.9744093113100725f, - 0.974379879199086f, - 0.9743504303923632f, - 0.9743209648904093f, - 0.9742914826937288f, - 0.974261983802827f, - 0.9742324682182092f, - 0.9742029359403814f, - 0.9741733869698493f, - 0.9741438213071196f, - 0.9741142389526986f, - 0.9740846399070932f, - 0.9740550241708108f, - 0.9740253917443586f, - 0.9739957426282445f, - 0.9739660768229765f, - 0.973936394329063f, - 0.9739066951470123f, - 0.9738769792773336f, - 0.973847246720536f, - 0.9738174974771289f, - 0.9737877315476221f, - 0.9737579489325255f, - 0.9737281496323495f, - 0.9736983336476048f, - 0.9736685009788023f, - 0.9736386516264529f, - 0.9736087855910683f, - 0.9735789028731603f, - 0.9735490034732407f, - 0.973519087391822f, - 0.9734891546294168f, - 0.9734592051865377f, - 0.9734292390636984f, - 0.9733992562614119f, - 0.973369256780192f, - 0.9733392406205531f, - 0.9733092077830092f, - 0.973279158268075f, - 0.9732490920762653f, - 0.9732190092080953f, - 0.9731889096640807f, - 0.9731587934447369f, - 0.9731286605505801f, - 0.9730985109821266f, - 0.973068344739893f, - 0.9730381618243963f, - 0.9730079622361534f, - 0.972977745975682f, - 0.9729475130434998f, - 0.9729172634401249f, - 0.9728869971660754f, - 0.97285671422187f, - 0.9728264146080279f, - 0.9727960983250677f, - 0.9727657653735095f, - 0.9727354157538723f, - 0.9727050494666769f, - 0.972674666512443f, - 0.9726442668916917f, - 0.9726138506049435f, - 0.9725834176527198f, - 0.972552968035542f, - 0.9725225017539318f, - 0.9724920188084114f, - 0.9724615191995027f, - 0.9724310029277289f, - 0.9724004699936124f, - 0.9723699203976767f, - 0.9723393541404449f, - 0.9723087712224412f, - 0.9722781716441892f, - 0.9722475554062133f, - 0.9722169225090385f, - 0.9721862729531892f, - 0.9721556067391908f, - 0.9721249238675687f, - 0.9720942243388487f, - 0.9720635081535567f, - 0.9720327753122192f, - 0.9720020258153627f, - 0.971971259663514f, - 0.9719404768572004f, - 0.9719096773969493f, - 0.9718788612832886f, - 0.971848028516746f, - 0.97181717909785f, - 0.9717863130271293f, - 0.9717554303051126f, - 0.971724530932329f, - 0.9716936149093083f, - 0.9716626822365799f, - 0.971631732914674f, - 0.9716007669441208f, - 0.971569784325451f, - 0.9715387850591953f, - 0.9715077691458851f, - 0.9714767365860517f, - 0.971445687380227f, - 0.9714146215289428f, - 0.9713835390327314f, - 0.9713524398921256f, - 0.9713213241076581f, - 0.9712901916798623f, - 0.9712590426092713f, - 0.9712278768964191f, - 0.9711966945418395f, - 0.9711654955460669f, - 0.9711342799096361f, - 0.9711030476330816f, - 0.9710717987169388f, - 0.9710405331617431f, - 0.9710092509680303f, - 0.9709779521363361f, - 0.9709466366671972f, - 0.9709153045611497f, - 0.9708839558187311f, - 0.970852590440478f, - 0.9708212084269281f, - 0.9707898097786191f, - 0.9707583944960889f, - 0.970726962579876f, - 0.9706955140305187f, - 0.9706640488485562f, - 0.9706325670345273f, - 0.9706010685889717f, - 0.9705695535124289f, - 0.9705380218054391f, - 0.9705064734685425f, - 0.9704749085022796f, - 0.9704433269071914f, - 0.9704117286838189f, - 0.9703801138327036f, - 0.9703484823543873f, - 0.9703168342494118f, - 0.9702851695183196f, - 0.9702534881616531f, - 0.9702217901799551f, - 0.970190075573769f, - 0.970158344343638f, - 0.9701265964901059f, - 0.9700948320137166f, - 0.9700630509150144f, - 0.970031253194544f, - 0.96999943885285f, - 0.9699676078904779f, - 0.9699357603079727f, - 0.9699038961058803f, - 0.9698720152847468f, - 0.9698401178451183f, - 0.9698082037875413f, - 0.9697762731125628f, - 0.9697443258207299f, - 0.9697123619125899f, - 0.9696803813886905f, - 0.9696483842495799f, - 0.9696163704958061f, - 0.9695843401279176f, - 0.9695522931464635f, - 0.9695202295519928f, - 0.969488149345055f, - 0.9694560525261995f, - 0.9694239390959766f, - 0.9693918090549363f, - 0.9693596624036294f, - 0.9693274991426063f, - 0.9692953192724186f, - 0.9692631227936174f, - 0.9692309097067544f, - 0.9691986800123816f, - 0.9691664337110514f, - 0.9691341708033161f, - 0.9691018912897286f, - 0.969069595170842f, - 0.9690372824472097f, - 0.9690049531193854f, - 0.968972607187923f, - 0.9689402446533768f, - 0.9689078655163011f, - 0.9688754697772511f, - 0.9688430574367816f, - 0.9688106284954479f, - 0.968778182953806f, - 0.9687457208124116f, - 0.9687132420718211f, - 0.9686807467325907f, - 0.9686482347952776f, - 0.9686157062604386f, - 0.9685831611286312f, - 0.9685505994004129f, - 0.9685180210763419f, - 0.9684854261569761f, - 0.9684528146428742f, - 0.968420186534595f, - 0.9683875418326976f, - 0.9683548805377413f, - 0.9683222026502856f, - 0.9682895081708907f, - 0.9682567971001166f, - 0.9682240694385239f, - 0.9681913251866732f, - 0.9681585643451259f, - 0.9681257869144431f, - 0.9680929928951865f, - 0.9680601822879179f, - 0.9680273550931996f, - 0.9679945113115943f, - 0.9679616509436644f, - 0.9679287739899732f, - 0.9678958804510839f, - 0.9678629703275603f, - 0.9678300436199659f, - 0.9677971003288655f, - 0.9677641404548231f, - 0.9677311639984036f, - 0.9676981709601721f, - 0.9676651613406938f, - 0.9676321351405345f, - 0.9675990923602598f, - 0.9675660330004362f, - 0.9675329570616299f, - 0.967499864544408f, - 0.967466755449337f, - 0.9674336297769848f, - 0.9674004875279185f, - 0.9673673287027064f, - 0.9673341533019163f, - 0.967300961326117f, - 0.9672677527758768f, - 0.9672345276517651f, - 0.9672012859543511f, - 0.9671680276842043f, - 0.9671347528418948f, - 0.9671014614279925f, - 0.9670681534430678f, - 0.9670348288876918f, - 0.9670014877624351f, - 0.9669681300678692f, - 0.9669347558045656f, - 0.9669013649730962f, - 0.9668679575740331f, - 0.9668345336079488f, - 0.966801093075416f, - 0.9667676359770077f, - 0.9667341623132969f, - 0.9667006720848577f, - 0.9666671652922634f, - 0.9666336419360886f, - 0.9666001020169073f, - 0.9665665455352945f, - 0.966532972491825f, - 0.9664993828870743f, - 0.9664657767216176f, - 0.966432153996031f, - 0.9663985147108906f, - 0.9663648588667726f, - 0.9663311864642539f, - 0.9662974975039114f, - 0.9662637919863222f, - 0.9662300699120641f, - 0.9661963312817148f, - 0.9661625760958523f, - 0.9661288043550552f, - 0.9660950160599019f, - 0.9660612112109715f, - 0.9660273898088434f, - 0.9659935518540969f, - 0.9659596973473118f, - 0.9659258262890683f, - 0.9658919386799467f, - 0.9658580345205277f, - 0.9658241138113922f, - 0.9657901765531214f, - 0.965756222746297f, - 0.9657222523915004f, - 0.9656882654893142f, - 0.9656542620403201f, - 0.9656202420451013f, - 0.9655862055042406f, - 0.965552152418321f, - 0.9655180827879263f, - 0.9654839966136399f, - 0.9654498938960462f, - 0.9654157746357293f, - 0.965381638833274f, - 0.9653474864892649f, - 0.9653133176042877f, - 0.9652791321789275f, - 0.9652449302137701f, - 0.9652107117094016f, - 0.9651764766664083f, - 0.965142225085377f, - 0.9651079569668941f, - 0.9650736723115474f, - 0.9650393711199239f, - 0.9650050533926116f, - 0.9649707191301983f, - 0.9649363683332725f, - 0.9649020010024226f, - 0.9648676171382378f, - 0.9648332167413068f, - 0.9647987998122194f, - 0.9647643663515653f, - 0.9647299163599343f, - 0.964695449837917f, - 0.9646609667861036f, - 0.9646264672050853f, - 0.9645919510954529f, - 0.9645574184577982f, - 0.9645228692927126f, - 0.9644883036007883f, - 0.9644537213826173f, - 0.9644191226387926f, - 0.9643845073699066f, - 0.9643498755765526f, - 0.9643152272593242f, - 0.9642805624188147f, - 0.9642458810556184f, - 0.9642111831703293f, - 0.9641764687635422f, - 0.9641417378358517f, - 0.9641069903878531f, - 0.9640722264201416f, - 0.964037445933313f, - 0.9640026489279632f, - 0.9639678354046883f, - 0.9639330053640852f, - 0.9638981588067503f, - 0.963863295733281f, - 0.9638284161442744f, - 0.9637935200403285f, - 0.9637586074220408f, - 0.9637236782900097f, - 0.9636887326448338f, - 0.9636537704871119f, - 0.9636187918174429f, - 0.9635837966364263f, - 0.9635487849446616f, - 0.9635137567427488f, - 0.9634787120312881f, - 0.9634436508108799f, - 0.9634085730821251f, - 0.9633734788456246f, - 0.9633383681019799f, - 0.9633032408517925f, - 0.9632680970956643f, - 0.9632329368341975f, - 0.9631977600679945f, - 0.9631625667976582f, - 0.9631273570237914f, - 0.9630921307469977f, - 0.9630568879678804f, - 0.9630216286870436f, - 0.9629863529050913f, - 0.962951060622628f, - 0.9629157518402583f, - 0.9628804265585876f, - 0.9628450847782208f, - 0.9628097264997637f, - 0.9627743517238219f, - 0.9627389604510017f, - 0.9627035526819095f, - 0.9626681284171521f, - 0.9626326876573363f, - 0.9625972304030695f, - 0.9625617566549592f, - 0.9625262664136134f, - 0.9624907596796399f, - 0.9624552364536473f, - 0.9624196967362443f, - 0.9623841405280397f, - 0.962348567829643f, - 0.9623129786416634f, - 0.9622773729647108f, - 0.9622417507993957f, - 0.9622061121463279f, - 0.9621704570061186f, - 0.9621347853793781f, - 0.9620990972667183f, - 0.9620633926687502f, - 0.9620276715860859f, - 0.9619919340193372f, - 0.9619561799691169f, - 0.961920409436037f, - 0.9618846224207109f, - 0.9618488189237516f, - 0.9618129989457728f, - 0.961777162487388f, - 0.9617413095492113f, - 0.9617054401318572f, - 0.9616695542359401f, - 0.9616336518620752f, - 0.9615977330108773f, - 0.961561797682962f, - 0.9615258458789451f, - 0.9614898775994427f, - 0.9614538928450709f, - 0.9614178916164464f, - 0.9613818739141861f, - 0.961345839738907f, - 0.9613097890912268f, - 0.961273721971763f, - 0.9612376383811337f, - 0.9612015383199571f, - 0.961165421788852f, - 0.9611292887884368f, - 0.9610931393193312f, - 0.961056973382154f, - 0.9610207909775255f, - 0.9609845921060651f, - 0.9609483767683935f, - 0.9609121449651311f, - 0.9608758966968985f, - 0.9608396319643173f, - 0.9608033507680084f, - 0.9607670531085937f, - 0.960730738986695f, - 0.9606944084029349f, - 0.9606580613579353f, - 0.9606216978523197f, - 0.9605853178867105f, - 0.9605489214617317f, - 0.9605125085780064f, - 0.9604760792361587f, - 0.9604396334368132f, - 0.9604031711805938f, - 0.9603666924681257f, - 0.9603301973000336f, - 0.9602936856769431f, - 0.9602571575994797f, - 0.9602206130682693f, - 0.9601840520839382f, - 0.9601474746471128f, - 0.9601108807584198f, - 0.960074270418486f, - 0.9600376436279393f, - 0.9600010003874067f, - 0.9599643406975165f, - 0.9599276645588964f, - 0.9598909719721753f, - 0.9598542629379817f, - 0.9598175374569446f, - 0.9597807955296933f, - 0.9597440371568575f, - 0.9597072623390667f, - 0.9596704710769514f, - 0.9596336633711416f, - 0.9595968392222685f, - 0.9595599986309626f, - 0.9595231415978555f, - 0.9594862681235786f, - 0.9594493782087636f, - 0.9594124718540429f, - 0.9593755490600485f, - 0.9593386098274134f, - 0.9593016541567703f, - 0.9592646820487525f, - 0.9592276935039936f, - 0.9591906885231273f, - 0.9591536671067877f, - 0.959116629255609f, - 0.9590795749702262f, - 0.9590425042512738f, - 0.9590054170993874f, - 0.9589683135152021f, - 0.9589311934993539f, - 0.9588940570524787f, - 0.9588569041752129f, - 0.958819734868193f, - 0.9587825491320562f, - 0.9587453469674393f, - 0.9587081283749799f, - 0.9586708933553157f, - 0.9586336419090848f, - 0.9585963740369254f, - 0.9585590897394762f, - 0.958521789017376f, - 0.9584844718712637f, - 0.9584471383017791f, - 0.9584097883095616f, - 0.9583724218952514f, - 0.9583350390594885f, - 0.9582976398029137f, - 0.9582602241261677f, - 0.9582227920298917f, - 0.9581853435147271f, - 0.9581478785813153f, - 0.9581103972302988f, - 0.9580728994623191f, - 0.9580353852780193f, - 0.957997854678042f, - 0.9579603076630303f, - 0.9579227442336274f, - 0.9578851643904772f, - 0.9578475681342234f, - 0.9578099554655104f, - 0.9577723263849826f, - 0.9577346808932846f, - 0.9576970189910616f, - 0.957659340678959f, - 0.9576216459576223f, - 0.9575839348276973f, - 0.9575462072898304f, - 0.9575084633446679f, - 0.9574707029928566f, - 0.9574329262350434f, - 0.9573951330718756f, - 0.957357323504001f, - 0.9573194975320672f, - 0.9572816551567226f, - 0.9572437963786152f, - 0.9572059211983942f, - 0.9571680296167082f, - 0.9571301216342067f, - 0.957092197251539f, - 0.9570542564693554f, - 0.9570162992883053f, - 0.9569783257090397f, - 0.9569403357322089f, - 0.956902329358464f, - 0.9568643065884562f, - 0.956826267422837f, - 0.9567882118622583f, - 0.9567501399073719f, - 0.9567120515588305f, - 0.9566739468172865f, - 0.9566358256833929f, - 0.9565976881578028f, - 0.9565595342411699f, - 0.9565213639341477f, - 0.9564831772373904f, - 0.956444974151552f, - 0.9564067546772876f, - 0.9563685188152519f, - 0.9563302665660999f, - 0.9562919979304872f, - 0.9562537129090694f, - 0.9562154115025027f, - 0.9561770937114431f, - 0.9561387595365474f, - 0.9561004089784724f, - 0.9560620420378751f, - 0.9560236587154131f, - 0.9559852590117439f, - 0.9559468429275256f, - 0.9559084104634163f, - 0.9558699616200749f, - 0.9558314963981597f, - 0.9557930147983302f, - 0.9557545168212455f, - 0.9557160024675654f, - 0.9556774717379497f, - 0.9556389246330589f, - 0.9556003611535532f, - 0.9555617813000935f, - 0.9555231850733408f, - 0.9554845724739564f, - 0.9554459435026021f, - 0.9554072981599396f, - 0.9553686364466313f, - 0.9553299583633394f, - 0.9552912639107268f, - 0.9552525530894564f, - 0.9552138259001918f, - 0.9551750823435962f, - 0.9551363224203335f, - 0.9550975461310681f, - 0.9550587534764642f, - 0.9550199444571866f, - 0.9549811190739003f, - 0.9549422773272706f, - 0.9549034192179627f, - 0.9548645447466431f, - 0.9548256539139771f, - 0.9547867467206317f, - 0.9547478231672732f, - 0.9547088832545688f, - 0.9546699269831855f, - 0.9546309543537911f, - 0.954591965367053f, - 0.9545529600236397f, - 0.954513938324219f, - 0.9544749002694601f, - 0.9544358458600316f, - 0.9543967750966027f, - 0.9543576879798429f, - 0.9543185845104218f, - 0.9542794646890099f, - 0.9542403285162769f, - 0.9542011759928939f, - 0.9541620071195313f, - 0.9541228218968605f, - 0.954083620325553f, - 0.9540444024062804f, - 0.9540051681397148f, - 0.9539659175265283f, - 0.9539266505673936f, - 0.9538873672629833f, - 0.9538480676139709f, - 0.9538087516210293f, - 0.9537694192848326f, - 0.9537300706060545f, - 0.9536907055853694f, - 0.9536513242234516f, - 0.9536119265209759f, - 0.9535725124786176f, - 0.953533082097052f, - 0.9534936353769546f, - 0.9534541723190012f, - 0.9534146929238684f, - 0.9533751971922322f, - 0.9533356851247697f, - 0.9532961567221576f, - 0.9532566119850736f, - 0.953217050914195f, - 0.9531774735101997f, - 0.953137879773766f, - 0.9530982697055721f, - 0.9530586433062971f, - 0.9530190005766195f, - 0.9529793415172189f, - 0.9529396661287746f, - 0.9528999744119667f, - 0.9528602663674751f, - 0.9528205419959803f, - 0.9527808012981629f, - 0.952741044274704f, - 0.9527012709262846f, - 0.9526614812535863f, - 0.9526216752572909f, - 0.9525818529380804f, - 0.9525420142966373f, - 0.9525021593336441f, - 0.9524622880497837f, - 0.9524224004457393f, - 0.9523824965221945f, - 0.9523425762798328f, - 0.9523026397193384f, - 0.9522626868413955f, - 0.9522227176466886f, - 0.9521827321359029f, - 0.9521427303097232f, - 0.9521027121688351f, - 0.9520626777139242f, - 0.9520226269456766f, - 0.9519825598647784f, - 0.9519424764719164f, - 0.9519023767677771f, - 0.9518622607530478f, - 0.9518221284284158f, - 0.9517819797945688f, - 0.9517418148521947f, - 0.9517016336019816f, - 0.9516614360446183f, - 0.9516212221807933f, - 0.9515809920111957f, - 0.9515407455365149f, - 0.9515004827574407f, - 0.9514602036746626f, - 0.951419908288871f, - 0.9513795966007562f, - 0.9513392686110093f, - 0.9512989243203208f, - 0.9512585637293823f, - 0.9512181868388854f, - 0.9511777936495216f, - 0.9511373841619836f, - 0.9510969583769633f, - 0.9510565162951536f, - 0.9510160579172474f, - 0.950975583243938f, - 0.950935092275919f, - 0.950894585013884f, - 0.9508540614585271f, - 0.9508135216105429f, - 0.9507729654706258f, - 0.9507323930394708f, - 0.9506918043177731f, - 0.9506511993062281f, - 0.9506105780055318f, - 0.95056994041638f, - 0.9505292865394691f, - 0.9504886163754955f, - 0.9504479299251565f, - 0.9504072271891487f, - 0.9503665081681701f, - 0.950325772862918f, - 0.9502850212740906f, - 0.9502442534023859f, - 0.9502034692485029f, - 0.9501626688131399f, - 0.9501218520969965f, - 0.9500810191007717f, - 0.9500401698251654f, - 0.9499993042708774f, - 0.9499584224386081f, - 0.9499175243290577f, - 0.9498766099429272f, - 0.9498356792809177f, - 0.9497947323437304f, - 0.9497537691320668f, - 0.9497127896466292f, - 0.9496717938881193f, - 0.94963078185724f, - 0.9495897535546937f, - 0.9495487089811835f, - 0.9495076481374126f, - 0.9494665710240849f, - 0.9494254776419039f, - 0.9493843679915739f, - 0.949343242073799f, - 0.9493020998892844f, - 0.9492609414387346f, - 0.9492197667228551f, - 0.9491785757423514f, - 0.9491373684979292f, - 0.9490961449902947f, - 0.9490549052201539f, - 0.949013649188214f, - 0.9489723768951814f, - 0.9489310883417637f, - 0.9488897835286679f, - 0.9488484624566021f, - 0.9488071251262743f, - 0.9487657715383927f, - 0.948724401693666f, - 0.9486830155928029f, - 0.9486416132365126f, - 0.9486001946255046f, - 0.9485587597604886f, - 0.9485173086421744f, - 0.9484758412712725f, - 0.9484343576484932f, - 0.9483928577745475f, - 0.9483513416501462f, - 0.9483098092760012f, - 0.9482682606528235f, - 0.9482266957813255f, - 0.9481851146622192f, - 0.948143517296217f, - 0.948101903684032f, - 0.9480602738263769f, - 0.9480186277239653f, - 0.9479769653775104f, - 0.9479352867877265f, - 0.9478935919553274f, - 0.9478518808810278f, - 0.9478101535655422f, - 0.9477684100095857f, - 0.9477266502138736f, - 0.9476848741791213f, - 0.9476430819060448f, - 0.94760127339536f, - 0.9475594486477835f, - 0.9475176076640318f, - 0.9474757504448219f, - 0.947433876990871f, - 0.9473919873028965f, - 0.9473500813816164f, - 0.9473081592277485f, - 0.9472662208420112f, - 0.947224266225123f, - 0.9471822953778031f, - 0.9471403083007703f, - 0.9470983049947443f, - 0.9470562854604446f, - 0.9470142496985915f, - 0.9469721977099049f, - 0.9469301294951057f, - 0.9468880450549144f, - 0.9468459443900524f, - 0.9468038275012408f, - 0.9467616943892015f, - 0.9467195450546563f, - 0.9466773794983274f, - 0.9466351977209375f, - 0.9465929997232092f, - 0.9465507855058656f, - 0.9465085550696299f, - 0.9464663084152259f, - 0.9464240455433774f, - 0.9463817664548085f, - 0.9463394711502439f, - 0.946297159630408f, - 0.9462548318960259f, - 0.9462124879478228f, - 0.9461701277865245f, - 0.9461277514128565f, - 0.9460853588275454f, - 0.946042950031317f, - 0.9460005250248984f, - 0.9459580838090162f, - 0.945915626384398f, - 0.945873152751771f, - 0.9458306629118631f, - 0.9457881568654022f, - 0.9457456346131169f, - 0.9457030961557354f, - 0.9456605414939872f, - 0.9456179706286009f, - 0.9455753835603061f, - 0.9455327802898327f, - 0.9454901608179105f, - 0.9454475251452698f, - 0.9454048732726411f, - 0.9453622052007555f, - 0.9453195209303438f, - 0.9452768204621376f, - 0.9452341037968682f, - 0.945191370935268f, - 0.945148621878069f, - 0.9451058566260037f, - 0.9450630751798049f, - 0.9450202775402055f, - 0.9449774637079391f, - 0.9449346336837391f, - 0.9448917874683395f, - 0.9448489250624742f, - 0.944806046466878f, - 0.9447631516822854f, - 0.9447202407094315f, - 0.9446773135490514f, - 0.9446343702018808f, - 0.9445914106686555f, - 0.9445484349501115f, - 0.9445054430469854f, - 0.9444624349600135f, - 0.9444194106899331f, - 0.9443763702374811f, - 0.9443333136033952f, - 0.9442902407884131f, - 0.9442471517932729f, - 0.9442040466187127f, - 0.9441609252654712f, - 0.9441177877342876f, - 0.9440746340259004f, - 0.9440314641410498f, - 0.9439882780804748f, - 0.9439450758449159f, - 0.943901857435113f, - 0.9438586228518069f, - 0.9438153720957381f, - 0.9437721051676481f, - 0.9437288220682779f, - 0.9436855227983694f, - 0.9436422073586643f, - 0.943598875749905f, - 0.9435555279728338f, - 0.9435121640281936f, - 0.9434687839167274f, - 0.9434253876391784f, - 0.9433819751962904f, - 0.9433385465888069f, - 0.9432951018174724f, - 0.9432516408830312f, - 0.943208163786228f, - 0.9431646705278075f, - 0.9431211611085153f, - 0.9430776355290968f, - 0.9430340937902978f, - 0.9429905358928645f, - 0.9429469618375429f, - 0.9429033716250801f, - 0.9428597652562226f, - 0.9428161427317179f, - 0.9427725040523132f, - 0.9427288492187563f, - 0.9426851782317953f, - 0.9426414910921784f, - 0.9425977878006543f, - 0.9425540683579716f, - 0.9425103327648798f, - 0.942466581022128f, - 0.9424228131304659f, - 0.9423790290906435f, - 0.9423352289034111f, - 0.9422914125695191f, - 0.9422475800897184f, - 0.9422037314647598f, - 0.942159866695395f, - 0.9421159857823752f, - 0.9420720887264526f, - 0.9420281755283794f, - 0.9419842461889077f, - 0.9419403007087906f, - 0.9418963390887809f, - 0.9418523613296319f, - 0.9418083674320971f, - 0.9417643573969303f, - 0.9417203312248857f, - 0.9416762889167177f, - 0.9416322304731809f, - 0.9415881558950303f, - 0.9415440651830208f, - 0.9414999583379082f, - 0.9414558353604483f, - 0.9414116962513968f, - 0.9413675410115104f, - 0.9413233696415454f, - 0.9412791821422588f, - 0.9412349785144076f, - 0.9411907587587496f, - 0.941146522876042f, - 0.9411022708670431f, - 0.941058002732511f, - 0.9410137184732043f, - 0.9409694180898815f, - 0.9409251015833022f, - 0.9408807689542255f, - 0.940836420203411f, - 0.9407920553316185f, - 0.9407476743396084f, - 0.9407032772281411f, - 0.940658863997977f, - 0.9406144346498778f, - 0.9405699891846041f, - 0.9405255276029179f, - 0.9404810499055807f, - 0.9404365560933549f, - 0.9403920461670028f, - 0.940347520127287f, - 0.9403029779749705f, - 0.9402584197108165f, - 0.9402138453355885f, - 0.9401692548500502f, - 0.9401246482549659f, - 0.9400800255510996f, - 0.9400353867392162f, - 0.9399907318200801f, - 0.9399460607944571f, - 0.939901373663112f, - 0.9398566704268109f, - 0.9398119510863197f, - 0.9397672156424046f, - 0.9397224640958322f, - 0.9396776964473691f, - 0.9396329126977827f, - 0.93958811284784f, - 0.9395432968983092f, - 0.9394984648499575f, - 0.9394536167035535f, - 0.9394087524598655f, - 0.9393638721196624f, - 0.9393189756837133f, - 0.939274063152787f, - 0.9392291345276537f, - 0.9391841898090827f, - 0.9391392289978444f, - 0.9390942520947091f, - 0.9390492591004476f, - 0.9390042500158307f, - 0.9389592248416296f, - 0.9389141835786159f, - 0.9388691262275614f, - 0.938824052789238f, - 0.9387789632644179f, - 0.9387338576538742f, - 0.9386887359583792f, - 0.9386435981787065f, - 0.9385984443156292f, - 0.9385532743699212f, - 0.9385080883423563f, - 0.9384628862337091f, - 0.9384176680447536f, - 0.9383724337762651f, - 0.9383271834290183f, - 0.9382819170037887f, - 0.9382366345013521f, - 0.938191335922484f, - 0.9381460212679611f, - 0.9381006905385594f, - 0.938055343735056f, - 0.9380099808582275f, - 0.9379646019088516f, - 0.9379192068877055f, - 0.9378737957955672f, - 0.9378283686332147f, - 0.9377829254014266f, - 0.9377374661009814f, - 0.937691990732658f, - 0.9376464992972356f, - 0.9376009917954938f, - 0.9375554682282126f, - 0.9375099285961713f, - 0.9374643729001509f, - 0.9374188011409317f, - 0.9373732133192947f, - 0.9373276094360208f, - 0.9372819894918916f, - 0.9372363534876886f, - 0.9371907014241939f, - 0.9371450333021899f, - 0.9370993491224587f, - 0.9370536488857836f, - 0.9370079325929472f, - 0.9369622002447331f, - 0.9369164518419248f, - 0.9368706873853062f, - 0.9368249068756616f, - 0.9367791103137751f, - 0.9367332977004318f, - 0.9366874690364164f, - 0.9366416243225143f, - 0.936595763559511f, - 0.9365498867481924f, - 0.9365039938893444f, - 0.9364580849837536f, - 0.9364121600322064f, - 0.9363662190354899f, - 0.9363202619943911f, - 0.9362742889096978f, - 0.9362282997821972f, - 0.9361822946126779f, - 0.9361362734019276f, - 0.9360902361507354f, - 0.9360441828598898f, - 0.93599811353018f, - 0.9359520281623954f, - 0.9359059267573258f, - 0.9358598093157607f, - 0.9358136758384908f, - 0.9357675263263066f, - 0.9357213607799982f, - 0.9356751792003574f, - 0.935628981588175f, - 0.9355827679442429f, - 0.9355365382693527f, - 0.9354902925642967f, - 0.9354440308298674f, - 0.9353977530668571f, - 0.9353514592760593f, - 0.9353051494582667f, - 0.9352588236142733f, - 0.9352124817448724f, - 0.9351661238508584f, - 0.9351197499330254f, - 0.9350733599921683f, - 0.9350269540290816f, - 0.9349805320445609f, - 0.9349340940394011f, - 0.9348876400143983f, - 0.9348411699703485f, - 0.9347946839080475f, - 0.9347481818282924f, - 0.9347016637318797f, - 0.9346551296196065f, - 0.93460857949227f, - 0.9345620133506682f, - 0.9345154311955987f, - 0.9344688330278598f, - 0.9344222188482498f, - 0.9343755886575675f, - 0.9343289424566121f, - 0.9342822802461825f, - 0.9342356020270786f, - 0.9341889078000999f, - 0.9341421975660468f, - 0.9340954713257194f, - 0.9340487290799185f, - 0.9340019708294449f, - 0.9339551965751001f, - 0.9339084063176851f, - 0.933861600058002f, - 0.9338147777968525f, - 0.9337679395350391f, - 0.9337210852733645f, - 0.9336742150126311f, - 0.9336273287536425f, - 0.9335804264972017f, - 0.9335335082441127f, - 0.9334865739951791f, - 0.9334396237512053f, - 0.9333926575129956f, - 0.933345675281355f, - 0.9332986770570884f, - 0.9332516628410009f, - 0.9332046326338986f, - 0.9331575864365869f, - 0.9331105242498721f, - 0.9330634460745604f, - 0.9330163519114588f, - 0.932969241761374f, - 0.9329221156251134f, - 0.9328749735034844f, - 0.9328278153972946f, - 0.9327806413073523f, - 0.9327334512344656f, - 0.9326862451794433f, - 0.9326390231430941f, - 0.9325917851262273f, - 0.9325445311296521f, - 0.9324972611541784f, - 0.932449975200616f, - 0.9324026732697752f, - 0.9323553553624665f, - 0.9323080214795008f, - 0.9322606716216887f, - 0.9322133057898422f, - 0.9321659239847723f, - 0.9321185262072911f, - 0.932071112458211f, - 0.932023682738344f, - 0.9319762370485032f, - 0.9319287753895013f, - 0.9318812977621515f, - 0.9318338041672675f, - 0.931786294605663f, - 0.931738769078152f, - 0.931691227585549f, - 0.9316436701286684f, - 0.9315960967083254f, - 0.9315485073253349f, - 0.9315009019805123f, - 0.9314532806746735f, - 0.9314056434086343f, - 0.9313579901832111f, - 0.9313103209992203f, - 0.9312626358574788f, - 0.9312149347588036f, - 0.9311672177040121f, - 0.9311194846939218f, - 0.9310717357293509f, - 0.9310239708111171f, - 0.9309761899400392f, - 0.9309283931169358f, - 0.9308805803426258f, - 0.9308327516179286f, - 0.9307849069436637f, - 0.9307370463206509f, - 0.9306891697497102f, - 0.9306412772316621f, - 0.930593368767327f, - 0.9305454443575262f, - 0.9304975040030803f, - 0.9304495477048113f, - 0.9304015754635404f, - 0.93035358728009f, - 0.9303055831552823f, - 0.9302575630899397f, - 0.9302095270848851f, - 0.9301614751409415f, - 0.9301134072589324f, - 0.9300653234396812f, - 0.9300172236840122f, - 0.9299691079927491f, - 0.9299209763667168f, - 0.9298728288067395f, - 0.9298246653136427f, - 0.9297764858882515f, - 0.9297282905313912f, - 0.9296800792438881f, - 0.9296318520265677f, - 0.9295836088802569f, - 0.9295353498057819f, - 0.9294870748039701f, - 0.929438783875648f, - 0.9293904770216438f, - 0.9293421542427847f, - 0.9292938155398989f, - 0.9292454609138144f, - 0.9291970903653601f, - 0.9291487038953649f, - 0.9291003015046575f, - 0.9290518831940675f, - 0.9290034489644244f, - 0.9289549988165583f, - 0.9289065327512991f, - 0.9288580507694776f, - 0.9288095528719242f, - 0.9287610390594702f, - 0.9287125093329466f, - 0.928663963693185f, - 0.9286154021410173f, - 0.9285668246772756f, - 0.9285182313027923f, - 0.9284696220183998f, - 0.9284209968249313f, - 0.9283723557232197f, - 0.9283236987140988f, - 0.9282750257984019f, - 0.9282263369769633f, - 0.9281776322506172f, - 0.9281289116201982f, - 0.928080175086541f, - 0.9280314226504806f, - 0.9279826543128527f, - 0.9279338700744925f, - 0.9278850699362362f, - 0.9278362538989199f, - 0.9277874219633803f, - 0.9277385741304536f, - 0.9276897104009771f, - 0.9276408307757882f, - 0.9275919352557241f, - 0.9275430238416229f, - 0.9274940965343225f, - 0.9274451533346614f, - 0.927396194243478f, - 0.9273472192616116f, - 0.927298228389901f, - 0.9272492216291858f, - 0.9272001989803056f, - 0.9271511604441006f, - 0.9271021060214109f, - 0.9270530357130772f, - 0.9270039495199399f, - 0.9269548474428406f, - 0.9269057294826203f, - 0.9268565956401207f, - 0.9268074459161839f, - 0.9267582803116519f, - 0.9267090988273671f, - 0.9266599014641722f, - 0.9266106882229103f, - 0.9265614591044246f, - 0.9265122141095585f, - 0.9264629532391561f, - 0.9264136764940611f, - 0.9263643838751181f, - 0.9263150753831718f, - 0.9262657510190667f, - 0.9262164107836482f, - 0.926167054677762f, - 0.9261176827022533f, - 0.9260682948579684f, - 0.9260188911457533f, - 0.9259694715664549f, - 0.9259200361209197f, - 0.9258705848099948f, - 0.9258211176345275f, - 0.9257716345953656f, - 0.9257221356933567f, - 0.9256726209293492f, - 0.9256230903041914f, - 0.925573543818732f, - 0.9255239814738201f, - 0.9254744032703047f, - 0.9254248092090355f, - 0.9253751992908621f, - 0.9253255735166348f, - 0.9252759318872036f, - 0.9252262744034195f, - 0.925176601066133f, - 0.9251269118761954f, - 0.925077206834458f, - 0.9250274859417728f, - 0.9249777491989915f, - 0.9249279966069661f, - 0.9248782281665496f, - 0.9248284438785945f, - 0.9247786437439539f, - 0.924728827763481f, - 0.9246789959380295f, - 0.9246291482684532f, - 0.9245792847556062f, - 0.924529405400343f, - 0.9244795102035183f, - 0.9244295991659868f, - 0.9243796722886038f, - 0.9243297295722251f, - 0.924279771017706f, - 0.9242297966259029f, - 0.9241798063976717f, - 0.9241298003338695f, - 0.9240797784353525f, - 0.9240297407029784f, - 0.9239796871376041f, - 0.9239296177400877f, - 0.9238795325112867f, - 0.9238294314520596f, - 0.9237793145632649f, - 0.923729181845761f, - 0.9236790333004073f, - 0.9236288689280628f, - 0.9235786887295874f, - 0.9235284927058404f, - 0.9234782808576824f, - 0.9234280531859733f, - 0.9233778096915742f, - 0.9233275503753456f, - 0.9232772752381491f, - 0.9232269842808457f, - 0.9231766775042974f, - 0.9231263549093662f, - 0.9230760164969143f, - 0.9230256622678042f, - 0.9229752922228988f, - 0.9229249063630611f, - 0.9228745046891543f, - 0.9228240872020425f, - 0.922773653902589f, - 0.9227232047916584f, - 0.9226727398701149f, - 0.9226222591388231f, - 0.9225717625986485f, - 0.9225212502504557f, - 0.9224707220951107f, - 0.922420178133479f, - 0.9223696183664268f, - 0.9223190427948205f, - 0.9222684514195264f, - 0.9222178442414115f, - 0.9221672212613431f, - 0.9221165824801885f, - 0.9220659278988154f, - 0.9220152575180915f, - 0.9219645713388854f, - 0.9219138693620657f, - 0.9218631515885005f, - 0.9218124180190596f, - 0.9217616686546116f, - 0.9217109034960268f, - 0.9216601225441744f, - 0.921609325799925f, - 0.9215585132641486f, - 0.9215076849377162f, - 0.9214568408214985f, - 0.9214059809163667f, - 0.9213551052231925f, - 0.9213042137428474f, - 0.9212533064762035f, - 0.9212023834241331f, - 0.9211514445875087f, - 0.9211004899672033f, - 0.9210495195640896f, - 0.9209985333790415f, - 0.9209475314129322f, - 0.9208965136666357f, - 0.9208454801410264f, - 0.9207944308369783f, - 0.9207433657553665f, - 0.920692284897066f, - 0.9206411882629518f, - 0.9205900758538997f, - 0.9205389476707853f, - 0.9204878037144847f, - 0.9204366439858742f, - 0.9203854684858306f, - 0.9203342772152305f, - 0.9202830701749514f, - 0.9202318473658704f, - 0.9201806087888652f, - 0.920129354444814f, - 0.9200780843345949f, - 0.9200267984590864f, - 0.9199754968191672f, - 0.9199241794157165f, - 0.9198728462496134f, - 0.9198214973217378f, - 0.919770132632969f, - 0.9197187521841877f, - 0.919667355976274f, - 0.9196159440101087f, - 0.9195645162865725f, - 0.9195130728065467f, - 0.919461613570913f, - 0.9194101385805529f, - 0.9193586478363485f, - 0.9193071413391819f, - 0.9192556190899359f, - 0.9192040810894931f, - 0.919152527338737f, - 0.9191009578385503f, - 0.9190493725898172f, - 0.9189977715934213f, - 0.918946154850247f, - 0.9188945223611784f, - 0.9188428741271006f, - 0.9187912101488984f, - 0.9187395304274568f, - 0.9186878349636618f, - 0.9186361237583988f, - 0.9185843968125541f, - 0.9185326541270138f, - 0.9184808957026648f, - 0.9184291215403936f, - 0.9183773316410877f, - 0.9183255260056341f, - 0.9182737046349208f, - 0.9182218675298358f, - 0.9181700146912669f, - 0.9181181461201031f, - 0.9180662618172328f, - 0.9180143617835452f, - 0.9179624460199295f, - 0.9179105145272753f, - 0.9178585673064723f, - 0.9178066043584109f, - 0.9177546256839813f, - 0.9177026312840738f, - 0.91765062115958f, - 0.9175985953113905f, - 0.9175465537403972f, - 0.9174944964474913f, - 0.9174424234335653f, - 0.917390334699511f, - 0.9173382302462215f, - 0.9172861100745889f, - 0.9172339741855069f, - 0.9171818225798684f, - 0.9171296552585673f, - 0.9170774722224971f, - 0.9170252734725521f, - 0.9169730590096271f, - 0.9169208288346163f, - 0.916868582948415f, - 0.9168163213519179f, - 0.9167640440460212f, - 0.9167117510316201f, - 0.9166594423096108f, - 0.9166071178808896f, - 0.9165547777463531f, - 0.916502421906898f, - 0.9164500503634216f, - 0.9163976631168211f, - 0.9163452601679942f, - 0.9162928415178391f, - 0.9162404071672533f, - 0.916187957117136f, - 0.9161354913683853f, - 0.9160830099219007f, - 0.916030512778581f, - 0.9159779999393262f, - 0.9159254714050356f, - 0.9158729271766096f, - 0.9158203672549483f, - 0.9157677916409525f, - 0.9157152003355231f, - 0.9156625933395611f, - 0.9156099706539679f, - 0.9155573322796452f, - 0.9155046782174949f, - 0.9154520084684195f, - 0.915399323033321f, - 0.9153466219131026f, - 0.915293905108667f, - 0.9152411726209176f, - 0.9151884244507581f, - 0.915135660599092f, - 0.9150828810668237f, - 0.9150300858548575f, - 0.9149772749640979f, - 0.91492444839545f, - 0.9148716061498187f, - 0.9148187482281097f, - 0.9147658746312285f, - 0.9147129853600813f, - 0.9146600804155741f, - 0.9146071597986136f, - 0.9145542235101065f, - 0.9145012715509598f, - 0.914448303922081f, - 0.9143953206243775f, - 0.9143423216587572f, - 0.9142893070261282f, - 0.914236276727399f, - 0.9141832307634781f, - 0.9141301691352747f, - 0.9140770918436976f, - 0.9140239988896567f, - 0.9139708902740612f, - 0.9139177659978217f, - 0.913864626061848f, - 0.9138114704670508f, - 0.9137582992143412f, - 0.9137051123046297f, - 0.9136519097388283f, - 0.9135986915178479f, - 0.913545457642601f, - 0.9134922081139992f, - 0.9134389429329555f, - 0.9133856621003821f, - 0.9133323656171923f, - 0.913279053484299f, - 0.913225725702616f, - 0.9131723822730567f, - 0.9131190231965356f, - 0.9130656484739667f, - 0.9130122581062643f, - 0.9129588520943438f, - 0.9129054304391199f, - 0.9128519931415081f, - 0.912798540202424f, - 0.9127450716227836f, - 0.9126915874035029f, - 0.9126380875454985f, - 0.9125845720496869f, - 0.9125310409169851f, - 0.9124774941483107f, - 0.9124239317445808f, - 0.9123703537067135f, - 0.9123167600356266f, - 0.9122631507322385f, - 0.9122095257974676f, - 0.9121558852322332f, - 0.9121022290374539f, - 0.9120485572140495f, - 0.9119948697629394f, - 0.9119411666850435f, - 0.9118874479812823f, - 0.9118337136525758f, - 0.9117799636998452f, - 0.9117261981240109f, - 0.9116724169259949f, - 0.911618620106718f, - 0.9115648076671026f, - 0.9115109796080703f, - 0.9114571359305438f, - 0.9114032766354453f, - 0.911349401723698f, - 0.9112955111962249f, - 0.9112416050539492f, - 0.9111876832977952f, - 0.9111337459286861f, - 0.9110797929475466f, - 0.9110258243553008f, - 0.9109718401528738f, - 0.9109178403411904f, - 0.9108638249211759f, - 0.9108097938937557f, - 0.910755747259856f, - 0.9107016850204024f, - 0.9106476071763215f, - 0.9105935137285399f, - 0.9105394046779844f, - 0.9104852800255824f, - 0.9104311397722609f, - 0.9103769839189478f, - 0.910322812466571f, - 0.9102686254160589f, - 0.9102144227683396f, - 0.9101602045243424f, - 0.9101059706849957f, - 0.9100517212512292f, - 0.9099974562239722f, - 0.9099431756041546f, - 0.9098888793927068f, - 0.9098345675905587f, - 0.909780240198641f, - 0.9097258972178848f, - 0.9096715386492211f, - 0.9096171644935813f, - 0.9095627747518972f, - 0.9095083694251006f, - 0.909453948514124f, - 0.9093995120198993f, - 0.90934505994336f, - 0.9092905922854385f, - 0.9092361090470686f, - 0.9091816102291834f, - 0.9091270958327172f, - 0.9090725658586035f, - 0.9090180203077773f, - 0.9089634591811726f, - 0.9089088824797249f, - 0.908854290204369f, - 0.9087996823560401f, - 0.9087450589356745f, - 0.9086904199442076f, - 0.9086357653825758f, - 0.9085810952517158f, - 0.9085264095525641f, - 0.9084717082860579f, - 0.9084169914531344f, - 0.9083622590547312f, - 0.908307511091786f, - 0.9082527475652371f, - 0.9081979684760226f, - 0.9081431738250815f, - 0.9080883636133521f, - 0.9080335378417743f, - 0.9079786965112868f, - 0.9079238396228297f, - 0.9078689671773432f, - 0.907814079175767f, - 0.9077591756190418f, - 0.9077042565081084f, - 0.9076493218439079f, - 0.9075943716273812f, - 0.9075394058594705f, - 0.9074844245411169f, - 0.9074294276732632f, - 0.9073744152568511f, - 0.9073193872928236f, - 0.9072643437821236f, - 0.9072092847256942f, - 0.9071542101244788f, - 0.9070991199794209f, - 0.907044014291465f, - 0.9069888930615546f, - 0.9069337562906349f, - 0.9068786039796499f, - 0.9068234361295454f, - 0.906768252741266f, - 0.9067130538157578f, - 0.9066578393539665f, - 0.9066026093568378f, - 0.9065473638253184f, - 0.9064921027603547f, - 0.906436826162894f, - 0.9063815340338829f, - 0.9063262263742693f, - 0.9062709031850005f, - 0.9062155644670247f, - 0.9061602102212899f, - 0.906104840448745f, - 0.9060494551503381f, - 0.9059940543270186f, - 0.905938637979736f, - 0.9058832061094393f, - 0.9058277587170789f, - 0.9057722958036043f, - 0.9057168173699663f, - 0.9056613234171151f, - 0.9056058139460021f, - 0.9055502889575779f, - 0.9054947484527944f, - 0.9054391924326027f, - 0.9053836208979554f, - 0.9053280338498041f, - 0.9052724312891014f, - 0.9052168132168005f, - 0.9051611796338538f, - 0.905105530541215f, - 0.9050498659398374f, - 0.9049941858306749f, - 0.9049384902146814f, - 0.9048827790928116f, - 0.9048270524660195f, - 0.9047713103352606f, - 0.9047155527014895f, - 0.9046597795656618f, - 0.9046039909287334f, - 0.9045481867916598f, - 0.9044923671553976f, - 0.9044365320209031f, - 0.9043806813891327f, - 0.9043248152610439f, - 0.9042689336375935f, - 0.9042130365197394f, - 0.904157123908439f, - 0.9041011958046508f, - 0.9040452522093327f, - 0.9039892931234434f, - 0.9039333185479418f, - 0.9038773284837871f, - 0.9038213229319384f, - 0.9037653018933558f, - 0.9037092653689986f, - 0.9036532133598275f, - 0.9035971458668026f, - 0.9035410628908849f, - 0.9034849644330348f, - 0.9034288504942144f, - 0.9033727210753844f, - 0.903316576177507f, - 0.903260415801544f, - 0.9032042399484578f, - 0.9031480486192112f, - 0.9030918418147664f, - 0.9030356195360872f, - 0.9029793817841365f, - 0.9029231285598781f, - 0.9028668598642757f, - 0.9028105756982938f, - 0.9027542760628964f, - 0.9026979609590485f, - 0.9026416303877147f, - 0.9025852843498605f, - 0.9025289228464515f, - 0.9024725458784529f, - 0.9024161534468313f, - 0.9023597455525526f, - 0.9023033221965836f, - 0.9022468833798908f, - 0.9021904291034415f, - 0.9021339593682027f, - 0.9020774741751426f, - 0.9020209735252284f, - 0.9019644574194287f, - 0.9019079258587115f, - 0.9018513788440458f, - 0.9017948163764001f, - 0.9017382384567443f, - 0.9016816450860472f, - 0.9016250362652786f, - 0.9015684119954087f, - 0.9015117722774075f, - 0.9014551171122459f, - 0.9013984465008941f, - 0.9013417604443237f, - 0.9012850589435055f, - 0.9012283419994113f, - 0.9011716096130131f, - 0.9011148617852828f, - 0.9010580985171929f, - 0.9010013198097157f, - 0.9009445256638244f, - 0.900887716080492f, - 0.9008308910606921f, - 0.9007740506053981f, - 0.9007171947155843f, - 0.9006603233922245f, - 0.9006034366362935f, - 0.9005465344487658f, - 0.9004896168306165f, - 0.900432683782821f, - 0.9003757353063547f, - 0.9003187714021935f, - 0.9002617920713133f, - 0.9002047973146906f, - 0.9001477871333018f, - 0.900090761528124f, - 0.900033720500134f, - 0.8999766640503094f, - 0.8999195921796278f, - 0.899862504889067f, - 0.8998054021796055f, - 0.8997482840522213f, - 0.8996911505078936f, - 0.8996340015476009f, - 0.8995768371723227f, - 0.8995196573830384f, - 0.8994624621807279f, - 0.8994052515663712f, - 0.8993480255409482f, - 0.8992907841054399f, - 0.8992335272608268f, - 0.8991762550080905f, - 0.8991189673482116f, - 0.8990616642821725f, - 0.8990043458109543f, - 0.8989470119355397f, - 0.8988896626569108f, - 0.8988322979760506f, - 0.8987749178939416f, - 0.8987175224115673f, - 0.8986601115299109f, - 0.8986026852499566f, - 0.8985452435726876f, - 0.8984877864990888f, - 0.8984303140301446f, - 0.8983728261668396f, - 0.898315322910159f, - 0.898257804261088f, - 0.8982002702206123f, - 0.8981427207897175f, - 0.8980851559693899f, - 0.8980275757606156f, - 0.8979699801643817f, - 0.8979123691816745f, - 0.8978547428134817f, - 0.8977971010607901f, - 0.8977394439245879f, - 0.897681771405863f, - 0.8976240835056033f, - 0.8975663802247975f, - 0.8975086615644342f, - 0.8974509275255026f, - 0.8973931781089917f, - 0.8973354133158912f, - 0.8972776331471907f, - 0.8972198376038806f, - 0.8971620266869507f, - 0.897104200397392f, - 0.8970463587361951f, - 0.8969885017043514f, - 0.8969306293028518f, - 0.8968727415326884f, - 0.8968148383948527f, - 0.8967569198903371f, - 0.8966989860201341f, - 0.896641036785236f, - 0.8965830721866361f, - 0.8965250922253273f, - 0.8964670969023035f, - 0.896409086218558f, - 0.8963510601750849f, - 0.8962930187728788f, - 0.8962349620129337f, - 0.8961768898962449f, - 0.896118802423807f, - 0.8960606995966158f, - 0.8960025814156664f, - 0.8959444478819548f, - 0.8958862989964771f, - 0.8958281347602299f, - 0.8957699551742094f, - 0.895711760239413f, - 0.8956535499568373f, - 0.89559532432748f, - 0.8955370833523391f, - 0.8954788270324118f, - 0.895420555368697f, - 0.8953622683621927f, - 0.8953039660138981f, - 0.8952456483248117f, - 0.8951873152959331f, - 0.8951289669282615f, - 0.8950706032227971f, - 0.8950122241805395f, - 0.8949538298024893f, - 0.8948954200896472f, - 0.8948369950430136f, - 0.8947785546635901f, - 0.8947200989523776f, - 0.8946616279103781f, - 0.8946031415385931f, - 0.8945446398380251f, - 0.8944861228096762f, - 0.8944275904545494f, - 0.8943690427736476f, - 0.8943104797679736f, - 0.8942519014385314f, - 0.8941933077863242f, - 0.8941346988123565f, - 0.894076074517632f, - 0.8940174349031558f, - 0.8939587799699322f, - 0.8939001097189665f, - 0.8938414241512639f, - 0.89378272326783f, - 0.8937240070696705f, - 0.8936652755577917f, - 0.8936065287331997f, - 0.8935477665969013f, - 0.8934889891499035f, - 0.893430196393213f, - 0.8933713883278376f, - 0.8933125649547847f, - 0.8932537262750626f, - 0.8931948722896789f, - 0.8931360029996427f, - 0.893077118405962f, - 0.8930182185096465f, - 0.8929593033117048f, - 0.8929003728131469f, - 0.8928414270149823f, - 0.8927824659182209f, - 0.8927234895238733f, - 0.8926644978329498f, - 0.8926054908464613f, - 0.8925464685654189f, - 0.8924874309908339f, - 0.8924283781237179f, - 0.8923693099650828f, - 0.8923102265159405f, - 0.8922511277773036f, - 0.8921920137501846f, - 0.8921328844355966f, - 0.8920737398345526f, - 0.8920145799480661f, - 0.8919554047771507f, - 0.8918962143228206f, - 0.8918370085860896f, - 0.8917777875679727f, - 0.891718551269484f, - 0.891659299691639f, - 0.8916000328354526f, - 0.8915407507019408f, - 0.891481453292119f, - 0.8914221406070032f, - 0.8913628126476099f, - 0.8913034694149558f, - 0.8912441109100573f, - 0.8911847371339319f, - 0.8911253480875966f, - 0.8910659437720695f, - 0.8910065241883679f, - 0.8909470893375104f, - 0.8908876392205152f, - 0.890828173838401f, - 0.8907686931921865f, - 0.8907091972828912f, - 0.8906496861115346f, - 0.8905901596791361f, - 0.890530617986716f, - 0.890471061035294f, - 0.8904114888258914f, - 0.8903519013595281f, - 0.8902922986372258f, - 0.8902326806600052f, - 0.8901730474288884f, - 0.8901133989448967f, - 0.8900537352090525f, - 0.8899940562223779f, - 0.8899343619858956f, - 0.8898746525006286f, - 0.8898149277675996f, - 0.8897551877878325f, - 0.8896954325623504f, - 0.8896356620921776f, - 0.8895758763783379f, - 0.8895160754218561f, - 0.8894562592237564f, - 0.8893964277850642f, - 0.8893365811068044f, - 0.8892767191900026f, - 0.8892168420356843f, - 0.8891569496448759f, - 0.8890970420186034f, - 0.889037119157893f, - 0.888977181063772f, - 0.888917227737267f, - 0.8888572591794056f, - 0.888797275391215f, - 0.8887372763737235f, - 0.8886772621279585f, - 0.888617232654949f, - 0.888557187955723f, - 0.8884971280313098f, - 0.8884370528827384f, - 0.888376962511038f, - 0.8883168569172386f, - 0.8882567361023695f, - 0.8881966000674616f, - 0.8881364488135446f, - 0.8880762823416496f, - 0.8880161006528073f, - 0.8879559037480492f, - 0.8878956916284065f, - 0.8878354642949111f, - 0.8877752217485947f, - 0.8877149639904898f, - 0.8876546910216289f, - 0.8875944028430445f, - 0.88753409945577f, - 0.8874737808608383f, - 0.8874134470592833f, - 0.8873530980521385f, - 0.8872927338404382f, - 0.8872323544252164f, - 0.8871719598075082f, - 0.887111549988348f, - 0.8870511249687709f, - 0.8869906847498127f, - 0.8869302293325085f, - 0.8868697587178946f, - 0.886809272907007f, - 0.8867487719008821f, - 0.8866882557005565f, - 0.8866277243070672f, - 0.8865671777214514f, - 0.8865066159447464f, - 0.8864460389779902f, - 0.8863854468222205f, - 0.8863248394784757f, - 0.8862642169477941f, - 0.8862035792312148f, - 0.8861429263297764f, - 0.8860822582445185f, - 0.8860215749764804f, - 0.885960876526702f, - 0.8859001628962232f, - 0.8858394340860847f, - 0.8857786900973266f, - 0.8857179309309902f, - 0.8856571565881161f, - 0.8855963670697458f, - 0.8855355623769212f, - 0.8854747425106839f, - 0.8854139074720763f, - 0.8853530572621403f, - 0.8852921918819191f, - 0.8852313113324553f, - 0.8851704156147921f, - 0.8851095047299729f, - 0.8850485786790416f, - 0.8849876374630419f, - 0.8849266810830182f, - 0.8848657095400148f, - 0.8848047228350765f, - 0.8847437209692485f, - 0.8846827039435756f, - 0.8846216717591039f, - 0.8845606244168785f, - 0.8844995619179461f, - 0.8844384842633525f, - 0.8843773914541445f, - 0.8843162834913686f, - 0.8842551603760724f, - 0.8841940221093026f, - 0.8841328686921074f, - 0.8840717001255342f, - 0.8840105164106313f, - 0.883949317548447f, - 0.88388810354003f, - 0.883826874386429f, - 0.8837656300886935f, - 0.8837043706478727f, - 0.883643096065016f, - 0.8835818063411738f, - 0.8835205014773959f, - 0.883459181474733f, - 0.8833978463342356f, - 0.8833364960569547f, - 0.8832751306439418f, - 0.883213750096248f, - 0.8831523544149253f, - 0.8830909436010256f, - 0.8830295176556012f, - 0.8829680765797044f, - 0.8829066203743884f, - 0.8828451490407058f, - 0.8827836625797102f, - 0.8827221609924548f, - 0.8826606442799937f, - 0.8825991124433812f, - 0.882537565483671f, - 0.8824760034019185f, - 0.8824144261991776f, - 0.8823528338765042f, - 0.8822912264349533f, - 0.8822296038755807f, - 0.8821679661994419f, - 0.8821063134075936f, - 0.8820446455010917f, - 0.8819829624809934f, - 0.881921264348355f, - 0.8818595511042341f, - 0.8817978227496881f, - 0.8817360792857746f, - 0.8816743207135517f, - 0.8816125470340772f, - 0.8815507582484102f, - 0.881488954357609f, - 0.8814271353627328f, - 0.8813653012648406f, - 0.8813034520649923f, - 0.8812415877642473f, - 0.8811797083636658f, - 0.8811178138643081f, - 0.8810559042672345f, - 0.8809939795735062f, - 0.880932039784184f, - 0.8808700849003294f, - 0.8808081149230037f, - 0.880746129853269f, - 0.8806841296921872f, - 0.8806221144408211f, - 0.8805600841002326f, - 0.8804980386714851f, - 0.8804359781556416f, - 0.8803739025537652f, - 0.8803118118669203f, - 0.8802497060961699f, - 0.880187585242579f, - 0.8801254493072113f, - 0.8800632982911321f, - 0.8800011321954057f, - 0.879938951021098f, - 0.8798767547692737f, - 0.8798145434409993f, - 0.87975231703734f, - 0.8796900755593628f, - 0.8796278190081336f, - 0.8795655473847193f, - 0.8795032606901871f, - 0.879440958925604f, - 0.879378642092038f, - 0.8793163101905562f, - 0.8792539632222272f, - 0.8791916011881189f, - 0.8791292240893002f, - 0.8790668319268395f, - 0.8790044247018065f, - 0.8789420024152699f, - 0.8788795650682995f, - 0.8788171126619654f, - 0.8787546451973375f, - 0.8786921626754859f, - 0.8786296650974817f, - 0.8785671524643954f, - 0.8785046247772985f, - 0.878442082037262f, - 0.8783795242453579f, - 0.8783169514026578f, - 0.8782543635102342f, - 0.8781917605691594f, - 0.8781291425805058f, - 0.8780665095453466f, - 0.8780038614647551f, - 0.8779411983398044f, - 0.8778785201715689f, - 0.8778158269611217f, - 0.8777531187095378f, - 0.877690395417891f, - 0.8776276570872567f, - 0.8775649037187093f, - 0.8775021353133247f, - 0.8774393518721778f, - 0.8773765533963446f, - 0.8773137398869014f, - 0.8772509113449242f, - 0.8771880677714897f, - 0.8771252091676746f, - 0.877062335534556f, - 0.8769994468732112f, - 0.8769365431847179f, - 0.8768736244701537f, - 0.8768106907305971f, - 0.8767477419671259f, - 0.8766847781808192f, - 0.8766217993727555f, - 0.8765588055440142f, - 0.8764957966956747f, - 0.8764327728288163f, - 0.8763697339445193f, - 0.8763066800438635f, - 0.8762436111279297f, - 0.876180527197798f, - 0.8761174282545501f, - 0.8760543142992665f, - 0.875991185333029f, - 0.875928041356919f, - 0.875864882372019f, - 0.8758017083794106f, - 0.8757385193801767f, - 0.8756753153753999f, - 0.8756120963661629f, - 0.8755488623535495f, - 0.8754856133386425f, - 0.8754223493225263f, - 0.8753590703062845f, - 0.8752957762910017f, - 0.875232467277762f, - 0.8751691432676507f, - 0.8751058042617523f, - 0.8750424502611525f, - 0.8749790812669368f, - 0.8749156972801907f, - 0.8748522983020007f, - 0.8747888843334528f, - 0.8747254553756338f, - 0.8746620114296303f, - 0.8745985524965298f, - 0.8745350785774191f, - 0.8744715896733863f, - 0.8744080857855189f, - 0.8743445669149051f, - 0.8742810330626336f, - 0.8742174842297926f, - 0.8741539204174714f, - 0.8740903416267588f, - 0.8740267478587445f, - 0.8739631391145177f, - 0.873899515395169f, - 0.8738358767017879f, - 0.8737722230354653f, - 0.8737085543972916f, - 0.873644870788358f, - 0.8735811722097553f, - 0.8735174586625752f, - 0.8734537301479098f, - 0.8733899866668505f, - 0.8733262282204899f, - 0.87326245480992f, - 0.8731986664362342f, - 0.8731348631005251f, - 0.8730710448038859f, - 0.8730072115474102f, - 0.8729433633321918f, - 0.8728795001593248f, - 0.8728156220299033f, - 0.872751728945022f, - 0.8726878209057753f, - 0.8726238979132589f, - 0.8725599599685676f, - 0.8724960070727973f, - 0.8724320392270434f, - 0.8723680564324023f, - 0.8723040586899702f, - 0.8722400460008438f, - 0.8721760183661198f, - 0.8721119757868955f, - 0.8720479182642678f, - 0.8719838457993346f, - 0.8719197583931941f, - 0.8718556560469439f, - 0.8717915387616827f, - 0.8717274065385089f, - 0.8716632593785216f, - 0.8715990972828197f, - 0.8715349202525029f, - 0.8714707282886706f, - 0.8714065213924229f, - 0.8713422995648596f, - 0.8712780628070818f, - 0.8712138111201895f, - 0.8711495445052838f, - 0.8710852629634663f, - 0.8710209664958379f, - 0.870956655103501f, - 0.8708923287875566f, - 0.8708279875491077f, - 0.8707636313892564f, - 0.8706992603091057f, - 0.8706348743097582f, - 0.8705704733923175f, - 0.8705060575578868f, - 0.8704416268075701f, - 0.8703771811424711f, - 0.8703127205636945f, - 0.8702482450723443f, - 0.8701837546695257f, - 0.8701192493563437f, - 0.870054729133903f, - 0.86999019400331f, - 0.8699256439656697f, - 0.8698610790220889f, - 0.8697964991736731f, - 0.8697319044215296f, - 0.8696672947667646f, - 0.8696026702104855f, - 0.8695380307537999f, - 0.8694733763978146f, - 0.8694087071436384f, - 0.8693440229923785f, - 0.8692793239451438f, - 0.8692146100030426f, - 0.8691498811671841f, - 0.8690851374386769f, - 0.8690203788186309f, - 0.8689556053081554f, - 0.8688908169083602f, - 0.8688260136203559f, - 0.8687611954452523f, - 0.8686963623841606f, - 0.8686315144381912f, - 0.8685666516084557f, - 0.868501773896065f, - 0.8684368813021313f, - 0.868371973827766f, - 0.8683070514740818f, - 0.8682421142421906f, - 0.8681771621332055f, - 0.8681121951482392f, - 0.8680472132884048f, - 0.8679822165548163f, - 0.8679172049485867f, - 0.8678521784708305f, - 0.8677871371226615f, - 0.8677220809051945f, - 0.867657009819544f, - 0.867591923866825f, - 0.8675268230481528f, - 0.867461707364643f, - 0.8673965768174111f, - 0.8673314314075731f, - 0.8672662711362455f, - 0.8672010960045444f, - 0.8671359060135871f, - 0.8670707011644901f, - 0.8670054814583711f, - 0.8669402468963472f, - 0.8668749974795364f, - 0.8668097332090567f, - 0.8667444540860266f, - 0.8666791601115642f, - 0.8666138512867888f, - 0.8665485276128189f, - 0.8664831890907742f, - 0.8664178357217742f, - 0.8663524675069385f, - 0.8662870844473876f, - 0.8662216865442411f, - 0.8661562737986205f, - 0.8660908462116459f, - 0.8660254037844387f, - 0.8659599465181201f, - 0.865894474413812f, - 0.8658289874726357f, - 0.8657634856957138f, - 0.8656979690841684f, - 0.865632437639122f, - 0.865566891361698f, - 0.8655013302530189f, - 0.8654357543142085f, - 0.8653701635463901f, - 0.865304557950688f, - 0.8652389375282258f, - 0.8651733022801283f, - 0.8651076522075198f, - 0.8650419873115257f, - 0.8649763075932706f, - 0.8649106130538802f, - 0.8648449036944803f, - 0.8647791795161965f, - 0.8647134405201551f, - 0.8646476867074826f, - 0.8645819180793053f, - 0.8645161346367507f, - 0.8644503363809455f, - 0.8643845233130175f, - 0.8643186954340942f, - 0.8642528527453034f, - 0.8641869952477736f, - 0.864121122942633f, - 0.8640552358310103f, - 0.8639893339140349f, - 0.8639234171928354f, - 0.8638574856685417f, - 0.8637915393422833f, - 0.8637255782151902f, - 0.8636596022883927f, - 0.8635936115630213f, - 0.8635276060402065f, - 0.8634615857210798f, - 0.8633955506067718f, - 0.8633295006984142f, - 0.8632634359971392f, - 0.8631973565040781f, - 0.8631312622203638f, - 0.8630651531471283f, - 0.8629990292855048f, - 0.8629328906366257f, - 0.8628667372016251f, - 0.8628005689816357f, - 0.862734385977792f, - 0.8626681881912273f, - 0.8626019756230765f, - 0.8625357482744738f, - 0.8624695061465539f, - 0.8624032492404523f, - 0.8623369775573039f, - 0.8622706910982445f, - 0.8622043898644095f, - 0.8621380738569355f, - 0.8620717430769582f, - 0.8620053975256148f, - 0.8619390372040415f, - 0.861872662113376f, - 0.8618062722547549f, - 0.8617398676293165f, - 0.8616734482381982f, - 0.861607014082538f, - 0.8615405651634747f, - 0.8614741014821462f, - 0.8614076230396919f, - 0.8613411298372505f, - 0.8612746218759618f, - 0.861208099156965f, - 0.8611415616814002f, - 0.8610750094504072f, - 0.8610084424651268f, - 0.860941860726699f, - 0.8608752642362651f, - 0.8608086529949663f, - 0.8607420270039436f, - 0.860675386264339f, - 0.860608730777294f, - 0.8605420605439512f, - 0.8604753755654523f, - 0.8604086758429407f, - 0.8603419613775585f, - 0.8602752321704494f, - 0.8602084882227565f, - 0.8601417295356236f, - 0.8600749561101947f, - 0.8600081679476136f, - 0.8599413650490251f, - 0.8598745474155733f, - 0.8598077150484038f, - 0.8597408679486611f, - 0.8596740061174911f, - 0.8596071295560391f, - 0.8595402382654513f, - 0.8594733322468736f, - 0.8594064115014528f, - 0.859339476030335f, - 0.8592725258346674f, - 0.8592055609155975f, - 0.8591385812742722f, - 0.8590715869118397f, - 0.8590045778294474f, - 0.8589375540282439f, - 0.8588705155093775f, - 0.8588034622739966f, - 0.8587363943232507f, - 0.8586693116582884f, - 0.8586022142802596f, - 0.8585351021903137f, - 0.8584679753896008f, - 0.858400833879271f, - 0.8583336776604751f, - 0.8582665067343632f, - 0.8581993211020867f, - 0.8581321207647966f, - 0.8580649057236447f, - 0.8579976759797822f, - 0.8579304315343614f, - 0.8578631723885344f, - 0.8577958985434538f, - 0.8577286100002721f, - 0.8576613067601424f, - 0.8575939888242181f, - 0.8575266561936522f, - 0.857459308869599f, - 0.857391946853212f, - 0.8573245701456458f, - 0.8572571787480545f, - 0.8571897726615932f, - 0.8571223518874166f, - 0.8570549164266803f, - 0.8569874662805392f, - 0.8569200014501497f, - 0.8568525219366673f, - 0.8567850277412483f, - 0.8567175188650497f, - 0.8566499953092275f, - 0.8565824570749394f, - 0.856514904163342f, - 0.8564473365755934f, - 0.8563797543128508f, - 0.8563121573762726f, - 0.8562445457670169f, - 0.8561769194862424f, - 0.8561092785351074f, - 0.8560416229147715f, - 0.8559739526263934f, - 0.8559062676711331f, - 0.8558385680501499f, - 0.8557708537646043f, - 0.8557031248156562f, - 0.8556353812044661f, - 0.8555676229321952f, - 0.855499850000004f, - 0.8554320624090541f, - 0.8553642601605067f, - 0.8552964432555241f, - 0.8552286116952678f, - 0.8551607654809001f, - 0.8550929046135841f, - 0.855025029094482f, - 0.8549571389247571f, - 0.8548892341055725f, - 0.8548213146380921f, - 0.854753380523479f, - 0.854685431762898f, - 0.8546174683575128f, - 0.8545494903084884f, - 0.8544814976169891f, - 0.8544134902841801f, - 0.8543454683112272f, - 0.8542774316992952f, - 0.8542093804495503f, - 0.8541413145631583f, - 0.8540732340412859f, - 0.8540051388850991f, - 0.8539370290957652f, - 0.8538689046744508f, - 0.8538007656223235f, - 0.8537326119405507f, - 0.8536644436303005f, - 0.8535962606927403f, - 0.8535280631290388f, - 0.8534598509403648f, - 0.8533916241278866f, - 0.8533233826927737f, - 0.853255126636195f, - 0.8531868559593203f, - 0.8531185706633192f, - 0.8530502707493621f, - 0.852981956218619f, - 0.8529136270722604f, - 0.8528452833114574f, - 0.8527769249373807f, - 0.8527085519512019f, - 0.8526401643540923f, - 0.852571762147224f, - 0.8525033453317686f, - 0.852434913908899f, - 0.8523664678797873f, - 0.8522980072456066f, - 0.8522295320075296f, - 0.8521610421667299f, - 0.8520925377243809f, - 0.8520240186816567f, - 0.8519554850397308f, - 0.8518869367997779f, - 0.8518183739629727f, - 0.8517497965304894f, - 0.8516812045035039f, - 0.8516125978831908f, - 0.851543976670726f, - 0.851475340867285f, - 0.8514066904740444f, - 0.85133802549218f, - 0.8512693459228686f, - 0.8512006517672868f, - 0.8511319430266118f, - 0.851063219702021f, - 0.8509944817946917f, - 0.8509257293058022f, - 0.8508569622365298f, - 0.8507881805880536f, - 0.8507193843615515f, - 0.8506505735582028f, - 0.8505817481791862f, - 0.8505129082256813f, - 0.8504440536988672f, - 0.8503751845999242f, - 0.850306300930032f, - 0.8502374026903713f, - 0.8501684898821221f, - 0.8500995625064659f, - 0.850030620564583f, - 0.8499616640576553f, - 0.8498926929868639f, - 0.8498237073533911f, - 0.8497547071584183f, - 0.8496856924031285f, - 0.8496166630887039f, - 0.849547619216327f, - 0.8494785607871813f, - 0.8494094878024501f, - 0.8493404002633166f, - 0.849271298170965f, - 0.8492021815265789f, - 0.8491330503313431f, - 0.8490639045864417f, - 0.8489947442930599f, - 0.8489255694523822f, - 0.8488563800655945f, - 0.8487871761338819f, - 0.8487179576584305f, - 0.848648724640426f, - 0.8485794770810547f, - 0.8485102149815037f, - 0.8484409383429592f, - 0.8483716471666086f, - 0.8483023414536388f, - 0.8482330212052378f, - 0.8481636864225929f, - 0.8480943371068926f, - 0.8480249732593248f, - 0.8479555948810784f, - 0.8478862019733416f, - 0.8478167945373042f, - 0.8477473725741548f, - 0.8476779360850831f, - 0.8476084850712793f, - 0.8475390195339328f, - 0.8474695394742344f, - 0.8474000448933743f, - 0.8473305357925435f, - 0.8472610121729326f, - 0.8471914740357335f, - 0.847121921382137f, - 0.8470523542133356f, - 0.8469827725305207f, - 0.846913176334885f, - 0.8468435656276209f, - 0.8467739404099207f, - 0.8467043006829782f, - 0.8466346464479859f, - 0.8465649777061379f, - 0.8464952944586276f, - 0.8464255967066493f, - 0.8463558844513968f, - 0.8462861576940651f, - 0.8462164164358486f, - 0.8461466606779425f, - 0.8460768904215418f, - 0.8460071056678422f, - 0.8459373064180395f, - 0.8458674926733295f, - 0.8457976644349088f, - 0.8457278217039732f, - 0.8456579644817203f, - 0.8455880927693463f, - 0.845518206568049f, - 0.8454483058790254f, - 0.8453783907034738f, - 0.8453084610425916f, - 0.8452385168975772f, - 0.8451685582696296f, - 0.8450985851599467f, - 0.8450285975697281f, - 0.8449585955001726f, - 0.84488857895248f, - 0.8448185479278497f, - 0.844748502427482f, - 0.8446784424525767f, - 0.8446083680043348f, - 0.8445382790839564f, - 0.844468175692643f, - 0.8443980578315953f, - 0.844327925502015f, - 0.844257778705104f, - 0.8441876174420638f, - 0.8441174417140972f, - 0.8440472515224061f, - 0.8439770468681933f, - 0.843906827752662f, - 0.843836594177015f, - 0.843766346142456f, - 0.8436960836501886f, - 0.8436258067014168f, - 0.8435555152973446f, - 0.8434852094391767f, - 0.8434148891281175f, - 0.8433445543653721f, - 0.8432742051521455f, - 0.8432038414896433f, - 0.843133463379071f, - 0.8430630708216348f, - 0.8429926638185403f, - 0.8429222423709947f, - 0.8428518064802037f, - 0.8427813561473751f, - 0.8427108913737154f, - 0.8426404121604322f, - 0.8425699185087334f, - 0.8424994104198266f, - 0.8424288878949201f, - 0.8423583509352219f, - 0.8422877995419413f, - 0.8422172337162865f, - 0.8421466534594673f, - 0.8420760587726923f, - 0.8420054496571718f, - 0.8419348261141153f, - 0.8418641881447329f, - 0.8417935357502353f, - 0.8417228689318327f, - 0.8416521876907364f, - 0.8415814920281569f, - 0.8415107819453062f, - 0.8414400574433953f, - 0.8413693185236366f, - 0.8412985651872418f, - 0.8412277974354235f, - 0.841157015269394f, - 0.8410862186903665f, - 0.8410154076995536f, - 0.8409445822981692f, - 0.8408737424874263f, - 0.8408028882685392f, - 0.8407320196427215f, - 0.8406611366111881f, - 0.8405902391751532f, - 0.8405193273358313f, - 0.8404484010944382f, - 0.8403774604521885f, - 0.8403065054102984f, - 0.840235535969983f, - 0.8401645521324589f, - 0.840093553898942f, - 0.840022541270649f, - 0.839951514248797f, - 0.8398804728346023f, - 0.839809417029283f, - 0.839738346834056f, - 0.8396672622501394f, - 0.839596163278751f, - 0.8395250499211093f, - 0.8394539221784325f, - 0.8393827800519398f, - 0.8393116235428497f, - 0.8392404526523817f, - 0.8391692673817553f, - 0.8390980677321902f, - 0.8390268537049066f, - 0.8389556253011242f, - 0.8388843825220641f, - 0.8388131253689466f, - 0.8387418538429929f, - 0.838670567945424f, - 0.8385992676774617f, - 0.8385279530403272f, - 0.8384566240352431f, - 0.838385280663431f, - 0.8383139229261136f, - 0.8382425508245138f, - 0.8381711643598542f, - 0.8380997635333584f, - 0.8380283483462493f, - 0.837956918799751f, - 0.8378854748950871f, - 0.8378140166334822f, - 0.8377425440161606f, - 0.8376710570443464f, - 0.8375995557192653f, - 0.8375280400421418f, - 0.8374565100142018f, - 0.8373849656366705f, - 0.8373134069107744f, - 0.837241833837739f, - 0.8371702464187912f, - 0.8370986446551572f, - 0.8370270285480642f, - 0.8369553980987391f, - 0.8368837533084095f, - 0.8368120941783027f, - 0.8367404207096469f, - 0.8366687329036699f, - 0.8365970307616002f, - 0.8365253142846666f, - 0.8364535834740975f, - 0.8363818383311225f, - 0.8363100788569703f, - 0.8362383050528711f, - 0.8361665169200543f, - 0.8360947144597504f, - 0.8360228976731892f, - 0.8359510665616016f, - 0.8358792211262183f, - 0.8358073613682702f, - 0.835735487288989f, - 0.8356635988896058f, - 0.8355916961713529f, - 0.8355197791354617f, - 0.8354478477831652f, - 0.8353759021156951f, - 0.8353039421342849f, - 0.8352319678401672f, - 0.8351599792345755f, - 0.835087976318743f, - 0.8350159590939039f, - 0.8349439275612917f, - 0.834871881722141f, - 0.834799821577686f, - 0.8347277471291618f, - 0.8346556583778029f, - 0.8345835553248451f, - 0.8345114379715233f, - 0.8344393063190736f, - 0.8343671603687318f, - 0.8342950001217341f, - 0.834222825579317f, - 0.8341506367427169f, - 0.8340784336131711f, - 0.8340062161919171f, - 0.8339339844801914f, - 0.8338617384792324f, - 0.8337894781902776f, - 0.8337172036145657f, - 0.8336449147533345f, - 0.833572611607823f, - 0.8335002941792699f, - 0.8334279624689146f, - 0.833355616477996f, - 0.8332832562077545f, - 0.833210881659429f, - 0.8331384928342604f, - 0.833066089733489f, - 0.8329936723583549f, - 0.8329212407100995f, - 0.8328487947899635f, - 0.8327763345991887f, - 0.832703860139016f, - 0.832631371410688f, - 0.832558868415446f, - 0.8324863511545331f, - 0.8324138196291911f, - 0.8323412738406633f, - 0.8322687137901928f, - 0.8321961394790226f, - 0.8321235509083965f, - 0.832050948079558f, - 0.8319783309937515f, - 0.8319056996522208f, - 0.831833054056211f, - 0.8317603942069663f, - 0.8316877201057322f, - 0.8316150317537534f, - 0.831542329152276f, - 0.8314696123025453f, - 0.8313968812058075f, - 0.8313241358633087f, - 0.8312513762762953f, - 0.8311786024460143f, - 0.8311058143737123f, - 0.831033012060637f, - 0.8309601955080352f, - 0.8308873647171553f, - 0.8308145196892446f, - 0.8307416604255519f, - 0.8306687869273248f, - 0.8305958991958129f, - 0.8305229972322643f, - 0.8304500810379286f, - 0.8303771506140553f, - 0.8303042059618937f, - 0.8302312470826939f, - 0.8301582739777059f, - 0.8300852866481804f, - 0.8300122850953675f, - 0.8299392693205185f, - 0.8298662393248842f, - 0.8297931951097163f, - 0.8297201366762659f, - 0.8296470640257851f, - 0.8295739771595263f, - 0.8295008760787412f, - 0.829427760784683f, - 0.829354631278604f, - 0.8292814875617577f, - 0.8292083296353968f, - 0.8291351575007755f, - 0.829061971159147f, - 0.8289887706117659f, - 0.8289155558598859f, - 0.828842326904762f, - 0.8287690837476486f, - 0.8286958263898008f, - 0.828622554832474f, - 0.8285492690769235f, - 0.8284759691244054f, - 0.8284026549761753f, - 0.8283293266334892f, - 0.8282559840976043f, - 0.8281826273697765f, - 0.8281092564512634f, - 0.8280358713433217f, - 0.8279624720472092f, - 0.8278890585641833f, - 0.8278156308955023f, - 0.8277421890424237f, - 0.8276687330062067f, - 0.8275952627881092f, - 0.8275217783893908f, - 0.8274482798113101f, - 0.8273747670551268f, - 0.8273012401221002f, - 0.8272276990134906f, - 0.8271541437305575f, - 0.827080574274562f, - 0.8270069906467641f, - 0.8269333928484247f, - 0.8268597808808054f, - 0.8267861547451667f, - 0.826712514442771f, - 0.8266388599748794f, - 0.8265651913427546f, - 0.8264915085476582f, - 0.8264178115908534f, - 0.8263441004736024f, - 0.8262703751971687f, - 0.8261966357628152f, - 0.8261228821718055f, - 0.8260491144254036f, - 0.8259753325248731f, - 0.8259015364714786f, - 0.8258277262664843f, - 0.825753901911155f, - 0.8256800634067557f, - 0.8256062107545517f, - 0.8255323439558081f, - 0.825458463011791f, - 0.825384567923766f, - 0.8253106586929997f, - 0.8252367353207578f, - 0.8251627978083078f, - 0.8250888461569158f, - 0.8250148803678498f, - 0.8249409004423764f, - 0.8248669063817635f, - 0.8247928981872792f, - 0.8247188758601912f, - 0.8246448394017684f, - 0.8245707888132786f, - 0.8244967240959915f, - 0.8244226452511755f, - 0.8243485522801002f, - 0.8242744451840354f, - 0.8242003239642504f, - 0.8241261886220158f, - 0.8240520391586014f, - 0.823977875575278f, - 0.8239036978733163f, - 0.8238295060539874f, - 0.8237553001185624f, - 0.823681080068313f, - 0.8236068459045105f, - 0.8235325976284276f, - 0.8234583352413358f, - 0.8233840587445079f, - 0.823309768139217f, - 0.8232354634267351f, - 0.8231611446083364f, - 0.8230868116852936f, - 0.8230124646588809f, - 0.8229381035303717f, - 0.8228637283010407f, - 0.8227893389721617f, - 0.82271493554501f, - 0.8226405180208598f, - 0.8225660864009866f, - 0.822491640686666f, - 0.822417180879173f, - 0.8223427069797842f, - 0.822268218989775f, - 0.8221937169104222f, - 0.8221192007430019f, - 0.8220446704887916f, - 0.8219701261490678f, - 0.8218955677251079f, - 0.8218209952181895f, - 0.8217464086295903f, - 0.8216718079605886f, - 0.8215971932124622f, - 0.8215225643864901f, - 0.8214479214839505f, - 0.8213732645061229f, - 0.8212985934542862f, - 0.8212239083297201f, - 0.8211492091337041f, - 0.8210744958675185f, - 0.8209997685324428f, - 0.8209250271297582f, - 0.8208502716607449f, - 0.820775502126684f, - 0.8207007185288566f, - 0.820625920868544f, - 0.8205511091470282f, - 0.8204762833655905f, - 0.8204014435255137f, - 0.8203265896280796f, - 0.8202517216745712f, - 0.8201768396662708f, - 0.8201019436044622f, - 0.820027033490428f, - 0.8199521093254525f, - 0.8198771711108188f, - 0.8198022188478112f, - 0.8197272525377145f, - 0.8196522721818124f, - 0.8195772777813903f, - 0.8195022693377327f, - 0.8194272468521255f, - 0.8193522103258535f, - 0.8192771597602029f, - 0.8192020951564594f, - 0.8191270165159094f, - 0.819051923839839f, - 0.8189768171295356f, - 0.8189016963862853f, - 0.818826561611376f, - 0.8187514128060945f, - 0.8186762499717289f, - 0.8186010731095669f, - 0.8185258822208967f, - 0.8184506773070065f, - 0.8183754583691852f, - 0.8183002254087217f, - 0.8182249784269046f, - 0.8181497174250237f, - 0.8180744424043682f, - 0.8179991533662282f, - 0.8179238503118939f, - 0.8178485332426552f, - 0.817773202159803f, - 0.8176978570646277f, - 0.8176224979584208f, - 0.817547124842473f, - 0.8174717377180765f, - 0.8173963365865221f, - 0.8173209214491027f, - 0.8172454923071099f, - 0.8171700491618366f, - 0.817094592014575f, - 0.8170191208666183f, - 0.81694363571926f, - 0.8168681365737929f, - 0.8167926234315113f, - 0.8167170962937084f, - 0.816641555161679f, - 0.816566000036717f, - 0.8164904309201173f, - 0.8164148478131745f, - 0.816339250717184f, - 0.8162636396334408f, - 0.8161880145632407f, - 0.8161123755078797f, - 0.8160367224686533f, - 0.8159610554468585f, - 0.8158853744437912f, - 0.8158096794607486f, - 0.8157339704990273f, - 0.815658247559925f, - 0.8155825106447389f, - 0.8155067597547669f, - 0.8154309948913068f, - 0.815355216055657f, - 0.815279423249116f, - 0.8152036164729819f, - 0.8151277957285544f, - 0.8150519610171321f, - 0.8149761123400149f, - 0.8149002496985019f, - 0.8148243730938937f, - 0.8147484825274895f, - 0.8146725780005906f, - 0.8145966595144968f, - 0.8145207270705096f, - 0.8144447806699295f, - 0.8143688203140582f, - 0.8142928460041974f, - 0.8142168577416484f, - 0.8141408555277139f, - 0.8140648393636953f, - 0.813988809250896f, - 0.8139127651906181f, - 0.8138367071841651f, - 0.8137606352328397f, - 0.813684549337946f, - 0.813608449500787f, - 0.8135323357226674f, - 0.8134562080048907f, - 0.8133800663487616f, - 0.8133039107555852f, - 0.8132277412266656f, - 0.8131515577633087f, - 0.8130753603668193f, - 0.8129991490385035f, - 0.8129229237796666f, - 0.8128466845916152f, - 0.8127704314756554f, - 0.8126941644330941f, - 0.8126178834652374f, - 0.8125415885733932f, - 0.8124652797588681f, - 0.81238895702297f, - 0.8123126203670068f, - 0.8122362697922862f, - 0.8121599053001165f, - 0.8120835268918063f, - 0.8120071345686641f, - 0.8119307283319993f, - 0.8118543081831205f, - 0.8117778741233378f, - 0.8117014261539602f, - 0.8116249642762983f, - 0.8115484884916616f, - 0.811471998801361f, - 0.8113954952067067f, - 0.8113189777090102f, - 0.8112424463095818f, - 0.8111659010097335f, - 0.8110893418107764f, - 0.8110127687140228f, - 0.8109361817207843f, - 0.8108595808323736f, - 0.8107829660501029f, - 0.8107063373752853f, - 0.8106296948092334f, - 0.8105530383532606f, - 0.8104763680086808f, - 0.8103996837768072f, - 0.8103229856589541f, - 0.8102462736564353f, - 0.8101695477705658f, - 0.8100928080026597f, - 0.8100160543540325f, - 0.8099392868259987f, - 0.8098625054198744f, - 0.8097857101369745f, - 0.8097089009786153f, - 0.809632077946113f, - 0.8095552410407836f, - 0.8094783902639441f, - 0.8094015256169108f, - 0.8093246471010013f, - 0.8092477547175324f, - 0.8091708484678221f, - 0.8090939283531876f, - 0.8090169943749475f, - 0.8089400465344195f, - 0.8088630848329226f, - 0.8087861092717751f, - 0.8087091198522962f, - 0.8086321165758049f, - 0.8085550994436209f, - 0.8084780684570638f, - 0.8084010236174533f, - 0.8083239649261096f, - 0.8082468923843531f, - 0.8081698059935046f, - 0.8080927057548846f, - 0.8080155916698146f, - 0.8079384637396156f, - 0.8078613219656092f, - 0.8077841663491176f, - 0.8077069968914623f, - 0.807629813593966f, - 0.8075526164579508f, - 0.8074754054847401f, - 0.807398180675656f, - 0.8073209420320226f, - 0.8072436895551627f, - 0.8071664232464004f, - 0.8070891431070594f, - 0.8070118491384641f, - 0.8069345413419386f, - 0.8068572197188077f, - 0.8067798842703967f, - 0.8067025349980299f, - 0.8066251719030335f, - 0.8065477949867323f, - 0.806470404250453f, - 0.8063929996955208f, - 0.8063155813232628f, - 0.8062381491350047f, - 0.8061607031320741f, - 0.8060832433157973f, - 0.8060057696875019f, - 0.8059282822485158f, - 0.8058507810001659f, - 0.805773265943781f, - 0.8056957370806884f, - 0.8056181944122174f, - 0.805540637939696f, - 0.8054630676644536f, - 0.8053854835878193f, - 0.805307885711122f, - 0.8052302740356918f, - 0.8051526485628583f, - 0.8050750092939518f, - 0.8049973562303023f, - 0.8049196893732409f, - 0.8048420087240977f, - 0.8047643142842045f, - 0.8046866060548918f, - 0.804608884037492f, - 0.8045311482333358f, - 0.8044533986437562f, - 0.8043756352700846f, - 0.8042978581136541f, - 0.8042200671757967f, - 0.8041422624578458f, - 0.8040644439611347f, - 0.8039866116869965f, - 0.8039087656367649f, - 0.8038309058117737f, - 0.8037530322133574f, - 0.8036751448428497f, - 0.8035972437015858f, - 0.8035193287908999f, - 0.8034414001121277f, - 0.8033634576666039f, - 0.8032855014556646f, - 0.8032075314806449f, - 0.8031295477428813f, - 0.8030515502437099f, - 0.802973538984467f, - 0.8028955139664897f, - 0.8028174751911145f, - 0.8027394226596789f, - 0.8026613563735199f, - 0.8025832763339757f, - 0.8025051825423837f, - 0.8024270750000824f, - 0.8023489537084096f, - 0.8022708186687046f, - 0.8021926698823055f, - 0.8021145073505522f, - 0.8020363310747831f, - 0.8019581410563384f, - 0.8018799372965574f, - 0.8018017197967806f, - 0.801723488558348f, - 0.8016452435825996f, - 0.8015669848708769f, - 0.80148871242452f, - 0.801410426244871f, - 0.8013321263332706f, - 0.8012538126910607f, - 0.8011754853195834f, - 0.8010971442201803f, - 0.8010187893941944f, - 0.8009404208429677f, - 0.8008620385678434f, - 0.8007836425701643f, - 0.800705232851274f, - 0.8006268094125157f, - 0.8005483722552336f, - 0.800469921380771f, - 0.800391456790473f, - 0.8003129784856832f, - 0.8002344864677468f, - 0.8001559807380089f, - 0.8000774612978142f, - 0.7999989281485086f, - 0.7999203812914373f, - 0.7998418207279465f, - 0.799763246459382f, - 0.7996846584870906f, - 0.7996060568124184f, - 0.7995274414367126f, - 0.7994488123613199f, - 0.7993701695875878f, - 0.7992915131168641f, - 0.7992128429504959f, - 0.7991341590898319f, - 0.7990554615362196f, - 0.7989767502910082f, - 0.7988980253555458f, - 0.7988192867311817f, - 0.7987405344192647f, - 0.7986617684211448f, - 0.798582988738171f, - 0.7985041953716936f, - 0.7984253883230625f, - 0.798346567593628f, - 0.7982677331847409f, - 0.7981888850977515f, - 0.7981100233340116f, - 0.7980311478948717f, - 0.7979522587816841f, - 0.7978733559957997f, - 0.7977944395385712f, - 0.7977155094113503f, - 0.7976365656154899f, - 0.7975576081523421f, - 0.7974786370232603f, - 0.7973996522295976f, - 0.7973206537727071f, - 0.797241641653943f, - 0.7971626158746582f, - 0.7970835764362079f, - 0.7970045233399453f, - 0.796925456587226f, - 0.796846376179404f, - 0.7967672821178349f, - 0.7966881744038733f, - 0.7966090530388754f, - 0.7965299180241964f, - 0.7964507693611923f, - 0.7963716070512198f, - 0.7962924310956346f, - 0.7962132414957941f, - 0.7961340382530545f, - 0.7960548213687735f, - 0.7959755908443079f, - 0.7958963466810159f, - 0.7958170888802548f, - 0.7957378174433831f, - 0.7956585323717587f, - 0.7955792336667401f, - 0.7954999213296866f, - 0.7954205953619568f, - 0.79534125576491f, - 0.7952619025399057f, - 0.7951825356883034f, - 0.7951031552114634f, - 0.7950237611107454f, - 0.7949443533875102f, - 0.794864932043118f, - 0.7947854970789303f, - 0.7947060484963078f, - 0.7946265862966115f, - 0.7945471104812034f, - 0.7944676210514455f, - 0.7943881180086994f, - 0.7943086013543276f, - 0.7942290710896922f, - 0.7941495272161566f, - 0.7940699697350831f, - 0.7939903986478355f, - 0.7939108139557767f, - 0.7938312156602707f, - 0.7937516037626812f, - 0.7936719782643723f, - 0.7935923391667088f, - 0.7935126864710547f, - 0.7934330201787753f, - 0.7933533402912352f, - 0.7932736468098002f, - 0.7931939397358353f, - 0.7931142190707068f, - 0.7930344848157802f, - 0.7929547369724222f, - 0.7928749755419987f, - 0.792795200525877f, - 0.7927154119254235f, - 0.7926356097420055f, - 0.7925557939769908f, - 0.7924759646317464f, - 0.7923961217076407f, - 0.7923162652060413f, - 0.792236395128317f, - 0.7921565114758358f, - 0.7920766142499671f, - 0.7919967034520793f, - 0.7919167790835422f, - 0.7918368411457248f, - 0.7917568896399974f, - 0.7916769245677292f, - 0.7915969459302911f, - 0.7915169537290532f, - 0.7914369479653858f, - 0.7913569286406604f, - 0.7912768957562476f, - 0.7911968493135192f, - 0.7911167893138463f, - 0.7910367157586012f, - 0.7909566286491554f, - 0.7908765279868818f, - 0.7907964137731522f, - 0.7907162860093397f, - 0.7906361446968175f, - 0.7905559898369584f, - 0.7904758214311361f, - 0.7903956394807241f, - 0.7903154439870965f, - 0.790235234951627f, - 0.7901550123756905f, - 0.7900747762606611f, - 0.7899945266079141f, - 0.7899142634188241f, - 0.7898339866947668f, - 0.7897536964371173f, - 0.7896733926472516f, - 0.7895930753265459f, - 0.7895127444763758f, - 0.7894324000981184f, - 0.7893520421931499f, - 0.7892716707628478f, - 0.7891912858085884f, - 0.7891108873317498f, - 0.7890304753337092f, - 0.7889500498158447f, - 0.7888696107795341f, - 0.7887891582261558f, - 0.7887086921570886f, - 0.7886282125737107f, - 0.7885477194774019f, - 0.7884672128695406f, - 0.7883866927515069f, - 0.7883061591246798f, - 0.7882256119904401f, - 0.7881450513501673f, - 0.7880644772052419f, - 0.7879838895570447f, - 0.7879032884069562f, - 0.7878226737563581f, - 0.7877420456066309f, - 0.787661403959157f, - 0.7875807488153173f, - 0.7875000801764945f, - 0.7874193980440705f, - 0.787338702419428f, - 0.7872579933039493f, - 0.7871772706990178f, - 0.7870965346060161f, - 0.7870157850263283f, - 0.7869350219613374f, - 0.7868542454124274f, - 0.7867734553809829f, - 0.7866926518683874f, - 0.7866118348760262f, - 0.7865310044052833f, - 0.7864501604575446f, - 0.7863693030341944f, - 0.786288432136619f, - 0.7862075477662035f, - 0.7861266499243343f, - 0.7860457386123971f, - 0.7859648138317787f, - 0.7858838755838654f, - 0.7858029238700442f, - 0.7857219586917025f, - 0.7856409800502269f, - 0.7855599879470058f, - 0.7854789823834261f, - 0.7853979633608765f, - 0.7853169308807448f, - 0.78523588494442f, - 0.7851548255532901f, - 0.7850737527087446f, - 0.7849926664121722f, - 0.7849115666649629f, - 0.7848304534685056f, - 0.7847493268241907f, - 0.784668186733408f, - 0.7845870331975481f, - 0.784505866218001f, - 0.7844246857961582f, - 0.7843434919334104f, - 0.7842622846311483f, - 0.7841810638907643f, - 0.7840998297136492f, - 0.7840185821011957f, - 0.7839373210547953f, - 0.7838560465758406f, - 0.7837747586657248f, - 0.7836934573258398f, - 0.7836121425575795f, - 0.7835308143623365f, - 0.783449472741505f, - 0.7833681176964782f, - 0.7832867492286505f, - 0.7832053673394158f, - 0.7831239720301689f, - 0.7830425633023042f, - 0.7829611411572168f, - 0.7828797055963016f, - 0.7827982566209543f, - 0.7827167942325703f, - 0.7826353184325454f, - 0.7825538292222761f, - 0.7824723266031579f, - 0.7823908105765882f, - 0.782309281143963f, - 0.7822277383066799f, - 0.7821461820661356f, - 0.7820646124237279f, - 0.7819830293808543f, - 0.7819014329389126f, - 0.7818198230993014f, - 0.7817381998634184f, - 0.781656563232663f, - 0.7815749132084331f, - 0.7814932497921286f, - 0.7814115729851481f, - 0.7813298827888916f, - 0.7812481792047584f, - 0.7811664622341491f, - 0.7810847318784634f, - 0.7810029881391016f, - 0.7809212310174648f, - 0.7808394605149535f, - 0.7807576766329692f, - 0.7806758793729128f, - 0.7805940687361864f, - 0.7805122447241913f, - 0.7804304073383299f, - 0.7803485565800041f, - 0.780266692450617f, - 0.7801848149515704f, - 0.7801029240842683f, - 0.7800210198501129f, - 0.7799391022505081f, - 0.7798571712868578f, - 0.7797752269605652f, - 0.7796932692730351f, - 0.7796112982256712f, - 0.7795293138198786f, - 0.7794473160570615f, - 0.7793653049386254f, - 0.7792832804659753f, - 0.7792012426405168f, - 0.7791191914636554f, - 0.7790371269367973f, - 0.7789550490613483f, - 0.7788729578387149f, - 0.7787908532703042f, - 0.7787087353575222f, - 0.7786266041017766f, - 0.7785444595044745f, - 0.7784623015670235f, - 0.778380130290831f, - 0.7782979456773056f, - 0.7782157477278548f, - 0.7781335364438878f, - 0.7780513118268125f, - 0.7779690738780383f, - 0.7778868225989743f, - 0.7778045579910299f, - 0.7777222800556142f, - 0.7776399887941375f, - 0.7775576842080096f, - 0.777475366298641f, - 0.7773930350674418f, - 0.7773106905158232f, - 0.7772283326451958f, - 0.777145961456971f, - 0.7770635769525602f, - 0.7769811791333746f, - 0.7768987680008265f, - 0.7768163435563281f, - 0.7767339058012912f, - 0.776651454737129f, - 0.7765689903652537f, - 0.7764865126870788f, - 0.776404021704017f, - 0.7763215174174823f, - 0.7762389998288879f, - 0.7761564689396482f, - 0.7760739247511768f, - 0.7759913672648884f, - 0.7759087964821978f, - 0.7758262124045193f, - 0.7757436150332685f, - 0.7756610043698603f, - 0.7755783804157105f, - 0.7754957431722345f, - 0.7754130926408486f, - 0.7753304288229687f, - 0.7752477517200115f, - 0.7751650613333934f, - 0.7750823576645315f, - 0.7749996407148426f, - 0.7749169104857443f, - 0.7748341669786543f, - 0.7747514101949899f, - 0.7746686401361697f, - 0.7745858568036114f, - 0.7745030601987338f, - 0.7744202503229554f, - 0.7743374271776955f, - 0.7742545907643726f, - 0.7741717410844069f, - 0.7740888781392171f, - 0.774006001930224f, - 0.7739231124588467f, - 0.7738402097265062f, - 0.7737572937346229f, - 0.7736743644846171f, - 0.7735914219779103f, - 0.7735084662159233f, - 0.7734254972000779f, - 0.7733425149317954f, - 0.7732595194124979f, - 0.7731765106436074f, - 0.7730934886265464f, - 0.7730104533627371f, - 0.7729274048536025f, - 0.7728443431005659f, - 0.7727612681050501f, - 0.7726781798684789f, - 0.7725950783922756f, - 0.7725119636778646f, - 0.7724288357266695f, - 0.7723456945401154f, - 0.772262540119626f, - 0.772179372466627f, - 0.7720961915825428f, - 0.7720129974687993f, - 0.7719297901268213f, - 0.7718465695580349f, - 0.7717633357638662f, - 0.7716800887457411f, - 0.7715968285050865f, - 0.7715135550433283f, - 0.7714302683618941f, - 0.7713469684622104f, - 0.7712636553457051f, - 0.7711803290138051f, - 0.7710969894679387f, - 0.7710136367095335f, - 0.770930270740018f, - 0.7708468915608208f, - 0.7707634991733701f, - 0.7706800935790953f, - 0.7705966747794251f, - 0.7705132427757893f, - 0.7704297975696172f, - 0.7703463391623384f, - 0.7702628675553835f, - 0.7701793827501823f, - 0.7700958847481655f, - 0.7700123735507637f, - 0.769928849159408f, - 0.7698453115755293f, - 0.7697617608005595f, - 0.7696781968359294f, - 0.7695946196830719f, - 0.769511029343418f, - 0.7694274258184008f, - 0.7693438091094524f, - 0.7692601792180058f, - 0.7691765361454937f, - 0.7690928798933497f, - 0.7690092104630067f, - 0.7689255278558986f, - 0.7688418320734596f, - 0.7687581231171233f, - 0.7686744009883244f, - 0.7685906656884971f, - 0.7685069172190767f, - 0.7684231555814977f, - 0.7683393807771957f, - 0.7682555928076056f, - 0.7681717916741638f, - 0.7680879773783057f, - 0.7680041499214679f, - 0.7679203093050861f, - 0.7678364555305973f, - 0.7677525885994386f, - 0.7676687085130464f, - 0.7675848152728585f, - 0.767500908880312f, - 0.767416989336845f, - 0.7673330566438948f, - 0.7672491108029005f, - 0.7671651518152995f, - 0.7670811796825312f, - 0.7669971944060339f, - 0.7669131959872472f, - 0.7668291844276096f, - 0.7667451597285616f, - 0.766661121891542f, - 0.7665770709179915f, - 0.7664930068093498f, - 0.7664089295670578f, - 0.7663248391925557f, - 0.7662407356872843f, - 0.7661566190526852f, - 0.7660724892901991f, - 0.7659883464012682f, - 0.7659041903873336f, - 0.7658200212498376f, - 0.7657358389902228f, - 0.7656516436099309f, - 0.7655674351104053f, - 0.7654832134930881f, - 0.7653989787594233f, - 0.7653147309108534f, - 0.7652304699488226f, - 0.7651461958747743f, - 0.7650619086901528f, - 0.7649776083964019f, - 0.7648932949949664f, - 0.7648089684872912f, - 0.7647246288748206f, - 0.7646402761590004f, - 0.7645559103412753f, - 0.7644715314230917f, - 0.7643871394058945f, - 0.7643027342911306f, - 0.7642183160802454f, - 0.7641338847746861f, - 0.764049440375899f, - 0.7639649828853313f, - 0.7638805123044298f, - 0.763796028634642f, - 0.7637115318774159f, - 0.7636270220341989f, - 0.7635424991064393f, - 0.763457963095585f, - 0.7633734140030851f, - 0.7632888518303876f, - 0.7632042765789422f, - 0.7631196882501974f, - 0.7630350868456033f, - 0.762950472366609f, - 0.7628658448146642f, - 0.7627812041912195f, - 0.7626965504977248f, - 0.7626118837356309f, - 0.7625272039063882f, - 0.7624425110114481f, - 0.7623578050522613f, - 0.7622730860302798f, - 0.7621883539469545f, - 0.762103608803738f, - 0.7620188506020819f, - 0.7619340793434387f, - 0.7618492950292608f, - 0.761764497661001f, - 0.7616796872401126f, - 0.7615948637680483f, - 0.7615100272462619f, - 0.7614251776762069f, - 0.7613403150593372f, - 0.7612554393971067f, - 0.7611705506909703f, - 0.7610856489423817f, - 0.7610007341527966f, - 0.7609158063236691f, - 0.7608308654564551f, - 0.7607459115526095f, - 0.7606609446135882f, - 0.7605759646408475f, - 0.7604909716358428f, - 0.7604059656000309f, - 0.7603209465348681f, - 0.7602359144418116f, - 0.7601508693223177f, - 0.7600658111778443f, - 0.7599807400098484f, - 0.759895655819788f, - 0.7598105586091205f, - 0.7597254483793046f, - 0.7596403251317985f, - 0.7595551888680606f, - 0.7594700395895495f, - 0.7593848772977247f, - 0.7592997019940451f, - 0.7592145136799703f, - 0.7591293123569597f, - 0.7590440980264738f, - 0.7589588706899723f, - 0.7588736303489152f, - 0.7587883770047638f, - 0.7587031106589783f, - 0.75861783131302f, - 0.7585325389683503f, - 0.7584472336264303f, - 0.758361915288722f, - 0.758276583956687f, - 0.7581912396317878f, - 0.7581058823154864f, - 0.7580205120092456f, - 0.757935128714528f, - 0.7578497324327969f, - 0.7577643231655151f, - 0.7576789009141464f, - 0.7575934656801547f, - 0.7575080174650033f, - 0.7574225562701571f, - 0.7573370820970795f, - 0.757251594947236f, - 0.7571660948220909f, - 0.7570805817231094f, - 0.7569950556517564f, - 0.7569095166094979f, - 0.7568239645977991f, - 0.7567383996181264f, - 0.7566528216719455f, - 0.7565672307607227f, - 0.7564816268859251f, - 0.7563960100490191f, - 0.756310380251472f, - 0.7562247374947505f, - 0.7561390817803229f, - 0.7560534131096559f, - 0.7559677314842184f, - 0.7558820369054776f, - 0.7557963293749027f, - 0.7557106088939616f, - 0.7556248754641236f, - 0.7555391290868573f, - 0.7554533697636323f, - 0.755367597495918f, - 0.7552818122851837f, - 0.7551960141328998f, - 0.7551102030405361f, - 0.7550243790095632f, - 0.7549385420414514f, - 0.7548526921376718f, - 0.754766829299695f, - 0.7546809535289928f, - 0.7545950648270361f, - 0.7545091631952967f, - 0.754423248635247f, - 0.7543373211483584f, - 0.754251380736104f, - 0.7541654273999555f, - 0.7540794611413866f, - 0.7539934819618695f, - 0.7539074898628781f, - 0.7538214848458852f, - 0.7537354669123651f, - 0.7536494360637912f, - 0.7535633923016378f, - 0.7534773356273795f, - 0.7533912660424903f, - 0.7533051835484457f, - 0.7532190881467199f, - 0.7531329798387888f, - 0.7530468586261273f, - 0.7529607245102117f, - 0.7528745774925171f, - 0.7527884175745203f, - 0.7527022447576971f, - 0.7526160590435246f, - 0.7525298604334789f, - 0.7524436489290374f, - 0.7523574245316774f, - 0.7522711872428761f, - 0.7521849370641114f, - 0.7520986739968608f, - 0.7520123980426029f, - 0.7519261092028157f, - 0.7518398074789774f, - 0.7517534928725675f, - 0.7516671653850643f, - 0.7515808250179475f, - 0.7514944717726961f, - 0.7514081056507902f, - 0.7513217266537091f, - 0.7512353347829336f, - 0.7511489300399432f, - 0.7510625124262191f, - 0.7509760819432415f, - 0.7508896385924919f, - 0.750803182375451f, - 0.7507167132936007f, - 0.7506302313484219f, - 0.7505437365413972f, - 0.7504572288740081f, - 0.7503707083477371f, - 0.7502841749640671f, - 0.75019762872448f, - 0.7501110696304596f, - 0.7500244976834884f, - 0.7499379128850504f, - 0.7498513152366285f, - 0.7497647047397072f, - 0.74967808139577f, - 0.7495914452063016f, - 0.7495047961727861f, - 0.7494181342967086f, - 0.7493314595795536f, - 0.7492447720228065f, - 0.7491580716279529f, - 0.7490713583964779f, - 0.7489846323298678f, - 0.748897893429608f, - 0.7488111416971854f, - 0.748724377134086f, - 0.748637599741797f, - 0.7485508095218046f, - 0.7484640064755966f, - 0.7483771906046599f, - 0.7482903619104824f, - 0.7482035203945514f, - 0.7481166660583556f, - 0.7480297989033825f, - 0.7479429189311211f, - 0.7478560261430599f, - 0.7477691205406874f, - 0.7476822021254934f, - 0.7475952708989666f, - 0.747508326862597f, - 0.747421370017874f, - 0.747334400366288f, - 0.7472474179093286f, - 0.7471604226484866f, - 0.7470734145852529f, - 0.7469863937211177f, - 0.7468993600575728f, - 0.746812313596109f, - 0.746725254338218f, - 0.7466381822853914f, - 0.7465510974391215f, - 0.7464639998009f, - 0.7463768893722197f, - 0.7462897661545728f, - 0.7462026301494524f, - 0.7461154813583518f, - 0.7460283197827637f, - 0.7459411454241822f, - 0.7458539582841004f, - 0.7457667583640128f, - 0.7456795456654131f, - 0.7455923201897959f, - 0.7455050819386556f, - 0.7454178309134875f, - 0.7453305671157857f, - 0.7452432905470464f, - 0.7451560012087645f, - 0.7450686991024357f, - 0.7449813842295563f, - 0.7448940565916219f, - 0.7448067161901294f, - 0.7447193630265747f, - 0.7446319971024552f, - 0.7445446184192673f, - 0.7444572269785088f, - 0.7443698227816768f, - 0.7442824058302688f, - 0.7441949761257831f, - 0.7441075336697173f, - 0.7440200784635702f, - 0.7439326105088397f, - 0.7438451298070252f, - 0.7437576363596251f, - 0.7436701301681392f, - 0.7435826112340662f, - 0.7434950795589063f, - 0.7434075351441588f, - 0.7433199779913243f, - 0.7432324081019025f, - 0.7431448254773945f, - 0.7430572301193004f, - 0.7429696220291213f, - 0.7428820012083589f, - 0.7427943676585137f, - 0.7427067213810881f, - 0.742619062377583f, - 0.7425313906495012f, - 0.7424437061983445f, - 0.7423560090256157f, - 0.7422682991328169f, - 0.7421805765214516f, - 0.7420928411930225f, - 0.742005093149033f, - 0.7419173323909869f, - 0.7418295589203875f, - 0.7417417727387393f, - 0.7416539738475458f, - 0.7415661622483123f, - 0.7414783379425426f, - 0.7413905009317422f, - 0.7413026512174156f, - 0.7412147888010685f, - 0.741126913684206f, - 0.7410390258683345f, - 0.740951125354959f, - 0.7408632121455863f, - 0.7407752862417228f, - 0.7406873476448749f, - 0.7405993963565491f, - 0.7405114323782531f, - 0.7404234557114935f, - 0.7403354663577782f, - 0.7402474643186145f, - 0.7401594495955107f, - 0.7400714221899748f, - 0.7399833821035146f, - 0.7398953293376394f, - 0.7398072638938573f, - 0.7397191857736777f, - 0.7396310949786099f, - 0.7395429915101628f, - 0.7394548753698467f, - 0.7393667465591707f, - 0.7392786050796456f, - 0.739190450932781f, - 0.7391022841200882f, - 0.7390141046430769f, - 0.7389259125032589f, - 0.7388377077021449f, - 0.7387494902412463f, - 0.7386612601220749f, - 0.7385730173461422f, - 0.7384847619149607f, - 0.738396493830042f, - 0.7383082130928991f, - 0.7382199197050442f, - 0.7381316136679907f, - 0.7380432949832512f, - 0.7379549636523394f, - 0.7378666196767684f, - 0.7377782630580525f, - 0.7376898937977051f, - 0.7376015118972407f, - 0.7375131173581739f, - 0.7374247101820188f, - 0.7373362903702909f, - 0.7372478579245044f, - 0.7371594128461755f, - 0.7370709551368189f, - 0.7369824847979508f, - 0.7368940018310867f, - 0.7368055062377432f, - 0.7367169980194361f, - 0.7366284771776827f, - 0.7365399437139992f, - 0.7364513976299025f, - 0.7363628389269105f, - 0.7362742676065397f, - 0.7361856836703086f, - 0.7360970871197344f, - 0.7360084779563358f, - 0.7359198561816305f, - 0.7358312217971374f, - 0.7357425748043751f, - 0.7356539152048627f, - 0.7355652430001188f, - 0.7354765581916634f, - 0.735387860781016f, - 0.7352991507696961f, - 0.7352104281592241f, - 0.7351216929511197f, - 0.7350329451469041f, - 0.7349441847480973f, - 0.7348554117562207f, - 0.7347666261727948f, - 0.7346778279993417f, - 0.734589017237382f, - 0.734500193888438f, - 0.734411357954032f, - 0.7343225094356854f, - 0.7342336483349213f, - 0.7341447746532618f, - 0.7340558883922301f, - 0.7339669895533489f, - 0.7338780781381419f, - 0.7337891541481318f, - 0.7337002175848433f, - 0.7336112684497994f, - 0.7335223067445249f, - 0.7334333324705437f, - 0.7333443456293803f, - 0.73325534622256f, - 0.7331663342516072f, - 0.7330773097180475f, - 0.7329882726234063f, - 0.7328992229692087f, - 0.7328101607569812f, - 0.7327210859882494f, - 0.7326319986645399f, - 0.7325428987873788f, - 0.7324537863582933f, - 0.7323646613788097f, - 0.7322755238504559f, - 0.7321863737747585f, - 0.7320972111532457f, - 0.7320080359874446f, - 0.731918848278884f, - 0.7318296480290912f, - 0.7317404352395955f, - 0.7316512099119248f, - 0.7315619720476085f, - 0.7314727216481753f, - 0.7313834587151549f, - 0.7312941832500762f, - 0.7312048952544692f, - 0.7311155947298642f, - 0.7310262816777907f, - 0.7309369560997797f, - 0.7308476179973611f, - 0.7307582673720663f, - 0.7306689042254256f, - 0.7305795285589711f, - 0.7304901403742334f, - 0.7304007396727448f, - 0.7303113264560365f, - 0.730221900725641f, - 0.7301324624830907f, - 0.7300430117299177f, - 0.7299535484676553f, - 0.7298640726978355f, - 0.7297745844219925f, - 0.7296850836416587f, - 0.7295955703583686f, - 0.7295060445736552f, - 0.729416506289053f, - 0.7293269555060957f, - 0.7292373922263184f, - 0.7291478164512551f, - 0.7290582281824414f, - 0.7289686274214114f, - 0.7288790141697014f, - 0.728789388428846f, - 0.7286997502003816f, - 0.7286100994858439f, - 0.7285204362867687f, - 0.7284307606046929f, - 0.7283410724411524f, - 0.7282513717976848f, - 0.7281616586758265f, - 0.728071933077115f, - 0.7279821950030876f, - 0.7278924444552817f, - 0.7278026814352357f, - 0.7277129059444872f, - 0.727623117984575f, - 0.7275333175570369f, - 0.7274435046634122f, - 0.7273536793052393f, - 0.727263841484058f, - 0.7271739912014069f, - 0.7270841284588261f, - 0.726994253257855f, - 0.7269043656000338f, - 0.7268144654869029f, - 0.7267245529200022f, - 0.726634627900873f, - 0.7265446904310554f, - 0.7264547405120911f, - 0.7263647781455208f, - 0.7262748033328865f, - 0.7261848160757295f, - 0.726094816375592f, - 0.7260048042340158f, - 0.7259147796525437f, - 0.7258247426327177f, - 0.7257346931760807f, - 0.7256446312841762f, - 0.7255545569585466f, - 0.7254644702007361f, - 0.7253743710122875f, - 0.7252842593947454f, - 0.725194135349653f, - 0.7251039988785555f, - 0.7250138499829968f, - 0.7249236886645213f, - 0.7248335149246746f, - 0.7247433287650011f, - 0.7246531301870468f, - 0.7245629191923566f, - 0.7244726957824769f, - 0.7243824599589528f, - 0.7242922117233314f, - 0.7242019510771582f, - 0.7241116780219806f, - 0.7240213925593447f, - 0.7239310946907982f, - 0.7238407844178876f, - 0.7237504617421611f, - 0.7236601266651655f, - 0.7235697791884493f, - 0.7234794193135606f, - 0.7233890470420473f, - 0.7232986623754584f, - 0.723208265315342f, - 0.7231178558632476f, - 0.7230274340207239f, - 0.7229369997893207f, - 0.722846553170587f, - 0.7227560941660732f, - 0.7226656227773288f, - 0.7225751390059041f, - 0.7224846428533499f, - 0.7223941343212162f, - 0.7223036134110545f, - 0.7222130801244152f, - 0.7221225344628502f, - 0.7220319764279104f, - 0.7219414060211481f, - 0.7218508232441144f, - 0.7217602280983623f, - 0.7216696205854433f, - 0.7215790007069106f, - 0.7214883684643164f, - 0.7213977238592143f, - 0.7213070668931567f, - 0.7212163975676976f, - 0.7211257158843902f, - 0.7210350218447888f, - 0.7209443154504467f, - 0.7208535967029189f, - 0.7207628656037592f, - 0.7206721221545228f, - 0.7205813663567642f, - 0.7204905982120383f, - 0.7203998177219006f, - 0.720309024887907f, - 0.7202182197116126f, - 0.7201274021945738f, - 0.7200365723383463f, - 0.7199457301444869f, - 0.7198548756145516f, - 0.7197640087500978f, - 0.7196731295526819f, - 0.7195822380238617f, - 0.7194913341651938f, - 0.7194004179782367f, - 0.7193094894645474f, - 0.7192185486256845f, - 0.7191275954632063f, - 0.7190366299786706f, - 0.7189456521736369f, - 0.7188546620496633f, - 0.7187636596083097f, - 0.7186726448511346f, - 0.7185816177796982f, - 0.7184905783955596f, - 0.7183995267002793f, - 0.7183084626954169f, - 0.7182173863825335f, - 0.7181262977631888f, - 0.718035196838944f, - 0.7179440836113604f, - 0.7178529580819987f, - 0.7177618202524206f, - 0.7176706701241875f, - 0.7175795076988616f, - 0.7174883329780043f, - 0.7173971459631786f, - 0.7173059466559464f, - 0.7172147350578708f, - 0.7171235111705142f, - 0.7170322749954403f, - 0.7169410265342121f, - 0.7168497657883928f, - 0.7167584927595466f, - 0.7166672074492371f, - 0.7165759098590289f, - 0.7164845999904857f, - 0.7163932778451728f, - 0.7163019434246544f, - 0.7162105967304959f, - 0.7161192377642621f, - 0.7160278665275188f, - 0.7159364830218313f, - 0.7158450872487655f, - 0.7157536792098879f, - 0.715662258906764f, - 0.7155708263409609f, - 0.7154793815140448f, - 0.7153879244275831f, - 0.7152964550831422f, - 0.7152049734822902f, - 0.7151134796265938f, - 0.7150219735176214f, - 0.7149304551569404f, - 0.7148389245461193f, - 0.7147473816867266f, - 0.7146558265803302f, - 0.7145642592284996f, - 0.7144726796328033f, - 0.7143810877948108f, - 0.7142894837160912f, - 0.7141978673982146f, - 0.71410623884275f, - 0.7140145980512683f, - 0.7139229450253392f, - 0.7138312797665334f, - 0.7137396022764213f, - 0.7136479125565739f, - 0.7135562106085626f, - 0.7134644964339582f, - 0.7133727700343326f, - 0.7132810314112573f, - 0.713189280566304f, - 0.7130975175010453f, - 0.713005742217053f, - 0.7129139547159002f, - 0.7128221549991592f, - 0.7127303430684034f, - 0.7126385189252055f, - 0.7125466825711393f, - 0.7124548340077779f, - 0.7123629732366956f, - 0.7122711002594662f, - 0.7121792150776639f, - 0.712087317692863f, - 0.7119954081066386f, - 0.711903486320565f, - 0.7118115523362177f, - 0.7117196061551714f, - 0.7116276477790023f, - 0.7115356772092855f, - 0.7114436944475969f, - 0.7113516994955132f, - 0.7112596923546101f, - 0.7111676730264646f, - 0.7110756415126527f, - 0.7109835978147522f, - 0.7108915419343395f, - 0.7107994738729926f, - 0.7107073936322884f, - 0.7106153012138055f, - 0.7105231966191209f, - 0.7104310798498132f, - 0.7103389509074614f, - 0.7102468097936432f, - 0.7101546565099381f, - 0.7100624910579245f, - 0.7099703134391823f, - 0.7098781236552902f, - 0.7097859217078286f, - 0.7096937075983767f, - 0.7096014813285151f, - 0.7095092428998235f, - 0.7094169923138831f, - 0.7093247295722738f, - 0.7092324546765773f, - 0.7091401676283738f, - 0.7090478684292456f, - 0.7089555570807736f, - 0.7088632335845395f, - 0.7087708979421257f, - 0.7086785501551136f, - 0.7085861902250864f, - 0.7084938181536259f, - 0.7084014339423157f, - 0.7083090375927378f, - 0.708216629106476f, - 0.7081242084851139f, - 0.7080317757302345f, - 0.7079393308434222f, - 0.7078468738262603f, - 0.7077544046803339f, - 0.7076619234072267f, - 0.7075694300085238f, - 0.7074769244858096f, - 0.7073844068406698f, - 0.707291877074689f, - 0.7071993351894532f, - 0.7071067811865476f, - 0.7070142150675583f, - 0.7069216368340717f, - 0.7068290464876736f, - 0.7067364440299511f, - 0.7066438294624902f, - 0.7065512027868786f, - 0.7064585640047025f, - 0.7063659131175501f, - 0.7062732501270085f, - 0.7061805750346657f, - 0.7060878878421093f, - 0.705995188550928f, - 0.7059024771627096f, - 0.7058097536790429f, - 0.7057170181015171f, - 0.7056242704317205f, - 0.705531510671243f, - 0.7054387388216734f, - 0.7053459548846018f, - 0.7052531588616175f, - 0.7051603507543114f, - 0.705067530564273f, - 0.7049746982930927f, - 0.7048818539423616f, - 0.7047889975136702f, - 0.7046961290086099f, - 0.7046032484287716f, - 0.7045103557757473f, - 0.7044174510511281f, - 0.7043245342565064f, - 0.7042316053934738f, - 0.7041386644636233f, - 0.7040457114685466f, - 0.7039527464098372f, - 0.7038597692890873f, - 0.7037667801078908f, - 0.7036737788678403f, - 0.7035807655705297f, - 0.7034877402175531f, - 0.7033947028105039f, - 0.7033016533509767f, - 0.7032085918405654f, - 0.7031155182808652f, - 0.7030224326734701f, - 0.702929335019976f, - 0.7028362253219772f, - 0.7027431035810701f, - 0.7026499697988492f, - 0.702556823976911f, - 0.7024636661168517f, - 0.702370496220267f, - 0.702277314288754f, - 0.7021841203239085f, - 0.7020909143273282f, - 0.7019976963006094f, - 0.7019044662453501f, - 0.701811224163147f, - 0.7017179700555985f, - 0.7016247039243019f, - 0.7015314257708558f, - 0.701438135596858f, - 0.7013448334039075f, - 0.7012515191936025f, - 0.7011581929675424f, - 0.7010648547273258f, - 0.7009715044745527f, - 0.7008781422108219f, - 0.7007847679377338f, - 0.700691381656888f, - 0.7005979833698844f, - 0.7005045730783239f, - 0.7004111507838066f, - 0.7003177164879333f, - 0.7002242701923054f, - 0.7001308118985237f, - 0.7000373416081898f, - 0.6999438593229049f, - 0.6998503650442714f, - 0.6997568587738907f, - 0.6996633405133657f, - 0.6995698102642979f, - 0.6994762680282907f, - 0.6993827138069464f, - 0.6992891476018684f, - 0.6991955694146597f, - 0.6991019792469236f, - 0.6990083771002644f, - 0.6989147629762851f, - 0.6988211368765905f, - 0.6987274988027843f, - 0.6986338487564714f, - 0.6985401867392559f, - 0.6984465127527434f, - 0.6983528267985382f, - 0.6982591288782464f, - 0.6981654189934726f, - 0.6980716971458231f, - 0.697977963336904f, - 0.6978842175683206f, - 0.6977904598416802f, - 0.6976966901585883f, - 0.6976029085206524f, - 0.697509114929479f, - 0.6974153093866755f, - 0.6973214918938488f, - 0.6972276624526071f, - 0.6971338210645575f, - 0.6970399677313084f, - 0.6969461024544679f, - 0.6968522252356437f, - 0.6967583360764453f, - 0.6966644349784809f, - 0.6965705219433598f, - 0.6964765969726906f, - 0.6963826600680835f, - 0.6962887112311472f, - 0.6961947504634924f, - 0.6961007777667283f, - 0.6960067931424657f, - 0.6959127965923144f, - 0.6958187881178854f, - 0.6957247677207897f, - 0.6956307354026379f, - 0.6955366911650416f, - 0.6954426350096117f, - 0.6953485669379604f, - 0.6952544869516989f, - 0.69516039505244f, - 0.6950662912417952f, - 0.6949721755213776f, - 0.6948780478927993f, - 0.6947839083576736f, - 0.6946897569176129f, - 0.6945955935742311f, - 0.6945014183291417f, - 0.6944072311839578f, - 0.6943130321402939f, - 0.6942188211997635f, - 0.6941245983639814f, - 0.6940303636345615f, - 0.6939361170131193f, - 0.6938418585012687f, - 0.6937475881006258f, - 0.6936533058128049f, - 0.6935590116394225f, - 0.6934647055820933f, - 0.6933703876424339f, - 0.6932760578220604f, - 0.693181716122589f, - 0.6930873625456359f, - 0.6929929970928183f, - 0.6928986197657526f, - 0.6928042305660567f, - 0.6927098294953471f, - 0.692615416555242f, - 0.6925209917473585f, - 0.6924265550733153f, - 0.6923321065347298f, - 0.692237646133221f, - 0.6921431738704068f, - 0.6920486897479067f, - 0.6919541937673389f, - 0.6918596859303232f, - 0.6917651662384785f, - 0.6916706346934248f, - 0.6915760912967814f, - 0.6914815360501687f, - 0.6913869689552065f, - 0.6912923900135156f, - 0.6911977992267161f, - 0.691103196596429f, - 0.6910085821242757f, - 0.6909139558118766f, - 0.690819317660854f, - 0.6907246676728286f, - 0.690630005849423f, - 0.6905353321922585f, - 0.690440646702958f, - 0.6903459493831432f, - 0.6902512402344373f, - 0.6901565192584627f, - 0.6900617864568425f, - 0.6899670418312003f, - 0.6898722853831589f, - 0.6897775171143428f, - 0.6896827370263747f, - 0.6895879451208797f, - 0.6894931413994813f, - 0.6893983258638045f, - 0.6893034985154731f, - 0.689208659356113f, - 0.6891138083873484f, - 0.6890189456108051f, - 0.688924071028108f, - 0.6888291846408835f, - 0.6887342864507565f, - 0.688639376459354f, - 0.6885444546683019f, - 0.6884495210792262f, - 0.6883545756937542f, - 0.6882596185135124f, - 0.6881646495401281f, - 0.6880696687752281f, - 0.6879746762204406f, - 0.6878796718773926f, - 0.6877846557477123f, - 0.687689627833028f, - 0.6875945881349674f, - 0.6874995366551596f, - 0.6874044733952327f, - 0.6873093983568161f, - 0.6872143115415383f, - 0.6871192129510294f, - 0.687024102586918f, - 0.6869289804508345f, - 0.6868338465444083f, - 0.6867387008692699f, - 0.6866435434270491f, - 0.6865483742193768f, - 0.6864531932478838f, - 0.6863580005142005f, - 0.6862627960199585f, - 0.6861675797667887f, - 0.6860723517563231f, - 0.6859771119901927f, - 0.6858818604700302f, - 0.685786597197467f, - 0.6856913221741361f, - 0.6855960354016692f, - 0.6855007368816994f, - 0.6854054266158602f, - 0.6853101046057838f, - 0.6852147708531041f, - 0.6851194253594542f, - 0.6850240681264684f, - 0.6849286991557799f, - 0.6848333184490235f, - 0.6847379260078332f, - 0.6846425218338432f, - 0.6845471059286888f, - 0.6844516782940044f, - 0.6843562389314258f, - 0.6842607878425876f, - 0.684165325029126f, - 0.684069850492676f, - 0.6839743642348742f, - 0.6838788662573563f, - 0.6837833565617589f, - 0.6836878351497182f, - 0.6835923020228716f, - 0.6834967571828551f, - 0.6834012006313066f, - 0.683305632369863f, - 0.6832100524001622f, - 0.6831144607238414f, - 0.6830188573425389f, - 0.6829232422578931f, - 0.6828276154715418f, - 0.682731976985124f, - 0.682636326800278f, - 0.6825406649186432f, - 0.6824449913418582f, - 0.682349306071563f, - 0.6822536091093965f, - 0.6821579004569989f, - 0.6820621801160097f, - 0.6819664480880694f, - 0.6818707043748186f, - 0.681774948977897f, - 0.6816791818989463f, - 0.6815834031396066f, - 0.6814876127015198f, - 0.6813918105863265f, - 0.6812959967956689f, - 0.6812001713311882f, - 0.6811043341945269f, - 0.6810084853873265f, - 0.6809126249112301f, - 0.6808167527678793f, - 0.6807208689589179f, - 0.6806249734859879f, - 0.6805290663507332f, - 0.6804331475547964f, - 0.680337217099822f, - 0.6802412749874527f, - 0.6801453212193332f, - 0.6800493557971075f, - 0.6799533787224193f, - 0.6798573899969141f, - 0.6797613896222359f, - 0.6796653776000299f, - 0.6795693539319416f, - 0.6794733186196157f, - 0.6793772716646983f, - 0.6792812130688347f, - 0.6791851428336713f, - 0.6790890609608535f, - 0.6789929674520286f, - 0.6788968623088423f, - 0.678800745532942f, - 0.678704617125974f, - 0.6786084770895859f, - 0.6785123254254247f, - 0.6784161621351381f, - 0.6783199872203741f, - 0.6782238006827802f, - 0.678127602524005f, - 0.6780313927456961f, - 0.6779351713495028f, - 0.6778389383370732f, - 0.6777426937100569f, - 0.6776464374701022f, - 0.6775501696188593f, - 0.677453890157977f, - 0.6773575990891052f, - 0.6772612964138942f, - 0.6771649821339937f, - 0.6770686562510544f, - 0.6769723187667263f, - 0.6768759696826607f, - 0.6767796090005079f, - 0.6766832367219198f, - 0.6765868528485468f, - 0.6764904573820412f, - 0.6763940503240541f, - 0.6762976316762379f, - 0.6762012014402446f, - 0.6761047596177261f, - 0.6760083062103355f, - 0.6759118412197247f, - 0.6758153646475477f, - 0.6757188764954565f, - 0.6756223767651053f, - 0.6755258654581469f, - 0.6754293425762355f, - 0.6753328081210246f, - 0.6752362620941688f, - 0.6751397044973216f, - 0.675043135332138f, - 0.6749465546002731f, - 0.6748499623033809f, - 0.6747533584431173f, - 0.6746567430211369f, - 0.6745601160390957f, - 0.6744634774986489f, - 0.6743668274014529f, - 0.6742701657491632f, - 0.6741734925434367f, - 0.6740768077859292f, - 0.6739801114782981f, - 0.6738834036221995f, - 0.6737866842192908f, - 0.6736899532712296f, - 0.6735932107796728f, - 0.6734964567462787f, - 0.6733996911727043f, - 0.6733029140606085f, - 0.6732061254116488f, - 0.6731093252274845f, - 0.6730125135097733f, - 0.6729156902601748f, - 0.6728188554803475f, - 0.6727220091719508f, - 0.6726251513366446f, - 0.6725282819760878f, - 0.672431401091941f, - 0.6723345086858638f, - 0.672237604759516f, - 0.6721406893145587f, - 0.6720437623526522f, - 0.6719468238754576f, - 0.6718498738846352f, - 0.6717529123818473f, - 0.6716559393687547f, - 0.6715589548470186f, - 0.6714619588183013f, - 0.671364951284265f, - 0.6712679322465713f, - 0.6711709017068834f, - 0.6710738596668631f, - 0.6709768061281737f, - 0.6708797410924777f, - 0.670782664561439f, - 0.6706855765367201f, - 0.6705884770199855f, - 0.670491366012898f, - 0.6703942435171226f, - 0.6702971095343226f, - 0.6701999640661627f, - 0.6701028071143077f, - 0.670005638680422f, - 0.6699084587661709f, - 0.6698112673732189f, - 0.6697140645032323f, - 0.6696168501578758f, - 0.6695196243388157f, - 0.6694223870477175f, - 0.6693251382862478f, - 0.6692278780560724f, - 0.669130606358858f, - 0.669033323196272f, - 0.6689360285699801f, - 0.6688387224816507f, - 0.66874140493295f, - 0.6686440759255463f, - 0.6685467354611068f, - 0.6684493835412998f, - 0.6683520201677929f, - 0.6682546453422551f, - 0.6681572590663541f, - 0.6680598613417593f, - 0.6679624521701389f, - 0.6678650315531628f, - 0.6677675994924994f, - 0.6676701559898189f, - 0.6675727010467907f, - 0.6674752346650843f, - 0.6673777568463704f, - 0.6672802675923185f, - 0.6671827669046f, - 0.6670852547848846f, - 0.6669877312348439f, - 0.6668901962561483f, - 0.6667926498504694f, - 0.6666950920194789f, - 0.6665975227648477f, - 0.6664999420882485f, - 0.6664023499913524f, - 0.6663047464758325f, - 0.6662071315433604f, - 0.6661095051956094f, - 0.6660118674342517f, - 0.6659142182609609f, - 0.6658165576774094f, - 0.6657188856852716f, - 0.6656212022862201f, - 0.6655235074819292f, - 0.6654258012740731f, - 0.6653280836643254f, - 0.665230354654361f, - 0.6651326142458538f, - 0.6650348624404793f, - 0.6649370992399118f, - 0.6648393246458271f, - 0.6647415386598998f, - 0.6646437412838062f, - 0.6645459325192213f, - 0.6644481123678214f, - 0.6643502808312829f, - 0.6642524379112815f, - 0.6641545836094944f, - 0.6640567179275976f, - 0.6639588408672686f, - 0.6638609524301841f, - 0.6637630526180216f, - 0.6636651414324587f, - 0.6635672188751724f, - 0.6634692849478416f, - 0.6633713396521435f, - 0.6632733829897569f, - 0.6631754149623598f, - 0.6630774355716315f, - 0.6629794448192501f, - 0.6628814427068954f, - 0.6627834292362459f, - 0.6626854044089817f, - 0.6625873682267819f, - 0.6624893206913268f, - 0.6623912618042959f, - 0.6622931915673699f, - 0.6621951099822287f, - 0.6620970170505532f, - 0.6619989127740246f, - 0.661900797154323f, - 0.6618026701931305f, - 0.6617045318921277f, - 0.6616063822529968f, - 0.661508221277419f, - 0.6614100489670769f, - 0.6613118653236518f, - 0.661213670348827f, - 0.6611154640442843f, - 0.661017246411707f, - 0.6609190174527775f, - 0.6608207771691792f, - 0.6607225255625956f, - 0.6606242626347099f, - 0.6605259883872061f, - 0.6604277028217675f, - 0.6603294059400793f, - 0.6602310977438245f, - 0.6601327782346886f, - 0.6600344474143557f, - 0.6599361052845111f, - 0.6598377518468392f, - 0.6597393871030262f, - 0.6596410110547566f, - 0.6595426237037169f, - 0.6594442250515921f, - 0.659345815100069f, - 0.6592473938508332f, - 0.6591489613055717f, - 0.6590505174659709f, - 0.6589520623337171f, - 0.6588535959104981f, - 0.6587551181980004f, - 0.658656629197912f, - 0.65855812891192f, - 0.6584596173417123f, - 0.6583610944889773f, - 0.6582625603554024f, - 0.6581640149426768f, - 0.6580654582524883f, - 0.6579668902865262f, - 0.6578683110464789f, - 0.6577697205340362f, - 0.6576711187508866f, - 0.6575725056987204f, - 0.6574738813792267f, - 0.657375245794096f, - 0.6572765989450177f, - 0.6571779408336824f, - 0.6570792714617811f, - 0.6569805908310036f, - 0.6568818989430415f, - 0.6567831957995851f, - 0.6566844814023265f, - 0.6565857557529564f, - 0.6564870188531671f, - 0.6563882707046497f, - 0.656289511309097f, - 0.6561907406682005f, - 0.6560919587836528f, - 0.6559931656571472f, - 0.6558943612903754f, - 0.6557955456850313f, - 0.6556967188428073f, - 0.6555978807653977f, - 0.6554990314544951f, - 0.6554001709117939f, - 0.6553012991389876f, - 0.655202416137771f, - 0.6551035219098379f, - 0.6550046164568826f, - 0.6549056997806005f, - 0.6548067718826859f, - 0.6547078327648344f, - 0.6546088824287408f, - 0.6545099208761012f, - 0.6544109481086104f, - 0.6543119641279653f, - 0.6542129689358612f, - 0.6541139625339949f, - 0.6540149449240622f, - 0.6539159161077603f, - 0.6538168760867857f, - 0.6537178248628356f, - 0.6536187624376074f, - 0.653519688812798f, - 0.6534206039901056f, - 0.6533215079712273f, - 0.6532224007578619f, - 0.6531232823517068f, - 0.6530241527544609f, - 0.6529250119678224f, - 0.6528258599934904f, - 0.6527266968331634f, - 0.6526275224885412f, - 0.6525283369613223f, - 0.6524291402532066f, - 0.6523299323658942f, - 0.6522307133010844f, - 0.6521314830604777f, - 0.652032241645774f, - 0.6519329890586744f, - 0.6518337253008787f, - 0.6517344503740886f, - 0.6516351642800043f, - 0.6515358670203281f, - 0.6514365585967603f, - 0.6513372390110032f, - 0.6512379082647587f, - 0.6511385663597282f, - 0.6510392132976147f, - 0.6509398490801201f, - 0.6508404737089468f, - 0.6507410871857982f, - 0.6506416895123764f, - 0.6505422806903854f, - 0.6504428607215279f, - 0.650343429607508f, - 0.6502439873500292f, - 0.650144533950795f, - 0.6500450694115097f, - 0.6499455937338782f, - 0.6498461069196042f, - 0.649746608970393f, - 0.649647099887949f, - 0.6495475796739777f, - 0.6494480483301838f, - 0.6493485058582733f, - 0.6492489522599513f, - 0.6491493875369242f, - 0.6490498116908975f, - 0.6489502247235774f, - 0.648850626636671f, - 0.6487510174318841f, - 0.6486513971109241f, - 0.6485517656754973f, - 0.6484521231273116f, - 0.6483524694680736f, - 0.6482528046994914f, - 0.6481531288232724f, - 0.6480534418411248f, - 0.6479537437547563f, - 0.6478540345658759f, - 0.6477543142761911f, - 0.6476545828874112f, - 0.6475548404012453f, - 0.6474550868194019f, - 0.6473553221435908f, - 0.6472555463755207f, - 0.6471557595169022f, - 0.6470559615694442f, - 0.6469561525348574f, - 0.6468563324148514f, - 0.6467565012111373f, - 0.6466566589254248f, - 0.6465568055594256f, - 0.6464569411148499f, - 0.6463570655934093f, - 0.6462571789968152f, - 0.6461572813267785f, - 0.6460573725850117f, - 0.6459574527732261f, - 0.6458575218931344f, - 0.6457575799464481f, - 0.6456576269348805f, - 0.6455576628601436f, - 0.6454576877239508f, - 0.6453577015280147f, - 0.6452577042740486f, - 0.6451576959637665f, - 0.6450576765988812f, - 0.6449576461811072f, - 0.6448576047121579f, - 0.6447575521937481f, - 0.6446574886275914f, - 0.6445574140154031f, - 0.6444573283588975f, - 0.6443572316597899f, - 0.6442571239197948f, - 0.6441570051406283f, - 0.6440568753240054f, - 0.6439567344716417f, - 0.6438565825852538f, - 0.643756419666557f, - 0.6436562457172681f, - 0.643556060739103f, - 0.643455864733779f, - 0.6433556577030123f, - 0.6432554396485206f, - 0.6431552105720203f, - 0.6430549704752295f, - 0.6429547193598654f, - 0.6428544572276457f, - 0.6427541840802888f, - 0.6426538999195125f, - 0.6425536047470355f, - 0.6424532985645757f, - 0.6423529813738525f, - 0.6422526531765845f, - 0.6421523139744906f, - 0.6420519637692905f, - 0.6419516025627031f, - 0.6418512303564489f, - 0.6417508471522468f, - 0.6416504529518177f, - 0.6415500477568811f, - 0.6414496315691581f, - 0.6413492043903686f, - 0.6412487662222341f, - 0.6411483170664749f, - 0.6410478569248128f, - 0.6409473857989686f, - 0.6408469036906643f, - 0.6407464106016212f, - 0.6406459065335618f, - 0.6405453914882075f, - 0.640444865467281f, - 0.6403443284725051f, - 0.6402437805056017f, - 0.6401432215682945f, - 0.6400426516623059f, - 0.6399420707893595f, - 0.6398414789511784f, - 0.6397408761494867f, - 0.6396402623860077f, - 0.6395396376624658f, - 0.6394390019805848f, - 0.6393383553420895f, - 0.6392376977487039f, - 0.639137029202153f, - 0.6390363497041621f, - 0.6389356592564557f, - 0.6388349578607597f, - 0.638734245518799f, - 0.6386335222322999f, - 0.6385327880029875f, - 0.6384320428325887f, - 0.638331286722829f, - 0.6382305196754354f, - 0.638129741692134f, - 0.6380289527746522f, - 0.6379281529247164f, - 0.6378273421440543f, - 0.6377265204343927f, - 0.6376256877974598f, - 0.6375248442349827f, - 0.6374239897486899f, - 0.6373231243403092f, - 0.6372222480115687f, - 0.6371213607641975f, - 0.6370204625999234f, - 0.6369195535204762f, - 0.6368186335275843f, - 0.636717702622977f, - 0.6366167608083843f, - 0.6365158080855351f, - 0.6364148444561597f, - 0.6363138699219876f, - 0.6362128844847497f, - 0.6361118881461754f, - 0.6360108809079961f, - 0.6359098627719418f, - 0.6358088337397443f, - 0.6357077938131338f, - 0.635606742993842f, - 0.6355056812836006f, - 0.6354046086841408f, - 0.6353035251971951f, - 0.6352024308244947f, - 0.6351013255677727f, - 0.6350002094287606f, - 0.6348990824091918f, - 0.6347979445107985f, - 0.6346967957353142f, - 0.6345956360844714f, - 0.6344944655600042f, - 0.6343932841636455f, - 0.6342920918971292f, - 0.6341908887621895f, - 0.6340896747605601f, - 0.6339884498939756f, - 0.63388721416417f, - 0.6337859675728786f, - 0.6336847101218356f, - 0.6335834418127766f, - 0.6334821626474361f, - 0.6333808726275503f, - 0.6332795717548542f, - 0.6331782600310835f, - 0.6330769374579747f, - 0.6329756040372633f, - 0.6328742597706862f, - 0.6327729046599794f, - 0.6326715387068801f, - 0.6325701619131245f, - 0.6324687742804506f, - 0.6323673758105947f, - 0.6322659665052949f, - 0.6321645463662883f, - 0.6320631153953133f, - 0.6319616735941073f, - 0.6318602209644087f, - 0.6317587575079563f, - 0.631657283226488f, - 0.631555798121743f, - 0.6314543021954597f, - 0.6313527954493778f, - 0.6312512778852362f, - 0.6311497495047746f, - 0.6310482103097323f, - 0.6309466603018499f, - 0.6308450994828664f, - 0.6307435278545229f, - 0.6306419454185592f, - 0.6305403521767161f, - 0.6304387481307347f, - 0.6303371332823554f, - 0.6302355076333199f, - 0.630133871185369f, - 0.6300322239402447f, - 0.6299305658996882f, - 0.629828897065442f, - 0.6297272174392473f, - 0.6296255270228472f, - 0.6295238258179836f, - 0.6294221138263993f, - 0.6293203910498374f, - 0.6292186574900407f, - 0.6291169131487518f, - 0.629015158027715f, - 0.6289133921286731f, - 0.6288116154533704f, - 0.6287098280035502f, - 0.6286080297809574f, - 0.6285062207873354f, - 0.6284044010244295f, - 0.628302570493984f, - 0.6282007291977432f, - 0.6280988771374527f, - 0.627997014314858f, - 0.6278951407317037f, - 0.6277932563897363f, - 0.6276913612907006f, - 0.6275894554363433f, - 0.6274875388284099f, - 0.6273856114686475f, - 0.6272836733588016f, - 0.62718172450062f, - 0.6270797648958486f, - 0.6269777945462347f, - 0.6268758134535262f, - 0.6267738216194695f, - 0.626671819045813f, - 0.626569805734304f, - 0.6264677816866909f, - 0.6263657469047214f, - 0.6262637013901442f, - 0.6261616451447074f, - 0.6260595781701604f, - 0.6259575004682513f, - 0.6258554120407298f, - 0.6257533128893445f, - 0.6256512030158454f, - 0.6255490824219823f, - 0.6254469511095042f, - 0.625344809080162f, - 0.6252426563357051f, - 0.6251404928778844f, - 0.6250383187084501f, - 0.6249361338291533f, - 0.6248339382417444f, - 0.624731731947975f, - 0.624629514949596f, - 0.6245272872483592f, - 0.6244250488460157f, - 0.6243227997443181f, - 0.624220539945018f, - 0.6241182694498673f, - 0.6240159882606189f, - 0.6239136963790247f, - 0.6238113938068384f, - 0.623709080545812f, - 0.6236067565976993f, - 0.623504421964253f, - 0.6234020766472272f, - 0.6232997206483749f, - 0.6231973539694503f, - 0.6230949766122077f, - 0.6229925885784007f, - 0.6228901898697844f, - 0.6227877804881126f, - 0.6226853604351407f, - 0.6225829297126231f, - 0.6224804883223155f, - 0.6223780362659725f, - 0.6222755735453505f, - 0.6221731001622043f, - 0.62207061611829f, - 0.6219681214153642f, - 0.6218656160551822f, - 0.6217631000395013f, - 0.6216605733700773f, - 0.6215580360486677f, - 0.6214554880770287f, - 0.6213529294569182f, - 0.6212503601900927f, - 0.6211477802783105f, - 0.6210451897233286f, - 0.6209425885269054f, - 0.6208399766907984f, - 0.6207373542167661f, - 0.6206347211065673f, - 0.6205320773619599f, - 0.6204294229847033f, - 0.6203267579765559f, - 0.6202240823392773f, - 0.6201213960746267f, - 0.6200186991843631f, - 0.619915991670247f, - 0.6198132735340376f, - 0.6197105447774954f, - 0.6196078054023801f, - 0.6195050554104529f, - 0.6194022948034735f, - 0.6192995235832035f, - 0.6191967417514032f, - 0.6190939493098342f, - 0.6189911462602574f, - 0.6188883326044349f, - 0.6187855083441276f, - 0.6186826734810982f, - 0.6185798280171079f, - 0.6184769719539198f, - 0.6183741052932955f, - 0.618271228036998f, - 0.6181683401867902f, - 0.6180654417444348f, - 0.6179625327116952f, - 0.6178596130903343f, - 0.6177566828821162f, - 0.6176537420888039f, - 0.6175507907121619f, - 0.6174478287539535f, - 0.6173448562159439f, - 0.6172418730998965f, - 0.6171388794075767f, - 0.6170358751407486f, - 0.6169328603011776f, - 0.6168298348906289f, - 0.6167267989108673f, - 0.6166237523636591f, - 0.616520695250769f, - 0.6164176275739638f, - 0.6163145493350086f, - 0.6162114605356706f, - 0.6161083611777152f, - 0.61600525126291f, - 0.6159021307930207f, - 0.6157989997698152f, - 0.6156958581950599f, - 0.6155927060705227f, - 0.6154895433979706f, - 0.6153863701791716f, - 0.6152831864158935f, - 0.6151799921099038f, - 0.6150767872629717f, - 0.6149735718768644f, - 0.6148703459533515f, - 0.6147671094942011f, - 0.6146638625011827f, - 0.6145606049760647f, - 0.6144573369206167f, - 0.6143540583366086f, - 0.6142507692258093f, - 0.6141474695899896f, - 0.6140441594309183f, - 0.6139408387503666f, - 0.6138375075501044f, - 0.6137341658319024f, - 0.613630813597531f, - 0.6135274508487618f, - 0.6134240775873652f, - 0.6133206938151126f, - 0.613217299533776f, - 0.6131138947451263f, - 0.613010479450936f, - 0.6129070536529764f, - 0.6128036173530204f, - 0.6127001705528397f, - 0.6125967132542073f, - 0.6124932454588954f, - 0.6123897671686775f, - 0.6122862783853262f, - 0.6121827791106151f, - 0.6120792693463173f, - 0.6119757490942065f, - 0.611872218356057f, - 0.6117686771336418f, - 0.6116651254287361f, - 0.6115615632431133f, - 0.6114579905785488f, - 0.6113544074368163f, - 0.6112508138196917f, - 0.6111472097289491f, - 0.6110435951663645f, - 0.610939970133713f, - 0.6108363346327699f, - 0.6107326886653115f, - 0.6106290322331132f, - 0.6105253653379517f, - 0.6104216879816026f, - 0.6103180001658433f, - 0.6102143018924494f, - 0.6101105931631987f, - 0.6100068739798675f, - 0.6099031443442336f, - 0.6097994042580739f, - 0.6096956537231664f, - 0.6095918927412882f, - 0.6094881213142177f, - 0.6093843394437333f, - 0.6092805471316124f, - 0.6091767443796343f, - 0.6090729311895768f, - 0.6089691075632198f, - 0.6088652735023411f, - 0.6087614290087209f, - 0.6086575740841376f, - 0.6085537087303716f, - 0.6084498329492019f, - 0.608345946742409f, - 0.6082420501117723f, - 0.6081381430590724f, - 0.6080342255860901f, - 0.6079302976946053f, - 0.6078263593863994f, - 0.6077224106632526f, - 0.6076184515269469f, - 0.6075144819792629f, - 0.6074105020219827f, - 0.6073065116568872f, - 0.6072025108857592f, - 0.6070984997103797f, - 0.6069944781325315f, - 0.6068904461539972f, - 0.6067864037765592f, - 0.6066823510019996f, - 0.6065782878321023f, - 0.6064742142686494f, - 0.6063701303134252f, - 0.6062660359682123f, - 0.6061619312347949f, - 0.6060578161149566f, - 0.605953690610481f, - 0.6058495547231529f, - 0.6057454084547561f, - 0.6056412518070754f, - 0.6055370847818958f, - 0.6054329073810014f, - 0.6053287196061782f, - 0.6052245214592105f, - 0.6051203129418844f, - 0.605016094055985f, - 0.6049118648032985f, - 0.6048076251856104f, - 0.6047033752047073f, - 0.6045991148623749f, - 0.6044948441604001f, - 0.6043905631005697f, - 0.60428627168467f, - 0.6041819699144886f, - 0.604077657791812f, - 0.6039733353184283f, - 0.6038690024961244f, - 0.6037646593266885f, - 0.603660305811908f, - 0.6035559419535715f, - 0.6034515677534669f, - 0.6033471832133828f, - 0.6032427883351075f, - 0.6031383831204299f, - 0.6030339675711395f, - 0.6029295416890246f, - 0.6028251054758752f, - 0.6027206589334801f, - 0.6026162020636298f, - 0.6025117348681133f, - 0.6024072573487212f, - 0.6023027695072434f, - 0.6021982713454705f, - 0.6020937628651927f, - 0.6019892440682012f, - 0.6018847149562867f, - 0.6017801755312399f, - 0.6016756257948526f, - 0.6015710657489157f, - 0.6014664953952215f, - 0.601361914735561f, - 0.6012573237717269f, - 0.6011527225055107f, - 0.6010481109387052f, - 0.6009434890731025f, - 0.6008388569104958f, - 0.6007342144526773f, - 0.6006295617014402f, - 0.6005248986585783f, - 0.600420225325884f, - 0.6003155417051519f, - 0.6002108477981747f, - 0.6001061436067472f, - 0.6000014291326626f, - 0.599896704377716f, - 0.5997919693437012f, - 0.5996872240324133f, - 0.5995824684456463f, - 0.599477702585196f, - 0.5993729264528573f, - 0.5992681400504253f, - 0.5991633433796959f, - 0.5990585364424641f, - 0.5989537192405265f, - 0.5988488917756783f, - 0.5987440540497166f, - 0.598639206064437f, - 0.5985343478216365f, - 0.5984294793231114f, - 0.5983246005706592f, - 0.5982197115660762f, - 0.5981148123111601f, - 0.5980099028077086f, - 0.5979049830575187f, - 0.5978000530623887f, - 0.597695112824116f, - 0.5975901623444994f, - 0.5974852016253367f, - 0.5973802306684263f, - 0.5972752494755672f, - 0.5971702580485578f, - 0.5970652563891977f, - 0.5969602444992854f, - 0.596855222380621f, - 0.5967501900350032f, - 0.5966451474642325f, - 0.5965400946701079f, - 0.5964350316544305f, - 0.5963299584189995f, - 0.596224874965616f, - 0.5961197812960802f, - 0.5960146774121933f, - 0.5959095633157555f, - 0.5958044390085687f, - 0.5956993044924335f, - 0.5955941597691515f, - 0.595489004840525f, - 0.5953838397083548f, - 0.5952786643744439f, - 0.5951734788405935f, - 0.5950682831086065f, - 0.5949630771802851f, - 0.5948578610574323f, - 0.5947526347418505f, - 0.5946473982353433f, - 0.5945421515397132f, - 0.5944368946567644f, - 0.5943316275882995f, - 0.5942263503361229f, - 0.5941210629020386f, - 0.59401576528785f, - 0.5939104574953622f, - 0.5938051395263787f, - 0.593699811382705f, - 0.593594473066145f, - 0.5934891245785044f, - 0.5933837659215877f, - 0.5932783970972009f, - 0.5931730181071485f, - 0.5930676289532372f, - 0.5929622296372719f, - 0.5928568201610593f, - 0.592751400526405f, - 0.5926459707351159f, - 0.5925405307889982f, - 0.5924350806898582f, - 0.5923296204395035f, - 0.5922241500397405f, - 0.592118669492377f, - 0.5920131787992197f, - 0.5919076779620769f, - 0.5918021669827556f, - 0.5916966458630639f, - 0.5915911146048106f, - 0.5914855732098029f, - 0.59138002167985f, - 0.59127446001676f, - 0.5911688882223421f, - 0.5910633062984048f, - 0.5909577142467576f, - 0.5908521120692094f, - 0.5907464997675702f, - 0.5906408773436489f, - 0.5905352447992558f, - 0.5904296021362012f, - 0.5903239493562945f, - 0.5902182864613468f, - 0.5901126134531678f, - 0.5900069303335689f, - 0.5899012371043604f, - 0.5897955337673538f, - 0.5896898203243599f, - 0.5895840967771905f, - 0.5894783631276564f, - 0.5893726193775704f, - 0.5892668655287433f, - 0.5891611015829876f, - 0.5890553275421161f, - 0.5889495434079403f, - 0.5888437491822734f, - 0.5887379448669278f, - 0.5886321304637168f, - 0.5885263059744529f, - 0.5884204714009501f, - 0.5883146267450216f, - 0.5882087720084804f, - 0.5881029071931413f, - 0.5879970323008173f, - 0.5878911473333235f, - 0.5877852522924732f, - 0.5876793471800819f, - 0.5875734319979633f, - 0.587467506747933f, - 0.5873615714318055f, - 0.5872556260513964f, - 0.5871496706085204f, - 0.5870437051049938f, - 0.5869377295426316f, - 0.5868317439232503f, - 0.5867257482486652f, - 0.586619742520693f, - 0.5865137267411503f, - 0.586407700911853f, - 0.5863016650346186f, - 0.5861956191112632f, - 0.5860895631436045f, - 0.5859834971334591f, - 0.5858774210826452f, - 0.5857713349929796f, - 0.5856652388662809f, - 0.585559132704366f, - 0.5854530165090537f, - 0.5853468902821624f, - 0.58524075402551f, - 0.5851346077409156f, - 0.5850284514301975f, - 0.5849222850951754f, - 0.5848161087376675f, - 0.584709922359494f, - 0.5846037259624736f, - 0.5844975195484265f, - 0.5843913031191721f, - 0.5842850766765308f, - 0.5841788402223224f, - 0.5840725937583676f, - 0.5839663372864865f, - 0.5838600708085002f, - 0.583753794326229f, - 0.5836475078414947f, - 0.5835412113561175f, - 0.5834349048719197f, - 0.5833285883907221f, - 0.5832222619143471f, - 0.5831159254446162f, - 0.5830095789833512f, - 0.5829032225323744f, - 0.5827968560935087f, - 0.5826904796685761f, - 0.5825840932593999f, - 0.5824776968678022f, - 0.5823712904956069f, - 0.5822648741446366f, - 0.5821584478167152f, - 0.5820520115136659f, - 0.5819455652373129f, - 0.5818391089894794f, - 0.5817326427719904f, - 0.5816261665866694f, - 0.5815196804353412f, - 0.5814131843198307f, - 0.581306678241962f, - 0.5812001622035607f, - 0.5810936362064514f, - 0.5809871002524599f, - 0.5808805543434111f, - 0.5807739984811313f, - 0.5806674326674456f, - 0.5805608569041806f, - 0.5804542711931617f, - 0.5803476755362162f, - 0.5802410699351697f, - 0.5801344543918492f, - 0.5800278289080819f, - 0.5799211934856942f, - 0.5798145481265137f, - 0.5797078928323673f, - 0.5796012276050831f, - 0.5794945524464881f, - 0.5793878673584109f, - 0.5792811723426787f, - 0.5791744674011206f, - 0.579067752535564f, - 0.5789610277478382f, - 0.5788542930397717f, - 0.5787475484131929f, - 0.5786407938699315f, - 0.5785340294118162f, - 0.5784272550406768f, - 0.5783204707583425f, - 0.5782136765666434f, - 0.5781068724674088f, - 0.5780000584624695f, - 0.5778932345536549f, - 0.5777864007427964f, - 0.5776795570317236f, - 0.5775727034222676f, - 0.5774658399162598f, - 0.5773589665155303f, - 0.5772520832219115f, - 0.5771451900372336f, - 0.5770382869633294f, - 0.5769313740020295f, - 0.5768244511551668f, - 0.5767175184245725f, - 0.5766105758120799f, - 0.5765036233195203f, - 0.576396660948727f, - 0.576289688701533f, - 0.5761827065797704f, - 0.5760757145852732f, - 0.5759687127198739f, - 0.5758617009854067f, - 0.5757546793837045f, - 0.5756476479166017f, - 0.5755406065859316f, - 0.5754335553935291f, - 0.5753264943412277f, - 0.5752194234308626f, - 0.5751123426642678f, - 0.5750052520432783f, - 0.5748981515697296f, - 0.574791041245456f, - 0.5746839210722935f, - 0.5745767910520773f, - 0.5744696511866426f, - 0.5743625014778261f, - 0.5742553419274629f, - 0.5741481725373899f, - 0.5740409933094427f, - 0.5739338042454586f, - 0.5738266053472734f, - 0.5737193966167247f, - 0.5736121780556487f, - 0.5735049496658835f, - 0.5733977114492654f, - 0.573290463407633f, - 0.5731832055428229f, - 0.5730759378566738f, - 0.572968660351023f, - 0.5728613730277093f, - 0.5727540758885704f, - 0.5726467689354455f, - 0.5725394521701725f, - 0.5724321255945908f, - 0.5723247892105396f, - 0.5722174430198574f, - 0.5721100870243843f, - 0.572002721225959f, - 0.5718953456264219f, - 0.5717879602276122f, - 0.5716805650313708f, - 0.5715731600395368f, - 0.5714657452539517f, - 0.5713583206764549f, - 0.5712508863088878f, - 0.5711434421530912f, - 0.5710359882109058f, - 0.5709285244841735f, - 0.5708210509747347f, - 0.5707135676844317f, - 0.5706060746151056f, - 0.570498571768599f, - 0.570391059146753f, - 0.5702835367514109f, - 0.5701760045844139f, - 0.5700684626476055f, - 0.5699609109428276f, - 0.5698533494719239f, - 0.5697457782367366f, - 0.5696381972391097f, - 0.5695306064808858f, - 0.5694230059639093f, - 0.5693153956900233f, - 0.5692077756610715f, - 0.5691001458788986f, - 0.568992506345348f, - 0.568884857062265f, - 0.5687771980314933f, - 0.5686695292548782f, - 0.5685618507342641f, - 0.5684541624714963f, - 0.5683464644684203f, - 0.5682387567268808f, - 0.5681310392487242f, - 0.5680233120357954f, - 0.5679155750899408f, - 0.5678078284130059f, - 0.5677000720068377f, - 0.5675923058732818f, - 0.5674845300141854f, - 0.5673767444313945f, - 0.5672689491267564f, - 0.5671611441021185f, - 0.5670533293593272f, - 0.5669455049002307f, - 0.5668376707266757f, - 0.5667298268405108f, - 0.566621973243583f, - 0.5665141099377412f, - 0.5664062369248328f, - 0.5662983542067069f, - 0.5661904617852113f, - 0.5660825596621955f, - 0.5659746478395076f, - 0.565866726318997f, - 0.5657587951025133f, - 0.5656508541919051f, - 0.5655429035890227f, - 0.5654349432957151f, - 0.5653269733138329f, - 0.5652189936452253f, - 0.5651110042917433f, - 0.5650030052552371f, - 0.5648949965375565f, - 0.5647869781405531f, - 0.5646789500660772f, - 0.5645709123159802f, - 0.564462864892113f, - 0.5643548077963273f, - 0.5642467410304741f, - 0.5641386645964058f, - 0.5640305784959736f, - 0.5639224827310301f, - 0.5638143773034269f, - 0.563706262215017f, - 0.5635981374676522f, - 0.563490003063186f, - 0.5633818590034705f, - 0.5632737052903589f, - 0.563165541925705f, - 0.5630573689113614f, - 0.5629491862491821f, - 0.5628409939410203f, - 0.5627327919887305f, - 0.562624580394166f, - 0.5625163591591815f, - 0.562408128285631f, - 0.5622998877753694f, - 0.5621916376302508f, - 0.5620833778521305f, - 0.5619751084428636f, - 0.5618668294043047f, - 0.5617585407383099f, - 0.5616502424467338f, - 0.561541934531433f, - 0.5614336169942624f, - 0.5613252898370789f, - 0.5612169530617377f, - 0.5611086066700961f, - 0.5610002506640098f, - 0.560891885045336f, - 0.5607835098159311f, - 0.5606751249776525f, - 0.5605667305323567f, - 0.5604583264819019f, - 0.5603499128281446f, - 0.5602414895729434f, - 0.5601330567181552f, - 0.5600246142656388f, - 0.5599161622172519f, - 0.5598077005748525f, - 0.5596992293402997f, - 0.5595907485154515f, - 0.559482258102167f, - 0.5593737581023055f, - 0.5592652485177254f, - 0.5591567293502868f, - 0.5590482006018482f, - 0.5589396622742703f, - 0.5588311143694117f, - 0.5587225568891334f, - 0.5586139898352946f, - 0.5585054132097566f, - 0.5583968270143785f, - 0.5582882312510222f, - 0.5581796259215476f, - 0.5580710110278158f, - 0.5579623865716884f, - 0.5578537525550258f, - 0.5577451089796903f, - 0.5576364558475426f, - 0.5575277931604453f, - 0.5574191209202596f, - 0.557310439128848f, - 0.5572017477880724f, - 0.5570930468997958f, - 0.5569843364658799f, - 0.5568756164881878f, - 0.5567668869685829f, - 0.5566581479089274f, - 0.5565493993110854f, - 0.5564406411769193f, - 0.5563318735082936f, - 0.5562230963070711f, - 0.5561143095751165f, - 0.5560055133142932f, - 0.5558967075264659f, - 0.5557878922134983f, - 0.5556790673772558f, - 0.5555702330196022f, - 0.555461389142403f, - 0.5553525357475231f, - 0.5552436728368271f, - 0.5551348004121811f, - 0.55502591847545f, - 0.5549170270285f, - 0.5548081260731964f, - 0.5546992156114058f, - 0.5545902956449935f, - 0.5544813661758268f, - 0.5543724272057713f, - 0.5542634787366945f, - 0.5541545207704621f, - 0.5540455533089419f, - 0.5539365763540012f, - 0.5538275899075065f, - 0.5537185939713261f, - 0.5536095885473267f, - 0.553500573637377f, - 0.5533915492433441f, - 0.5532825153670969f, - 0.5531734720105029f, - 0.5530644191754313f, - 0.5529553568637499f, - 0.5528462850773279f, - 0.5527372038180345f, - 0.552628113087738f, - 0.5525190128883085f, - 0.5524099032216147f, - 0.5523007840895267f, - 0.5521916554939136f, - 0.5520825174366462f, - 0.5519733699195934f, - 0.5518642129446265f, - 0.5517550465136151f, - 0.5516458706284304f, - 0.5515366852909424f, - 0.5514274905030222f, - 0.5513182862665413f, - 0.5512090725833702f, - 0.5510998494553808f, - 0.5509906168844445f, - 0.5508813748724325f, - 0.5507721234212173f, - 0.55066286253267f, - 0.550553592208664f, - 0.5504443124510704f, - 0.5503350232617625f, - 0.5502257246426124f, - 0.5501164165954936f, - 0.5500070991222782f, - 0.54989777222484f, - 0.5497884359050518f, - 0.5496790901647876f, - 0.5495697350059203f, - 0.5494603704303245f, - 0.5493509964398733f, - 0.5492416130364415f, - 0.5491322202219027f, - 0.549022817998132f, - 0.5489134063670034f, - 0.5488039853303918f, - 0.5486945548901725f, - 0.5485851150482199f, - 0.5484756658064099f, - 0.5483662071666172f, - 0.5482567391307182f, - 0.5481472617005875f, - 0.548037774878102f, - 0.5479282786651369f, - 0.5478187730635693f, - 0.5477092580752745f, - 0.5475997337021296f, - 0.5474901999460116f, - 0.5473806568087964f, - 0.547271104292362f, - 0.5471615423985847f, - 0.5470519711293426f, - 0.5469423904865124f, - 0.5468328004719725f, - 0.5467232010875998f, - 0.5466135923352732f, - 0.54650397421687f, - 0.5463943467342692f, - 0.5462847098893485f, - 0.5461750636839873f, - 0.5460654081200635f, - 0.5459557431994568f, - 0.5458460689240461f, - 0.54573638529571f, - 0.5456266923163288f, - 0.5455169899877812f, - 0.5454072783119477f, - 0.5452975572907075f, - 0.5451878269259414f, - 0.5450780872195288f, - 0.5449683381733503f, - 0.5448585797892871f, - 0.5447488120692189f, - 0.5446390350150273f, - 0.5445292486285926f, - 0.5444194529117967f, - 0.5443096478665203f, - 0.5441998334946454f, - 0.544090009798053f, - 0.5439801767786258f, - 0.5438703344382447f, - 0.5437604827787927f, - 0.5436506218021515f, - 0.5435407515102036f, - 0.5434308719048323f, - 0.5433209829879194f, - 0.5432110847613486f, - 0.5431011772270022f, - 0.5429912603867643f, - 0.5428813342425174f, - 0.542771398796146f, - 0.5426614540495328f, - 0.5425515000045626f, - 0.5424415366631188f, - 0.5423315640270856f, - 0.542221582098348f, - 0.5421115908787898f, - 0.5420015903702963f, - 0.5418915805747515f, - 0.5417815614940413f, - 0.5416715331300501f, - 0.5415614954846638f, - 0.5414514485597677f, - 0.5413413923572468f, - 0.5412313268789878f, - 0.5411212521268759f, - 0.5410111681027979f, - 0.5409010748086392f, - 0.5407909722462872f, - 0.5406808604176278f, - 0.540570739324548f, - 0.5404606089689343f, - 0.5403504693526746f, - 0.5402403204776551f, - 0.540130162345764f, - 0.5400199949588883f, - 0.5399098183189162f, - 0.5397996324277347f, - 0.5396894372872328f, - 0.5395792328992978f, - 0.5394690192658185f, - 0.5393587963886836f, - 0.5392485642697811f, - 0.5391383229110004f, - 0.5390280723142299f, - 0.5389178124813594f, - 0.5388075434142774f, - 0.538697265114874f, - 0.5385869775850382f, - 0.5384766808266604f, - 0.5383663748416297f, - 0.5382560596318368f, - 0.538145735199172f, - 0.538035401545525f, - 0.5379250586727872f, - 0.5378147065828485f, - 0.5377043452776004f, - 0.5375939747589332f, - 0.5374835950287389f, - 0.537373206088908f, - 0.5372628079413329f, - 0.5371524005879041f, - 0.5370419840305146f, - 0.5369315582710554f, - 0.5368211233114194f, - 0.5367106791534981f, - 0.5366002257991846f, - 0.5364897632503709f, - 0.5363792915089504f, - 0.5362688105768153f, - 0.5361583204558593f, - 0.5360478211479754f, - 0.5359373126550566f, - 0.535826794978997f, - 0.5357162681216897f, - 0.5356057320850288f, - 0.5354951868709089f, - 0.5353846324812231f, - 0.5352740689178668f, - 0.5351634961827334f, - 0.5350529142777186f, - 0.5349423232047162f, - 0.534831722965622f, - 0.5347211135623304f, - 0.5346104949967373f, - 0.5344998672707374f, - 0.5343892303862271f, - 0.5342785843451013f, - 0.5341679291492564f, - 0.5340572648005886f, - 0.5339465913009935f, - 0.5338359086523682f, - 0.5337252168566085f, - 0.5336145159156117f, - 0.533503805831274f, - 0.533393086605493f, - 0.5332823582401653f, - 0.5331716207371888f, - 0.5330608740984603f, - 0.5329501183258776f, - 0.5328393534213391f, - 0.5327285793867418f, - 0.5326177962239846f, - 0.532507003934965f, - 0.5323962025215822f, - 0.5322853919857338f, - 0.5321745723293194f, - 0.5320637435542371f, - 0.5319529056623867f, - 0.5318420586556667f, - 0.5317312025359769f, - 0.5316203373052167f, - 0.5315094629652852f, - 0.5313985795180831f, - 0.5312876869655095f, - 0.5311767853094653f, - 0.5310658745518501f, - 0.5309549546945649f, - 0.5308440257395096f, - 0.5307330876885857f, - 0.5306221405436934f, - 0.5305111843067344f, - 0.5304002189796092f, - 0.5302892445642196f, - 0.5301782610624673f, - 0.5300672684762535f, - 0.5299562668074806f, - 0.5298452560580499f, - 0.5297342362298643f, - 0.5296232073248252f, - 0.5295121693448359f, - 0.5294011222917983f, - 0.5292900661676158f, - 0.5291790009741907f, - 0.5290679267134267f, - 0.5289568433872264f, - 0.5288457509974934f, - 0.5287346495461318f, - 0.5286235390350444f, - 0.5285124194661359f, - 0.5284012908413095f, - 0.52829015316247f, - 0.5281790064315212f, - 0.5280678506503681f, - 0.5279566858209147f, - 0.5278455119450666f, - 0.5277343290247277f, - 0.5276231370618041f, - 0.5275119360582002f, - 0.5274007260158219f, - 0.527289506936575f, - 0.5271782788223647f, - 0.5270670416750967f, - 0.5269557954966777f, - 0.5268445402890132f, - 0.5267332760540102f, - 0.5266220027935744f, - 0.5265107205096132f, - 0.5263994292040328f, - 0.5262881288787407f, - 0.5261768195356432f, - 0.5260655011766486f, - 0.5259541738036633f, - 0.5258428374185957f, - 0.5257314920233528f, - 0.5256201376198432f, - 0.5255087742099741f, - 0.5253974017956546f, - 0.5252860203787921f, - 0.525174629961296f, - 0.5250632305450741f, - 0.524951822132036f, - 0.5248404047240898f, - 0.524728978323145f, - 0.5246175429311114f, - 0.5245060985498976f, - 0.5243946451814138f, - 0.524283182827569f, - 0.524171711490274f, - 0.524060231171438f, - 0.5239487418729717f, - 0.523837243596785f, - 0.523725736344789f, - 0.5236142201188937f, - 0.5235026949210101f, - 0.5233911607530497f, - 0.5232796176169227f, - 0.5231680655145412f, - 0.5230565044478159f, - 0.5229449344186592f, - 0.5228333554289818f, - 0.5227217674806965f, - 0.5226101705757146f, - 0.5224985647159489f, - 0.5223869499033111f, - 0.5222753261397146f, - 0.5221636934270709f, - 0.5220520517672939f, - 0.5219404011622956f, - 0.5218287416139898f, - 0.5217170731242896f, - 0.521605395695108f, - 0.5214937093283591f, - 0.5213820140259561f, - 0.5212703097898135f, - 0.5211585966218445f, - 0.5210468745239641f, - 0.5209351434980861f, - 0.520823403546125f, - 0.520711654669996f, - 0.5205998968716131f, - 0.520488130152892f, - 0.520376354515747f, - 0.5202645699620941f, - 0.5201527764938481f, - 0.520040974112925f, - 0.5199291628212401f, - 0.5198173426207098f, - 0.5197055135132492f, - 0.5195936755007756f, - 0.5194818285852043f, - 0.5193699727684523f, - 0.5192581080524364f, - 0.5191462344390728f, - 0.519034351930279f, - 0.5189224605279715f, - 0.5188105602340682f, - 0.5186986510504858f, - 0.5185867329791425f, - 0.5184748060219552f, - 0.5183628701808426f, - 0.5182509254577218f, - 0.5181389718545114f, - 0.5180270093731302f, - 0.5179150380154957f, - 0.5178030577835273f, - 0.517691068679143f, - 0.5175790707042626f, - 0.5174670638608041f, - 0.5173550481506878f, - 0.5172430235758324f, - 0.5171309901381572f, - 0.5170189478395826f, - 0.5169068966820276f, - 0.516794836667413f, - 0.516682767797658f, - 0.5165706900746838f, - 0.5164586035004101f, - 0.516346508076758f, - 0.5162344038056477f, - 0.5161222906890006f, - 0.5160101687287372f, - 0.5158980379267794f, - 0.5157858982850476f, - 0.5156737498054642f, - 0.51556159248995f, - 0.5154494263404272f, - 0.5153372513588182f, - 0.5152250675470442f, - 0.5151128749070283f, - 0.5150006734406919f, - 0.5148884631499586f, - 0.5147762440367503f, - 0.5146640161029903f, - 0.5145517793506011f, - 0.5144395337815066f, - 0.5143272793976293f, - 0.5142150162008934f, - 0.5141027441932218f, - 0.5139904633765384f, - 0.5138781737527678f, - 0.5137658753238331f, - 0.5136535680916593f, - 0.51354125205817f, - 0.5134289272252904f, - 0.5133165935949445f, - 0.5132042511690579f, - 0.5130918999495547f, - 0.5129795399383608f, - 0.5128671711374007f, - 0.5127547935486004f, - 0.512642407173885f, - 0.5125300120151808f, - 0.512417608074413f, - 0.5123051953535082f, - 0.5121927738543919f, - 0.5120803435789912f, - 0.5119679045292321f, - 0.511855456707041f, - 0.5117430001143453f, - 0.5116305347530712f, - 0.5115180606251464f, - 0.5114055777324974f, - 0.5112930860770522f, - 0.5111805856607382f, - 0.5110680764854828f, - 0.5109555585532143f, - 0.5108430318658599f, - 0.5107304964253486f, - 0.5106179522336078f, - 0.5105053992925668f, - 0.5103928376041532f, - 0.5102802671702967f, - 0.5101676879929253f, - 0.5100551000739687f, - 0.5099425034153555f, - 0.5098298980190151f, - 0.5097172838868776f, - 0.5096046610208719f, - 0.5094920294229281f, - 0.5093793890949759f, - 0.5092667400389458f, - 0.5091540822567673f, - 0.5090414157503714f, - 0.5089287405216881f, - 0.5088160565726487f, - 0.5087033639051833f, - 0.5085906625212232f, - 0.5084779524226998f, - 0.5083652336115437f, - 0.5082525060896871f, - 0.5081397698590606f, - 0.5080270249215969f, - 0.507914271279227f, - 0.5078015089338836f, - 0.5076887378874982f, - 0.5075759581420038f, - 0.5074631696993321f, - 0.5073503725614166f, - 0.5072375667301894f, - 0.5071247522075831f, - 0.5070119289955316f, - 0.5068990970959674f, - 0.5067862565108243f, - 0.5066734072420354f, - 0.5065605492915348f, - 0.5064476826612557f, - 0.5063348073531329f, - 0.5062219233690994f, - 0.5061090307110905f, - 0.5059961293810397f, - 0.5058832193808819f, - 0.5057703007125521f, - 0.5056573733779846f, - 0.5055444373791149f, - 0.5054314927178775f, - 0.5053185393962084f, - 0.5052055774160423f, - 0.5050926067793154f, - 0.5049796274879629f, - 0.5048666395439212f, - 0.5047536429491256f, - 0.5046406377055132f, - 0.5045276238150194f, - 0.5044146012795809f, - 0.5043015701011351f, - 0.5041885302816176f, - 0.5040754818229662f, - 0.5039624247271174f, - 0.5038493589960088f, - 0.5037362846315773f, - 0.5036232016357609f, - 0.5035101100104967f, - 0.5033970097577233f, - 0.5032839008793776f, - 0.5031707833773982f, - 0.5030576572537239f, - 0.502944522510292f, - 0.5028313791490421f, - 0.5027182271719123f, - 0.502605066580841f, - 0.5024918973777682f, - 0.5023787195646321f, - 0.5022655331433727f, - 0.5021523381159287f, - 0.5020391344842405f, - 0.5019259222502473f, - 0.5018127014158886f, - 0.5016994719831049f, - 0.5015862339538367f, - 0.5014729873300234f, - 0.5013597321136064f, - 0.5012464683065255f, - 0.5011331959107221f, - 0.5010199149281364f, - 0.5009066253607102f, - 0.5007933272103839f, - 0.5006800204790997f, - 0.5005667051687981f, - 0.5004533812814213f, - 0.5003400488189114f, - 0.5002267077832095f, - 0.5001133581762586f, - 0.49999999999999994f, - 0.4998866332563768f, - 0.49977325794733085f, - 0.4996598740748055f, - 0.49954648164074283f, - 0.4994330806470866f, - 0.499319671095779f, - 0.49920625298876414f, - 0.49909282632798463f, - 0.49897939111538436f, - 0.4988659473529074f, - 0.49875249504249686f, - 0.4986390341860974f, - 0.49852556478565246f, - 0.498412086843107f, - 0.4982986003604047f, - 0.4981851053394909f, - 0.4980716017823095f, - 0.49795808969080624f, - 0.49784456906692515f, - 0.4977310399126123f, - 0.49761750222981216f, - 0.4975039560204709f, - 0.49739040128653383f, - 0.4972768380299462f, - 0.4971632662526547f, - 0.49704968595660454f, - 0.49693609714374265f, - 0.4968224998160147f, - 0.4967088939753677f, - 0.49659527962374767f, - 0.4964816567631021f, - 0.496368025395377f, - 0.49625438552251994f, - 0.49614073714647844f, - 0.49602708026919906f, - 0.49591341489263f, - 0.49579974101871827f, - 0.49568605864941223f, - 0.49557236778665914f, - 0.49545866843240777f, - 0.4953449605886056f, - 0.4952312442572017f, - 0.4951175194401439f, - 0.49500378613938156f, - 0.4948900443568626f, - 0.49477629409453655f, - 0.4946625353543527f, - 0.49454876813825954f, - 0.4944349924482072f, - 0.4943212082861445f, - 0.4942074156540219f, - 0.49409361455378825f, - 0.4939798049873944f, - 0.49386598695678974f, - 0.4937521604639251f, - 0.49363832551075026f, - 0.49352448209921607f, - 0.4934106302312736f, - 0.4932967699088729f, - 0.4931829011339657f, - 0.49306902390850227f, - 0.49295513823443476f, - 0.4928412441137138f, - 0.49272734154829156f, - 0.4926134305401195f, - 0.49249951109114903f, - 0.4923855832033328f, - 0.4922716468786223f, - 0.49215770211897053f, - 0.49204374892632907f, - 0.49192978730265124f, - 0.4918158172498891f, - 0.4917018387699962f, - 0.49158785186492465f, - 0.4914738565366285f, - 0.49135985278706024f, - 0.491245840618174f, - 0.49113182003192263f, - 0.4910177910302606f, - 0.490903753615141f, - 0.49078970778851816f, - 0.49067565355234666f, - 0.49056159090858004f, - 0.49044751985917345f, - 0.49033344040608073f, - 0.49021935255125737f, - 0.49010525629665747f, - 0.4899911516442368f, - 0.4898770385959497f, - 0.4897629171537523f, - 0.48964878731959927f, - 0.48953464909544686f, - 0.4894205024832502f, - 0.4893063474849654f, - 0.4891921841025489f, - 0.4890780123379561f, - 0.4889638321931441f, - 0.48884964367006856f, - 0.4887354467706868f, - 0.48862124149695485f, - 0.4885070278508303f, - 0.4883928058342694f, - 0.4882785754492301f, - 0.48816433669766895f, - 0.48805008958154417f, - 0.48793583410281255f, - 0.48782157026343265f, - 0.48770729806536156f, - 0.487593017510558f, - 0.48747872860097946f, - 0.48736443133858504f, - 0.48725012572533266f, - 0.4871358117631807f, - 0.4870214894540886f, - 0.4869071588000144f, - 0.486792819802918f, - 0.48667847246475776f, - 0.4865641167874934f, - 0.4864497527730847f, - 0.48633538042349056f, - 0.4862209997406714f, - 0.4861066107265864f, - 0.48599221338319637f, - 0.48587780771246064f, - 0.4857633937163403f, - 0.48564897139679514f, - 0.4855345407557864f, - 0.48542010179527406f, - 0.48530565451721985f, - 0.4851911989235839f, - 0.4850767350163279f, - 0.4849622627974135f, - 0.4848477822688013f, - 0.4847332934324538f, - 0.48461879629033183f, - 0.4845042908443981f, - 0.48438977709661385f, - 0.4842752550489421f, - 0.4841607247033442f, - 0.4840461860617835f, - 0.4839316391262218f, - 0.4838170838986222f, - 0.48370252038094796f, - 0.4835879485751613f, - 0.4834733684832262f, - 0.48335878010710515f, - 0.4832441834487624f, - 0.4831295785101607f, - 0.4830149652932646f, - 0.48290034380003716f, - 0.4827857140324432f, - 0.48267107599244646f, - 0.48255642968201085f, - 0.48244177510310154f, - 0.4823271122576824f, - 0.48221244114771883f, - 0.482097761775175f, - 0.4819830741420167f, - 0.4818683782502082f, - 0.4817536741017156f, - 0.48163896169850356f, - 0.48152424104253844f, - 0.48140951213578514f, - 0.4812947749802103f, - 0.48118002957777917f, - 0.48106527593045817f, - 0.48095051404021405f, - 0.4808357439090124f, - 0.48072096553882054f, - 0.4806061789316045f, - 0.4804913840893318f, - 0.4803765810139686f, - 0.48026176970748286f, - 0.48014695017184106f, - 0.4800321224090114f, - 0.4799172864209606f, - 0.4798024422096572f, - 0.4796875897770681f, - 0.4795727291251618f, - 0.4794578602559067f, - 0.47934298317127033f, - 0.47922809787322185f, - 0.47911320436372895f, - 0.4789983026447611f, - 0.4788833927182864f, - 0.47876847458627453f, - 0.47865354825069384f, - 0.47853861371351425f, - 0.4784236709767044f, - 0.47830872004223424f, - 0.4781937609120737f, - 0.47807879358819233f, - 0.47796381807255955f, - 0.4778488343671463f, - 0.477733842473922f, - 0.47761884239485775f, - 0.4775038341319232f, - 0.47738881768708996f, - 0.47727379306232787f, - 0.4771587602596086f, - 0.47704371928090294f, - 0.4769286701281817f, - 0.47681361280341644f, - 0.4766985473085792f, - 0.4765834736456407f, - 0.4764683918165736f, - 0.47635330182334884f, - 0.4762382036679394f, - 0.47612309735231656f, - 0.47600798287845353f, - 0.4758928602483219f, - 0.47577772946389507f, - 0.47566259052714494f, - 0.4755474434400449f, - 0.47543228820456823f, - 0.4753171248226874f, - 0.4752019532963764f, - 0.47508677362760793f, - 0.47497158581835636f, - 0.4748563898705946f, - 0.4747411857862972f, - 0.4746259735674375f, - 0.4745107532159904f, - 0.47439552473392926f, - 0.4742802881232294f, - 0.47416504338586457f, - 0.4740497905238098f, - 0.47393452953904036f, - 0.47381926043353034f, - 0.4737039832092558f, - 0.47358869786819097f, - 0.4734734044123122f, - 0.47335810284359414f, - 0.4732427931640133f, - 0.4731274753755446f, - 0.4730121494801649f, - 0.4728968154798494f, - 0.47278147337657506f, - 0.47266612317231754f, - 0.4725507648690541f, - 0.472435398468761f, - 0.47232002397341455f, - 0.47220464138499246f, - 0.47208925070547103f, - 0.4719738519368283f, - 0.47185844508104063f, - 0.4717430301400864f, - 0.4716276071159424f, - 0.4715121760105872f, - 0.4713967368259978f, - 0.4712812895641527f, - 0.47116583422703046f, - 0.4710503708166085f, - 0.4709348993348661f, - 0.47081941978378106f, - 0.4707039321653328f, - 0.47058843648149945f, - 0.4704729327342608f, - 0.4703574209255951f, - 0.47024190105748254f, - 0.4701263731319016f, - 0.47001083715083264f, - 0.4698952931162546f, - 0.46977974103014764f, - 0.4696641808944922f, - 0.4695486127112674f, - 0.46943303648245444f, - 0.46931745221003285f, - 0.46920185989598384f, - 0.46908625954228733f, - 0.46897065115092496f, - 0.4688550347238767f, - 0.46873941026312455f, - 0.4686237777706488f, - 0.4685081372484312f, - 0.4683924886984537f, - 0.468276832122697f, - 0.46816116752314374f, - 0.46804549490177494f, - 0.4679298142605734f, - 0.4678141256015209f, - 0.4676984289265994f, - 0.467582724237792f, - 0.46746701153708065f, - 0.46735129082644866f, - 0.4672355621078782f, - 0.467119825383353f, - 0.4670040806548554f, - 0.4668883279243694f, - 0.4667725671938777f, - 0.4666567984653645f, - 0.4665410217408128f, - 0.4664252370222071f, - 0.4663094443115306f, - 0.4661936436107681f, - 0.4660778349219031f, - 0.4659620182469207f, - 0.4658461935878046f, - 0.46573036094653986f, - 0.4656145203251116f, - 0.46549867172550385f, - 0.4653828151497026f, - 0.46526695059969214f, - 0.46515107807745854f, - 0.4650351975849865f, - 0.4649193091242624f, - 0.4648034126972711f, - 0.4646875083059993f, - 0.46457159595243225f, - 0.4644556756385567f, - 0.46433974736635836f, - 0.46422381113782385f, - 0.4641078669549401f, - 0.4639919148196931f, - 0.46387595473407034f, - 0.463759986700058f, - 0.463644010719644f, - 0.4635280267948148f, - 0.46341203492755845f, - 0.4632960351198616f, - 0.46318002737371283f, - 0.463064011691099f, - 0.4629479880740089f, - 0.4628319565244296f, - 0.4627159170443502f, - 0.4625998696357582f, - 0.4624838143006428f, - 0.46236775104099176f, - 0.4622516798587946f, - 0.4621356007560398f, - 0.462019513734716f, - 0.46190341879681296f, - 0.4617873159443193f, - 0.4616712051792251f, - 0.4615550865035191f, - 0.4614389599191915f, - 0.4613228254282323f, - 0.4612066830326307f, - 0.4610905327343776f, - 0.4609743745354624f, - 0.4608582084378762f, - 0.4607420344436088f, - 0.4606258525546514f, - 0.4605096627729941f, - 0.46039346510062856f, - 0.46027725953954496f, - 0.4601610460917349f, - 0.46004482475919f, - 0.4599285955439009f, - 0.45981235844786f, - 0.45969611347305817f, - 0.459579860621488f, - 0.4594635998951407f, - 0.45934733129600913f, - 0.45923105482608473f, - 0.45911477048736066f, - 0.45899847828182866f, - 0.45888217821148214f, - 0.45876587027831306f, - 0.45864955448431477f, - 0.4585332308314806f, - 0.4584168993218031f, - 0.45830055995727614f, - 0.4581842127398926f, - 0.4580678576716467f, - 0.45795149475453145f, - 0.4578351239905415f, - 0.4577187453816699f, - 0.4576023589299117f, - 0.4574859646372607f, - 0.4573695625057109f, - 0.4572531525372576f, - 0.45713673473389466f, - 0.4570203090976177f, - 0.4569038756304208f, - 0.4567874343342998f, - 0.45667098521124916f, - 0.4565545282632649f, - 0.45643806349234184f, - 0.4563215909004762f, - 0.456205110489663f, - 0.45608862226189884f, - 0.45597212621917904f, - 0.45585562236349997f, - 0.4557391106968584f, - 0.4556225912212499f, - 0.45550606393867177f, - 0.4553895288511199f, - 0.45527298596059185f, - 0.45515643526908384f, - 0.45503987677859364f, - 0.4549233104911177f, - 0.45480673640865416f, - 0.4546901545331996f, - 0.45457356486675254f, - 0.45445696741130986f, - 0.4543403621688698f, - 0.45422374914143077f, - 0.4541071283309901f, - 0.45399049973954686f, - 0.4538738633690987f, - 0.4537572192216449f, - 0.45364056729918334f, - 0.4535239076037136f, - 0.4534072401372338f, - 0.4532905649017439f, - 0.4531738818992422f, - 0.45305719113172843f, - 0.45294049260120256f, - 0.45282378630966363f, - 0.4527070722591111f, - 0.4525903504515456f, - 0.45247362088896637f, - 0.4523568835733742f, - 0.4522401385067687f, - 0.45212338569115096f, - 0.45200662512852113f, - 0.45188985682087957f, - 0.4517730807702277f, - 0.45165629697856585f, - 0.4515395054478953f, - 0.45142270618021774f, - 0.45130589917753366f, - 0.4511890844418453f, - 0.4510722619751535f, - 0.45095543177946074f, - 0.4508385938567681f, - 0.45072174820907834f, - 0.45060489483839283f, - 0.45048803374671453f, - 0.4503711649360451f, - 0.45025428840838744f, - 0.4501374041657446f, - 0.4500205122101185f, - 0.44990361254351297f, - 0.4497867051679301f, - 0.449669790085374f, - 0.44955286729784716f, - 0.4494359368073537f, - 0.4493189986158966f, - 0.4492020527254802f, - 0.44908509913810757f, - 0.4489681378557835f, - 0.44885116888051124f, - 0.4487341922142955f, - 0.44861720785914105f, - 0.44850021581705146f, - 0.4483832160900323f, - 0.44826620868008743f, - 0.4481491935892226f, - 0.448032170819442f, - 0.4479151403727516f, - 0.4477981022511559f, - 0.44768105645666106f, - 0.4475640029912719f, - 0.44744694185699485f, - 0.44732987305583494f, - 0.4472127965897989f, - 0.44709571246089236f, - 0.44697862067112126f, - 0.44686152122249256f, - 0.4467444141170121f, - 0.44662729935668716f, - 0.44651017694352374f, - 0.4463930468795294f, - 0.44627590916671045f, - 0.44615876380707475f, - 0.4460416108026288f, - 0.4459244501553803f, - 0.44580728186733726f, - 0.44569010594050645f, - 0.4455729223768965f, - 0.4454557311785145f, - 0.4453385323473693f, - 0.44522132588546826f, - 0.44510411179482046f, - 0.4449868900774336f, - 0.444869660735317f, - 0.44475242377047847f, - 0.44463517918492734f, - 0.444517926980673f, - 0.4444006671597236f, - 0.44428339972408926f, - 0.44416612467577854f, - 0.4440488420168016f, - 0.4439315517491673f, - 0.44381425387488627f, - 0.44369694839596746f, - 0.44357963531442174f, - 0.4434623146322584f, - 0.44334498635148845f, - 0.4432276504741216f, - 0.44311030700216864f, - 0.4429929559376407f, - 0.4428755972825478f, - 0.44275823103890155f, - 0.4426408572087122f, - 0.44252347579399176f, - 0.44240608679675114f, - 0.4422886902190013f, - 0.4421712860627547f, - 0.44205387433002213f, - 0.44193645502281625f, - 0.4418190281431482f, - 0.4417015936930309f, - 0.4415841516744757f, - 0.44146670208949573f, - 0.44134924494010275f, - 0.44123178022831006f, - 0.4411143079561296f, - 0.4409968281255751f, - 0.44087934073865864f, - 0.4407618457973942f, - 0.4406443433037942f, - 0.44052683325987285f, - 0.44040931566764285f, - 0.44029179052911815f, - 0.440174257846313f, - 0.44005671762124043f, - 0.4399391698559153f, - 0.43982161455235097f, - 0.4397040517125625f, - 0.4395864813385635f, - 0.4394689034323693f, - 0.4393513179959937f, - 0.4392337250314524f, - 0.4391161245407595f, - 0.43899851652593086f, - 0.4388809009889808f, - 0.4387632779319251f, - 0.4386456473567795f, - 0.4385280092655589f, - 0.43841036366027974f, - 0.43829271054295704f, - 0.4381750499156075f, - 0.43805738178024656f, - 0.43793970613889105f, - 0.4378220229935566f, - 0.4377043323462605f, - 0.4375866341990185f, - 0.4374689285538481f, - 0.43735121541276545f, - 0.4372334947777883f, - 0.4371157666509329f, - 0.4369980310342173f, - 0.4368802879296585f, - 0.4367625373392736f, - 0.4366447792650811f, - 0.4365270137090978f, - 0.43640924067334247f, - 0.4362914601598323f, - 0.4361736721705862f, - 0.43605587670762175f, - 0.43593807377295757f, - 0.4358202633686127f, - 0.435702445496605f, - 0.43558462015895394f, - 0.43546678735767774f, - 0.43534894709479616f, - 0.43523109937232757f, - 0.4351132441922921f, - 0.43499538155670836f, - 0.4348775114675966f, - 0.43475963392697586f, - 0.4346417489368662f, - 0.434523856499288f, - 0.4344059566162605f, - 0.43428804928980475f, - 0.43417013452194014f, - 0.434052212314688f, - 0.43393428267006806f, - 0.4338163455901018f, - 0.4336984010768093f, - 0.4335804491322122f, - 0.4334624897583309f, - 0.43334452295718734f, - 0.433226548730802f, - 0.4331085670811969f, - 0.4329905780103938f, - 0.43287258152041375f, - 0.4327545776132794f, - 0.4326365662910118f, - 0.432518547555634f, - 0.4324005214091673f, - 0.4322824878536349f, - 0.4321644468910588f, - 0.43204639852346133f, - 0.4319283427528659f, - 0.43181027958129464f, - 0.43169220901077127f, - 0.43157413104331815f, - 0.4314560456809593f, - 0.43133795292571725f, - 0.4312198527796163f, - 0.43110174524467926f, - 0.4309836303229307f, - 0.4308655080163937f, - 0.430747378327093f, - 0.4306292412570519f, - 0.4305110968082955f, - 0.4303929449828474f, - 0.4302747857827324f, - 0.43015661920997567f, - 0.43003844526660107f, - 0.4299202639546343f, - 0.4298020752760995f, - 0.4296838792330227f, - 0.4295656758274283f, - 0.42944746506134246f, - 0.42932924693679f, - 0.4292110214557972f, - 0.42909278862038913f, - 0.4289745484325921f, - 0.42885630089443244f, - 0.4287380460079355f, - 0.42861978377512844f, - 0.4285015141980367f, - 0.4283832372786877f, - 0.42826495301910733f, - 0.428146661421323f, - 0.428028362487361f, - 0.42791005621924894f, - 0.4277917426190133f, - 0.42767342168868216f, - 0.42755509343028203f, - 0.4274367578458409f, - 0.4273184149373868f, - 0.42720006470694716f, - 0.42708170715654936f, - 0.4269633422882223f, - 0.42684497010399336f, - 0.4267265906058915f, - 0.42660820379594444f, - 0.42648980967618144f, - 0.42637140824863085f, - 0.42625299951532086f, - 0.42613458347828137f, - 0.42601616013954047f, - 0.42589772950112775f, - 0.4257792915650729f, - 0.4256608463334045f, - 0.42554239380815295f, - 0.42542393399134704f, - 0.4253054668850173f, - 0.42518699249119296f, - 0.4250685108119047f, - 0.424950021849182f, - 0.4248315256050559f, - 0.4247130220815559f, - 0.42459451128071307f, - 0.42447599320455837f, - 0.4243574678551218f, - 0.42423893523443507f, - 0.4241203953445284f, - 0.42400184818743375f, - 0.4238832937651816f, - 0.4237647320798041f, - 0.423646163133332f, - 0.4235275869277977f, - 0.42340900346523225f, - 0.4232904127476684f, - 0.42317181477713717f, - 0.4230532095556713f, - 0.4229345970853033f, - 0.42281597736806487f, - 0.4226973504059893f, - 0.42257871620110843f, - 0.42246007475545583f, - 0.42234142607106356f, - 0.4222227701499655f, - 0.42210410699419393f, - 0.42198543660578286f, - 0.421866758986765f, - 0.4217480741391746f, - 0.42162938206504486f, - 0.4215106827664092f, - 0.4213919762453022f, - 0.4212732625037572f, - 0.42115454154380905f, - 0.4210358133674912f, - 0.4209170779768388f, - 0.4207983353738856f, - 0.42067958556066704f, - 0.420560828539217f, - 0.4204420643115712f, - 0.4203232928797638f, - 0.42020451424583033f, - 0.42008572841180647f, - 0.41996693537972674f, - 0.4198481351516274f, - 0.4197293277295433f, - 0.41961051311551095f, - 0.41949169131156544f, - 0.4193728623197435f, - 0.4192540261420805f, - 0.4191351827806134f, - 0.41901633223737783f, - 0.41889747451441056f, - 0.41877860961374863f, - 0.41865973753742797f, - 0.4185408582874862f, - 0.41842197186595953f, - 0.41830307827488583f, - 0.41818417751630144f, - 0.4180652695922446f, - 0.41794635450475187f, - 0.41782743225586166f, - 0.4177085028476109f, - 0.4175895662820382f, - 0.41747062256118067f, - 0.4173516716870769f, - 0.4172327136617653f, - 0.41711374848728344f, - 0.41699477616567066f, - 0.416875796698965f, - 0.41675681008920484f, - 0.41663781633842967f, - 0.4165188154486777f, - 0.4163998074219888f, - 0.4162807922604012f, - 0.41616176996595516f, - 0.4160427405406892f, - 0.4159237039866437f, - 0.4158046603058575f, - 0.41568560950037114f, - 0.4155665515722238f, - 0.41544748652345626f, - 0.41532841435610784f, - 0.4152093350722197f, - 0.4150902486738313f, - 0.4149711551629841f, - 0.41485205454171786f, - 0.4147329468120742f, - 0.41461383197609303f, - 0.4144947100358159f, - 0.4143755809932843f, - 0.41425644485053864f, - 0.41413730160962114f, - 0.41401815127257247f, - 0.413898993841435f, - 0.41377982931824975f, - 0.4136606577050593f, - 0.4135414790039048f, - 0.41342229321682916f, - 0.41330310034587386f, - 0.41318390039308156f, - 0.41306469336049517f, - 0.41294547925015646f, - 0.41282625806410894f, - 0.4127070298043946f, - 0.4125877944730572f, - 0.412468552072139f, - 0.412349302603684f, - 0.41223004606973473f, - 0.41211078247233535f, - 0.41199151181352867f, - 0.4118722340953591f, - 0.4117529493198697f, - 0.4116336574891052f, - 0.4115143586051087f, - 0.4113950526699253f, - 0.4112757396855984f, - 0.4111564196541732f, - 0.41103709257769383f, - 0.41091775845820455f, - 0.41079841729775085f, - 0.41067906909837687f, - 0.4105597138621284f, - 0.41044035159104975f, - 0.41032098228718694f, - 0.4102016059525846f, - 0.4100822225892885f, - 0.40996283219934476f, - 0.40984343478479823f, - 0.40972403034769556f, - 0.40960461889008193f, - 0.4094852004140042f, - 0.4093657749215078f, - 0.4092463424146398f, - 0.40912690289544595f, - 0.4090074563659735f, - 0.4088880028282684f, - 0.40876854228437787f, - 0.40864907473634915f, - 0.4085296001862286f, - 0.408410118636064f, - 0.40829063008790206f, - 0.4081711345437909f, - 0.40805163200577715f, - 0.4079321224759093f, - 0.4078126059562344f, - 0.4076930824488011f, - 0.40757355195565653f, - 0.40745401447884966f, - 0.40733447002042794f, - 0.4072149185824401f, - 0.40709536016693504f, - 0.4069757947759606f, - 0.40685622241156627f, - 0.40673664307580004f, - 0.40661705677071175f, - 0.40649746349834964f, - 0.4063778632607637f, - 0.4062582560600029f, - 0.40613864189811616f, - 0.40601902077715396f, - 0.40589939269916514f, - 0.4057797576662003f, - 0.40566011568030846f, - 0.4055404667435406f, - 0.405420810857946f, - 0.4053011480255757f, - 0.4051814782484794f, - 0.40506180152870824f, - 0.4049421178683122f, - 0.40482242726934276f, - 0.40470272973384996f, - 0.4045830252638857f, - 0.40446331386150014f, - 0.404343595528745f, - 0.4042238702676719f, - 0.4041041380803317f, - 0.40398439896877664f, - 0.40386465293505763f, - 0.4037448999812273f, - 0.4036251401093368f, - 0.403505373321439f, - 0.40338559961958514f, - 0.4032658190058285f, - 0.40314603148222056f, - 0.4030262370508143f, - 0.40290643571366275f, - 0.40278662747281785f, - 0.4026668123303333f, - 0.40254699028826135f, - 0.40242716134865586f, - 0.40230732551356924f, - 0.4021874827850557f, - 0.4020676331651679f, - 0.40194777665596026f, - 0.40182791325948564f, - 0.4017080429777987f, - 0.4015881658129526f, - 0.4014682817670021f, - 0.4013483908420007f, - 0.4012284930400034f, - 0.4011085883630639f, - 0.4009886768132375f, - 0.4008687583925781f, - 0.40074883310314113f, - 0.40062890094698084f, - 0.400508961926153f, - 0.4003890160427122f, - 0.4002690632987134f, - 0.4001491036962124f, - 0.400029137237265f, - 0.399909163923926f, - 0.3997891837582519f, - 0.3996691967422977f, - 0.3995492028781203f, - 0.3994292021677748f, - 0.3993091946133182f, - 0.39918918021680605f, - 0.3990691589802955f, - 0.3989491309058424f, - 0.3988290959955041f, - 0.3987090542513365f, - 0.39858900567539707f, - 0.3984689502697431f, - 0.3983488880364309f, - 0.39822881897751855f, - 0.39810874309506256f, - 0.3979886603911212f, - 0.39786857086775124f, - 0.39774847452701123f, - 0.3976283713709582f, - 0.3975082614016508f, - 0.39738814462114636f, - 0.39726802103150377f, - 0.3971478906347806f, - 0.39702775343303565f, - 0.3969076094283278f, - 0.39678745862271486f, - 0.3966673010182564f, - 0.3965471366170106f, - 0.39642696542103706f, - 0.39630678743239417f, - 0.39618660265314193f, - 0.3960664110853389f, - 0.39594621273104535f, - 0.39582600759232f, - 0.3957057956712233f, - 0.3955855769698148f, - 0.3954653514901538f, - 0.3953451192343013f, - 0.3952248802043166f, - 0.39510463440226073f, - 0.3949843818301933f, - 0.3948641224901756f, - 0.3947438563842674f, - 0.3946235835145303f, - 0.3945033038830243f, - 0.3943830174918112f, - 0.3942627243429512f, - 0.39414242443850594f, - 0.39402211778053714f, - 0.3939018043711054f, - 0.393781484212273f, - 0.3936611573061009f, - 0.39354082365465165f, - 0.39342048325998624f, - 0.3933001361241676f, - 0.3931797822492569f, - 0.39305942163731733f, - 0.3929390542904104f, - 0.39281868021059885f, - 0.3926982993999457f, - 0.39257791186051294f, - 0.39245751759436415f, - 0.3923371166035614f, - 0.3922167088901685f, - 0.39209629445624794f, - 0.39197587330386363f, - 0.3918554454350783f, - 0.3917350108519561f, - 0.39161456955656f, - 0.39149412155095437f, - 0.39137366683720237f, - 0.39125320541736835f, - 0.3911327372935167f, - 0.3910122624677109f, - 0.39089178094201604f, - 0.3907712927184961f, - 0.3906507977992152f, - 0.39053029618623886f, - 0.390409787881631f, - 0.39028927288745724f, - 0.39016875120578187f, - 0.3900482228386708f, - 0.3899276877881883f, - 0.3898071460564007f, - 0.38968659764537256f, - 0.38956604255717026f, - 0.3894454807938586f, - 0.38932491235750427f, - 0.3892043372501724f, - 0.3890837554739297f, - 0.38896316703084155f, - 0.38884257192297506f, - 0.38872197015239573f, - 0.3886013617211709f, - 0.3884807466313662f, - 0.388360124885049f, - 0.3882394964842863f, - 0.3881188614311443f, - 0.38799821972769094f, - 0.3878775713759925f, - 0.38775691637811704f, - 0.38763625473613117f, - 0.38751558645210316f, - 0.3873949115280999f, - 0.38727422996618993f, - 0.3871535417684402f, - 0.38703284693691914f, - 0.38691214547369523f, - 0.3867914373808358f, - 0.38667072266041f, - 0.38655000131448547f, - 0.3864292733451315f, - 0.3863085387544159f, - 0.38618779754440824f, - 0.3860670497171766f, - 0.3859462952747908f, - 0.3858255342193191f, - 0.3857047665528315f, - 0.3855839922773965f, - 0.3854632113950843f, - 0.3853424239079638f, - 0.38522162981810537f, - 0.38510082912757837f, - 0.3849800218384523f, - 0.384859207952798f, - 0.3847383874726847f, - 0.38461756040018347f, - 0.38449672673736385f, - 0.3843758864862971f, - 0.384255039649053f, - 0.3841341862277026f, - 0.3840133262243171f, - 0.3838924596409666f, - 0.38377158647972287f, - 0.38365070674265633f, - 0.383529820431839f, - 0.38340892754934136f, - 0.3832880280972358f, - 0.38316712207759296f, - 0.3830462094924854f, - 0.38292529034398415f, - 0.3828043646341619f, - 0.3826834323650899f, - 0.38256249353884064f, - 0.3824415481574868f, - 0.38232059622309994f, - 0.3821996377377534f, - 0.3820786727035189f, - 0.38195770112247f, - 0.38183672299667865f, - 0.3817157383282186f, - 0.38159474711916214f, - 0.3814737493715831f, - 0.3813527450875541f, - 0.38123173426914925f, - 0.3811107169184412f, - 0.3809896930375039f, - 0.3808686626284116f, - 0.3807476256932373f, - 0.38062658223405565f, - 0.38050553225294f, - 0.3803844757519652f, - 0.3802634127332048f, - 0.3801423431987339f, - 0.38002126715062673f, - 0.37990018459095737f, - 0.3797790955218014f, - 0.3796579999452328f, - 0.37953689786332734f, - 0.37941578927815933f, - 0.3792946741918046f, - 0.3791735526063377f, - 0.3790524245238349f, - 0.37893128994637076f, - 0.3788101488760217f, - 0.3786890013148627f, - 0.37856784726497045f, - 0.3784466867284199f, - 0.37832551970728806f, - 0.3782043462036503f, - 0.37808316621958316f, - 0.37796197975716356f, - 0.3778407868184671f, - 0.37771958740557127f, - 0.377598381520552f, - 0.3774771691654868f, - 0.3773559503424519f, - 0.3772347250535252f, - 0.3771134933007829f, - 0.37699225508630324f, - 0.3768710104121627f, - 0.37674975928043924f, - 0.3766285016932108f, - 0.3765072376525544f, - 0.37638596716054856f, - 0.3762646902192705f, - 0.376143406830799f, - 0.37602211699721144f, - 0.3759008207205869f, - 0.3757795180030029f, - 0.37565820884653883f, - 0.37553689325327244f, - 0.3754155712252832f, - 0.3752942427646492f, - 0.37517290787345015f, - 0.37505156655376426f, - 0.3749302188076715f, - 0.3748088646372503f, - 0.37468750404458095f, - 0.374566137031742f, - 0.3744447636008139f, - 0.3743233837538759f, - 0.3742019974930075f, - 0.3740806048202893f, - 0.37395920573780067f, - 0.37383780024762203f, - 0.37371638835183413f, - 0.3735949700525164f, - 0.37347354535175026f, - 0.3733521142516154f, - 0.3732306767541933f, - 0.373109232861564f, - 0.3729877825758092f, - 0.37286632589900914f, - 0.37274486283324565f, - 0.3726233933805993f, - 0.37250191754315215f, - 0.37238043532298487f, - 0.37225894672217946f, - 0.3721374517428179f, - 0.3720159503869813f, - 0.3718944426567523f, - 0.3717729285542121f, - 0.3716514080814436f, - 0.3715298812405282f, - 0.3714083480335491f, - 0.3712868084625879f, - 0.3711652625297279f, - 0.371043710237051f, - 0.3709221515866404f, - 0.37080058658057935f, - 0.37067901522095f, - 0.3705574375098363f, - 0.37043585344932056f, - 0.37031426304148696f, - 0.3701926662884181f, - 0.3700710631921984f, - 0.3699494537549105f, - 0.36982783797863916f, - 0.36970621586546726f, - 0.3695845874174796f, - 0.36946295263676f, - 0.369341311525392f, - 0.3692196640854609f, - 0.36909801031905015f, - 0.36897635022824515f, - 0.36885468381512965f, - 0.3687330110817892f, - 0.36861133203030777f, - 0.36848964666277123f, - 0.3683679549812637f, - 0.36824625698787117f, - 0.36812455268467814f, - 0.3680028420737703f, - 0.3678811251572337f, - 0.3677594019371529f, - 0.36763767241561457f, - 0.3675159365947036f, - 0.36739419447650673f, - 0.3672724460631092f, - 0.367150691356598f, - 0.3670289303590584f, - 0.3669071630725777f, - 0.36678538949924144f, - 0.3666636096411371f, - 0.36654182350035036f, - 0.3664200310789686f, - 0.36629823237907894f, - 0.3661764274027676f, - 0.3660546161521226f, - 0.36593279862923017f, - 0.3658109748361785f, - 0.3656891447750542f, - 0.36556730844794566f, - 0.3654454658569396f, - 0.36532361700412463f, - 0.36520176189158776f, - 0.36507990052141776f, - 0.36495803289570194f, - 0.36483615901652877f, - 0.364714278885987f, - 0.3645923925061646f, - 0.36447049987914965f, - 0.3643486010070316f, - 0.3642266958918982f, - 0.3641047845358392f, - 0.36398286694094273f, - 0.36386094310929856f, - 0.363739013042995f, - 0.36361707674412214f, - 0.36349513421476853f, - 0.36337318545702435f, - 0.3632512304729784f, - 0.3631292692647212f, - 0.36300730183434166f, - 0.3628853281839305f, - 0.36276334831557683f, - 0.3626413622313716f, - 0.36251936993340417f, - 0.3623973714237657f, - 0.3622753667045458f, - 0.3621533557778358f, - 0.3620313386457254f, - 0.36190931531030585f, - 0.36178728577366837f, - 0.3616652500379031f, - 0.3615432081051019f, - 0.361421159977355f, - 0.36129910565675466f, - 0.36117704514539134f, - 0.36105497844535733f, - 0.36093290555874336f, - 0.360810826487642f, - 0.3606887412341442f, - 0.36056664980034225f, - 0.3604445521883286f, - 0.3603224484001945f, - 0.360200338438033f, - 0.3600782223039356f, - 0.35995609999999556f, - 0.3598339715283046f, - 0.35971183689095615f, - 0.35958969609004215f, - 0.3594675491276562f, - 0.3593453960058906f, - 0.3592232367268391f, - 0.35910107129259405f, - 0.35897889970524954f, - 0.3588567219668982f, - 0.3587345380796343f, - 0.358612348045551f, - 0.35849015186674155f, - 0.35836794954530066f, - 0.3582457410833213f, - 0.3581235264828984f, - 0.35800130574612526f, - 0.3578790788750968f, - 0.35775684587190665f, - 0.35763460673864955f, - 0.35751236147742055f, - 0.35739011009031335f, - 0.3572678525794236f, - 0.35714558894684534f, - 0.3570233191946743f, - 0.35690104332500466f, - 0.3567787613399325f, - 0.3566564732415523f, - 0.35653417903196016f, - 0.3564118787132508f, - 0.35628957228752056f, - 0.35616725975686436f, - 0.35604494112337837f, - 0.35592261638915895f, - 0.3558002855563012f, - 0.35567794862690216f, - 0.3555556056030571f, - 0.3554332564868632f, - 0.3553109012804161f, - 0.35518853998581307f, - 0.35506617260514994f, - 0.3549437991405243f, - 0.3548214195940322f, - 0.35469903396777086f, - 0.35457664226383784f, - 0.35445424448432944f, - 0.3543318406313437f, - 0.3542094307069772f, - 0.3540870147133282f, - 0.35396459265249347f, - 0.3538421645265715f, - 0.35371973033765963f, - 0.35359729008785534f, - 0.3534748437792574f, - 0.3533523914139631f, - 0.35322993299407146f, - 0.3531074685216799f, - 0.3529849979988877f, - 0.3528625214277925f, - 0.35274003881049376f, - 0.3526175501490893f, - 0.35249505544567883f, - 0.3523725547023604f, - 0.3522500479212339f, - 0.3521275351043975f, - 0.35200501625395136f, - 0.3518824913719939f, - 0.3517599604606255f, - 0.35163742352194477f, - 0.3515148805580518f, - 0.3513923315710467f, - 0.35126977656302855f, - 0.35114721553609807f, - 0.35102464849235454f, - 0.3509020754338989f, - 0.35077949636283057f, - 0.3506569112812507f, - 0.350534320191259f, - 0.3504117230949569f, - 0.3502891199944441f, - 0.35016651089182194f, - 0.3500438957891916f, - 0.34992127468865325f, - 0.34979864759230883f, - 0.34967601450225866f, - 0.34955337542060483f, - 0.34943073034944794f, - 0.34930807929089036f, - 0.34918542224703275f, - 0.3490627592199777f, - 0.34894009021182615f, - 0.34881741522468085f, - 0.3486947342606429f, - 0.34857204732181535f, - 0.34844935441029956f, - 0.3483266555281986f, - 0.34820395067761406f, - 0.34808123986064937f, - 0.3479585230794062f, - 0.3478358003359882f, - 0.3477130716324977f, - 0.34759033697103725f, - 0.3474675963537107f, - 0.34734484978262037f, - 0.34722209725986986f, - 0.3470993387875629f, - 0.34697657436780216f, - 0.346853804002692f, - 0.34673102769433517f, - 0.34660824544483626f, - 0.34648545725629826f, - 0.34636266313082603f, - 0.3462398630705227f, - 0.3461170570774933f, - 0.3459942451538412f, - 0.3458714273016716f, - 0.3457486035230881f, - 0.3456257738201957f, - 0.3455029381950995f, - 0.34538009664990327f, - 0.3452572491867129f, - 0.3451343958076324f, - 0.3450115365147677f, - 0.3448886713102231f, - 0.3447658001961047f, - 0.34464292317451706f, - 0.34452004024756644f, - 0.3443971514173576f, - 0.3442742566859966f, - 0.34415135605558966f, - 0.34402844952824174f, - 0.34390553710605976f, - 0.34378261879114885f, - 0.3436596945856161f, - 0.3435367644915669f, - 0.34341382851110847f, - 0.34329088664634644f, - 0.34316793889938824f, - 0.3430449852723397f, - 0.3429220257673084f, - 0.34279906038640084f, - 0.3426760891317236f, - 0.3425531120053846f, - 0.34243012900949005f, - 0.34230714014614827f, - 0.3421841454174656f, - 0.34206114482555056f, - 0.34193813837250975f, - 0.3418151260604518f, - 0.34169210789148347f, - 0.3415690838677137f, - 0.3414460539912495f, - 0.3413230182641994f, - 0.341199976688672f, - 0.34107692926677485f, - 0.340953876000617f, - 0.3408308168923062f, - 0.34070775194395186f, - 0.34058468115766183f, - 0.3404616045355457f, - 0.3403385220797115f, - 0.34021543379226915f, - 0.3400923396753268f, - 0.3399692397309945f, - 0.33984613396138075f, - 0.3397230223685953f, - 0.339599904954748f, - 0.33947678172194773f, - 0.3393536526723049f, - 0.3392305178079285f, - 0.33910737713092926f, - 0.33898423064341626f, - 0.3388610783475005f, - 0.3387379202452913f, - 0.33861475633889976f, - 0.33849158663043544f, - 0.3383684111220092f, - 0.33824522981573213f, - 0.33812204271371393f, - 0.3379988498180664f, - 0.3378756511308998f, - 0.3377524466543248f, - 0.3376292363904533f, - 0.33750602034139565f, - 0.3373827985092639f, - 0.33725957089616865f, - 0.33713633750422217f, - 0.33701309833553567f, - 0.33688985339222033f, - 0.33676660267638836f, - 0.33664334619015207f, - 0.33652008393562255f, - 0.3363968159149127f, - 0.33627354213013394f, - 0.33615026258339925f, - 0.33602697727682024f, - 0.33590368621251016f, - 0.33578038939258076f, - 0.3356570868191455f, - 0.33553377849431637f, - 0.33541046442020694f, - 0.33528714459892944f, - 0.3351638190325973f, - 0.33504048772332407f, - 0.3349171506732222f, - 0.3347938078844058f, - 0.33467045935898765f, - 0.3345471050990819f, - 0.3344237451068015f, - 0.334300379384261f, - 0.3341770079335734f, - 0.33405363075685346f, - 0.3339302478562144f, - 0.33380685923377074f, - 0.3336834648916372f, - 0.3335600648319271f, - 0.33343665905675596f, - 0.33331324756823727f, - 0.33318983036848654f, - 0.3330664074596177f, - 0.3329429788437463f, - 0.3328195445229865f, - 0.3326961044994542f, - 0.3325726587752636f, - 0.3324492073525307f, - 0.3323257502333701f, - 0.33220228741989793f, - 0.33207881891422886f, - 0.33195534471847943f, - 0.3318318648347648f, - 0.3317083792652004f, - 0.331584888011903f, - 0.3314613910769877f, - 0.3313378884625714f, - 0.3312143801707695f, - 0.33109086620369904f, - 0.33096734656347565f, - 0.33084382125221623f, - 0.3307202902720377f, - 0.3305967536250559f, - 0.3304732113133885f, - 0.3303496633391515f, - 0.33022610970446264f, - 0.3301025504114382f, - 0.3299789854621962f, - 0.32985541485885295f, - 0.32973183860352673f, - 0.3296082566983341f, - 0.3294846691453935f, - 0.3293610759468216f, - 0.3292374771047367f, - 0.329113872621257f, - 0.3289902624984996f, - 0.3288666467385834f, - 0.32874302534362554f, - 0.3286193983157452f, - 0.32849576565705985f, - 0.32837212736968874f, - 0.3282484834557495f, - 0.3281248339173616f, - 0.32800117875664286f, - 0.3278775179757126f, - 0.32775385157669f, - 0.3276301795616933f, - 0.3275065019328424f, - 0.3273828186922557f, - 0.32725912984205324f, - 0.3271354353843536f, - 0.32701173532127703f, - 0.32688802965494274f, - 0.32676431838746994f, - 0.3266406015209793f, - 0.3265168790575897f, - 0.32639315099942207f, - 0.32626941734859555f, - 0.3261456781072311f, - 0.32602193327744816f, - 0.3258981828613679f, - 0.3257744268611099f, - 0.3256506652787955f, - 0.32552689811654456f, - 0.32540312537647853f, - 0.3252793470607175f, - 0.3251555631713831f, - 0.32503177371059555f, - 0.3249079786804764f, - 0.32478417808314725f, - 0.3246603719207285f, - 0.3245365601953424f, - 0.3244127429091096f, - 0.32428892006415255f, - 0.324165091662592f, - 0.3240412577065506f, - 0.32391741819814945f, - 0.3237935731395112f, - 0.32366972253275716f, - 0.32354586638001026f, - 0.32342200468339194f, - 0.32329813744502495f, - 0.32317426466703214f, - 0.32305038635153516f, - 0.3229265025006576f, - 0.32280261311652114f, - 0.32267871820124955f, - 0.32255481775696493f, - 0.32243091178579103f, - 0.32230700028985015f, - 0.3221830832712663f, - 0.32205916073216195f, - 0.32193523267466134f, - 0.32181129910088707f, - 0.3216873600129635f, - 0.32156341541301353f, - 0.32143946530316175f, - 0.32131550968553113f, - 0.3211915485622465f, - 0.32106758193543145f, - 0.3209436098072097f, - 0.3208196321797063f, - 0.3206956490550448f, - 0.3205716604353504f, - 0.32044766632274674f, - 0.32032366671935897f, - 0.32019966162731206f, - 0.32007565104873004f, - 0.31995163498573864f, - 0.319827613440462f, - 0.31970358641502605f, - 0.31957955391155507f, - 0.31945551593217525f, - 0.319331472479011f, - 0.31920742355418863f, - 0.31908336915983293f, - 0.3189593092980703f, - 0.31883524397102564f, - 0.3187111731808252f, - 0.3185870969295954f, - 0.3184630152194613f, - 0.3183389280525499f, - 0.31821483543098655f, - 0.31809073735689836f, - 0.3179666338324109f, - 0.31784252485965153f, - 0.31771841044074595f, - 0.3175942905778216f, - 0.31747016527300453f, - 0.3173460345284219f, - 0.3172218983462011f, - 0.3170977567284684f, - 0.3169736096773518f, - 0.3168494571949775f, - 0.3167252992834738f, - 0.31660113594496725f, - 0.3164769671815862f, - 0.3163527929954574f, - 0.31622861338870933f, - 0.3161044283634694f, - 0.31598023792186514f, - 0.31585604206602524f, - 0.315731840798077f, - 0.31560763412014936f, - 0.31548342203436974f, - 0.31535920454286737f, - 0.3152349816477698f, - 0.3151107533512064f, - 0.31498651965530494f, - 0.314862280562195f, - 0.3147380360740045f, - 0.31461378619286323f, - 0.3144895309208993f, - 0.31436527026024225f, - 0.31424100421302165f, - 0.31411673278136587f, - 0.31399245596740516f, - 0.31386817377326814f, - 0.3137438862010852f, - 0.31361959325298505f, - 0.31349529493109834f, - 0.3133709912375541f, - 0.3132466821744829f, - 0.3131223677440141f, - 0.31299804794827846f, - 0.31287372278940545f, - 0.31274939226952575f, - 0.3126250563907701f, - 0.3125007151552681f, - 0.3123763685651513f, - 0.3122520166225493f, - 0.3121276593295938f, - 0.31200329668841476f, - 0.311878928701144f, - 0.31175455536991153f, - 0.3116301766968495f, - 0.3115057926840881f, - 0.31138140333375913f, - 0.3112570086479943f, - 0.3111326086289244f, - 0.3110082032786816f, - 0.31088379259939736f, - 0.31075937659320285f, - 0.31063495526223084f, - 0.31051052860861234f, - 0.31038609663448025f, - 0.31026165934196587f, - 0.3101372167332021f, - 0.31001276881032097f, - 0.3098883155754544f, - 0.3097638570307352f, - 0.3096393931782965f, - 0.30951492402027f, - 0.30939044955878925f, - 0.30926596979598636f, - 0.30914148473399505f, - 0.3090169943749475f, - 0.3088924987209777f, - 0.30876799777421793f, - 0.3086434915368023f, - 0.3085189800108635f, - 0.30839446319853525f, - 0.30826994110195166f, - 0.30814541372324544f, - 0.3080208810645513f, - 0.30789634312800207f, - 0.30777179991573267f, - 0.30764725142987615f, - 0.30752269767256757f, - 0.3073981386459402f, - 0.30727357435212915f, - 0.30714900479326807f, - 0.30702442997149215f, - 0.30689984988893515f, - 0.3067752645477322f, - 0.30665067395001827f, - 0.30652607809792753f, - 0.3064014769935957f, - 0.3062768706391569f, - 0.3061522590367471f, - 0.3060276421885006f, - 0.30590302009655357f, - 0.3057783927630405f, - 0.3056537601900977f, - 0.30552912237985985f, - 0.3054044793344635f, - 0.30527983105604345f, - 0.30515517754673643f, - 0.3050305188086778f, - 0.30490585484400334f, - 0.30478118565484974f, - 0.3046565112433525f, - 0.30453183161164865f, - 0.30440714676187375f, - 0.30428245669616505f, - 0.3041577614166582f, - 0.3040330609254907f, - 0.3039083552247984f, - 0.3037836443167186f, - 0.3036589282033885f, - 0.3035342068869443f, - 0.3034094803695239f, - 0.3032847486532636f, - 0.3031600117403015f, - 0.30303526963277405f, - 0.3029105223328195f, - 0.30278576984257466f, - 0.30266101216417785f, - 0.3025362492997659f, - 0.3024114812514775f, - 0.30228670802144963f, - 0.3021619296118207f, - 0.30203714602472914f, - 0.3019123572623123f, - 0.3017875633267092f, - 0.3016627642200573f, - 0.30153795994449584f, - 0.3014131505021625f, - 0.30128833589519666f, - 0.30116351612573616f, - 0.3010386911959206f, - 0.300913861107888f, - 0.30078902586377765f, - 0.30066418546572904f, - 0.3005393399158804f, - 0.3004144892163718f, - 0.30028963336934167f, - 0.30016477237693023f, - 0.30003990624127647f, - 0.2999150349645196f, - 0.29979015854880003f, - 0.29966527699625667f, - 0.2995403903090301f, - 0.2994154984892596f, - 0.2992906015390857f, - 0.29916569946064786f, - 0.299040792256087f, - 0.2989158799275425f, - 0.2987909624771556f, - 0.2986660399070658f, - 0.29854111221941454f, - 0.2984161794163416f, - 0.2982912414999884f, - 0.29816629847249504f, - 0.29804135033600304f, - 0.29791639709265266f, - 0.29779143874458525f, - 0.29766647529394247f, - 0.29754150674286456f, - 0.2974165330934938f, - 0.2972915543479706f, - 0.2971665705084374f, - 0.2970415815770349f, - 0.29691658755590555f, - 0.2967915884471903f, - 0.2966665842530317f, - 0.296541574975571f, - 0.2964165606169509f, - 0.29629154117931267f, - 0.296166516664799f, - 0.29604148707555245f, - 0.29591645241371456f, - 0.29579141268142867f, - 0.2956663678808364f, - 0.2955413180140812f, - 0.29541626308330493f, - 0.29529120309065127f, - 0.29516613803826214f, - 0.29504106792828144f, - 0.2949159927628513f, - 0.2947909125441157f, - 0.2946658272742171f, - 0.29454073695529953f, - 0.2944156415895056f, - 0.2942905411789796f, - 0.29416543572586434f, - 0.29404032523230417f, - 0.29391520970044244f, - 0.2937900891324226f, - 0.2936649635303894f, - 0.29353983289648594f, - 0.2934146972328571f, - 0.2932895565416464f, - 0.2931644108249983f, - 0.29303926008505765f, - 0.2929141043239681f, - 0.29278894354387486f, - 0.2926637777469217f, - 0.2925386069352543f, - 0.2924134311110164f, - 0.29228825027635386f, - 0.2921630644334106f, - 0.29203787358433264f, - 0.2919126777312642f, - 0.29178747687635087f, - 0.2916622710217384f, - 0.29153706016957126f, - 0.2914118443219958f, - 0.2912866234811567f, - 0.2911613976492004f, - 0.29103616682827177f, - 0.2909109310205175f, - 0.2907856902280826f, - 0.2906604444531139f, - 0.29053519369775654f, - 0.2904099379641576f, - 0.2902846772544624f, - 0.29015941157081765f, - 0.29003414091537016f, - 0.28990886529026566f, - 0.2897835846976515f, - 0.28965829913967345f, - 0.28953300861847914f, - 0.2894077131362145f, - 0.28928241269502736f, - 0.28915710729706373f, - 0.2890317969444717f, - 0.28890648163939786f, - 0.28878116138398907f, - 0.28865583618039353f, - 0.2885305060307578f, - 0.2884051709372302f, - 0.2882798309019576f, - 0.2881544859270883f, - 0.2880291360147693f, - 0.2879037811671494f, - 0.28777842138637544f, - 0.28765305667459645f, - 0.28752768703395964f, - 0.28740231246661396f, - 0.28727693297470697f, - 0.28715154856038727f, - 0.2870261592258038f, - 0.28690076497310424f, - 0.28677536580443796f, - 0.28664996172195284f, - 0.28652455272779853f, - 0.286399138824123f, - 0.286273720013076f, - 0.2861482962968057f, - 0.2860228676774621f, - 0.28589743415719354f, - 0.28577199573815004f, - 0.2856465524224802f, - 0.2855211042123339f, - 0.285395651109861f, - 0.2852701931172103f, - 0.28514473023653236f, - 0.28501926246997605f, - 0.2848937898196921f, - 0.2847683122878296f, - 0.28464282987653944f, - 0.28451734258797085f, - 0.2843918504242749f, - 0.28426635338760103f, - 0.28414085148009993f, - 0.2840153447039226f, - 0.283889833061219f, - 0.2837643165541394f, - 0.28363879518483537f, - 0.28351326895545675f, - 0.2833877378681553f, - 0.28326220192508106f, - 0.283136661128386f, - 0.28301111548022023f, - 0.282885564982736f, - 0.28276000963808395f, - 0.2826344494484151f, - 0.28250888441588135f, - 0.2823833145426346f, - 0.28225773983082564f, - 0.28213216028260696f, - 0.2820065759001295f, - 0.281880986685546f, - 0.2817553926410075f, - 0.2816297937686669f, - 0.2815041900706755f, - 0.2813785815491862f, - 0.28125296820635054f, - 0.28112735004432127f, - 0.2810017270652512f, - 0.28087609927129203f, - 0.2807504666645972f, - 0.2806248292473186f, - 0.2804991870216097f, - 0.28037353998962267f, - 0.28024788815351115f, - 0.28012223151542737f, - 0.27999657007752526f, - 0.2798709038419571f, - 0.2797452328108771f, - 0.27961955698643765f, - 0.27949387637079265f, - 0.279368190966096f, - 0.27924250077450047f, - 0.2791168057981605f, - 0.2789911060392291f, - 0.2788654014998609f, - 0.2787396921822089f, - 0.2786139780884281f, - 0.27848825922067155f, - 0.27836253558109436f, - 0.2782368071718499f, - 0.2781110739950933f, - 0.27798533605297826f, - 0.2778595933476599f, - 0.2777338458812926f, - 0.27760809365603034f, - 0.2774823366740289f, - 0.2773565749374421f, - 0.2772308084484258f, - 0.27710503720913404f, - 0.27697926122172273f, - 0.27685348048834624f, - 0.27672769501116057f, - 0.27660190479232016f, - 0.27647610983398085f, - 0.27635031013829847f, - 0.27622450570742785f, - 0.2760986965435253f, - 0.27597288264874575f, - 0.2758470640252459f, - 0.27572124067518067f, - 0.2755954126007069f, - 0.27546957980397974f, - 0.2753437422871562f, - 0.2752179000523916f, - 0.27509205310184265f, - 0.2749662014376661f, - 0.27484034506201754f, - 0.27471448397705434f, - 0.27458861818493224f, - 0.2744627476878088f, - 0.2743368724878399f, - 0.27421099258718323f, - 0.27408510798799485f, - 0.2739592186924326f, - 0.27383332470265276f, - 0.2737074260208133f, - 0.2735815226490706f, - 0.27345561458958245f, - 0.2733297018445066f, - 0.2732037844159998f, - 0.27307786230622033f, - 0.27295193551732505f, - 0.2728260040514725f, - 0.27270006791082013f, - 0.27257412709752527f, - 0.27244818161374684f, - 0.27232223146164203f, - 0.27219627664336976f, - 0.2720703171610874f, - 0.2719443530169541f, - 0.2718183842131273f, - 0.2716924107517664f, - 0.271566432635029f, - 0.2714404498650746f, - 0.27131446244406093f, - 0.2711884703741477f, - 0.2710624736574929f, - 0.2709364722962562f, - 0.2708104662925959f, - 0.27068445564867183f, - 0.2705584403666423f, - 0.270432420448667f, - 0.27030639589690564f, - 0.2701803667135168f, - 0.2700543329006608f, - 0.2699282944604963f, - 0.2698022513951839f, - 0.26967620370688233f, - 0.2695501513977523f, - 0.2694240944699528f, - 0.2692980329256447f, - 0.2691719667669871f, - 0.26904589599614104f, - 0.26891982061526576f, - 0.268793740626522f, - 0.2686676560320706f, - 0.26854156683407104f, - 0.2684154730346847f, - 0.26828937463607133f, - 0.2681632716403924f, - 0.2680371640498079f, - 0.26791105186647934f, - 0.2677849350925669f, - 0.2676588137302324f, - 0.26753268778163597f, - 0.2674065572489397f, - 0.2672804221343038f, - 0.2671542824398906f, - 0.2670281381678605f, - 0.26690198932037573f, - 0.2667758358995975f, - 0.26664967790768707f, - 0.2665235153468068f, - 0.26639734821911765f, - 0.2662711765267824f, - 0.26614500027196203f, - 0.2660188194568194f, - 0.2658926340835157f, - 0.2657664441542136f, - 0.2656402496710757f, - 0.26551405063626343f, - 0.2653878470519401f, - 0.2652616389202673f, - 0.2651354262434083f, - 0.2650092090235251f, - 0.26488298726278103f, - 0.26475676096333817f, - 0.26463053012736015f, - 0.26450429475700904f, - 0.2643780548544483f, - 0.2642518104218415f, - 0.2641255614613508f, - 0.26399930797514043f, - 0.2638730499653728f, - 0.2637467874342122f, - 0.2636205203838212f, - 0.2634942488163643f, - 0.26336797273400414f, - 0.26324169213890536f, - 0.2631154070332309f, - 0.2629891174191454f, - 0.26286282329881205f, - 0.2627365246743952f, - 0.2626102215480594f, - 0.262483913921968f, - 0.26235760179828604f, - 0.2622312851791771f, - 0.2621049640668063f, - 0.2619786384633373f, - 0.2618523083709356f, - 0.2617259737917649f, - 0.26159963472799075f, - 0.26147329118177753f, - 0.26134694315528967f, - 0.261220590650693f, - 0.26109423367015167f, - 0.26096787221583156f, - 0.26084150628989705f, - 0.2607151358945142f, - 0.2605887610318476f, - 0.26046238170406333f, - 0.2603359979133261f, - 0.26020960966180234f, - 0.26008321695165676f, - 0.2599568197850559f, - 0.25983041816416486f, - 0.2597040120911497f, - 0.2595776015681769f, - 0.2594511865974116f, - 0.25932476718102077f, - 0.25919834332116964f, - 0.2590719150200254f, - 0.25894548227975345f, - 0.258819045102521f, - 0.2586926034904938f, - 0.25856615744583905f, - 0.25843970697072266f, - 0.25831325206731215f, - 0.2581867927377734f, - 0.2580603289842737f, - 0.25793386080898045f, - 0.25780738821405974f, - 0.2576809112016795f, - 0.25755442977400606f, - 0.25742794393320745f, - 0.25730145368145013f, - 0.25717495902090237f, - 0.2570484599537307f, - 0.2569219564821036f, - 0.2567954486081877f, - 0.2566689363341512f, - 0.25654241966216224f, - 0.2564158985943882f, - 0.2562893731329966f, - 0.25616284328015626f, - 0.25603630903803437f, - 0.2559097704088f, - 0.25578322739462034f, - 0.2556566799976646f, - 0.25553012822010074f, - 0.25540357206409675f, - 0.255277011531822f, - 0.2551504466254441f, - 0.25502387734713233f, - 0.2548973036990557f, - 0.25477072568338227f, - 0.25464414330228163f, - 0.254517556557922f, - 0.25439096545247325f, - 0.25426436998810353f, - 0.254137770166983f, - 0.25401116599128004f, - 0.25388455746316474f, - 0.2537579445848058f, - 0.25363132735837296f, - 0.2535047057860363f, - 0.2533780798699645f, - 0.25325144961232826f, - 0.25312481501529643f, - 0.25299817608103964f, - 0.2528715328117271f, - 0.25274488520952954f, - 0.2526182332766162f, - 0.2524915770151582f, - 0.2523649164273247f, - 0.25223825151528706f, - 0.25211158228121466f, - 0.2519849087272784f, - 0.25185823085564923f, - 0.2517315486684969f, - 0.25160486216799294f, - 0.2514781713563072f, - 0.2513514762356114f, - 0.2512247768080754f, - 0.2510980730758713f, - 0.25097136504116907f, - 0.2508446527061407f, - 0.25071793607295656f, - 0.2505912151437888f, - 0.2504644899208082f, - 0.2503377604061858f, - 0.250211026602094f, - 0.2500842885107034f, - 0.2499575461341865f, - 0.24983079947471415f, - 0.24970404853445896f, - 0.24957729331559195f, - 0.24945053382028587f, - 0.24932377005071185f, - 0.24919700200904282f, - 0.24907022969745005f, - 0.2489434531181062f, - 0.24881667227318394f, - 0.24868988716485482f, - 0.24856309779529207f, - 0.24843630416666737f, - 0.24830950628115417f, - 0.24818270414092422f, - 0.2480558977481511f, - 0.24792908710500677f, - 0.24780227221366494f, - 0.24767545307629768f, - 0.24754862969507846f, - 0.24742180207218079f, - 0.24729497020977692f, - 0.24716813411004102f, - 0.24704129377514544f, - 0.2469144492072645f, - 0.24678760040857073f, - 0.24666074738123853f, - 0.24653389012744065f, - 0.24640702864935157f, - 0.2462801629491442f, - 0.24615329302899322f, - 0.24602641889107163f, - 0.2458995405375538f, - 0.24577265797061423f, - 0.24564577119242612f, - 0.24551888020516452f, - 0.2453919850110028f, - 0.24526508561211616f, - 0.24513818201067852f, - 0.24501127420886393f, - 0.2448843622088478f, - 0.24475744601280383f, - 0.24463052562290757f, - 0.24450360104133292f, - 0.24437667227025556f, - 0.2442497393118495f, - 0.2441228021682906f, - 0.24399586084175298f, - 0.24386891533441266f, - 0.24374196564844391f, - 0.24361501178602285f, - 0.24348805374932397f, - 0.2433610915405235f, - 0.24323412516179602f, - 0.24310715461531796f, - 0.24298017990326407f, - 0.2428532010278104f, - 0.2427262179911332f, - 0.2425992307954074f, - 0.24247223944280974f, - 0.24234524393551535f, - 0.2422182442757011f, - 0.24209124046554223f, - 0.2419642325072158f, - 0.24183722040289718f, - 0.24171020415476357f, - 0.24158318376499047f, - 0.24145615923575522f, - 0.24132913056923347f, - 0.24120209776760226f, - 0.24107506083303873f, - 0.2409480197677187f, - 0.2408209745738199f, - 0.24069392525351832f, - 0.24056687180899178f, - 0.24043981424241645f, - 0.24031275255597032f, - 0.24018568675182964f, - 0.24005861683217256f, - 0.23993154279917547f, - 0.23980446465501667f, - 0.23967738240187272f, - 0.239550296041922f, - 0.23942320557734126f, - 0.23929611101030898f, - 0.2391690123430025f, - 0.2390419095775992f, - 0.23891480271627774f, - 0.23878769176121528f, - 0.23866057671459065f, - 0.2385334575785811f, - 0.23840633435536562f, - 0.2382792070471216f, - 0.23815207565602772f, - 0.2380249401842628f, - 0.2378978006340044f, - 0.23777065700743188f, - 0.23764350930672296f, - 0.23751635753405714f, - 0.2373892016916123f, - 0.237262041781568f, - 0.23713487780610232f, - 0.23700770976739502f, - 0.23688053766762418f, - 0.23675336150896933f, - 0.23662618129361002f, - 0.2364989970237246f, - 0.23637180870149319f, - 0.23624461632909427f, - 0.23611741990870808f, - 0.23599021944251328f, - 0.23586301493269024f, - 0.23573580638141775f, - 0.23560859379087631f, - 0.23548137716324488f, - 0.23535415650070407f, - 0.23522693180543294f, - 0.2350997030796119f, - 0.23497247032542137f, - 0.2348452335450406f, - 0.23471799274065067f, - 0.23459074791443088f, - 0.23446349906856245f, - 0.2343362462052249f, - 0.23420898932659948f, - 0.2340817284348663f, - 0.23395446353220553f, - 0.23382719462079865f, - 0.23369992170282552f, - 0.23357264478046783f, - 0.23344536385590553f, - 0.2333180789313204f, - 0.23319079000889262f, - 0.23306349709080407f, - 0.23293620017923503f, - 0.23280889927636755f, - 0.23268159438438207f, - 0.23255428550546076f, - 0.23242697264178414f, - 0.23229965579553458f, - 0.23217233496889275f, - 0.23204501016404067f, - 0.2319176813831605f, - 0.23179034862843303f, - 0.23166301190204103f, - 0.23153567120616544f, - 0.23140832654298915f, - 0.23128097791469324f, - 0.2311536253234607f, - 0.2310262687714728f, - 0.23089890826091264f, - 0.23077154379396164f, - 0.23064417537280257f, - 0.2305168029996183f, - 0.23038942667659046f, - 0.23026204640590245f, - 0.23013466218973608f, - 0.23000727403027485f, - 0.2298798819297007f, - 0.2297524858901973f, - 0.22962508591394673f, - 0.22949768200313275f, - 0.22937027415993758f, - 0.22924286238654512f, - 0.22911544668513775f, - 0.22898802705789953f, - 0.22886060350701287f, - 0.22873317603466206f, - 0.22860574464302963f, - 0.22847830933429994f, - 0.22835087011065575f, - 0.2282234269742815f, - 0.22809597992736005f, - 0.22796852897207603f, - 0.22784107411061288f, - 0.22771361534515405f, - 0.22758615267788393f, - 0.227458686110987f, - 0.2273312156466465f, - 0.22720374128704746f, - 0.22707626303437328f, - 0.2269487808908091f, - 0.22682129485853844f, - 0.2266938049397466f, - 0.22656631113661727f, - 0.2264388134513358f, - 0.226311311886086f, - 0.22618380644305344f, - 0.22605629712442205f, - 0.22592878393237706f, - 0.22580126686910384f, - 0.2256737459367865f, - 0.22554622113761089f, - 0.2254186924737613f, - 0.22529115994742374f, - 0.2251636235607826f, - 0.225036083316024f, - 0.22490853921533252f, - 0.2247809912608944f, - 0.22465343945489427f, - 0.2245258837995186f, - 0.22439832429695214f, - 0.224270760949381f, - 0.22414319375899142f, - 0.2240156227279683f, - 0.22388804785849845f, - 0.22376046915276696f, - 0.2236328866129607f, - 0.22350530024126494f, - 0.22337771003986667f, - 0.22325011601095124f, - 0.22312251815670583f, - 0.2229949164793159f, - 0.22286731098096876f, - 0.2227397016638505f, - 0.22261208853014713f, - 0.22248447158204623f, - 0.22235685082173356f, - 0.2222292262513968f, - 0.2221015978732218f, - 0.2219739656893964f, - 0.22184632970210663f, - 0.22171868991354035f, - 0.22159104632588378f, - 0.22146339894132494f, - 0.22133574776205017f, - 0.22120809279024714f, - 0.22108043402810362f, - 0.2209527714778062f, - 0.22082510514154313f, - 0.22069743502150113f, - 0.22056976111986862f, - 0.22044208343883243f, - 0.2203144019805811f, - 0.22018671674730161f, - 0.22005902774118263f, - 0.21993133496441125f, - 0.21980363841917586f, - 0.21967593810766492f, - 0.2195482340320657f, - 0.21942052619456723f, - 0.21929281459735692f, - 0.21916509924262387f, - 0.21903738013255564f, - 0.2189096572693415f, - 0.2187819306551691f, - 0.21865420029222787f, - 0.21852646618270555f, - 0.2183987283287917f, - 0.2182709867326742f, - 0.21814324139654231f, - 0.21801549232258535f, - 0.2178877395129914f, - 0.21775998296995033f, - 0.2176322226956508f, - 0.21750445869228147f, - 0.21737669096203244f, - 0.2172489195070921f, - 0.21712114432965068f, - 0.21699336543189665f, - 0.21686558281602036f, - 0.21673779648421046f, - 0.2166100064386574f, - 0.21648221268155f, - 0.21635441521507878f, - 0.21622661404143267f, - 0.21609880916280239f, - 0.21597100058137697f, - 0.2158431882993472f, - 0.2157153723189023f, - 0.21558755264223323f, - 0.2154597292715292f, - 0.2153319022089814f, - 0.2152040714567792f, - 0.21507623701711334f, - 0.2149483988921747f, - 0.2148205570841529f, - 0.2146927115952393f, - 0.2145648624276237f, - 0.21443700958349754f, - 0.21430915306505074f, - 0.21418129287447493f, - 0.2140534290139601f, - 0.21392556148569802f, - 0.2137976902918788f, - 0.21366981543469393f, - 0.21354193691633494f, - 0.2134140547389921f, - 0.21328616890485755f, - 0.21315827941612164f, - 0.21303038627497667f, - 0.21290248948361312f, - 0.2127745890442234f, - 0.2126466849589981f, - 0.21251877723012977f, - 0.21239086585980915f, - 0.2122629508502289f, - 0.21213503220357985f, - 0.2120071099220548f, - 0.21187918400784472f, - 0.21175125446314255f, - 0.2116233212901394f, - 0.21149538449102823f, - 0.21136744406800076f, - 0.21123950002324884f, - 0.2111115523589656f, - 0.2109836010773425f, - 0.2108556461805728f, - 0.21072768767084815f, - 0.21059972555036194f, - 0.2104717598213059f, - 0.21034379048587312f, - 0.21021581754625673f, - 0.2100878410046487f, - 0.20995986086324267f, - 0.20983187712423074f, - 0.2097038897898067f, - 0.20957589886216274f, - 0.20944790434349278f, - 0.20931990623598917f, - 0.2091919045418459f, - 0.20906389926325547f, - 0.20893589040241162f, - 0.20880787796150813f, - 0.20867986194273763f, - 0.20855184234829452f, - 0.2084238191803715f, - 0.20829579244116309f, - 0.20816776213286212f, - 0.2080397282576632f, - 0.20791169081775931f, - 0.2077836498153452f, - 0.20765560525261395f, - 0.20752755713176044f, - 0.20739950545497787f, - 0.2072714502244608f, - 0.2071433914424039f, - 0.20701532911100048f, - 0.20688726323244575f, - 0.20675919380893323f, - 0.20663112084265825f, - 0.20650304433581437f, - 0.20637496429059704f, - 0.20624688070920047f, - 0.20611879359381888f, - 0.2059907029466479f, - 0.2058626087698814f, - 0.2057345110657152f, - 0.20560640983634326f, - 0.20547830508396148f, - 0.20535019681076402f, - 0.20522208501894687f, - 0.2050939697107043f, - 0.20496585088823235f, - 0.20483772855372553f, - 0.20470960270938002f, - 0.2045814733573903f, - 0.20445334049995276f, - 0.20432520413926203f, - 0.2041970642775141f, - 0.2040689209169051f, - 0.20394077405962985f, - 0.20381262370788494f, - 0.20368446986386535f, - 0.20355631252976786f, - 0.2034281517077875f, - 0.20329998740012115f, - 0.203171819608964f, - 0.20304364833651303f, - 0.2029154735849636f, - 0.20278729535651233f, - 0.20265911365335598f, - 0.20253092847769003f, - 0.20240273983171178f, - 0.20227454771761683f, - 0.20214635213760257f, - 0.20201815309386476f, - 0.2018899505886009f, - 0.20176174462400684f, - 0.20163353520228025f, - 0.20150532232561705f, - 0.20137710599621506f, - 0.2012488862162703f, - 0.20112066298798068f, - 0.20099243631354238f, - 0.20086420619515347f, - 0.20073597263501017f, - 0.20060773563531067f, - 0.20047949519825137f, - 0.20035125132603052f, - 0.2002230040208451f, - 0.20009475328489218f, - 0.19996649912037015f, - 0.19983824152947574f, - 0.19970998051440705f, - 0.19958171607736225f, - 0.1994534482205382f, - 0.19932517694613366f, - 0.19919690225634562f, - 0.1990686241533729f, - 0.19894034263941265f, - 0.19881205771666383f, - 0.19868376938732366f, - 0.19855547765359122f, - 0.1984271825176639f, - 0.1982988839817408f, - 0.1981705820480195f, - 0.1980422767186988f, - 0.19791396799597763f, - 0.19778565588205366f, - 0.19765734037912633f, - 0.19752902148939344f, - 0.19740069921505457f, - 0.19727237355830762f, - 0.19714404452135226f, - 0.19701571210638655f, - 0.19688737631561026f, - 0.19675903715122153f, - 0.19663069461541985f, - 0.19650234871040478f, - 0.19637399943837464f, - 0.19624564680152948f, - 0.19611729080206775f, - 0.19598893144218965f, - 0.19586056872409374f, - 0.19573220264998034f, - 0.19560383322204808f, - 0.19547546044249742f, - 0.19534708431352713f, - 0.19521870483733775f, - 0.1950903220161286f, - 0.19496193585209906f, - 0.19483354634744984f, - 0.19470515350438003f, - 0.19457675732509044f, - 0.19444835781178024f, - 0.1943199549666504f, - 0.1941915487919002f, - 0.1940631392897307f, - 0.1939347264623413f, - 0.1938063103119332f, - 0.19367789084070589f, - 0.19354946805086068f, - 0.1934210419445972f, - 0.19329261252411642f, - 0.19316417979161937f, - 0.19303574374930585f, - 0.19290730439937745f, - 0.19277886174403408f, - 0.19265041578547742f, - 0.1925219665259075f, - 0.19239351396752613f, - 0.19226505811253344f, - 0.19213659896313134f, - 0.1920081365215201f, - 0.19187967078990134f, - 0.19175120177047666f, - 0.19162272946544653f, - 0.19149425387701313f, - 0.19136577500737698f, - 0.19123729285874042f, - 0.19110880743330405f, - 0.19098031873327037f, - 0.19085182676084006f, - 0.19072333151821572f, - 0.19059483300759816f, - 0.19046633123119008f, - 0.1903378261911924f, - 0.19020931788980755f, - 0.19008080632923782f, - 0.18995229151168438f, - 0.18982377343935022f, - 0.18969525211443697f, - 0.18956672753914636f, - 0.18943819971568154f, - 0.18930966864624393f, - 0.1891811343330367f, - 0.18905259677826142f, - 0.1889240559841214f, - 0.1887955119528183f, - 0.18866696468655553f, - 0.18853841418753486f, - 0.18840986045795985f, - 0.1882813035000323f, - 0.18815274331595597f, - 0.18802417990793274f, - 0.18789561327816645f, - 0.18776704342885914f, - 0.18763847036221468f, - 0.1875098940804353f, - 0.18738131458572502f, - 0.18725273188028604f, - 0.18712414596632213f, - 0.18699555684603697f, - 0.186866964521633f, - 0.1867383689953145f, - 0.1866097702692841f, - 0.18648116834574613f, - 0.18635256322690327f, - 0.18622395491496005f, - 0.1860953434121192f, - 0.18596672872058537f, - 0.18583811084256144f, - 0.1857094897802517f, - 0.18558086553586045f, - 0.18545223811159078f, - 0.18532360750964755f, - 0.18519497373223393f, - 0.18506633678155487f, - 0.18493769665981374f, - 0.18480905336921555f, - 0.18468040691196375f, - 0.18455175729026346f, - 0.18442310450631827f, - 0.18429444856233343f, - 0.18416578946051257f, - 0.18403712720306112f, - 0.18390846179218276f, - 0.183779793230083f, - 0.18365112151896618f, - 0.18352244666103654f, - 0.18339376865849982f, - 0.18326508751355997f, - 0.18313640322842278f, - 0.18300771580529238f, - 0.18287902524637464f, - 0.18275033155387377f, - 0.18262163472999535f, - 0.18249293477694498f, - 0.18236423169692706f, - 0.18223552549214772f, - 0.18210681616481145f, - 0.1819781037171245f, - 0.1818493881512915f, - 0.1817206694695188f, - 0.18159194767401104f, - 0.1814632227669748f, - 0.1813344947506148f, - 0.18120576362713767f, - 0.1810770293987483f, - 0.18094829206765295f, - 0.18081955163605795f, - 0.18069080810616833f, - 0.18056206148019097f, - 0.18043331176033103f, - 0.18030455894879546f, - 0.18017580304778957f, - 0.1800470440595204f, - 0.17991828198619333f, - 0.17978951683001554f, - 0.17966074859319253f, - 0.17953197727793113f, - 0.1794032028864382f, - 0.17927442542091948f, - 0.1791456448835823f, - 0.1790168612766325f, - 0.17888807460227754f, - 0.17875928486272333f, - 0.1786304920601775f, - 0.17850169619684647f, - 0.17837289727493666f, - 0.17824409529665586f, - 0.17811529026421022f, - 0.17798648217980761f, - 0.1778576710456543f, - 0.17772885686395828f, - 0.1776000396369259f, - 0.17747121936676521f, - 0.17734239605568272f, - 0.17721356970588661f, - 0.17708474031958343f, - 0.1769559078989815f, - 0.17682707244628745f, - 0.17669823396370973f, - 0.17656939245345507f, - 0.17644054791773203f, - 0.1763117003587474f, - 0.17618284977870943f, - 0.17605399617982637f, - 0.1759251395643052f, - 0.17579627993435473f, - 0.17566741729218205f, - 0.1755385516399961f, - 0.17540968298000403f, - 0.17528081131441486f, - 0.17515193664543593f, - 0.1750230589752763f, - 0.17489417830614343f, - 0.17476529464024604f, - 0.174636407979793f, - 0.17450751832699185f, - 0.17437862568405194f, - 0.17424973005318095f, - 0.17412083143658835f, - 0.17399192983648193f, - 0.1738630252550712f, - 0.1737341176945641f, - 0.17360520715717023f, - 0.17347629364509762f, - 0.17334737716055604f, - 0.17321845770575353f, - 0.17308953528289997f, - 0.17296060989420356f, - 0.17283168154187425f, - 0.17270275022812034f, - 0.17257381595515192f, - 0.17244487872517733f, - 0.17231593854040678f, - 0.17218699540304916f, - 0.17205804931531346f, - 0.17192910027941002f, - 0.17180014829754744f, - 0.17167119337193573f, - 0.17154223550478495f, - 0.17141327469830386f, - 0.17128431095470306f, - 0.17115534427619145f, - 0.17102637466497966f, - 0.17089740212327673f, - 0.17076842665329342f, - 0.1706394482572388f, - 0.1705104669373238f, - 0.17038148269575754f, - 0.17025249553475108f, - 0.17012350545651364f, - 0.1699945124632559f, - 0.16986551655718857f, - 0.16973651774052104f, - 0.1696075160154646f, - 0.16947851138422873f, - 0.1693495038490248f, - 0.16922049341206244f, - 0.16909148007555308f, - 0.16896246384170646f, - 0.1688334447127341f, - 0.16870442269084585f, - 0.16857539777825287f, - 0.16844636997716644f, - 0.16831733928979653f, - 0.16818830571835494f, - 0.16805926926505171f, - 0.16793022993209875f, - 0.1678011877217062f, - 0.16767214263608612f, - 0.1675430946774487f, - 0.1674140438480061f, - 0.16728499014996862f, - 0.16715593358554845f, - 0.16702687415695655f, - 0.16689781186640382f, - 0.16676874671610262f, - 0.16663967870826357f, - 0.16651060784509908f, - 0.16638153412881984f, - 0.16625245756163845f, - 0.16612337814576564f, - 0.16599429588341408f, - 0.16586521077679467f, - 0.1657361228281201f, - 0.16560703203960145f, - 0.16547793841345101f, - 0.16534884195188124f, - 0.1652197426571033f, - 0.16509064053133016f, - 0.16496153557677304f, - 0.164832427795645f, - 0.16470331719015743f, - 0.16457420376252344f, - 0.16444508751495449f, - 0.16431596844966384f, - 0.164186846568863f, - 0.16405772187476536f, - 0.16392859436958254f, - 0.16379946405552756f, - 0.16367033093481342f, - 0.16354119500965195f, - 0.16341205628225675f, - 0.16328291475483964f, - 0.16315377042961435f, - 0.16302462330879283f, - 0.1628954733945889f, - 0.16276632068921457f, - 0.16263716519488378f, - 0.16250800691380865f, - 0.16237884584820314f, - 0.16224968200027956f, - 0.1621205153722515f, - 0.16199134596633266f, - 0.16186217378473589f, - 0.161732998829674f, - 0.16160382110336138f, - 0.16147464060801048f, - 0.16134545734583566f, - 0.1612162713190496f, - 0.1610870825298667f, - 0.16095789098049973f, - 0.1608286966731632f, - 0.16069949961007002f, - 0.16057029979343473f, - 0.16044109722547029f, - 0.16031189190839146f, - 0.1601826838444112f, - 0.16005347303574438f, - 0.15992425948460412f, - 0.15979504319320528f, - 0.15966582416376113f, - 0.15953660239848666f, - 0.15940737789959517f, - 0.15927815066930176f, - 0.15914892070981984f, - 0.15901968802336414f, - 0.15889045261214949f, - 0.15876121447838942f, - 0.1586319736242993f, - 0.1585027300520927f, - 0.15837348376398508f, - 0.15824423476219018f, - 0.1581149830489235f, - 0.15798572862639884f, - 0.15785647149683188f, - 0.15772721166243647f, - 0.15759794912542788f, - 0.1574686838880215f, - 0.15733941595243128f, - 0.15721014532087313f, - 0.15708087199556114f, - 0.15695159597871133f, - 0.15682231727253787f, - 0.15669303587925681f, - 0.15656375180108248f, - 0.15643446504023098f, - 0.15630517559891677f, - 0.15617588347935601f, - 0.15604658868376328f, - 0.15591729121435483f, - 0.15578799107334526f, - 0.155658688262951f, - 0.1555293827853872f, - 0.15540007464286898f, - 0.1552707638376129f, - 0.1551414503718338f, - 0.15501213424774832f, - 0.15488281546757132f, - 0.15475349403351957f, - 0.1546241699478081f, - 0.15449484321265322f, - 0.1543655138302714f, - 0.15423618180287774f, - 0.1541068471326892f, - 0.15397750982192107f, - 0.15384816987279032f, - 0.15371882728751232f, - 0.15358948206830417f, - 0.1534601342173813f, - 0.15333078373696093f, - 0.1532014306292586f, - 0.15307207489649152f, - 0.1529427165408754f, - 0.15281335556462713f, - 0.15268399196996374f, - 0.15255462575910098f, - 0.15242525693425632f, - 0.15229588549764567f, - 0.15216651145148657f, - 0.15203713479799497f, - 0.1519077555393886f, - 0.1517783736778834f, - 0.15164898921569725f, - 0.15151960215504617f, - 0.15139021249814769f, - 0.1512608202472192f, - 0.15113142540447702f, - 0.15100202797213913f, - 0.15087262795242182f, - 0.15074322534754325f, - 0.1506138201597198f, - 0.15048441239116966f, - 0.1503550020441098f, - 0.15022558912075712f, - 0.15009617362333f, - 0.14996675555404507f, - 0.14983733491512075f, - 0.1497079117087737f, - 0.1495784859372225f, - 0.1494490576026839f, - 0.14931962670737653f, - 0.14919019325351723f, - 0.14906075724332474f, - 0.148931318679016f, - 0.14880187756280977f, - 0.14867243389692314f, - 0.14854298768357496f, - 0.14841353892498238f, - 0.14828408762336392f, - 0.1481546337809381f, - 0.14802517739992221f, - 0.14789571848253535f, - 0.14776625703099489f, - 0.14763679304751995f, - 0.147507326534328f, - 0.1473778574936383f, - 0.1472483859276684f, - 0.14711891183863762f, - 0.14698943522876362f, - 0.14685995610026578f, - 0.1467304744553618f, - 0.14660099029627083f, - 0.1464715036252119f, - 0.1463420144444029f, - 0.14621252275606345f, - 0.14608302856241148f, - 0.14595353186566676f, - 0.14582403266804722f, - 0.14569453097177273f, - 0.14556502677906138f, - 0.14543552009213306f, - 0.14530601091320594f, - 0.14517649924450005f, - 0.14504698508823358f, - 0.14491746844662667f, - 0.14478794932189767f, - 0.1446584277162667f, - 0.1445289036319522f, - 0.14439937707117442f, - 0.14426984803615234f, - 0.14414031652910494f, - 0.1440107825522526f, - 0.14388124610781397f, - 0.1437517071980095f, - 0.14362216582505793f, - 0.14349262199117935f, - 0.14336307569859388f, - 0.1432335269495204f, - 0.1431039757461796f, - 0.1429744220907904f, - 0.1428448659855735f, - 0.142715307432748f, - 0.1425857464345347f, - 0.1424561829931527f, - 0.14232661711082295f, - 0.14219704878976464f, - 0.1420674780321987f, - 0.14193790484034452f, - 0.14180832921642267f, - 0.14167875116265385f, - 0.14154917068125747f, - 0.14141958777445474f, - 0.1412900024444651f, - 0.1411604146935099f, - 0.14103082452380872f, - 0.14090123193758286f, - 0.14077163693705205f, - 0.14064203952443768f, - 0.14051243970195954f, - 0.1403828374718387f, - 0.14025323283629632f, - 0.14012362579755222f, - 0.1399940163578281f, - 0.1398644045193439f, - 0.13973479028432134f, - 0.13960517365498049f, - 0.1394755546335431f, - 0.13934593322222935f, - 0.1392163094232611f, - 0.1390866832388586f, - 0.13895705467124375f, - 0.13882742372263734f, - 0.1386977903952601f, - 0.1385681546913341f, - 0.13843851661307977f, - 0.1383088761627193f, - 0.13817923334247317f, - 0.13804958815456367f, - 0.1379199406012113f, - 0.13779029068463847f, - 0.13766063840706577f, - 0.13753098377071568f, - 0.1374013267778089f, - 0.13727166743056748f, - 0.1371420057312136f, - 0.13701234168196805f, - 0.13688267528505346f, - 0.1367530065426908f, - 0.13662333545710273f, - 0.1364936620305103f, - 0.1363639862651363f, - 0.13623430816320176f, - 0.1361046277269296f, - 0.13597494495854098f, - 0.13584525986025886f, - 0.13571557243430446f, - 0.13558588268290042f, - 0.13545619060826933f, - 0.13532649621263257f, - 0.13519679949821328f, - 0.13506710046723294f, - 0.13493739912191477f, - 0.13480769546448026f, - 0.13467798949715276f, - 0.13454828122215384f, - 0.13441857064170692f, - 0.13428885775803368f, - 0.13415914257335712f, - 0.13402942508990034f, - 0.13389970530988515f, - 0.1337699832355351f, - 0.13364025886907255f, - 0.1335105322127198f, - 0.1333808032687006f, - 0.13325107203923695f, - 0.1331213385265526f, - 0.13299160273286964f, - 0.13286186466041194f, - 0.1327321243114021f, - 0.1326023816880627f, - 0.13247263679261734f, - 0.13234288962728957f, - 0.1322131401943017f, - 0.1320833884958778f, - 0.13195363453424033f, - 0.1318238783116134f, - 0.13169411983021947f, - 0.13156435909228284f, - 0.13143459610002603f, - 0.13130483085567335f, - 0.1311750633614474f, - 0.13104529361957223f, - 0.13091552163227177f, - 0.13078574740176876f, - 0.13065597093028777f, - 0.13052619222005157f, - 0.13039641127328475f, - 0.13026662809221023f, - 0.13013684267905268f, - 0.13000705503603502f, - 0.12987726516538203f, - 0.12974747306931678f, - 0.12961767875006405f, - 0.129487882209847f, - 0.12935808345089006f, - 0.12922828247541773f, - 0.12909847928565327f, - 0.12896867388382166f, - 0.12883886627214625f, - 0.1287090564528521f, - 0.12857924442816263f, - 0.12844943020030294f, - 0.12831961377149656f, - 0.1281897951439687f, - 0.12805997431994287f, - 0.12793015130164442f, - 0.12780032609129696f, - 0.12767049869112587f, - 0.1275406691033553f, - 0.12741083733020936f, - 0.1272810033739136f, - 0.1271511672366918f, - 0.1270213289207695f, - 0.12689148842837064f, - 0.12676164576172083f, - 0.12663180092304405f, - 0.12650195391456598f, - 0.12637210473851068f, - 0.12624225339710352f, - 0.12611239989256987f, - 0.1259825442271339f, - 0.1258526864030215f, - 0.12572282642245686f, - 0.12559296428766603f, - 0.1254631000008732f, - 0.12533323356430454f, - 0.1252033649801843f, - 0.12507349425073871f, - 0.12494362137819212f, - 0.12481374636477077f, - 0.12468386921269917f, - 0.12455398992420315f, - 0.12442410850150859f, - 0.12429422494684012f, - 0.12416433926242412f, - 0.12403445145048526f, - 0.12390456151325004f, - 0.12377466945294319f, - 0.12364477527179125f, - 0.12351487897201906f, - 0.12338498055585323f, - 0.12325508002551865f, - 0.12312517738324155f, - 0.12299527263124826f, - 0.12286536577176377f, - 0.12273545680701485f, - 0.1226055457392266f, - 0.12247563257062591f, - 0.12234571730343788f, - 0.12221579993988949f, - 0.12208588048220638f, - 0.12195595893261424f, - 0.12182603529334014f, - 0.12169610956660941f, - 0.12156618175464914f, - 0.12143625185968476f, - 0.12130631988394346f, - 0.12117638582965069f, - 0.12104644969903373f, - 0.12091651149431812f, - 0.12078657121773118f, - 0.12065662887149854f, - 0.1205266844578476f, - 0.12039673797900405f, - 0.12026678943719535f, - 0.12013683883464728f, - 0.12000688617358692f, - 0.11987693145624143f, - 0.11974697468483667f, - 0.11961701586160028f, - 0.11948705498875821f, - 0.11935709206853817f, - 0.11922712710316616f, - 0.11909716009486998f, - 0.11896719104587569f, - 0.11883721995841118f, - 0.11870724683470256f, - 0.11857727167697776f, - 0.11844729448746302f, - 0.1183173152683859f, - 0.11818733402197397f, - 0.11805735075045357f, - 0.1179273654560528f, - 0.11779737814099804f, - 0.11766738880751747f, - 0.11753739745783755f, - 0.1174074040941865f, - 0.11727740871879087f, - 0.11714741133387897f, - 0.11701741194167738f, - 0.11688741054441448f, - 0.11675740714431695f, - 0.11662740174361325f, - 0.11649739434453006f, - 0.11636738494929594f, - 0.11623737356013768f, - 0.11610736017928387f, - 0.11597734480896181f, - 0.11584732745139883f, - 0.11571730810882364f, - 0.1155872867834632f, - 0.11545726347754626f, - 0.11532723819329986f, - 0.1151972109329524f, - 0.11506718169873228f, - 0.11493715049286667f, - 0.11480711731758446f, - 0.11467708217511288f, - 0.11454704506768092f, - 0.11441700599751584f, - 0.11428696496684672f, - 0.11415692197790088f, - 0.11402687703290748f, - 0.1138968301340939f, - 0.11376678128368935f, - 0.11363673048392128f, - 0.11350667773701854f, - 0.11337662304521f, - 0.1132465664107232f, - 0.11311650783578753f, - 0.1129864473226306f, - 0.11285638487348187f, - 0.11272632049056903f, - 0.1125962541761216f, - 0.11246618593236732f, - 0.11233611576153577f, - 0.11220604366585478f, - 0.11207596964755355f, - 0.1119458937088613f, - 0.11181581585200596f, - 0.11168573607921727f, - 0.11155565439272322f, - 0.11142557079475361f, - 0.11129548528753652f, - 0.11116539787330178f, - 0.11103530855427755f, - 0.11090521733269375f, - 0.11077512421077901f, - 0.110645029190762f, - 0.11051493227487273f, - 0.11038483346533953f, - 0.11025473276439247f, - 0.11012463017425991f, - 0.10999452569717201f, - 0.10986441933535718f, - 0.10973431109104564f, - 0.1096042009664659f, - 0.10947408896384822f, - 0.10934397508542117f, - 0.10921385933341507f, - 0.10908374171005857f, - 0.10895362221758162f, - 0.10882350085821423f, - 0.10869337763418511f, - 0.10856325254772477f, - 0.108433125601062f, - 0.10830299679642734f, - 0.10817286613604965f, - 0.10804273362215958f, - 0.107912599256986f, - 0.10778246304275962f, - 0.10765232498170943f, - 0.10752218507606617f, - 0.10739204332805888f, - 0.10726189973991794f, - 0.10713175431387377f, - 0.10700160705215549f, - 0.10687145795699401f, - 0.10674130703061854f, - 0.10661115427526005f, - 0.1064809996931478f, - 0.10635084328651281f, - 0.10622068505758443f, - 0.10609052500859374f, - 0.10596036314177013f, - 0.10583019945934431f, - 0.10570003396354707f, - 0.10556986665660831f, - 0.10543969754075795f, - 0.1053095266182273f, - 0.10517935389124593f, - 0.10504917936204518f, - 0.10491900303285467f, - 0.10478882490590585f, - 0.10465864498342838f, - 0.10452846326765373f, - 0.10439827976081212f, - 0.10426809446513374f, - 0.10413790738284973f, - 0.10400771851619126f, - 0.10387752786738817f, - 0.10374733543867216f, - 0.10361714123227315f, - 0.10348694525042286f, - 0.10335674749535127f, - 0.10322654796929018f, - 0.10309634667446964f, - 0.1029661436131215f, - 0.10283593878747585f, - 0.10270573219976417f, - 0.10257552385221796f, - 0.10244531374706743f, - 0.10231510188654457f, - 0.10218488827287962f, - 0.10205467290830467f, - 0.10192445579505002f, - 0.10179423693534781f, - 0.10166401633142841f, - 0.10153379398552398f, - 0.101403569899865f, - 0.10127334407668367f, - 0.10114311651821052f, - 0.10101288722667738f, - 0.10088265620431616f, - 0.10075242345335744f, - 0.1006221889760336f, - 0.1004919527745753f, - 0.10036171485121498f, - 0.10023147520818333f, - 0.1001012338477129f, - 0.0999709907720344f, - 0.09984074598338044f, - 0.09971049948398183f, - 0.0995802512760712f, - 0.09945000136187941f, - 0.09931974974363916f, - 0.09918949642358184f, - 0.09905924140393883f, - 0.09892898468694294f, - 0.09879872627482518f, - 0.09866846616981839f, - 0.09853820437415363f, - 0.09840794089006381f, - 0.09827767571978006f, - 0.09814740886553533f, - 0.09801714032956083f, - 0.09788687011408911f, - 0.09775659822135276f, - 0.09762632465358305f, - 0.0974960494130131f, - 0.09736577250187424f, - 0.09723549392239961f, - 0.09710521367682062f, - 0.09697493176737047f, - 0.09684464819628062f, - 0.09671436296578433f, - 0.09658407607811312f, - 0.0964537875355003f, - 0.09632349734017745f, - 0.09619320549437749f, - 0.09606291200033339f, - 0.09593261686027679f, - 0.09580232007644117f, - 0.09567202165105823f, - 0.0955417215863615f, - 0.09541141988458272f, - 0.0952811165479555f, - 0.09515081157871164f, - 0.09502050497908476f, - 0.09489019675130676f, - 0.09475988689761089f, - 0.09462957542023039f, - 0.09449926232139724f, - 0.0943689476033452f, - 0.0942386312683063f, - 0.09410831331851435f, - 0.09397799375620187f, - 0.09384767258360142f, - 0.09371734980294691f, - 0.09358702541647047f, - 0.09345669942640608f, - 0.09332637183498596f, - 0.0931960426444441f, - 0.09306571185701279f, - 0.0929353794749261f, - 0.09280504550041634f, - 0.09267470993571764f, - 0.09254437278306238f, - 0.09241403404468473f, - 0.09228369372281715f, - 0.09215335181969384f, - 0.0920230083375473f, - 0.09189266327861183f, - 0.09176231664511994f, - 0.09163196843930554f, - 0.09150161866340258f, - 0.09137126731964365f, - 0.09124091441026318f, - 0.09111055993749385f, - 0.09098020390357014f, - 0.09084984631072476f, - 0.09071948716119227f, - 0.09058912645720542f, - 0.0904587642009988f, - 0.09032840039480526f, - 0.09019803504085942f, - 0.09006766814139418f, - 0.08993729969864378f, - 0.08980692971484248f, - 0.08967655819222327f, - 0.0895461851330209f, - 0.0894158105394684f, - 0.08928543441380057f, - 0.08915505675825053f, - 0.0890246775750531f, - 0.08889429686644143f, - 0.08876391463465044f, - 0.08863353088191332f, - 0.08850314561046503f, - 0.08837275882253881f, - 0.08824237052036969f, - 0.08811198070619095f, - 0.08798158938223764f, - 0.08785119655074315f, - 0.08772080221394257f, - 0.08759040637406976f, - 0.08746000903335854f, - 0.08732961019404414f, - 0.08719920985836004f, - 0.08706880802854146f, - 0.08693840470682193f, - 0.08680799989543633f, - 0.08667759359661954f, - 0.08654718581260518f, - 0.0864167765456286f, - 0.08628636579792345f, - 0.08615595357172519f, - 0.08602553986926749f, - 0.08589512469278585f, - 0.08576470804451401f, - 0.0856342899266875f, - 0.08550387034154015f, - 0.08537344929130707f, - 0.08524302677822344f, - 0.08511260280452314f, - 0.08498217737244182f, - 0.08485175048421341f, - 0.08472132214207362f, - 0.08459089234825642f, - 0.08446046110499758f, - 0.0843300284145311f, - 0.08419959427909283f, - 0.0840691587009168f, - 0.0839387216822389f, - 0.08380828322529324f, - 0.08367784333231529f, - 0.08354740200554053f, - 0.08341695924720317f, - 0.0832865150595392f, - 0.08315606944478285f, - 0.08302562240517015f, - 0.08289517394293541f, - 0.0827647240603147f, - 0.08263427275954235f, - 0.08250382004285452f, - 0.08237336591248601f, - 0.08224291037067169f, - 0.08211245341964776f, - 0.08198199506164869f, - 0.08185153529891072f, - 0.08172107413366836f, - 0.08159061156815792f, - 0.08146014760461395f, - 0.0813296822452728f, - 0.08119921549236907f, - 0.08106874734813917f, - 0.08093827781481774f, - 0.08080780689464122f, - 0.08067733458984433f, - 0.08054686090266311f, - 0.08041638583533361f, - 0.08028590939009064f, - 0.08015543156917075f, - 0.08002495237480874f, - 0.07989447180924124f, - 0.0797639898747031f, - 0.07963350657343099f, - 0.07950302190765982f, - 0.07937253587962628f, - 0.07924204849156535f, - 0.07911155974571377f, - 0.07898106964430654f, - 0.07885057818958001f, - 0.07872008538377058f, - 0.07858959122911331f, - 0.07845909572784507f, - 0.07832859888220096f, - 0.07819810069441793f, - 0.07806760116673113f, - 0.07793710030137752f, - 0.0778065981005923f, - 0.07767609456661248f, - 0.07754558970167333f, - 0.07741508350801145f, - 0.07728457598786348f, - 0.07715406714346516f, - 0.07702355697705232f, - 0.07689304549086207f, - 0.07676253268712982f, - 0.07663201856809275f, - 0.0765015031359863f, - 0.07637098639304772f, - 0.07624046834151291f, - 0.07610994898361782f, - 0.07597942832159978f, - 0.07584890635769431f, - 0.07571838309413832f, - 0.07558785853316873f, - 0.07545733267702116f, - 0.07532680552793304f, - 0.07519627708814f, - 0.07506574735987952f, - 0.07493521634538729f, - 0.07480468404690081f, - 0.07467415046665585f, - 0.07454361560688992f, - 0.07441307946983884f, - 0.07428254205773975f, - 0.07415200337282982f, - 0.07402146341734489f, - 0.07389092219352263f, - 0.07376037970359894f, - 0.07362983594981151f, - 0.07349929093439629f, - 0.07336874465959102f, - 0.07323819712763169f, - 0.07310764834075609f, - 0.07297709830120022f, - 0.07284654701120195f, - 0.07271599447299733f, - 0.07258544068882379f, - 0.07245488566091877f, - 0.07232432939151842f, - 0.07219377188286066f, - 0.0720632131371817f, - 0.07193265315671947f, - 0.07180209194371023f, - 0.07167152950039199f, - 0.07154096582900102f, - 0.07141040093177535f, - 0.07127983481095132f, - 0.07114926746876703f, - 0.07101869890745881f, - 0.0708881291292648f, - 0.07075755813642187f, - 0.07062698593116684f, - 0.07049641251573795f, - 0.07036583789237161f, - 0.0702352620633061f, - 0.07010468503077791f, - 0.06997410679702533f, - 0.06984352736428488f, - 0.0697129467347949f, - 0.06958236491079198f, - 0.06945178189451402f, - 0.069321197688199f, - 0.06919061229408353f, - 0.06906002571440606f, - 0.06892943795140326f, - 0.06879884900731362f, - 0.06866825888437382f, - 0.06853766758482242f, - 0.06840707511089615f, - 0.06827648146483357f, - 0.06814588664887149f, - 0.06801529066524804f, - 0.06788469351620142f, - 0.06775409520396847f, - 0.06762349573078784f, - 0.06749289509889644f, - 0.06736229331053295f, - 0.06723169036793433f, - 0.0671010862733393f, - 0.06697048102898484f, - 0.06683987463710973f, - 0.06670926709995098f, - 0.0665786584197474f, - 0.06644804859873606f, - 0.06631743763915535f, - 0.0661868255432437f, - 0.06605621231323824f, - 0.06592559795137787f, - 0.06579498245989975f, - 0.06566436584104282f, - 0.06553374809704472f, - 0.06540312923014312f, - 0.06527250924257699f, - 0.06514188813658363f, - 0.06501126591440204f, - 0.06488064257826955f, - 0.06475001813042519f, - 0.06461939257310634f, - 0.0644887659085521f, - 0.06435813813899983f, - 0.06422750926668869f, - 0.0640968792938561f, - 0.06396624822274123f, - 0.06383561605558154f, - 0.06370498279461626f, - 0.06357434844208286f, - 0.06344371300022063f, - 0.06331307647126706f, - 0.06318243885746104f, - 0.06305180016104144f, - 0.06292116038424583f, - 0.06279051952931358f, - 0.06265987759848231f, - 0.0625292345939914f, - 0.0623985905180785f, - 0.06226794537298306f, - 0.06213729916094275f, - 0.06200665188419706f, - 0.06187600354498369f, - 0.06174535414554216f, - 0.06161470368811022f, - 0.06148405217492699f, - 0.061353399608231565f, - 0.06122274599026178f, - 0.06109209132325722f, - 0.060961435609455744f, - 0.06083077885109697f, - 0.060700121050418804f, - 0.0605694622096609f, - 0.060438802331061185f, - 0.060308141416859355f, - 0.06017747946929338f, - 0.06004681649060299f, - 0.05991615248302618f, - 0.05978548744880273f, - 0.059654821390170656f, - 0.05952415430936978f, - 0.0593934862086386f, - 0.05926281709021564f, - 0.05913214695634076f, - 0.05900147580925208f, - 0.05887080365118949f, - 0.05874013048439114f, - 0.058609456311096965f, - 0.05847878113354515f, - 0.058348104953975216f, - 0.05821742777462671f, - 0.05808674959773787f, - 0.057956070425548706f, - 0.057825390260297496f, - 0.05769470910422428f, - 0.057564026959567374f, - 0.05743334382856686f, - 0.05730265971346107f, - 0.05717197461649013f, - 0.05704128853989241f, - 0.05691060148590762f, - 0.056779913456775494f, - 0.05664922445473444f, - 0.05651853448202468f, - 0.056387843540884657f, - 0.05625715163355461f, - 0.05612645876227303f, - 0.05599576492928018f, - 0.05586507013681458f, - 0.05573437438711654f, - 0.055603677682424614f, - 0.055472980024979135f, - 0.055342281417018684f, - 0.0552115818607832f, - 0.05508088135851261f, - 0.05495017991244556f, - 0.05481947752482246f, - 0.054688774197881984f, - 0.054558069933864584f, - 0.05442736473500895f, - 0.054296658603555564f, - 0.054165951541743605f, - 0.05403524355181226f, - 0.053904534636002054f, - 0.05377382479655177f, - 0.05364311403570196f, - 0.05351240235569145f, - 0.05338168975876082f, - 0.05325097624714892f, - 0.053120261823096364f, - 0.052989546488842035f, - 0.05285883024662659f, - 0.05272811309868892f, - 0.05259739504726972f, - 0.05246667609460792f, - 0.05233595624294425f, - 0.05220523549451766f, - 0.052074513851568464f, - 0.05194379131633699f, - 0.051813067891062235f, - 0.051682343577985006f, - 0.05155161837934434f, - 0.05142089229738107f, - 0.051290165334334246f, - 0.05115943749244475f, - 0.05102870877395166f, - 0.050897979181095884f, - 0.050767248716116535f, - 0.0506365173812541f, - 0.05050578517874906f, - 0.05037505211084059f, - 0.05024431817976966f, - 0.05011358338777547f, - 0.049982847737099004f, - 0.049852111229979505f, - 0.04972137386865799f, - 0.04959063565537373f, - 0.04945989659236776f, - 0.049329156681879385f, - 0.04919841592614968f, - 0.049067674327417966f, - 0.04893693188792491f, - 0.04880618860991119f, - 0.048675444495616615f, - 0.048544699547281f, - 0.04841395376714552f, - 0.04828320715744958f, - 0.048152459720434374f, - 0.04802171145833933f, - 0.047890962373405684f, - 0.047760212467873334f, - 0.0476294617439822f, - 0.04749871020397355f, - 0.04736795785008689f, - 0.04723720468456308f, - 0.04710645070964296f, - 0.04697569592756609f, - 0.046844940340573814f, - 0.04671418395090569f, - 0.04658342676080309f, - 0.04645266877250561f, - 0.04632190998825465f, - 0.04619115041028983f, - 0.04606039004085257f, - 0.04592962888218253f, - 0.0457988669365207f, - 0.04566810420610811f, - 0.04553734069318445f, - 0.0454065763999912f, - 0.04527581132876808f, - 0.045145045481756615f, - 0.04501427886119655f, - 0.04488351146932942f, - 0.044752743308395f, - 0.04462197438063486f, - 0.0444912046882888f, - 0.044360434233598416f, - 0.044229663018803524f, - 0.04409889104614531f, - 0.04396811831786495f, - 0.04383734483620232f, - 0.04370657060339908f, - 0.04357579562169511f, - 0.043445019893332104f, - 0.04331424342054997f, - 0.04318346620559042f, - 0.0430526882506934f, - 0.04292190955810064f, - 0.04279113013005212f, - 0.04266034996878958f, - 0.04252956907655348f, - 0.04239878745558425f, - 0.0422680051081237f, - 0.042137222036411855f, - 0.04200643824269054f, - 0.04187565372919981f, - 0.04174486849818151f, - 0.04161408255187572f, - 0.041483295892524315f, - 0.041352508522367395f, - 0.04122172044364686f, - 0.041090931658602836f, - 0.040960142169476806f, - 0.040829351978510245f, - 0.04069856108794332f, - 0.040567769500017996f, - 0.04043697721697445f, - 0.04030618424105468f, - 0.04017539057449888f, - 0.04004459621954906f, - 0.03991380117844546f, - 0.0397830054534301f, - 0.03965220904674325f, - 0.03952141196062651f, - 0.0393906141973215f, - 0.039259815759068506f, - 0.039129016648109624f, - 0.03899821686668517f, - 0.03886741641703725f, - 0.0387366153014062f, - 0.03860581352203416f, - 0.0384750110811615f, - 0.03834420798103035f, - 0.038213404223881114f, - 0.03808259981195597f, - 0.03795179474749532f, - 0.03782098903274092f, - 0.037690182669934534f, - 0.03755937566131661f, - 0.03742856800912937f, - 0.03729775971561373f, - 0.03716695078301061f, - 0.037036141213562274f, - 0.03690533100950922f, - 0.03677452017309374f, - 0.03664370870655634f, - 0.036512896612139335f, - 0.03638208389208327f, - 0.03625127054863047f, - 0.03612045658402149f, - 0.0359896420004987f, - 0.035858826800302675f, - 0.035728010985675775f, - 0.03559719455885862f, - 0.0354663775220936f, - 0.03533555987762133f, - 0.03520474162768424f, - 0.03507392277452297f, - 0.03494310332037995f, - 0.034812283267495844f, - 0.03468146261811268f, - 0.03455064137447246f, - 0.0344198195388159f, - 0.03428899711338546f, - 0.034158174100421886f, - 0.034027350502167666f, - 0.03389652632086355f, - 0.033765701558752054f, - 0.033634876218073935f, - 0.033504050301071744f, - 0.033373223809986266f, - 0.03324239674705961f, - 0.03311156911453391f, - 0.032980740914649975f, - 0.0328499121496504f, - 0.032719082821776005f, - 0.03258825293326941f, - 0.03245742248637147f, - 0.0323265914833248f, - 0.032195759926370277f, - 0.03206492781775055f, - 0.03193409515970651f, - 0.031803261954480806f, - 0.031672428204314367f, - 0.03154159391144987f, - 0.031410759078128236f, - 0.03127992370659218f, - 0.031149087799082632f, - 0.03101825135784233f, - 0.030887414385112666f, - 0.03075657688313506f, - 0.03062573885415226f, - 0.030494900300405255f, - 0.030364061224136818f, - 0.030233221627587948f, - 0.03010238151300144f, - 0.029971540882618313f, - 0.02984069973868093f, - 0.02970985808343166f, - 0.029579015919111558f, - 0.029448173247963453f, - 0.02931733007222841f, - 0.02918648639414928f, - 0.029055642215967147f, - 0.028924797539924878f, - 0.028793952368263574f, - 0.02866310670322612f, - 0.028532260547053632f, - 0.028401413901988568f, - 0.02827056677027339f, - 0.02813971915414925f, - 0.028008871055859065f, - 0.027878022477644f, - 0.02774717342174699f, - 0.02761632389040922f, - 0.027485473885873645f, - 0.027354623410381456f, - 0.02722377246617563f, - 0.02709292105549737f, - 0.026962069180589673f, - 0.026831216843693762f, - 0.0267003640470522f, - 0.026569510792907557f, - 0.02643865708350108f, - 0.026307802921075797f, - 0.02617694830787298f, - 0.026046093246135667f, - 0.025915237738105137f, - 0.025784381786024456f, - 0.02565352539213536f, - 0.02552266855867959f, - 0.025391811287900235f, - 0.02526095358203861f, - 0.025130095443337813f, - 0.024999236874039175f, - 0.024868377876385815f, - 0.02473751845261907f, - 0.024606658604982075f, - 0.02447579833571619f, - 0.024344937647064555f, - 0.02421407654126855f, - 0.024083215020571324f, - 0.023952353087214273f, - 0.023821490743440567f, - 0.02369062799149161f, - 0.023559764833610143f, - 0.02342890127203891f, - 0.023298037309019345f, - 0.023167172946794646f, - 0.023036308187606255f, - 0.02290544303369739f, - 0.022774577487309502f, - 0.022643711550685824f, - 0.022512845226067824f, - 0.022381978515698748f, - 0.022251111421820072f, - 0.022120243946674615f, - 0.021989376092505196f, - 0.021858507861553314f, - 0.021727639256062248f, - 0.021596770278273513f, - 0.021465900930430395f, - 0.02133503121477442f, - 0.021204161133548893f, - 0.021073290688995352f, - 0.02094241988335711f, - 0.02081154871887572f, - 0.020680677197794504f, - 0.020549805322355032f, - 0.02041893309480064f, - 0.0202880605173729f, - 0.02015718759231517f, - 0.02002631432186903f, - 0.019895440708277853f, - 0.019764566753783228f, - 0.019633692460628533f, - 0.019502817831055383f, - 0.01937194286730716f, - 0.019241067571625928f, - 0.019110191946253758f, - 0.018979315993433613f, - 0.01884843971540846f, - 0.01871756311441994f, - 0.018586686192711473f, - 0.01845580895252472f, - 0.01832493139610311f, - 0.018194053525688307f, - 0.018063175343523755f, - 0.01793229685185113f, - 0.017801418052913888f, - 0.017670538948953714f, - 0.01753965954221407f, - 0.017408779834936657f, - 0.017277899829364503f, - 0.01714701952774065f, - 0.0170161389323068f, - 0.016885258045306457f, - 0.01675437686898133f, - 0.01662349540557493f, - 0.01649261365732898f, - 0.016361731626486995f, - 0.016230849315290716f, - 0.016099966725983662f, - 0.015969083860807587f, - 0.015838200722006014f, - 0.01570731731182071f, - 0.015576433632494764f, - 0.015445549686271282f, - 0.015314665475392035f, - 0.015183781002100575f, - 0.015052896268638687f, - 0.014922011277249932f, - 0.0147911260301761f, - 0.014660240529660765f, - 0.014529354777945723f, - 0.014398468777274558f, - 0.014267582529889076f, - 0.014136696038032866f, - 0.014005809303948189f, - 0.013874922329877307f, - 0.013744035118063826f, - 0.013613147670749571f, - 0.013482259990178153f, - 0.01335137207859141f, - 0.013220483938232955f, - 0.013089595571344636f, - 0.012958706980170077f, - 0.012827818166951131f, - 0.012696929133931431f, - 0.012566039883352836f, - 0.012435150417458542f, - 0.012304260738491751f, - 0.012173370848694331f, - 0.012042480750309933f, - 0.011911590445580439f, - 0.011780699936749503f, - 0.011649809226059014f, - 0.011518918315752634f, - 0.011388027208072258f, - 0.011257135905261555f, - 0.011126244409562426f, - 0.010995352723218103f, - 0.010864460848471829f, - 0.010733568787565506f, - 0.010602676542742828f, - 0.010471784116245709f, - 0.01034089151031784f, - 0.010209998727201144f, - 0.010079105769139325f, - 0.009948212638374306f, - 0.009817319337149796f, - 0.009686425867707725f, - 0.00955553223229181f, - 0.009424638433143987f, - 0.009293744472507531f, - 0.009162850352625717f, - 0.009031956075740494f, - 0.00890106164409559f, - 0.008770167059933397f, - 0.008639272325496317f, - 0.008508377443028084f, - 0.008377482414770659f, - 0.00824658724296778f, - 0.008115691929861411f, - 0.007984796477695299f, - 0.007853900888711412f, - 0.007723005165153498f, - 0.007592109309263535f, - 0.007461213323285272f, - 0.007330317209460692f, - 0.007199420970033551f, - 0.007068524607245831f, - 0.006937628123341297f, - 0.006806731520561935f, - 0.006675834801151511f, - 0.006544937967352018f, - 0.006414041021407225f, - 0.006283143965559127f, - 0.006152246802051055f, - 0.0060213495331263404f, - 0.005890452161026984f, - 0.0057595546879967655f, - 0.005628657116277689f, - 0.005497759448113538f, - 0.00536686168574632f, - 0.005235963831419821f, - 0.005105065887376052f, - 0.004974167855858802f, - 0.004843269739110086f, - 0.004712371539373252f, - 0.004581473258891648f, - 0.004450574899907293f, - 0.004319676464663985f, - 0.0041887779554037425f, - 0.004057879374370366f, - 0.003926980723805878f, - 0.0037960820059540815f, - 0.0036651832230570006f, - 0.003534284377358439f, - 0.003403385471100426f, - 0.0032724865065267665f, - 0.0031415874858794902f, - 0.0030106884114024057f, - 0.002879789285337544f, - 0.0027488901099287154f, - 0.002617990887418397f, - 0.0024870916200490684f, - 0.002356192310064541f, - 0.0022252929597068507f, - 0.0020943935712198106f, - 0.001963494146845458f, - 0.0018325946888276086f, - 0.0017016951994082998f, - 0.0015707956808309034f, - 0.0014398961353387918f, - 0.0013089965651740046f, - 0.001178096972580359f, - 0.001047197359799896f, - 0.0009162977290764331f, - 0.0007853980826520122f, - 0.0006544984227704515f, - 0.0005235987516737929f, - 0.0003926990716058553f, - 0.0002617993848086811f, - 0.00013089969352608925f, - 1.2246467991473532e-16f, - -0.00013089969352584433f, - -0.00026179938480888024f, - -0.0003926990716051663f, - -0.000523598751673548f, - -0.0006544984227702064f, - -0.0007853980826522113f, - -0.0009162977290757441f, - -0.001047197359799651f, - -0.001178096972580114f, - -0.0013089965651742036f, - -0.0014398961353381027f, - -0.0015707956808306586f, - -0.0017016951994080548f, - -0.0018325946888273635f, - -0.0019634941468452136f, - -0.0020943935712191214f, - -0.0022252929597066057f, - -0.002356192310064296f, - -0.002487091620048824f, - -0.0026179908874177085f, - -0.0027488901099284703f, - -0.002879789285337299f, - -0.0030106884114021607f, - -0.003141587485879245f, - -0.0032724865065265215f, - -0.003403385471100181f, - -0.003534284377358194f, - -0.0036651832230571997f, - -0.0037960820059533924f, - -0.0039269807238056335f, - -0.004057879374370121f, - -0.004188777955403942f, - -0.004319676464663295f, - -0.004450574899907049f, - -0.004581473258891403f, - -0.004712371539373451f, - -0.004843269739110285f, - -0.004974167855858113f, - -0.005105065887375807f, - -0.005235963831419576f, - -0.005366861685746519f, - -0.005497759448112849f, - -0.005628657116277444f, - -0.00575955468799652f, - -0.005890452161027183f, - -0.006021349533125651f, - -0.0061522468020508096f, - -0.006283143965558882f, - -0.006414041021406979f, - -0.006544937967352216f, - -0.006675834801150822f, - -0.00680673152056169f, - -0.006937628123341052f, - -0.007068524607246031f, - -0.007199420970032861f, - -0.007330317209460447f, - -0.007461213323285028f, - -0.007592109309263733f, - -0.00772300516515281f, - -0.007853900888711166f, - -0.007984796477695054f, - -0.008115691929861167f, - -0.008246587242967535f, - -0.008377482414770415f, - -0.00850837744302784f, - -0.008639272325496073f, - -0.008770167059933153f, - -0.008901061644095345f, - -0.00903195607574025f, - -0.009162850352625472f, - -0.00929374447250773f, - -0.009424638433143742f, - -0.00955553223229112f, - -0.00968642586770748f, - -0.009817319337149551f, - -0.009948212638374506f, - -0.010079105769138636f, - -0.0102099987272009f, - -0.010340891510317595f, - -0.010471784116245907f, - -0.01060267654274214f, - -0.010733568787565262f, - -0.010864460848471584f, - -0.010995352723218303f, - -0.011126244409562624f, - -0.011257135905260866f, - -0.011388027208072013f, - -0.011518918315752389f, - -0.011649809226059214f, - -0.011780699936748814f, - -0.011911590445580194f, - -0.012042480750309689f, - -0.012173370848694529f, - -0.01230426073849106f, - -0.012435150417458298f, - -0.012566039883352592f, - -0.012696929133931186f, - -0.01282781816695133f, - -0.012958706980169389f, - -0.013089595571344391f, - -0.01322048393823271f, - -0.013351372078591163f, - -0.013482259990177464f, - -0.013613147670749327f, - -0.013744035118063581f, - -0.013874922329877063f, - -0.0140058093039475f, - -0.014136696038032621f, - -0.014267582529888832f, - -0.014398468777274314f, - -0.014529354777945922f, - -0.01466024052966052f, - -0.014791126030175855f, - -0.014922011277249686f, - -0.015052896268638885f, - -0.01518378100210033f, - -0.01531466547539179f, - -0.015445549686271038f, - -0.015576433632494963f, - -0.01570731731182002f, - -0.015838200722005327f, - -0.01596908386080734f, - -0.01609996672598342f, - -0.016230849315290917f, - -0.016361731626486308f, - -0.016492613657328736f, - -0.016623495405574683f, - -0.01675437686898153f, - -0.016885258045305766f, - -0.017016138932306555f, - -0.017147019527740403f, - -0.0172778998293647f, - -0.017408779834935967f, - -0.01753965954221338f, - -0.017670538948953467f, - -0.017801418052913645f, - -0.01793229685185133f, - -0.01806317534352307f, - -0.01819405352568806f, - -0.018324931396102865f, - -0.01845580895252492f, - -0.018586686192710786f, - -0.018717563114419692f, - -0.018848439715408213f, - -0.01897931599343381f, - -0.01911019194625351f, - -0.019241067571625237f, - -0.019371942867306913f, - -0.019502817831055137f, - -0.01963369246062829f, - -0.01976456675378298f, - -0.019895440708277607f, - -0.02002631432186879f, - -0.020157187592314926f, - -0.020288060517372655f, - -0.020418933094800393f, - -0.020549805322354786f, - -0.02068067719779426f, - -0.020811548718875916f, - -0.020942419883356423f, - -0.02107329068899511f, - -0.02120416113354865f, - -0.02133503121477462f, - -0.021465900930429705f, - -0.021596770278273267f, - -0.021727639256062005f, - -0.021858507861553512f, - -0.021989376092504506f, - -0.02212024394667437f, - -0.022251111421819826f, - -0.022381978515698505f, - -0.022512845226068025f, - -0.022643711550685137f, - -0.022774577487309256f, - -0.022905443033697143f, - -0.023036308187606453f, - -0.02316717294679396f, - -0.0232980373090191f, - -0.023428901272038668f, - -0.02355976483361034f, - -0.023690627991490923f, - -0.02382149074343988f, - -0.02395235308721403f, - -0.02408321502057108f, - -0.024214076541268746f, - -0.02434493764706387f, - -0.024475798335715945f, - -0.024606658604981832f, - -0.02473751845261927f, - -0.024868377876385125f, - -0.024999236874038933f, - -0.02513009544333757f, - -0.025260953582038365f, - -0.02539181128789999f, - -0.025522668558679344f, - -0.025653525392135113f, - -0.02578438178602421f, - -0.025915237738105334f, - -0.02604609324613542f, - -0.026176948307872733f, - -0.026307802921075554f, - -0.026438657083501276f, - -0.02656951079290731f, - -0.026700364047051953f, - -0.02683121684369352f, - -0.02696206918058943f, - -0.02709292105549757f, - -0.02722377246617494f, - -0.02735462341038121f, - -0.0274854738858734f, - -0.02761632389040942f, - -0.027747173421746305f, - -0.027878022477643753f, - -0.02800887105585882f, - -0.028139719154149447f, - -0.028270566770272704f, - -0.02840141390198832f, - -0.028532260547053385f, - -0.028663106703225874f, - -0.028793952368263775f, - -0.02892479753992419f, - -0.0290556422159669f, - -0.029186486394149034f, - -0.029317330072228608f, - -0.029448173247962763f, - -0.02957901591911131f, - -0.029709858083431417f, - -0.02984069973868113f, - -0.029971540882617623f, - -0.03010238151300075f, - -0.030233221627587705f, - -0.03036406122413657f, - -0.030494900300405012f, - -0.030625738854151572f, - -0.030756576883134813f, - -0.03088741438511242f, - -0.031018251357842083f, - -0.03114908779908239f, - -0.03127992370659193f, - -0.031410759078127994f, - -0.031541593911449624f, - -0.03167242820431457f, - -0.03180326195448056f, - -0.03193409515970626f, - -0.032064927817750305f, - -0.03219575992637048f, - -0.03232659148332411f, - -0.03245742248637122f, - -0.03258825293326917f, - -0.032719082821776206f, - -0.032849912149649704f, - -0.032980740914649725f, - -0.03311156911453366f, - -0.0332423967470598f, - -0.03337322380998646f, - -0.03350405030107106f, - -0.03363487621807369f, - -0.033765701558751804f, - -0.03389652632086375f, - -0.03402735050216698f, - -0.03415817410042164f, - -0.03428899711338522f, - -0.03441981953881609f, - -0.03455064137447177f, - -0.03468146261811243f, - -0.0348122832674956f, - -0.034943103320379705f, - -0.03507392277452317f, - -0.035204741627683556f, - -0.03533555987762109f, - -0.035466377522093355f, - -0.03559719455885882f, - -0.03572801098567509f, - -0.035858826800302425f, - -0.03598964200049846f, - -0.036120456584021694f, - -0.036251270548629776f, - -0.03638208389208302f, - -0.03651289661213909f, - -0.036643708706556095f, - -0.03677452017309349f, - -0.036905331009508976f, - -0.03703614121356203f, - -0.03716695078301037f, - -0.037297759715613485f, - -0.03742856800912912f, - -0.03755937566131636f, - -0.03769018266993429f, - -0.03782098903274112f, - -0.03795179474749508f, - -0.03808259981195528f, - -0.03821340422388087f, - -0.03834420798103011f, - -0.03847501108116169f, - -0.038605813522033475f, - -0.03873661530140596f, - -0.038867416417037004f, - -0.03899821686668537f, - -0.03912901664810894f, - -0.03925981575906826f, - -0.039390614197321254f, - -0.03952141196062671f, - -0.03965220904674345f, - -0.039783005453429415f, - -0.039913801178445216f, - -0.04004459621954881f, - -0.04017539057449908f, - -0.040306184241053984f, - -0.04043697721697421f, - -0.040567769500017746f, - -0.04069856108794352f, - -0.04082935197850955f, - -0.04096014216947656f, - -0.04109093165860259f, - -0.041221720443646616f, - -0.0413525085223676f, - -0.04148329589252363f, - -0.04161408255187548f, - -0.041744868498181265f, - -0.04187565372919957f, - -0.042006438242689854f, - -0.04213722203641161f, - -0.04226800510812345f, - -0.04239878745558401f, - -0.04252956907655279f, - -0.04266034996878934f, - -0.042791130130051876f, - -0.0429219095581004f, - -0.0430526882506936f, - -0.043183466205590174f, - -0.04331424342054972f, - -0.043445019893331854f, - -0.043575795621695314f, - -0.043706570603398394f, - -0.04383734483620208f, - -0.04396811831786471f, - -0.044098891046145505f, - -0.04422966301880284f, - -0.04436043423359772f, - -0.04449120468828856f, - -0.044621974380634616f, - -0.0447527433083952f, - -0.04488351146932873f, - -0.04501427886119631f, - -0.04514504548175637f, - -0.04527581132876828f, - -0.04540657639999051f, - -0.0455373406931842f, - -0.04566810420610787f, - -0.0457988669365209f, - -0.04592962888218273f, - -0.046060390040851884f, - -0.04619115041028959f, - -0.0463219099882544f, - -0.04645266877250581f, - -0.0465834267608024f, - -0.046714183950905444f, - -0.046844940340573564f, - -0.04697569592756629f, - -0.04710645070964227f, - -0.04723720468456283f, - -0.04736795785008665f, - -0.04749871020397331f, - -0.04762946174398196f, - -0.04776021246787265f, - -0.04789096237340544f, - -0.04802171145833909f, - -0.04815245972043413f, - -0.04828320715744934f, - -0.04841395376714528f, - -0.04854469954728076f, - -0.04867544449561637f, - -0.04880618860991095f, - -0.04893693188792467f, - -0.049067674327417724f, - -0.04919841592614944f, - -0.049329156681879587f, - -0.049459896592367075f, - -0.049590635655373486f, - -0.04972137386865775f, - -0.049852111229979706f, - -0.04998284773709832f, - -0.050113583387775225f, - -0.05024431817976942f, - -0.05037505211084079f, - -0.05050578517874837f, - -0.050636517381253854f, - -0.05076724871611629f, - -0.050897979181095634f, - -0.05102870877395186f, - -0.05115943749244406f, - -0.051290165334334004f, - -0.05142089229738082f, - -0.05155161837934454f, - -0.05168234357798432f, - -0.05181306789106199f, - -0.051943791316336745f, - -0.052074513851568666f, - -0.05220523549451697f, - -0.052335956242943564f, - -0.05246667609460768f, - -0.05259739504726947f, - -0.05272811309868912f, - -0.052858830246625896f, - -0.05298954648884179f, - -0.05312026182309612f, - -0.053250976247148675f, - -0.053381689758760134f, - -0.053512402355691206f, - -0.05364311403570172f, - -0.053773824796551524f, - -0.05390453463600181f, - -0.054035243551812016f, - -0.05416595154174336f, - -0.05429665860355532f, - -0.05442736473500915f, - -0.05455806993386434f, - -0.05468877419788174f, - -0.05481947752482222f, - -0.05495017991244575f, - -0.055080881358512364f, - -0.05521158186078295f, - -0.05534228141701844f, - -0.05547298002497889f, - -0.055603677682424815f, - -0.055734374387115856f, - -0.055865070136814333f, - -0.055995764929279934f, - -0.05612645876227323f, - -0.05625715163355392f, - -0.056387843540884414f, - -0.056518534482024436f, - -0.056649224454734644f, - -0.05677991345677481f, - -0.056910601485907375f, - -0.05704128853989217f, - -0.05717197461648989f, - -0.05730265971346127f, - -0.05743334382856617f, - -0.05756402695956713f, - -0.057694709104224036f, - -0.05782539026029769f, - -0.05795607042554802f, - -0.05808674959773762f, - -0.05821742777462647f, - -0.05834810495397542f, - -0.05847878113354446f, - -0.05860945631109628f, - -0.05874013048439089f, - -0.05887080365118924f, - -0.05900147580925183f, - -0.05913214695634007f, - -0.0592628170902154f, - -0.05939348620863836f, - -0.05952415430936954f, - -0.059654821390170414f, - -0.059785487448802486f, - -0.05991615248302594f, - -0.06004681649060275f, - -0.060177479469293575f, - -0.06030814141685911f, - -0.060438802331060935f, - -0.060569462209660654f, - -0.060700121050419005f, - -0.060830778851096286f, - -0.060961435609455494f, - -0.06109209132325698f, - -0.06122274599026198f, - -0.06135339960823088f, - -0.06148405217492674f, - -0.06161470368810998f, - -0.061745354145541914f, - -0.06187600354498388f, - -0.062006651884196365f, - -0.06213729916094251f, - -0.062267945372982816f, - -0.0623985905180787f, - -0.0625292345939907f, - -0.06265987759848206f, - -0.06279051952931335f, - -0.06292116038424603f, - -0.06305180016104076f, - -0.06318243885746079f, - -0.06331307647126681f, - -0.06344371300022038f, - -0.06357434844208305f, - -0.06370498279461558f, - -0.0638356160555813f, - -0.06396624822274098f, - -0.0640968792938563f, - -0.06422750926668801f, - -0.06435813813899958f, - -0.06448876590855185f, - -0.06461939257310655f, - -0.06475001813042451f, - -0.0648806425782693f, - -0.0650112659144018f, - -0.06514188813658338f, - -0.06527250924257676f, - -0.06540312923014287f, - -0.06553374809704447f, - -0.06566436584104257f, - -0.06579498245989995f, - -0.06592559795137763f, - -0.066056212313238f, - -0.06618682554324345f, - -0.06631743763915554f, - -0.0664480485987358f, - -0.06657865841974671f, - -0.06670926709995073f, - -0.06683987463710948f, - -0.06697048102898505f, - -0.06710108627333862f, - -0.06723169036793408f, - -0.06736229331053271f, - -0.06749289509889664f, - -0.06762349573078714f, - -0.06775409520396822f, - -0.06788469351620117f, - -0.06801529066524825f, - -0.0681458866488717f, - -0.06827648146483288f, - -0.0684070751108959f, - -0.06853766758482217f, - -0.06866825888437403f, - -0.06879884900731292f, - -0.06892943795140302f, - -0.06906002571440581f, - -0.06919061229408373f, - -0.0693211976881983f, - -0.06945178189451379f, - -0.06958236491079173f, - -0.06971294673479465f, - -0.06984352736428508f, - -0.06997410679702463f, - -0.07010468503077767f, - -0.07023526206330585f, - -0.07036583789237137f, - -0.07049641251573725f, - -0.0706269859311666f, - -0.07075755813642162f, - -0.07088812912926457f, - -0.07101869890745856f, - -0.07114926746876678f, - -0.07127983481095107f, - -0.07141040093177511f, - -0.07154096582900121f, - -0.07167152950039175f, - -0.07180209194371f, - -0.07193265315671923f, - -0.07206321313718189f, - -0.07219377188285998f, - -0.07232432939151817f, - -0.07245488566091852f, - -0.07258544068882399f, - -0.07271599447299663f, - -0.07284654701120126f, - -0.07297709830119999f, - -0.07310764834075584f, - -0.07323819712763188f, - -0.07336874465959034f, - -0.07349929093439604f, - -0.07362983594981126f, - -0.07376037970359914f, - -0.07389092219352195f, - -0.07402146341734464f, - -0.07415200337282957f, - -0.07428254205773996f, - -0.07441307946983905f, - -0.07454361560688924f, - -0.0746741504666556f, - -0.07480468404690056f, - -0.07493521634538748f, - -0.07506574735987882f, - -0.07519627708813975f, - -0.07532680552793279f, - -0.07545733267702137f, - -0.07558785853316805f, - -0.07571838309413807f, - -0.07584890635769406f, - -0.07597942832159954f, - -0.07610994898361759f, - -0.07624046834151223f, - -0.07637098639304747f, - -0.07650150313598607f, - -0.07663201856809251f, - -0.07676253268712957f, - -0.07689304549086183f, - -0.07702355697705207f, - -0.07715406714346491f, - -0.07728457598786323f, - -0.07741508350801121f, - -0.07754558970167309f, - -0.07767609456661224f, - -0.0778065981005925f, - -0.07793710030137682f, - -0.0780676011667309f, - -0.0781981006944177f, - -0.07832859888220117f, - -0.07845909572784437f, - -0.07858959122911306f, - -0.07872008538377033f, - -0.07885057818958022f, - -0.07898106964430585f, - -0.07911155974571307f, - -0.0792420484915651f, - -0.07937253587962605f, - -0.07950302190766001f, - -0.07963350657343031f, - -0.07976398987470286f, - -0.07989447180924099f, - -0.08002495237480894f, - -0.08015543156917006f, - -0.08028590939009041f, - -0.08041638583533338f, - -0.0805468609026633f, - -0.08067733458984452f, - -0.08080780689464054f, - -0.0809382778148175f, - -0.08106874734813892f, - -0.08119921549236928f, - -0.08132968224527211f, - -0.0814601476046137f, - -0.08159061156815768f, - -0.08172107413366812f, - -0.08185153529891002f, - -0.08198199506164844f, - -0.08211245341964753f, - -0.08224291037067145f, - -0.08237336591248577f, - -0.08250382004285427f, - -0.08263427275954212f, - -0.08276472406031446f, - -0.08289517394293561f, - -0.08302562240516992f, - -0.08315606944478261f, - -0.08328651505953896f, - -0.08341695924720338f, - -0.08354740200553985f, - -0.08367784333231504f, - -0.08380828322529299f, - -0.08393872168223866f, - -0.08406915870091701f, - -0.08419959427909214f, - -0.08433002841453087f, - -0.08446046110499733f, - -0.08459089234825662f, - -0.08472132214207292f, - -0.08485175048421316f, - -0.08498217737244157f, - -0.08511260280452333f, - -0.08524302677822275f, - -0.08537344929130682f, - -0.0855038703415399f, - -0.08563428992668727f, - -0.0857647080445142f, - -0.08589512469278517f, - -0.08602553986926724f, - -0.08615595357172494f, - -0.08628636579792365f, - -0.0864167765456279f, - -0.08654718581260493f, - -0.0866775935966193f, - -0.08680799989543653f, - -0.08693840470682125f, - -0.08706880802854076f, - -0.08719920985835979f, - -0.08732961019404391f, - -0.08746000903335831f, - -0.08759040637406908f, - -0.08772080221394234f, - -0.0878511965507429f, - -0.08798158938223741f, - -0.0881119807061907f, - -0.08824237052036944f, - -0.08837275882253857f, - -0.0885031456104648f, - -0.08863353088191352f, - -0.0887639146346502f, - -0.0888942968664412f, - -0.08902467757505285f, - -0.08915505675825072f, - -0.0892854344137999f, - -0.08941581053946815f, - -0.08954618513302065f, - -0.08967655819222346f, - -0.08980692971484179f, - -0.08993729969864353f, - -0.09006766814139394f, - -0.09019803504085917f, - -0.09032840039480546f, - -0.09045876420099812f, - -0.09058912645720517f, - -0.09071948716119202f, - -0.09084984631072497f, - -0.09098020390356945f, - -0.0911105599374936f, - -0.09124091441026294f, - -0.09137126731964385f, - -0.0915016186634019f, - -0.09163196843930531f, - -0.09176231664511969f, - -0.09189266327861158f, - -0.09202300833754751f, - -0.09215335181969316f, - -0.0922836937228169f, - -0.0924140340446845f, - -0.09254437278306259f, - -0.09267470993571696f, - -0.0928050455004161f, - -0.09293537947492585f, - -0.093065711857013f, - -0.09319604264444341f, - -0.09332637183498571f, - -0.09345669942640583f, - -0.09358702541647022f, - -0.09371734980294666f, - -0.09384767258360119f, - -0.09397799375620164f, - -0.0941083133185141f, - -0.09423863126830649f, - -0.09436894760334495f, - -0.09449926232139699f, - -0.09462957542023015f, - -0.09475988689761108f, - -0.09489019675130697f, - -0.09502050497908408f, - -0.09515081157871139f, - -0.09528111654795525f, - -0.09541141988458292f, - -0.0955417215863608f, - -0.095672021651058f, - -0.09580232007644092f, - -0.09593261686027699f, - -0.09606291200033269f, - -0.09619320549437724f, - -0.0963234973401772f, - -0.09645378753550006f, - -0.09658407607811331f, - -0.09671436296578365f, - -0.09684464819628037f, - -0.09697493176737022f, - -0.09710521367682082f, - -0.09723549392239893f, - -0.09736577250187399f, - -0.09749604941301286f, - -0.09762632465358326f, - -0.09775659822135206f, - -0.09788687011408886f, - -0.09801714032956059f, - -0.0981474088655351f, - -0.09827767571978026f, - -0.09840794089006312f, - -0.0985382043741534f, - -0.09866846616981814f, - -0.09879872627482494f, - -0.09892898468694226f, - -0.0990592414039386f, - -0.09918949642358159f, - -0.09931974974363891f, - -0.09945000136187916f, - -0.09958025127607095f, - -0.0997104994839816f, - -0.0998407459833802f, - -0.09997099077203461f, - -0.10010123384771265f, - -0.1002314752081831f, - -0.10036171485121473f, - -0.1004919527745755f, - -0.10062218897603291f, - -0.10075242345335719f, - -0.10088265620431591f, - -0.10101288722667759f, - -0.10114311651820983f, - -0.10127334407668298f, - -0.10140356989986475f, - -0.10153379398552374f, - -0.1016640163314286f, - -0.10179423693534713f, - -0.10192445579504979f, - -0.10205467290830443f, - -0.10218488827287982f, - -0.10231510188654387f, - -0.10244531374706718f, - -0.10257552385221773f, - -0.10270573219976437f, - -0.10283593878747604f, - -0.1029661436131208f, - -0.10309634667446939f, - -0.10322654796928994f, - -0.10335674749535147f, - -0.10348694525042217f, - -0.1036171412322729f, - -0.10374733543867193f, - -0.10387752786738838f, - -0.10400771851619058f, - -0.10413790738284949f, - -0.10426809446513349f, - -0.10439827976081187f, - -0.1045284632676535f, - -0.10465864498342813f, - -0.1047888249059056f, - -0.10491900303285444f, - -0.10504917936204493f, - -0.10517935389124568f, - -0.10530952661822705f, - -0.1054396975407577f, - -0.10556986665660806f, - -0.10570003396354682f, - -0.10583019945934408f, - -0.10596036314176989f, - -0.10609052500859349f, - -0.10622068505758463f, - -0.10635084328651213f, - -0.10648099969314755f, - -0.1066111542752598f, - -0.10674130703061874f, - -0.10687145795699332f, - -0.10700160705215524f, - -0.10713175431387352f, - -0.10726189973991813f, - -0.1073920433280582f, - -0.1075221850760655f, - -0.1076523249817092f, - -0.10778246304275939f, - -0.1079125992569862f, - -0.10804273362215888f, - -0.1081728661360494f, - -0.10830299679642709f, - -0.10843312560106219f, - -0.10856325254772409f, - -0.10869337763418487f, - -0.10882350085821399f, - -0.10895362221758181f, - -0.10908374171005877f, - -0.10921385933341439f, - -0.10934397508542092f, - -0.10947408896384798f, - -0.1096042009664661f, - -0.10973431109104496f, - -0.10986441933535694f, - -0.10999452569717176f, - -0.11012463017425968f, - -0.1102547327643918f, - -0.1103848334653393f, - -0.1105149322748725f, - -0.11064502919076175f, - -0.11077512421077876f, - -0.1109052173326935f, - -0.1110353085542773f, - -0.11116539787330154f, - -0.11129548528753672f, - -0.11142557079475338f, - -0.11155565439272298f, - -0.11168573607921703f, - -0.11181581585200616f, - -0.11194589370886061f, - -0.11207596964755331f, - -0.11220604366585454f, - -0.11233611576153553f, - -0.11246618593236751f, - -0.11259625417612092f, - -0.1127263204905688f, - -0.11285638487348164f, - -0.1129864473226308f, - -0.11311650783578683f, - -0.11324656641072296f, - -0.11337662304520976f, - -0.11350667773701875f, - -0.1136367304839206f, - -0.11376678128368865f, - -0.11389683013409366f, - -0.11402687703290723f, - -0.11415692197790109f, - -0.11428696496684604f, - -0.1144170059975156f, - -0.11454704506768067f, - -0.11467708217511308f, - -0.11480711731758378f, - -0.11493715049286643f, - -0.11506718169873205f, - -0.1151972109329526f, - -0.11532723819329918f, - -0.11545726347754558f, - -0.11558728678346294f, - -0.1157173081088234f, - -0.11584732745139859f, - -0.11597734480896112f, - -0.11610736017928362f, - -0.11623737356013744f, - -0.1163673849492957f, - -0.11649739434452981f, - -0.116627401743613f, - -0.11675740714431672f, - -0.11688741054441425f, - -0.11701741194167757f, - -0.11714741133387828f, - -0.11727740871879062f, - -0.11740740409418626f, - -0.11753739745783774f, - -0.11766738880751679f, - -0.11779737814099779f, - -0.11792736545605256f, - -0.11805735075045377f, - -0.11818733402197329f, - -0.11831731526838565f, - -0.11844729448746279f, - -0.11857727167697753f, - -0.11870724683470275f, - -0.11883721995841048f, - -0.11896719104587546f, - -0.11909716009486973f, - -0.11922712710316635f, - -0.11935709206853748f, - -0.11948705498875796f, - -0.11961701586160003f, - -0.11974697468483686f, - -0.11987693145624075f, - -0.12000688617358668f, - -0.12013683883464703f, - -0.12026678943719511f, - -0.12039673797900424f, - -0.12052668445784692f, - -0.12065662887149829f, - -0.12078657121773094f, - -0.12091651149431831f, - -0.12104644969903304f, - -0.12117638582965044f, - -0.12130631988394322f, - -0.12143625185968453f, - -0.12156618175464846f, - -0.12169610956660916f, - -0.12182603529333991f, - -0.121955958932614f, - -0.12208588048220613f, - -0.12221579993988924f, - -0.12234571730343764f, - -0.12247563257062566f, - -0.1226055457392268f, - -0.12273545680701461f, - -0.12286536577176352f, - -0.12299527263124801f, - -0.12312517738324176f, - -0.12325508002551884f, - -0.12338498055585254f, - -0.12351487897201882f, - -0.12364477527179102f, - -0.12377466945294338f, - -0.12390456151324936f, - -0.12403445145048503f, - -0.12416433926242387f, - -0.12429422494684031f, - -0.12442410850150791f, - -0.1245539899242029f, - -0.12468386921269892f, - -0.12481374636477054f, - -0.12494362137819232f, - -0.12507349425073802f, - -0.12520336498018408f, - -0.12533323356430429f, - -0.1254631000008734f, - -0.12559296428766534f, - -0.12572282642245663f, - -0.12585268640302125f, - -0.1259825442271341f, - -0.12611239989256917f, - -0.12624225339710327f, - -0.12637210473851043f, - -0.12650195391456573f, - -0.1266318009230438f, - -0.12676164576172014f, - -0.1268914884283704f, - -0.12702132892076926f, - -0.12715116723669154f, - -0.1272810033739129f, - -0.1274108373302091f, - -0.12754066910335507f, - -0.12767049869112565f, - -0.1278003260912967f, - -0.12793015130164417f, - -0.12805997431994262f, - -0.12818979514396844f, - -0.12831961377149675f, - -0.1284494302003027f, - -0.12857924442816238f, - -0.12870905645285186f, - -0.12883886627214644f, - -0.128968673883821f, - -0.12909847928565302f, - -0.12922828247541748f, - -0.12935808345089025f, - -0.1294878822098472f, - -0.1296176787500634f, - -0.12974747306931655f, - -0.1298772651653818f, - -0.1300070550360352f, - -0.13013684267905198f, - -0.13026662809220999f, - -0.13039641127328452f, - -0.13052619222005177f, - -0.13065597093028708f, - -0.13078574740176852f, - -0.13091552163227152f, - -0.13104529361957243f, - -0.1311750633614476f, - -0.13130483085567266f, - -0.13143459610002578f, - -0.13156435909228262f, - -0.13169411983021967f, - -0.1318238783116127f, - -0.13195363453424008f, - -0.13208338849587759f, - -0.1322131401943019f, - -0.13234288962728888f, - -0.1324726367926171f, - -0.13260238168806246f, - -0.13273212431140186f, - -0.13286186466041172f, - -0.13299160273286942f, - -0.13312133852655236f, - -0.1332510720392367f, - -0.13338080326870036f, - -0.13351053221271955f, - -0.1336402588690723f, - -0.13376998323553485f, - -0.13389970530988535f, - -0.1340294250899001f, - -0.13415914257335687f, - -0.13428885775803343f, - -0.13441857064170668f, - -0.13454828122215404f, - -0.13467798949715207f, - -0.13480769546448002f, - -0.13493739912191452f, - -0.13506710046723314f, - -0.13519679949821262f, - -0.13532649621263232f, - -0.13545619060826908f, - -0.13558588268290062f, - -0.1357155724343038f, - -0.1358452598602582f, - -0.13597494495854073f, - -0.13610462772692936f, - -0.13623430816320195f, - -0.1363639862651356f, - -0.13649366203051005f, - -0.1366233354571025f, - -0.13675300654269099f, - -0.1368826752850528f, - -0.1370123416819678f, - -0.13714200573121335f, - -0.13727166743056768f, - -0.13740132677780909f, - -0.137530983770715f, - -0.13766063840706552f, - -0.13779029068463822f, - -0.1379199406012115f, - -0.13804958815456297f, - -0.13817923334247295f, - -0.13830887616271909f, - -0.13843851661307954f, - -0.1385681546913334f, - -0.13869779039525984f, - -0.1388274237226371f, - -0.13895705467124353f, - -0.13908668323885878f, - -0.13921630942326088f, - -0.1393459332222291f, - -0.13947555463354286f, - -0.13960517365498068f, - -0.1397347902843211f, - -0.13986440451934365f, - -0.13999401635782788f, - -0.14012362579755241f, - -0.14025323283629562f, - -0.14038283747183847f, - -0.14051243970195929f, - -0.14064203952443743f, - -0.14077163693705225f, - -0.1409012319375822f, - -0.14103082452380847f, - -0.14116041469350968f, - -0.1412900024444653f, - -0.14141958777445404f, - -0.14154917068125722f, - -0.1416787511626536f, - -0.14180832921642286f, - -0.14193790484034385f, - -0.14206747803219805f, - -0.14219704878976439f, - -0.1423266171108227f, - -0.1424561829931529f, - -0.142585746434534f, - -0.14271530743274777f, - -0.14284486598557325f, - -0.1429744220907906f, - -0.14310397574617892f, - -0.14323352694952018f, - -0.14336307569859363f, - -0.14349262199117954f, - -0.14362216582505768f, - -0.14375170719800884f, - -0.14388124610781375f, - -0.14401078255225236f, - -0.1441403165291047f, - -0.14426984803615167f, - -0.14439937707117417f, - -0.14452890363195195f, - -0.14465842771626644f, - -0.14478794932189742f, - -0.14491746844662645f, - -0.14504698508823335f, - -0.1451764992444998f, - -0.14530601091320614f, - -0.14543552009213237f, - -0.14556502677906114f, - -0.14569453097177248f, - -0.14582403266804742f, - -0.14595353186566606f, - -0.14608302856241126f, - -0.14621252275606322f, - -0.1463420144444031f, - -0.14647150362521122f, - -0.14660099029627058f, - -0.14673047445536158f, - -0.14685995610026553f, - -0.14698943522876382f, - -0.14711891183863696f, - -0.14724838592766817f, - -0.14737785749363808f, - -0.1475073265343282f, - -0.14763679304751925f, - -0.14776625703099464f, - -0.14789571848253513f, - -0.14802517739992244f, - -0.14815463378093743f, - -0.14828408762336368f, - -0.14841353892498216f, - -0.14854298768357474f, - -0.14867243389692336f, - -0.1488018775628091f, - -0.14893131867901574f, - -0.1490607572433245f, - -0.14919019325351743f, - -0.14931962670737584f, - -0.14944905760268368f, - -0.14957848593722226f, - -0.14970791170877348f, - -0.14983733491512005f, - -0.14996675555404484f, - -0.15009617362332978f, - -0.15022558912075687f, - -0.15035500204410954f, - -0.15048441239116941f, - -0.15061382015971955f, - -0.150743225347543f, - -0.150872627952422f, - -0.15100202797213888f, - -0.15113142540447677f, - -0.15126082024721896f, - -0.15139021249814788f, - -0.1515196021550464f, - -0.15164898921569656f, - -0.15177837367788316f, - -0.15190775553938834f, - -0.15203713479799516f, - -0.15216651145148588f, - -0.15229588549764542f, - -0.1524252569342561f, - -0.15255462575910117f, - -0.15268399196996307f, - -0.15281335556462688f, - -0.15294271654087516f, - -0.1530720748964913f, - -0.15320143062925878f, - -0.15333078373696027f, - -0.15346013421738106f, - -0.15358948206830392f, - -0.15371882728751252f, - -0.15384816987278965f, - -0.15397750982192082f, - -0.15410684713268896f, - -0.15423618180287793f, - -0.1543655138302707f, - -0.15449484321265297f, - -0.15462416994780784f, - -0.15475349403351935f, - -0.15488281546757107f, - -0.15501213424774762f, - -0.15514145037183358f, - -0.15527076383761268f, - -0.15540007464286873f, - -0.15552938278538653f, - -0.1556586882629508f, - -0.15578799107334504f, - -0.15591729121435458f, - -0.15604658868376303f, - -0.1561758834793558f, - -0.15630517559891652f, - -0.15643446504023073f, - -0.15656375180108267f, - -0.15669303587925656f, - -0.15682231727253762f, - -0.15695159597871108f, - -0.15708087199556134f, - -0.15721014532087244f, - -0.15733941595243103f, - -0.15746868388802124f, - -0.1575979491254281f, - -0.15772721166243667f, - -0.15785647149683119f, - -0.15798572862639862f, - -0.15811498304892324f, - -0.15824423476219038f, - -0.1583734837639844f, - -0.15850273005209245f, - -0.15863197362429904f, - -0.15876121447838962f, - -0.15889045261214882f, - -0.1590196880233639f, - -0.1591489207098196f, - -0.1592781506693015f, - -0.15940737789959536f, - -0.159536602398486f, - -0.1596658241637609f, - -0.15979504319320506f, - -0.15992425948460431f, - -0.16005347303574372f, - -0.16018268384441095f, - -0.1603118919083912f, - -0.16044109722547048f, - -0.16057029979343404f, - -0.16069949961006977f, - -0.160828696673163f, - -0.16095789098049948f, - -0.16108708252986645f, - -0.16121627131904934f, - -0.1613454573458354f, - -0.16147464060801023f, - -0.16160382110336113f, - -0.1617329988296738f, - -0.16186217378473564f, - -0.16199134596633244f, - -0.16212051537225172f, - -0.1622496820002793f, - -0.16237884584820247f, - -0.1625080069138084f, - -0.16263716519488353f, - -0.16276632068921476f, - -0.1628954733945882f, - -0.16302462330879258f, - -0.1631537704296141f, - -0.16328291475483983f, - -0.16341205628225605f, - -0.16354119500965172f, - -0.16367033093481317f, - -0.16379946405552775f, - -0.16392859436958188f, - -0.1640577218747647f, - -0.16418684656886276f, - -0.1643159684496636f, - -0.16444508751495468f, - -0.16457420376252274f, - -0.16470331719015718f, - -0.16483242779564475f, - -0.16496153557677323f, - -0.16509064053132946f, - -0.16521974265710307f, - -0.165348841951881f, - -0.1654779384134512f, - -0.16560703203960164f, - -0.16573612282811945f, - -0.16586521077679442f, - -0.16599429588341386f, - -0.16612337814576583f, - -0.16625245756163776f, - -0.16638153412881962f, - -0.16651060784509883f, - -0.16663967870826332f, - -0.16676874671610195f, - -0.16689781186640357f, - -0.1670268741569563f, - -0.1671559335855482f, - -0.1672849901499688f, - -0.16741404384800584f, - -0.1675430946774485f, - -0.16767214263608587f, - -0.1678011877217064f, - -0.1679302299320985f, - -0.16805926926505146f, - -0.1681883057183547f, - -0.16831733928979672f, - -0.16844636997716575f, - -0.16857539777825262f, - -0.1687044226908456f, - -0.16883344471273384f, - -0.16896246384170666f, - -0.16909148007555241f, - -0.1692204934120622f, - -0.16934950384902456f, - -0.16947851138422892f, - -0.1696075160154639f, - -0.1697365177405208f, - -0.16986551655718832f, - -0.1699945124632561f, - -0.17012350545651295f, - -0.1702524955347504f, - -0.1703814826957573f, - -0.17051046693732355f, - -0.170639448257239f, - -0.17076842665329273f, - -0.17089740212327648f, - -0.17102637466497944f, - -0.17115534427619164f, - -0.1712843109547024f, - -0.17141327469830364f, - -0.1715422355047847f, - -0.17167119337193593f, - -0.1718001482975472f, - -0.17192910027940933f, - -0.1720580493153132f, - -0.1721869954030489f, - -0.17231593854040653f, - -0.17244487872517708f, - -0.17257381595515167f, - -0.17270275022812012f, - -0.172831681541874f, - -0.1729606098942033f, - -0.17308953528289972f, - -0.17321845770575328f, - -0.1733473771605558f, - -0.1734762936450978f, - -0.17360520715716957f, - -0.17373411769456384f, - -0.17386302525507097f, - -0.17399192983648212f, - -0.1741208314365877f, - -0.1742497300531807f, - -0.17437862568405169f, - -0.17450751832699204f, - -0.17463640797979232f, - -0.17476529464024582f, - -0.17489417830614318f, - -0.1750230589752761f, - -0.17515193664543613f, - -0.1752808113144142f, - -0.17540968298000378f, - -0.17553855163999585f, - -0.17566741729218227f, - -0.17579627993435404f, - -0.17592513956430494f, - -0.17605399617982612f, - -0.17618284977870963f, - -0.17631170035874671f, - -0.17644054791773134f, - -0.17656939245345485f, - -0.1766982339637095f, - -0.17682707244628765f, - -0.17695590789898083f, - -0.17708474031958318f, - -0.1772135697058864f, - -0.17734239605568292f, - -0.17747121936676455f, - -0.17760003963692564f, - -0.17772885686395806f, - -0.17785767104565406f, - -0.1779864821798074f, - -0.17811529026420997f, - -0.1782440952966556f, - -0.1783728972749364f, - -0.17850169619684622f, - -0.17863049206017728f, - -0.1787592848627231f, - -0.1788880746022773f, - -0.1790168612766327f, - -0.17914564488358206f, - -0.17927442542091923f, - -0.179403202886438f, - -0.17953197727793133f, - -0.17966074859319273f, - -0.17978951683001487f, - -0.17991828198619308f, - -0.18004704405952016f, - -0.18017580304778977f, - -0.1803045589487948f, - -0.18043331176033078f, - -0.18056206148019072f, - -0.18069080810616853f, - -0.18081955163605726f, - -0.18094829206765273f, - -0.18107702939874806f, - -0.18120576362713745f, - -0.181334494750615f, - -0.18146322276697413f, - -0.18159194767401082f, - -0.18172066946951854f, - -0.1818493881512917f, - -0.18197810371712383f, - -0.1821068161648112f, - -0.18223552549214747f, - -0.18236423169692725f, - -0.1824929347769443f, - -0.1826216347299951f, - -0.18275033155387355f, - -0.1828790252463744f, - -0.18300771580529215f, - -0.18313640322842212f, - -0.18326508751355972f, - -0.18339376865849957f, - -0.18352244666103631f, - -0.1836511215189655f, - -0.18377979323008278f, - -0.1839084617921825f, - -0.18403712720306087f, - -0.18416578946051235f, - -0.1842944485623332f, - -0.18442310450631805f, - -0.18455175729026324f, - -0.18468040691196394f, - -0.18480905336921488f, - -0.1849376966598135f, - -0.18506633678155465f, - -0.18519497373223412f, - -0.18532360750964685f, - -0.18545223811159053f, - -0.1855808655358602f, - -0.1857094897802519f, - -0.18583811084256163f, - -0.1859667287205847f, - -0.18609534341211897f, - -0.1862239549149598f, - -0.18635256322690347f, - -0.18648116834574546f, - -0.18660977026928388f, - -0.1867383689953143f, - -0.1868669645216332f, - -0.18699555684603628f, - -0.1871241459663219f, - -0.18725273188028582f, - -0.18738131458572477f, - -0.1875098940804355f, - -0.187638470362214f, - -0.1877670434288589f, - -0.1878956132781662f, - -0.18802417990793294f, - -0.18815274331595527f, - -0.18828130350003208f, - -0.1884098604579596f, - -0.18853841418753506f, - -0.18866696468655486f, - -0.18879551195281807f, - -0.18892405598412118f, - -0.1890525967782612f, - -0.18918113433303646f, - -0.18930966864624368f, - -0.18943819971568132f, - -0.18956672753914613f, - -0.18969525211443672f, - -0.18982377343934997f, - -0.18995229151168416f, - -0.19008080632923757f, - -0.19020931788980774f, - -0.1903378261911922f, - -0.1904663312311894f, - -0.1905948330075979f, - -0.19072333151821547f, - -0.19085182676084025f, - -0.19098031873326968f, - -0.19110880743330383f, - -0.19123729285874017f, - -0.19136577500737717f, - -0.19149425387701244f, - -0.19162272946544628f, - -0.19175120177047641f, - -0.19187967078990154f, - -0.1920081365215203f, - -0.19213659896313068f, - -0.1922650581125332f, - -0.19239351396752588f, - -0.1925219665259077f, - -0.19265041578547673f, - -0.19277886174403383f, - -0.1929073043993772f, - -0.19303574374930604f, - -0.1931641797916187f, - -0.19329261252411617f, - -0.19342104194459697f, - -0.19354946805086046f, - -0.19367789084070608f, - -0.19380631031193252f, - -0.19393472646234106f, - -0.19406313928973046f, - -0.19419154879189995f, - -0.19431995496664972f, - -0.19444835781178f, - -0.1945767573250902f, - -0.19470515350437978f, - -0.19483354634744918f, - -0.1949619358520988f, - -0.19509032201612836f, - -0.1952187048373375f, - -0.19534708431352732f, - -0.1954754604424972f, - -0.19560383322204783f, - -0.1957322026499801f, - -0.19586056872409394f, - -0.19598893144218943f, - -0.1961172908020675f, - -0.19624564680152923f, - -0.19637399943837483f, - -0.19650234871040412f, - -0.19663069461541963f, - -0.19675903715122128f, - -0.19688737631561f, - -0.19701571210638674f, - -0.1971440445213516f, - -0.19727237355830737f, - -0.19740069921505432f, - -0.19752902148939364f, - -0.19765734037912566f, - -0.1977856558820534f, - -0.19791396799597738f, - -0.198042276718699f, - -0.19817058204801882f, - -0.19829888398174014f, - -0.19842718251766364f, - -0.198555477653591f, - -0.19868376938732388f, - -0.19881205771666316f, - -0.19894034263941243f, - -0.19906862415337268f, - -0.19919690225634581f, - -0.199325176946133f, - -0.19945344822053798f, - -0.199581716077362f, - -0.19970998051440725f, - -0.19983824152947552f, - -0.19996649912036948f, - -0.20009475328489196f, - -0.20022300402084486f, - -0.2003512513260303f, - -0.20047949519825115f, - -0.20060773563531042f, - -0.20073597263500995f, - -0.20086420619515322f, - -0.20099243631354216f, - -0.20112066298798043f, - -0.20124888621627005f, - -0.2013771059962148f, - -0.20150532232561724f, - -0.20163353520227958f, - -0.20176174462400662f, - -0.20188995058860065f, - -0.20201815309386495f, - -0.2021463521376019f, - -0.20227454771761658f, - -0.20240273983171153f, - -0.20253092847769022f, - -0.20265911365335532f, - -0.2027872953565121f, - -0.20291547358496337f, - -0.2030436483365128f, - -0.2031718196089642f, - -0.20329998740012045f, - -0.20342815170778725f, - -0.2035563125297676f, - -0.20368446986386554f, - -0.20381262370788428f, - -0.2039407740596296f, - -0.20406892091690487f, - -0.2041970642775143f, - -0.20432520413926133f, - -0.2044533404999521f, - -0.20458147335739005f, - -0.20470960270937977f, - -0.20483772855372573f, - -0.2049658508882317f, - -0.20509396971070404f, - -0.20522208501894662f, - -0.20535019681076422f, - -0.2054783050839608f, - -0.205606409836343f, - -0.20573451106571494f, - -0.2058626087698812f, - -0.20599070294664765f, - -0.20611879359381866f, - -0.20624688070920025f, - -0.20637496429059682f, - -0.20650304433581457f, - -0.206631120842658f, - -0.206759193808933f, - -0.20688726323244552f, - -0.20701532911100068f, - -0.20714339144240365f, - -0.20727145022446058f, - -0.20739950545497765f, - -0.20752755713176022f, - -0.20765560525261414f, - -0.20778364981534453f, - -0.20791169081775907f, - -0.20803972825766295f, - -0.2081677621328623f, - -0.20829579244116242f, - -0.20842381918037128f, - -0.2085518423482943f, - -0.20867986194273783f, - -0.20880787796150746f, - -0.20893589040241137f, - -0.20906389926325525f, - -0.2091919045418457f, - -0.20931990623598937f, - -0.20944790434349211f, - -0.2095758988621625f, - -0.20970388978980645f, - -0.20983187712423093f, - -0.209959860863242f, - -0.21008784100464845f, - -0.2102158175462565f, - -0.21034379048587332f, - -0.21047175982130523f, - -0.21059972555036127f, - -0.2107276876708479f, - -0.21085564618057256f, - -0.21098360107734224f, - -0.21111155235896492f, - -0.2112395000232486f, - -0.21136744406800054f, - -0.21149538449102798f, - -0.21162332129013914f, - -0.2117512544631423f, - -0.2118791840078445f, - -0.21200710992205454f, - -0.2121350322035796f, - -0.21226295085022864f, - -0.21239086585980893f, - -0.21251877723012952f, - -0.2126466849589983f, - -0.2127745890442227f, - -0.21290248948361287f, - -0.21303038627497642f, - -0.21315827941612184f, - -0.21328616890485685f, - -0.21341405473899186f, - -0.2135419369163347f, - -0.21366981543469413f, - -0.213797690291879f, - -0.21392556148569736f, - -0.21405342901395988f, - -0.2141812928744747f, - -0.21430915306505094f, - -0.21443700958349687f, - -0.21456486242762346f, - -0.2146927115952391f, - -0.2148205570841531f, - -0.21494839889217404f, - -0.2150762370171131f, - -0.21520407145677894f, - -0.21533190220898116f, - -0.2154597292715294f, - -0.21558755264223253f, - -0.21571537231890206f, - -0.21584318829934698f, - -0.21597100058137716f, - -0.21609880916280172f, - -0.21622661404143245f, - -0.21635441521507853f, - -0.21648221268155018f, - -0.21661000643865674f, - -0.21673779648421024f, - -0.2168655828160201f, - -0.2169933654318964f, - -0.21712114432965043f, - -0.21724891950709188f, - -0.21737669096203222f, - -0.21750445869228124f, - -0.21763222269565055f, - -0.2177599829699501f, - -0.21788773951299117f, - -0.21801549232258513f, - -0.2181432413965425f, - -0.21827098673267395f, - -0.218398728328791f, - -0.2185264661827053f, - -0.21865420029222762f, - -0.2187819306551693f, - -0.21890965726934083f, - -0.21903738013255541f, - -0.21916509924262365f, - -0.2192928145973571f, - -0.21942052619456656f, - -0.21954823403206547f, - -0.21967593810766467f, - -0.21980363841917605f, - -0.21993133496441145f, - -0.22005902774118197f, - -0.2201867167473014f, - -0.2203144019805809f, - -0.22044208343883262f, - -0.22056976111986795f, - -0.22069743502150088f, - -0.2208251051415429f, - -0.2209527714778064f, - -0.22108043402810296f, - -0.2212080927902469f, - -0.22133574776204992f, - -0.22146339894132472f, - -0.22159104632588397f, - -0.22171868991353968f, - -0.22184632970210638f, - -0.22197396568939617f, - -0.2221015978732216f, - -0.22222922625139613f, - -0.22235685082173334f, - -0.22248447158204598f, - -0.22261208853014688f, - -0.22273970166384982f, - -0.22286731098096854f, - -0.22299491647931569f, - -0.22312251815670558f, - -0.22325011601095143f, - -0.22337771003986642f, - -0.22350530024126472f, - -0.2236328866129605f, - -0.22376046915276715f, - -0.22388804785849778f, - -0.22401562272796807f, - -0.22414319375899117f, - -0.2242707609493812f, - -0.22439832429695147f, - -0.22452588379951793f, - -0.22465343945489405f, - -0.22478099126089415f, - -0.22490853921533271f, - -0.22503608331602334f, - -0.22516362356078234f, - -0.2252911599474235f, - -0.2254186924737615f, - -0.22554622113761022f, - -0.22567374593678624f, - -0.2258012668691036f, - -0.22592878393237725f, - -0.22605629712442224f, - -0.22618380644305278f, - -0.22631131188608575f, - -0.22643881345133554f, - -0.22656631113661746f, - -0.22669380493974595f, - -0.22682129485853822f, - -0.22694878089080886f, - -0.22707626303437348f, - -0.2272037412870468f, - -0.22733121564664627f, - -0.22745868611098677f, - -0.22758615267788412f, - -0.2277136153451538f, - -0.22784107411061222f, - -0.2279685289720758f, - -0.2280959799273598f, - -0.22822342697428125f, - -0.2283508701106555f, - -0.22847830933429972f, - -0.22860574464302938f, - -0.2287331760346618f, - -0.22886060350701262f, - -0.22898802705789928f, - -0.2291154466851375f, - -0.2292428623865449f, - -0.22937027415993777f, - -0.2294976820031321f, - -0.22962508591394648f, - -0.2297524858901971f, - -0.2298798819297009f, - -0.23000727403027418f, - -0.23013466218973583f, - -0.23026204640590223f, - -0.23038942667659065f, - -0.23051680299961763f, - -0.23064417537280232f, - -0.2307715437939614f, - -0.23089890826091242f, - -0.231026268771473f, - -0.23115362532346004f, - -0.23128097791469301f, - -0.2314083265429889f, - -0.23153567120616564f, - -0.23166301190204036f, - -0.2317903486284328f, - -0.23191768138316024f, - -0.23204501016404086f, - -0.23217233496889209f, - -0.2322996557955339f, - -0.2324269726417839f, - -0.2325542855054605f, - -0.23268159438438227f, - -0.2328088992763669f, - -0.23293620017923478f, - -0.23306349709080382f, - -0.23319079000889237f, - -0.23331807893131973f, - -0.23344536385590528f, - -0.23357264478046758f, - -0.2336999217028253f, - -0.2338271946207984f, - -0.23395446353220528f, - -0.23408172843486608f, - -0.23420898932659923f, - -0.23433624620522508f, - -0.23446349906856223f, - -0.23459074791443066f, - -0.23471799274065042f, - -0.2348452335450408f, - -0.23497247032542112f, - -0.23509970307961164f, - -0.2352269318054327f, - -0.23535415650070382f, - -0.23548137716324508f, - -0.23560859379087565f, - -0.2357358063814175f, - -0.23586301493269002f, - -0.23599021944251347f, - -0.2361174199087074f, - -0.23624461632909402f, - -0.23637180870149296f, - -0.2364989970237248f, - -0.23662618129360935f, - -0.23675336150896908f, - -0.23688053766762393f, - -0.23700770976739477f, - -0.2371348778061025f, - -0.23726204178156735f, - -0.23738920169161204f, - -0.23751635753405692f, - -0.23764350930672315f, - -0.23777065700743122f, - -0.23789780063400415f, - -0.23802494018426254f, - -0.23815207565602792f, - -0.2382792070471209f, - -0.23840633435536496f, - -0.23853345757858088f, - -0.23866057671459043f, - -0.23878769176121503f, - -0.23891480271627707f, - -0.23904190957759894f, - -0.23916901234300225f, - -0.23929611101030873f, - -0.239423205577341f, - -0.23955029604192177f, - -0.23967738240187247f, - -0.23980446465501642f, - -0.23993154279917567f, - -0.2400586168321723f, - -0.24018568675182939f, - -0.24031275255597007f, - -0.24043981424241664f, - -0.2405668718089911f, - -0.24069392525351807f, - -0.24082097457381965f, - -0.2409480197677189f, - -0.24107506083303806f, - -0.24120209776760204f, - -0.24132913056923322f, - -0.24145615923575497f, - -0.24158318376499066f, - -0.2417102041547629f, - -0.24183722040289696f, - -0.24196423250721558f, - -0.24209124046554242f, - -0.24221824427570043f, - -0.2423452439355151f, - -0.24247223944280952f, - -0.2425992307954076f, - -0.24272621799113253f, - -0.24285320102781016f, - -0.24298017990326382f, - -0.24310715461531773f, - -0.2432341251617962f, - -0.24336109154052282f, - -0.24348805374932372f, - -0.24361501178602263f, - -0.2437419656484441f, - -0.243868915334412f, - -0.24399586084175276f, - -0.24412280216829035f, - -0.2442497393118497f, - -0.2443766722702549f, - -0.2445036010413327f, - -0.24463052562290732f, - -0.24475744601280358f, - -0.24488436220884754f, - -0.2450112742088637f, - -0.24513818201067827f, - -0.2452650856121159f, - -0.24539198501100298f, - -0.24551888020516427f, - -0.2456457711924259f, - -0.24577265797061398f, - -0.245899540537554f, - -0.24602641889107138f, - -0.24615329302899255f, - -0.24628016294914398f, - -0.24640702864935132f, - -0.24653389012744084f, - -0.24666074738123786f, - -0.2467876004085705f, - -0.24691444920726427f, - -0.24704129377514564f, - -0.24716813411004035f, - -0.2472949702097767f, - -0.24742180207218054f, - -0.24754862969507865f, - -0.24767545307629787f, - -0.24780227221366427f, - -0.24792908710500652f, - -0.24805589774815087f, - -0.24818270414092442f, - -0.2483095062811535f, - -0.24843630416666715f, - -0.24856309779529184f, - -0.24868988716485502f, - -0.24881667227318327f, - -0.24894345311810595f, - -0.24907022969744982f, - -0.24919700200904257f, - -0.24932377005071205f, - -0.2494505338202852f, - -0.2495772933155917f, - -0.24970404853445874f, - -0.2498307994747139f, - -0.24995754613418583f, - -0.25008428851070313f, - -0.25021102660209377f, - -0.2503377604061856f, - -0.25046448992080755f, - -0.2505912151437885f, - -0.25071793607295634f, - -0.2508446527061405f, - -0.25097136504116924f, - -0.25109807307587106f, - -0.2512247768080752f, - -0.2513514762356111f, - -0.2514781713563074f, - -0.25160486216799227f, - -0.2517315486684967f, - -0.251858230855649f, - -0.2519849087272786f, - -0.252111582281214f, - -0.2522382515152864f, - -0.2523649164273245f, - -0.25249157701515795f, - -0.2526182332766164f, - -0.25274488520952887f, - -0.25287153281172686f, - -0.2529981760810394f, - -0.2531248150152966f, - -0.2532514496123276f, - -0.2533780798699643f, - -0.253504705786036f, - -0.2536313273583731f, - -0.25375794458480594f, - -0.2538845574631641f, - -0.2540111659912798f, - -0.2541377701669828f, - -0.25426436998810376f, - -0.2543909654524726f, - -0.25451755655792174f, - -0.2546441433022814f, - -0.25477072568338244f, - -0.25489730369905506f, - -0.2550238773471321f, - -0.2551504466254439f, - -0.25527701153182175f, - -0.25540357206409653f, - -0.2555301282201001f, - -0.2556566799976644f, - -0.25578322739462006f, - -0.2559097704087997f, - -0.25603630903803415f, - -0.25616284328015604f, - -0.2562893731329964f, - -0.25641589859438796f, - -0.256542419662162f, - -0.25666893633415094f, - -0.2567954486081875f, - -0.25692195648210336f, - -0.25704845995373093f, - -0.2571749590209017f, - -0.2573014536814499f, - -0.2574279439332072f, - -0.2575544297740062f, - -0.25768091120167885f, - -0.2578073882140595f, - -0.25793386080898023f, - -0.25806032898427395f, - -0.25818679273777273f, - -0.2583132520673115f, - -0.25843970697072244f, - -0.25856615744583883f, - -0.25869260349049394f, - -0.25881904510252035f, - -0.25894548227975317f, - -0.25907191502002513f, - -0.25919834332116987f, - -0.2593247671810201f, - -0.2594511865974114f, - -0.25957760156817666f, - -0.2597040120911499f, - -0.2598304181641642f, - -0.25995681978505525f, - -0.26008321695165654f, - -0.26020960966180207f, - -0.2603359979133263f, - -0.26046238170406266f, - -0.26058876103184736f, - -0.260715135894514f, - -0.26084150628989683f, - -0.2609678722158309f, - -0.2610942336701514f, - -0.26122059065069275f, - -0.26134694315528945f, - -0.2614732911817773f, - -0.26159963472799047f, - -0.26172597379176465f, - -0.26185230837093537f, - -0.2619786384633375f, - -0.26210496406680606f, - -0.2622312851791768f, - -0.2623576017982858f, - -0.2624839139219682f, - -0.2626102215480592f, - -0.26273652467439496f, - -0.2628628232988118f, - -0.26298911741914516f, - -0.26311540703323105f, - -0.2632416921389047f, - -0.2633679727340039f, - -0.2634942488163641f, - -0.26362052038382144f, - -0.26374678743421154f, - -0.2638730499653726f, - -0.2639993079751402f, - -0.264125561461351f, - -0.2642518104218408f, - -0.2643780548544481f, - -0.2645042947570088f, - -0.2646305301273599f, - -0.26475676096333833f, - -0.26488298726278037f, - -0.2650092090235248f, - -0.2651354262434081f, - -0.26526163892026744f, - -0.2653878470519394f, - -0.2655140506362632f, - -0.26564024967107547f, - -0.2657664441542138f, - -0.26589263408351504f, - -0.2660188194568187f, - -0.26614500027196175f, - -0.26627117652678217f, - -0.2663973482191174f, - -0.26652351534680613f, - -0.2666496779076868f, - -0.2667758358995973f, - -0.2669019893203755f, - -0.2670281381678602f, - -0.26715428243989037f, - -0.2672804221343036f, - -0.26740655724893947f, - -0.2675326877816362f, - -0.26765881373023215f, - -0.2677849350925667f, - -0.2679110518664791f, - -0.26803716404980804f, - -0.2681632716403917f, - -0.26828937463607105f, - -0.26841547303468444f, - -0.2685415668340712f, - -0.26866765603206993f, - -0.2687937406265218f, - -0.26891982061526554f, - -0.26904589599614076f, - -0.2691719667669873f, - -0.269298032925644f, - -0.2694240944699526f, - -0.26955015139775207f, - -0.2696762037068825f, - -0.2698022513951832f, - -0.2699282944604961f, - -0.27005433290066055f, - -0.270180366713517f, - -0.27030639589690497f, - -0.2704324204486668f, - -0.27055844036664206f, - -0.2706844556486716f, - -0.2708104662925961f, - -0.27093647229625556f, - -0.27106247365749264f, - -0.2711884703741475f, - -0.27131446244406116f, - -0.27144044986507393f, - -0.2715664326350288f, - -0.27169241075176614f, - -0.2718183842131275f, - -0.2719443530169534f, - -0.27207031716108715f, - -0.27219627664336954f, - -0.2723222314616418f, - -0.2724481816137466f, - -0.27257412709752504f, - -0.27270006791081985f, - -0.2728260040514723f, - -0.2729519355173252f, - -0.27307786230622005f, - -0.2732037844159995f, - -0.2733297018445064f, - -0.2734556145895826f, - -0.2735815226490708f, - -0.27370742602081266f, - -0.27383332470265254f, - -0.2739592186924324f, - -0.27408510798799507f, - -0.27421099258718257f, - -0.27433687248783967f, - -0.2744627476878086f, - -0.27458861818493246f, - -0.27471448397705367f, - -0.27484034506201727f, - -0.27496620143766587f, - -0.2750920531018428f, - -0.2752179000523918f, - -0.2753437422871555f, - -0.2754695798039795f, - -0.27559541260070664f, - -0.27572124067518083f, - -0.2758470640252452f, - -0.27597288264874553f, - -0.27609869654352504f, - -0.276224505707428f, - -0.2763503101382978f, - -0.2764761098339806f, - -0.2766019047923199f, - -0.2767276950111603f, - -0.2768534804883464f, - -0.27697926122172206f, - -0.2771050372091338f, - -0.27723080844842557f, - -0.27735657493744187f, - -0.2774823366740282f, - -0.2776080936560301f, - -0.27773384588129235f, - -0.2778595933476597f, - -0.277985336052978f, - -0.2781110739950931f, - -0.2782368071718497f, - -0.2783625355810941f, - -0.2784882592206717f, - -0.2786139780884278f, - -0.2787396921822087f, - -0.27886540149986067f, - -0.2789911060392293f, - -0.27911680579815984f, - -0.2792425007745002f, - -0.2793681909660958f, - -0.2794938763707928f, - -0.279619556986437f, - -0.27974523281087643f, - -0.2798709038419569f, - -0.279996570077525f, - -0.28012223151542753f, - -0.2802478881535105f, - -0.2803735399896224f, - -0.2804991870216095f, - -0.28062482924731874f, - -0.2807504666645965f, - -0.2808760992712918f, - -0.28100172706525095f, - -0.28112735004432143f, - -0.28125296820635076f, - -0.28137858154918555f, - -0.28150419007067523f, - -0.2816297937686667f, - -0.28175539264100774f, - -0.28188098668554534f, - -0.2820065759001293f, - -0.28213216028260674f, - -0.2822577398308258f, - -0.28238331454263393f, - -0.2825088844158811f, - -0.28263444944841487f, - -0.2827600096380837f, - -0.2828855649827357f, - -0.28301111548022f, - -0.28313666112838576f, - -0.28326220192508084f, - -0.283387737868155f, - -0.2835132689554565f, - -0.28363879518483515f, - -0.2837643165541392f, - -0.2838898330612188f, - -0.28401534470392237f, - -0.2841408514800997f, - -0.28426635338760076f, - -0.2843918504242747f, - -0.28451734258797107f, - -0.28464282987653877f, - -0.2847683122878294f, - -0.2848937898196919f, - -0.2850192624699762f, - -0.2851447302365317f, - -0.2852701931172101f, - -0.28539565110986076f, - -0.28552110421233406f, - -0.28564655242247955f, - -0.2857719957381494f, - -0.28589743415719326f, - -0.2860228676774619f, - -0.2861482962968059f, - -0.28627372001307533f, - -0.28639913882412277f, - -0.2865245527277983f, - -0.28664996172195306f, - -0.2867753658044373f, - -0.28690076497310396f, - -0.28702615922580355f, - -0.28715154856038744f, - -0.28727693297470713f, - -0.28740231246661335f, - -0.28752768703395937f, - -0.28765305667459623f, - -0.28777842138637566f, - -0.2879037811671487f, - -0.2880291360147691f, - -0.28815448592708803f, - -0.28827983090195736f, - -0.2884051709372296f, - -0.2885305060307576f, - -0.2886558361803933f, - -0.28878116138398885f, - -0.2889064816393976f, - -0.28903179694447145f, - -0.2891571072970635f, - -0.2892824126950271f, - -0.2894077131362147f, - -0.2895330086184789f, - -0.2896582991396732f, - -0.28978358469765125f, - -0.2899088652902658f, - -0.2900341409153695f, - -0.29015941157081737f, - -0.2902846772544621f, - -0.29040993796415737f, - -0.29053519369775677f, - -0.29066044445311323f, - -0.29078569022808237f, - -0.2909109310205173f, - -0.291036166828272f, - -0.29116139764919974f, - -0.29128662348115647f, - -0.2914118443219956f, - -0.2915370601695715f, - -0.29166227102173775f, - -0.29178747687635065f, - -0.291912677731264f, - -0.2920378735843324f, - -0.29216306443341084f, - -0.2922882502763532f, - -0.2924134311110162f, - -0.2925386069352541f, - -0.2926637777469219f, - -0.2927889435438742f, - -0.2929141043239678f, - -0.29303926008505743f, - -0.2931644108249985f, - -0.29328955654164574f, - -0.2934146972328565f, - -0.29353983289648566f, - -0.2936649635303891f, - -0.2937900891324224f, - -0.29391520970044177f, - -0.2940403252323039f, - -0.29416543572586407f, - -0.2942905411789794f, - -0.2944156415895054f, - -0.2945407369552993f, - -0.29466582727421686f, - -0.2947909125441155f, - -0.29491599276285146f, - -0.2950410679282808f, - -0.2951661380382619f, - -0.295291203090651f, - -0.2954162630833051f, - -0.2955413180140805f, - -0.29566636788083617f, - -0.29579141268142845f, - -0.2959164524137148f, - -0.2960414870755518f, - -0.29616651666479876f, - -0.29629154117931245f, - -0.29641656061695065f, - -0.29654157497557115f, - -0.29666658425303105f, - -0.29679158844719006f, - -0.29691658755590533f, - -0.2970415815770351f, - -0.29716657050843676f, - -0.2972915543479704f, - -0.29741653309349353f, - -0.2975415067428648f, - -0.2976664752939418f, - -0.297791438744585f, - -0.2979163970926524f, - -0.2980413503360028f, - -0.2981662984724952f, - -0.29829124149998776f, - -0.29841617941634135f, - -0.2985411122194143f, - -0.29866603990706597f, - -0.2987909624771549f, - -0.29891587992754226f, - -0.2990407922560867f, - -0.29916569946064764f, - -0.29929060153908504f, - -0.2994154984892593f, - -0.2995403903090299f, - -0.29966527699625645f, - -0.2997901585487998f, - -0.2999150349645194f, - -0.30003990624127624f, - -0.30016477237692996f, - -0.30028963336934184f, - -0.30041448921637154f, - -0.30053933991588017f, - -0.30066418546572876f, - -0.3007890258637778f, - -0.30091386110788815f, - -0.3010386911959199f, - -0.30116351612573594f, - -0.30128833589519644f, - -0.30141315050216266f, - -0.30153795994449517f, - -0.30166276422005706f, - -0.301787563326709f, - -0.30191235726231247f, - -0.30203714602472853f, - -0.3021619296118205f, - -0.3022867080214494f, - -0.30241148125147727f, - -0.3025362492997661f, - -0.3026610121641772f, - -0.30278576984257444f, - -0.3029105223328193f, - -0.3030352696327742f, - -0.3031600117403008f, - -0.3032847486532634f, - -0.30340948036952364f, - -0.3035342068869445f, - -0.30365892820338786f, - -0.3037836443167184f, - -0.3039083552247982f, - -0.3040330609254905f, - -0.3041577614166584f, - -0.3042824566961644f, - -0.3044071467618735f, - -0.30453183161164843f, - -0.3046565112433523f, - -0.30478118565484913f, - -0.30490585484400307f, - -0.3050305188086776f, - -0.30515517754673616f, - -0.3052798310560432f, - -0.30540447933446324f, - -0.30552912237985963f, - -0.30565376019009743f, - -0.3057783927630407f, - -0.3059030200965533f, - -0.30602764218850037f, - -0.30615225903674687f, - -0.3062768706391571f, - -0.30640147699359505f, - -0.3065260780979273f, - -0.30665067395001805f, - -0.30677526454773235f, - -0.3068998498889345f, - -0.3070244299714915f, - -0.30714900479326784f, - -0.30727357435212893f, - -0.3073981386459404f, - -0.3075226976725669f, - -0.3076472514298759f, - -0.30777179991573245f, - -0.3078963431280023f, - -0.3080208810645506f, - -0.3081454137232452f, - -0.3082699411019514f, - -0.3083944631985354f, - -0.30851898001086364f, - -0.30864349153680165f, - -0.30876799777421765f, - -0.30889249872097746f, - -0.30901699437494773f, - -0.30914148473399444f, - -0.30926596979598614f, - -0.309390449558789f, - -0.30951492402027014f, - -0.30963939317829586f, - -0.309763857030735f, - -0.30988831557545415f, - -0.31001276881032075f, - -0.3101372167332019f, - -0.3102616593419656f, - -0.31038609663448f, - -0.3105105286086121f, - -0.3106349552622306f, - -0.31075937659320263f, - -0.31088379259939714f, - -0.3110082032786814f, - -0.31113260862892456f, - -0.3112570086479941f, - -0.31138140333375885f, - -0.31150579268408785f, - -0.3116301766968492f, - -0.31175455536991176f, - -0.3118789287011433f, - -0.31200329668841453f, - -0.3121276593295936f, - -0.3122520166225495f, - -0.3123763685651506f, - -0.3125007151552679f, - -0.3126250563907698f, - -0.3127493922695259f, - -0.3128737227894048f, - -0.3129980479482778f, - -0.31312236774401386f, - -0.3132466821744827f, - -0.31337099123755424f, - -0.31349529493109773f, - -0.31361959325298483f, - -0.31374388620108495f, - -0.3138681737732683f, - -0.3139924559674045f, - -0.31411673278136565f, - -0.31424100421302137f, - -0.31436527026024247f, - -0.31448953092089954f, - -0.3146137861928626f, - -0.3147380360740043f, - -0.3148622805621948f, - -0.31498651965530516f, - -0.31511075335120575f, - -0.3152349816477696f, - -0.31535920454286714f, - -0.3154834220343695f, - -0.3156076341201487f, - -0.31573184079807676f, - -0.315856042066025f, - -0.3159802379218649f, - -0.3161044283634692f, - -0.31622861338870906f, - -0.3163527929954571f, - -0.3164769671815859f, - -0.3166011359449674f, - -0.31672529928347354f, - -0.31684945719497726f, - -0.3169736096773515f, - -0.3170977567284686f, - -0.31722189834620046f, - -0.31734603452842164f, - -0.31747016527300426f, - -0.3175942905778214f, - -0.3177184104407461f, - -0.31784252485965087f, - -0.3179666338324107f, - -0.31809073735689813f, - -0.3182148354309867f, - -0.3183389280525492f, - -0.3184630152194611f, - -0.31858709692959514f, - -0.3187111731808254f, - -0.318835243971025f, - -0.31895930929806965f, - -0.3190833691598327f, - -0.3192074235541884f, - -0.31933147247901117f, - -0.3194555159321746f, - -0.31957955391155485f, - -0.31970358641502583f, - -0.31982761344046223f, - -0.31995163498573803f, - -0.3200756510487298f, - -0.32019966162731184f, - -0.32032366671935913f, - -0.3204476663227465f, - -0.32057166043534974f, - -0.32069564905504455f, - -0.3208196321797061f, - -0.3209436098072095f, - -0.3210675819354308f, - -0.32119154856224624f, - -0.3213155096855309f, - -0.32143946530316153f, - -0.3215634154130133f, - -0.3216873600129633f, - -0.3218112991008868f, - -0.3219352326746611f, - -0.3220591607321622f, - -0.32218308327126566f, - -0.32230700028984993f, - -0.3224309117857908f, - -0.3225548177569651f, - -0.32267871820124894f, - -0.3228026131165209f, - -0.32292650250065735f, - -0.3230503863515354f, - -0.3231742646670315f, - -0.3232981374450247f, - -0.3234220046833917f, - -0.32354586638001004f, - -0.32366972253275733f, - -0.32379357313951057f, - -0.3239174181981492f, - -0.3240412577065504f, - -0.3241650916625922f, - -0.3242889200641519f, - -0.3244127429091094f, - -0.32453656019534216f, - -0.32466037192072866f, - -0.3247841780831466f, - -0.32490797868047616f, - -0.32503177371059533f, - -0.3251555631713829f, - -0.32527934706071765f, - -0.32540312537647786f, - -0.3255268981165443f, - -0.32565066527879527f, - -0.3257744268611101f, - -0.32589818286136724f, - -0.32602193327744794f, - -0.3261456781072309f, - -0.32626941734859527f, - -0.3263931509994214f, - -0.32651687905758947f, - -0.326640601520979f, - -0.3267643183874697f, - -0.3268880296549425f, - -0.3270117353212768f, - -0.32713543538435336f, - -0.327259129842053f, - -0.3273828186922559f, - -0.3275065019328422f, - -0.32763017956169305f, - -0.32775385157668974f, - -0.32787751797571274f, - -0.32800117875664303f, - -0.3281248339173609f, - -0.32824848345574925f, - -0.3283721273696885f, - -0.32849576565706007f, - -0.32861939831574455f, - -0.3287430253436253f, - -0.3288666467385831f, - -0.32899026249849983f, - -0.3291138726212564f, - -0.3292374771047365f, - -0.3293610759468214f, - -0.32948466914539326f, - -0.3296082566983343f, - -0.32973183860352606f, - -0.3298554148588527f, - -0.32997898546219595f, - -0.3301025504114384f, - -0.330226109704462f, - -0.3303496633391513f, - -0.33047321131338825f, - -0.3305967536250561f, - -0.33072029027203703f, - -0.330843821252216f, - -0.33096734656347543f, - -0.3310908662036988f, - -0.33121438017076926f, - -0.33133788846257073f, - -0.33146139107698747f, - -0.3315848880119028f, - -0.3317083792652002f, - -0.3318318648347642f, - -0.3319553447184792f, - -0.33207881891422864f, - -0.33220228741989766f, - -0.33232575023336985f, - -0.3324492073525305f, - -0.3325726587752633f, - -0.33269610449945397f, - -0.33281954452298673f, - -0.3329429788437461f, - -0.3330664074596174f, - -0.3331898303684863f, - -0.33331324756823744f, - -0.3334366590567553f, - -0.3335600648319269f, - -0.3336834648916369f, - -0.33380685923377096f, - -0.3339302478562146f, - -0.33405363075685285f, - -0.3341770079335732f, - -0.33430037938426077f, - -0.33442374510680173f, - -0.33454710509908125f, - -0.33467045935898737f, - -0.3347938078844056f, - -0.3349171506732224f, - -0.33504048772332345f, - -0.33516381903259707f, - -0.3352871445989292f, - -0.3354104644202067f, - -0.33553377849431654f, - -0.33565708681914486f, - -0.33578038939258054f, - -0.33590368621250993f, - -0.33602697727682046f, - -0.33615026258339864f, - -0.3362735421301337f, - -0.3363968159149125f, - -0.3365200839356227f, - -0.3366433461901514f, - -0.33676660267638814f, - -0.3368898533922201f, - -0.33701309833553544f, - -0.33713633750422195f, - -0.3372595708961684f, - -0.33738279850926367f, - -0.3375060203413954f, - -0.33762923639045306f, - -0.3377524466543246f, - -0.33787565113089957f, - -0.33799884981806616f, - -0.33812204271371415f, - -0.3382452298157319f, - -0.338368411122009f, - -0.3384915866304352f, - -0.33861475633889954f, - -0.3387379202452915f, - -0.3388610783474999f, - -0.33898423064341604f, - -0.33910737713092903f, - -0.3392305178079287f, - -0.3393536526723043f, - -0.3394767817219475f, - -0.3395999049547478f, - -0.3397230223685955f, - -0.3398461339613801f, - -0.33996923973099386f, - -0.3400923396753266f, - -0.34021543379226893f, - -0.3403385220797117f, - -0.340461604535545f, - -0.3405846811576616f, - -0.34070775194395164f, - -0.3408308168923064f, - -0.3409538760006164f, - -0.34107692926677463f, - -0.3411999766886718f, - -0.3413230182641996f, - -0.34144605399124967f, - -0.34156908386771306f, - -0.34169210789148324f, - -0.3418151260604515f, - -0.34193813837250997f, - -0.3420611448255499f, - -0.3421841454174654f, - -0.342307140146148f, - -0.3424301290094898f, - -0.3425531120053839f, - -0.34267608913172337f, - -0.3427990603864006f, - -0.3429220257673082f, - -0.34304498527233984f, - -0.343167938899388f, - -0.3432908866463462f, - -0.34341382851110824f, - -0.3435367644915671f, - -0.3436596945856159f, - -0.34378261879114863f, - -0.34390553710605953f, - -0.34402844952824196f, - -0.344151356055589f, - -0.34427425668599637f, - -0.3443971514173574f, - -0.3445200402475662f, - -0.3446429231745172f, - -0.34476580019610403f, - -0.3448886713102228f, - -0.34501153651476746f, - -0.3451343958076326f, - -0.34525724918671225f, - -0.34538009664990305f, - -0.34550293819509925f, - -0.3456257738201959f, - -0.34574860352308745f, - -0.3458714273016709f, - -0.345994245153841f, - -0.3461170570774931f, - -0.3462398630705229f, - -0.34636266313082537f, - -0.34648545725629804f, - -0.34660824544483604f, - -0.34673102769433534f, - -0.34685380400269133f, - -0.34697657436780194f, - -0.34709933878756266f, - -0.34722209725987f, - -0.34734484978262015f, - -0.34746759635371005f, - -0.34759033697103703f, - -0.3477130716324975f, - -0.34783580033598793f, - -0.34795852307940595f, - -0.3480812398606491f, - -0.34820395067761384f, - -0.34832665552819836f, - -0.34844935441029934f, - -0.3485720473218151f, - -0.3486947342606427f, - -0.34881741522468057f, - -0.3489400902118263f, - -0.34906275921997704f, - -0.34918542224703253f, - -0.34930807929089014f, - -0.34943073034944816f, - -0.34955337542060416f, - -0.3496760145022584f, - -0.3497986475923086f, - -0.3499212746886534f, - -0.35004389578919093f, - -0.3501665108918217f, - -0.3502891199944439f, - -0.35041172309495666f, - -0.35053432019125924f, - -0.3506569112812501f, - -0.35077949636283035f, - -0.3509020754338987f, - -0.3510246484923547f, - -0.35114721553609746f, - -0.3512697765630283f, - -0.3513923315710465f, - -0.35151488055805197f, - -0.35163742352194416f, - -0.35175996046062485f, - -0.3518824913719937f, - -0.3520050162539511f, - -0.35212753510439765f, - -0.3522500479212332f, - -0.3523725547023602f, - -0.3524950554456786f, - -0.3526175501490895f, - -0.3527400388104931f, - -0.3528625214277923f, - -0.3529849979988875f, - -0.3531074685216797f, - -0.3532299329940708f, - -0.35335239141396285f, - -0.35347484377925714f, - -0.3535972900878551f, - -0.3537197303376594f, - -0.3538421645265713f, - -0.35396459265249325f, - -0.354087014713328f, - -0.3542094307069774f, - -0.3543318406313435f, - -0.35445424448432916f, - -0.3545766422638376f, - -0.354699033967771f, - -0.35482141959403235f, - -0.35494379914052365f, - -0.3550661726051497f, - -0.35518853998581285f, - -0.35531090128041626f, - -0.3554332564868625f, - -0.3555556056030569f, - -0.3556779486269019f, - -0.3558002855563014f, - -0.3559226163891583f, - -0.35604494112337814f, - -0.35616725975686414f, - -0.35628957228752034f, - -0.356411878713251f, - -0.35653417903195955f, - -0.3566564732415521f, - -0.3567787613399323f, - -0.3569010433250049f, - -0.3570233191946736f, - -0.3571455889468451f, - -0.3572678525794234f, - -0.3573901100903135f, - -0.3575123614774199f, - -0.35763460673864933f, - -0.3577568458719064f, - -0.35787907887509657f, - -0.358001305746125f, - -0.3581235264828978f, - -0.3582457410833211f, - -0.35836794954530043f, - -0.3584901518667413f, - -0.35861234804555037f, - -0.35873453807963407f, - -0.358856721966898f, - -0.3589788997052493f, - -0.3591010712925938f, - -0.35922323672683887f, - -0.3593453960058904f, - -0.359467549127656f, - -0.3595896960900423f, - -0.3597118368909555f, - -0.3598339715283044f, - -0.35995609999999534f, - -0.3600782223039358f, - -0.3602003384380324f, - -0.3603224484001943f, - -0.3604445521883284f, - -0.3605666498003425f, - -0.3606887412341444f, - -0.3608108264876414f, - -0.36093290555874313f, - -0.3610549784453571f, - -0.3611770451453915f, - -0.36129910565675405f, - -0.3614211599773548f, - -0.36154320810510165f, - -0.3616652500379033f, - -0.36178728577366775f, - -0.3619093153103056f, - -0.3620313386457252f, - -0.36215335577783553f, - -0.362275366704546f, - -0.3623973714237651f, - -0.36251936993340395f, - -0.3626413622313714f, - -0.362763348315577f, - -0.3628853281839298f, - -0.36300730183434143f, - -0.363129269264721f, - -0.36325123047297864f, - -0.36337318545702374f, - -0.3634951342147683f, - -0.3636170767441219f, - -0.3637390130429948f, - -0.36386094310929834f, - -0.3639828669409425f, - -0.364104784535839f, - -0.364226695891898f, - -0.3643486010070313f, - -0.3644704998791494f, - -0.3645923925061644f, - -0.3647142788859868f, - -0.36483615901652894f, - -0.36495803289570167f, - -0.36507990052141714f, - -0.36520176189158754f, - -0.3653236170041244f, - -0.36544546585693977f, - -0.365567308447945f, - -0.365689144775054f, - -0.36581097483617825f, - -0.36593279862923034f, - -0.3660546161521219f, - -0.3661764274027674f, - -0.3662982323790787f, - -0.36642003107896876f, - -0.3665418235003506f, - -0.3666636096411364f, - -0.3667853894992412f, - -0.3669071630725775f, - -0.3670289303590586f, - -0.36715069135659734f, - -0.367272446063109f, - -0.3673941944765065f, - -0.3675159365947038f, - -0.3676376724156139f, - -0.3677594019371527f, - -0.3678811251572334f, - -0.36800284207377054f, - -0.3681245526846783f, - -0.36824625698787056f, - -0.36836795498126346f, - -0.368489646662771f, - -0.36861133203030755f, - -0.3687330110817885f, - -0.3688546838151294f, - -0.36897635022824493f, - -0.36909801031904993f, - -0.36921966408546025f, - -0.3693413115253918f, - -0.36946295263675977f, - -0.3695845874174794f, - -0.3697062158654674f, - -0.3698278379786389f, - -0.3699494537549103f, - -0.3700710631921981f, - -0.3701926662884183f, - -0.37031426304148674f, - -0.37043585344932034f, - -0.37055743750983605f, - -0.37067901522095015f, - -0.3708005865805787f, - -0.37092215158664016f, - -0.3710437102370508f, - -0.37116526252972765f, - -0.37128680846258805f, - -0.37140834803354844f, - -0.371529881240528f, - -0.37165140808144337f, - -0.3717729285542123f, - -0.3718944426567517f, - -0.3720159503869811f, - -0.3721374517428177f, - -0.37225894672217963f, - -0.37238043532298426f, - -0.37250191754315154f, - -0.3726233933805991f, - -0.3727448628332454f, - -0.3728663258990093f, - -0.37298778257580856f, - -0.3731092328615638f, - -0.3732306767541931f, - -0.3733521142516156f, - -0.3734735453517496f, - -0.3735949700525162f, - -0.3737163883518339f, - -0.3738378002476222f, - -0.37395920573780045f, - -0.3740806048202887f, - -0.37420199749300725f, - -0.3743233837538757f, - -0.3744447636008137f, - -0.3745661370317418f, - -0.37468750404458073f, - -0.3748088646372501f, - -0.3749302188076713f, - -0.37505156655376404f, - -0.3751729078734499f, - -0.37529424276464896f, - -0.37541557122528296f, - -0.3755368932532726f, - -0.37565820884653817f, - -0.3757795180030027f, - -0.3759008207205866f, - -0.3760221169972116f, - -0.37614340683079833f, - -0.3762646902192703f, - -0.37638596716054834f, - -0.3765072376525546f, - -0.3766285016932102f, - -0.376749759280439f, - -0.3768710104121625f, - -0.376992255086303f, - -0.3771134933007831f, - -0.3772347250535245f, - -0.3773559503424517f, - -0.37747716916548657f, - -0.37759838152055214f, - -0.37771958740557066f, - -0.3778407868184669f, - -0.37796197975716334f, - -0.3780831662195833f, - -0.3782043462036496f, - -0.37832551970728745f, - -0.3784466867284197f, - -0.37856784726497017f, - -0.37868900131486294f, - -0.3788101488760211f, - -0.37893128994637054f, - -0.37905242452383464f, - -0.37917355260633795f, - -0.37929467419180396f, - -0.37941578927815905f, - -0.3795368978633271f, - -0.3796579999452326f, - -0.37977909552180117f, - -0.37990018459095715f, - -0.3800212671506265f, - -0.3801423431987337f, - -0.38026341273320496f, - -0.380384475751965f, - -0.38050553225293976f, - -0.38062658223405543f, - -0.3807476256932375f, - -0.3808686626284114f, - -0.3809896930375037f, - -0.38111071691844095f, - -0.38123173426914897f, - -0.3813527450875543f, - -0.3814737493715825f, - -0.38159474711916186f, - -0.38171573832821837f, - -0.3818367229966788f, - -0.38195770112246935f, - -0.3820786727035187f, - -0.3821996377377532f, - -0.38232059622310016f, - -0.38244154815748616f, - -0.38256249353884036f, - -0.38268343236508967f, - -0.3828043646341617f, - -0.3829252903439843f, - -0.38304620949248475f, - -0.38316712207759274f, - -0.38328802809723556f, - -0.3834089275493415f, - -0.38352982043183836f, - -0.3836507067426561f, - -0.38377158647972265f, - -0.38389245964096674f, - -0.38401332622431644f, - -0.3841341862277024f, - -0.3842550396490528f, - -0.3843758864862969f, - -0.3844967267373636f, - -0.38461756040018286f, - -0.38473838747268446f, - -0.38485920795279777f, - -0.3849800218384521f, - -0.38510082912757776f, - -0.38522162981810515f, - -0.3853424239079636f, - -0.3854632113950841f, - -0.38558399227739626f, - -0.38570476655283126f, - -0.38582553421931887f, - -0.3859462952747906f, - -0.3860670497171768f, - -0.38618779754440763f, - -0.3863085387544157f, - -0.3864292733451313f, - -0.3865500013144857f, - -0.3866707226604094f, - -0.3867914373808356f, - -0.386912145473695f, - -0.38703284693691936f, - -0.3871535417684404f, - -0.38727422996618927f, - -0.3873949115280997f, - -0.38751558645210293f, - -0.38763625473613134f, - -0.3877569163781164f, - -0.38787757137599227f, - -0.3879982197276907f, - -0.38811886143114455f, - -0.3882394964842857f, - -0.3883601248850488f, - -0.388480746631366f, - -0.38860136172117066f, - -0.3887219701523959f, - -0.38884257192297444f, - -0.38896316703084133f, - -0.3890837554739295f, - -0.38920433725017256f, - -0.38932491235750366f, - -0.3894454807938584f, - -0.38956604255717003f, - -0.3896865976453727f, - -0.3898071460564001f, - -0.3899276877881881f, - -0.3900482228386706f, - -0.39016875120578165f, - -0.390289272887457f, - -0.3904097878816307f, - -0.39053029618623863f, - -0.39065079779921497f, - -0.39077129271849587f, - -0.3908917809420158f, - -0.3910122624677107f, - -0.3911327372935165f, - -0.3912532054173685f, - -0.39137366683720215f, - -0.39149412155095376f, - -0.39161456955655977f, - -0.3917350108519559f, - -0.39185544543507844f, - -0.391975873303863f, - -0.3920962944562477f, - -0.3922167088901683f, - -0.3923371166035616f, - -0.39245751759436354f, - -0.3925779118605127f, - -0.3926982993999455f, - -0.392818680210599f, - -0.39293905429041054f, - -0.3930594216373167f, - -0.3931797822492567f, - -0.39330013612416737f, - -0.39342048325998646f, - -0.393540823654651f, - -0.3936611573061007f, - -0.39378148421227277f, - -0.39390180437110556f, - -0.3940221177805365f, - -0.3941424244385057f, - -0.39426272434295095f, - -0.394383017491811f, - -0.3945033038830245f, - -0.3946235835145297f, - -0.3947438563842672f, - -0.3948641224901754f, - -0.3949843818301931f, - -0.3951046344022601f, - -0.3952248802043164f, - -0.3953451192343011f, - -0.3954653514901536f, - -0.39558557696981417f, - -0.3957057956712231f, - -0.3958260075923198f, - -0.39594621273104513f, - -0.39606641108533913f, - -0.3961866026531417f, - -0.39630678743239395f, - -0.39642696542103684f, - -0.39654713661701074f, - -0.3966673010182562f, - -0.39678745862271464f, - -0.3969076094283276f, - -0.3970277534330358f, - -0.39714789063478f, - -0.39726802103150316f, - -0.39738814462114613f, - -0.3975082614016506f, - -0.39762837137095836f, - -0.3977484745270106f, - -0.397868570867751f, - -0.39798866039112096f, - -0.3981087430950627f, - -0.3982288189775179f, - -0.3983488880364307f, - -0.3984689502697429f, - -0.3985890056753973f, - -0.3987090542513359f, - -0.3988290959955034f, - -0.39894913090584216f, - -0.39906915898029527f, - -0.3991891802168062f, - -0.39930919461331754f, - -0.39942920216777456f, - -0.39954920287812007f, - -0.3996691967422979f, - -0.39978918375825123f, - -0.3999091639239258f, - -0.4000291372372648f, - -0.4001491036962126f, - -0.4002690632987132f, - -0.4003890160427116f, - -0.40050896192615276f, - -0.4006289009469806f, - -0.4007488331031409f, - -0.40086875839257785f, - -0.4009886768132373f, - -0.4011085883630637f, - -0.4012284930400032f, - -0.40134839084200047f, - -0.4014682817670019f, - -0.40158816581295237f, - -0.4017080429777985f, - -0.40182791325948586f, - -0.40194777665595965f, - -0.4020676331651677f, - -0.4021874827850555f, - -0.4023073255135694f, - -0.4024271613486552f, - -0.40254699028826113f, - -0.4026668123303331f, - -0.402786627472818f, - -0.4029064357136621f, - -0.40302623705081403f, - -0.40314603148222034f, - -0.40326581900582825f, - -0.4033855996195853f, - -0.4035053733214383f, - -0.4036251401093366f, - -0.4037448999812271f, - -0.4038646529350578f, - -0.403984398968776f, - -0.40410413808033147f, - -0.4042238702676717f, - -0.40434359552874516f, - -0.4044633138614995f, - -0.40458302526388507f, - -0.40470272973384974f, - -0.40482242726934253f, - -0.40494211786831236f, - -0.40506180152870763f, - -0.40518147824847917f, - -0.4053011480255755f, - -0.4054208108579462f, - -0.40554046674354f, - -0.40566011568030824f, - -0.40577975766620006f, - -0.4058993926991649f, - -0.40601902077715374f, - -0.40613864189811594f, - -0.40625825606000265f, - -0.40637786326076347f, - -0.4064974634983498f, - -0.4066170567707115f, - -0.4067366430757998f, - -0.406856222411566f, - -0.4069757947759608f, - -0.4070953601669348f, - -0.40721491858243986f, - -0.4073344700204277f, - -0.40745401447884944f, - -0.4075735519556567f, - -0.4076930824488005f, - -0.4078126059562342f, - -0.4079321224759091f, - -0.4080516320057773f, - -0.4081711345437902f, - -0.40829063008790184f, - -0.4084101186360638f, - -0.40852960018622875f, - -0.40864907473634854f, - -0.40876854228437765f, - -0.4088880028282682f, - -0.4090074563659733f, - -0.4091269028954461f, - -0.4092463424146392f, - -0.40936577492150755f, - -0.409485200414004f, - -0.4096046188900821f, - -0.40972403034769495f, - -0.409843434784798f, - -0.40996283219934454f, - -0.4100822225892887f, - -0.410201605952584f, - -0.41032098228718633f, - -0.4104403515910495f, - -0.4105597138621282f, - -0.41067906909837665f, - -0.41079841729775024f, - -0.41091775845820433f, - -0.4110370925776936f, - -0.411156419654173f, - -0.41127573968559816f, - -0.41139505266992504f, - -0.4115143586051085f, - -0.41163365748910496f, - -0.4117529493198699f, - -0.4118722340953589f, - -0.41199151181352844f, - -0.4121107824723351f, - -0.4122300460697349f, - -0.4123493026036834f, - -0.4124685520721388f, - -0.412587794473057f, - -0.4127070298043948f, - -0.41282625806410833f, - -0.41294547925015623f, - -0.41306469336049495f, - -0.4131839003930818f, - -0.41330310034587403f, - -0.41342229321682855f, - -0.41354147900390453f, - -0.41366065770505905f, - -0.4137798293182499f, - -0.4138989938414344f, - -0.41401815127257224f, - -0.4141373016096209f, - -0.41425644485053886f, - -0.41437558099328364f, - -0.41449471003581567f, - -0.4146138319760928f, - -0.41473294681207395f, - -0.41485205454171803f, - -0.4149711551629835f, - -0.4150902486738311f, - -0.41520933507221947f, - -0.415328414356108f, - -0.4154474865234556f, - -0.41556655157222355f, - -0.4156856095003709f, - -0.41580466030585767f, - -0.4159237039866431f, - -0.41604274054068896f, - -0.41616176996595494f, - -0.416280792260401f, - -0.41639980742198857f, - -0.41651881544867747f, - -0.41663781633842945f, - -0.4167568100892046f, - -0.4168757966989648f, - -0.41699477616567043f, - -0.4171137484872832f, - -0.41723271366176506f, - -0.41735167168707704f, - -0.41747062256118045f, - -0.4175895662820376f, - -0.4177085028476107f, - -0.41782743225586144f, - -0.41794635450475204f, - -0.41806526959224394f, - -0.4181841775163012f, - -0.4183030782748856f, - -0.41842197186595975f, - -0.4185408582874856f, - -0.41865973753742775f, - -0.4187786096137484f, - -0.41889747451441073f, - -0.419016332237378f, - -0.4191351827806128f, - -0.4192540261420803f, - -0.4193728623197433f, - -0.4194916913115656f, - -0.41961051311551034f, - -0.4197293277295431f, - -0.41984813515162717f, - -0.4199669353797269f, - -0.42008572841180586f, - -0.4202045142458301f, - -0.42032329287976355f, - -0.420442064311571f, - -0.42056082853921717f, - -0.4206795855606664f, - -0.4207983353738854f, - -0.4209170779768386f, - -0.42103581336749096f, - -0.4211545415438084f, - -0.42127326250375696f, - -0.421391976245302f, - -0.42151068276640896f, - -0.42162938206504424f, - -0.42174807413917437f, - -0.4218667589867648f, - -0.42198543660578264f, - -0.4221041069941941f, - -0.4222227701499653f, - -0.42234142607106334f, - -0.4224600747554556f, - -0.4225787162011086f, - -0.42269735040598866f, - -0.42281597736806464f, - -0.42293459708530307f, - -0.42305320955567144f, - -0.42317181477713656f, - -0.4232904127476677f, - -0.423409003465232f, - -0.42352758692779746f, - -0.42364616313333214f, - -0.4237647320798034f, - -0.42388329376518136f, - -0.4240018481874335f, - -0.4241203953445286f, - -0.42423893523443446f, - -0.4243574678551216f, - -0.42447599320455814f, - -0.42459451128071324f, - -0.4247130220815561f, - -0.4248315256050552f, - -0.4249500218491818f, - -0.4250685108119045f, - -0.4251869924911931f, - -0.4253054668850167f, - -0.4254239339913468f, - -0.42554239380815273f, - -0.42566084633340473f, - -0.42577929156507227f, - -0.42589772950112753f, - -0.42601616013954025f, - -0.42613458347828115f, - -0.42625299951532064f, - -0.4263714082486302f, - -0.4264898096761812f, - -0.4266082037959442f, - -0.4267265906058913f, - -0.42684497010399314f, - -0.4269633422882221f, - -0.42708170715654914f, - -0.42720006470694694f, - -0.4273184149373866f, - -0.4274367578458407f, - -0.4275550934302818f, - -0.42767342168868194f, - -0.4277917426190135f, - -0.4279100562192483f, - -0.42802836248736076f, - -0.4281466614213228f, - -0.4282649530191075f, - -0.4283832372786871f, - -0.4285015141980365f, - -0.4286197837751282f, - -0.4287380460079357f, - -0.42885630089443183f, - -0.42897454843259186f, - -0.4290927886203889f, - -0.429211021455797f, - -0.42932924693679014f, - -0.42944746506134185f, - -0.42956567582742805f, - -0.4296838792330225f, - -0.4298020752760997f, - -0.4299202639546337f, - -0.43003844526660084f, - -0.43015661920997544f, - -0.43027478578273265f, - -0.43039294498284675f, - -0.43051109680829486f, - -0.43062924125705165f, - -0.43074737832709276f, - -0.43086550801639384f, - -0.4309836303229301f, - -0.43110174524467904f, - -0.43121985277961605f, - -0.431337952925717f, - -0.43145604568095863f, - -0.43157413104331793f, - -0.43169220901077104f, - -0.4318102795812944f, - -0.4319283427528657f, - -0.4320463985234611f, - -0.4321644468910586f, - -0.43228248785363466f, - -0.43240052140916746f, - -0.4325185475556338f, - -0.4326365662910116f, - -0.4327545776132792f, - -0.4328725815204139f, - -0.4329905780103936f, - -0.43310856708119666f, - -0.4332265487308018f, - -0.4333445229571871f, - -0.43346248975833107f, - -0.4335804491322116f, - -0.43369840107680907f, - -0.43381634559010157f, - -0.4339342826700682f, - -0.4340522123146874f, - -0.4341701345219399f, - -0.4342880492898045f, - -0.4344059566162607f, - -0.4345238564992874f, - -0.43464174893686597f, - -0.43475963392697564f, - -0.4348775114675964f, - -0.4349953815567085f, - -0.43511324419229147f, - -0.43523109937232735f, - -0.43534894709479593f, - -0.4354667873576779f, - -0.43558462015895333f, - -0.43570244549660475f, - -0.4358202633686125f, - -0.43593807377295773f, - -0.4360558767076211f, - -0.4361736721705856f, - -0.43629146015983206f, - -0.43640924067334225f, - -0.4365270137090976f, - -0.43664477926508044f, - -0.4367625373392734f, - -0.4368802879296583f, - -0.4369980310342171f, - -0.43711576665093266f, - -0.43723349477778806f, - -0.4373512154127652f, - -0.4374689285538479f, - -0.43758663419901866f, - -0.43770433234626027f, - -0.4378220229935564f, - -0.4379397061388908f, - -0.4380573817802467f, - -0.4381750499156069f, - -0.4382927105429568f, - -0.4384103636602795f, - -0.4385280092655591f, - -0.4386456473567789f, - -0.4387632779319249f, - -0.4388809009889806f, - -0.43899851652593064f, - -0.43911612454075966f, - -0.4392337250314518f, - -0.4393513179959935f, - -0.43946890343236905f, - -0.43958648133856365f, - -0.4397040517125619f, - -0.43982161455235075f, - -0.4399391698559151f, - -0.4400567176212406f, - -0.44017425784631237f, - -0.44029179052911793f, - -0.44040931566764263f, - -0.44052683325987263f, - -0.44064434330379443f, - -0.4407618457973936f, - -0.4408793407386584f, - -0.4409968281255749f, - -0.4411143079561298f, - -0.44123178022830944f, - -0.4413492449401025f, - -0.4414667020894955f, - -0.44158415167447584f, - -0.44170159369303025f, - -0.441819028143148f, - -0.44193645502281603f, - -0.4420538743300219f, - -0.44217128606275447f, - -0.4422886902190011f, - -0.4424060867967509f, - -0.44252347579399154f, - -0.4426408572087124f, - -0.44275823103890133f, - -0.44287559728254755f, - -0.4429929559376405f, - -0.44311030700216886f, - -0.4432276504741214f, - -0.44334498635148784f, - -0.44346231463225816f, - -0.4435796353144215f, - -0.4436969483959676f, - -0.44381425387488566f, - -0.4439315517491671f, - -0.4440488420168014f, - -0.4441661246757787f, - -0.44428339972408865f, - -0.4444006671597234f, - -0.4445179269806728f, - -0.44463517918492756f, - -0.44475242377047863f, - -0.4448696607353163f, - -0.44498689007743336f, - -0.44510411179482023f, - -0.4452213258854684f, - -0.4453385323473687f, - -0.4454557311785143f, - -0.4455729223768963f, - -0.4456901059405066f, - -0.44580728186733665f, - -0.44592445015538007f, - -0.44604161080262855f, - -0.44615876380707453f, - -0.4462759091667106f, - -0.4463930468795288f, - -0.4465101769435235f, - -0.44662729935668694f, - -0.4467444141170119f, - -0.44686152122249195f, - -0.44697862067112104f, - -0.44709571246089214f, - -0.4472127965897987f, - -0.4473298730558347f, - -0.44744694185699463f, - -0.4475640029912717f, - -0.44768105645666084f, - -0.44779810225115607f, - -0.44791514037275143f, - -0.4480321708194418f, - -0.4481491935892224f, - -0.44826620868008765f, - -0.4483832160900317f, - -0.44850021581705124f, - -0.44861720785914083f, - -0.4487341922142957f, - -0.44885116888051063f, - -0.4489681378557829f, - -0.44908509913810735f, - -0.44920205272547997f, - -0.44931899861589675f, - -0.4494359368073531f, - -0.44955286729784694f, - -0.4496697900853738f, - -0.4497867051679303f, - -0.4499036125435123f, - -0.4500205122101183f, - -0.4501374041657444f, - -0.4502542884083876f, - -0.4503711649360453f, - -0.4504880337467139f, - -0.4506048948383926f, - -0.4507217482090781f, - -0.4508385938567683f, - -0.4509554317794601f, - -0.45107226197515327f, - -0.4511890844418451f, - -0.45130589917753383f, - -0.4514227061802171f, - -0.45153950544789506f, - -0.45165629697856563f, - -0.4517730807702275f, - -0.45188985682087934f, - -0.4520066251285205f, - -0.45212338569115074f, - -0.4522401385067685f, - -0.452356883573374f, - -0.45247362088896614f, - -0.4525903504515454f, - -0.4527070722591109f, - -0.45282378630966347f, - -0.45294049260120234f, - -0.45305719113172827f, - -0.45317388189924196f, - -0.4532905649017437f, - -0.453407240137234f, - -0.453523907603713f, - -0.4536405672991831f, - -0.4537572192216447f, - -0.4538738633690989f, - -0.45399049973954625f, - -0.4541071283309899f, - -0.45422374914143054f, - -0.45434036216886997f, - -0.45445696741130925f, - -0.45457356486675193f, - -0.4546901545331994f, - -0.45480673640865393f, - -0.4549233104911179f, - -0.45503987677859303f, - -0.4551564352690836f, - -0.4552729859605917f, - -0.45538952885112005f, - -0.45550606393867116f, - -0.45562259122124965f, - -0.4557391106968582f, - -0.45585562236350013f, - -0.4559721262191792f, - -0.4560886222618983f, - -0.4562051104896628f, - -0.45632159090047597f, - -0.456438063492342f, - -0.4565545282632643f, - -0.45667098521124894f, - -0.4567874343342996f, - -0.45690387563042056f, - -0.4570203090976171f, - -0.45713673473389443f, - -0.4572531525372574f, - -0.4573695625057107f, - -0.4574859646372605f, - -0.45760235892991147f, - -0.4577187453816697f, - -0.45783512399054127f, - -0.4579514947545317f, - -0.4580678576716465f, - -0.4581842127398924f, - -0.4583005599572759f, - -0.45841689932180324f, - -0.45853323083148f, - -0.45864955448431455f, - -0.45876587027831284f, - -0.4588821782114819f, - -0.4589984782818288f, - -0.45911477048736005f, - -0.4592310548260845f, - -0.4593473312960089f, - -0.45946359989514085f, - -0.45957986062148737f, - -0.45969611347305794f, - -0.4598123584478598f, - -0.4599285955439011f, - -0.4600448247591894f, - -0.4601610460917347f, - -0.46027725953954474f, - -0.46039346510062834f, - -0.4605096627729943f, - -0.4606258525546508f, - -0.46074203444360856f, - -0.460858208437876f, - -0.4609743745354626f, - -0.461090532734377f, - -0.46120668303263046f, - -0.46132282542823205f, - -0.46143895991919165f, - -0.4615550865035185f, - -0.4616712051792245f, - -0.4617873159443191f, - -0.46190341879681274f, - -0.4620195137347158f, - -0.4621356007560392f, - -0.4622516798587944f, - -0.46236775104099154f, - -0.46248381430064256f, - -0.462599869635758f, - -0.46271591704435f, - -0.4628319565244294f, - -0.46294798807400867f, - -0.46306401169109923f, - -0.4631800273737126f, - -0.4632960351198614f, - -0.4634120349275582f, - -0.463528026794815f, - -0.46364401071964345f, - -0.4637599867000578f, - -0.4638759547340701f, - -0.46399191481969326f, - -0.4641078669549395f, - -0.4642238111378236f, - -0.46433974736635814f, - -0.46445567563855655f, - -0.4645715959524324f, - -0.4646875083059987f, - -0.4648034126972709f, - -0.46491930912426216f, - -0.4650351975849867f, - -0.4651510780774579f, - -0.4652669505996919f, - -0.46538281514970237f, - -0.4654986717255041f, - -0.46561452032511097f, - -0.46573036094653963f, - -0.4658461935878044f, - -0.46596201824692046f, - -0.46607783492190324f, - -0.4661936436107675f, - -0.4663094443115304f, - -0.4664252370222069f, - -0.46654102174081297f, - -0.4666567984653639f, - -0.4667725671938775f, - -0.4668883279243692f, - -0.46700408065485555f, - -0.4671198253833524f, - -0.467235562107878f, - -0.46735129082644844f, - -0.4674670115370804f, - -0.4675827242377918f, - -0.4676984289265992f, - -0.4678141256015207f, - -0.4679298142605732f, - -0.4680454949017751f, - -0.4681611675231435f, - -0.4682768321226968f, - -0.46839248869845346f, - -0.4685081372484314f, - -0.46862377777064895f, - -0.46873941026312393f, - -0.4688550347238765f, - -0.46897065115092473f, - -0.46908625954228755f, - -0.46920185989598323f, - -0.4693174522100326f, - -0.4694330364824542f, - -0.4695486127112676f, - -0.4696641808944916f, - -0.46977974103014747f, - -0.4698952931162544f, - -0.4700108371508324f, - -0.47012637313190175f, - -0.4702419010574819f, - -0.4703574209255949f, - -0.47047293273426055f, - -0.4705884364814996f, - -0.4707039321653322f, - -0.47081941978378083f, - -0.4709348993348659f, - -0.47105037081660867f, - -0.47116583422702984f, - -0.4712812895641525f, - -0.47139673682599764f, - -0.471512176010587f, - -0.4716276071159426f, - -0.4717430301400858f, - -0.4718584450810404f, - -0.47197385193682806f, - -0.4720892507054708f, - -0.47220464138499185f, - -0.4723200239734143f, - -0.47243539846876076f, - -0.4725507648690539f, - -0.4726661231723174f, - -0.47278147337657483f, - -0.4728968154798492f, - -0.4730121494801647f, - -0.47312747537554484f, - -0.4732427931640131f, - -0.4733581028435939f, - -0.473473404412312f, - -0.47358869786819113f, - -0.47370398320925516f, - -0.4738192604335302f, - -0.47393452953904014f, - -0.47404979052380997f, - -0.47416504338586396f, - -0.4742802881232288f, - -0.4743955247339291f, - -0.4745107532159902f, - -0.4746259735674377f, - -0.4747411857862966f, - -0.47485638987059436f, - -0.47497158581835613f, - -0.4750867736276081f, - -0.47520195329637577f, - -0.4753171248226872f, - -0.475432288204568f, - -0.47554744344004507f, - -0.47566259052714516f, - -0.47577772946389446f, - -0.47589286024832167f, - -0.4760079828784533f, - -0.4761230973523168f, - -0.4762382036679388f, - -0.4763533018233486f, - -0.47646839181657336f, - -0.4765834736456409f, - -0.4766985473085786f, - -0.4768136128034162f, - -0.47692867012818146f, - -0.4770437192809028f, - -0.4771587602596084f, - -0.47727379306232764f, - -0.47738881768708974f, - -0.47750383413192304f, - -0.4776188423948575f, - -0.47773384247392175f, - -0.4778488343671461f, - -0.4779638180725594f, - -0.4780787935881921f, - -0.4781937609120735f, - -0.478308720042234f, - -0.4784236709767042f, - -0.478538613713514f, - -0.478653548250694f, - -0.4787684745862739f, - -0.4788833927182862f, - -0.4789983026447609f, - -0.4791132043637291f, - -0.47922809787322124f, - -0.4793429831712701f, - -0.4794578602559065f, - -0.47957272912516197f, - -0.4796875897770675f, - -0.47980244220965657f, - -0.4799172864209604f, - -0.48003212240901116f, - -0.4801469501718412f, - -0.48026176970748224f, - -0.48037658101396835f, - -0.48049138408933156f, - -0.4806061789316047f, - -0.48072096553881993f, - -0.4808357439090122f, - -0.48095051404021383f, - -0.48106527593045834f, - -0.48118002957777933f, - -0.4812947749802097f, - -0.4814095121357849f, - -0.4815242410425382f, - -0.48163896169850373f, - -0.481753674101715f, - -0.48186837825020795f, - -0.48198307414201647f, - -0.4820977617751748f, - -0.4822124411477182f, - -0.48232711225768216f, - -0.4824417751031013f, - -0.4825564296820106f, - -0.48267107599244624f, - -0.48278571403244297f, - -0.48290034380003694f, - -0.4830149652932644f, - -0.48312957851016086f, - -0.4832441834487622f, - -0.4833587801071049f, - -0.483473368483226f, - -0.48358794857516146f, - -0.48370252038094735f, - -0.483817083898622f, - -0.48393163912622156f, - -0.4840461860617833f, - -0.48416072470334437f, - -0.4842752550489415f, - -0.4843897770966137f, - -0.4845042908443979f, - -0.484618796290332f, - -0.4847332934324532f, - -0.4848477822688011f, - -0.4849622627974133f, - -0.4850767350163281f, - -0.4851911989235833f, - -0.48530565451721924f, - -0.48542010179527384f, - -0.48553454075578617f, - -0.4856489713967953f, - -0.4857633937163397f, - -0.4858778077124604f, - -0.48599221338319615f, - -0.48610661072658656f, - -0.4862209997406708f, - -0.48633538042349034f, - -0.4864497527730845f, - -0.48656411678749356f, - -0.48667847246475715f, - -0.4867928198029174f, - -0.4869071588000142f, - -0.48702148945408835f, - -0.4871358117631805f, - -0.4872501257253321f, - -0.4873644313385848f, - -0.4874787286009793f, - -0.4875930175105578f, - -0.48770729806536134f, - -0.4878215702634324f, - -0.4879358341028124f, - -0.48805008958154394f, - -0.4881643366976691f, - -0.48827857544922953f, - -0.4883928058342692f, - -0.48850702785083006f, - -0.488621241496955f, - -0.4887354467706862f, - -0.48884964367006833f, - -0.4889638321931439f, - -0.4890780123379563f, - -0.4891921841025483f, - -0.48930634748496515f, - -0.48942050248325f, - -0.48953464909544664f, - -0.48964878731959943f, - -0.4897629171537517f, - -0.4898770385959495f, - -0.48999115164423657f, - -0.49010525629665763f, - -0.4902193525512568f, - -0.4903334404060805f, - -0.49044751985917323f, - -0.4905615909085802f, - -0.49067565355234605f, - -0.49078970778851794f, - -0.49090375361514077f, - -0.4910177910302604f, - -0.4911318200319228f, - -0.4912458406181734f, - -0.49135985278706f, - -0.49147385653662834f, - -0.4915878518649248f, - -0.49170183876999557f, - -0.4918158172498889f, - -0.4919297873026511f, - -0.49204374892632885f, - -0.4921577021189699f, - -0.4922716468786221f, - -0.4923855832033326f, - -0.4924995110911488f, - -0.4926134305401193f, - -0.4927273415482914f, - -0.49284124411371355f, - -0.4929551382344346f, - -0.49306902390850244f, - -0.49318290113396546f, - -0.49329676990887267f, - -0.49341063023127335f, - -0.49352448209921623f, - -0.49363832551075043f, - -0.4937521604639245f, - -0.4938659869567895f, - -0.4939798049873942f, - -0.4940936145537884f, - -0.49420741565402126f, - -0.49432120828614434f, - -0.494434992448207f, - -0.4945487681382597f, - -0.49466253535435206f, - -0.49477629409453633f, - -0.49489004435686246f, - -0.49500378613938134f, - -0.4951175194401441f, - -0.49523124425720116f, - -0.4953449605886054f, - -0.49545866843240755f, - -0.4955723677866593f, - -0.4956860586494116f, - -0.49579974101871804f, - -0.49591341489262986f, - -0.4960270802691992f, - -0.49614073714647783f, - -0.4962543855225197f, - -0.49636802539537683f, - -0.49648165676310185f, - -0.49659527962374744f, - -0.4967088939753671f, - -0.49682249981601445f, - -0.4969360971437425f, - -0.4970496859566043f, - -0.4971632662526541f, - -0.497276838029946f, - -0.49739040128653367f, - -0.49750395602047076f, - -0.49761750222981194f, - -0.4977310399126121f, - -0.497844569066925f, - -0.497958089690806f, - -0.4980716017823097f, - -0.4981851053394907f, - -0.49829860036040446f, - -0.4984120868431068f, - -0.49852556478565263f, - -0.4986390341860968f, - -0.49875249504249664f, - -0.4988659473529072f, - -0.49897939111538453f, - -0.4990928263279848f, - -0.49920625298876353f, - -0.4993196710957788f, - -0.49943308064708636f, - -0.499546481640743f, - -0.49965987407480494f, - -0.49977325794733063f, - -0.49988663325637656f, - -0.5000000000000001f, - -0.500113358176258f, - -0.5002267077832093f, - -0.5003400488189111f, - -0.5004533812814215f, - -0.5005667051687983f, - -0.500680020479099f, - -0.5007933272103837f, - -0.50090662536071f, - -0.5010199149281366f, - -0.5011331959107215f, - -0.5012464683065253f, - -0.5013597321136062f, - -0.5014729873300237f, - -0.5015862339538361f, - -0.5016994719831047f, - -0.5018127014158884f, - -0.5019259222502471f, - -0.5020391344842403f, - -0.5021523381159285f, - -0.5022655331433725f, - -0.5023787195646319f, - -0.502491897377768f, - -0.5026050665808408f, - -0.5027182271719121f, - -0.5028313791490419f, - -0.5029445225102922f, - -0.5030576572537236f, - -0.503170783377398f, - -0.5032839008793774f, - -0.5033970097577231f, - -0.503510110010497f, - -0.5036232016357604f, - -0.503736284631577f, - -0.5038493589960086f, - -0.5039624247271175f, - -0.5040754818229657f, - -0.5041885302816174f, - -0.5043015701011349f, - -0.5044146012795812f, - -0.5045276238150187f, - -0.5046406377055126f, - -0.5047536429491254f, - -0.504866639543921f, - -0.504979627487963f, - -0.5050926067793149f, - -0.5052055774160421f, - -0.5053185393962082f, - -0.5054314927178777f, - -0.5055444373791144f, - -0.5056573733779843f, - -0.5057703007125519f, - -0.505883219380882f, - -0.5059961293810399f, - -0.5061090307110899f, - -0.5062219233690992f, - -0.5063348073531326f, - -0.506447682661256f, - -0.5065605492915343f, - -0.5066734072420351f, - -0.5067862565108241f, - -0.5068990970959671f, - -0.507011928995531f, - -0.5071247522075829f, - -0.5072375667301892f, - -0.5073503725614164f, - -0.5074631696993324f, - -0.5075759581420036f, - -0.507688737887498f, - -0.5078015089338834f, - -0.5079142712792272f, - -0.5080270249215967f, - -0.5081397698590604f, - -0.5082525060896869f, - -0.5083652336115438f, - -0.5084779524226992f, - -0.508590662521223f, - -0.5087033639051831f, - -0.5088160565726485f, - -0.5089287405216883f, - -0.5090414157503709f, - -0.5091540822567671f, - -0.5092667400389456f, - -0.509379389094976f, - -0.5094920294229276f, - -0.5096046610208717f, - -0.5097172838868774f, - -0.5098298980190153f, - -0.5099425034153549f, - -0.5100551000739681f, - -0.5101676879929251f, - -0.5102802671702965f, - -0.5103928376041534f, - -0.5105053992925662f, - -0.5106179522336076f, - -0.5107304964253484f, - -0.5108430318658601f, - -0.5109555585532136f, - -0.5110680764854826f, - -0.511180585660738f, - -0.5112930860770523f, - -0.5114055777324973f, - -0.5115180606251458f, - -0.511630534753071f, - -0.5117430001143451f, - -0.5118554567070408f, - -0.5119679045292316f, - -0.512080343578991f, - -0.5121927738543917f, - -0.5123051953535079f, - -0.5124176080744127f, - -0.5125300120151806f, - -0.5126424071738848f, - -0.5127547935486002f, - -0.5128671711374008f, - -0.5129795399383602f, - -0.5130918999495545f, - -0.5132042511690577f, - -0.5133165935949447f, - -0.5134289272252899f, - -0.5135412520581698f, - -0.5136535680916591f, - -0.5137658753238332f, - -0.5138781737527672f, - -0.5139904633765382f, - -0.5141027441932216f, - -0.5142150162008933f, - -0.5143272793976296f, - -0.5144395337815061f, - -0.5145517793506009f, - -0.5146640161029901f, - -0.5147762440367504f, - -0.5148884631499581f, - -0.5150006734406918f, - -0.5151128749070281f, - -0.5152250675470443f, - -0.5153372513588176f, - -0.515449426340427f, - -0.5155615924899498f, - -0.515673749805464f, - -0.5157858982850477f, - -0.5158980379267787f, - -0.516010168728737f, - -0.5161222906890004f, - -0.5162344038056478f, - -0.5163465080767574f, - -0.5164586035004098f, - -0.5165706900746836f, - -0.5166827677976578f, - -0.5167948366674123f, - -0.5169068966820274f, - -0.5170189478395824f, - -0.517130990138157f, - -0.5172430235758322f, - -0.5173550481506876f, - -0.517467063860804f, - -0.5175790707042623f, - -0.5176910686791432f, - -0.5178030577835271f, - -0.5179150380154954f, - -0.51802700937313f, - -0.5181389718545116f, - -0.518250925457722f, - -0.5183628701808419f, - -0.518474806021955f, - -0.5185867329791423f, - -0.518698651050486f, - -0.5188105602340677f, - -0.5189224605279713f, - -0.5190343519302789f, - -0.5191462344390729f, - -0.5192581080524359f, - -0.5193699727684521f, - -0.5194818285852042f, - -0.5195936755007754f, - -0.5197055135132495f, - -0.5198173426207091f, - -0.5199291628212399f, - -0.5200409741129248f, - -0.5201527764938483f, - -0.5202645699620936f, - -0.5203763545157468f, - -0.5204881301528917f, - -0.5205998968716132f, - -0.5207116546699955f, - -0.5208234035461248f, - -0.5209351434980859f, - -0.521046874523964f, - -0.5211585966218443f, - -0.5212703097898128f, - -0.5213820140259559f, - -0.5214937093283589f, - -0.5216053956951078f, - -0.521717073124289f, - -0.5218287416139896f, - -0.5219404011622953f, - -0.5220520517672936f, - -0.5221636934270707f, - -0.5222753261397144f, - -0.522386949903311f, - -0.5224985647159487f, - -0.5226101705757148f, - -0.5227217674806963f, - -0.5228333554289816f, - -0.522944934418659f, - -0.5230565044478162f, - -0.5231680655145406f, - -0.5232796176169225f, - -0.5233911607530495f, - -0.5235026949210102f, - -0.5236142201188938f, - -0.5237257363447885f, - -0.5238372435967849f, - -0.5239487418729715f, - -0.5240602311714381f, - -0.5241717114902734f, - -0.5242831828275688f, - -0.5243946451814135f, - -0.5245060985498977f, - -0.5246175429311108f, - -0.5247289783231448f, - -0.5248404047240895f, - -0.5249518221320357f, - -0.5250632305450742f, - -0.5251746299612954f, - -0.5252860203787919f, - -0.5253974017956544f, - -0.5255087742099743f, - -0.5256201376198426f, - -0.5257314920233526f, - -0.5258428374185955f, - -0.5259541738036635f, - -0.526065501176648f, - -0.5261768195356431f, - -0.5262881288787404f, - -0.5263994292040326f, - -0.526510720509613f, - -0.5266220027935742f, - -0.52673327605401f, - -0.526844540289013f, - -0.5269557954966775f, - -0.5270670416750964f, - -0.5271782788223645f, - -0.5272895069365747f, - -0.527400726015822f, - -0.5275119360582f, - -0.5276231370618035f, - -0.5277343290247275f, - -0.5278455119450663f, - -0.5279566858209149f, - -0.5280678506503675f, - -0.5281790064315209f, - -0.5282901531624699f, - -0.5284012908413096f, - -0.5285124194661353f, - -0.5286235390350442f, - -0.5287346495461316f, - -0.5288457509974935f, - -0.5289568433872258f, - -0.5290679267134261f, - -0.5291790009741905f, - -0.5292900661676155f, - -0.5294011222917984f, - -0.5295121693448352f, - -0.5296232073248249f, - -0.529734236229864f, - -0.5298452560580501f, - -0.5299562668074801f, - -0.5300672684762533f, - -0.5301782610624672f, - -0.5302892445642198f, - -0.5304002189796094f, - -0.5305111843067338f, - -0.5306221405436932f, - -0.5307330876885855f, - -0.5308440257395097f, - -0.5309549546945642f, - -0.5310658745518498f, - -0.5311767853094651f, - -0.5312876869655093f, - -0.5313985795180826f, - -0.5315094629652851f, - -0.5316203373052165f, - -0.5317312025359767f, - -0.5318420586556668f, - -0.5319529056623865f, - -0.5320637435542369f, - -0.5321745723293192f, - -0.532285391985734f, - -0.5323962025215819f, - -0.5325070039349649f, - -0.5326177962239844f, - -0.532728579386742f, - -0.5328393534213385f, - -0.5329501183258775f, - -0.53306087409846f, - -0.5331716207371886f, - -0.5332823582401655f, - -0.5333930866054925f, - -0.5335038058312738f, - -0.5336145159156115f, - -0.5337252168566086f, - -0.5338359086523676f, - -0.5339465913009933f, - -0.5340572648005883f, - -0.5341679291492565f, - -0.5342785843451008f, - -0.5343892303862265f, - -0.5344998672707372f, - -0.5346104949967371f, - -0.5347211135623305f, - -0.5348317229656214f, - -0.534942323204716f, - -0.5350529142777184f, - -0.5351634961827336f, - -0.5352740689178662f, - -0.5353846324812229f, - -0.5354951868709087f, - -0.535605732085029f, - -0.5357162681216895f, - -0.5358267949789964f, - -0.5359373126550564f, - -0.5360478211479752f, - -0.5361583204558591f, - -0.5362688105768151f, - -0.5363792915089503f, - -0.5364897632503707f, - -0.5366002257991844f, - -0.5367106791534979f, - -0.5368211233114192f, - -0.5369315582710552f, - -0.5370419840305144f, - -0.5371524005879044f, - -0.5372628079413322f, - -0.5373732060889078f, - -0.5374835950287387f, - -0.5375939747589333f, - -0.5377043452775998f, - -0.5378147065828482f, - -0.537925058672787f, - -0.5380354015455252f, - -0.5381457351991714f, - -0.5382560596318365f, - -0.5383663748416296f, - -0.5384766808266602f, - -0.5385869775850384f, - -0.5386972651148735f, - -0.5388075434142772f, - -0.5389178124813592f, - -0.5390280723142301f, - -0.5391383229109998f, - -0.5392485642697809f, - -0.5393587963886833f, - -0.5394690192658186f, - -0.5395792328992972f, - -0.5396894372872322f, - -0.5397996324277345f, - -0.5399098183189159f, - -0.5400199949588884f, - -0.5401301623457635f, - -0.5402403204776549f, - -0.5403504693526744f, - -0.5404606089689346f, - -0.5405707393245475f, - -0.5406808604176275f, - -0.540790972246287f, - -0.5409010748086391f, - -0.5410111681027977f, - -0.5411212521268757f, - -0.5412313268789876f, - -0.5413413923572465f, - -0.5414514485597675f, - -0.5415614954846636f, - -0.5416715331300499f, - -0.5417815614940411f, - -0.5418915805747517f, - -0.542001590370296f, - -0.5421115908787896f, - -0.5422215820983478f, - -0.5423315640270858f, - -0.5424415366631189f, - -0.5425515000045621f, - -0.5426614540495326f, - -0.5427713987961458f, - -0.5428813342425176f, - -0.5429912603867637f, - -0.543101177227002f, - -0.5432110847613484f, - -0.5433209829879195f, - -0.5434308719048317f, - -0.5435407515102034f, - -0.5436506218021513f, - -0.5437604827787925f, - -0.5438703344382448f, - -0.5439801767786252f, - -0.5440900097980529f, - -0.5441998334946452f, - -0.5443096478665205f, - -0.5444194529117962f, - -0.5445292486285924f, - -0.5446390350150271f, - -0.544748812069219f, - -0.5448585797892865f, - -0.5449683381733501f, - -0.5450780872195286f, - -0.5451878269259411f, - -0.5452975572907074f, - -0.5454072783119471f, - -0.545516989987781f, - -0.5456266923163285f, - -0.5457363852957098f, - -0.5458460689240455f, - -0.5459557431994567f, - -0.5460654081200633f, - -0.546175063683987f, - -0.5462847098893483f, - -0.546394346734269f, - -0.5465039742168698f, - -0.546613592335273f, - -0.5467232010876f, - -0.5468328004719718f, - -0.5469423904865122f, - -0.5470519711293423f, - -0.5471615423985849f, - -0.5472711042923615f, - -0.5473806568087962f, - -0.5474901999460113f, - -0.5475997337021297f, - -0.5477092580752747f, - -0.5478187730635686f, - -0.5479282786651367f, - -0.5480377748781018f, - -0.5481472617005877f, - -0.5482567391307176f, - -0.5483662071666171f, - -0.5484756658064097f, - -0.54858511504822f, - -0.5486945548901719f, - -0.5488039853303915f, - -0.5489134063670031f, - -0.5490228179981318f, - -0.5491322202219029f, - -0.5492416130364409f, - -0.5493509964398731f, - -0.5494603704303243f, - -0.5495697350059204f, - -0.549679090164787f, - -0.5497884359050516f, - -0.5498977722248398f, - -0.5500070991222783f, - -0.550116416595493f, - -0.5502257246426122f, - -0.5503350232617623f, - -0.5504443124510702f, - -0.5505535922086637f, - -0.5506628625326699f, - -0.5507721234212171f, - -0.5508813748724323f, - -0.5509906168844443f, - -0.5510998494553807f, - -0.5512090725833699f, - -0.5513182862665411f, - -0.5514274905030223f, - -0.5515366852909421f, - -0.5516458706284298f, - -0.551755046513615f, - -0.5518642129446264f, - -0.5519733699195936f, - -0.5520825174366455f, - -0.5521916554939135f, - -0.5523007840895264f, - -0.5524099032216148f, - -0.552519012888308f, - -0.5526281130877378f, - -0.5527372038180343f, - -0.552846285077328f, - -0.5529553568637501f, - -0.5530644191754307f, - -0.5531734720105027f, - -0.5532825153670967f, - -0.5533915492433443f, - -0.5535005736373764f, - -0.5536095885473264f, - -0.5537185939713258f, - -0.5538275899075067f, - -0.5539365763540006f, - -0.5540455533089418f, - -0.554154520770462f, - -0.5542634787366942f, - -0.5543724272057715f, - -0.5544813661758262f, - -0.5545902956449933f, - -0.5546992156114056f, - -0.5548081260731962f, - -0.5549170270284994f, - -0.5550259184754498f, - -0.5551348004121809f, - -0.5552436728368269f, - -0.5553525357475225f, - -0.5554613891424028f, - -0.555570233019602f, - -0.5556790673772556f, - -0.5557878922134984f, - -0.5558967075264657f, - -0.5560055133142929f, - -0.5561143095751163f, - -0.5562230963070713f, - -0.5563318735082934f, - -0.5564406411769192f, - -0.5565493993110852f, - -0.5566581479089276f, - -0.5567668869685823f, - -0.5568756164881876f, - -0.5569843364658796f, - -0.5570930468997956f, - -0.5572017477880726f, - -0.5573104391288475f, - -0.5574191209202594f, - -0.5575277931604451f, - -0.5576364558475428f, - -0.5577451089796897f, - -0.5578537525550256f, - -0.5579623865716882f, - -0.558071011027816f, - -0.558179625921547f, - -0.5582882312510217f, - -0.5583968270143784f, - -0.5585054132097563f, - -0.5586139898352949f, - -0.5587225568891329f, - -0.5588311143694116f, - -0.55893966227427f, - -0.5590482006018485f, - -0.5591567293502862f, - -0.5592652485177252f, - -0.5593737581023053f, - -0.5594822581021671f, - -0.5595907485154513f, - -0.5596992293402991f, - -0.5598077005748523f, - -0.5599161622172517f, - -0.5600246142656385f, - -0.5601330567181549f, - -0.5602414895729432f, - -0.5603499128281444f, - -0.5604583264819016f, - -0.5605667305323565f, - -0.5606751249776523f, - -0.5607835098159308f, - -0.5608918850453358f, - -0.5610002506640099f, - -0.5611086066700955f, - -0.5612169530617376f, - -0.5613252898370786f, - -0.5614336169942625f, - -0.5615419345314324f, - -0.5616502424467336f, - -0.5617585407383097f, - -0.5618668294043049f, - -0.561975108442863f, - -0.5620833778521303f, - -0.5621916376302507f, - -0.5622998877753692f, - -0.5624081282856311f, - -0.562516359159181f, - -0.5626245803941657f, - -0.5627327919887303f, - -0.5628409939410205f, - -0.5629491862491816f, - -0.5630573689113612f, - -0.5631655419257048f, - -0.5632737052903591f, - -0.5633818590034699f, - -0.5634900030631854f, - -0.5635981374676521f, - -0.5637062622150169f, - -0.5638143773034271f, - -0.5639224827310295f, - -0.5640305784959734f, - -0.5641386645964056f, - -0.5642467410304743f, - -0.5643548077963267f, - -0.5644628648921127f, - -0.56457091231598f, - -0.5646789500660769f, - -0.5647869781405529f, - -0.5648949965375563f, - -0.5650030052552368f, - -0.5651110042917432f, - -0.5652189936452255f, - -0.5653269733138326f, - -0.565434943295715f, - -0.5655429035890226f, - -0.5656508541919053f, - -0.5657587951025131f, - -0.5658667263189968f, - -0.5659746478395073f, - -0.5660825596621953f, - -0.5661904617852115f, - -0.5662983542067063f, - -0.5664062369248326f, - -0.566514109937741f, - -0.5666219732435832f, - -0.5667298268405102f, - -0.5668376707266756f, - -0.5669455049002304f, - -0.5670533293593274f, - -0.5671611441021179f, - -0.5672689491267562f, - -0.5673767444313943f, - -0.5674845300141852f, - -0.5675923058732819f, - -0.5677000720068371f, - -0.5678078284130057f, - -0.5679155750899406f, - -0.5680233120357955f, - -0.5681310392487237f, - -0.5682387567268807f, - -0.5683464644684202f, - -0.5684541624714965f, - -0.5685618507342636f, - -0.5686695292548777f, - -0.5687771980314931f, - -0.5688848570622648f, - -0.5689925063453478f, - -0.569100145878898f, - -0.5692077756610713f, - -0.5693153956900231f, - -0.569423005963909f, - -0.5695306064808856f, - -0.5696381972391096f, - -0.5697457782367364f, - -0.5698533494719237f, - -0.5699609109428274f, - -0.5700684626476052f, - -0.5701760045844136f, - -0.5702835367514106f, - -0.5703910591467533f, - -0.5704985717685984f, - -0.5706060746151055f, - -0.5707135676844315f, - -0.5708210509747348f, - -0.5709285244841729f, - -0.5710359882109057f, - -0.5711434421530911f, - -0.5712508863088879f, - -0.5713583206764551f, - -0.5714657452539511f, - -0.5715731600395366f, - -0.5716805650313705f, - -0.5717879602276125f, - -0.5718953456264213f, - -0.5720027212259587f, - -0.572110087024384f, - -0.5722174430198576f, - -0.5723247892105391f, - -0.5724321255945907f, - -0.5725394521701724f, - -0.5726467689354453f, - -0.5727540758885705f, - -0.5728613730277087f, - -0.5729686603510228f, - -0.5730759378566735f, - -0.573183205542823f, - -0.5732904634076323f, - -0.5733977114492653f, - -0.5735049496658833f, - -0.5736121780556489f, - -0.5737193966167241f, - -0.5738266053472731f, - -0.5739338042454584f, - -0.5740409933094425f, - -0.5741481725373897f, - -0.5742553419274626f, - -0.5743625014778259f, - -0.5744696511866425f, - -0.5745767910520772f, - -0.5746839210722933f, - -0.5747910412454558f, - -0.5748981515697293f, - -0.5750052520432785f, - -0.5751123426642676f, - -0.5752194234308621f, - -0.5753264943412275f, - -0.5754335553935289f, - -0.5755406065859318f, - -0.5756476479166012f, - -0.5757546793837043f, - -0.5758617009854066f, - -0.575968712719874f, - -0.5760757145852726f, - -0.5761827065797702f, - -0.5762896887015327f, - -0.5763966609487272f, - -0.5765036233195205f, - -0.5766105758120793f, - -0.5767175184245724f, - -0.5768244511551666f, - -0.5769313740020297f, - -0.5770382869633288f, - -0.5771451900372334f, - -0.5772520832219112f, - -0.5773589665155305f, - -0.5774658399162592f, - -0.5775727034222674f, - -0.5776795570317234f, - -0.5777864007427962f, - -0.5778932345536552f, - -0.5780000584624689f, - -0.5781068724674086f, - -0.5782136765666431f, - -0.5783204707583423f, - -0.5784272550406763f, - -0.578534029411816f, - -0.5786407938699314f, - -0.5787475484131926f, - -0.5788542930397711f, - -0.578961027747838f, - -0.5790677525355638f, - -0.5791744674011203f, - -0.5792811723426788f, - -0.5793878673584107f, - -0.579494552446488f, - -0.5796012276050829f, - -0.5797078928323675f, - -0.5798145481265131f, - -0.5799211934856939f, - -0.5800278289080817f, - -0.5801344543918494f, - -0.5802410699351691f, - -0.5803476755362157f, - -0.5804542711931616f, - -0.5805608569041804f, - -0.5806674326674457f, - -0.5807739984811308f, - -0.5808805543434109f, - -0.5809871002524597f, - -0.5810936362064516f, - -0.5812001622035602f, - -0.5813066782419618f, - -0.5814131843198305f, - -0.5815196804353414f, - -0.5816261665866697f, - -0.5817326427719899f, - -0.5818391089894792f, - -0.5819455652373127f, - -0.582052011513666f, - -0.5821584478167147f, - -0.5822648741446363f, - -0.5823712904956068f, - -0.5824776968678024f, - -0.5825840932593993f, - -0.5826904796685759f, - -0.5827968560935085f, - -0.5829032225323746f, - -0.5830095789833509f, - -0.5831159254446157f, - -0.5832222619143469f, - -0.583328588390722f, - -0.5834349048719195f, - -0.5835412113561173f, - -0.5836475078414944f, - -0.5837537943262288f, - -0.5838600708085f, - -0.5839663372864863f, - -0.5840725937583675f, - -0.5841788402223222f, - -0.5842850766765306f, - -0.5843913031191722f, - -0.584497519548426f, - -0.5846037259624733f, - -0.5847099223594938f, - -0.5848161087376677f, - -0.5849222850951749f, - -0.5850284514301974f, - -0.5851346077409154f, - -0.5852407540255101f, - -0.5853468902821618f, - -0.5854530165090535f, - -0.5855591327043658f, - -0.5856652388662806f, - -0.5857713349929797f, - -0.5858774210826446f, - -0.5859834971334589f, - -0.5860895631436043f, - -0.5861956191112633f, - -0.586301665034618f, - -0.5864077009118528f, - -0.5865137267411501f, - -0.5866197425206932f, - -0.5867257482486646f, - -0.5868317439232498f, - -0.5869377295426313f, - -0.5870437051049936f, - -0.5871496706085205f, - -0.5872556260513958f, - -0.5873615714318052f, - -0.5874675067479328f, - -0.5875734319979631f, - -0.5876793471800813f, - -0.587785252292473f, - -0.5878911473333233f, - -0.5879970323008171f, - -0.5881029071931411f, - -0.5882087720084802f, - -0.5883146267450213f, - -0.5884204714009499f, - -0.5885263059744531f, - -0.5886321304637165f, - -0.5887379448669275f, - -0.5888437491822732f, - -0.5889495434079404f, - -0.5890553275421159f, - -0.5891611015829874f, - -0.5892668655287431f, - -0.5893726193775701f, - -0.5894783631276567f, - -0.5895840967771899f, - -0.5896898203243597f, - -0.5897955337673536f, - -0.5899012371043605f, - -0.5900069303335683f, - -0.5901126134531676f, - -0.5902182864613466f, - -0.5903239493562946f, - -0.5904296021362007f, - -0.5905352447992556f, - -0.5906408773436487f, - -0.59074649976757f, - -0.5908521120692095f, - -0.590957714246757f, - -0.5910633062984045f, - -0.5911688882223419f, - -0.5912744600167602f, - -0.5913800216798495f, - -0.5914855732098027f, - -0.5915911146048104f, - -0.5916966458630641f, - -0.591802166982755f, - -0.5919076779620763f, - -0.5920131787992196f, - -0.5921186694923768f, - -0.5922241500397403f, - -0.592329620439503f, - -0.5924350806898581f, - -0.592540530788998f, - -0.5926459707351157f, - -0.5927514005264048f, - -0.5928568201610591f, - -0.5929622296372717f, - -0.5930676289532371f, - -0.5931730181071487f, - -0.5932783970972006f, - -0.5933837659215875f, - -0.5934891245785042f, - -0.5935944730661451f, - -0.5936998113827043f, - -0.5938051395263785f, - -0.593910457495362f, - -0.5940157652878502f, - -0.594121062902038f, - -0.5942263503361227f, - -0.5943316275882994f, - -0.5944368946567642f, - -0.5945421515397133f, - -0.5946473982353427f, - -0.5947526347418503f, - -0.5948578610574321f, - -0.5949630771802852f, - -0.595068283108606f, - -0.5951734788405932f, - -0.5952786643744437f, - -0.5953838397083551f, - -0.5954890048405245f, - -0.5955941597691514f, - -0.5956993044924332f, - -0.5958044390085685f, - -0.5959095633157556f, - -0.5960146774121927f, - -0.59611978129608f, - -0.5962248749656158f, - -0.5963299584189996f, - -0.5964350316544299f, - -0.5965400946701077f, - -0.5966451474642323f, - -0.5967501900350034f, - -0.5968552223806205f, - -0.5969602444992853f, - -0.5970652563891976f, - -0.5971702580485576f, - -0.5972752494755671f, - -0.597380230668426f, - -0.5974852016253366f, - -0.5975901623444991f, - -0.5976951128241161f, - -0.5978000530623885f, - -0.5979049830575185f, - -0.5980099028077084f, - -0.5981148123111603f, - -0.598219711566076f, - -0.5983246005706586f, - -0.5984294793231112f, - -0.5985343478216363f, - -0.5986392060644371f, - -0.5987440540497161f, - -0.5988488917756782f, - -0.5989537192405263f, - -0.5990585364424643f, - -0.5991633433796953f, - -0.5992681400504252f, - -0.5993729264528572f, - -0.5994777025851961f, - -0.5995824684456466f, - -0.5996872240324127f, - -0.5997919693437009f, - -0.5998967043777158f, - -0.6000014291326627f, - -0.6001061436067465f, - -0.6002108477981745f, - -0.6003155417051517f, - -0.6004202253258842f, - -0.6005248986585777f, - -0.60062956170144f, - -0.600734214452677f, - -0.6008388569104957f, - -0.6009434890731027f, - -0.6010481109387047f, - -0.6011527225055104f, - -0.6012573237717267f, - -0.6013619147355608f, - -0.6014664953952209f, - -0.6015710657489155f, - -0.6016756257948523f, - -0.6017801755312396f, - -0.6018847149562861f, - -0.6019892440682011f, - -0.6020937628651925f, - -0.6021982713454703f, - -0.6023027695072435f, - -0.6024072573487211f, - -0.602511734868113f, - -0.6026162020636296f, - -0.6027206589334803f, - -0.6028251054758746f, - -0.6029295416890244f, - -0.6030339675711393f, - -0.6031383831204301f, - -0.6032427883351069f, - -0.6033471832133822f, - -0.6034515677534666f, - -0.6035559419535714f, - -0.6036603058119081f, - -0.603764659326688f, - -0.6038690024961242f, - -0.6039733353184281f, - -0.6040776577918122f, - -0.604181969914488f, - -0.6042862716846698f, - -0.6043905631005695f, - -0.6044948441604002f, - -0.6045991148623752f, - -0.6047033752047068f, - -0.6048076251856103f, - -0.6049118648032984f, - -0.6050160940559851f, - -0.6051203129418838f, - -0.6052245214592102f, - -0.605328719606178f, - -0.6054329073810016f, - -0.6055370847818953f, - -0.6056412518070752f, - -0.605745408454756f, - -0.6058495547231527f, - -0.6059536906104808f, - -0.606057816114956f, - -0.6061619312347947f, - -0.606266035968212f, - -0.606370130313425f, - -0.6064742142686493f, - -0.6065782878321021f, - -0.6066823510019994f, - -0.606786403776559f, - -0.6068904461539971f, - -0.6069944781325314f, - -0.6070984997103795f, - -0.6072025108857589f, - -0.6073065116568874f, - -0.6074105020219821f, - -0.6075144819792627f, - -0.6076184515269467f, - -0.6077224106632528f, - -0.6078263593863988f, - -0.607930297694605f, - -0.60803422558609f, - -0.6081381430590727f, - -0.6082420501117718f, - -0.6083459467424085f, - -0.6084498329492017f, - -0.6085537087303714f, - -0.6086575740841378f, - -0.6087614290087203f, - -0.6088652735023409f, - -0.6089691075632195f, - -0.6090729311895771f, - -0.6091767443796338f, - -0.6092805471316122f, - -0.609384339443733f, - -0.6094881213142179f, - -0.6095918927412877f, - -0.6096956537231659f, - -0.6097994042580737f, - -0.6099031443442335f, - -0.6100068739798676f, - -0.6101105931631982f, - -0.6102143018924492f, - -0.610318000165843f, - -0.6104216879816025f, - -0.6105253653379511f, - -0.6106290322331129f, - -0.6107326886653114f, - -0.6108363346327698f, - -0.6109399701337129f, - -0.6110435951663644f, - -0.6111472097289489f, - -0.6112508138196915f, - -0.6113544074368165f, - -0.6114579905785485f, - -0.6115615632431132f, - -0.611665125428736f, - -0.611768677133642f, - -0.6118722183560568f, - -0.6119757490942063f, - -0.6120792693463171f, - -0.612182779110615f, - -0.6122862783853263f, - -0.612389767168677f, - -0.6124932454588952f, - -0.6125967132542071f, - -0.6127001705528398f, - -0.6128036173530198f, - -0.6129070536529763f, - -0.6130104794509358f, - -0.6131138947451265f, - -0.6132172995337755f, - -0.6133206938151123f, - -0.613424077587365f, - -0.6135274508487616f, - -0.6136308135975312f, - -0.6137341658319019f, - -0.6138375075501041f, - -0.6139408387503665f, - -0.6140441594309185f, - -0.614147469589989f, - -0.6142507692258092f, - -0.6143540583366084f, - -0.6144573369206169f, - -0.6145606049760641f, - -0.6146638625011821f, - -0.6147671094942009f, - -0.6148703459533514f, - -0.6149735718768642f, - -0.6150767872629711f, - -0.6151799921099037f, - -0.6152831864158933f, - -0.6153863701791714f, - -0.6154895433979704f, - -0.6155927060705225f, - -0.6156958581950598f, - -0.615798999769815f, - -0.6159021307930209f, - -0.6160052512629097f, - -0.6161083611777151f, - -0.6162114605356703f, - -0.6163145493350087f, - -0.6164176275739632f, - -0.6165206952507688f, - -0.6166237523636589f, - -0.6167267989108676f, - -0.6168298348906284f, - -0.6169328603011774f, - -0.6170358751407485f, - -0.6171388794075766f, - -0.6172418730998966f, - -0.6173448562159434f, - -0.6174478287539533f, - -0.6175507907121617f, - -0.617653742088804f, - -0.6177566828821157f, - -0.6178596130903341f, - -0.6179625327116951f, - -0.6180654417444349f, - -0.6181683401867898f, - -0.6182712280369977f, - -0.6183741052932953f, - -0.6184769719539196f, - -0.6185798280171081f, - -0.6186826734810976f, - -0.6187855083441274f, - -0.6188883326044347f, - -0.6189911462602575f, - -0.6190939493098337f, - -0.6191967417514029f, - -0.6192995235832033f, - -0.6194022948034736f, - -0.6195050554104523f, - -0.6196078054023799f, - -0.6197105447774952f, - -0.6198132735340374f, - -0.6199159916702468f, - -0.6200186991843629f, - -0.6201213960746265f, - -0.6202240823392772f, - -0.620326757976556f, - -0.6204294229847032f, - -0.6205320773619597f, - -0.6206347211065671f, - -0.6207373542167662f, - -0.6208399766907985f, - -0.6209425885269049f, - -0.6210451897233283f, - -0.6211477802783103f, - -0.6212503601900928f, - -0.6213529294569177f, - -0.6214554880770286f, - -0.6215580360486676f, - -0.6216605733700775f, - -0.6217631000395007f, - -0.6218656160551821f, - -0.621968121415364f, - -0.6220706161182902f, - -0.6221731001622044f, - -0.62227557354535f, - -0.6223780362659724f, - -0.6224804883223153f, - -0.6225829297126232f, - -0.6226853604351401f, - -0.6227877804881123f, - -0.6228901898697842f, - -0.6229925885784009f, - -0.6230949766122071f, - -0.6231973539694501f, - -0.6232997206483747f, - -0.623402076647227f, - -0.6235044219642532f, - -0.6236067565976988f, - -0.6237090805458118f, - -0.6238113938068381f, - -0.6239136963790246f, - -0.6240159882606183f, - -0.624118269449867f, - -0.6242205399450178f, - -0.6243227997443179f, - -0.6244250488460156f, - -0.6245272872483589f, - -0.6246295149495957f, - -0.6247317319479748f, - -0.6248339382417445f, - -0.6249361338291531f, - -0.6250383187084498f, - -0.6251404928778843f, - -0.6252426563357052f, - -0.6253448090801614f, - -0.625446951109504f, - -0.625549082421982f, - -0.6256512030158455f, - -0.625753312889344f, - -0.6258554120407293f, - -0.625957500468251f, - -0.6260595781701602f, - -0.6261616451447076f, - -0.6262637013901438f, - -0.6263657469047211f, - -0.6264677816866908f, - -0.6265698057343042f, - -0.6266718190458126f, - -0.6267738216194693f, - -0.6268758134535259f, - -0.6269777945462349f, - -0.6270797648958487f, - -0.6271817245006195f, - -0.6272836733588015f, - -0.6273856114686472f, - -0.6274875388284101f, - -0.6275894554363428f, - -0.6276913612907004f, - -0.627793256389736f, - -0.6278951407317039f, - -0.6279970143148574f, - -0.6280988771374525f, - -0.6282007291977431f, - -0.6283025704939837f, - -0.6284044010244293f, - -0.6285062207873352f, - -0.6286080297809572f, - -0.6287098280035501f, - -0.6288116154533703f, - -0.6289133921286729f, - -0.6290151580277149f, - -0.6291169131487516f, - -0.6292186574900405f, - -0.6293203910498373f, - -0.6294221138263991f, - -0.6295238258179835f, - -0.6296255270228471f, - -0.6297272174392474f, - -0.6298288970654414f, - -0.629930565899688f, - -0.6300322239402446f, - -0.6301338711853691f, - -0.6302355076333195f, - -0.6303371332823553f, - -0.6304387481307345f, - -0.6305403521767162f, - -0.6306419454185587f, - -0.6307435278545224f, - -0.6308450994828663f, - -0.6309466603018496f, - -0.6310482103097326f, - -0.6311497495047741f, - -0.6312512778852359f, - -0.6313527954493777f, - -0.6314543021954598f, - -0.6315557981217425f, - -0.6316572832264877f, - -0.6317587575079561f, - -0.6318602209644089f, - -0.6319616735941075f, - -0.6320631153953128f, - -0.6321645463662882f, - -0.6322659665052947f, - -0.6323673758105948f, - -0.63246877428045f, - -0.6325701619131244f, - -0.6326715387068799f, - -0.6327729046599792f, - -0.6328742597706857f, - -0.632975604037263f, - -0.6330769374579746f, - -0.6331782600310834f, - -0.633279571754854f, - -0.63338087262755f, - -0.6334821626474358f, - -0.6335834418127764f, - -0.6336847101218357f, - -0.6337859675728785f, - -0.6338872141641698f, - -0.6339884498939754f, - -0.6340896747605602f, - -0.634190888762189f, - -0.634292091897129f, - -0.6343932841636453f, - -0.6344944655600041f, - -0.6345956360844716f, - -0.6346967957353137f, - -0.6347979445107983f, - -0.6348990824091917f, - -0.6350002094287608f, - -0.6351013255677721f, - -0.6352024308244946f, - -0.6353035251971949f, - -0.6354046086841411f, - -0.6355056812836002f, - -0.6356067429938418f, - -0.6357077938131336f, - -0.6358088337397441f, - -0.6359098627719421f, - -0.6360108809079955f, - -0.6361118881461751f, - -0.6362128844847494f, - -0.6363138699219878f, - -0.6364148444561591f, - -0.6365158080855349f, - -0.6366167608083841f, - -0.6367177026229772f, - -0.6368186335275837f, - -0.6369195535204757f, - -0.6370204625999233f, - -0.6371213607641972f, - -0.6372222480115685f, - -0.6373231243403087f, - -0.6374239897486896f, - -0.6375248442349825f, - -0.6376256877974595f, - -0.6377265204343925f, - -0.6378273421440541f, - -0.6379281529247162f, - -0.6380289527746521f, - -0.6381297416921342f, - -0.6382305196754349f, - -0.6383312867228288f, - -0.6384320428325885f, - -0.6385327880029876f, - -0.6386335222322993f, - -0.6387342455187988f, - -0.6388349578607595f, - -0.6389356592564559f, - -0.6390363497041616f, - -0.6391370292021528f, - -0.6392376977487036f, - -0.6393383553420893f, - -0.6394390019805849f, - -0.6395396376624654f, - -0.6396402623860075f, - -0.6397408761494866f, - -0.6398414789511786f, - -0.639942070789359f, - -0.6400426516623057f, - -0.6401432215682944f, - -0.6402437805056019f, - -0.6403443284725046f, - -0.6404448654672809f, - -0.6405453914882073f, - -0.6406459065335616f, - -0.6407464106016214f, - -0.6408469036906638f, - -0.6409473857989684f, - -0.6410478569248126f, - -0.641148317066475f, - -0.6412487662222336f, - -0.6413492043903684f, - -0.6414496315691579f, - -0.641550047756881f, - -0.6416504529518172f, - -0.6417508471522466f, - -0.6418512303564486f, - -0.641951602562703f, - -0.6420519637692903f, - -0.6421523139744904f, - -0.6422526531765844f, - -0.6423529813738523f, - -0.6424532985645758f, - -0.6425536047470353f, - -0.6426538999195123f, - -0.6427541840802887f, - -0.6428544572276458f, - -0.6429547193598655f, - -0.6430549704752291f, - -0.6431552105720201f, - -0.6432554396485204f, - -0.6433556577030125f, - -0.6434558647337785f, - -0.6435560607391029f, - -0.6436562457172679f, - -0.6437564196665572f, - -0.6438565825852534f, - -0.6439567344716416f, - -0.6440568753240051f, - -0.6441570051406282f, - -0.644257123919795f, - -0.6443572316597893f, - -0.6444573283588972f, - -0.644557414015403f, - -0.6446574886275915f, - -0.6447575521937475f, - -0.6448576047121577f, - -0.6449576461811071f, - -0.6450576765988814f, - -0.6451576959637659f, - -0.6452577042740485f, - -0.6453577015280145f, - -0.6454576877239507f, - -0.6455576628601438f, - -0.64565762693488f, - -0.6457575799464479f, - -0.6458575218931342f, - -0.6459574527732259f, - -0.6460573725850113f, - -0.6461572813267784f, - -0.646257178996815f, - -0.6463570655934092f, - -0.6464569411148496f, - -0.6465568055594254f, - -0.6466566589254247f, - -0.646756501211137f, - -0.6468563324148515f, - -0.6469561525348573f, - -0.647055961569444f, - -0.6471557595169021f, - -0.647255546375521f, - -0.6473553221435903f, - -0.6474550868194017f, - -0.6475548404012451f, - -0.6476545828874114f, - -0.6477543142761906f, - -0.6478540345658753f, - -0.6479537437547561f, - -0.6480534418411247f, - -0.6481531288232725f, - -0.648252804699491f, - -0.6483524694680733f, - -0.6484521231273114f, - -0.6485517656754975f, - -0.6486513971109236f, - -0.648751017431884f, - -0.6488506266366709f, - -0.6489502247235777f, - -0.6490498116908976f, - -0.6491493875369236f, - -0.649248952259951f, - -0.6493485058582731f, - -0.6494480483301839f, - -0.6495475796739771f, - -0.6496470998879488f, - -0.6497466089703928f, - -0.6498461069196043f, - -0.6499455937338777f, - -0.6500450694115095f, - -0.6501445339507947f, - -0.650243987350029f, - -0.6503434296075079f, - -0.6504428607215278f, - -0.6505422806903853f, - -0.6506416895123762f, - -0.650741087185798f, - -0.6508404737089467f, - -0.65093984908012f, - -0.6510392132976146f, - -0.6511385663597284f, - -0.6512379082647585f, - -0.6513372390110029f, - -0.6514365585967601f, - -0.6515358670203278f, - -0.6516351642800046f, - -0.6517344503740881f, - -0.6518337253008785f, - -0.6519329890586741f, - -0.6520322416457742f, - -0.6521314830604772f, - -0.6522307133010842f, - -0.6523299323658941f, - -0.6524291402532068f, - -0.6525283369613217f, - -0.6526275224885406f, - -0.6527266968331633f, - -0.6528258599934903f, - -0.6529250119678225f, - -0.6530241527544605f, - -0.6531232823517066f, - -0.6532224007578618f, - -0.6533215079712275f, - -0.653420603990105f, - -0.6535196888127978f, - -0.6536187624376072f, - -0.6537178248628357f, - -0.653816876086786f, - -0.6539159161077599f, - -0.654014944924062f, - -0.6541139625339947f, - -0.6542129689358613f, - -0.6543119641279649f, - -0.6544109481086103f, - -0.6545099208761009f, - -0.6546088824287406f, - -0.6547078327648339f, - -0.6548067718826857f, - -0.6549056997806003f, - -0.6550046164568825f, - -0.6551035219098377f, - -0.6552024161377707f, - -0.6553012991389875f, - -0.6554001709117938f, - -0.6554990314544952f, - -0.6555978807653975f, - -0.6556967188428072f, - -0.6557955456850311f, - -0.6558943612903755f, - -0.6559931656571466f, - -0.6560919587836527f, - -0.6561907406682003f, - -0.6562895113090967f, - -0.6563882707046499f, - -0.6564870188531665f, - -0.6565857557529562f, - -0.6566844814023264f, - -0.6567831957995853f, - -0.6568818989430409f, - -0.6569805908310034f, - -0.6570792714617809f, - -0.6571779408336826f, - -0.6572765989450172f, - -0.6573752457940955f, - -0.6574738813792266f, - -0.6575725056987203f, - -0.6576711187508867f, - -0.6577697205340356f, - -0.6578683110464787f, - -0.657966890286526f, - -0.6580654582524884f, - -0.6581640149426763f, - -0.6582625603554023f, - -0.6583610944889771f, - -0.6584596173417124f, - -0.6585581289119198f, - -0.6586566291979116f, - -0.6587551181980003f, - -0.6588535959104979f, - -0.6589520623337168f, - -0.6590505174659703f, - -0.6591489613055715f, - -0.659247393850833f, - -0.6593458151000688f, - -0.659444225051592f, - -0.6595426237037166f, - -0.6596410110547565f, - -0.659739387103026f, - -0.6598377518468395f, - -0.6599361052845106f, - -0.6600344474143555f, - -0.6601327782346885f, - -0.6602310977438247f, - -0.6603294059400787f, - -0.6604277028217674f, - -0.6605259883872059f, - -0.66062426263471f, - -0.6607225255625951f, - -0.660820777169179f, - -0.6609190174527773f, - -0.6610172464117069f, - -0.6611154640442845f, - -0.6612136703488266f, - -0.6613118653236517f, - -0.6614100489670767f, - -0.6615082212774192f, - -0.6616063822529963f, - -0.6617045318921275f, - -0.6618026701931303f, - -0.6619007971543233f, - -0.6619989127740241f, - -0.6620970170505531f, - -0.6621951099822285f, - -0.6622931915673698f, - -0.662391261804296f, - -0.6624893206913263f, - -0.6625873682267817f, - -0.6626854044089815f, - -0.662783429236246f, - -0.6628814427068949f, - -0.6629794448192499f, - -0.6630774355716313f, - -0.6631754149623597f, - -0.6632733829897564f, - -0.6633713396521432f, - -0.6634692849478414f, - -0.6635672188751723f, - -0.6636651414324585f, - -0.6637630526180215f, - -0.6638609524301838f, - -0.6639588408672685f, - -0.6640567179275978f, - -0.6641545836094942f, - -0.6642524379112813f, - -0.6643502808312828f, - -0.6644481123678215f, - -0.6645459325192214f, - -0.6646437412838057f, - -0.6647415386598996f, - -0.6648393246458268f, - -0.664937099239912f, - -0.6650348624404788f, - -0.6651326142458536f, - -0.6652303546543608f, - -0.6653280836643255f, - -0.6654258012740726f, - -0.665523507481929f, - -0.66562120228622f, - -0.6657188856852714f, - -0.6658165576774097f, - -0.6659142182609603f, - -0.6660118674342514f, - -0.6661095051956092f, - -0.6662071315433605f, - -0.6663047464758319f, - -0.6664023499913523f, - -0.6664999420882483f, - -0.6665975227648478f, - -0.6666950920194783f, - -0.6667926498504692f, - -0.6668901962561481f, - -0.6669877312348437f, - -0.6670852547848843f, - -0.6671827669045994f, - -0.6672802675923184f, - -0.6673777568463701f, - -0.6674752346650841f, - -0.6675727010467902f, - -0.6676701559898187f, - -0.6677675994924992f, - -0.6678650315531627f, - -0.6679624521701388f, - -0.6680598613417592f, - -0.6681572590663539f, - -0.6682546453422549f, - -0.668352020167793f, - -0.6684493835412997f, - -0.6685467354611065f, - -0.6686440759255461f, - -0.6687414049329501f, - -0.6688387224816501f, - -0.66893602856998f, - -0.6690333231962717f, - -0.6691306063588582f, - -0.6692278780560725f, - -0.6693251382862473f, - -0.6694223870477173f, - -0.6695196243388155f, - -0.6696168501578759f, - -0.6697140645032318f, - -0.6698112673732188f, - -0.6699084587661707f, - -0.6700056386804221f, - -0.6701028071143073f, - -0.6701999640661624f, - -0.6702971095343224f, - -0.6703942435171224f, - -0.6704913660128983f, - -0.6705884770199849f, - -0.6706855765367199f, - -0.6707826645614388f, - -0.6708797410924778f, - -0.6709768061281731f, - -0.6710738596668628f, - -0.6711709017068832f, - -0.6712679322465716f, - -0.6713649512842645f, - -0.6714619588183011f, - -0.6715589548470184f, - -0.6716559393687545f, - -0.6717529123818471f, - -0.6718498738846351f, - -0.6719468238754573f, - -0.672043762352652f, - -0.6721406893145586f, - -0.6722376047595158f, - -0.6723345086858635f, - -0.6724314010919408f, - -0.672528281976088f, - -0.6726251513366445f, - -0.6727220091719507f, - -0.6728188554803474f, - -0.6729156902601746f, - -0.6730125135097734f, - -0.6731093252274839f, - -0.6732061254116487f, - -0.6733029140606084f, - -0.6733996911727045f, - -0.6734964567462781f, - -0.6735932107796726f, - -0.6736899532712295f, - -0.6737866842192909f, - -0.6738834036221989f, - -0.6739801114782975f, - -0.674076807785929f, - -0.6741734925434365f, - -0.6742701657491633f, - -0.6743668274014524f, - -0.6744634774986487f, - -0.6745601160390955f, - -0.674656743021137f, - -0.6747533584431168f, - -0.6748499623033808f, - -0.6749465546002729f, - -0.6750431353321382f, - -0.6751397044973217f, - -0.6752362620941682f, - -0.6753328081210244f, - -0.6754293425762353f, - -0.675525865458147f, - -0.6756223767651047f, - -0.6757188764954563f, - -0.6758153646475474f, - -0.6759118412197246f, - -0.6760083062103349f, - -0.6761047596177259f, - -0.6762012014402444f, - -0.6762976316762378f, - -0.6763940503240542f, - -0.676490457382041f, - -0.6765868528485466f, - -0.6766832367219195f, - -0.6767796090005082f, - -0.6768759696826605f, - -0.6769723187667261f, - -0.6770686562510543f, - -0.6771649821339938f, - -0.6772612964138938f, - -0.677357599089105f, - -0.6774538901579767f, - -0.677550169618859f, - -0.6776464374701023f, - -0.6777426937100564f, - -0.6778389383370731f, - -0.6779351713495027f, - -0.6780313927456962f, - -0.6781276025240044f, - -0.67822380068278f, - -0.678319987220374f, - -0.6784161621351382f, - -0.6785123254254242f, - -0.6786084770895855f, - -0.6787046171259737f, - -0.6788007455329418f, - -0.6788968623088424f, - -0.6789929674520281f, - -0.6790890609608534f, - -0.679185142833671f, - -0.6792812130688348f, - -0.6793772716646979f, - -0.6794733186196155f, - -0.6795693539319414f, - -0.6796653776000301f, - -0.6797613896222358f, - -0.6798573899969136f, - -0.6799533787224191f, - -0.6800493557971072f, - -0.680145321219333f, - -0.6802412749874525f, - -0.6803372170998218f, - -0.6804331475547963f, - -0.6805290663507331f, - -0.6806249734859877f, - -0.6807208689589177f, - -0.6808167527678792f, - -0.6809126249112298f, - -0.6810084853873267f, - -0.6811043341945264f, - -0.681200171331188f, - -0.6812959967956688f, - -0.6813918105863266f, - -0.6814876127015193f, - -0.6815834031396064f, - -0.6816791818989462f, - -0.6817749489778971f, - -0.681870704374818f, - -0.6819664480880693f, - -0.6820621801160096f, - -0.6821579004569988f, - -0.6822536091093966f, - -0.6823493060715625f, - -0.682444991341858f, - -0.682540664918643f, - -0.6826363268002781f, - -0.6827319769851234f, - -0.6828276154715416f, - -0.6829232422578929f, - -0.6830188573425391f, - -0.6831144607238409f, - -0.6832100524001616f, - -0.6833056323698627f, - -0.6834012006313065f, - -0.6834967571828552f, - -0.683592302022871f, - -0.6836878351497181f, - -0.6837833565617588f, - -0.6838788662573564f, - -0.6839743642348738f, - -0.6840698504926759f, - -0.6841653250291257f, - -0.6842607878425875f, - -0.6843562389314254f, - -0.6844516782940043f, - -0.6845471059286887f, - -0.684642521833843f, - -0.684737926007833f, - -0.6848333184490233f, - -0.6849286991557797f, - -0.6850240681264682f, - -0.6851194253594544f, - -0.685214770853104f, - -0.6853101046057836f, - -0.68540542661586f, - -0.6855007368816997f, - -0.6855960354016694f, - -0.6856913221741355f, - -0.6857865971974668f, - -0.6858818604700301f, - -0.6859771119901928f, - -0.6860723517563225f, - -0.6861675797667885f, - -0.6862627960199583f, - -0.6863580005142006f, - -0.6864531932478832f, - -0.6865483742193765f, - -0.6866435434270489f, - -0.6867387008692698f, - -0.6868338465444084f, - -0.6869289804508341f, - -0.6870241025869178f, - -0.6871192129510292f, - -0.6872143115415386f, - -0.6873093983568156f, - -0.6874044733952325f, - -0.6874995366551594f, - -0.6875945881349675f, - -0.6876896278330275f, - -0.6877846557477121f, - -0.6878796718773925f, - -0.6879746762204405f, - -0.688069668775228f, - -0.6881646495401276f, - -0.6882596185135121f, - -0.6883545756937541f, - -0.688449521079226f, - -0.6885444546683014f, - -0.6886393764593539f, - -0.6887342864507564f, - -0.6888291846408833f, - -0.6889240710281078f, - -0.6890189456108049f, - -0.6891138083873481f, - -0.6892086593561129f, - -0.6893034985154733f, - -0.6893983258638039f, - -0.689493141399481f, - -0.6895879451208795f, - -0.689682737026375f, - -0.6897775171143422f, - -0.6898722853831588f, - -0.6899670418312001f, - -0.6900617864568426f, - -0.6901565192584628f, - -0.6902512402344368f, - -0.690345949383143f, - -0.6904406467029578f, - -0.6905353321922587f, - -0.6906300058494226f, - -0.6907246676728285f, - -0.6908193176608538f, - -0.6909139558118769f, - -0.6910085821242752f, - -0.6911031965964288f, - -0.691197799226716f, - -0.6912923900135155f, - -0.6913869689552067f, - -0.6914815360501683f, - -0.6915760912967812f, - -0.6916706346934247f, - -0.6917651662384786f, - -0.6918596859303228f, - -0.6919541937673387f, - -0.6920486897479066f, - -0.6921431738704069f, - -0.6922376461332205f, - -0.6923321065347297f, - -0.6924265550733151f, - -0.6925209917473584f, - -0.6926154165552418f, - -0.6927098294953469f, - -0.6928042305660566f, - -0.6928986197657525f, - -0.6929929970928181f, - -0.6930873625456356f, - -0.6931817161225888f, - -0.6932760578220603f, - -0.693370387642434f, - -0.6934647055820932f, - -0.6935590116394219f, - -0.6936533058128047f, - -0.6937475881006255f, - -0.6938418585012689f, - -0.6939361170131187f, - -0.6940303636345614f, - -0.6941245983639812f, - -0.6942188211997636f, - -0.6943130321402934f, - -0.6944072311839576f, - -0.6945014183291415f, - -0.6945955935742313f, - -0.6946897569176131f, - -0.694783908357673f, - -0.6948780478927991f, - -0.6949721755213775f, - -0.6950662912417954f, - -0.6951603950524395f, - -0.6952544869516988f, - -0.6953485669379602f, - -0.6954426350096118f, - -0.695536691165041f, - -0.6956307354026376f, - -0.6957247677207896f, - -0.6958187881178856f, - -0.6959127965923145f, - -0.6960067931424652f, - -0.6961007777667281f, - -0.6961947504634922f, - -0.6962887112311471f, - -0.6963826600680829f, - -0.6964765969726904f, - -0.6965705219433596f, - -0.6966644349784806f, - -0.6967583360764449f, - -0.6968522252356435f, - -0.6969461024544676f, - -0.6970399677313082f, - -0.6971338210645576f, - -0.6972276624526069f, - -0.6973214918938486f, - -0.6974153093866753f, - -0.6975091149294791f, - -0.6976029085206523f, - -0.6976966901585882f, - -0.69779045984168f, - -0.6978842175683209f, - -0.6979779633369034f, - -0.698071697145823f, - -0.6981654189934725f, - -0.6982591288782461f, - -0.6983528267985384f, - -0.6984465127527428f, - -0.6985401867392557f, - -0.6986338487564712f, - -0.6987274988027844f, - -0.69882113687659f, - -0.698914762976285f, - -0.6990083771002642f, - -0.6991019792469237f, - -0.6991955694146591f, - -0.699289147601868f, - -0.6993827138069462f, - -0.6994762680282905f, - -0.699569810264298f, - -0.6996633405133651f, - -0.6997568587738906f, - -0.6998503650442713f, - -0.699943859322905f, - -0.7000373416081893f, - -0.7001308118985234f, - -0.7002242701923053f, - -0.7003177164879334f, - -0.7004111507838063f, - -0.7005045730783235f, - -0.7005979833698842f, - -0.7006913816568878f, - -0.7007847679377336f, - -0.7008781422108217f, - -0.7009715044745526f, - -0.7010648547273257f, - -0.7011581929675422f, - -0.7012515191936023f, - -0.7013448334039073f, - -0.7014381355968579f, - -0.7015314257708556f, - -0.701624703924302f, - -0.701717970055598f, - -0.7018112241631468f, - -0.7019044662453499f, - -0.7019976963006096f, - -0.7020909143273277f, - -0.7021841203239083f, - -0.7022773142887538f, - -0.7023704962202673f, - -0.7024636661168513f, - -0.7025568239769109f, - -0.7026499697988491f, - -0.7027431035810698f, - -0.7028362253219774f, - -0.7029293350199755f, - -0.70302243267347f, - -0.7031155182808649f, - -0.7032085918405655f, - -0.7033016533509762f, - -0.7033947028105036f, - -0.703487740217553f, - -0.70358076557053f, - -0.7036737788678399f, - -0.7037667801078904f, - -0.7038597692890872f, - -0.7039527464098371f, - -0.7040457114685468f, - -0.7041386644636228f, - -0.7042316053934736f, - -0.7043245342565062f, - -0.7044174510511282f, - -0.7045103557757468f, - -0.7046032484287714f, - -0.7046961290086098f, - -0.70478899751367f, - -0.7048818539423615f, - -0.7049746982930924f, - -0.7050675305642728f, - -0.7051603507543112f, - -0.7052531588616178f, - -0.7053459548846016f, - -0.7054387388216732f, - -0.7055315106712429f, - -0.7056242704317206f, - -0.7057170181015169f, - -0.7058097536790428f, - -0.7059024771627094f, - -0.7059951885509279f, - -0.7060878878421095f, - -0.7061805750346652f, - -0.7062732501270084f, - -0.70636591311755f, - -0.7064585640047026f, - -0.706551202786878f, - -0.70664382946249f, - -0.706736444029951f, - -0.7068290464876739f, - -0.7069216368340713f, - -0.7070142150675581f, - -0.7071067811865475f, - -0.7071993351894531f, - -0.7072918770746891f, - -0.7073844068406693f, - -0.7074769244858095f, - -0.7075694300085237f, - -0.7076619234072268f, - -0.7077544046803333f, - -0.7078468738262601f, - -0.707939330843422f, - -0.7080317757302346f, - -0.7081242084851134f, - -0.7082166291064758f, - -0.7083090375927377f, - -0.7084014339423155f, - -0.7084938181536258f, - -0.708586190225086f, - -0.7086785501551135f, - -0.7087708979421254f, - -0.7088632335845394f, - -0.7089555570807732f, - -0.7090478684292455f, - -0.7091401676283737f, - -0.709232454676577f, - -0.7093247295722737f, - -0.7094169923138829f, - -0.7095092428998233f, - -0.7096014813285149f, - -0.7096937075983768f, - -0.7097859217078281f, - -0.70987812365529f, - -0.7099703134391822f, - -0.7100624910579246f, - -0.7101546565099377f, - -0.7102468097936431f, - -0.7103389509074612f, - -0.7104310798498135f, - -0.710523196619121f, - -0.7106153012138049f, - -0.7107073936322883f, - -0.7107994738729925f, - -0.7108915419343397f, - -0.7109835978147517f, - -0.7110756415126526f, - -0.7111676730264643f, - -0.7112596923546102f, - -0.7113516994955128f, - -0.7114436944475968f, - -0.7115356772092852f, - -0.7116276477790021f, - -0.7117196061551716f, - -0.7118115523362172f, - -0.7119034863205648f, - -0.7119954081066384f, - -0.7120873176928633f, - -0.7121792150776635f, - -0.7122711002594659f, - -0.7123629732366955f, - -0.712454834007778f, - -0.7125466825711387f, - -0.7126385189252052f, - -0.7127303430684032f, - -0.712822154999159f, - -0.7129139547159001f, - -0.7130057422170528f, - -0.7130975175010451f, - -0.7131892805663038f, - -0.7132810314112572f, - -0.7133727700343324f, - -0.7134644964339579f, - -0.7135562106085624f, - -0.713647912556574f, - -0.7137396022764211f, - -0.7138312797665329f, - -0.7139229450253389f, - -0.7140145980512682f, - -0.7141062388427502f, - -0.714197867398214f, - -0.714289483716091f, - -0.7143810877948107f, - -0.7144726796328035f, - -0.7145642592284992f, - -0.71465582658033f, - -0.7147473816867264f, - -0.7148389245461194f, - -0.7149304551569406f, - -0.715021973517621f, - -0.7151134796265937f, - -0.7152049734822901f, - -0.7152964550831423f, - -0.7153879244275826f, - -0.7154793815140447f, - -0.7155708263409608f, - -0.7156622589067642f, - -0.7157536792098874f, - -0.7158450872487653f, - -0.7159364830218311f, - -0.7160278665275187f, - -0.7161192377642622f, - -0.7162105967304955f, - -0.7163019434246541f, - -0.7163932778451727f, - -0.7164845999904855f, - -0.7165759098590284f, - -0.716667207449237f, - -0.7167584927595465f, - -0.7168497657883925f, - -0.7169410265342117f, - -0.7170322749954401f, - -0.717123511170514f, - -0.7172147350578706f, - -0.7173059466559465f, - -0.7173971459631785f, - -0.7174883329780042f, - -0.7175795076988614f, - -0.7176706701241876f, - -0.7177618202524205f, - -0.7178529580819984f, - -0.7179440836113603f, - -0.7180351968389442f, - -0.7181262977631884f, - -0.7182173863825331f, - -0.7183084626954168f, - -0.7183995267002792f, - -0.7184905783955597f, - -0.7185816177796978f, - -0.7186726448511344f, - -0.7187636596083096f, - -0.7188546620496634f, - -0.7189456521736364f, - -0.7190366299786705f, - -0.719127595463206f, - -0.7192185486256846f, - -0.719309489464547f, - -0.7194004179782363f, - -0.7194913341651937f, - -0.7195822380238616f, - -0.7196731295526821f, - -0.7197640087500974f, - -0.7198548756145515f, - -0.7199457301444868f, - -0.7200365723383465f, - -0.7201274021945734f, - -0.7202182197116125f, - -0.7203090248879069f, - -0.7203998177219008f, - -0.7204905982120382f, - -0.7205813663567637f, - -0.7206721221545226f, - -0.720762865603759f, - -0.7208535967029188f, - -0.7209443154504466f, - -0.7210350218447886f, - -0.7211257158843901f, - -0.7212163975676975f, - -0.7213070668931565f, - -0.7213977238592141f, - -0.7214883684643163f, - -0.7215790007069105f, - -0.7216696205854435f, - -0.7217602280983618f, - -0.7218508232441143f, - -0.7219414060211479f, - -0.7220319764279106f, - -0.7221225344628498f, - -0.7222130801244151f, - -0.7223036134110543f, - -0.7223941343212164f, - -0.7224846428533493f, - -0.7225751390059039f, - -0.7226656227773286f, - -0.7227560941660731f, - -0.7228465531705872f, - -0.7229369997893202f, - -0.7230274340207238f, - -0.7231178558632475f, - -0.7232082653153421f, - -0.7232986623754579f, - -0.7233890470420471f, - -0.7234794193135605f, - -0.7235697791884494f, - -0.7236601266651651f, - -0.7237504617421606f, - -0.7238407844178875f, - -0.723931094690798f, - -0.724021392559345f, - -0.7241116780219802f, - -0.7242019510771581f, - -0.7242922117233312f, - -0.724382459958953f, - -0.7244726957824763f, - -0.7245629191923565f, - -0.7246531301870467f, - -0.724743328765001f, - -0.7248335149246745f, - -0.7249236886645212f, - -0.7250138499829967f, - -0.7251039988785554f, - -0.7251941353496532f, - -0.7252842593947452f, - -0.7253743710122873f, - -0.7254644702007359f, - -0.7255545569585468f, - -0.725644631284176f, - -0.7257346931760805f, - -0.7258247426327175f, - -0.7259147796525436f, - -0.7260048042340159f, - -0.7260948163755916f, - -0.7261848160757293f, - -0.7262748033328864f, - -0.7263647781455209f, - -0.7264547405120906f, - -0.7265446904310552f, - -0.7266346279008729f, - -0.7267245529200024f, - -0.7268144654869024f, - -0.7269043656000336f, - -0.7269942532578548f, - -0.727084128458826f, - -0.727173991201407f, - -0.7272638414840575f, - -0.7273536793052392f, - -0.727443504663412f, - -0.7275333175570371f, - -0.7276231179845746f, - -0.7277129059444871f, - -0.7278026814352356f, - -0.7278924444552819f, - -0.727982195003087f, - -0.7280719330771146f, - -0.7281616586758263f, - -0.7282513717976847f, - -0.7283410724411523f, - -0.7284307606046924f, - -0.7285204362867684f, - -0.7286100994858438f, - -0.7286997502003815f, - -0.7287893884288458f, - -0.7288790141697011f, - -0.7289686274214113f, - -0.7290582281824411f, - -0.7291478164512554f, - -0.7292373922263183f, - -0.7293269555060956f, - -0.7294165062890529f, - -0.7295060445736553f, - -0.7295955703583682f, - -0.7296850836416586f, - -0.7297745844219923f, - -0.7298640726978357f, - -0.7299535484676547f, - -0.7300430117299175f, - -0.7301324624830906f, - -0.7302219007256411f, - -0.7303113264560367f, - -0.7304007396727443f, - -0.7304901403742332f, - -0.7305795285589709f, - -0.7306689042254259f, - -0.7307582673720658f, - -0.7308476179973609f, - -0.7309369560997795f, - -0.7310262816777908f, - -0.7311155947298638f, - -0.7312048952544691f, - -0.731294183250076f, - -0.7313834587151548f, - -0.7314727216481755f, - -0.7315619720476082f, - -0.7316512099119247f, - -0.7317404352395953f, - -0.7318296480290913f, - -0.7319188482788835f, - -0.7320080359874445f, - -0.7320972111532456f, - -0.7321863737747586f, - -0.7322755238504555f, - -0.7323646613788096f, - -0.7324537863582932f, - -0.7325428987873785f, - -0.7326319986645398f, - -0.7327210859882491f, - -0.7328101607569811f, - -0.7328992229692085f, - -0.7329882726234062f, - -0.7330773097180474f, - -0.7331663342516069f, - -0.7332553462225598f, - -0.7333443456293804f, - -0.7334333324705434f, - -0.7335223067445245f, - -0.7336112684497993f, - -0.7337002175848432f, - -0.7337891541481321f, - -0.7338780781381414f, - -0.7339669895533487f, - -0.73405588839223f, - -0.7341447746532619f, - -0.7342336483349209f, - -0.7343225094356853f, - -0.7344113579540318f, - -0.7345001938884381f, - -0.7345890172373821f, - -0.7346778279993411f, - -0.7347666261727946f, - -0.7348554117562205f, - -0.7349441847480974f, - -0.7350329451469038f, - -0.7351216929511196f, - -0.7352104281592239f, - -0.7352991507696962f, - -0.7353878607810155f, - -0.7354765581916631f, - -0.7355652430001187f, - -0.7356539152048626f, - -0.7357425748043752f, - -0.735831221797137f, - -0.7359198561816302f, - -0.7360084779563357f, - -0.7360970871197343f, - -0.7361856836703081f, - -0.7362742676065396f, - -0.7363628389269102f, - -0.7364513976299024f, - -0.7365399437139988f, - -0.7366284771776825f, - -0.736716998019436f, - -0.7368055062377431f, - -0.7368940018310868f, - -0.7369824847979506f, - -0.7370709551368186f, - -0.7371594128461754f, - -0.7372478579245046f, - -0.7373362903702905f, - -0.7374247101820186f, - -0.7375131173581737f, - -0.7376015118972408f, - -0.7376898937977047f, - -0.737778263058052f, - -0.7378666196767683f, - -0.7379549636523393f, - -0.7380432949832513f, - -0.7381316136679903f, - -0.7382199197050441f, - -0.738308213092899f, - -0.7383964938300421f, - -0.7384847619149603f, - -0.738573017346142f, - -0.7386612601220748f, - -0.7387494902412464f, - -0.738837707702145f, - -0.7389259125032585f, - -0.7390141046430767f, - -0.7391022841200879f, - -0.7391904509327812f, - -0.7392786050796452f, - -0.7393667465591706f, - -0.7394548753698466f, - -0.739542991510163f, - -0.7396310949786095f, - -0.7397191857736775f, - -0.7398072638938572f, - -0.7398953293376392f, - -0.7399833821035144f, - -0.7400714221899743f, - -0.7401594495955106f, - -0.7402474643186143f, - -0.740335466357778f, - -0.7404234557114934f, - -0.740511432378253f, - -0.740599396356549f, - -0.7406873476448748f, - -0.7407752862417226f, - -0.740863212145586f, - -0.7409511253549589f, - -0.7410390258683343f, - -0.7411269136842061f, - -0.7412147888010681f, - -0.7413026512174153f, - -0.741390500931742f, - -0.7414783379425427f, - -0.7415661622483118f, - -0.7416539738475457f, - -0.7417417727387391f, - -0.7418295589203876f, - -0.7419173323909865f, - -0.7420050931490327f, - -0.7420928411930223f, - -0.7421805765214515f, - -0.7422682991328171f, - -0.7423560090256153f, - -0.7424437061983443f, - -0.7425313906495011f, - -0.7426190623775831f, - -0.7427067213810876f, - -0.7427943676585136f, - -0.7428820012083587f, - -0.7429696220291214f, - -0.7430572301192999f, - -0.743144825477394f, - -0.7432324081019024f, - -0.7433199779913241f, - -0.7434075351441589f, - -0.7434950795589058f, - -0.743582611234066f, - -0.7436701301681391f, - -0.743757636359625f, - -0.7438451298070248f, - -0.7439326105088395f, - -0.74402007846357f, - -0.7441075336697172f, - -0.744194976125783f, - -0.7442824058302687f, - -0.7443698227816767f, - -0.7444572269785087f, - -0.7445446184192674f, - -0.744631997102455f, - -0.7447193630265745f, - -0.7448067161901292f, - -0.744894056591622f, - -0.7449813842295562f, - -0.7450686991024354f, - -0.7451560012087644f, - -0.7452432905470463f, - -0.7453305671157858f, - -0.7454178309134869f, - -0.7455050819386555f, - -0.7455923201897958f, - -0.7456795456654132f, - -0.7457667583640124f, - -0.7458539582841003f, - -0.7459411454241821f, - -0.7460283197827638f, - -0.7461154813583514f, - -0.7462026301494522f, - -0.7462897661545727f, - -0.7463768893722196f, - -0.7464639998009001f, - -0.7465510974391211f, - -0.7466381822853912f, - -0.7467252543382179f, - -0.7468123135961091f, - -0.7468993600575724f, - -0.7469863937211176f, - -0.7470734145852527f, - -0.7471604226484867f, - -0.7472474179093281f, - -0.7473344003662875f, - -0.7474213700178738f, - -0.7475083268625969f, - -0.7475952708989664f, - -0.747682202125493f, - -0.7477691205406873f, - -0.7478560261430598f, - -0.747942918931121f, - -0.7480297989033823f, - -0.7481166660583554f, - -0.7482035203945513f, - -0.7482903619104823f, - -0.74837719060466f, - -0.7484640064755965f, - -0.7485508095218045f, - -0.7486375997417969f, - -0.7487243771340862f, - -0.748811141697185f, - -0.7488978934296079f, - -0.7489846323298676f, - -0.749071358396478f, - -0.7491580716279524f, - -0.7492447720228064f, - -0.7493314595795535f, - -0.7494181342967084f, - -0.7495047961727862f, - -0.7495914452063012f, - -0.7496780813957699f, - -0.749764704739707f, - -0.7498513152366286f, - -0.74993791288505f, - -0.7500244976834883f, - -0.7501110696304595f, - -0.7501976287244801f, - -0.7502841749640666f, - -0.750370708347737f, - -0.7504572288740079f, - -0.750543736541397f, - -0.750630231348422f, - -0.7507167132936002f, - -0.7508031823754509f, - -0.7508896385924918f, - -0.7509760819432417f, - -0.7510625124262187f, - -0.7511489300399431f, - -0.7512353347829335f, - -0.7513217266537093f, - -0.7514081056507897f, - -0.7514944717726959f, - -0.7515808250179473f, - -0.7516671653850641f, - -0.7517534928725673f, - -0.7518398074789773f, - -0.7519261092028154f, - -0.7520123980426027f, - -0.7520986739968609f, - -0.7521849370641113f, - -0.7522711872428759f, - -0.7523574245316773f, - -0.7524436489290375f, - -0.7525298604334787f, - -0.7526160590435241f, - -0.7527022447576969f, - -0.7527884175745201f, - -0.7528745774925172f, - -0.7529607245102112f, - -0.7530468586261272f, - -0.7531329798387887f, - -0.75321908814672f, - -0.7533051835484452f, - -0.7533912660424902f, - -0.7534773356273793f, - -0.7535633923016379f, - -0.7536494360637913f, - -0.7537354669123647f, - -0.7538214848458851f, - -0.7539074898628779f, - -0.7539934819618697f, - -0.7540794611413861f, - -0.7541654273999554f, - -0.7542513807361038f, - -0.7543373211483586f, - -0.7544232486352466f, - -0.7545091631952965f, - -0.7545950648270359f, - -0.7546809535289927f, - -0.7547668292996952f, - -0.7548526921376714f, - -0.7549385420414512f, - -0.7550243790095631f, - -0.7551102030405359f, - -0.7551960141328994f, - -0.7552818122851835f, - -0.7553675974959179f, - -0.7554533697636322f, - -0.755539129086857f, - -0.7556248754641235f, - -0.7557106088939615f, - -0.7557963293749025f, - -0.7558820369054777f, - -0.7559677314842181f, - -0.7560534131096557f, - -0.7561390817803226f, - -0.7562247374947506f, - -0.7563103802514716f, - -0.7563960100490189f, - -0.756481626885925f, - -0.7565672307607229f, - -0.756652821671945f, - -0.756738399618126f, - -0.7568239645977993f, - -0.7569095166094978f, - -0.7569950556517562f, - -0.757080581723109f, - -0.757166094822091f, - -0.7572515949472359f, - -0.7573370820970794f, - -0.7574225562701566f, - -0.7575080174650035f, - -0.7575934656801545f, - -0.7576789009141462f, - -0.7577643231655152f, - -0.7578497324327967f, - -0.7579351287145277f, - -0.7580205120092451f, - -0.7581058823154865f, - -0.7581912396317871f, - -0.7582765839566868f, - -0.7583619152887215f, - -0.7584472336264304f, - -0.7585325389683496f, - -0.7586178313130197f, - -0.7587031106589778f, - -0.7587883770047636f, - -0.7588736303489151f, - -0.7589588706899718f, - -0.7590440980264733f, - -0.7591293123569598f, - -0.7592145136799702f, - -0.7592997019940448f, - -0.7593848772977243f, - -0.7594700395895496f, - -0.7595551888680605f, - -0.7596403251317982f, - -0.7597254483793043f, - -0.7598105586091207f, - -0.7598956558197879f, - -0.7599807400098488f, - -0.7600658111778439f, - -0.7601508693223179f, - -0.7602359144418114f, - -0.7603209465348686f, - -0.7604059656000306f, - -0.7604909716358429f, - -0.7605759646408473f, - -0.7606609446135887f, - -0.7607459115526091f, - -0.760830865456455f, - -0.760915806323669f, - -0.7610007341527961f, - -0.7610856489423818f, - -0.7611705506909702f, - -0.7612554393971066f, - -0.7613403150593369f, - -0.761425177676207f, - -0.7615100272462618f, - -0.7615948637680481f, - -0.7616796872401121f, - -0.7617644976610011f, - -0.7618492950292606f, - -0.7619340793434383f, - -0.7620188506020813f, - -0.7621036088037378f, - -0.7621883539469544f, - -0.7622730860302793f, - -0.7623578050522608f, - -0.7624425110114479f, - -0.7625272039063881f, - -0.7626118837356305f, - -0.7626965504977243f, - -0.7627812041912194f, - -0.762865844814664f, - -0.7629504723666091f, - -0.7630350868456028f, - -0.7631196882501976f, - -0.7632042765789421f, - -0.7632888518303881f, - -0.7633734140030847f, - -0.7634579630955851f, - -0.7635424991064391f, - -0.7636270220341993f, - -0.7637115318774155f, - -0.7637960286346421f, - -0.7638805123044297f, - -0.7639649828853314f, - -0.7640494403758991f, - -0.764133884774686f, - -0.7642183160802453f, - -0.7643027342911307f, - -0.7643871394058946f, - -0.7644715314230915f, - -0.7645559103412752f, - -0.7646402761590005f, - -0.7647246288748207f, - -0.764808968487291f, - -0.7648932949949662f, - -0.7649776083964014f, - -0.7650619086901526f, - -0.7651461958747741f, - -0.7652304699488223f, - -0.765314730910853f, - -0.7653989787594231f, - -0.765483213493088f, - -0.7655674351104048f, - -0.7656516436099305f, - -0.7657358389902227f, - -0.7658200212498375f, - -0.7659041903873332f, - -0.7659883464012676f, - -0.766072489290199f, - -0.7661566190526847f, - -0.7662407356872845f, - -0.766324839192555f, - -0.7664089295670576f, - -0.7664930068093496f, - -0.7665770709179917f, - -0.7666611218915416f, - -0.7667451597285614f, - -0.7668291844276095f, - -0.7669131959872473f, - -0.766997194406034f, - -0.7670811796825311f, - -0.7671651518152993f, - -0.7672491108029006f, - -0.767333056643895f, - -0.7674169893368448f, - -0.7675009088803117f, - -0.7675848152728586f, - -0.7676687085130465f, - -0.7677525885994384f, - -0.7678364555305972f, - -0.7679203093050863f, - -0.7680041499214677f, - -0.7680879773783056f, - -0.7681717916741635f, - -0.7682555928076058f, - -0.7683393807771954f, - -0.7684231555814974f, - -0.7685069172190763f, - -0.7685906656884973f, - -0.7686744009883243f, - -0.7687581231171231f, - -0.7688418320734591f, - -0.7689255278558982f, - -0.7690092104630065f, - -0.7690928798933493f, - -0.7691765361454939f, - -0.7692601792180052f, - -0.7693438091094522f, - -0.7694274258184004f, - -0.7695110293434182f, - -0.7695946196830711f, - -0.7696781968359293f, - -0.769761760800559f, - -0.7698453115755294f, - -0.7699288491594073f, - -0.7700123735507635f, - -0.7700958847481651f, - -0.7701793827501824f, - -0.7702628675553833f, - -0.7703463391623383f, - -0.7704297975696167f, - -0.7705132427757894f, - -0.7705966747794252f, - -0.7706800935790951f, - -0.7707634991733698f, - -0.7708468915608209f, - -0.7709302707400181f, - -0.7710136367095339f, - -0.7710969894679383f, - -0.7711803290138052f, - -0.771263655345705f, - -0.7713469684622108f, - -0.7714302683618937f, - -0.7715135550433285f, - -0.7715968285050864f, - -0.771680088745741f, - -0.7717633357638659f, - -0.771846569558035f, - -0.7719297901268212f, - -0.7720129974687988f, - -0.7720961915825431f, - -0.7721793724666269f, - -0.7722625401196259f, - -0.7723456945401149f, - -0.7724288357266696f, - -0.7725119636778645f, - -0.7725950783922754f, - -0.7726781798684784f, - -0.7727612681050502f, - -0.7728443431005652f, - -0.7729274048536023f, - -0.7730104533627367f, - -0.7730934886265463f, - -0.7731765106436073f, - -0.7732595194124975f, - -0.773342514931795f, - -0.7734254972000778f, - -0.7735084662159232f, - -0.7735914219779099f, - -0.7736743644846167f, - -0.7737572937346228f, - -0.7738402097265061f, - -0.7739231124588465f, - -0.7740060019302235f, - -0.7740888781392172f, - -0.7741717410844067f, - -0.7742545907643731f, - -0.774337427177695f, - -0.7744202503229556f, - -0.7745030601987337f, - -0.7745858568036117f, - -0.7746686401361692f, - -0.77475141019499f, - -0.7748341669786541f, - -0.7749169104857447f, - -0.7749996407148422f, - -0.7750823576645314f, - -0.7751650613333931f, - -0.7752477517200117f, - -0.7753304288229688f, - -0.7754130926408485f, - -0.7754957431722342f, - -0.77557838041571f, - -0.7756610043698604f, - -0.7757436150332684f, - -0.7758262124045191f, - -0.7759087964821973f, - -0.7759913672648885f, - -0.7760739247511766f, - -0.7761564689396477f, - -0.7762389998288874f, - -0.7763215174174821f, - -0.7764040217040168f, - -0.7764865126870784f, - -0.7765689903652533f, - -0.7766514547371288f, - -0.7767339058012911f, - -0.7768163435563277f, - -0.776898768000826f, - -0.7769811791333745f, - -0.7770635769525598f, - -0.7771459614569711f, - -0.7772283326451953f, - -0.7773106905158231f, - -0.7773930350674417f, - -0.7774753662986411f, - -0.7775576842080092f, - -0.7776399887941374f, - -0.7777222800556141f, - -0.77780455799103f, - -0.7778868225989739f, - -0.7779690738780384f, - -0.7780513118268124f, - -0.7781335364438879f, - -0.778215747727855f, - -0.7782979456773055f, - -0.7783801302908309f, - -0.7784623015670236f, - -0.7785444595044746f, - -0.7786266041017765f, - -0.778708735357522f, - -0.7787908532703043f, - -0.778872957838715f, - -0.7789550490613482f, - -0.7790371269367969f, - -0.7791191914636555f, - -0.7792012426405167f, - -0.7792832804659752f, - -0.7793653049386251f, - -0.7794473160570616f, - -0.7795293138198784f, - -0.779611298225671f, - -0.7796932692730347f, - -0.7797752269605648f, - -0.7798571712868576f, - -0.7799391022505079f, - -0.780021019850113f, - -0.7801029240842675f, - -0.7801848149515703f, - -0.7802666924506165f, - -0.7803485565800042f, - -0.7804304073383292f, - -0.7805122447241911f, - -0.780594068736186f, - -0.7806758793729129f, - -0.7807576766329686f, - -0.7808394605149533f, - -0.7809212310174644f, - -0.7810029881391017f, - -0.7810847318784633f, - -0.7811664622341489f, - -0.7812481792047583f, - -0.7813298827888917f, - -0.7814115729851482f, - -0.7814932497921284f, - -0.781574913208433f, - -0.7816565632326631f, - -0.7817381998634186f, - -0.7818198230993012f, - -0.7819014329389125f, - -0.7819830293808544f, - -0.7820646124237278f, - -0.782146182066136f, - -0.7822277383066795f, - -0.7823092811439631f, - -0.7823908105765881f, - -0.7824723266031578f, - -0.7825538292222757f, - -0.7826353184325456f, - -0.7827167942325702f, - -0.782798256620954f, - -0.7828797055963013f, - -0.7829611411572167f, - -0.783042563302304f, - -0.7831239720301685f, - -0.7832053673394159f, - -0.7832867492286504f, - -0.7833681176964781f, - -0.7834494727415046f, - -0.7835308143623366f, - -0.7836121425575788f, - -0.7836934573258396f, - -0.7837747586657243f, - -0.7838560465758407f, - -0.7839373210547945f, - -0.7840185821011952f, - -0.7840998297136488f, - -0.784181063890764f, - -0.7842622846311481f, - -0.7843434919334099f, - -0.7844246857961578f, - -0.7845058662180011f, - -0.784587033197548f, - -0.7846681867334078f, - -0.7847493268241903f, - -0.7848304534685057f, - -0.7849115666649626f, - -0.7849926664121726f, - -0.7850737527087441f, - -0.7851548255532902f, - -0.7852358849444198f, - -0.7853169308807453f, - -0.7853979633608761f, - -0.7854789823834262f, - -0.7855599879470055f, - -0.7856409800502273f, - -0.785721958691702f, - -0.7858029238700444f, - -0.7858838755838653f, - -0.785964813831779f, - -0.7860457386123972f, - -0.7861266499243341f, - -0.7862075477662034f, - -0.7862884321366186f, - -0.7863693030341945f, - -0.7864501604575443f, - -0.7865310044052831f, - -0.7866118348760257f, - -0.7866926518683875f, - -0.7867734553809828f, - -0.7868542454124273f, - -0.786935021961337f, - -0.7870157850263282f, - -0.787096534606016f, - -0.7871772706990173f, - -0.7872579933039489f, - -0.7873387024194278f, - -0.7874193980440704f, - -0.7875000801764942f, - -0.7875807488153169f, - -0.7876614039591567f, - -0.7877420456066307f, - -0.7878226737563576f, - -0.7879032884069558f, - -0.7879838895570446f, - -0.7880644772052416f, - -0.7881450513501674f, - -0.7882256119904396f, - -0.7883061591246799f, - -0.7883866927515066f, - -0.7884672128695409f, - -0.7885477194774014f, - -0.7886282125737109f, - -0.7887086921570884f, - -0.7887891582261561f, - -0.7888696107795342f, - -0.7889500498158446f, - -0.7890304753337091f, - -0.7891108873317499f, - -0.7891912858085885f, - -0.7892716707628477f, - -0.7893520421931498f, - -0.7894324000981187f, - -0.789512744476376f, - -0.7895930753265457f, - -0.7896733926472514f, - -0.7897536964371175f, - -0.7898339866947667f, - -0.789914263418824f, - -0.7899945266079137f, - -0.7900747762606607f, - -0.7901550123756904f, - -0.7902352349516268f, - -0.7903154439870961f, - -0.7903956394807237f, - -0.790475821431136f, - -0.7905559898369583f, - -0.7906361446968171f, - -0.7907162860093393f, - -0.790796413773152f, - -0.7908765279868814f, - -0.7909566286491555f, - -0.7910367157586006f, - -0.7911167893138462f, - -0.7911968493135189f, - -0.7912768957562477f, - -0.7913569286406598f, - -0.7914369479653857f, - -0.7915169537290527f, - -0.7915969459302912f, - -0.7916769245677288f, - -0.7917568896399971f, - -0.7918368411457247f, - -0.7919167790835423f, - -0.7919967034520794f, - -0.7920766142499669f, - -0.7921565114758357f, - -0.7922363951283171f, - -0.7923162652060415f, - -0.7923961217076406f, - -0.7924759646317463f, - -0.7925557939769909f, - -0.7926356097420056f, - -0.7927154119254234f, - -0.7927952005258766f, - -0.7928749755419988f, - -0.792954736972422f, - -0.7930344848157801f, - -0.7931142190707064f, - -0.7931939397358354f, - -0.7932736468098f, - -0.7933533402912349f, - -0.7934330201787748f, - -0.7935126864710548f, - -0.7935923391667086f, - -0.7936719782643722f, - -0.7937516037626813f, - -0.79383121566027f, - -0.7939108139557766f, - -0.793990398647835f, - -0.7940699697350833f, - -0.794149527216156f, - -0.7942290710896921f, - -0.7943086013543271f, - -0.7943881180086995f, - -0.7944676210514449f, - -0.7945471104812033f, - -0.7946265862966111f, - -0.7947060484963077f, - -0.7947854970789301f, - -0.7948649320431179f, - -0.7949443533875098f, - -0.7950237611107455f, - -0.7951031552114632f, - -0.7951825356883032f, - -0.7952619025399054f, - -0.7953412557649101f, - -0.7954205953619568f, - -0.7954999213296865f, - -0.79557923366674f, - -0.7956585323717587f, - -0.7957378174433829f, - -0.7958170888802552f, - -0.7958963466810155f, - -0.795975590844308f, - -0.7960548213687734f, - -0.7961340382530548f, - -0.7962132414957936f, - -0.7962924310956347f, - -0.7963716070512197f, - -0.7964507693611922f, - -0.7965299180241959f, - -0.7966090530388753f, - -0.7966881744038732f, - -0.7967672821178344f, - -0.7968463761794041f, - -0.7969254565872259f, - -0.7970045233399452f, - -0.7970835764362074f, - -0.7971626158746584f, - -0.7972416416539427f, - -0.797320653772707f, - -0.7973996522295972f, - -0.7974786370232604f, - -0.797557608152342f, - -0.7976365656154895f, - -0.7977155094113498f, - -0.7977944395385711f, - -0.7978733559957996f, - -0.7979522587816836f, - -0.7980311478948713f, - -0.7981100233340115f, - -0.7981888850977514f, - -0.7982677331847404f, - -0.7983465675936275f, - -0.7984253883230624f, - -0.7985041953716935f, - -0.7985829887381714f, - -0.7986617684211444f, - -0.798740534419265f, - -0.7988192867311816f, - -0.7988980253555461f, - -0.7989767502910078f, - -0.7990554615362198f, - -0.7991341590898318f, - -0.7992128429504963f, - -0.7992915131168636f, - -0.799370169587588f, - -0.7994488123613198f, - -0.7995274414367127f, - -0.7996060568124185f, - -0.7996846584870905f, - -0.7997632464593819f, - -0.7998418207279466f, - -0.7999203812914374f, - -0.7999989281485085f, - -0.8000774612978141f, - -0.8001559807380085f, - -0.800234486467747f, - -0.8003129784856831f, - -0.8003914567904725f, - -0.8004699213807707f, - -0.8005483722552335f, - -0.8006268094125156f, - -0.8007052328512737f, - -0.8007836425701639f, - -0.8008620385678433f, - -0.8009404208429676f, - -0.801018789394194f, - -0.80109714422018f, - -0.8011754853195833f, - -0.8012538126910606f, - -0.8013321263332708f, - -0.8014104262448704f, - -0.8014887124245199f, - -0.8015669848708764f, - -0.8016452435825997f, - -0.8017234885583472f, - -0.8018017197967805f, - -0.8018799372965573f, - -0.8019581410563386f, - -0.8020363310747827f, - -0.802114507350552f, - -0.8021926698823054f, - -0.8022708186687048f, - -0.8023489537084098f, - -0.8024270750000821f, - -0.8025051825423835f, - -0.8025832763339759f, - -0.80266135637352f, - -0.8027394226596787f, - -0.8028174751911143f, - -0.8028955139664898f, - -0.8029735389844671f, - -0.8030515502437098f, - -0.803129547742881f, - -0.803207531480645f, - -0.8032855014556645f, - -0.8033634576666038f, - -0.8034414001121273f, - -0.8035193287909f, - -0.8035972437015857f, - -0.8036751448428496f, - -0.803753032213357f, - -0.8038309058117739f, - -0.8039087656367648f, - -0.8039866116869964f, - -0.8040644439611344f, - -0.8041422624578454f, - -0.8042200671757965f, - -0.8042978581136536f, - -0.8043756352700847f, - -0.8044533986437554f, - -0.8045311482333357f, - -0.8046088840374915f, - -0.804686606054892f, - -0.8047643142842038f, - -0.8048420087240976f, - -0.8049196893732404f, - -0.8049973562303024f, - -0.8050750092939511f, - -0.8051526485628581f, - -0.8052302740356915f, - -0.8053078857111221f, - -0.8053854835878191f, - -0.8054630676644535f, - -0.8055406379396959f, - -0.8056181944122176f, - -0.8056957370806885f, - -0.8057732659437807f, - -0.8058507810001657f, - -0.8059282822485159f, - -0.806005769687502f, - -0.8060832433157977f, - -0.8061607031320737f, - -0.8062381491350048f, - -0.8063155813232625f, - -0.8063929996955211f, - -0.8064704042504526f, - -0.8065477949867326f, - -0.8066251719030334f, - -0.8067025349980298f, - -0.8067798842703963f, - -0.8068572197188079f, - -0.8069345413419384f, - -0.8070118491384637f, - -0.8070891431070595f, - -0.8071664232464003f, - -0.8072436895551626f, - -0.8073209420320222f, - -0.8073981806756562f, - -0.80747540548474f, - -0.8075526164579507f, - -0.8076298135939657f, - -0.8077069968914624f, - -0.807784166349117f, - -0.8078613219656091f, - -0.8079384637396152f, - -0.8080155916698145f, - -0.8080927057548845f, - -0.8081698059935042f, - -0.8082468923843527f, - -0.8083239649261095f, - -0.808401023617453f, - -0.8084780684570635f, - -0.8085550994436206f, - -0.808632116575805f, - -0.8087091198522961f, - -0.8087861092717749f, - -0.8088630848329222f, - -0.8089400465344196f, - -0.8090169943749473f, - -0.8090939283531879f, - -0.8091708484678216f, - -0.8092477547175325f, - -0.8093246471010012f, - -0.8094015256169113f, - -0.8094783902639437f, - -0.8095552410407837f, - -0.8096320779461129f, - -0.8097089009786157f, - -0.8097857101369746f, - -0.8098625054198743f, - -0.8099392868259986f, - -0.8100160543540326f, - -0.8100928080026598f, - -0.8101695477705657f, - -0.8102462736564352f, - -0.8103229856589537f, - -0.8103996837768073f, - -0.8104763680086806f, - -0.8105530383532605f, - -0.810629694809233f, - -0.8107063373752852f, - -0.8107829660501027f, - -0.8108595808323733f, - -0.810936181720784f, - -0.8110127687140227f, - -0.8110893418107763f, - -0.8111659010097331f, - -0.8112424463095814f, - -0.8113189777090101f, - -0.8113954952067066f, - -0.8114719988013607f, - -0.8115484884916612f, - -0.8116249642762982f, - -0.8117014261539601f, - -0.8117778741233379f, - -0.8118543081831201f, - -0.8119307283319992f, - -0.812007134568664f, - -0.8120835268918065f, - -0.8121599053001161f, - -0.8122362697922861f, - -0.8123126203670066f, - -0.8123889570229703f, - -0.8124652797588677f, - -0.8125415885733931f, - -0.8126178834652373f, - -0.8126941644330942f, - -0.8127704314756555f, - -0.8128466845916151f, - -0.8129229237796665f, - -0.8129991490385036f, - -0.8130753603668194f, - -0.8131515577633085f, - -0.8132277412266654f, - -0.8133039107555853f, - -0.8133800663487618f, - -0.8134562080048906f, - -0.813532335722667f, - -0.8136084495007871f, - -0.8136845493379459f, - -0.8137606352328396f, - -0.8138367071841647f, - -0.8139127651906177f, - -0.8139888092508959f, - -0.8140648393636952f, - -0.8141408555277134f, - -0.8142168577416481f, - -0.8142928460041973f, - -0.8143688203140581f, - -0.8144447806699296f, - -0.8145207270705089f, - -0.8145966595144967f, - -0.8146725780005901f, - -0.8147484825274897f, - -0.814824373093893f, - -0.8149002496985018f, - -0.8149761123400145f, - -0.8150519610171322f, - -0.8151277957285538f, - -0.8152036164729818f, - -0.8152794232491155f, - -0.8153552160556571f, - -0.8154309948913069f, - -0.8155067597547668f, - -0.8155825106447387f, - -0.8156582475599252f, - -0.8157339704990274f, - -0.8158096794607484f, - -0.8158853744437911f, - -0.8159610554468586f, - -0.8160367224686536f, - -0.8161123755078796f, - -0.8161880145632406f, - -0.816263639633441f, - -0.8163392507171839f, - -0.8164148478131743f, - -0.816490430920117f, - -0.8165660000367171f, - -0.8166415551616789f, - -0.8167170962937083f, - -0.8167926234315108f, - -0.816868136573793f, - -0.8169436357192599f, - -0.8170191208666182f, - -0.8170945920145746f, - -0.8171700491618364f, - -0.8172454923071097f, - -0.8173209214491023f, - -0.8173963365865222f, - -0.8174717377180758f, - -0.8175471248424729f, - -0.8176224979584205f, - -0.8176978570646278f, - -0.8177732021598023f, - -0.817848533242655f, - -0.8179238503118935f, - -0.8179991533662283f, - -0.8180744424043681f, - -0.8181497174250233f, - -0.8182249784269041f, - -0.8183002254087215f, - -0.8183754583691851f, - -0.8184506773070064f, - -0.8185258822208963f, - -0.818601073109567f, - -0.8186762499717288f, - -0.8187514128060943f, - -0.8188265616113756f, - -0.8189016963862854f, - -0.8189768171295354f, - -0.8190519238398395f, - -0.819127016515909f, - -0.8192020951564595f, - -0.8192771597602028f, - -0.8193522103258538f, - -0.8194272468521251f, - -0.819502269337733f, - -0.8195772777813902f, - -0.8196522721818128f, - -0.8197272525377141f, - -0.8198022188478113f, - -0.8198771711108186f, - -0.819952109325452f, - -0.8200270334904282f, - -0.820101943604462f, - -0.8201768396662706f, - -0.8202517216745707f, - -0.8203265896280797f, - -0.8204014435255136f, - -0.8204762833655904f, - -0.8205511091470278f, - -0.8206259208685441f, - -0.8207007185288565f, - -0.8207755021266837f, - -0.8208502716607444f, - -0.8209250271297581f, - -0.8209997685324427f, - -0.821074495867518f, - -0.8211492091337037f, - -0.82122390832972f, - -0.821298593454286f, - -0.8213732645061226f, - -0.8214479214839501f, - -0.8215225643864899f, - -0.821597193212462f, - -0.8216718079605887f, - -0.8217464086295899f, - -0.8218209952181894f, - -0.8218955677251076f, - -0.821970126149068f, - -0.8220446704887912f, - -0.822119200743002f, - -0.8221937169104221f, - -0.8222682189897753f, - -0.8223427069797838f, - -0.8224171808791731f, - -0.8224916406866659f, - -0.8225660864009869f, - -0.8226405180208599f, - -0.8227149355450097f, - -0.8227893389721616f, - -0.8228637283010407f, - -0.8229381035303718f, - -0.8230124646588808f, - -0.8230868116852934f, - -0.8231611446083366f, - -0.8232354634267353f, - -0.8233097681392167f, - -0.8233840587445078f, - -0.8234583352413359f, - -0.8235325976284275f, - -0.8236068459045104f, - -0.8236810800683125f, - -0.8237553001185619f, - -0.8238295060539873f, - -0.8239036978733161f, - -0.8239778755752777f, - -0.8240520391586009f, - -0.8241261886220157f, - -0.8242003239642502f, - -0.824274445184035f, - -0.8243485522800998f, - -0.8244226452511754f, - -0.8244967240959911f, - -0.8245707888132787f, - -0.8246448394017677f, - -0.8247188758601911f, - -0.8247928981872789f, - -0.8248669063817636f, - -0.8249409004423759f, - -0.8250148803678495f, - -0.8250888461569157f, - -0.8251627978083079f, - -0.8252367353207575f, - -0.8253106586929995f, - -0.8253845679237659f, - -0.8254584630117912f, - -0.8255323439558082f, - -0.8256062107545515f, - -0.8256800634067555f, - -0.8257539019111552f, - -0.8258277262664844f, - -0.8259015364714785f, - -0.825975332524873f, - -0.8260491144254037f, - -0.8261228821718056f, - -0.826196635762815f, - -0.8262703751971684f, - -0.8263441004736025f, - -0.8264178115908533f, - -0.8264915085476581f, - -0.8265651913427542f, - -0.8266388599748795f, - -0.8267125144427708f, - -0.8267861547451666f, - -0.8268597808808049f, - -0.8269333928484248f, - -0.8270069906467639f, - -0.8270805742745616f, - -0.8271541437305576f, - -0.8272276990134899f, - -0.8273012401221f, - -0.8273747670551264f, - -0.8274482798113102f, - -0.8275217783893902f, - -0.8275952627881091f, - -0.8276687330062062f, - -0.8277421890424238f, - -0.8278156308955016f, - -0.8278890585641832f, - -0.8279624720472089f, - -0.8280358713433218f, - -0.8281092564512633f, - -0.8281826273697763f, - -0.8282559840976039f, - -0.8283293266334893f, - -0.8284026549761752f, - -0.8284759691244052f, - -0.8285492690769234f, - -0.8286225548324742f, - -0.8286958263898009f, - -0.8287690837476483f, - -0.8288423269047617f, - -0.828915555859886f, - -0.8289887706117658f, - -0.8290619711591474f, - -0.829135157500775f, - -0.8292083296353969f, - -0.8292814875617576f, - -0.8293546312786044f, - -0.8294277607846827f, - -0.8295008760787415f, - -0.8295739771595262f, - -0.829647064025785f, - -0.829720136676266f, - -0.8297931951097162f, - -0.829866239324884f, - -0.8299392693205182f, - -0.8300122850953676f, - -0.8300852866481803f, - -0.8301582739777058f, - -0.8302312470826936f, - -0.8303042059618937f, - -0.8303771506140551f, - -0.8304500810379284f, - -0.830522997232264f, - -0.8305958991958127f, - -0.8306687869273247f, - -0.8307416604255514f, - -0.8308145196892442f, - -0.8308873647171552f, - -0.8309601955080351f, - -0.8310330120606366f, - -0.8311058143737119f, - -0.8311786024460142f, - -0.8312513762762951f, - -0.8313241358633083f, - -0.831396881205807f, - -0.8314696123025452f, - -0.8315423291522759f, - -0.8316150317537537f, - -0.8316877201057318f, - -0.8317603942069665f, - -0.8318330540562109f, - -0.8319056996522213f, - -0.8319783309937512f, - -0.8320509480795582f, - -0.8321235509083964f, - -0.8321961394790229f, - -0.8322687137901925f, - -0.8323412738406634f, - -0.832413819629191f, - -0.8324863511545332f, - -0.8325588684154461f, - -0.8326313714106878f, - -0.8327038601390159f, - -0.8327763345991888f, - -0.8328487947899637f, - -0.8329212407100994f, - -0.8329936723583548f, - -0.8330660897334886f, - -0.8331384928342606f, - -0.8332108816594289f, - -0.833283256207754f, - -0.8333556164779956f, - -0.8334279624689144f, - -0.8335002941792696f, - -0.8335726116078226f, - -0.833644914753334f, - -0.8337172036145656f, - -0.8337894781902775f, - -0.8338617384792321f, - -0.833933984480191f, - -0.8340062161919168f, - -0.834078433613171f, - -0.8341506367427172f, - -0.8342228255793164f, - -0.8342950001217339f, - -0.8343671603687315f, - -0.8344393063190737f, - -0.8345114379715228f, - -0.834583555324845f, - -0.8346556583778028f, - -0.8347277471291619f, - -0.8347998215776856f, - -0.8348718817221409f, - -0.8349439275612915f, - -0.835015959093904f, - -0.8350879763187432f, - -0.8351599792345754f, - -0.8352319678401671f, - -0.8353039421342852f, - -0.8353759021156952f, - -0.835447847783165f, - -0.8355197791354616f, - -0.835591696171353f, - -0.835663598889606f, - -0.8357354872889888f, - -0.83580736136827f, - -0.8358792211262183f, - -0.8359510665616016f, - -0.836022897673189f, - -0.83609471445975f, - -0.8361665169200544f, - -0.836238305052871f, - -0.8363100788569702f, - -0.836381838331122f, - -0.836453583474097f, - -0.8365253142846665f, - -0.8365970307616f, - -0.8366687329036695f, - -0.8367404207096463f, - -0.8368120941783025f, - -0.8368837533084091f, - -0.8369553980987392f, - -0.8370270285480637f, - -0.837098644655157f, - -0.8371702464187908f, - -0.8372418338377391f, - -0.8373134069107738f, - -0.8373849656366704f, - -0.8374565100142014f, - -0.8375280400421419f, - -0.8375995557192651f, - -0.8376710570443463f, - -0.8377425440161601f, - -0.8378140166334823f, - -0.8378854748950872f, - -0.8379569187997509f, - -0.8380283483462491f, - -0.8380997635333585f, - -0.8381711643598543f, - -0.8382425508245137f, - -0.8383139229261135f, - -0.8383852806634311f, - -0.838456624035243f, - -0.8385279530403276f, - -0.8385992676774613f, - -0.8386705679454242f, - -0.8387418538429928f, - -0.8388131253689465f, - -0.8388843825220638f, - -0.8389556253011243f, - -0.8390268537049065f, - -0.8390980677321901f, - -0.839169267381755f, - -0.8392404526523818f, - -0.8393116235428495f, - -0.8393827800519394f, - -0.8394539221784326f, - -0.8395250499211092f, - -0.8395961632787509f, - -0.8396672622501391f, - -0.8397383468340561f, - -0.8398094170292829f, - -0.8398804728346022f, - -0.8399515142487965f, - -0.8400225412706491f, - -0.8400935538989414f, - -0.8401645521324586f, - -0.8402355359699826f, - -0.8403065054102983f, - -0.8403774604521884f, - -0.8404484010944379f, - -0.840519327335831f, - -0.8405902391751531f, - -0.8406611366111879f, - -0.8407320196427214f, - -0.8408028882685388f, - -0.8408737424874263f, - -0.840944582298169f, - -0.8410154076995534f, - -0.8410862186903661f, - -0.8411570152693941f, - -0.8412277974354234f, - -0.8412985651872421f, - -0.8413693185236363f, - -0.8414400574433955f, - -0.841510781945306f, - -0.8415814920281572f, - -0.8416521876907359f, - -0.8417228689318328f, - -0.8417935357502352f, - -0.8418641881447332f, - -0.8419348261141154f, - -0.8420054496571717f, - -0.8420760587726922f, - -0.8421466534594669f, - -0.8422172337162867f, - -0.8422877995419412f, - -0.8423583509352218f, - -0.8424288878949197f, - -0.8424994104198267f, - -0.8425699185087333f, - -0.8426404121604321f, - -0.842710891373715f, - -0.8427813561473749f, - -0.8428518064802036f, - -0.8429222423709942f, - -0.84299266381854f, - -0.8430630708216347f, - -0.8431334633790709f, - -0.843203841489643f, - -0.8432742051521451f, - -0.843344554365372f, - -0.8434148891281174f, - -0.8434852094391764f, - -0.8435555152973443f, - -0.8436258067014167f, - -0.8436960836501884f, - -0.8437663461424562f, - -0.8438365941770146f, - -0.8439068277526619f, - -0.8439770468681932f, - -0.8440472515224062f, - -0.8441174417140968f, - -0.8441876174420639f, - -0.8442577787051039f, - -0.8443279255020153f, - -0.8443980578315948f, - -0.8444681756926428f, - -0.8445382790839563f, - -0.8446083680043349f, - -0.8446784424525768f, - -0.8447485024274819f, - -0.8448185479278496f, - -0.8448885789524802f, - -0.8449585955001727f, - -0.845028597569728f, - -0.8450985851599466f, - -0.8451685582696297f, - -0.8452385168975773f, - -0.8453084610425915f, - -0.8453783907034734f, - -0.8454483058790255f, - -0.8455182065680489f, - -0.8455880927693461f, - -0.8456579644817199f, - -0.8457278217039729f, - -0.8457976644349087f, - -0.8458674926733294f, - -0.8459373064180392f, - -0.8460071056678418f, - -0.8460768904215417f, - -0.8461466606779422f, - -0.8462164164358487f, - -0.8462861576940646f, - -0.8463558844513966f, - -0.846425596706649f, - -0.8464952944586277f, - -0.8465649777061374f, - -0.8466346464479858f, - -0.8467043006829779f, - -0.8467739404099208f, - -0.8468435656276203f, - -0.8469131763348848f, - -0.8469827725305206f, - -0.8470523542133357f, - -0.8471219213821372f, - -0.8471914740357334f, - -0.8472610121729325f, - -0.8473305357925436f, - -0.8474000448933744f, - -0.8474695394742343f, - -0.8475390195339327f, - -0.8476084850712794f, - -0.8476779360850832f, - -0.8477473725741547f, - -0.8478167945373039f, - -0.8478862019733417f, - -0.8479555948810782f, - -0.8480249732593247f, - -0.8480943371068923f, - -0.8481636864225931f, - -0.8482330212052377f, - -0.8483023414536387f, - -0.8483716471666083f, - -0.8484409383429593f, - -0.8485102149815036f, - -0.8485794770810546f, - -0.8486487246404261f, - -0.8487179576584303f, - -0.8487871761338817f, - -0.8488563800655942f, - -0.8489255694523823f, - -0.8489947442930592f, - -0.8490639045864415f, - -0.8491330503313428f, - -0.849202181526579f, - -0.8492712981709644f, - -0.8493404002633165f, - -0.8494094878024497f, - -0.8494785607871814f, - -0.8495476192163269f, - -0.8496166630887035f, - -0.8496856924031282f, - -0.8497547071584184f, - -0.849823707353391f, - -0.8498926929868638f, - -0.8499616640576549f, - -0.8500306205645831f, - -0.8500995625064658f, - -0.850168489882122f, - -0.850237402690371f, - -0.8503063009300321f, - -0.8503751845999241f, - -0.8504440536988676f, - -0.8505129082256809f, - -0.8505817481791863f, - -0.8506505735582027f, - -0.8507193843615519f, - -0.8507881805880533f, - -0.85085696223653f, - -0.850925729305802f, - -0.8509944817946921f, - -0.8510632197020207f, - -0.8511319430266119f, - -0.8512006517672867f, - -0.8512693459228683f, - -0.8513380254921801f, - -0.8514066904740443f, - -0.8514753408672849f, - -0.8515439766707257f, - -0.8516125978831908f, - -0.8516812045035037f, - -0.8517497965304893f, - -0.8518183739629722f, - -0.851886936799778f, - -0.8519554850397306f, - -0.8520240186816563f, - -0.8520925377243805f, - -0.8521610421667298f, - -0.8522295320075294f, - -0.8522980072456062f, - -0.8523664678797869f, - -0.8524349139088989f, - -0.8525033453317685f, - -0.8525717621472236f, - -0.8526401643540918f, - -0.8527085519512018f, - -0.8527769249373806f, - -0.8528452833114575f, - -0.85291362707226f, - -0.8529819562186189f, - -0.853050270749362f, - -0.8531185706633195f, - -0.85318685595932f, - -0.8532551266361951f, - -0.8533233826927736f, - -0.8533916241278869f, - -0.8534598509403645f, - -0.853528063129039f, - -0.8535962606927402f, - -0.8536644436303006f, - -0.8537326119405508f, - -0.8538007656223234f, - -0.8538689046744506f, - -0.8539370290957653f, - -0.8540051388850992f, - -0.8540732340412858f, - -0.8541413145631582f, - -0.8542093804495504f, - -0.8542774316992952f, - -0.854345468311227f, - -0.85441349028418f, - -0.8544814976169888f, - -0.8545494903084883f, - -0.8546174683575127f, - -0.8546854317628977f, - -0.8547533805234787f, - -0.854821314638092f, - -0.8548892341055724f, - -0.8549571389247568f, - -0.8550250290944816f, - -0.855092904613584f, - -0.8551607654809f, - -0.8552286116952674f, - -0.8552964432555235f, - -0.8553642601605066f, - -0.8554320624090538f, - -0.8554998500000041f, - -0.8555676229321946f, - -0.855635381204466f, - -0.8557031248156559f, - -0.8557708537646044f, - -0.8558385680501496f, - -0.855906267671133f, - -0.8559739526263932f, - -0.8560416229147716f, - -0.8561092785351075f, - -0.8561769194862422f, - -0.8562445457670168f, - -0.8563121573762728f, - -0.8563797543128508f, - -0.8564473365755932f, - -0.8565149041633419f, - -0.8565824570749394f, - -0.8566499953092276f, - -0.8567175188650495f, - -0.8567850277412482f, - -0.8568525219366674f, - -0.8569200014501496f, - -0.8569874662805391f, - -0.85705491642668f, - -0.8571223518874167f, - -0.8571897726615931f, - -0.8572571787480544f, - -0.8573245701456454f, - -0.8573919468532121f, - -0.8574593088695989f, - -0.8575266561936521f, - -0.8575939888242178f, - -0.8576613067601421f, - -0.857728610000272f, - -0.8577958985434535f, - -0.8578631723885345f, - -0.8579304315343609f, - -0.857997675979782f, - -0.8580649057236444f, - -0.8581321207647967f, - -0.8581993211020862f, - -0.858266506734363f, - -0.8583336776604747f, - -0.8584008338792711f, - -0.8584679753896003f, - -0.8585351021903135f, - -0.8586022142802593f, - -0.8586693116582885f, - -0.8587363943232506f, - -0.8588034622739965f, - -0.8588705155093772f, - -0.858937554028244f, - -0.8590045778294475f, - -0.8590715869118396f, - -0.8591385812742721f, - -0.8592055609155976f, - -0.8592725258346675f, - -0.8593394760303349f, - -0.8594064115014524f, - -0.8594733322468737f, - -0.8595402382654512f, - -0.8596071295560395f, - -0.8596740061174908f, - -0.8597408679486612f, - -0.8598077150484037f, - -0.8598745474155732f, - -0.8599413650490247f, - -0.8600081679476137f, - -0.8600749561101946f, - -0.8601417295356235f, - -0.8602084882227566f, - -0.8602752321704493f, - -0.8603419613775584f, - -0.8604086758429402f, - -0.8604753755654524f, - -0.860542060543951f, - -0.8606087307772939f, - -0.8606753862643387f, - -0.8607420270039438f, - -0.8608086529949662f, - -0.8608752642362649f, - -0.8609418607266986f, - -0.8610084424651266f, - -0.861075009450407f, - -0.8611415616813999f, - -0.8612080991569646f, - -0.8612746218759617f, - -0.8613411298372504f, - -0.8614076230396915f, - -0.8614741014821459f, - -0.8615405651634745f, - -0.8616070140825379f, - -0.8616734482381979f, - -0.8617398676293162f, - -0.861806272254755f, - -0.8618726621133759f, - -0.8619390372040419f, - -0.8620053975256144f, - -0.8620717430769583f, - -0.8621380738569353f, - -0.8622043898644098f, - -0.8622706910982442f, - -0.862336977557304f, - -0.8624032492404522f, - -0.8624695061465543f, - -0.8625357482744733f, - -0.8626019756230764f, - -0.8626681881912271f, - -0.8627343859777921f, - -0.8628005689816358f, - -0.862866737201625f, - -0.8629328906366256f, - -0.8629990292855049f, - -0.8630651531471284f, - -0.8631312622203636f, - -0.863197356504078f, - -0.8632634359971388f, - -0.8633295006984143f, - -0.8633955506067716f, - -0.8634615857210793f, - -0.8635276060402062f, - -0.8635936115630212f, - -0.8636596022883926f, - -0.8637255782151899f, - -0.8637915393422828f, - -0.8638574856685416f, - -0.8639234171928352f, - -0.8639893339140345f, - -0.86405523583101f, - -0.8641211229426329f, - -0.8641869952477733f, - -0.8642528527453035f, - -0.8643186954340937f, - -0.8643845233130174f, - -0.8644503363809454f, - -0.8645161346367508f, - -0.864581918079305f, - -0.8646476867074825f, - -0.8647134405201549f, - -0.8647791795161966f, - -0.86484490369448f, - -0.8649106130538803f, - -0.8649763075932705f, - -0.8650419873115258f, - -0.86510765220752f, - -0.8651733022801282f, - -0.8652389375282257f, - -0.8653045579506881f, - -0.8653701635463902f, - -0.8654357543142084f, - -0.8655013302530188f, - -0.8655668913616981f, - -0.8656324376391221f, - -0.8656979690841683f, - -0.8657634856957135f, - -0.8658289874726358f, - -0.8658944744138118f, - -0.86595994651812f, - -0.8660254037844385f, - -0.866090846211646f, - -0.8661562737986204f, - -0.866221686544241f, - -0.8662870844473872f, - -0.8663524675069382f, - -0.8664178357217741f, - -0.866483189090774f, - -0.8665485276128185f, - -0.8666138512867883f, - -0.8666791601115641f, - -0.8667444540860263f, - -0.8668097332090569f, - -0.8668749974795359f, - -0.866940246896347f, - -0.8670054814583708f, - -0.8670707011644903f, - -0.8671359060135866f, - -0.8672010960045443f, - -0.8672662711362452f, - -0.8673314314075732f, - -0.867396576817411f, - -0.8674617073646429f, - -0.8675268230481527f, - -0.8675919238668252f, - -0.867657009819544f, - -0.8677220809051944f, - -0.8677871371226614f, - -0.8678521784708306f, - -0.8679172049485868f, - -0.8679822165548161f, - -0.8680472132884047f, - -0.8681121951482393f, - -0.8681771621332054f, - -0.8682421142421909f, - -0.8683070514740814f, - -0.8683719738277661f, - -0.8684368813021311f, - -0.8685017738960649f, - -0.8685666516084554f, - -0.8686315144381913f, - -0.8686963623841605f, - -0.8687611954452522f, - -0.8688260136203556f, - -0.8688908169083603f, - -0.8689556053081552f, - -0.8690203788186306f, - -0.869085137438677f, - -0.869149881167184f, - -0.8692146100030425f, - -0.8692793239451435f, - -0.8693440229923786f, - -0.8694087071436378f, - -0.8694733763978145f, - -0.8695380307537995f, - -0.8696026702104857f, - -0.8696672947667641f, - -0.8697319044215293f, - -0.8697964991736727f, - -0.8698610790220888f, - -0.8699256439656696f, - -0.8699901940033097f, - -0.8700547291339027f, - -0.8701192493563435f, - -0.8701837546695256f, - -0.8702482450723442f, - -0.8703127205636941f, - -0.8703771811424712f, - -0.87044162680757f, - -0.8705060575578871f, - -0.8705704733923172f, - -0.8706348743097583f, - -0.8706992603091056f, - -0.8707636313892567f, - -0.8708279875491075f, - -0.8708923287875567f, - -0.8709566551035008f, - -0.8710209664958383f, - -0.871085262963466f, - -0.8711495445052839f, - -0.8712138111201894f, - -0.8712780628070819f, - -0.8713422995648598f, - -0.8714065213924227f, - -0.8714707282886704f, - -0.8715349202525026f, - -0.8715990972828198f, - -0.8716632593785215f, - -0.8717274065385088f, - -0.8717915387616824f, - -0.8718556560469439f, - -0.871919758393194f, - -0.8719838457993345f, - -0.8720479182642674f, - -0.8721119757868953f, - -0.8721760183661196f, - -0.8722400460008435f, - -0.8723040586899699f, - -0.8723680564324022f, - -0.8724320392270433f, - -0.872496007072797f, - -0.8725599599685673f, - -0.8726238979132588f, - -0.8726878209057752f, - -0.8727517289450216f, - -0.8728156220299029f, - -0.8728795001593247f, - -0.8729433633321917f, - -0.8730072115474103f, - -0.8730710448038855f, - -0.873134863100525f, - -0.8731986664362341f, - -0.8732624548099204f, - -0.8733262282204896f, - -0.8733899866668506f, - -0.8734537301479097f, - -0.8735174586625756f, - -0.8735811722097554f, - -0.8736448707883578f, - -0.8737085543972914f, - -0.8737722230354654f, - -0.873835876701788f, - -0.8738995153951689f, - -0.8739631391145176f, - -0.8740267478587446f, - -0.8740903416267589f, - -0.8741539204174713f, - -0.8742174842297925f, - -0.8742810330626337f, - -0.8743445669149053f, - -0.8744080857855188f, - -0.874471589673386f, - -0.8745350785774187f, - -0.8745985524965297f, - -0.8746620114296302f, - -0.8747254553756335f, - -0.8747888843334525f, - -0.8748522983020006f, - -0.8749156972801906f, - -0.8749790812669365f, - -0.8750424502611521f, - -0.8751058042617522f, - -0.8751691432676504f, - -0.8752324672777622f, - -0.8752957762910012f, - -0.8753590703062843f, - -0.8754223493225259f, - -0.8754856133386426f, - -0.8755488623535489f, - -0.8756120963661628f, - -0.8756753153753996f, - -0.8757385193801768f, - -0.8758017083794103f, - -0.8758648823720189f, - -0.8759280413569189f, - -0.8759911853330291f, - -0.8760543142992666f, - -0.87611742825455f, - -0.8761805271977979f, - -0.8762436111279298f, - -0.8763066800438636f, - -0.8763697339445192f, - -0.8764327728288162f, - -0.8764957966956748f, - -0.8765588055440143f, - -0.8766217993727554f, - -0.8766847781808189f, - -0.876747741967126f, - -0.876810690730597f, - -0.8768736244701536f, - -0.8769365431847176f, - -0.8769994468732113f, - -0.8770623355345559f, - -0.8771252091676744f, - -0.8771880677714894f, - -0.8772509113449243f, - -0.8773137398869013f, - -0.8773765533963445f, - -0.8774393518721778f, - -0.8775021353133245f, - -0.8775649037187092f, - -0.8776276570872563f, - -0.8776903954178911f, - -0.8777531187095372f, - -0.8778158269611216f, - -0.8778785201715685f, - -0.8779411983398046f, - -0.8780038614647546f, - -0.8780665095453465f, - -0.8781291425805055f, - -0.8781917605691593f, - -0.8782543635102341f, - -0.8783169514026576f, - -0.8783795242453576f, - -0.878442082037262f, - -0.8785046247772984f, - -0.8785671524643953f, - -0.8786296650974814f, - -0.878692162675486f, - -0.8787546451973374f, - -0.8788171126619653f, - -0.8788795650682993f, - -0.87894200241527f, - -0.8790044247018064f, - -0.8790668319268399f, - -0.8791292240892998f, - -0.879191601188119f, - -0.879253963222227f, - -0.8793163101905564f, - -0.8793786420920376f, - -0.8794409589256041f, - -0.879503260690187f, - -0.8795655473847196f, - -0.8796278190081332f, - -0.8796900755593627f, - -0.8797523170373399f, - -0.879814543440999f, - -0.8798767547692738f, - -0.8799389510210978f, - -0.8800011321954055f, - -0.8800632982911317f, - -0.8801254493072114f, - -0.8801875852425789f, - -0.8802497060961698f, - -0.88031181186692f, - -0.8803739025537654f, - -0.8804359781556415f, - -0.8804980386714848f, - -0.8805600841002322f, - -0.880622114440821f, - -0.8806841296921871f, - -0.8807461298532687f, - -0.8808081149230034f, - -0.8808700849003293f, - -0.8809320397841839f, - -0.8809939795735059f, - -0.8810559042672341f, - -0.881117813864308f, - -0.8811797083636657f, - -0.8812415877642474f, - -0.8813034520649919f, - -0.8813653012648407f, - -0.8814271353627326f, - -0.8814889543576092f, - -0.8815507582484099f, - -0.8816125470340773f, - -0.8816743207135516f, - -0.8817360792857748f, - -0.8817978227496878f, - -0.8818595511042342f, - -0.8819212643483549f, - -0.8819829624809935f, - -0.8820446455010919f, - -0.8821063134075935f, - -0.8821679661994418f, - -0.8822296038755807f, - -0.8822912264349534f, - -0.8823528338765041f, - -0.8824144261991775f, - -0.8824760034019185f, - -0.8825375654836711f, - -0.8825991124433811f, - -0.8826606442799936f, - -0.8827221609924545f, - -0.8827836625797101f, - -0.8828451490407055f, - -0.882906620374388f, - -0.8829680765797041f, - -0.8830295176556011f, - -0.8830909436010255f, - -0.883152354414925f, - -0.8832137500962477f, - -0.8832751306439417f, - -0.8833364960569546f, - -0.8833978463342352f, - -0.8834591814747325f, - -0.8835205014773958f, - -0.8835818063411734f, - -0.8836430960650161f, - -0.8837043706478721f, - -0.8837656300886934f, - -0.8838268743864289f, - -0.8838881035400301f, - -0.8839493175484466f, - -0.8840105164106312f, - -0.884071700125534f, - -0.8841328686921075f, - -0.8841940221093028f, - -0.8842551603760722f, - -0.8843162834913685f, - -0.8843773914541446f, - -0.8844384842633525f, - -0.884499561917946f, - -0.8845606244168784f, - -0.884621671759104f, - -0.8846827039435757f, - -0.8847437209692484f, - -0.8848047228350764f, - -0.8848657095400149f, - -0.8849266810830181f, - -0.8849876374630418f, - -0.8850485786790413f, - -0.885109504729973f, - -0.885170415614792f, - -0.8852313113324551f, - -0.8852921918819188f, - -0.8853530572621404f, - -0.8854139074720762f, - -0.8854747425106838f, - -0.8855355623769209f, - -0.8855963670697454f, - -0.885657156588116f, - -0.8857179309309898f, - -0.8857786900973267f, - -0.8858394340860842f, - -0.8859001628962231f, - -0.8859608765267017f, - -0.8860215749764804f, - -0.886082258244518f, - -0.8861429263297763f, - -0.8862035792312145f, - -0.8862642169477942f, - -0.8863248394784753f, - -0.8863854468222204f, - -0.8864460389779899f, - -0.8865066159447466f, - -0.8865671777214513f, - -0.886627724307067f, - -0.8866882557005563f, - -0.8867487719008822f, - -0.8868092729070071f, - -0.8868697587178945f, - -0.8869302293325084f, - -0.8869906847498128f, - -0.887051124968771f, - -0.8871115499883482f, - -0.8871719598075078f, - -0.8872323544252165f, - -0.887292733840438f, - -0.8873530980521387f, - -0.8874134470592829f, - -0.8874737808608384f, - -0.8875340994557699f, - -0.8875944028430444f, - -0.8876546910216285f, - -0.8877149639904898f, - -0.8877752217485946f, - -0.8878354642949108f, - -0.8878956916284065f, - -0.8879559037480491f, - -0.8880161006528072f, - -0.8880762823416493f, - -0.8881364488135446f, - -0.8881966000674614f, - -0.8882567361023694f, - -0.8883168569172383f, - -0.8883769625110381f, - -0.8884370528827379f, - -0.8884971280313096f, - -0.8885571879557228f, - -0.8886172326549489f, - -0.8886772621279584f, - -0.8887372763737231f, - -0.8887972753912147f, - -0.8888572591794055f, - -0.8889172277372669f, - -0.8889771810637717f, - -0.8890371191578927f, - -0.8890970420186033f, - -0.8891569496448758f, - -0.8892168420356842f, - -0.8892767191900023f, - -0.8893365811068045f, - -0.8893964277850641f, - -0.8894562592237567f, - -0.8895160754218557f, - -0.889575876378338f, - -0.8896356620921775f, - -0.8896954325623507f, - -0.8897551877878322f, - -0.8898149277675997f, - -0.8898746525006285f, - -0.8899343619858959f, - -0.8899940562223776f, - -0.8900537352090524f, - -0.8901133989448966f, - -0.8901730474288885f, - -0.8902326806600053f, - -0.8902922986372257f, - -0.890351901359528f, - -0.890411488825891f, - -0.8904710610352942f, - -0.8905306179867158f, - -0.890590159679136f, - -0.8906496861115343f, - -0.8907091972828913f, - -0.8907686931921864f, - -0.8908281738384007f, - -0.8908876392205148f, - -0.8909470893375103f, - -0.8910065241883678f, - -0.8910659437720692f, - -0.8911253480875964f, - -0.8911847371339318f, - -0.8912441109100572f, - -0.8913034694149554f, - -0.8913628126476095f, - -0.8914221406070031f, - -0.8914814532921187f, - -0.8915407507019408f, - -0.8916000328354523f, - -0.8916592996916389f, - -0.8917185512694839f, - -0.8917777875679727f, - -0.8918370085860894f, - -0.8918962143228205f, - -0.8919554047771507f, - -0.8920145799480663f, - -0.8920737398345523f, - -0.8921328844355967f, - -0.8921920137501845f, - -0.8922511277773038f, - -0.8923102265159405f, - -0.8923693099650827f, - -0.8924283781237178f, - -0.892487430990834f, - -0.892546468565419f, - -0.8926054908464612f, - -0.8926644978329497f, - -0.8927234895238734f, - -0.892782465918221f, - -0.8928414270149821f, - -0.8929003728131466f, - -0.8929593033117049f, - -0.8930182185096464f, - -0.8930771184059619f, - -0.8931360029996424f, - -0.8931948722896786f, - -0.8932537262750624f, - -0.8933125649547846f, - -0.8933713883278374f, - -0.8934301963932126f, - -0.8934889891499033f, - -0.8935477665969012f, - -0.8936065287331998f, - -0.8936652755577912f, - -0.8937240070696704f, - -0.8937827232678297f, - -0.8938414241512639f, - -0.893900109718966f, - -0.8939587799699321f, - -0.8940174349031556f, - -0.8940760745176322f, - -0.894134698812356f, - -0.8941933077863241f, - -0.8942519014385311f, - -0.8943104797679737f, - -0.8943690427736475f, - -0.8944275904545493f, - -0.8944861228096761f, - -0.8945446398380252f, - -0.8946031415385931f, - -0.894661627910378f, - -0.8947200989523775f, - -0.8947785546635902f, - -0.8948369950430137f, - -0.8948954200896471f, - -0.8949538298024892f, - -0.8950122241805396f, - -0.895070603222797f, - -0.8951289669282614f, - -0.8951873152959328f, - -0.8952456483248117f, - -0.895303966013898f, - -0.8953622683621927f, - -0.8954205553686967f, - -0.8954788270324119f, - -0.895537083352339f, - -0.8955953243274799f, - -0.895653549956837f, - -0.8957117602394129f, - -0.8957699551742093f, - -0.8958281347602296f, - -0.8958862989964772f, - -0.8959444478819547f, - -0.8960025814156662f, - -0.8960606995966155f, - -0.8961188024238071f, - -0.8961768898962444f, - -0.8962349620129336f, - -0.8962930187728785f, - -0.896351060175085f, - -0.8964090862185579f, - -0.8964670969023032f, - -0.8965250922253271f, - -0.896583072186636f, - -0.8966410367852359f, - -0.8966989860201338f, - -0.8967569198903368f, - -0.8968148383948528f, - -0.8968727415326883f, - -0.8969306293028517f, - -0.8969885017043511f, - -0.8970463587361952f, - -0.8971042003973919f, - -0.897162026686951f, - -0.8972198376038802f, - -0.8972776331471908f, - -0.8973354133158912f, - -0.897393178108992f, - -0.8974509275255024f, - -0.8975086615644343f, - -0.8975663802247974f, - -0.8976240835056035f, - -0.8976817714058627f, - -0.897739443924588f, - -0.89779710106079f, - -0.8978547428134818f, - -0.8979123691816746f, - -0.8979699801643816f, - -0.8980275757606155f, - -0.8980851559693895f, - -0.8981427207897175f, - -0.8982002702206122f, - -0.8982578042610879f, - -0.8983153229101588f, - -0.8983728261668397f, - -0.8984303140301445f, - -0.8984877864990887f, - -0.8985452435726874f, - -0.8986026852499565f, - -0.8986601115299109f, - -0.898717522411567f, - -0.8987749178939413f, - -0.8988322979760505f, - -0.8988896626569107f, - -0.8989470119355395f, - -0.899004345810954f, - -0.8990616642821723f, - -0.8991189673482115f, - -0.8991762550080902f, - -0.8992335272608266f, - -0.8992907841054398f, - -0.8993480255409481f, - -0.8994052515663712f, - -0.8994624621807277f, - -0.8995196573830385f, - -0.8995768371723227f, - -0.8996340015476012f, - -0.8996911505078933f, - -0.8997482840522214f, - -0.8998054021796054f, - -0.8998625048890673f, - -0.8999195921796278f, - -0.8999766640503093f, - -0.9000337205001339f, - -0.9000907615281241f, - -0.9001477871333019f, - -0.9002047973146905f, - -0.9002617920713132f, - -0.9003187714021936f, - -0.9003757353063548f, - -0.9004326837828209f, - -0.9004896168306163f, - -0.9005465344487659f, - -0.9006034366362934f, - -0.9006603233922243f, - -0.900717194715584f, - -0.9007740506053978f, - -0.900830891060692f, - -0.9008877160804919f, - -0.9009445256638241f, - -0.9010013198097153f, - -0.9010580985171928f, - -0.9011148617852827f, - -0.9011716096130129f, - -0.901228341999411f, - -0.9012850589435054f, - -0.9013417604443233f, - -0.9013984465008942f, - -0.9014551171122454f, - -0.9015117722774074f, - -0.9015684119954085f, - -0.9016250362652787f, - -0.9016816450860468f, - -0.9017382384567442f, - -0.9017948163764f, - -0.9018513788440459f, - -0.9019079258587112f, - -0.9019644574194285f, - -0.9020209735252283f, - -0.9020774741751426f, - -0.9021339593682028f, - -0.9021904291034414f, - -0.9022468833798907f, - -0.9023033221965837f, - -0.9023597455525527f, - -0.9024161534468313f, - -0.9024725458784528f, - -0.9025289228464516f, - -0.9025852843498606f, - -0.9026416303877146f, - -0.9026979609590482f, - -0.9027542760628965f, - -0.9028105756982937f, - -0.9028668598642756f, - -0.9029231285598779f, - -0.9029793817841366f, - -0.9030356195360871f, - -0.9030918418147663f, - -0.9031480486192108f, - -0.9032042399484579f, - -0.9032604158015439f, - -0.9033165761775067f, - -0.9033727210753845f, - -0.9034288504942138f, - -0.9034849644330347f, - -0.9035410628908845f, - -0.9035971458668026f, - -0.9036532133598271f, - -0.9037092653689985f, - -0.9037653018933555f, - -0.9038213229319385f, - -0.9038773284837867f, - -0.9039333185479417f, - -0.9039892931234431f, - -0.9040452522093326f, - -0.9041011958046506f, - -0.9041571239084389f, - -0.904213036519739f, - -0.9042689336375935f, - -0.9043248152610438f, - -0.9043806813891326f, - -0.9044365320209028f, - -0.9044923671553977f, - -0.9045481867916599f, - -0.9046039909287333f, - -0.9046597795656617f, - -0.9047155527014895f, - -0.9047713103352605f, - -0.9048270524660198f, - -0.9048827790928112f, - -0.9049384902146814f, - -0.9049941858306748f, - -0.9050498659398376f, - -0.9051055305412148f, - -0.9051611796338539f, - -0.9052168132168004f, - -0.9052724312891014f, - -0.9053280338498038f, - -0.9053836208979553f, - -0.9054391924326026f, - -0.9054947484527941f, - -0.905550288957578f, - -0.905605813946002f, - -0.9056613234171151f, - -0.905716817369966f, - -0.9057722958036044f, - -0.9058277587170788f, - -0.9058832061094392f, - -0.9059386379797356f, - -0.9059940543270186f, - -0.906049455150338f, - -0.9061048404487446f, - -0.9061602102212896f, - -0.9062155644670246f, - -0.9062709031850004f, - -0.906326226374269f, - -0.9063815340338826f, - -0.9064368261628939f, - -0.9064921027603546f, - -0.9065473638253181f, - -0.9066026093568375f, - -0.9066578393539664f, - -0.9067130538157577f, - -0.9067682527412664f, - -0.9068234361295451f, - -0.90687860397965f, - -0.9069337562906348f, - -0.906988893061555f, - -0.9070440142914646f, - -0.907099119979421f, - -0.9071542101244787f, - -0.9072092847256944f, - -0.9072643437821234f, - -0.9073193872928237f, - -0.907374415256851f, - -0.9074294276732632f, - -0.907484424541117f, - -0.9075394058594703f, - -0.9075943716273811f, - -0.9076493218439079f, - -0.9077042565081085f, - -0.9077591756190417f, - -0.9078140791757668f, - -0.9078689671773429f, - -0.9079238396228299f, - -0.9079786965112867f, - -0.908033537841774f, - -0.9080883636133519f, - -0.9081431738250814f, - -0.9081979684760225f, - -0.9082527475652368f, - -0.9083075110917856f, - -0.9083622590547311f, - -0.9084169914531343f, - -0.9084717082860577f, - -0.9085264095525638f, - -0.9085810952517157f, - -0.9086357653825757f, - -0.9086904199442076f, - -0.908745058935674f, - -0.9087996823560401f, - -0.9088542902043687f, - -0.908908882479725f, - -0.9089634591811724f, - -0.9090180203077772f, - -0.9090725658586034f, - -0.9091270958327172f, - -0.9091816102291831f, - -0.9092361090470685f, - -0.9092905922854384f, - -0.90934505994336f, - -0.9093995120198993f, - -0.9094539485141238f, - -0.9095083694251004f, - -0.9095627747518973f, - -0.9096171644935813f, - -0.909671538649221f, - -0.9097258972178847f, - -0.9097802401986411f, - -0.9098345675905587f, - -0.9098888793927067f, - -0.9099431756041545f, - -0.9099974562239723f, - -0.9100517212512291f, - -0.9101059706849955f, - -0.9101602045243421f, - -0.9102144227683397f, - -0.9102686254160588f, - -0.910322812466571f, - -0.9103769839189476f, - -0.9104311397722609f, - -0.9104852800255823f, - -0.9105394046779843f, - -0.9105935137285397f, - -0.9106476071763212f, - -0.9107016850204023f, - -0.9107557472598558f, - -0.9108097938937558f, - -0.9108638249211755f, - -0.9109178403411903f, - -0.9109718401528737f, - -0.911025824355301f, - -0.9110797929475463f, - -0.9111337459286861f, - -0.911187683297795f, - -0.9112416050539495f, - -0.9112955111962244f, - -0.9113494017236978f, - -0.9114032766354451f, - -0.9114571359305438f, - -0.9115109796080703f, - -0.9115648076671024f, - -0.9116186201067178f, - -0.9116724169259949f, - -0.9117261981240109f, - -0.9117799636998449f, - -0.9118337136525756f, - -0.9118874479812823f, - -0.9119411666850435f, - -0.9119948697629396f, - -0.9120485572140492f, - -0.912102229037454f, - -0.9121558852322331f, - -0.912209525797468f, - -0.9122631507322382f, - -0.9123167600356266f, - -0.9123703537067134f, - -0.9124239317445807f, - -0.9124774941483105f, - -0.9125310409169852f, - -0.9125845720496868f, - -0.9126380875454982f, - -0.9126915874035029f, - -0.9127450716227835f, - -0.9127985402024239f, - -0.9128519931415079f, - -0.91290543043912f, - -0.9129588520943437f, - -0.9130122581062642f, - -0.9130656484739663f, - -0.9131190231965356f, - -0.9131723822730564f, - -0.9132257257026158f, - -0.9132790534842988f, - -0.9133323656171923f, - -0.9133856621003821f, - -0.9134389429329554f, - -0.9134922081139991f, - -0.913545457642601f, - -0.9135986915178479f, - -0.913651909738828f, - -0.9137051123046296f, - -0.9137582992143412f, - -0.9138114704670508f, - -0.9138646260618478f, - -0.9139177659978214f, - -0.9139708902740612f, - -0.9140239988896565f, - -0.9140770918436978f, - -0.9141301691352743f, - -0.9141832307634781f, - -0.9142362767273988f, - -0.9142893070261283f, - -0.9143423216587568f, - -0.9143953206243775f, - -0.9144483039220809f, - -0.91450127155096f, - -0.9145542235101065f, - -0.9146071597986135f, - -0.914660080415574f, - -0.9147129853600814f, - -0.9147658746312286f, - -0.9148187482281096f, - -0.9148716061498186f, - -0.9149244483954497f, - -0.914977274964098f, - -0.9150300858548575f, - -0.9150828810668236f, - -0.9151356605990918f, - -0.915188424450758f, - -0.9152411726209175f, - -0.9152939051086668f, - -0.9153466219131022f, - -0.915399323033321f, - -0.9154520084684193f, - -0.9155046782174948f, - -0.9155573322796449f, - -0.9156099706539679f, - -0.915662593339561f, - -0.9157152003355229f, - -0.9157677916409523f, - -0.9158203672549483f, - -0.9158729271766095f, - -0.9159254714050358f, - -0.9159779999393258f, - -0.916030512778581f, - -0.9160830099219005f, - -0.9161354913683855f, - -0.9161879571171356f, - -0.9162404071672533f, - -0.9162928415178389f, - -0.9163452601679944f, - -0.9163976631168208f, - -0.9164500503634215f, - -0.9165024219068978f, - -0.9165547777463531f, - -0.9166071178808896f, - -0.9166594423096107f, - -0.9167117510316198f, - -0.9167640440460213f, - -0.916816321351918f, - -0.9168685829484149f, - -0.9169208288346162f, - -0.9169730590096272f, - -0.9170252734725522f, - -0.917077472222497f, - -0.9171296552585669f, - -0.9171818225798685f, - -0.9172339741855068f, - -0.9172861100745888f, - -0.9173382302462212f, - -0.9173903346995108f, - -0.9174424234335652f, - -0.9174944964474911f, - -0.9175465537403968f, - -0.9175985953113902f, - -0.9176506211595798f, - -0.9177026312840737f, - -0.9177546256839813f, - -0.9178066043584105f, - -0.9178585673064723f, - -0.9179105145272751f, - -0.9179624460199296f, - -0.9180143617835449f, - -0.9180662618172328f, - -0.918118146120103f, - -0.9181700146912671f, - -0.9182218675298354f, - -0.9182737046349208f, - -0.9183255260056339f, - -0.9183773316410877f, - -0.9184291215403936f, - -0.9184808957026646f, - -0.9185326541270136f, - -0.9185843968125541f, - -0.9186361237583988f, - -0.9186878349636617f, - -0.9187395304274567f, - -0.9187912101488984f, - -0.9188428741271005f, - -0.9188945223611784f, - -0.9189461548502468f, - -0.9189977715934214f, - -0.9190493725898172f, - -0.9191009578385503f, - -0.9191525273387366f, - -0.9192040810894933f, - -0.9192556190899358f, - -0.9193071413391818f, - -0.9193586478363482f, - -0.9194101385805529f, - -0.9194616135709129f, - -0.9195130728065466f, - -0.9195645162865722f, - -0.9196159440101086f, - -0.9196673559762739f, - -0.9197187521841875f, - -0.9197701326329691f, - -0.9198214973217373f, - -0.9198728462496133f, - -0.9199241794157162f, - -0.9199754968191673f, - -0.9200267984590861f, - -0.9200780843345948f, - -0.9201293544448138f, - -0.9201806087888653f, - -0.9202318473658704f, - -0.9202830701749513f, - -0.9203342772152303f, - -0.9203854684858306f, - -0.9204366439858742f, - -0.9204878037144846f, - -0.920538947670785f, - -0.9205900758538997f, - -0.9206411882629518f, - -0.9206922848970659f, - -0.9207433657553663f, - -0.9207944308369783f, - -0.9208454801410262f, - -0.9208965136666358f, - -0.9209475314129318f, - -0.9209985333790415f, - -0.9210495195640896f, - -0.9211004899672034f, - -0.9211514445875085f, - -0.9212023834241331f, - -0.9212533064762034f, - -0.9213042137428475f, - -0.9213551052231922f, - -0.9214059809163667f, - -0.9214568408214984f, - -0.921507684937716f, - -0.9215585132641487f, - -0.9216093257999249f, - -0.9216601225441743f, - -0.9217109034960265f, - -0.9217616686546117f, - -0.9218124180190594f, - -0.9218631515885004f, - -0.9219138693620653f, - -0.9219645713388855f, - -0.9220152575180915f, - -0.9220659278988151f, - -0.9221165824801882f, - -0.9221672212613431f, - -0.9222178442414114f, - -0.9222684514195262f, - -0.9223190427948201f, - -0.9223696183664268f, - -0.922420178133479f, - -0.9224707220951106f, - -0.9225212502504555f, - -0.9225717625986485f, - -0.9226222591388231f, - -0.922672739870115f, - -0.922723204791658f, - -0.922773653902589f, - -0.9228240872020422f, - -0.9228745046891546f, - -0.9229249063630607f, - -0.9229752922228988f, - -0.923025662267804f, - -0.9230760164969144f, - -0.9231263549093659f, - -0.9231766775042974f, - -0.9232269842808456f, - -0.9232772752381491f, - -0.9233275503753456f, - -0.9233778096915741f, - -0.9234280531859732f, - -0.9234782808576825f, - -0.9235284927058405f, - -0.9235786887295873f, - -0.9236288689280627f, - -0.9236790333004075f, - -0.9237291818457611f, - -0.9237793145632648f, - -0.9238294314520595f, - -0.9238795325112865f, - -0.9239296177400876f, - -0.923979687137604f, - -0.9240297407029782f, - -0.9240797784353523f, - -0.9241298003338694f, - -0.9241798063976716f, - -0.9242297966259027f, - -0.9242797710177058f, - -0.924329729572225f, - -0.9243796722886038f, - -0.9244295991659865f, - -0.9244795102035179f, - -0.924529405400343f, - -0.9245792847556061f, - -0.9246291482684533f, - -0.9246789959380292f, - -0.924728827763481f, - -0.9247786437439537f, - -0.9248284438785946f, - -0.9248782281665493f, - -0.9249279966069661f, - -0.9249777491989912f, - -0.9250274859417729f, - -0.9250772068344577f, - -0.9251269118761952f, - -0.9251766010661328f, - -0.9252262744034194f, - -0.9252759318872036f, - -0.9253255735166346f, - -0.9253751992908619f, - -0.9254248092090355f, - -0.9254744032703047f, - -0.92552398147382f, - -0.9255735438187319f, - -0.9256230903041915f, - -0.9256726209293492f, - -0.9257221356933566f, - -0.9257716345953654f, - -0.9258211176345276f, - -0.9258705848099947f, - -0.9259200361209196f, - -0.9259694715664547f, - -0.9260188911457534f, - -0.9260682948579683f, - -0.9261176827022531f, - -0.9261670546777617f, - -0.9262164107836482f, - -0.9262657510190666f, - -0.9263150753831715f, - -0.9263643838751182f, - -0.9264136764940607f, - -0.926462953239156f, - -0.9265122141095583f, - -0.9265614591044246f, - -0.9266106882229099f, - -0.9266599014641721f, - -0.9267090988273669f, - -0.926758280311652f, - -0.9268074459161836f, - -0.9268565956401207f, - -0.9269057294826202f, - -0.9269548474428406f, - -0.9270039495199399f, - -0.927053035713077f, - -0.9271021060214106f, - -0.9271511604441006f, - -0.9272001989803056f, - -0.9272492216291855f, - -0.9272982283899007f, - -0.9273472192616116f, - -0.927396194243478f, - -0.9274451533346612f, - -0.9274940965343222f, - -0.9275430238416229f, - -0.927591935255724f, - -0.9276408307757883f, - -0.9276897104009769f, - -0.9277385741304536f, - -0.9277874219633802f, - -0.9278362538989202f, - -0.927885069936236f, - -0.9279338700744925f, - -0.9279826543128525f, - -0.9280314226504804f, - -0.928080175086541f, - -0.9281289116201981f, - -0.9281776322506171f, - -0.9282263369769631f, - -0.9282750257984019f, - -0.9283236987140987f, - -0.9283723557232196f, - -0.9284209968249311f, - -0.9284696220183999f, - -0.9285182313027922f, - -0.9285668246772755f, - -0.9286154021410171f, - -0.928663963693185f, - -0.9287125093329465f, - -0.92876103905947f, - -0.928809552871924f, - -0.9288580507694776f, - -0.9289065327512991f, - -0.9289549988165582f, - -0.9290034489644242f, - -0.9290518831940675f, - -0.9291003015046575f, - -0.9291487038953647f, - -0.92919709036536f, - -0.9292454609138144f, - -0.9292938155398988f, - -0.9293421542427848f, - -0.9293904770216435f, - -0.929438783875648f, - -0.9294870748039699f, - -0.9295353498057821f, - -0.9295836088802566f, - -0.9296318520265677f, - -0.9296800792438878f, - -0.9297282905313914f, - -0.9297764858882511f, - -0.9298246653136427f, - -0.9298728288067394f, - -0.9299209763667168f, - -0.9299691079927491f, - -0.9300172236840121f, - -0.9300653234396812f, - -0.9301134072589324f, - -0.9301614751409415f, - -0.930209527084885f, - -0.9302575630899396f, - -0.930305583155282f, - -0.93035358728009f, - -0.9304015754635403f, - -0.930449547704811f, - -0.9304975040030801f, - -0.9305454443575261f, - -0.9305933687673269f, - -0.9306412772316619f, - -0.9306891697497099f, - -0.9307370463206509f, - -0.9307849069436636f, - -0.9308327516179284f, - -0.9308805803426256f, - -0.9309283931169358f, - -0.9309761899400391f, - -0.9310239708111172f, - -0.9310717357293505f, - -0.9311194846939218f, - -0.9311672177040119f, - -0.9312149347588037f, - -0.9312626358574785f, - -0.9313103209992203f, - -0.931357990183211f, - -0.9314056434086344f, - -0.9314532806746731f, - -0.9315009019805123f, - -0.9315485073253347f, - -0.9315960967083254f, - -0.9316436701286684f, - -0.9316912275855489f, - -0.9317387690781518f, - -0.931786294605663f, - -0.9318338041672675f, - -0.9318812977621513f, - -0.931928775389501f, - -0.9319762370485032f, - -0.932023682738344f, - -0.9320711124582108f, - -0.932118526207291f, - -0.9321659239847723f, - -0.9322133057898421f, - -0.9322606716216887f, - -0.9323080214795004f, - -0.9323553553624665f, - -0.9324026732697752f, - -0.9324499752006159f, - -0.9324972611541782f, - -0.9325445311296519f, - -0.9325917851262272f, - -0.932639023143094f, - -0.9326862451794431f, - -0.9327334512344653f, - -0.9327806413073522f, - -0.9328278153972944f, - -0.9328749735034844f, - -0.9329221156251131f, - -0.932969241761374f, - -0.9330163519114587f, - -0.9330634460745606f, - -0.9331105242498717f, - -0.9331575864365869f, - -0.9332046326338984f, - -0.9332516628410011f, - -0.9332986770570884f, - -0.9333456752813549f, - -0.9333926575129954f, - -0.9334396237512053f, - -0.9334865739951791f, - -0.9335335082441125f, - -0.9335804264972016f, - -0.9336273287536425f, - -0.9336742150126311f, - -0.9337210852733644f, - -0.933767939535039f, - -0.9338147777968525f, - -0.9338616000580019f, - -0.9339084063176852f, - -0.9339551965750998f, - -0.934001970829445f, - -0.9340487290799184f, - -0.9340954713257194f, - -0.9341421975660466f, - -0.9341889078001f, - -0.9342356020270786f, - -0.9342822802461824f, - -0.9343289424566118f, - -0.9343755886575675f, - -0.9344222188482497f, - -0.9344688330278595f, - -0.9345154311955988f, - -0.9345620133506681f, - -0.9346085794922699f, - -0.9346551296196063f, - -0.9347016637318797f, - -0.9347481818282921f, - -0.9347946839080475f, - -0.9348411699703483f, - -0.9348876400143984f, - -0.9349340940394008f, - -0.9349805320445607f, - -0.9350269540290814f, - -0.9350733599921683f, - -0.9351197499330254f, - -0.9351661238508583f, - -0.9352124817448723f, - -0.9352588236142733f, - -0.9353051494582667f, - -0.9353514592760591f, - -0.935397753066857f, - -0.9354440308298674f, - -0.9354902925642967f, - -0.9355365382693529f, - -0.9355827679442426f, - -0.935628981588175f, - -0.9356751792003573f, - -0.9357213607799983f, - -0.9357675263263062f, - -0.9358136758384908f, - -0.9358598093157607f, - -0.9359059267573259f, - -0.9359520281623952f, - -0.93599811353018f, - -0.9360441828598897f, - -0.9360902361507355f, - -0.9361362734019277f, - -0.9361822946126778f, - -0.9362282997821971f, - -0.9362742889096974f, - -0.9363202619943911f, - -0.9363662190354898f, - -0.9364121600322063f, - -0.9364580849837534f, - -0.9365039938893445f, - -0.9365498867481923f, - -0.9365957635595109f, - -0.9366416243225141f, - -0.9366874690364164f, - -0.9367332977004317f, - -0.9367791103137749f, - -0.9368249068756612f, - -0.9368706873853062f, - -0.9369164518419247f, - -0.936962200244733f, - -0.937007932592947f, - -0.9370536488857836f, - -0.9370993491224587f, - -0.9371450333021898f, - -0.9371907014241937f, - -0.9372363534876886f, - -0.9372819894918915f, - -0.9373276094360209f, - -0.9373732133192944f, - -0.9374188011409317f, - -0.9374643729001508f, - -0.9375099285961715f, - -0.9375554682282122f, - -0.9376009917954938f, - -0.9376464992972355f, - -0.9376919907326581f, - -0.9377374661009811f, - -0.9377829254014265f, - -0.9378283686332146f, - -0.9378737957955672f, - -0.9379192068877055f, - -0.9379646019088514f, - -0.9380099808582274f, - -0.9380553437350561f, - -0.9381006905385595f, - -0.9381460212679611f, - -0.938191335922484f, - -0.9382366345013522f, - -0.9382819170037888f, - -0.9383271834290182f, - -0.9383724337762649f, - -0.9384176680447537f, - -0.938462886233709f, - -0.9385080883423562f, - -0.938553274369921f, - -0.9385984443156289f, - -0.9386435981787065f, - -0.9386887359583791f, - -0.938733857653874f, - -0.9387789632644177f, - -0.9388240527892379f, - -0.9388691262275611f, - -0.938914183578616f, - -0.9389592248416293f, - -0.9390042500158307f, - -0.9390492591004475f, - -0.9390942520947092f, - -0.9391392289978441f, - -0.9391841898090826f, - -0.9392291345276534f, - -0.9392740631527872f, - -0.9393189756837129f, - -0.9393638721196624f, - -0.9394087524598654f, - -0.9394536167035535f, - -0.9394984648499575f, - -0.939543296898309f, - -0.9395881128478399f, - -0.9396329126977827f, - -0.9396776964473691f, - -0.939722464095832f, - -0.9397672156424044f, - -0.9398119510863198f, - -0.9398566704268109f, - -0.9399013736631119f, - -0.9399460607944568f, - -0.9399907318200802f, - -0.940035386739216f, - -0.9400800255510995f, - -0.9401246482549657f, - -0.9401692548500503f, - -0.9402138453355884f, - -0.9402584197108164f, - -0.9403029779749702f, - -0.940347520127287f, - -0.9403920461670027f, - -0.9404365560933547f, - -0.9404810499055808f, - -0.9405255276029177f, - -0.940569989184604f, - -0.9406144346498775f, - -0.9406588639979772f, - -0.9407032772281406f, - -0.9407476743396083f, - -0.9407920553316184f, - -0.940836420203411f, - -0.9408807689542251f, - -0.9409251015833021f, - -0.9409694180898814f, - -0.9410137184732043f, - -0.941058002732511f, - -0.9411022708670429f, - -0.9411465228760418f, - -0.9411907587587496f, - -0.9412349785144076f, - -0.9412791821422587f, - -0.9413233696415452f, - -0.9413675410115104f, - -0.9414116962513968f, - -0.9414558353604481f, - -0.941499958337908f, - -0.9415440651830208f, - -0.9415881558950301f, - -0.941632230473181f, - -0.9416762889167175f, - -0.9417203312248857f, - -0.9417643573969302f, - -0.9418083674320972f, - -0.9418523613296317f, - -0.9418963390887809f, - -0.9419403007087905f, - -0.941984246188908f, - -0.9420281755283791f, - -0.9420720887264526f, - -0.9421159857823752f, - -0.9421598666953948f, - -0.9422037314647599f, - -0.9422475800897183f, - -0.942291412569519f, - -0.9423352289034109f, - -0.9423790290906436f, - -0.9424228131304658f, - -0.9424665810221279f, - -0.9425103327648796f, - -0.9425540683579717f, - -0.9425977878006542f, - -0.9426414910921783f, - -0.9426851782317951f, - -0.9427288492187563f, - -0.942772504052313f, - -0.9428161427317177f, - -0.9428597652562224f, - -0.9429033716250801f, - -0.9429469618375429f, - -0.9429905358928643f, - -0.9430340937902977f, - -0.9430776355290968f, - -0.9431211611085153f, - -0.9431646705278076f, - -0.9432081637862276f, - -0.9432516408830312f, - -0.9432951018174723f, - -0.943338546588807f, - -0.9433819751962901f, - -0.9434253876391784f, - -0.9434687839167273f, - -0.9435121640281937f, - -0.9435555279728336f, - -0.9435988757499049f, - -0.9436422073586642f, - -0.9436855227983695f, - -0.9437288220682779f, - -0.943772105167648f, - -0.9438153720957381f, - -0.9438586228518069f, - -0.943901857435113f, - -0.9439450758449158f, - -0.9439882780804747f, - -0.9440314641410499f, - -0.9440746340259005f, - -0.9441177877342875f, - -0.9441609252654711f, - -0.9442040466187124f, - -0.9442471517932728f, - -0.944290240788413f, - -0.944333313603395f, - -0.9443763702374809f, - -0.944419410689933f, - -0.9444624349600134f, - -0.9445054430469851f, - -0.9445484349501113f, - -0.9445914106686555f, - -0.9446343702018807f, - -0.9446773135490513f, - -0.9447202407094313f, - -0.9447631516822854f, - -0.9448060464668779f, - -0.9448489250624744f, - -0.9448917874683391f, - -0.9449346336837391f, - -0.944977463707939f, - -0.9450202775402057f, - -0.9450630751798046f, - -0.9451058566260037f, - -0.9451486218780689f, - -0.9451913709352681f, - -0.9452341037968682f, - -0.9452768204621375f, - -0.9453195209303437f, - -0.9453622052007555f, - -0.9454048732726411f, - -0.9454475251452696f, - -0.9454901608179103f, - -0.9455327802898327f, - -0.9455753835603061f, - -0.9456179706286008f, - -0.9456605414939869f, - -0.9457030961557356f, - -0.9457456346131168f, - -0.9457881568654021f, - -0.9458306629118629f, - -0.945873152751771f, - -0.945915626384398f, - -0.9459580838090161f, - -0.9460005250248982f, - -0.9460429500313171f, - -0.9460853588275453f, - -0.9461277514128565f, - -0.9461701277865243f, - -0.9462124879478225f, - -0.9462548318960258f, - -0.9462971596304077f, - -0.9463394711502439f, - -0.9463817664548083f, - -0.9464240455433773f, - -0.9464663084152257f, - -0.94650855506963f, - -0.9465507855058652f, - -0.9465929997232091f, - -0.9466351977209374f, - -0.9466773794983275f, - -0.946719545054656f, - -0.9467616943892014f, - -0.9468038275012407f, - -0.9468459443900524f, - -0.9468880450549144f, - -0.9469301294951056f, - -0.9469721977099048f, - -0.9470142496985915f, - -0.9470562854604446f, - -0.9470983049947442f, - -0.9471403083007701f, - -0.9471822953778031f, - -0.947224266225123f, - -0.947266220842011f, - -0.9473081592277482f, - -0.9473500813816164f, - -0.9473919873028964f, - -0.9474338769908711f, - -0.9474757504448217f, - -0.9475176076640318f, - -0.9475594486477835f, - -0.9476012733953599f, - -0.9476430819060446f, - -0.9476848741791213f, - -0.9477266502138735f, - -0.9477684100095856f, - -0.9478101535655422f, - -0.9478518808810278f, - -0.9478935919553273f, - -0.9479352867877263f, - -0.9479769653775105f, - -0.9480186277239652f, - -0.9480602738263768f, - -0.9481019036840319f, - -0.9481435172962172f, - -0.9481851146622191f, - -0.9482266957813253f, - -0.9482682606528233f, - -0.9483098092760012f, - -0.9483513416501462f, - -0.9483928577745473f, - -0.948434357648493f, - -0.9484758412712725f, - -0.9485173086421744f, - -0.9485587597604884f, - -0.9486001946255045f, - -0.9486416132365126f, - -0.9486830155928029f, - -0.9487244016936658f, - -0.9487657715383925f, - -0.9488071251262743f, - -0.948848462456602f, - -0.948889783528668f, - -0.9489310883417633f, - -0.9489723768951813f, - -0.9490136491882138f, - -0.9490549052201541f, - -0.9490961449902944f, - -0.9491373684979292f, - -0.9491785757423513f, - -0.9492197667228552f, - -0.9492609414387344f, - -0.9493020998892844f, - -0.9493432420737989f, - -0.9493843679915739f, - -0.9494254776419039f, - -0.9494665710240848f, - -0.9495076481374126f, - -0.9495487089811836f, - -0.9495897535546937f, - -0.9496307818572399f, - -0.9496717938881193f, - -0.949712789646629f, - -0.9497537691320669f, - -0.9497947323437302f, - -0.9498356792809175f, - -0.949876609942927f, - -0.9499175243290577f, - -0.949958422438608f, - -0.9499993042708773f, - -0.9500401698251651f, - -0.9500810191007717f, - -0.9501218520969964f, - -0.9501626688131398f, - -0.9502034692485026f, - -0.9502442534023859f, - -0.9502850212740904f, - -0.9503257728629181f, - -0.9503665081681698f, - -0.9504072271891487f, - -0.9504479299251564f, - -0.9504886163754956f, - -0.9505292865394688f, - -0.9505699404163799f, - -0.9506105780055317f, - -0.9506511993062283f, - -0.9506918043177729f, - -0.9507323930394708f, - -0.9507729654706256f, - -0.950813521610543f, - -0.9508540614585271f, - -0.9508945850138839f, - -0.9509350922759188f, - -0.9509755832439382f, - -0.9510160579172474f, - -0.9510565162951535f, - -0.9510969583769632f, - -0.9511373841619836f, - -0.9511777936495217f, - -0.9512181868388853f, - -0.9512585637293821f, - -0.9512989243203208f, - -0.9513392686110091f, - -0.9513795966007561f, - -0.9514199082888708f, - -0.9514602036746626f, - -0.9515004827574406f, - -0.9515407455365149f, - -0.9515809920111956f, - -0.951621222180793f, - -0.9516614360446182f, - -0.9517016336019816f, - -0.9517418148521947f, - -0.9517819797945685f, - -0.9518221284284157f, - -0.9518622607530477f, - -0.9519023767677772f, - -0.9519424764719161f, - -0.9519825598647784f, - -0.9520226269456765f, - -0.9520626777139244f, - -0.9521027121688349f, - -0.9521427303097232f, - -0.9521827321359028f, - -0.9522227176466888f, - -0.9522626868413954f, - -0.9523026397193383f, - -0.9523425762798327f, - -0.9523824965221945f, - -0.9524224004457393f, - -0.9524622880497836f, - -0.9525021593336439f, - -0.9525420142966373f, - -0.9525818529380804f, - -0.9526216752572908f, - -0.9526614812535861f, - -0.9527012709262846f, - -0.952741044274704f, - -0.9527808012981631f, - -0.9528205419959802f, - -0.9528602663674751f, - -0.9528999744119666f, - -0.9529396661287746f, - -0.9529793415172186f, - -0.9530190005766195f, - -0.953058643306297f, - -0.9530982697055721f, - -0.9531378797737657f, - -0.9531774735101998f, - -0.9532170509141948f, - -0.9532566119850734f, - -0.9532961567221577f, - -0.9533356851247696f, - -0.9533751971922321f, - -0.9534146929238682f, - -0.9534541723190013f, - -0.9534936353769543f, - -0.9535330820970519f, - -0.9535725124786175f, - -0.953611926520976f, - -0.9536513242234512f, - -0.9536907055853693f, - -0.9537300706060543f, - -0.9537694192848326f, - -0.9538087516210293f, - -0.9538480676139707f, - -0.9538873672629832f, - -0.9539266505673936f, - -0.9539659175265283f, - -0.9540051681397147f, - -0.9540444024062803f, - -0.954083620325553f, - -0.9541228218968605f, - -0.9541620071195314f, - -0.9542011759928936f, - -0.9542403285162769f, - -0.9542794646890097f, - -0.9543185845104221f, - -0.9543576879798427f, - -0.9543967750966027f, - -0.9544358458600315f, - -0.9544749002694602f, - -0.9545139383242189f, - -0.9545529600236397f, - -0.9545919653670529f, - -0.9546309543537912f, - -0.9546699269831856f, - -0.9547088832545688f, - -0.9547478231672731f, - -0.9547867467206315f, - -0.9548256539139771f, - -0.954864544746643f, - -0.9549034192179627f, - -0.9549422773272703f, - -0.9549811190739004f, - -0.9550199444571866f, - -0.9550587534764641f, - -0.9550975461310679f, - -0.9551363224203335f, - -0.955175082343596f, - -0.9552138259001915f, - -0.9552525530894562f, - -0.9552912639107268f, - -0.9553299583633393f, - -0.9553686364466312f, - -0.9554072981599395f, - -0.9554459435026021f, - -0.9554845724739564f, - -0.9555231850733407f, - -0.9555617813000933f, - -0.9556003611535532f, - -0.9556389246330588f, - -0.9556774717379499f, - -0.9557160024675652f, - -0.9557545168212455f, - -0.95579301479833f, - -0.9558314963981598f, - -0.9558699616200746f, - -0.9559084104634163f, - -0.9559468429275255f, - -0.955985259011744f, - -0.9560236587154131f, - -0.956062042037875f, - -0.9561004089784723f, - -0.9561387595365475f, - -0.9561770937114431f, - -0.9562154115025026f, - -0.9562537129090694f, - -0.9562919979304872f, - -0.9563302665661f, - -0.9563685188152519f, - -0.9564067546772875f, - -0.9564449741515522f, - -0.9564831772373903f, - -0.9565213639341476f, - -0.9565595342411697f, - -0.9565976881578027f, - -0.9566358256833929f, - -0.9566739468172865f, - -0.9567120515588303f, - -0.9567501399073718f, - -0.9567882118622583f, - -0.9568262674228369f, - -0.956864306588456f, - -0.9569023293584638f, - -0.9569403357322088f, - -0.9569783257090395f, - -0.9570162992883054f, - -0.957054256469355f, - -0.957092197251539f, - -0.9571301216342066f, - -0.9571680296167083f, - -0.957205921198394f, - -0.9572437963786152f, - -0.9572816551567225f, - -0.9573194975320674f, - -0.9573573235040008f, - -0.9573951330718756f, - -0.9574329262350433f, - -0.9574707029928566f, - -0.9575084633446679f, - -0.9575462072898303f, - -0.9575839348276972f, - -0.9576216459576223f, - -0.957659340678959f, - -0.9576970189910615f, - -0.9577346808932844f, - -0.9577723263849826f, - -0.9578099554655104f, - -0.9578475681342233f, - -0.9578851643904771f, - -0.9579227442336276f, - -0.9579603076630302f, - -0.957997854678042f, - -0.9580353852780192f, - -0.9580728994623192f, - -0.9581103972302987f, - -0.9581478785813153f, - -0.958185343514727f, - -0.9582227920298918f, - -0.9582602241261677f, - -0.9582976398029136f, - -0.9583350390594886f, - -0.9583724218952511f, - -0.9584097883095615f, - -0.9584471383017789f, - -0.9584844718712637f, - -0.9585217890173756f, - -0.9585590897394761f, - -0.9585963740369253f, - -0.958633641909085f, - -0.9586708933553155f, - -0.9587081283749799f, - -0.9587453469674392f, - -0.9587825491320562f, - -0.958819734868193f, - -0.9588569041752127f, - -0.9588940570524785f, - -0.9589311934993539f, - -0.9589683135152021f, - -0.9590054170993872f, - -0.9590425042512737f, - -0.9590795749702262f, - -0.959116629255609f, - -0.9591536671067875f, - -0.9591906885231272f, - -0.9592276935039936f, - -0.9592646820487525f, - -0.9593016541567704f, - -0.9593386098274131f, - -0.9593755490600485f, - -0.9594124718540428f, - -0.9594493782087637f, - -0.9594862681235784f, - -0.9595231415978556f, - -0.9595599986309626f, - -0.9595968392222683f, - -0.9596336633711415f, - -0.9596704710769514f, - -0.9597072623390667f, - -0.9597440371568573f, - -0.9597807955296934f, - -0.9598175374569446f, - -0.9598542629379816f, - -0.9598909719721752f, - -0.9599276645588964f, - -0.9599643406975163f, - -0.9600010003874067f, - -0.9600376436279391f, - -0.9600742704184861f, - -0.9601108807584197f, - -0.9601474746471126f, - -0.9601840520839381f, - -0.9602206130682693f, - -0.9602571575994796f, - -0.960293685676943f, - -0.9603301973000334f, - -0.9603666924681257f, - -0.9604031711805938f, - -0.960439633436813f, - -0.9604760792361586f, - -0.9605125085780064f, - -0.9605489214617315f, - -0.9605853178867106f, - -0.9606216978523194f, - -0.9606580613579353f, - -0.9606944084029346f, - -0.9607307389866951f, - -0.9607670531085934f, - -0.9608033507680084f, - -0.9608396319643171f, - -0.9608758966968987f, - -0.9609121449651309f, - -0.9609483767683935f, - -0.960984592106065f, - -0.9610207909775255f, - -0.9610569733821541f, - -0.961093139319331f, - -0.9611292887884367f, - -0.961165421788852f, - -0.9612015383199571f, - -0.9612376383811336f, - -0.9612737219717629f, - -0.9613097890912269f, - -0.961345839738907f, - -0.961381873914186f, - -0.9614178916164462f, - -0.9614538928450707f, - -0.9614898775994426f, - -0.961525845878945f, - -0.9615617976829618f, - -0.961597733010877f, - -0.9616336518620751f, - -0.9616695542359401f, - -0.9617054401318571f, - -0.9617413095492111f, - -0.961777162487388f, - -0.9618129989457727f, - -0.9618488189237515f, - -0.9618846224207107f, - -0.961920409436037f, - -0.9619561799691168f, - -0.9619919340193374f, - -0.9620276715860857f, - -0.9620633926687502f, - -0.9620990972667182f, - -0.9621347853793782f, - -0.9621704570061183f, - -0.9622061121463279f, - -0.9622417507993956f, - -0.9622773729647109f, - -0.9623129786416633f, - -0.9623485678296428f, - -0.9623841405280396f, - -0.9624196967362443f, - -0.9624552364536473f, - -0.9624907596796398f, - -0.9625262664136133f, - -0.9625617566549594f, - -0.9625972304030695f, - -0.9626326876573362f, - -0.962668128417152f, - -0.9627035526819095f, - -0.9627389604510017f, - -0.9627743517238218f, - -0.9628097264997635f, - -0.9628450847782208f, - -0.9628804265585875f, - -0.9629157518402583f, - -0.9629510606226278f, - -0.9629863529050913f, - -0.9630216286870436f, - -0.9630568879678804f, - -0.9630921307469975f, - -0.9631273570237913f, - -0.9631625667976581f, - -0.9631977600679944f, - -0.9632329368341975f, - -0.9632680970956641f, - -0.9633032408517924f, - -0.9633383681019798f, - -0.9633734788456247f, - -0.9634085730821248f, - -0.9634436508108798f, - -0.963478712031288f, - -0.9635137567427489f, - -0.9635487849446613f, - -0.9635837966364261f, - -0.9636187918174428f, - -0.9636537704871119f, - -0.9636887326448338f, - -0.9637236782900096f, - -0.9637586074220406f, - -0.9637935200403285f, - -0.9638284161442744f, - -0.9638632957332809f, - -0.9638981588067502f, - -0.9639330053640852f, - -0.9639678354046883f, - -0.9640026489279633f, - -0.9640374459333128f, - -0.9640722264201416f, - -0.964106990387853f, - -0.9641417378358519f, - -0.964176468763542f, - -0.9642111831703294f, - -0.9642458810556183f, - -0.9642805624188145f, - -0.964315227259324f, - -0.9643498755765526f, - -0.9643845073699066f, - -0.9644191226387924f, - -0.9644537213826174f, - -0.9644883036007882f, - -0.9645228692927125f, - -0.964557418457798f, - -0.9645919510954529f, - -0.9646264672050852f, - -0.9646609667861035f, - -0.9646954498379168f, - -0.9647299163599343f, - -0.964764366351565f, - -0.9647987998122194f, - -0.9648332167413067f, - -0.9648676171382378f, - -0.9649020010024226f, - -0.9649363683332723f, - -0.9649707191301982f, - -0.9650050533926116f, - -0.9650393711199239f, - -0.9650736723115473f, - -0.965107956966894f, - -0.965142225085377f, - -0.9651764766664083f, - -0.9652107117094015f, - -0.9652449302137699f, - -0.9652791321789275f, - -0.9653133176042876f, - -0.965347486489265f, - -0.9653816388332738f, - -0.9654157746357293f, - -0.9654498938960461f, - -0.96548399661364f, - -0.9655180827879261f, - -0.965552152418321f, - -0.9655862055042406f, - -0.9656202420451014f, - -0.9656542620403202f, - -0.9656882654893141f, - -0.9657222523915003f, - -0.965756222746297f, - -0.9657901765531215f, - -0.9658241138113922f, - -0.9658580345205277f, - -0.9658919386799466f, - -0.9659258262890683f, - -0.9659596973473118f, - -0.9659935518540967f, - -0.9660273898088433f, - -0.9660612112109715f, - -0.9660950160599019f, - -0.966128804355055f, - -0.9661625760958521f, - -0.9661963312817148f, - -0.9662300699120641f, - -0.9662637919863221f, - -0.9662974975039111f, - -0.9663311864642539f, - -0.9663648588667725f, - -0.9663985147108904f, - -0.9664321539960308f, - -0.9664657767216176f, - -0.9664993828870742f, - -0.9665329724918251f, - -0.9665665455352943f, - -0.9666001020169073f, - -0.9666336419360885f, - -0.9666671652922635f, - -0.9667006720848574f, - -0.9667341623132969f, - -0.9667676359770075f, - -0.9668010930754161f, - -0.9668345336079486f, - -0.9668679575740331f, - -0.9669013649730961f, - -0.9669347558045657f, - -0.9669681300678692f, - -0.967001487762435f, - -0.9670348288876917f, - -0.967068153443068f, - -0.9671014614279925f, - -0.9671347528418947f, - -0.9671680276842043f, - -0.9672012859543512f, - -0.9672345276517651f, - -0.9672677527758767f, - -0.9673009613261168f, - -0.9673341533019163f, - -0.9673673287027064f, - -0.9674004875279185f, - -0.9674336297769847f, - -0.9674667554493369f, - -0.9674998645444078f, - -0.9675329570616299f, - -0.967566033000436f, - -0.9675990923602596f, - -0.9676321351405344f, - -0.9676651613406937f, - -0.9676981709601721f, - -0.9677311639984034f, - -0.9677641404548231f, - -0.9677971003288653f, - -0.967830043619966f, - -0.96786297032756f, - -0.9678958804510839f, - -0.9679287739899731f, - -0.9679616509436645f, - -0.9679945113115941f, - -0.9680273550931996f, - -0.9680601822879178f, - -0.9680929928951865f, - -0.9681257869144431f, - -0.9681585643451258f, - -0.9681913251866731f, - -0.9682240694385238f, - -0.9682567971001165f, - -0.9682895081708905f, - -0.9683222026502855f, - -0.9683548805377412f, - -0.9683875418326976f, - -0.9684201865345949f, - -0.9684528146428741f, - -0.9684854261569761f, - -0.9685180210763418f, - -0.9685505994004128f, - -0.968583161128631f, - -0.9686157062604386f, - -0.9686482347952775f, - -0.9686807467325906f, - -0.9687132420718209f, - -0.9687457208124116f, - -0.9687781829538059f, - -0.9688106284954479f, - -0.9688430574367813f, - -0.968875469777251f, - -0.968907865516301f, - -0.9689402446533766f, - -0.968972607187923f, - -0.9690049531193854f, - -0.9690372824472097f, - -0.9690695951708419f, - -0.9691018912897287f, - -0.9691341708033159f, - -0.9691664337110513f, - -0.9691986800123815f, - -0.9692309097067544f, - -0.9692631227936174f, - -0.9692953192724185f, - -0.9693274991426062f, - -0.9693596624036294f, - -0.9693918090549363f, - -0.9694239390959765f, - -0.9694560525261994f, - -0.969488149345055f, - -0.9695202295519928f, - -0.9695522931464634f, - -0.9695843401279175f, - -0.969616370495806f, - -0.9696483842495798f, - -0.9696803813886906f, - -0.9697123619125897f, - -0.9697443258207299f, - -0.9697762731125628f, - -0.9698082037875414f, - -0.9698401178451181f, - -0.9698720152847468f, - -0.9699038961058803f, - -0.9699357603079728f, - -0.9699676078904778f, - -0.9699994388528501f, - -0.970031253194544f, - -0.9700630509150145f, - -0.9700948320137166f, - -0.9701265964901058f, - -0.9701583443436379f, - -0.9701900755737689f, - -0.9702217901799551f, - -0.970253488161653f, - -0.9702851695183194f, - -0.9703168342494117f, - -0.9703484823543873f, - -0.9703801138327036f, - -0.9704117286838189f, - -0.9704433269071913f, - -0.9704749085022796f, - -0.9705064734685425f, - -0.970538021805439f, - -0.9705695535124288f, - -0.9706010685889717f, - -0.9706325670345273f, - -0.9706640488485561f, - -0.9706955140305186f, - -0.970726962579876f, - -0.9707583944960889f, - -0.970789809778619f, - -0.9708212084269279f, - -0.970852590440478f, - -0.970883955818731f, - -0.9709153045611498f, - -0.9709466366671969f, - -0.9709779521363361f, - -0.9710092509680301f, - -0.9710405331617432f, - -0.9710717987169386f, - -0.9711030476330816f, - -0.971134279909636f, - -0.971165495546067f, - -0.9711966945418395f, - -0.971227876896419f, - -0.9712590426092712f, - -0.9712901916798623f, - -0.9713213241076581f, - -0.9713524398921256f, - -0.9713835390327313f, - -0.9714146215289428f, - -0.971445687380227f, - -0.9714767365860517f, - -0.971507769145885f, - -0.9715387850591954f, - -0.9715697843254509f, - -0.9716007669441207f, - -0.9716317329146739f, - -0.9716626822365797f, - -0.9716936149093083f, - -0.971724530932329f, - -0.9717554303051125f, - -0.971786313027129f, - -0.97181717909785f, - -0.9718480285167459f, - -0.9718788612832884f, - -0.9719096773969492f, - -0.9719404768572004f, - -0.9719712596635139f, - -0.9720020258153628f, - -0.972032775312219f, - -0.9720635081535567f, - -0.9720942243388486f, - -0.9721249238675688f, - -0.9721556067391905f, - -0.9721862729531892f, - -0.9722169225090384f, - -0.9722475554062134f, - -0.972278171644189f, - -0.9723087712224411f, - -0.9723393541404448f, - -0.9723699203976767f, - -0.9724004699936124f, - -0.9724310029277288f, - -0.9724615191995027f, - -0.9724920188084114f, - -0.9725225017539318f, - -0.9725529680355419f, - -0.9725834176527197f, - -0.9726138506049435f, - -0.9726442668916917f, - -0.972674666512443f, - -0.9727050494666767f, - -0.9727354157538725f, - -0.9727657653735093f, - -0.9727960983250676f, - -0.9728264146080277f, - -0.9728567142218701f, - -0.9728869971660754f, - -0.9729172634401247f, - -0.9729475130434997f, - -0.972977745975682f, - -0.9730079622361534f, - -0.9730381618243961f, - -0.973068344739893f, - -0.9730985109821264f, - -0.97312866055058f, - -0.9731587934447368f, - -0.9731889096640807f, - -0.9732190092080951f, - -0.9732490920762653f, - -0.9732791582680749f, - -0.9733092077830092f, - -0.973339240620553f, - -0.973369256780192f, - -0.9733992562614118f, - -0.9734292390636984f, - -0.9734592051865377f, - -0.9734891546294167f, - -0.9735190873918219f, - -0.9735490034732407f, - -0.9735789028731603f, - -0.9736087855910683f, - -0.9736386516264528f, - -0.9736685009788023f, - -0.9736983336476048f, - -0.9737281496323494f, - -0.9737579489325253f, - -0.9737877315476221f, - -0.9738174974771289f, - -0.9738472467205361f, - -0.9738769792773335f, - -0.9739066951470123f, - -0.9739363943290629f, - -0.9739660768229766f, - -0.9739957426282444f, - -0.9740253917443586f, - -0.9740550241708107f, - -0.9740846399070932f, - -0.9741142389526984f, - -0.9741438213071195f, - -0.9741733869698492f, - -0.9742029359403812f, - -0.9742324682182093f, - -0.9742619838028269f, - -0.9742914826937288f, - -0.9743209648904092f, - -0.9743504303923634f, - -0.9743798791990859f, - -0.9744093113100725f, - -0.9744387267248187f, - -0.9744681254428208f, - -0.9744975074635748f, - -0.9745268727865771f, - -0.9745562214113247f, - -0.974585553337315f, - -0.974614868564045f, - -0.9746441670910124f, - -0.9746734489177155f, - -0.9747027140436524f, - -0.9747319624683215f, - -0.9747611941912216f, - -0.9747904092118522f, - -0.9748196075297126f, - -0.9748487891443022f, - -0.9748779540551213f, - -0.9749071022616697f, - -0.9749362337634486f, - -0.9749653485599584f, - -0.9749944466507006f, - -0.9750235280351759f, - -0.9750525927128869f, - -0.9750816406833349f, - -0.9751106719460226f, - -0.975139686500452f, - -0.9751686843461267f, - -0.9751976654825493f, - -0.9752266299092235f, - -0.9752555776256527f, - -0.9752845086313411f, - -0.9753134229257928f, - -0.9753423205085128f, - -0.9753712013790053f, - -0.9754000655367759f, - -0.9754289129813299f, - -0.975457743712173f, - -0.9754865577288113f, - -0.9755153550307508f, - -0.9755441356174983f, - -0.9755728994885606f, - -0.975601646643445f, - -0.9756303770816586f, - -0.9756590908027092f, - -0.9756877878061048f, - -0.975716468091354f, - -0.975745131657965f, - -0.9757737785054467f, - -0.9758024086333084f, - -0.9758310220410595f, - -0.9758596187282096f, - -0.9758881986942689f, - -0.9759167619387472f, - -0.9759453084611559f, - -0.9759738382610051f, - -0.9760023513378066f, - -0.9760308476910708f, - -0.9760593273203108f, - -0.9760877902250376f, - -0.9761162364047641f, - -0.9761446658590021f, - -0.9761730785872653f, - -0.9762014745890665f, - -0.9762298538639193f, - -0.976258216411337f, - -0.976286562230834f, - -0.9763148913219245f, - -0.9763432036841233f, - -0.9763714993169449f, - -0.9763997782199045f, - -0.9764280403925178f, - -0.9764562858343007f, - -0.9764845145447686f, - -0.9765127265234382f, - -0.9765409217698261f, - -0.9765691002834493f, - -0.9765972620638246f, - -0.9766254071104696f, - -0.9766535354229021f, - -0.9766816470006404f, - -0.9767097418432024f, - -0.9767378199501067f, - -0.9767658813208723f, - -0.9767939259550187f, - -0.9768219538520648f, - -0.9768499650115308f, - -0.9768779594329363f, - -0.9769059371158021f, - -0.9769338980596487f, - -0.9769618422639966f, - -0.9769897697283676f, - -0.9770176804522824f, - -0.9770455744352636f, - -0.9770734516768327f, - -0.9771013121765122f, - -0.9771291559338244f, - -0.9771569829482929f, - -0.9771847932194403f, - -0.9772125867467905f, - -0.9772403635298668f, - -0.9772681235681934f, - -0.9772958668612948f, - -0.9773235934086957f, - -0.9773513032099207f, - -0.9773789962644952f, - -0.9774066725719446f, - -0.977434332131795f, - -0.9774619749435719f, - -0.9774896010068019f, - -0.9775172103210117f, - -0.9775448028857284f, - -0.9775723787004789f, - -0.9775999377647908f, - -0.9776274800781916f, - -0.97765500564021f, - -0.9776825144503738f, - -0.9777100065082119f, - -0.9777374818132532f, - -0.977764940365027f, - -0.9777923821630625f, - -0.9778198072068898f, - -0.9778472154960388f, - -0.9778746070300401f, - -0.977901981808424f, - -0.9779293398307217f, - -0.9779566810964646f, - -0.9779840056051837f, - -0.9780113133564111f, - -0.9780386043496788f, - -0.9780658785845195f, - -0.9780931360604654f, - -0.9781203767770497f, - -0.9781476007338056f, - -0.9781748079302667f, - -0.9782019983659664f, - -0.9782291720404396f, - -0.9782563289532199f, - -0.9782834691038426f, - -0.978310592491842f, - -0.9783376991167538f, - -0.9783647889781135f, - -0.9783918620754569f, - -0.97841891840832f, - -0.9784459579762392f, - -0.9784729807787513f, - -0.9784999868153934f, - -0.9785269760857024f, - -0.978553948589216f, - -0.978580904325472f, - -0.9786078432940087f, - -0.9786347654943645f, - -0.9786616709260779f, - -0.9786885595886877f, - -0.9787154314817338f, - -0.9787422866047552f, - -0.9787691249572921f, - -0.9787959465388841f, - -0.9788227513490724f, - -0.978849539387397f, - -0.9788763106533995f, - -0.9789030651466206f, - -0.9789298028666022f, - -0.9789565238128861f, - -0.9789832279850147f, - -0.9790099153825298f, - -0.9790365860049747f, - -0.979063239851892f, - -0.9790898769228253f, - -0.9791164972173182f, - -0.9791431007349143f, - -0.9791696874751579f, - -0.9791962574375934f, - -0.9792228106217657f, - -0.9792493470272197f, - -0.9792758666535005f, - -0.979302369500154f, - -0.9793288555667261f, - -0.9793553248527627f, - -0.9793817773578104f, - -0.9794082130814159f, - -0.9794346320231264f, - -0.979461034182489f, - -0.9794874195590513f, - -0.9795137881523613f, - -0.9795401399619674f, - -0.9795664749874177f, - -0.9795927932282611f, - -0.9796190946840464f, - -0.9796453793543235f, - -0.9796716472386415f, - -0.9796978983365507f, - -0.9797241326476007f, - -0.9797503501713428f, - -0.9797765509073271f, - -0.979802734855105f, - -0.9798289020142276f, - -0.9798550523842469f, - -0.9798811859647144f, - -0.9799073027551827f, - -0.9799334027552039f, - -0.979959485964331f, - -0.979985552382117f, - -0.9800116020081157f, - -0.98003763484188f, - -0.9800636508829642f, - -0.9800896501309225f, - -0.9801156325853098f, - -0.9801415982456801f, - -0.980167547111589f, - -0.9801934791825918f, - -0.9802193944582444f, - -0.9802452929381023f, - -0.9802711746217218f, - -0.9802970395086597f, - -0.9803228875984725f, - -0.9803487188907177f, - -0.9803745333849524f, - -0.9804003310807342f, - -0.9804261119776212f, - -0.9804518760751719f, - -0.9804776233729443f, - -0.9805033538704978f, - -0.9805290675673908f, - -0.9805547644631836f, - -0.9805804445574351f, - -0.9806061078497058f, - -0.9806317543395554f, - -0.9806573840265452f, - -0.9806829969102355f, - -0.9807085929901878f, - -0.9807341722659629f, - -0.9807597347371233f, - -0.9807852804032303f, - -0.9808108092638469f, - -0.9808363213185349f, - -0.9808618165668576f, - -0.980887295008378f, - -0.9809127566426599f, - -0.9809382014692665f, - -0.980963629487762f, - -0.9809890406977106f, - -0.9810144350986774f, - -0.9810398126902266f, - -0.9810651734719236f, - -0.981090517443334f, - -0.9811158446040236f, - -0.981141154953558f, - -0.9811664484915039f, - -0.9811917252174277f, - -0.9812169851308965f, - -0.9812422282314773f, - -0.9812674545187375f, - -0.981292663992245f, - -0.981317856651568f, - -0.9813430324962745f, - -0.9813681915259332f, - -0.9813933337401132f, - -0.9814184591383835f, - -0.9814435677203137f, - -0.9814686594854733f, - -0.9814937344334329f, - -0.9815187925637622f, - -0.9815438338760324f, - -0.9815688583698141f, - -0.9815938660446787f, - -0.9816188569001972f, - -0.9816438309359422f, - -0.9816687881514853f, - -0.9816937285463989f, - -0.9817186521202556f, - -0.9817435588726284f, - -0.9817684488030906f, - -0.9817933219112157f, - -0.9818181781965774f, - -0.9818430176587498f, - -0.9818678402973074f, - -0.981892646111825f, - -0.9819174351018772f, - -0.9819422072670395f, - -0.9819669626068872f, - -0.9819917011209965f, - -0.9820164228089433f, - -0.982041127670304f, - -0.982065815704655f, - -0.9820904869115739f, - -0.9821151412906374f, - -0.9821397788414236f, - -0.9821643995635095f, - -0.9821890034564742f, - -0.9822135905198954f, - -0.9822381607533525f, - -0.9822627141564235f, - -0.9822872507286887f, - -0.9823117704697271f, - -0.9823362733791186f, - -0.9823607594564436f, - -0.9823852287012823f, - -0.9824096811132155f, - -0.9824341166918242f, - -0.9824585354366899f, - -0.9824829373473938f, - -0.9825073224235181f, - -0.9825316906646447f, - -0.9825560420703566f, - -0.9825803766402359f, - -0.9826046943738659f, - -0.9826289952708299f, - -0.9826532793307118f, - -0.9826775465530949f, - -0.9827017969375639f, - -0.982726030483703f, - -0.9827502471910973f, - -0.9827744470593314f, - -0.9827986300879907f, - -0.9828227962766612f, - -0.9828469456249287f, - -0.9828710781323792f, - -0.9828951937985995f, - -0.9829192926231757f, - -0.9829433746056958f, - -0.9829674397457465f, - -0.9829914880429159f, - -0.9830155194967914f, - -0.983039534106962f, - -0.9830635318730154f, - -0.983087512794541f, - -0.9831114768711273f, - -0.9831354241023644f, - -0.9831593544878415f, - -0.9831832680271488f, - -0.9832071647198762f, - -0.9832310445656145f, - -0.9832549075639545f, - -0.9832787537144875f, - -0.9833025830168044f, - -0.9833263954704973f, - -0.9833501910751581f, - -0.9833739698303791f, - -0.9833977317357527f, - -0.9834214767908718f, - -0.9834452049953296f, - -0.9834689163487195f, - -0.9834926108506354f, - -0.983516288500671f, - -0.9835399492984206f, - -0.9835635932434789f, - -0.9835872203354409f, - -0.9836108305739015f, - -0.9836344239584562f, - -0.9836580004887008f, - -0.9836815601642315f, - -0.9837051029846442f, - -0.9837286289495358f, - -0.983752138058503f, - -0.9837756303111433f, - -0.9837991057070539f, - -0.9838225642458327f, - -0.9838460059270773f, - -0.9838694307503867f, - -0.983892838715359f, - -0.9839162298215935f, - -0.9839396040686891f, - -0.9839629614562455f, - -0.9839863019838623f, - -0.9840096256511398f, - -0.9840329324576779f, - -0.9840562224030779f, - -0.9840794954869401f, - -0.9841027517088663f, - -0.9841259910684574f, - -0.9841492135653157f, - -0.984172419199043f, - -0.984195607969242f, - -0.984218779875515f, - -0.984241934917465f, - -0.9842650730946954f, - -0.9842881944068098f, - -0.9843112988534118f, - -0.9843343864341056f, - -0.9843574571484957f, - -0.9843805109961868f, - -0.9844035479767836f, - -0.9844265680898916f, - -0.9844495713351162f, - -0.9844725577120637f, - -0.9844955272203396f, - -0.9845184798595507f, - -0.9845414156293035f, - -0.9845643345292054f, - -0.9845872365588633f, - -0.9846101217178848f, - -0.984632990005878f, - -0.9846558414224507f, - -0.9846786759672118f, - -0.9847014936397697f, - -0.9847242944397336f, - -0.9847470783667126f, - -0.9847698454203166f, - -0.9847925956001554f, - -0.9848153289058391f, - -0.984838045336978f, - -0.9848607448931833f, - -0.9848834275740657f, - -0.9849060933792367f, - -0.9849287423083078f, - -0.9849513743608911f, - -0.9849739895365985f, - -0.984996587835043f, - -0.9850191692558368f, - -0.9850417337985933f, - -0.9850642814629258f, - -0.9850868122484481f, - -0.9851093261547739f, - -0.9851318231815175f, - -0.9851543033282935f, - -0.9851767665947168f, - -0.9851992129804021f, - -0.9852216424849654f, - -0.9852440551080216f, - -0.9852664508491874f, - -0.9852888297080785f, - -0.985311191684312f, - -0.985333536777504f, - -0.9853558649872725f, - -0.9853781763132342f, - -0.985400470755007f, - -0.9854227483122092f, - -0.9854450089844587f, - -0.9854672527713741f, - -0.9854894796725745f, - -0.985511689687679f, - -0.9855338828163067f, - -0.9855560590580776f, - -0.9855782184126118f, - -0.9856003608795296f, - -0.9856224864584513f, - -0.9856445951489979f, - -0.9856666869507908f, - -0.9856887618634514f, - -0.9857108198866011f, - -0.9857328610198623f, - -0.9857548852628574f, - -0.9857768926152087f, - -0.9857988830765393f, - -0.9858208566464723f, - -0.9858428133246313f, - -0.9858647531106401f, - -0.9858866760041226f, - -0.9859085820047033f, - -0.9859304711120067f, - -0.9859523433256581f, - -0.9859741986452822f, - -0.985996037070505f, - -0.9860178586009518f, - -0.9860396632362493f, - -0.9860614509760233f, - -0.9860832218199009f, - -0.9861049757675087f, - -0.9861267128184743f, - -0.986148432972425f, - -0.986170136228989f, - -0.9861918225877937f, - -0.9862134920484682f, - -0.9862351446106409f, - -0.9862567802739409f, - -0.9862783990379974f, - -0.98630000090244f, - -0.9863215858668984f, - -0.9863431539310031f, - -0.9863647050943842f, - -0.9863862393566726f, - -0.9864077567174991f, - -0.9864292571764954f, - -0.9864507407332929f, - -0.9864722073875233f, - -0.986493657138819f, - -0.9865150899868124f, - -0.9865365059311363f, - -0.9865579049714236f, - -0.9865792871073078f, - -0.9866006523384223f, - -0.9866220006644014f, - -0.986643332084879f, - -0.9866646465994895f, - -0.9866859442078679f, - -0.9867072249096495f, - -0.986728488704469f, - -0.9867497355919627f, - -0.9867709655717659f, - -0.9867921786435155f, - -0.9868133748068476f, - -0.9868345540613993f, - -0.9868557164068071f, - -0.9868768618427093f, - -0.9868979903687428f, - -0.986919101984546f, - -0.9869401966897567f, - -0.9869612744840142f, - -0.9869823353669567f, - -0.9870033793382236f, - -0.9870244063974541f, - -0.9870454165442881f, - -0.9870664097783656f, - -0.9870873860993268f, - -0.9871083455068124f, - -0.987129288000463f, - -0.9871502135799199f, - -0.987171122244825f, - -0.9871920139948192f, - -0.987212888829545f, - -0.9872337467486447f, - -0.987254587751761f, - -0.9872754118385365f, - -0.9872962190086146f, - -0.9873170092616387f, - -0.9873377825972527f, - -0.9873585390151003f, - -0.9873792785148262f, - -0.9874000010960748f, - -0.9874207067584914f, - -0.9874413955017208f, - -0.9874620673254086f, - -0.9874827222292007f, - -0.9875033602127431f, - -0.9875239812756824f, - -0.9875445854176649f, - -0.9875651726383379f, - -0.9875857429373481f, - -0.9876062963143437f, - -0.9876268327689721f, - -0.9876473523008817f, - -0.9876678549097205f, - -0.9876883405951377f, - -0.9877088093567818f, - -0.9877292611943025f, - -0.9877496961073491f, - -0.9877701140955714f, - -0.9877905151586196f, - -0.9878108992961444f, - -0.9878312665077962f, - -0.9878516167932261f, - -0.9878719501520854f, - -0.9878922665840258f, - -0.987912566088699f, - -0.9879328486657574f, - -0.9879531143148532f, - -0.9879733630356394f, - -0.9879935948277689f, - -0.9880138096908953f, - -0.9880340076246715f, - -0.9880541886287523f, - -0.9880743527027914f, - -0.9880944998464434f, - -0.988114630059363f, - -0.9881347433412055f, - -0.9881548396916261f, - -0.9881749191102804f, - -0.9881949815968245f, - -0.9882150271509147f, - -0.9882350557722072f, - -0.988255067460359f, - -0.9882750622150274f, - -0.9882950400358693f, - -0.9883150009225429f, - -0.9883349448747059f, - -0.9883548718920167f, - -0.9883747819741335f, - -0.9883946751207158f, - -0.9884145513314222f, - -0.9884344106059124f, - -0.9884542529438458f, - -0.9884740783448828f, - -0.9884938868086834f, - -0.9885136783349086f, - -0.9885334529232186f, - -0.988553210573275f, - -0.9885729512847393f, - -0.9885926750572733f, - -0.9886123818905387f, - -0.9886320717841981f, - -0.988651744737914f, - -0.9886714007513494f, - -0.9886910398241674f, - -0.9887106619560316f, - -0.9887302671466055f, - -0.9887498553955536f, - -0.98876942670254f, - -0.9887889810672296f, - -0.9888085184892867f, - -0.9888280389683773f, - -0.9888475425041665f, - -0.9888670290963203f, - -0.9888864987445045f, - -0.9889059514483859f, - -0.9889253872076309f, - -0.9889448060219067f, - -0.9889642078908802f, - -0.9889835928142193f, - -0.9890029607915917f, - -0.9890223118226655f, - -0.9890416459071093f, - -0.9890609630445917f, - -0.9890802632347816f, - -0.9890995464773484f, - -0.9891188127719618f, - -0.9891380621182915f, - -0.9891572945160076f, - -0.9891765099647809f, - -0.989195708464282f, - -0.9892148900141816f, - -0.9892340546141515f, - -0.989253202263863f, - -0.9892723329629883f, - -0.9892914467111994f, - -0.9893105435081687f, - -0.9893296233535691f, - -0.989348686247074f, - -0.9893677321883562f, - -0.9893867611770895f, - -0.989405773212948f, - -0.9894247682956061f, - -0.9894437464247379f, - -0.9894627076000185f, - -0.9894816518211227f, - -0.9895005790877264f, - -0.9895194893995048f, - -0.9895383827561343f, - -0.9895572591572906f, - -0.9895761186026509f, - -0.9895949610918917f, - -0.9896137866246902f, - -0.9896325952007237f, - -0.9896513868196702f, - -0.9896701614812075f, - -0.989688919185014f, - -0.9897076599307681f, - -0.9897263837181489f, - -0.9897450905468355f, - -0.9897637804165075f, - -0.9897824533268443f, - -0.9898011092775262f, - -0.9898197482682335f, - -0.989838370298647f, - -0.9898569753684473f, - -0.9898755634773158f, - -0.9898941346249338f, - -0.9899126888109834f, - -0.9899312260351465f, - -0.9899497462971054f, - -0.9899682495965428f, - -0.9899867359331418f, - -0.9900052053065855f, - -0.9900236577165575f, - -0.9900420931627416f, - -0.9900605116448218f, - -0.9900789131624828f, - -0.990097297715409f, - -0.9901156653032855f, - -0.9901340159257974f, - -0.9901523495826308f, - -0.9901706662734708f, - -0.9901889659980042f, - -0.990207248755917f, - -0.9902255145468963f, - -0.9902437633706288f, - -0.990261995226802f, - -0.9902802101151033f, - -0.990298408035221f, - -0.9903165889868428f, - -0.9903347529696576f, - -0.9903528999833537f, - -0.9903710300276205f, - -0.9903891431021473f, - -0.9904072392066238f, - -0.9904253183407397f, - -0.9904433805041852f, - -0.9904614256966512f, - -0.9904794539178282f, - -0.9904974651674073f, - -0.9905154594450799f, - -0.9905334367505377f, - -0.9905513970834728f, - -0.9905693404435773f, - -0.9905872668305437f, - -0.9906051762440647f, - -0.990623068683834f, - -0.9906409441495444f, - -0.9906588026408899f, - -0.9906766441575645f, - -0.9906944686992625f, - -0.9907122762656784f, - -0.990730066856507f, - -0.9907478404714436f, - -0.9907655971101836f, - -0.9907833367724228f, - -0.9908010594578571f, - -0.9908187651661832f, - -0.9908364538970971f, - -0.9908541256502963f, - -0.9908717804254775f, - -0.9908894182223388f, - -0.9909070390405772f, - -0.9909246428798915f, - -0.9909422297399796f, - -0.9909597996205404f, - -0.9909773525212727f, - -0.9909948884418758f, - -0.9910124073820491f, - -0.9910299093414928f, - -0.9910473943199065f, - -0.9910648623169909f, - -0.9910823133324467f, - -0.9910997473659748f, - -0.9911171644172765f, - -0.9911345644860532f, - -0.991151947572007f, - -0.9911693136748401f, - -0.9911866627942545f, - -0.9912039949299535f, - -0.9912213100816395f, - -0.9912386082490164f, - -0.9912558894317876f, - -0.9912731536296568f, - -0.9912904008423282f, - -0.9913076310695066f, - -0.9913248443108964f, - -0.991342040566203f, - -0.9913592198351313f, - -0.9913763821173874f, - -0.991393527412677f, - -0.9914106557207062f, - -0.9914277670411819f, - -0.9914448613738104f, - -0.9914619387182991f, - -0.9914789990743554f, - -0.991496042441687f, - -0.9915130688200017f, - -0.9915300782090077f, - -0.9915470706084138f, - -0.9915640460179288f, - -0.9915810044372617f, - -0.9915979458661219f, - -0.9916148703042192f, - -0.9916317777512638f, - -0.9916486682069655f, - -0.9916655416710353f, - -0.9916823981431839f, - -0.9916992376231227f, - -0.9917160601105628f, - -0.9917328656052162f, - -0.9917496541067948f, - -0.9917664256150112f, - -0.9917831801295777f, - -0.9917999176502075f, - -0.9918166381766134f, - -0.9918333417085092f, - -0.9918500282456088f, - -0.9918666977876262f, - -0.9918833503342753f, - -0.9918999858852715f, - -0.9919166044403293f, - -0.9919332059991641f, - -0.9919497905614912f, - -0.9919663581270269f, - -0.991982908695487f, - -0.991999442266588f, - -0.9920159588400465f, - -0.9920324584155794f, - -0.9920489409929042f, - -0.9920654065717386f, - -0.9920818551518f, - -0.992098286732807f, - -0.9921147013144778f, - -0.9921310988965314f, - -0.9921474794786864f, - -0.9921638430606625f, - -0.9921801896421791f, - -0.9921965192229564f, - -0.9922128318027144f, - -0.9922291273811734f, - -0.9922454059580544f, - -0.9922616675330784f, - -0.992277912105967f, - -0.9922941396764415f, - -0.992310350244224f, - -0.9923265438090367f, - -0.9923427203706023f, - -0.9923588799286434f, - -0.9923750224828831f, - -0.9923911480330451f, - -0.9924072565788528f, - -0.9924233481200302f, - -0.9924394226563017f, - -0.9924554801873917f, - -0.9924715207130254f, - -0.9924875442329275f, - -0.9925035507468237f, - -0.9925195402544397f, - -0.9925355127555016f, - -0.9925514682497356f, - -0.9925674067368684f, - -0.9925833282166268f, - -0.9925992326887378f, - -0.9926151201529293f, - -0.992630990608929f, - -0.9926468440564647f, - -0.992662680495265f, - -0.9926784999250583f, - -0.9926943023455739f, - -0.9927100877565406f, - -0.9927258561576882f, - -0.9927416075487464f, - -0.9927573419294455f, - -0.9927730592995158f, - -0.9927887596586877f, - -0.9928044430066925f, - -0.9928201093432615f, - -0.992835758668126f, - -0.9928513909810182f, - -0.9928670062816698f, - -0.9928826045698137f, - -0.9928981858451823f, - -0.9929137501075087f, - -0.9929292973565262f, - -0.9929448275919686f, - -0.9929603408135695f, - -0.9929758370210633f, - -0.9929913162141845f, - -0.9930067783926675f, - -0.9930222235562478f, - -0.9930376517046605f, - -0.9930530628376414f, - -0.9930684569549262f, - -0.9930838340562514f, - -0.9930991941413534f, - -0.9931145372099691f, - -0.9931298632618353f, - -0.9931451722966897f, - -0.9931604643142699f, - -0.9931757393143139f, - -0.9931909972965598f, - -0.9932062382607463f, - -0.9932214622066122f, - -0.9932366691338969f, - -0.9932518590423394f, - -0.9932670319316796f, - -0.9932821878016577f, - -0.9932973266520139f, - -0.9933124484824886f, - -0.993327553292823f, - -0.9933426410827579f, - -0.9933577118520353f, - -0.9933727656003964f, - -0.9933878023275837f, - -0.9934028220333393f, - -0.993417824717406f, - -0.9934328103795266f, - -0.9934477790194444f, - -0.9934627306369028f, - -0.9934776652316459f, - -0.9934925828034175f, - -0.993507483351962f, - -0.9935223668770244f, - -0.9935372333783493f, - -0.9935520828556822f, - -0.9935669153087685f, - -0.9935817307373542f, - -0.9935965291411853f, - -0.9936113105200084f, - -0.99362607487357f, - -0.9936408222016174f, - -0.9936555525038976f, - -0.9936702657801585f, - -0.9936849620301478f, - -0.9936996412536138f, - -0.9937143034503048f, - -0.9937289486199696f, - -0.9937435767623574f, - -0.9937581878772176f, - -0.9937727819642996f, - -0.9937873590233535f, - -0.9938019190541294f, - -0.9938164620563781f, - -0.99383098802985f, - -0.9938454969742966f, - -0.9938599888894689f, - -0.993874463775119f, - -0.9938889216309986f, - -0.9939033624568601f, - -0.9939177862524557f, - -0.9939321930175389f, - -0.9939465827518623f, - -0.9939609554551797f, - -0.9939753111272445f, - -0.993989649767811f, - -0.9940039713766333f, - -0.9940182759534661f, - -0.9940325634980642f, - -0.9940468340101831f, - -0.9940610874895779f, - -0.9940753239360046f, - -0.9940895433492192f, - -0.9941037457289779f, - -0.9941179310750375f, - -0.994132099387155f, - -0.9941462506650875f, - -0.9941603849085927f, - -0.9941745021174282f, - -0.9941886022913521f, - -0.994202685430123f, - -0.9942167515334995f, - -0.9942308006012405f, - -0.9942448326331054f, - -0.9942588476288536f, - -0.9942728455882451f, - -0.9942868265110401f, - -0.9943007903969988f, - -0.9943147372458823f, - -0.9943286670574512f, - -0.994342579831467f, - -0.9943564755676914f, - -0.9943703542658863f, - -0.9943842159258137f, - -0.9943980605472363f, - -0.9944118881299167f, - -0.9944256986736181f, - -0.9944394921781038f, - -0.9944532686431374f, - -0.9944670280684829f, - -0.9944807704539047f, - -0.994494495799167f, - -0.994508204104035f, - -0.9945218953682733f, - -0.9945355695916478f, - -0.9945492267739239f, - -0.9945628669148678f, - -0.9945764900142456f, - -0.9945900960718239f, - -0.9946036850873696f, - -0.9946172570606501f, - -0.9946308119914323f, - -0.9946443498794844f, - -0.9946578707245742f, - -0.9946713745264703f, - -0.9946848612849409f, - -0.9946983309997551f, - -0.9947117836706822f, - -0.9947252192974918f, - -0.9947386378799533f, - -0.9947520394178371f, - -0.9947654239109133f, - -0.9947787913589529f, - -0.9947921417617265f, - -0.9948054751190055f, - -0.9948187914305615f, - -0.9948320906961662f, - -0.9948453729155919f, - -0.9948586380886109f, - -0.9948718862149959f, - -0.9948851172945198f, - -0.9948983313269562f, - -0.9949115283120782f, - -0.9949247082496602f, - -0.9949378711394758f, - -0.9949510169813002f, - -0.9949641457749074f, - -0.9949772575200729f, - -0.9949903522165718f, - -0.99500342986418f, - -0.995016490462673f, - -0.9950295340118275f, - -0.9950425605114196f, - -0.9950555699612262f, - -0.9950685623610246f, - -0.9950815377105919f, - -0.9950944960097059f, - -0.9951074372581445f, - -0.9951203614556862f, - -0.9951332686021092f, - -0.9951461586971925f, - -0.9951590317407152f, - -0.9951718877324567f, - -0.9951847266721969f, - -0.9951975485597155f, - -0.9952103533947932f, - -0.9952231411772101f, - -0.9952359119067475f, - -0.9952486655831865f, - -0.9952614022063083f, - -0.9952741217758949f, - -0.9952868242917284f, - -0.995299509753591f, - -0.9953121781612654f, - -0.9953248295145345f, - -0.9953374638131817f, - -0.9953500810569901f, - -0.9953626812457439f, - -0.9953752643792271f, - -0.995387830457224f, - -0.9954003794795193f, - -0.995412911445898f, - -0.9954254263561456f, - -0.9954379242100472f, - -0.995450405007389f, - -0.9954628687479571f, - -0.9954753154315379f, - -0.9954877450579179f, - -0.9955001576268845f, - -0.9955125531382248f, - -0.9955249315917265f, - -0.9955372929871774f, - -0.9955496373243657f, - -0.99556196460308f, - -0.995574274823109f, - -0.9955865679842417f, - -0.9955988440862675f, - -0.9956111031289762f, - -0.9956233451121576f, - -0.9956355700356019f, - -0.9956477778990998f, - -0.9956599687024418f, - -0.9956721424454195f, - -0.9956842991278237f, - -0.9956964387494468f, - -0.9957085613100801f, - -0.9957206668095163f, - -0.995732755247548f, - -0.9957448266239679f, - -0.9957568809385691f, - -0.9957689181911452f, - -0.99578093838149f, - -0.9957929415093975f, - -0.9958049275746618f, - -0.9958168965770777f, - -0.9958288485164402f, - -0.9958407833925442f, - -0.9958527012051857f, - -0.99586460195416f, - -0.9958764856392636f, - -0.9958883522602925f, - -0.9959002018170436f, - -0.9959120343093137f, - -0.9959238497369003f, - -0.9959356480996007f, - -0.9959474293972129f, - -0.9959591936295349f, - -0.9959709407963652f, - -0.9959826708975025f, - -0.9959943839327459f, - -0.9960060799018944f, - -0.996017758804748f, - -0.9960294206411062f, - -0.9960410654107695f, - -0.9960526931135383f, - -0.9960643037492132f, - -0.9960758973175954f, - -0.9960874738184862f, - -0.9960990332516871f, - -0.9961105756170004f, - -0.9961221009142279f, - -0.9961336091431725f, - -0.9961451003036367f, - -0.9961565743954238f, - -0.996168031418337f, - -0.9961794713721802f, - -0.9961908942567572f, - -0.9962023000718725f, - -0.9962136888173304f, - -0.9962250604929359f, - -0.9962364150984943f, - -0.9962477526338107f, - -0.996259073098691f, - -0.9962703764929413f, - -0.9962816628163678f, - -0.9962929320687772f, - -0.9963041842499764f, - -0.9963154193597724f, - -0.996326637397973f, - -0.9963378383643859f, - -0.996349022258819f, - -0.9963601890810808f, - -0.99637133883098f, - -0.9963824715083254f, - -0.9963935871129264f, - -0.9964046856445924f, - -0.9964157671031333f, - -0.9964268314883593f, - -0.9964378788000807f, - -0.9964489090381082f, - -0.996459922202253f, - -0.996470918292326f, - -0.9964818973081393f, - -0.9964928592495043f, - -0.9965038041162335f, - -0.9965147319081391f, - -0.9965256426250341f, - -0.9965365362667313f, - -0.9965474128330444f, - -0.9965582723237866f, - -0.9965691147387721f, - -0.996579940077815f, - -0.99659074834073f, - -0.9966015395273317f, - -0.9966123136374353f, - -0.9966230706708561f, - -0.9966338106274099f, - -0.9966445335069125f, - -0.9966552393091803f, - -0.9966659280340299f, - -0.9966765996812781f, - -0.9966872542507419f, - -0.9966978917422389f, - -0.9967085121555869f, - -0.9967191154906038f, - -0.9967297017471077f, - -0.9967402709249177f, - -0.9967508230238523f, - -0.996761358043731f, - -0.9967718759843729f, - -0.9967823768455981f, - -0.9967928606272266f, - -0.9968033273290787f, - -0.9968137769509751f, - -0.9968242094927366f, - -0.9968346249541847f, - -0.9968450233351408f, - -0.9968554046354268f, - -0.9968657688548646f, - -0.9968761159932769f, - -0.9968864460504862f, - -0.9968967590263156f, - -0.9969070549205883f, - -0.996917333733128f, - -0.9969275954637584f, - -0.9969378401123039f, - -0.9969480676785888f, - -0.996958278162438f, - -0.9969684715636763f, - -0.9969786478821292f, - -0.9969888071176224f, - -0.9969989492699818f, - -0.9970090743390334f, - -0.9970191823246038f, - -0.99702927322652f, - -0.9970393470446091f, - -0.9970494037786981f, - -0.997059443428615f, - -0.9970694659941877f, - -0.9970794714752446f, - -0.9970894598716139f, - -0.9970994311831248f, - -0.9971093854096064f, - -0.997119322550888f, - -0.9971292426067994f, - -0.9971391455771705f, - -0.9971490314618319f, - -0.9971589002606139f, - -0.9971687519733476f, - -0.9971785865998642f, - -0.997188404139995f, - -0.997198204593572f, - -0.9972079879604271f, - -0.9972177542403927f, - -0.9972275034333015f, - -0.9972372355389866f, - -0.9972469505572809f, - -0.9972566484880182f, - -0.9972663293310322f, - -0.9972759930861571f, - -0.9972856397532273f, - -0.9972952693320775f, - -0.9973048818225426f, - -0.9973144772244581f, - -0.9973240555376593f, - -0.9973336167619824f, - -0.9973431608972635f, - -0.9973526879433389f, - -0.9973621979000453f, - -0.99737169076722f, - -0.9973811665447002f, - -0.9973906252323237f, - -0.9974000668299281f, - -0.9974094913373519f, - -0.9974188987544336f, - -0.9974282890810118f, - -0.9974376623169258f, - -0.9974470184620149f, - -0.9974563575161188f, - -0.9974656794790775f, - -0.9974749843507313f, - -0.9974842721309207f, - -0.9974935428194865f, - -0.99750279641627f, - -0.9975120329211127f, - -0.997521252333856f, - -0.9975304546543422f, - -0.9975396398824136f, - -0.9975488080179128f, - -0.9975579590606825f, - -0.9975670930105662f, - -0.9975762098674072f, - -0.9975853096310495f, - -0.997594392301337f, - -0.9976034578781139f, - -0.9976125063612252f, - -0.9976215377505158f, - -0.9976305520458307f, - -0.9976395492470157f, - -0.9976485293539165f, - -0.9976574923663794f, - -0.9976664382842505f, - -0.9976753671073768f, - -0.9976842788356053f, - -0.9976931734687831f, - -0.997702051006758f, - -0.9977109114493777f, - -0.9977197547964906f, - -0.9977285810479449f, - -0.9977373902035896f, - -0.9977461822632737f, - -0.9977549572268465f, - -0.9977637150941576f, - -0.9977724558650571f, - -0.997781179539395f, - -0.9977898861170221f, - -0.997798575597789f, - -0.9978072479815469f, - -0.9978159032681471f, - -0.9978245414574415f, - -0.9978331625492818f, - -0.9978417665435205f, - -0.99785035344001f, - -0.9978589232386035f, - -0.9978674759391538f, - -0.9978760115415145f, - -0.9978845300455393f, - -0.9978930314510823f, - -0.9979015157579979f, - -0.9979099829661404f, - -0.9979184330753651f, - -0.997926866085527f, - -0.9979352819964817f, - -0.9979436808080849f, - -0.9979520625201928f, - -0.9979604271326616f, - -0.9979687746453482f, - -0.9979771050581093f, - -0.9979854183708025f, - -0.9979937145832851f, - -0.998001993695415f, - -0.9980102557070504f, - -0.9980185006180496f, - -0.9980267284282716f, - -0.9980349391375751f, - -0.9980431327458196f, - -0.9980513092528646f, - -0.9980594686585701f, - -0.9980676109627962f, - -0.9980757361654035f, - -0.9980838442662525f, - -0.9980919352652047f, - -0.9981000091621212f, - -0.9981080659568636f, - -0.998116105649294f, - -0.9981241282392745f, - -0.9981321337266679f, - -0.9981401221113367f, - -0.9981480933931443f, - -0.9981560475719538f, - -0.9981639846476291f, - -0.9981719046200342f, - -0.9981798074890336f, - -0.9981876932544914f, - -0.9981955619162729f, - -0.9982034134742431f, - -0.9982112479282674f, - -0.9982190652782118f, - -0.998226865523942f, - -0.9982346486653247f, - -0.9982424147022264f, - -0.9982501636345139f, - -0.9982578954620546f, - -0.9982656101847158f, - -0.9982733078023657f, - -0.998280988314872f, - -0.9982886517221033f, - -0.9982962980239283f, - -0.9983039272202159f, - -0.9983115393108354f, - -0.9983191342956564f, - -0.9983267121745487f, - -0.9983342729473825f, - -0.9983418166140283f, - -0.9983493431743568f, - -0.9983568526282389f, - -0.9983643449755463f, - -0.9983718202161501f, - -0.9983792783499226f, - -0.9983867193767358f, - -0.9983941432964624f, - -0.998401550108975f, - -0.9984089398141468f, - -0.9984163124118512f, - -0.9984236679019618f, - -0.9984310062843526f, - -0.9984383275588977f, - -0.998445631725472f, - -0.9984529187839499f, - -0.9984601887342069f, - -0.9984674415761184f, - -0.9984746773095601f, - -0.9984818959344077f, - -0.9984890974505379f, - -0.9984962818578271f, - -0.9985034491561524f, - -0.9985105993453908f, - -0.9985177324254197f, - -0.9985248483961172f, - -0.9985319472573612f, - -0.9985390290090299f, - -0.9985460936510022f, - -0.998553141183157f, - -0.9985601716053734f, - -0.998567184917531f, - -0.9985741811195098f, - -0.9985811602111896f, - -0.9985881221924512f, - -0.9985950670631749f, - -0.9986019948232421f, - -0.9986089054725338f, - -0.9986157990109317f, - -0.9986226754383176f, - -0.9986295347545739f, - -0.9986363769595828f, - -0.9986432020532272f, - -0.9986500100353901f, - -0.998656800905955f, - -0.9986635746648053f, - -0.998670331311825f, - -0.9986770708468985f, - -0.9986837932699101f, - -0.9986904985807449f, - -0.9986971867792875f, - -0.9987038578654238f, - -0.9987105118390394f, - -0.99871714870002f, - -0.9987237684482522f, - -0.9987303710836224f, - -0.9987369566060175f, - -0.9987435250153247f, - -0.9987500763114313f, - -0.9987566104942253f, - -0.9987631275635945f, - -0.9987696275194275f, - -0.9987761103616126f, - -0.998782576090039f, - -0.9987890247045957f, - -0.9987954562051724f, - -0.9988018705916587f, - -0.9988082678639448f, - -0.9988146480219211f, - -0.9988210110654783f, - -0.9988273569945072f, - -0.9988336858088992f, - -0.9988399975085459f, - -0.9988462920933391f, - -0.9988525695631708f, - -0.9988588299179337f, - -0.9988650731575204f, - -0.9988712992818238f, - -0.9988775082907375f, - -0.998883700184155f, - -0.99888987496197f, - -0.9988960326240769f, - -0.9989021731703701f, - -0.9989082966007445f, - -0.998914402915095f, - -0.9989204921133172f, - -0.9989265641953066f, - -0.9989326191609592f, - -0.9989386570101713f, - -0.9989446777428392f, - -0.9989506813588601f, - -0.9989566678581309f, - -0.9989626372405491f, - -0.9989685895060123f, - -0.9989745246544187f, - -0.9989804426856664f, - -0.9989863435996542f, - -0.9989922273962809f, - -0.9989980940754456f, - -0.9990039436370479f, - -0.9990097760809875f, - -0.9990155914071644f, - -0.9990213896154793f, - -0.9990271707058322f, - -0.9990329346781247f, - -0.9990386815322577f, - -0.9990444112681328f, - -0.9990501238856517f, - -0.9990558193847169f, - -0.9990614977652303f, - -0.999067159027095f, - -0.9990728031702136f, - -0.9990784301944899f, - -0.9990840400998271f, - -0.9990896328861292f, - -0.9990952085533004f, - -0.999100767101245f, - -0.9991063085298679f, - -0.9991118328390742f, - -0.9991173400287692f, - -0.9991228300988584f, - -0.9991283030492478f, - -0.9991337588798437f, - -0.9991391975905526f, - -0.9991446191812813f, - -0.9991500236519367f, - -0.9991554110024267f, - -0.9991607812326584f, - -0.9991661343425401f, - -0.9991714703319801f, - -0.9991767892008868f, - -0.9991820909491692f, - -0.9991873755767364f, - -0.9991926430834979f, - -0.9991978934693634f, - -0.9992031267342429f, - -0.9992083428780468f, - -0.9992135419006857f, - -0.9992187238020704f, - -0.9992238885821124f, - -0.9992290362407229f, - -0.9992341667778138f, - -0.9992392801932973f, - -0.9992443764870856f, - -0.9992494556590916f, - -0.999254517709228f, - -0.9992595626374082f, - -0.9992645904435459f, - -0.9992696011275547f, - -0.9992745946893489f, - -0.9992795711288428f, - -0.9992845304459512f, - -0.9992894726405892f, - -0.9992943977126721f, - -0.9992993056621154f, - -0.9993041964888351f, - -0.9993090701927473f, - -0.9993139267737686f, - -0.9993187662318158f, - -0.9993235885668059f, - -0.9993283937786562f, - -0.9993331818672846f, - -0.9993379528326087f, - -0.9993427066745472f, - -0.9993474433930183f, - -0.9993521629879409f, - -0.9993568654592342f, - -0.9993615508068177f, - -0.9993662190306107f, - -0.9993708701305338f, - -0.999375504106507f, - -0.999380120958451f, - -0.9993847206862865f, - -0.9993893032899348f, - -0.9993938687693175f, - -0.9993984171243561f, - -0.9994029483549729f, - -0.9994074624610901f, - -0.9994119594426306f, - -0.9994164392995171f, - -0.9994209020316729f, - -0.9994253476390215f, - -0.9994297761214869f, - -0.9994341874789929f, - -0.9994385817114643f, - -0.9994429588188255f, - -0.9994473188010017f, - -0.999451661657918f, - -0.9994559873895001f, - -0.999460295995674f, - -0.9994645874763657f, - -0.9994688618315016f, - -0.9994731190610087f, - -0.9994773591648138f, - -0.9994815821428444f, - -0.9994857879950282f, - -0.999489976721293f, - -0.999494148321567f, - -0.9994983027957789f, - -0.9995024401438574f, - -0.9995065603657316f, - -0.9995106634613309f, - -0.9995147494305849f, - -0.9995188182734238f, - -0.9995228699897779f, - -0.9995269045795775f, - -0.9995309220427536f, - -0.9995349223792375f, - -0.9995389055889605f, - -0.9995428716718544f, - -0.9995468206278512f, - -0.9995507524568833f, - -0.9995546671588833f, - -0.999558564733784f, - -0.9995624451815189f, - -0.9995663085020212f, - -0.999570154695225f, - -0.9995739837610641f, - -0.9995777956994731f, - -0.9995815905103866f, - -0.9995853681937397f, - -0.9995891287494675f, - -0.9995928721775056f, - -0.9995965984777899f, - -0.9996003076502565f, - -0.9996039996948419f, - -0.9996076746114829f, - -0.9996113324001163f, - -0.9996149730606797f, - -0.9996185965931106f, - -0.9996222029973468f, - -0.9996257922733267f, - -0.9996293644209887f, - -0.9996329194402717f, - -0.9996364573311145f, - -0.9996399780934567f, - -0.999643481727238f, - -0.9996469682323983f, - -0.9996504376088778f, - -0.9996538898566173f, - -0.9996573249755573f, - -0.9996607429656391f, - -0.9996641438268041f, - -0.9996675275589942f, - -0.9996708941621513f, - -0.9996742436362176f, - -0.9996775759811358f, - -0.9996808911968489f, - -0.9996841892832999f, - -0.9996874702404326f, - -0.9996907340681903f, - -0.9996939807665175f, - -0.9996972103353584f, - -0.9997004227746578f, - -0.9997036180843604f, - -0.9997067962644115f, - -0.9997099573147569f, - -0.9997131012353422f, - -0.9997162280261135f, - -0.9997193376870174f, - -0.9997224302180006f, - -0.99972550561901f, - -0.9997285638899929f, - -0.999731605030897f, - -0.99973462904167f, - -0.9997376359222604f, - -0.9997406256726165f, - -0.9997435982926869f, - -0.9997465537824209f, - -0.9997494921417679f, - -0.9997524133706773f, - -0.9997553174690993f, - -0.999758204436984f, - -0.999761074274282f, - -0.9997639269809441f, - -0.9997667625569213f, - -0.9997695810021652f, - -0.9997723823166274f, - -0.99977516650026f, - -0.9997779335530151f, - -0.9997806834748455f, - -0.9997834162657039f, - -0.9997861319255437f, - -0.9997888304543181f, - -0.9997915118519811f, - -0.9997941761184866f, - -0.999796823253789f, - -0.9997994532578429f, - -0.9998020661306034f, - -0.9998046618720255f, - -0.9998072404820648f, - -0.9998098019606773f, - -0.9998123463078188f, - -0.9998148735234459f, - -0.9998173836075153f, - -0.9998198765599838f, - -0.999822352380809f, - -0.9998248110699482f, - -0.9998272526273595f, - -0.9998296770530009f, - -0.9998320843468308f, - -0.999834474508808f, - -0.9998368475388918f, - -0.9998392034370412f, - -0.999841542203216f, - -0.9998438638373761f, - -0.9998461683394817f, - -0.9998484557094933f, - -0.9998507259473718f, - -0.9998529790530782f, - -0.9998552150265739f, - -0.9998574338678207f, - -0.9998596355767804f, - -0.9998618201534154f, - -0.9998639875976882f, - -0.9998661379095618f, - -0.9998682710889991f, - -0.9998703871359639f, - -0.9998724860504196f, - -0.9998745678323304f, - -0.9998766324816606f, - -0.9998786799983749f, - -0.999880710382438f, - -0.9998827236338154f, - -0.9998847197524724f, - -0.9998866987383749f, - -0.9998886605914888f, - -0.9998906053117809f, - -0.9998925328992174f, - -0.9998944433537655f, - -0.9998963366753925f, - -0.9998982128640659f, - -0.9999000719197535f, - -0.9999019138424236f, - -0.9999037386320444f, - -0.999905546288585f, - -0.9999073368120139f, - -0.999909110202301f, - -0.9999108664594155f, - -0.9999126055833274f, - -0.999914327574007f, - -0.9999160324314248f, - -0.9999177201555514f, - -0.999919390746358f, - -0.9999210442038161f, - -0.9999226805278972f, - -0.9999242997185733f, - -0.9999259017758166f, - -0.9999274866995999f, - -0.9999290544898957f, - -0.9999306051466773f, - -0.9999321386699181f, - -0.999933655059592f, - -0.9999351543156727f, - -0.9999366364381348f, - -0.9999381014269527f, - -0.9999395492821014f, - -0.999940980003556f, - -0.9999423935912921f, - -0.9999437900452854f, - -0.9999451693655121f, - -0.9999465315519485f, - -0.9999478766045711f, - -0.999949204523357f, - -0.9999505153082835f, - -0.999951808959328f, - -0.9999530854764684f, - -0.9999543448596829f, - -0.9999555871089498f, - -0.9999568122242479f, - -0.9999580202055561f, - -0.9999592110528538f, - -0.9999603847661206f, - -0.9999615413453363f, - -0.9999626807904812f, - -0.9999638031015358f, - -0.9999649082784806f, - -0.999965996321297f, - -0.9999670672299661f, - -0.9999681210044697f, - -0.9999691576447897f, - -0.9999701771509083f, - -0.9999711795228081f, - -0.9999721647604719f, - -0.9999731328638829f, - -0.9999740838330242f, - -0.9999750176678799f, - -0.9999759343684338f, - -0.9999768339346702f, - -0.9999777163665737f, - -0.9999785816641292f, - -0.9999794298273218f, - -0.9999802608561371f, - -0.9999810747505607f, - -0.9999818715105789f, - -0.9999826511361778f, - -0.9999834136273441f, - -0.9999841589840648f, - -0.999984887206327f, - -0.9999855982941185f, - -0.9999862922474267f, - -0.9999869690662402f, - -0.9999876287505469f, - -0.999988271300336f, - -0.999988896715596f, - -0.9999895049963164f, - -0.9999900961424869f, - -0.9999906701540973f, - -0.9999912270311376f, - -0.9999917667735985f, - -0.9999922893814706f, - -0.999992794854745f, - -0.999993283193413f, - -0.9999937543974662f, - -0.9999942084668966f, - -0.9999946454016965f, - -0.9999950652018582f, - -0.9999954678673746f, - -0.9999958533982388f, - -0.9999962217944444f, - -0.9999965730559848f, - -0.999996907182854f, - -0.9999972241750464f, - -0.9999975240325565f, - -0.9999978067553793f, - -0.9999980723435097f, - -0.9999983207969434f, - -0.999998552115676f, - -0.9999987662997035f, - -0.9999989633490224f, - -0.9999991432636292f, - -0.9999993060435208f, - -0.9999994516886945f, - -0.9999995801991477f, - -0.9999996915748783f, - -0.9999997858158843f, - -0.9999998629221643f, - -0.9999999228937166f, - -0.9999999657305405f, - -0.9999999914326351f, - -1.0f, - -0.9999999914326351f, - -0.9999999657305405f, - -0.9999999228937166f, - -0.9999998629221643f, - -0.9999997858158843f, - -0.9999996915748783f, - -0.9999995801991477f, - -0.9999994516886945f, - -0.9999993060435208f, - -0.9999991432636292f, - -0.9999989633490224f, - -0.9999987662997035f, - -0.999998552115676f, - -0.9999983207969434f, - -0.9999980723435097f, - -0.9999978067553793f, - -0.9999975240325565f, - -0.9999972241750464f, - -0.999996907182854f, - -0.9999965730559848f, - -0.9999962217944444f, - -0.9999958533982388f, - -0.9999954678673746f, - -0.9999950652018582f, - -0.9999946454016965f, - -0.9999942084668966f, - -0.9999937543974662f, - -0.999993283193413f, - -0.999992794854745f, - -0.9999922893814706f, - -0.9999917667735985f, - -0.9999912270311376f, - -0.9999906701540973f, - -0.9999900961424869f, - -0.9999895049963164f, - -0.999988896715596f, - -0.999988271300336f, - -0.9999876287505469f, - -0.9999869690662402f, - -0.9999862922474267f, - -0.9999855982941185f, - -0.999984887206327f, - -0.9999841589840648f, - -0.9999834136273441f, - -0.9999826511361778f, - -0.9999818715105789f, - -0.9999810747505607f, - -0.9999802608561371f, - -0.9999794298273218f, - -0.9999785816641292f, - -0.9999777163665737f, - -0.9999768339346702f, - -0.9999759343684338f, - -0.9999750176678799f, - -0.9999740838330242f, - -0.9999731328638829f, - -0.9999721647604719f, - -0.9999711795228081f, - -0.9999701771509083f, - -0.9999691576447897f, - -0.9999681210044697f, - -0.9999670672299661f, - -0.999965996321297f, - -0.9999649082784806f, - -0.9999638031015358f, - -0.9999626807904812f, - -0.9999615413453363f, - -0.9999603847661206f, - -0.9999592110528538f, - -0.9999580202055561f, - -0.9999568122242479f, - -0.9999555871089498f, - -0.9999543448596829f, - -0.9999530854764684f, - -0.999951808959328f, - -0.9999505153082835f, - -0.999949204523357f, - -0.9999478766045711f, - -0.9999465315519485f, - -0.9999451693655121f, - -0.9999437900452854f, - -0.9999423935912921f, - -0.999940980003556f, - -0.9999395492821014f, - -0.9999381014269527f, - -0.9999366364381348f, - -0.9999351543156727f, - -0.999933655059592f, - -0.9999321386699181f, - -0.9999306051466773f, - -0.9999290544898957f, - -0.9999274866995999f, - -0.9999259017758166f, - -0.9999242997185733f, - -0.9999226805278972f, - -0.9999210442038161f, - -0.999919390746358f, - -0.9999177201555515f, - -0.9999160324314248f, - -0.999914327574007f, - -0.9999126055833274f, - -0.9999108664594155f, - -0.999909110202301f, - -0.9999073368120139f, - -0.999905546288585f, - -0.9999037386320444f, - -0.9999019138424236f, - -0.9999000719197535f, - -0.9998982128640659f, - -0.9998963366753925f, - -0.9998944433537655f, - -0.9998925328992174f, - -0.9998906053117809f, - -0.9998886605914888f, - -0.9998866987383749f, - -0.9998847197524724f, - -0.9998827236338154f, - -0.999880710382438f, - -0.9998786799983749f, - -0.9998766324816606f, - -0.9998745678323304f, - -0.9998724860504196f, - -0.9998703871359639f, - -0.9998682710889991f, - -0.9998661379095618f, - -0.9998639875976882f, - -0.9998618201534154f, - -0.9998596355767804f, - -0.9998574338678207f, - -0.9998552150265739f, - -0.9998529790530782f, - -0.9998507259473718f, - -0.9998484557094933f, - -0.9998461683394817f, - -0.9998438638373761f, - -0.9998415422032161f, - -0.9998392034370412f, - -0.9998368475388918f, - -0.9998344745088081f, - -0.9998320843468308f, - -0.9998296770530009f, - -0.9998272526273595f, - -0.9998248110699482f, - -0.999822352380809f, - -0.9998198765599838f, - -0.9998173836075153f, - -0.9998148735234459f, - -0.9998123463078188f, - -0.9998098019606773f, - -0.9998072404820648f, - -0.9998046618720255f, - -0.9998020661306034f, - -0.9997994532578429f, - -0.999796823253789f, - -0.9997941761184866f, - -0.9997915118519811f, - -0.9997888304543181f, - -0.9997861319255437f, - -0.9997834162657039f, - -0.9997806834748455f, - -0.9997779335530151f, - -0.99977516650026f, - -0.9997723823166274f, - -0.9997695810021652f, - -0.9997667625569213f, - -0.9997639269809441f, - -0.999761074274282f, - -0.999758204436984f, - -0.9997553174690993f, - -0.9997524133706773f, - -0.9997494921417679f, - -0.9997465537824209f, - -0.9997435982926869f, - -0.9997406256726165f, - -0.9997376359222604f, - -0.9997346290416701f, - -0.999731605030897f, - -0.9997285638899929f, - -0.99972550561901f, - -0.9997224302180006f, - -0.9997193376870174f, - -0.9997162280261135f, - -0.9997131012353422f, - -0.9997099573147569f, - -0.9997067962644115f, - -0.9997036180843604f, - -0.9997004227746578f, - -0.9996972103353584f, - -0.9996939807665175f, - -0.9996907340681904f, - -0.9996874702404326f, - -0.9996841892832999f, - -0.9996808911968489f, - -0.9996775759811358f, - -0.9996742436362176f, - -0.9996708941621513f, - -0.9996675275589942f, - -0.9996641438268042f, - -0.9996607429656391f, - -0.9996573249755573f, - -0.9996538898566173f, - -0.9996504376088778f, - -0.9996469682323983f, - -0.999643481727238f, - -0.9996399780934567f, - -0.9996364573311145f, - -0.9996329194402717f, - -0.9996293644209887f, - -0.9996257922733267f, - -0.9996222029973468f, - -0.9996185965931106f, - -0.9996149730606797f, - -0.9996113324001163f, - -0.9996076746114829f, - -0.9996039996948419f, - -0.9996003076502565f, - -0.9995965984777899f, - -0.9995928721775056f, - -0.9995891287494675f, - -0.9995853681937397f, - -0.9995815905103868f, - -0.9995777956994731f, - -0.9995739837610642f, - -0.999570154695225f, - -0.9995663085020213f, - -0.9995624451815189f, - -0.999558564733784f, - -0.9995546671588833f, - -0.9995507524568833f, - -0.9995468206278513f, - -0.9995428716718544f, - -0.9995389055889605f, - -0.9995349223792375f, - -0.9995309220427537f, - -0.9995269045795775f, - -0.9995228699897779f, - -0.9995188182734238f, - -0.9995147494305849f, - -0.9995106634613309f, - -0.9995065603657316f, - -0.9995024401438574f, - -0.9994983027957789f, - -0.999494148321567f, - -0.999489976721293f, - -0.9994857879950282f, - -0.9994815821428444f, - -0.9994773591648138f, - -0.9994731190610087f, - -0.9994688618315016f, - -0.9994645874763657f, - -0.999460295995674f, - -0.9994559873895001f, - -0.999451661657918f, - -0.9994473188010017f, - -0.9994429588188255f, - -0.9994385817114643f, - -0.9994341874789929f, - -0.9994297761214869f, - -0.9994253476390216f, - -0.9994209020316729f, - -0.9994164392995171f, - -0.9994119594426306f, - -0.9994074624610901f, - -0.9994029483549729f, - -0.9993984171243561f, - -0.9993938687693175f, - -0.9993893032899348f, - -0.9993847206862865f, - -0.999380120958451f, - -0.999375504106507f, - -0.9993708701305338f, - -0.9993662190306108f, - -0.9993615508068177f, - -0.9993568654592342f, - -0.9993521629879409f, - -0.9993474433930183f, - -0.9993427066745472f, - -0.9993379528326088f, - -0.9993331818672846f, - -0.9993283937786562f, - -0.9993235885668059f, - -0.9993187662318158f, - -0.9993139267737687f, - -0.9993090701927474f, - -0.9993041964888351f, - -0.9992993056621154f, - -0.9992943977126721f, - -0.9992894726405892f, - -0.9992845304459512f, - -0.9992795711288428f, - -0.9992745946893489f, - -0.9992696011275547f, - -0.9992645904435459f, - -0.9992595626374082f, - -0.999254517709228f, - -0.9992494556590916f, - -0.9992443764870856f, - -0.9992392801932973f, - -0.999234166777814f, - -0.9992290362407229f, - -0.9992238885821124f, - -0.9992187238020706f, - -0.9992135419006857f, - -0.9992083428780468f, - -0.9992031267342429f, - -0.9991978934693634f, - -0.9991926430834979f, - -0.9991873755767364f, - -0.9991820909491692f, - -0.9991767892008868f, - -0.9991714703319801f, - -0.9991661343425401f, - -0.9991607812326584f, - -0.9991554110024267f, - -0.9991500236519368f, - -0.9991446191812813f, - -0.9991391975905526f, - -0.9991337588798438f, - -0.9991283030492478f, - -0.9991228300988584f, - -0.9991173400287692f, - -0.9991118328390742f, - -0.9991063085298679f, - -0.999100767101245f, - -0.9990952085533004f, - -0.9990896328861292f, - -0.9990840400998271f, - -0.9990784301944899f, - -0.9990728031702137f, - -0.999067159027095f, - -0.9990614977652303f, - -0.9990558193847169f, - -0.9990501238856518f, - -0.9990444112681328f, - -0.9990386815322577f, - -0.9990329346781247f, - -0.9990271707058322f, - -0.9990213896154793f, - -0.9990155914071644f, - -0.9990097760809875f, - -0.9990039436370479f, - -0.9989980940754456f, - -0.9989922273962809f, - -0.9989863435996542f, - -0.9989804426856664f, - -0.9989745246544187f, - -0.9989685895060123f, - -0.9989626372405491f, - -0.998956667858131f, - -0.9989506813588601f, - -0.9989446777428392f, - -0.9989386570101713f, - -0.9989326191609592f, - -0.9989265641953067f, - -0.9989204921133172f, - -0.9989144029150951f, - -0.9989082966007445f, - -0.9989021731703701f, - -0.9988960326240769f, - -0.99888987496197f, - -0.998883700184155f, - -0.9988775082907375f, - -0.9988712992818239f, - -0.9988650731575204f, - -0.9988588299179337f, - -0.9988525695631708f, - -0.9988462920933391f, - -0.9988399975085459f, - -0.9988336858088993f, - -0.9988273569945072f, - -0.9988210110654783f, - -0.9988146480219211f, - -0.9988082678639448f, - -0.9988018705916587f, - -0.9987954562051724f, - -0.9987890247045957f, - -0.9987825760900391f, - -0.9987761103616127f, - -0.9987696275194275f, - -0.9987631275635946f, - -0.9987566104942254f, - -0.9987500763114314f, - -0.9987435250153247f, - -0.9987369566060175f, - -0.9987303710836224f, - -0.9987237684482522f, - -0.99871714870002f, - -0.9987105118390394f, - -0.9987038578654238f, - -0.9986971867792876f, - -0.9986904985807449f, - -0.9986837932699102f, - -0.9986770708468985f, - -0.998670331311825f, - -0.9986635746648053f, - -0.998656800905955f, - -0.9986500100353901f, - -0.9986432020532272f, - -0.9986363769595828f, - -0.9986295347545739f, - -0.9986226754383176f, - -0.9986157990109317f, - -0.9986089054725338f, - -0.9986019948232421f, - -0.9985950670631749f, - -0.9985881221924512f, - -0.9985811602111896f, - -0.9985741811195098f, - -0.998567184917531f, - -0.9985601716053734f, - -0.998553141183157f, - -0.9985460936510022f, - -0.9985390290090299f, - -0.9985319472573612f, - -0.9985248483961172f, - -0.9985177324254199f, - -0.9985105993453908f, - -0.9985034491561524f, - -0.9984962818578272f, - -0.9984890974505379f, - -0.9984818959344077f, - -0.9984746773095601f, - -0.9984674415761184f, - -0.998460188734207f, - -0.9984529187839499f, - -0.998445631725472f, - -0.9984383275588977f, - -0.9984310062843526f, - -0.9984236679019618f, - -0.9984163124118512f, - -0.9984089398141468f, - -0.998401550108975f, - -0.9983941432964625f, - -0.9983867193767358f, - -0.9983792783499226f, - -0.9983718202161501f, - -0.9983643449755463f, - -0.9983568526282389f, - -0.9983493431743568f, - -0.9983418166140283f, - -0.9983342729473826f, - -0.9983267121745487f, - -0.9983191342956564f, - -0.9983115393108355f, - -0.998303927220216f, - -0.9982962980239283f, - -0.9982886517221033f, - -0.998280988314872f, - -0.9982733078023657f, - -0.9982656101847159f, - -0.9982578954620546f, - -0.9982501636345139f, - -0.9982424147022264f, - -0.9982346486653247f, - -0.9982268655239421f, - -0.9982190652782118f, - -0.9982112479282675f, - -0.9982034134742431f, - -0.9981955619162729f, - -0.9981876932544914f, - -0.9981798074890336f, - -0.9981719046200344f, - -0.9981639846476292f, - -0.9981560475719538f, - -0.9981480933931443f, - -0.9981401221113367f, - -0.9981321337266679f, - -0.9981241282392745f, - -0.9981161056492941f, - -0.9981080659568636f, - -0.9981000091621212f, - -0.9980919352652047f, - -0.9980838442662526f, - -0.9980757361654035f, - -0.9980676109627962f, - -0.9980594686585701f, - -0.9980513092528646f, - -0.9980431327458196f, - -0.9980349391375751f, - -0.9980267284282716f, - -0.9980185006180496f, - -0.9980102557070504f, - -0.9980019936954151f, - -0.9979937145832851f, - -0.9979854183708025f, - -0.9979771050581093f, - -0.9979687746453482f, - -0.9979604271326616f, - -0.9979520625201928f, - -0.9979436808080849f, - -0.9979352819964817f, - -0.997926866085527f, - -0.9979184330753651f, - -0.9979099829661405f, - -0.9979015157579979f, - -0.9978930314510824f, - -0.9978845300455393f, - -0.9978760115415145f, - -0.9978674759391538f, - -0.9978589232386036f, - -0.9978503534400102f, - -0.9978417665435205f, - -0.9978331625492818f, - -0.9978245414574415f, - -0.9978159032681472f, - -0.997807247981547f, - -0.9977985755977891f, - -0.9977898861170222f, - -0.9977811795393952f, - -0.9977724558650571f, - -0.9977637150941576f, - -0.9977549572268465f, - -0.9977461822632737f, - -0.9977373902035898f, - -0.9977285810479449f, - -0.9977197547964906f, - -0.9977109114493777f, - -0.997702051006758f, - -0.9976931734687832f, - -0.9976842788356053f, - -0.9976753671073769f, - -0.9976664382842506f, - -0.9976574923663794f, - -0.9976485293539166f, - -0.9976395492470157f, - -0.9976305520458307f, - -0.9976215377505158f, - -0.9976125063612252f, - -0.997603457878114f, - -0.997594392301337f, - -0.9975853096310495f, - -0.9975762098674072f, - -0.9975670930105662f, - -0.9975579590606826f, - -0.9975488080179128f, - -0.9975396398824137f, - -0.9975304546543423f, - -0.997521252333856f, - -0.9975120329211127f, - -0.9975027964162702f, - -0.9974935428194867f, - -0.9974842721309207f, - -0.9974749843507313f, - -0.9974656794790776f, - -0.9974563575161188f, - -0.9974470184620149f, - -0.9974376623169258f, - -0.9974282890810118f, - -0.9974188987544336f, - -0.9974094913373519f, - -0.9974000668299281f, - -0.9973906252323237f, - -0.9973811665447003f, - -0.99737169076722f, - -0.9973621979000453f, - -0.9973526879433389f, - -0.9973431608972635f, - -0.9973336167619825f, - -0.9973240555376595f, - -0.9973144772244581f, - -0.9973048818225427f, - -0.9972952693320775f, - -0.9972856397532273f, - -0.9972759930861571f, - -0.9972663293310322f, - -0.9972566484880182f, - -0.997246950557281f, - -0.9972372355389866f, - -0.9972275034333016f, - -0.9972177542403927f, - -0.9972079879604271f, - -0.997198204593572f, - -0.997188404139995f, - -0.9971785865998642f, - -0.9971687519733476f, - -0.9971589002606139f, - -0.9971490314618319f, - -0.9971391455771706f, - -0.9971292426067994f, - -0.997119322550888f, - -0.9971093854096064f, - -0.9970994311831248f, - -0.997089459871614f, - -0.9970794714752446f, - -0.9970694659941877f, - -0.997059443428615f, - -0.9970494037786981f, - -0.9970393470446091f, - -0.99702927322652f, - -0.9970191823246038f, - -0.9970090743390334f, - -0.9969989492699818f, - -0.9969888071176224f, - -0.9969786478821293f, - -0.9969684715636763f, - -0.996958278162438f, - -0.9969480676785889f, - -0.9969378401123039f, - -0.9969275954637584f, - -0.9969173337331281f, - -0.9969070549205883f, - -0.9968967590263156f, - -0.9968864460504862f, - -0.996876115993277f, - -0.9968657688548647f, - -0.9968554046354268f, - -0.9968450233351409f, - -0.9968346249541847f, - -0.9968242094927366f, - -0.9968137769509751f, - -0.9968033273290787f, - -0.9967928606272266f, - -0.9967823768455981f, - -0.996771875984373f, - -0.996761358043731f, - -0.9967508230238523f, - -0.9967402709249177f, - -0.9967297017471078f, - -0.9967191154906038f, - -0.9967085121555869f, - -0.996697891742239f, - -0.9966872542507419f, - -0.9966765996812781f, - -0.9966659280340299f, - -0.9966552393091803f, - -0.9966445335069125f, - -0.9966338106274099f, - -0.9966230706708561f, - -0.9966123136374353f, - -0.9966015395273317f, - -0.9965907483407301f, - -0.9965799400778151f, - -0.9965691147387722f, - -0.9965582723237866f, - -0.9965474128330444f, - -0.9965365362667313f, - -0.9965256426250341f, - -0.9965147319081391f, - -0.9965038041162335f, - -0.9964928592495044f, - -0.9964818973081393f, - -0.996470918292326f, - -0.996459922202253f, - -0.9964489090381083f, - -0.9964378788000807f, - -0.9964268314883593f, - -0.9964157671031334f, - -0.9964046856445924f, - -0.9963935871129264f, - -0.9963824715083254f, - -0.99637133883098f, - -0.9963601890810808f, - -0.996349022258819f, - -0.9963378383643859f, - -0.996326637397973f, - -0.9963154193597725f, - -0.9963041842499764f, - -0.9962929320687772f, - -0.9962816628163678f, - -0.9962703764929413f, - -0.996259073098691f, - -0.9962477526338107f, - -0.9962364150984943f, - -0.996225060492936f, - -0.9962136888173305f, - -0.9962023000718726f, - -0.9961908942567572f, - -0.9961794713721802f, - -0.996168031418337f, - -0.9961565743954238f, - -0.9961451003036367f, - -0.9961336091431725f, - -0.9961221009142279f, - -0.9961105756170004f, - -0.9960990332516872f, - -0.9960874738184862f, - -0.9960758973175954f, - -0.9960643037492132f, - -0.9960526931135383f, - -0.9960410654107696f, - -0.9960294206411062f, - -0.996017758804748f, - -0.9960060799018945f, - -0.9959943839327459f, - -0.9959826708975025f, - -0.9959709407963652f, - -0.9959591936295349f, - -0.9959474293972129f, - -0.9959356480996007f, - -0.9959238497369003f, - -0.9959120343093137f, - -0.9959002018170436f, - -0.9958883522602925f, - -0.9958764856392636f, - -0.9958646019541602f, - -0.9958527012051858f, - -0.9958407833925443f, - -0.9958288485164402f, - -0.9958168965770777f, - -0.9958049275746618f, - -0.9957929415093975f, - -0.99578093838149f, - -0.9957689181911453f, - -0.9957568809385691f, - -0.9957448266239679f, - -0.995732755247548f, - -0.9957206668095164f, - -0.9957085613100801f, - -0.9956964387494468f, - -0.9956842991278239f, - -0.9956721424454195f, - -0.9956599687024418f, - -0.9956477778990999f, - -0.9956355700356019f, - -0.9956233451121577f, - -0.9956111031289762f, - -0.9955988440862675f, - -0.9955865679842417f, - -0.995574274823109f, - -0.99556196460308f, - -0.9955496373243657f, - -0.9955372929871774f, - -0.9955249315917265f, - -0.9955125531382248f, - -0.9955001576268845f, - -0.9954877450579179f, - -0.9954753154315379f, - -0.9954628687479571f, - -0.9954504050073891f, - -0.9954379242100473f, - -0.9954254263561456f, - -0.9954129114458982f, - -0.9954003794795194f, - -0.995387830457224f, - -0.9953752643792272f, - -0.9953626812457439f, - -0.9953500810569902f, - -0.9953374638131817f, - -0.9953248295145345f, - -0.9953121781612654f, - -0.995299509753591f, - -0.9952868242917284f, - -0.9952741217758949f, - -0.9952614022063083f, - -0.9952486655831865f, - -0.9952359119067475f, - -0.9952231411772101f, - -0.9952103533947932f, - -0.9951975485597157f, - -0.9951847266721969f, - -0.9951718877324568f, - -0.9951590317407152f, - -0.9951461586971925f, - -0.9951332686021093f, - -0.9951203614556862f, - -0.9951074372581447f, - -0.995094496009706f, - -0.995081537710592f, - -0.9950685623610246f, - -0.9950555699612263f, - -0.9950425605114197f, - -0.9950295340118276f, - -0.9950164904626732f, - -0.99500342986418f, - -0.9949903522165718f, - -0.994977257520073f, - -0.9949641457749074f, - -0.9949510169813002f, - -0.994937871139476f, - -0.9949247082496603f, - -0.9949115283120783f, - -0.9948983313269562f, - -0.9948851172945198f, - -0.9948718862149959f, - -0.9948586380886109f, - -0.9948453729155919f, - -0.9948320906961663f, - -0.9948187914305615f, - -0.9948054751190055f, - -0.9947921417617265f, - -0.9947787913589529f, - -0.9947654239109133f, - -0.9947520394178371f, - -0.9947386378799533f, - -0.9947252192974918f, - -0.9947117836706824f, - -0.9946983309997552f, - -0.9946848612849409f, - -0.9946713745264703f, - -0.9946578707245742f, - -0.9946443498794845f, - -0.9946308119914324f, - -0.9946172570606501f, - -0.9946036850873697f, - -0.994590096071824f, - -0.9945764900142456f, - -0.9945628669148678f, - -0.994549226773924f, - -0.9945355695916478f, - -0.9945218953682733f, - -0.994508204104035f, - -0.994494495799167f, - -0.9944807704539047f, - -0.994467028068483f, - -0.9944532686431375f, - -0.9944394921781038f, - -0.9944256986736181f, - -0.9944118881299167f, - -0.9943980605472363f, - -0.9943842159258137f, - -0.9943703542658863f, - -0.9943564755676915f, - -0.994342579831467f, - -0.9943286670574512f, - -0.9943147372458823f, - -0.9943007903969988f, - -0.9942868265110402f, - -0.9942728455882452f, - -0.9942588476288537f, - -0.9942448326331054f, - -0.9942308006012406f, - -0.9942167515334995f, - -0.9942026854301231f, - -0.9941886022913522f, - -0.9941745021174282f, - -0.9941603849085927f, - -0.9941462506650877f, - -0.994132099387155f, - -0.9941179310750375f, - -0.994103745728978f, - -0.9940895433492192f, - -0.9940753239360046f, - -0.9940610874895779f, - -0.9940468340101831f, - -0.9940325634980642f, - -0.9940182759534663f, - -0.9940039713766333f, - -0.993989649767811f, - -0.9939753111272445f, - -0.9939609554551798f, - -0.9939465827518624f, - -0.993932193017539f, - -0.9939177862524559f, - -0.9939033624568602f, - -0.9938889216309986f, - -0.993874463775119f, - -0.993859988889469f, - -0.9938454969742966f, - -0.99383098802985f, - -0.9938164620563781f, - -0.9938019190541295f, - -0.9937873590233535f, - -0.9937727819642996f, - -0.9937581878772176f, - -0.9937435767623575f, - -0.9937289486199696f, - -0.9937143034503048f, - -0.9936996412536138f, - -0.9936849620301478f, - -0.9936702657801585f, - -0.9936555525038976f, - -0.9936408222016174f, - -0.99362607487357f, - -0.9936113105200084f, - -0.9935965291411853f, - -0.9935817307373542f, - -0.9935669153087685f, - -0.9935520828556822f, - -0.9935372333783494f, - -0.9935223668770244f, - -0.9935074833519622f, - -0.9934925828034176f, - -0.9934776652316459f, - -0.9934627306369028f, - -0.9934477790194444f, - -0.9934328103795266f, - -0.993417824717406f, - -0.9934028220333393f, - -0.9933878023275838f, - -0.9933727656003964f, - -0.9933577118520353f, - -0.9933426410827579f, - -0.993327553292823f, - -0.9933124484824887f, - -0.9932973266520139f, - -0.9932821878016578f, - -0.9932670319316798f, - -0.9932518590423395f, - -0.993236669133897f, - -0.9932214622066123f, - -0.9932062382607464f, - -0.9931909972965598f, - -0.9931757393143139f, - -0.9931604643142699f, - -0.9931451722966897f, - -0.9931298632618353f, - -0.9931145372099691f, - -0.9930991941413535f, - -0.9930838340562514f, - -0.9930684569549263f, - -0.9930530628376415f, - -0.9930376517046605f, - -0.9930222235562478f, - -0.9930067783926675f, - -0.9929913162141845f, - -0.9929758370210633f, - -0.9929603408135695f, - -0.9929448275919686f, - -0.9929292973565262f, - -0.9929137501075087f, - -0.9928981858451823f, - -0.9928826045698137f, - -0.9928670062816698f, - -0.9928513909810182f, - -0.9928357586681261f, - -0.9928201093432616f, - -0.9928044430066926f, - -0.9927887596586877f, - -0.9927730592995158f, - -0.9927573419294456f, - -0.9927416075487465f, - -0.9927258561576883f, - -0.9927100877565407f, - -0.9926943023455739f, - -0.9926784999250583f, - -0.992662680495265f, - -0.9926468440564647f, - -0.992630990608929f, - -0.9926151201529294f, - -0.992599232688738f, - -0.9925833282166268f, - -0.9925674067368684f, - -0.9925514682497356f, - -0.9925355127555017f, - -0.9925195402544397f, - -0.9925035507468238f, - -0.9924875442329275f, - -0.9924715207130254f, - -0.9924554801873917f, - -0.9924394226563018f, - -0.9924233481200302f, - -0.9924072565788528f, - -0.9923911480330451f, - -0.9923750224828832f, - -0.9923588799286435f, - -0.9923427203706023f, - -0.9923265438090367f, - -0.9923103502442241f, - -0.9922941396764415f, - -0.992277912105967f, - -0.9922616675330785f, - -0.9922454059580544f, - -0.9922291273811734f, - -0.9922128318027144f, - -0.9921965192229564f, - -0.9921801896421792f, - -0.9921638430606625f, - -0.9921474794786865f, - -0.9921310988965314f, - -0.9921147013144779f, - -0.992098286732807f, - -0.9920818551518f, - -0.9920654065717386f, - -0.9920489409929042f, - -0.9920324584155794f, - -0.9920159588400465f, - -0.991999442266588f, - -0.991982908695487f, - -0.991966358127027f, - -0.9919497905614914f, - -0.9919332059991642f, - -0.9919166044403294f, - -0.9918999858852715f, - -0.9918833503342753f, - -0.9918666977876262f, - -0.9918500282456089f, - -0.9918333417085093f, - -0.9918166381766134f, - -0.9917999176502075f, - -0.9917831801295778f, - -0.9917664256150113f, - -0.9917496541067949f, - -0.9917328656052162f, - -0.9917160601105629f, - -0.9916992376231227f, - -0.991682398143184f, - -0.9916655416710354f, - -0.9916486682069656f, - -0.9916317777512638f, - -0.9916148703042192f, - -0.9915979458661219f, - -0.9915810044372617f, - -0.9915640460179289f, - -0.9915470706084138f, - -0.9915300782090078f, - -0.9915130688200017f, - -0.9914960424416871f, - -0.9914789990743554f, - -0.9914619387182992f, - -0.9914448613738105f, - -0.9914277670411819f, - -0.9914106557207062f, - -0.991393527412677f, - -0.9913763821173874f, - -0.9913592198351313f, - -0.991342040566203f, - -0.9913248443108965f, - -0.9913076310695066f, - -0.9912904008423282f, - -0.9912731536296568f, - -0.9912558894317876f, - -0.9912386082490166f, - -0.9912213100816396f, - -0.9912039949299536f, - -0.9911866627942546f, - -0.9911693136748401f, - -0.9911519475720071f, - -0.9911345644860533f, - -0.9911171644172765f, - -0.9910997473659748f, - -0.9910823133324467f, - -0.991064862316991f, - -0.9910473943199066f, - -0.9910299093414928f, - -0.9910124073820492f, - -0.9909948884418758f, - -0.9909773525212727f, - -0.9909597996205405f, - -0.9909422297399796f, - -0.9909246428798915f, - -0.9909070390405772f, - -0.9908894182223388f, - -0.9908717804254776f, - -0.9908541256502963f, - -0.9908364538970971f, - -0.9908187651661832f, - -0.9908010594578572f, - -0.9907833367724228f, - -0.9907655971101837f, - -0.9907478404714437f, - -0.990730066856507f, - -0.9907122762656784f, - -0.9906944686992626f, - -0.9906766441575645f, - -0.99065880264089f, - -0.9906409441495445f, - -0.9906230686838341f, - -0.9906051762440649f, - -0.9905872668305437f, - -0.9905693404435773f, - -0.9905513970834728f, - -0.9905334367505377f, - -0.99051545944508f, - -0.9904974651674073f, - -0.9904794539178283f, - -0.9904614256966512f, - -0.9904433805041853f, - -0.9904253183407397f, - -0.9904072392066238f, - -0.9903891431021473f, - -0.9903710300276206f, - -0.9903528999833537f, - -0.9903347529696576f, - -0.9903165889868428f, - -0.990298408035221f, - -0.9902802101151034f, - -0.9902619952268021f, - -0.9902437633706288f, - -0.9902255145468963f, - -0.990207248755917f, - -0.9901889659980043f, - -0.990170666273471f, - -0.9901523495826308f, - -0.9901340159257975f, - -0.9901156653032855f, - -0.990097297715409f, - -0.9900789131624829f, - -0.9900605116448219f, - -0.9900420931627416f, - -0.9900236577165575f, - -0.9900052053065856f, - -0.9899867359331418f, - -0.9899682495965428f, - -0.9899497462971054f, - -0.9899312260351465f, - -0.9899126888109835f, - -0.9898941346249338f, - -0.9898755634773158f, - -0.9898569753684473f, - -0.9898383702986471f, - -0.9898197482682336f, - -0.9898011092775263f, - -0.9897824533268443f, - -0.9897637804165075f, - -0.9897450905468356f, - -0.9897263837181489f, - -0.9897076599307681f, - -0.989688919185014f, - -0.9896701614812075f, - -0.9896513868196702f, - -0.9896325952007238f, - -0.9896137866246904f, - -0.9895949610918917f, - -0.989576118602651f, - -0.9895572591572906f, - -0.9895383827561344f, - -0.9895194893995048f, - -0.9895005790877265f, - -0.9894816518211228f, - -0.9894627076000185f, - -0.9894437464247379f, - -0.9894247682956061f, - -0.9894057732129481f, - -0.9893867611770896f, - -0.9893677321883562f, - -0.989348686247074f, - -0.9893296233535692f, - -0.9893105435081687f, - -0.9892914467111994f, - -0.9892723329629883f, - -0.989253202263863f, - -0.9892340546141515f, - -0.9892148900141817f, - -0.989195708464282f, - -0.9891765099647809f, - -0.9891572945160078f, - -0.9891380621182916f, - -0.9891188127719619f, - -0.9890995464773484f, - -0.9890802632347816f, - -0.9890609630445917f, - -0.9890416459071094f, - -0.9890223118226655f, - -0.9890029607915918f, - -0.9889835928142193f, - -0.9889642078908804f, - -0.9889448060219067f, - -0.988925387207631f, - -0.988905951448386f, - -0.9888864987445045f, - -0.9888670290963204f, - -0.9888475425041665f, - -0.9888280389683773f, - -0.9888085184892867f, - -0.9887889810672296f, - -0.9887694267025401f, - -0.9887498553955537f, - -0.9887302671466055f, - -0.9887106619560316f, - -0.9886910398241674f, - -0.9886714007513494f, - -0.988651744737914f, - -0.9886320717841981f, - -0.9886123818905388f, - -0.9885926750572733f, - -0.9885729512847394f, - -0.9885532105732752f, - -0.9885334529232187f, - -0.9885136783349086f, - -0.9884938868086836f, - -0.9884740783448829f, - -0.9884542529438458f, - -0.9884344106059124f, - -0.9884145513314222f, - -0.9883946751207159f, - -0.9883747819741336f, - -0.9883548718920168f, - -0.9883349448747059f, - -0.988315000922543f, - -0.9882950400358694f, - -0.9882750622150274f, - -0.9882550674603591f, - -0.9882350557722073f, - -0.9882150271509147f, - -0.9881949815968245f, - -0.9881749191102805f, - -0.9881548396916262f, - -0.9881347433412057f, - -0.9881146300593631f, - -0.9880944998464434f, - -0.9880743527027914f, - -0.9880541886287524f, - -0.9880340076246716f, - -0.9880138096908953f, - -0.987993594827769f, - -0.9879733630356395f, - -0.9879531143148532f, - -0.9879328486657574f, - -0.9879125660886992f, - -0.9878922665840258f, - -0.9878719501520854f, - -0.9878516167932261f, - -0.9878312665077962f, - -0.9878108992961445f, - -0.9877905151586197f, - -0.9877701140955714f, - -0.9877496961073491f, - -0.9877292611943026f, - -0.987708809356782f, - -0.9876883405951378f, - -0.9876678549097205f, - -0.9876473523008819f, - -0.9876268327689722f, - -0.9876062963143438f, - -0.9875857429373481f, - -0.9875651726383379f, - -0.987544585417665f, - -0.9875239812756824f, - -0.9875033602127432f, - -0.9874827222292007f, - -0.9874620673254088f, - -0.9874413955017208f, - -0.9874207067584914f, - -0.987400001096075f, - -0.9873792785148262f, - -0.9873585390151004f, - -0.9873377825972527f, - -0.9873170092616387f, - -0.9872962190086146f, - -0.9872754118385366f, - -0.9872545877517611f, - -0.9872337467486448f, - -0.987212888829545f, - -0.9871920139948193f, - -0.987171122244825f, - -0.98715021357992f, - -0.9871292880004631f, - -0.9871083455068124f, - -0.9870873860993269f, - -0.9870664097783656f, - -0.9870454165442881f, - -0.9870244063974541f, - -0.9870033793382236f, - -0.9869823353669567f, - -0.9869612744840143f, - -0.9869401966897569f, - -0.986919101984546f, - -0.9868979903687428f, - -0.9868768618427093f, - -0.9868557164068072f, - -0.9868345540613993f, - -0.9868133748068477f, - -0.9867921786435156f, - -0.986770965571766f, - -0.9867497355919628f, - -0.986728488704469f, - -0.9867072249096495f, - -0.986685944207868f, - -0.9866646465994896f, - -0.986643332084879f, - -0.9866220006644015f, - -0.9866006523384224f, - -0.9865792871073078f, - -0.9865579049714237f, - -0.9865365059311364f, - -0.9865150899868125f, - -0.9864936571388191f, - -0.9864722073875234f, - -0.986450740733293f, - -0.9864292571764954f, - -0.9864077567174993f, - -0.9863862393566726f, - -0.9863647050943842f, - -0.9863431539310031f, - -0.9863215858668984f, - -0.98630000090244f, - -0.9862783990379975f, - -0.986256780273941f, - -0.986235144610641f, - -0.9862134920484683f, - -0.9861918225877937f, - -0.986170136228989f, - -0.986148432972425f, - -0.9861267128184744f, - -0.9861049757675087f, - -0.9860832218199009f, - -0.9860614509760234f, - -0.9860396632362493f, - -0.9860178586009518f, - -0.9859960370705051f, - -0.9859741986452822f, - -0.9859523433256582f, - -0.9859304711120068f, - -0.9859085820047033f, - -0.9858866760041227f, - -0.9858647531106401f, - -0.9858428133246313f, - -0.9858208566464723f, - -0.9857988830765394f, - -0.9857768926152088f, - -0.9857548852628574f, - -0.9857328610198625f, - -0.9857108198866013f, - -0.9856887618634514f, - -0.9856666869507908f, - -0.985644595148998f, - -0.9856224864584514f, - -0.9856003608795296f, - -0.9855782184126118f, - -0.9855560590580777f, - -0.9855338828163068f, - -0.985511689687679f, - -0.9854894796725746f, - -0.9854672527713743f, - -0.9854450089844587f, - -0.9854227483122093f, - -0.9854004707550071f, - -0.9853781763132342f, - -0.9853558649872726f, - -0.9853335367775041f, - -0.985311191684312f, - -0.9852888297080786f, - -0.9852664508491874f, - -0.9852440551080216f, - -0.9852216424849654f, - -0.9851992129804023f, - -0.9851767665947169f, - -0.9851543033282936f, - -0.9851318231815176f, - -0.985109326154774f, - -0.9850868122484482f, - -0.9850642814629259f, - -0.9850417337985934f, - -0.9850191692558369f, - -0.9849965878350431f, - -0.9849739895365985f, - -0.9849513743608911f, - -0.984928742308308f, - -0.9849060933792368f, - -0.9848834275740658f, - -0.9848607448931834f, - -0.984838045336978f, - -0.9848153289058392f, - -0.9847925956001554f, - -0.9847698454203168f, - -0.9847470783667127f, - -0.9847242944397337f, - -0.9847014936397698f, - -0.9846786759672118f, - -0.9846558414224507f, - -0.984632990005878f, - -0.9846101217178848f, - -0.9845872365588633f, - -0.9845643345292054f, - -0.9845414156293036f, - -0.9845184798595508f, - -0.9844955272203397f, - -0.9844725577120638f, - -0.9844495713351163f, - -0.9844265680898917f, - -0.9844035479767836f, - -0.9843805109961868f, - -0.9843574571484958f, - -0.9843343864341058f, - -0.984311298853412f, - -0.9842881944068099f, - -0.9842650730946955f, - -0.984241934917465f, - -0.984218779875515f, - -0.984195607969242f, - -0.9841724191990431f, - -0.9841492135653157f, - -0.9841259910684576f, - -0.9841027517088663f, - -0.9840794954869402f, - -0.9840562224030779f, - -0.984032932457678f, - -0.9840096256511398f, - -0.9839863019838624f, - -0.9839629614562456f, - -0.9839396040686891f, - -0.9839162298215937f, - -0.9838928387153592f, - -0.9838694307503868f, - -0.9838460059270774f, - -0.9838225642458327f, - -0.983799105707054f, - -0.9837756303111435f, - -0.9837521380585031f, - -0.9837286289495358f, - -0.9837051029846443f, - -0.9836815601642316f, - -0.9836580004887009f, - -0.9836344239584562f, - -0.9836108305739015f, - -0.983587220335441f, - -0.983563593243479f, - -0.9835399492984206f, - -0.983516288500671f, - -0.9834926108506354f, - -0.9834689163487196f, - -0.9834452049953297f, - -0.9834214767908719f, - -0.9833977317357527f, - -0.9833739698303792f, - -0.9833501910751581f, - -0.9833263954704974f, - -0.9833025830168045f, - -0.9832787537144876f, - -0.9832549075639546f, - -0.9832310445656146f, - -0.9832071647198763f, - -0.9831832680271488f, - -0.9831593544878415f, - -0.9831354241023645f, - -0.9831114768711274f, - -0.9830875127945411f, - -0.9830635318730154f, - -0.983039534106962f, - -0.9830155194967916f, - -0.982991488042916f, - -0.9829674397457466f, - -0.9829433746056959f, - -0.9829192926231758f, - -0.9828951937985995f, - -0.9828710781323793f, - -0.9828469456249288f, - -0.9828227962766612f, - -0.9827986300879908f, - -0.9827744470593314f, - -0.9827502471910973f, - -0.9827260304837031f, - -0.982701796937564f, - -0.982677546553095f, - -0.9826532793307118f, - -0.98262899527083f, - -0.982604694373866f, - -0.982580376640236f, - -0.9825560420703566f, - -0.9825316906646449f, - -0.9825073224235181f, - -0.9824829373473939f, - -0.9824585354366899f, - -0.9824341166918242f, - -0.9824096811132156f, - -0.9823852287012824f, - -0.9823607594564437f, - -0.9823362733791187f, - -0.9823117704697271f, - -0.9822872507286887f, - -0.9822627141564235f, - -0.9822381607533525f, - -0.9822135905198955f, - -0.9821890034564743f, - -0.9821643995635095f, - -0.9821397788414236f, - -0.9821151412906375f, - -0.982090486911574f, - -0.982065815704655f, - -0.982041127670304f, - -0.9820164228089433f, - -0.9819917011209967f, - -0.9819669626068873f, - -0.9819422072670395f, - -0.9819174351018773f, - -0.9818926461118251f, - -0.9818678402973076f, - -0.9818430176587499f, - -0.9818181781965775f, - -0.9817933219112158f, - -0.9817684488030906f, - -0.9817435588726284f, - -0.9817186521202557f, - -0.981693728546399f, - -0.9816687881514853f, - -0.9816438309359423f, - -0.9816188569001973f, - -0.9815938660446788f, - -0.9815688583698141f, - -0.9815438338760325f, - -0.9815187925637623f, - -0.981493734433433f, - -0.9814686594854735f, - -0.9814435677203137f, - -0.9814184591383837f, - -0.9813933337401132f, - -0.9813681915259334f, - -0.9813430324962746f, - -0.9813178566515681f, - -0.9812926639922451f, - -0.9812674545187376f, - -0.9812422282314773f, - -0.9812169851308966f, - -0.9811917252174278f, - -0.9811664484915039f, - -0.9811411549535581f, - -0.9811158446040237f, - -0.9810905174433341f, - -0.9810651734719237f, - -0.9810398126902267f, - -0.9810144350986774f, - -0.9809890406977106f, - -0.980963629487762f, - -0.9809382014692665f, - -0.9809127566426599f, - -0.9808872950083781f, - -0.9808618165668577f, - -0.9808363213185349f, - -0.9808108092638469f, - -0.9807852804032304f, - -0.9807597347371233f, - -0.9807341722659629f, - -0.9807085929901879f, - -0.9806829969102356f, - -0.9806573840265453f, - -0.9806317543395555f, - -0.9806061078497058f, - -0.9805804445574351f, - -0.9805547644631836f, - -0.9805290675673909f, - -0.9805033538704979f, - -0.9804776233729444f, - -0.9804518760751719f, - -0.9804261119776213f, - -0.9804003310807342f, - -0.9803745333849524f, - -0.9803487188907178f, - -0.9803228875984725f, - -0.9802970395086597f, - -0.9802711746217219f, - -0.9802452929381023f, - -0.9802193944582445f, - -0.9801934791825919f, - -0.9801675471115892f, - -0.9801415982456803f, - -0.9801156325853098f, - -0.9800896501309226f, - -0.9800636508829643f, - -0.98003763484188f, - -0.9800116020081157f, - -0.9799855523821172f, - -0.9799594859643311f, - -0.979933402755204f, - -0.9799073027551828f, - -0.9798811859647144f, - -0.979855052384247f, - -0.9798289020142276f, - -0.9798027348551052f, - -0.9797765509073272f, - -0.9797503501713428f, - -0.9797241326476008f, - -0.9796978983365507f, - -0.9796716472386416f, - -0.9796453793543236f, - -0.9796190946840465f, - -0.9795927932282612f, - -0.9795664749874177f, - -0.9795401399619674f, - -0.9795137881523613f, - -0.9794874195590514f, - -0.979461034182489f, - -0.9794346320231265f, - -0.9794082130814159f, - -0.9793817773578104f, - -0.9793553248527628f, - -0.9793288555667262f, - -0.9793023695001541f, - -0.9792758666535006f, - -0.9792493470272198f, - -0.9792228106217659f, - -0.9791962574375935f, - -0.979169687475158f, - -0.9791431007349144f, - -0.9791164972173183f, - -0.9790898769228253f, - -0.9790632398518921f, - -0.9790365860049747f, - -0.9790099153825299f, - -0.9789832279850147f, - -0.9789565238128862f, - -0.9789298028666024f, - -0.9789030651466207f, - -0.9788763106533996f, - -0.9788495393873972f, - -0.9788227513490725f, - -0.9787959465388841f, - -0.9787691249572922f, - -0.9787422866047553f, - -0.9787154314817338f, - -0.9786885595886877f, - -0.9786616709260779f, - -0.9786347654943645f, - -0.9786078432940089f, - -0.9785809043254721f, - -0.978553948589216f, - -0.9785269760857024f, - -0.9784999868153934f, - -0.9784729807787513f, - -0.9784459579762393f, - -0.9784189184083201f, - -0.978391862075457f, - -0.9783647889781135f, - -0.978337699116754f, - -0.9783105924918422f, - -0.9782834691038426f, - -0.97825632895322f, - -0.9782291720404396f, - -0.9782019983659666f, - -0.9781748079302668f, - -0.9781476007338056f, - -0.9781203767770498f, - -0.9780931360604654f, - -0.9780658785845195f, - -0.9780386043496789f, - -0.9780113133564111f, - -0.9779840056051837f, - -0.9779566810964646f, - -0.9779293398307218f, - -0.9779019818084241f, - -0.9778746070300401f, - -0.9778472154960388f, - -0.9778198072068899f, - -0.9777923821630626f, - -0.977764940365027f, - -0.9777374818132533f, - -0.9777100065082119f, - -0.9776825144503739f, - -0.9776550056402101f, - -0.9776274800781917f, - -0.9775999377647909f, - -0.9775723787004789f, - -0.9775448028857285f, - -0.9775172103210118f, - -0.9774896010068019f, - -0.9774619749435719f, - -0.977434332131795f, - -0.9774066725719447f, - -0.9773789962644953f, - -0.9773513032099208f, - -0.9773235934086958f, - -0.9772958668612949f, - -0.9772681235681935f, - -0.9772403635298669f, - -0.9772125867467906f, - -0.9771847932194404f, - -0.977156982948293f, - -0.9771291559338245f, - -0.9771013121765123f, - -0.9770734516768327f, - -0.9770455744352636f, - -0.9770176804522824f, - -0.9769897697283677f, - -0.9769618422639967f, - -0.9769338980596487f, - -0.9769059371158022f, - -0.9768779594329364f, - -0.9768499650115308f, - -0.9768219538520649f, - -0.9767939259550188f, - -0.9767658813208724f, - -0.9767378199501068f, - -0.9767097418432024f, - -0.9766816470006405f, - -0.9766535354229022f, - -0.9766254071104697f, - -0.9765972620638247f, - -0.9765691002834493f, - -0.9765409217698262f, - -0.9765127265234383f, - -0.9764845145447687f, - -0.9764562858343008f, - -0.976428040392518f, - -0.9763997782199046f, - -0.976371499316945f, - -0.9763432036841234f, - -0.9763148913219246f, - -0.9762865622308341f, - -0.9762582164113371f, - -0.9762298538639194f, - -0.9762014745890666f, - -0.9761730785872654f, - -0.9761446658590022f, - -0.9761162364047641f, - -0.9760877902250377f, - -0.9760593273203109f, - -0.976030847691071f, - -0.9760023513378066f, - -0.9759738382610053f, - -0.975945308461156f, - -0.9759167619387473f, - -0.975888198694269f, - -0.9758596187282097f, - -0.9758310220410596f, - -0.9758024086333085f, - -0.9757737785054468f, - -0.9757451316579651f, - -0.9757164680913541f, - -0.9756877878061049f, - -0.9756590908027092f, - -0.9756303770816586f, - -0.9756016466434451f, - -0.9755728994885606f, - -0.9755441356174984f, - -0.9755153550307509f, - -0.9754865577288114f, - -0.9754577437121731f, - -0.9754289129813299f, - -0.975400065536776f, - -0.9753712013790055f, - -0.9753423205085129f, - -0.9753134229257929f, - -0.9752845086313411f, - -0.9752555776256527f, - -0.9752266299092236f, - -0.9751976654825494f, - -0.9751686843461268f, - -0.9751396865004521f, - -0.9751106719460226f, - -0.9750816406833349f, - -0.9750525927128869f, - -0.975023528035176f, - -0.9749944466507007f, - -0.9749653485599585f, - -0.9749362337634487f, - -0.9749071022616698f, - -0.9748779540551215f, - -0.9748487891443023f, - -0.9748196075297126f, - -0.9747904092118522f, - -0.9747611941912218f, - -0.9747319624683215f, - -0.9747027140436525f, - -0.9746734489177156f, - -0.9746441670910125f, - -0.9746148685640451f, - -0.9745855533373151f, - -0.9745562214113248f, - -0.9745268727865771f, - -0.9744975074635748f, - -0.9744681254428209f, - -0.9744387267248188f, - -0.9744093113100726f, - -0.974379879199086f, - -0.9743504303923635f, - -0.9743209648904093f, - -0.9742914826937288f, - -0.974261983802827f, - -0.9742324682182093f, - -0.9742029359403813f, - -0.9741733869698493f, - -0.9741438213071196f, - -0.9741142389526984f, - -0.9740846399070933f, - -0.9740550241708108f, - -0.9740253917443588f, - -0.9739957426282445f, - -0.9739660768229768f, - -0.973936394329063f, - -0.9739066951470124f, - -0.9738769792773336f, - -0.9738472467205362f, - -0.973817497477129f, - -0.9737877315476221f, - -0.9737579489325254f, - -0.9737281496323495f, - -0.9736983336476049f, - -0.9736685009788023f, - -0.9736386516264529f, - -0.9736087855910683f, - -0.9735789028731603f, - -0.9735490034732408f, - -0.9735190873918219f, - -0.9734891546294168f, - -0.9734592051865378f, - -0.9734292390636985f, - -0.9733992562614119f, - -0.9733692567801921f, - -0.973339240620553f, - -0.9733092077830093f, - -0.973279158268075f, - -0.9732490920762653f, - -0.9732190092080952f, - -0.9731889096640808f, - -0.9731587934447369f, - -0.9731286605505801f, - -0.9730985109821264f, - -0.9730683447398931f, - -0.9730381618243962f, - -0.9730079622361534f, - -0.9729777459756821f, - -0.9729475130434998f, - -0.9729172634401249f, - -0.9728869971660754f, - -0.9728567142218703f, - -0.9728264146080278f, - -0.9727960983250677f, - -0.9727657653735095f, - -0.9727354157538725f, - -0.9727050494666768f, - -0.972674666512443f, - -0.9726442668916917f, - -0.9726138506049437f, - -0.9725834176527198f, - -0.972552968035542f, - -0.972522501753932f, - -0.9724920188084114f, - -0.9724615191995027f, - -0.9724310029277289f, - -0.9724004699936125f, - -0.9723699203976768f, - -0.9723393541404449f, - -0.9723087712224411f, - -0.9722781716441891f, - -0.9722475554062135f, - -0.9722169225090385f, - -0.9721862729531893f, - -0.9721556067391907f, - -0.9721249238675689f, - -0.9720942243388487f, - -0.9720635081535568f, - -0.9720327753122191f, - -0.9720020258153629f, - -0.971971259663514f, - -0.9719404768572005f, - -0.9719096773969493f, - -0.9718788612832885f, - -0.971848028516746f, - -0.9718171790978501f, - -0.9717863130271291f, - -0.9717554303051125f, - -0.971724530932329f, - -0.9716936149093083f, - -0.9716626822365798f, - -0.971631732914674f, - -0.9716007669441208f, - -0.971569784325451f, - -0.9715387850591954f, - -0.9715077691458851f, - -0.9714767365860518f, - -0.9714456873802271f, - -0.9714146215289429f, - -0.9713835390327314f, - -0.9713524398921257f, - -0.9713213241076583f, - -0.9712901916798624f, - -0.9712590426092713f, - -0.9712278768964191f, - -0.9711966945418397f, - -0.9711654955460671f, - -0.9711342799096361f, - -0.9711030476330816f, - -0.9710717987169387f, - -0.9710405331617433f, - -0.9710092509680301f, - -0.9709779521363361f, - -0.9709466366671969f, - -0.9709153045611499f, - -0.970883955818731f, - -0.970852590440478f, - -0.970821208426928f, - -0.9707898097786191f, - -0.970758394496089f, - -0.9707269625798761f, - -0.9706955140305187f, - -0.9706640488485562f, - -0.9706325670345274f, - -0.9706010685889718f, - -0.9705695535124289f, - -0.9705380218054391f, - -0.9705064734685426f, - -0.9704749085022797f, - -0.9704433269071914f, - -0.9704117286838189f, - -0.9703801138327037f, - -0.9703484823543874f, - -0.9703168342494117f, - -0.9702851695183196f, - -0.9702534881616531f, - -0.9702217901799552f, - -0.9701900755737689f, - -0.970158344343638f, - -0.9701265964901059f, - -0.9700948320137167f, - -0.9700630509150147f, - -0.970031253194544f, - -0.9699994388528502f, - -0.9699676078904778f, - -0.9699357603079729f, - -0.9699038961058805f, - -0.9698720152847469f, - -0.9698401178451181f, - -0.9698082037875415f, - -0.9697762731125629f, - -0.9697443258207299f, - -0.9697123619125898f, - -0.9696803813886907f, - -0.9696483842495799f, - -0.9696163704958061f, - -0.9695843401279176f, - -0.9695522931464635f, - -0.9695202295519929f, - -0.9694881493450551f, - -0.9694560525261995f, - -0.9694239390959766f, - -0.9693918090549364f, - -0.9693596624036294f, - -0.9693274991426063f, - -0.9692953192724186f, - -0.9692631227936175f, - -0.9692309097067545f, - -0.9691986800123816f, - -0.9691664337110514f, - -0.969134170803316f, - -0.9691018912897287f, - -0.969069595170842f, - -0.9690372824472098f, - -0.9690049531193855f, - -0.9689726071879231f, - -0.9689402446533767f, - -0.9689078655163011f, - -0.9688754697772511f, - -0.9688430574367815f, - -0.968810628495448f, - -0.968778182953806f, - -0.9687457208124117f, - -0.968713242071821f, - -0.9686807467325907f, - -0.9686482347952776f, - -0.9686157062604387f, - -0.9685831611286311f, - -0.9685505994004129f, - -0.9685180210763419f, - -0.9684854261569762f, - -0.9684528146428742f, - -0.968420186534595f, - -0.9683875418326977f, - -0.9683548805377413f, - -0.9683222026502856f, - -0.9682895081708907f, - -0.9682567971001166f, - -0.9682240694385239f, - -0.9681913251866732f, - -0.9681585643451259f, - -0.9681257869144432f, - -0.9680929928951866f, - -0.9680601822879179f, - -0.9680273550931997f, - -0.9679945113115942f, - -0.9679616509436646f, - -0.9679287739899732f, - -0.967895880451084f, - -0.9678629703275601f, - -0.9678300436199662f, - -0.9677971003288655f, - -0.9677641404548232f, - -0.9677311639984035f, - -0.9676981709601722f, - -0.9676651613406938f, - -0.9676321351405345f, - -0.9675990923602596f, - -0.9675660330004361f, - -0.96753295706163f, - -0.967499864544408f, - -0.9674667554493369f, - -0.9674336297769847f, - -0.9674004875279185f, - -0.9673673287027064f, - -0.9673341533019164f, - -0.9673009613261169f, - -0.9672677527758768f, - -0.9672345276517652f, - -0.9672012859543513f, - -0.9671680276842043f, - -0.9671347528418948f, - -0.9671014614279926f, - -0.967068153443068f, - -0.9670348288876918f, - -0.9670014877624351f, - -0.9669681300678693f, - -0.9669347558045658f, - -0.9669013649730962f, - -0.9668679575740332f, - -0.9668345336079487f, - -0.9668010930754162f, - -0.9667676359770075f, - -0.966734162313297f, - -0.9667006720848575f, - -0.9666671652922636f, - -0.9666336419360886f, - -0.9666001020169074f, - -0.9665665455352944f, - -0.9665329724918252f, - -0.9664993828870743f, - -0.9664657767216177f, - -0.9664321539960309f, - -0.9663985147108904f, - -0.9663648588667726f, - -0.966331186464254f, - -0.9662974975039113f, - -0.9662637919863222f, - -0.9662300699120642f, - -0.9661963312817148f, - -0.9661625760958522f, - -0.9661288043550551f, - -0.9660950160599019f, - -0.9660612112109717f, - -0.9660273898088433f, - -0.9659935518540969f, - -0.9659596973473119f, - -0.9659258262890684f, - -0.9658919386799466f, - -0.9658580345205278f, - -0.9658241138113923f, - -0.9657901765531216f, - -0.9657562227462971f, - -0.9657222523915004f, - -0.9656882654893142f, - -0.9656542620403203f, - -0.9656202420451016f, - -0.9655862055042406f, - -0.9655521524183212f, - -0.9655180827879262f, - -0.9654839966136401f, - -0.9654498938960462f, - -0.9654157746357294f, - -0.9653816388332738f, - -0.9653474864892652f, - -0.9653133176042877f, - -0.9652791321789276f, - -0.96524493021377f, - -0.9652107117094015f, - -0.9651764766664084f, - -0.9651422250853771f, - -0.9651079569668941f, - -0.9650736723115474f, - -0.965039371119924f, - -0.9650050533926117f, - -0.9649707191301982f, - -0.9649363683332725f, - -0.9649020010024227f, - -0.9648676171382378f, - -0.9648332167413067f, - -0.9647987998122195f, - -0.9647643663515652f, - -0.9647299163599344f, - -0.9646954498379169f, - -0.9646609667861036f, - -0.9646264672050853f, - -0.964591951095453f, - -0.9645574184577981f, - -0.9645228692927126f, - -0.9644883036007883f, - -0.9644537213826175f, - -0.9644191226387925f, - -0.9643845073699066f, - -0.9643498755765527f, - -0.9643152272593241f, - -0.9642805624188147f, - -0.9642458810556184f, - -0.9642111831703294f, - -0.9641764687635421f, - -0.964141737835852f, - -0.9641069903878531f, - -0.9640722264201417f, - -0.9640374459333129f, - -0.9640026489279634f, - -0.9639678354046884f, - -0.9639330053640853f, - -0.9638981588067503f, - -0.963863295733281f, - -0.9638284161442745f, - -0.9637935200403285f, - -0.9637586074220407f, - -0.9637236782900097f, - -0.9636887326448339f, - -0.963653770487112f, - -0.9636187918174428f, - -0.9635837966364262f, - -0.9635487849446615f, - -0.9635137567427489f, - -0.963478712031288f, - -0.9634436508108799f, - -0.9634085730821249f, - -0.9633734788456249f, - -0.9633383681019799f, - -0.9633032408517925f, - -0.9632680970956642f, - -0.9632329368341976f, - -0.9631977600679945f, - -0.9631625667976582f, - -0.9631273570237914f, - -0.9630921307469976f, - -0.9630568879678804f, - -0.9630216286870437f, - -0.9629863529050914f, - -0.9629510606226279f, - -0.9629157518402585f, - -0.9628804265585876f, - -0.962845084778221f, - -0.9628097264997636f, - -0.9627743517238219f, - -0.9627389604510018f, - -0.9627035526819097f, - -0.9626681284171521f, - -0.9626326876573363f, - -0.9625972304030697f, - -0.9625617566549595f, - -0.9625262664136134f, - -0.9624907596796399f, - -0.9624552364536474f, - -0.9624196967362444f, - -0.9623841405280397f, - -0.962348567829643f, - -0.9623129786416634f, - -0.962277372964711f, - -0.9622417507993957f, - -0.962206112146328f, - -0.9621704570061184f, - -0.9621347853793784f, - -0.9620990972667183f, - -0.9620633926687503f, - -0.9620276715860858f, - -0.9619919340193375f, - -0.9619561799691168f, - -0.9619204094360371f, - -0.9618846224207108f, - -0.9618488189237516f, - -0.9618129989457728f, - -0.9617771624873881f, - -0.9617413095492112f, - -0.9617054401318572f, - -0.9616695542359401f, - -0.9616336518620752f, - -0.9615977330108771f, - -0.9615617976829619f, - -0.9615258458789451f, - -0.9614898775994427f, - -0.9614538928450708f, - -0.9614178916164463f, - -0.9613818739141861f, - -0.9613458397389071f, - -0.961309789091227f, - -0.961273721971763f, - -0.9612376383811337f, - -0.9612015383199572f, - -0.9611654217888521f, - -0.9611292887884368f, - -0.9610931393193312f, - -0.9610569733821542f, - -0.9610207909775256f, - -0.9609845921060651f, - -0.9609483767683936f, - -0.9609121449651309f, - -0.9608758966968988f, - -0.9608396319643172f, - -0.9608033507680084f, - -0.9607670531085936f, - -0.9607307389866953f, - -0.9606944084029347f, - -0.9606580613579354f, - -0.9606216978523194f, - -0.9605853178867108f, - -0.9605489214617317f, - -0.9605125085780065f, - -0.9604760792361587f, - -0.9604396334368132f, - -0.9604031711805938f, - -0.9603666924681258f, - -0.9603301973000336f, - -0.9602936856769431f, - -0.9602571575994797f, - -0.9602206130682694f, - -0.9601840520839382f, - -0.9601474746471127f, - -0.9601108807584198f, - -0.9600742704184863f, - -0.9600376436279392f, - -0.9600010003874068f, - -0.9599643406975165f, - -0.9599276645588966f, - -0.9598909719721753f, - -0.9598542629379817f, - -0.9598175374569448f, - -0.9597807955296935f, - -0.9597440371568574f, - -0.9597072623390668f, - -0.9596704710769514f, - -0.9596336633711415f, - -0.9595968392222685f, - -0.9595599986309628f, - -0.9595231415978557f, - -0.9594862681235785f, - -0.9594493782087639f, - -0.9594124718540429f, - -0.9593755490600486f, - -0.9593386098274133f, - -0.9593016541567705f, - -0.9592646820487526f, - -0.9592276935039937f, - -0.9591906885231272f, - -0.9591536671067876f, - -0.9591166292556091f, - -0.9590795749702263f, - -0.9590425042512738f, - -0.9590054170993874f, - -0.9589683135152022f, - -0.958931193499354f, - -0.9588940570524785f, - -0.9588569041752129f, - -0.9588197348681932f, - -0.9587825491320563f, - -0.9587453469674393f, - -0.95870812837498f, - -0.9586708933553156f, - -0.9586336419090851f, - -0.9585963740369254f, - -0.9585590897394762f, - -0.9585217890173757f, - -0.9584844718712638f, - -0.958447138301779f, - -0.9584097883095616f, - -0.9583724218952512f, - -0.9583350390594887f, - -0.9582976398029137f, - -0.9582602241261678f, - -0.9582227920298919f, - -0.9581853435147271f, - -0.9581478785813154f, - -0.9581103972302988f, - -0.9580728994623193f, - -0.9580353852780193f, - -0.957997854678042f, - -0.9579603076630303f, - -0.9579227442336276f, - -0.9578851643904772f, - -0.9578475681342234f, - -0.9578099554655105f, - -0.9577723263849827f, - -0.9577346808932845f, - -0.9576970189910616f, - -0.9576593406789591f, - -0.9576216459576224f, - -0.9575839348276973f, - -0.9575462072898304f, - -0.957508463344668f, - -0.9574707029928567f, - -0.9574329262350434f, - -0.9573951330718757f, - -0.9573573235040009f, - -0.9573194975320675f, - -0.9572816551567226f, - -0.9572437963786153f, - -0.9572059211983941f, - -0.9571680296167084f, - -0.9571301216342067f, - -0.9570921972515392f, - -0.9570542564693552f, - -0.9570162992883056f, - -0.9569783257090396f, - -0.9569403357322089f, - -0.9569023293584639f, - -0.9568643065884561f, - -0.956826267422837f, - -0.9567882118622584f, - -0.9567501399073719f, - -0.9567120515588304f, - -0.9566739468172866f, - -0.956635825683393f, - -0.9565976881578028f, - -0.9565595342411698f, - -0.9565213639341477f, - -0.9564831772373904f, - -0.9564449741515523f, - -0.9564067546772876f, - -0.956368518815252f, - -0.9563302665661f, - -0.9562919979304874f, - -0.9562537129090695f, - -0.9562154115025027f, - -0.9561770937114432f, - -0.9561387595365476f, - -0.9561004089784724f, - -0.9560620420378751f, - -0.9560236587154132f, - -0.9559852590117441f, - -0.9559468429275256f, - -0.9559084104634165f, - -0.9558699616200748f, - -0.9558314963981599f, - -0.9557930147983301f, - -0.9557545168212456f, - -0.9557160024675653f, - -0.9556774717379499f, - -0.9556389246330589f, - -0.9556003611535533f, - -0.9555617813000934f, - -0.9555231850733408f, - -0.9554845724739565f, - -0.9554459435026023f, - -0.9554072981599395f, - -0.9553686364466313f, - -0.9553299583633394f, - -0.9552912639107269f, - -0.9552525530894563f, - -0.9552138259001917f, - -0.9551750823435962f, - -0.9551363224203336f, - -0.955097546131068f, - -0.9550587534764642f, - -0.9550199444571867f, - -0.9549811190739005f, - -0.9549422773272704f, - -0.9549034192179628f, - -0.9548645447466431f, - -0.9548256539139772f, - -0.9547867467206316f, - -0.9547478231672732f, - -0.9547088832545689f, - -0.9546699269831858f, - -0.9546309543537913f, - -0.954591965367053f, - -0.9545529600236398f, - -0.9545139383242189f, - -0.9544749002694604f, - -0.9544358458600316f, - -0.9543967750966028f, - -0.9543576879798428f, - -0.9543185845104222f, - -0.9542794646890098f, - -0.954240328516277f, - -0.9542011759928937f, - -0.9541620071195315f, - -0.9541228218968606f, - -0.9540836203255532f, - -0.9540444024062804f, - -0.9540051681397148f, - -0.9539659175265284f, - -0.9539266505673937f, - -0.9538873672629833f, - -0.9538480676139709f, - -0.9538087516210294f, - -0.9537694192848327f, - -0.9537300706060544f, - -0.9536907055853694f, - -0.9536513242234513f, - -0.9536119265209761f, - -0.9535725124786176f, - -0.953533082097052f, - -0.9534936353769544f, - -0.9534541723190014f, - -0.9534146929238683f, - -0.9533751971922322f, - -0.9533356851247697f, - -0.9532961567221578f, - -0.9532566119850735f, - -0.9532170509141951f, - -0.9531774735101999f, - -0.9531378797737659f, - -0.9530982697055722f, - -0.9530586433062971f, - -0.9530190005766196f, - -0.9529793415172187f, - -0.9529396661287747f, - -0.9528999744119667f, - -0.9528602663674752f, - -0.9528205419959803f, - -0.9527808012981632f, - -0.9527410442747041f, - -0.9527012709262848f, - -0.9526614812535862f, - -0.9526216752572909f, - -0.9525818529380805f, - -0.9525420142966374f, - -0.952502159333644f, - -0.9524622880497837f, - -0.9524224004457394f, - -0.9523824965221946f, - -0.9523425762798328f, - -0.9523026397193384f, - -0.9522626868413956f, - -0.9522227176466889f, - -0.9521827321359029f, - -0.9521427303097233f, - -0.952102712168835f, - -0.9520626777139245f, - -0.9520226269456766f, - -0.9519825598647785f, - -0.9519424764719162f, - -0.9519023767677773f, - -0.9518622607530478f, - -0.9518221284284158f, - -0.9517819797945686f, - -0.9517418148521948f, - -0.9517016336019817f, - -0.9516614360446183f, - -0.9516212221807931f, - -0.9515809920111957f, - -0.951540745536515f, - -0.9515004827574407f, - -0.9514602036746627f, - -0.9514199082888709f, - -0.9513795966007563f, - -0.9513392686110093f, - -0.9512989243203209f, - -0.9512585637293822f, - -0.9512181868388854f, - -0.9511777936495218f, - -0.9511373841619837f, - -0.9510969583769633f, - -0.9510565162951536f, - -0.9510160579172475f, - -0.9509755832439383f, - -0.9509350922759189f, - -0.950894585013884f, - -0.9508540614585272f, - -0.9508135216105431f, - -0.9507729654706257f, - -0.9507323930394709f, - -0.950691804317773f, - -0.9506511993062284f, - -0.9506105780055318f, - -0.9505699404163801f, - -0.9505292865394689f, - -0.9504886163754958f, - -0.9504479299251565f, - -0.9504072271891488f, - -0.9503665081681699f, - -0.9503257728629182f, - -0.9502850212740905f, - -0.950244253402386f, - -0.9502034692485027f, - -0.9501626688131399f, - -0.9501218520969965f, - -0.9500810191007718f, - -0.9500401698251654f, - -0.9499993042708774f, - -0.9499584224386081f, - -0.9499175243290578f, - -0.9498766099429271f, - -0.9498356792809176f, - -0.9497947323437304f, - -0.949753769132067f, - -0.9497127896466291f, - -0.9496717938881194f, - -0.94963078185724f, - -0.9495897535546938f, - -0.9495487089811837f, - -0.9495076481374127f, - -0.9494665710240849f, - -0.949425477641904f, - -0.949384367991574f, - -0.949343242073799f, - -0.9493020998892845f, - -0.9492609414387345f, - -0.9492197667228555f, - -0.9491785757423514f, - -0.9491373684979293f, - -0.9490961449902945f, - -0.9490549052201542f, - -0.949013649188214f, - -0.9489723768951814f, - -0.9489310883417634f, - -0.9488897835286682f, - -0.9488484624566021f, - -0.9488071251262744f, - -0.9487657715383926f, - -0.9487244016936659f, - -0.948683015592803f, - -0.9486416132365127f, - -0.9486001946255046f, - -0.9485587597604885f, - -0.9485173086421745f, - -0.9484758412712726f, - -0.9484343576484932f, - -0.9483928577745474f, - -0.9483513416501463f, - -0.9483098092760013f, - -0.9482682606528234f, - -0.9482266957813255f, - -0.9481851146622192f, - -0.9481435172962173f, - -0.948101903684032f, - -0.948060273826377f, - -0.9480186277239653f, - -0.9479769653775106f, - -0.9479352867877264f, - -0.9478935919553274f, - -0.9478518808810279f, - -0.9478101535655423f, - -0.9477684100095857f, - -0.9477266502138736f, - -0.9476848741791215f, - -0.9476430819060447f, - -0.94760127339536f, - -0.9475594486477836f, - -0.9475176076640319f, - -0.9474757504448218f, - -0.9474338769908712f, - -0.9473919873028965f, - -0.9473500813816165f, - -0.9473081592277484f, - -0.9472662208420111f, - -0.9472242662251231f, - -0.9471822953778032f, - -0.9471403083007702f, - -0.9470983049947443f, - -0.9470562854604447f, - -0.9470142496985916f, - -0.9469721977099049f, - -0.9469301294951057f, - -0.9468880450549145f, - -0.9468459443900525f, - -0.9468038275012408f, - -0.9467616943892015f, - -0.9467195450546562f, - -0.9466773794983276f, - -0.9466351977209375f, - -0.9465929997232092f, - -0.9465507855058654f, - -0.9465085550696302f, - -0.9464663084152259f, - -0.9464240455433774f, - -0.9463817664548084f, - -0.946339471150244f, - -0.9462971596304078f, - -0.9462548318960259f, - -0.9462124879478226f, - -0.9461701277865244f, - -0.9461277514128567f, - -0.9460853588275454f, - -0.9460429500313172f, - -0.9460005250248983f, - -0.9459580838090162f, - -0.9459156263843981f, - -0.9458731527517711f, - -0.945830662911863f, - -0.9457881568654022f, - -0.9457456346131169f, - -0.9457030961557357f, - -0.9456605414939872f, - -0.9456179706286009f, - -0.9455753835603062f, - -0.9455327802898328f, - -0.9454901608179104f, - -0.9454475251452698f, - -0.9454048732726412f, - -0.9453622052007556f, - -0.9453195209303438f, - -0.9452768204621376f, - -0.9452341037968683f, - -0.9451913709352682f, - -0.945148621878069f, - -0.9451058566260038f, - -0.9450630751798047f, - -0.9450202775402058f, - -0.9449774637079391f, - -0.9449346336837392f, - -0.9448917874683394f, - -0.9448489250624745f, - -0.944806046466878f, - -0.9447631516822855f, - -0.9447202407094314f, - -0.9446773135490514f, - -0.9446343702018809f, - -0.9445914106686556f, - -0.9445484349501114f, - -0.9445054430469852f, - -0.9444624349600135f, - -0.9444194106899331f, - -0.944376370237481f, - -0.9443333136033951f, - -0.9442902407884131f, - -0.9442471517932729f, - -0.9442040466187126f, - -0.9441609252654712f, - -0.9441177877342876f, - -0.9440746340259006f, - -0.94403146414105f, - -0.9439882780804748f, - -0.9439450758449159f, - -0.9439018574351131f, - -0.9438586228518071f, - -0.9438153720957382f, - -0.9437721051676481f, - -0.943728822068278f, - -0.9436855227983696f, - -0.9436422073586643f, - -0.9435988757499051f, - -0.9435555279728337f, - -0.9435121640281938f, - -0.9434687839167274f, - -0.9434253876391785f, - -0.9433819751962902f, - -0.9433385465888072f, - -0.9432951018174724f, - -0.9432516408830313f, - -0.9432081637862277f, - -0.9431646705278077f, - -0.9431211611085154f, - -0.943077635529097f, - -0.9430340937902978f, - -0.9429905358928644f, - -0.9429469618375431f, - -0.9429033716250802f, - -0.9428597652562225f, - -0.9428161427317178f, - -0.9427725040523132f, - -0.9427288492187564f, - -0.9426851782317952f, - -0.9426414910921784f, - -0.9425977878006544f, - -0.9425540683579718f, - -0.9425103327648797f, - -0.942466581022128f, - -0.942422813130466f, - -0.9423790290906437f, - -0.942335228903411f, - -0.9422914125695191f, - -0.9422475800897184f, - -0.94220373146476f, - -0.9421598666953949f, - -0.9421159857823753f, - -0.9420720887264528f, - -0.9420281755283793f, - -0.9419842461889081f, - -0.9419403007087906f, - -0.941896339088781f, - -0.9418523613296318f, - -0.9418083674320974f, - -0.9417643573969304f, - -0.9417203312248859f, - -0.9416762889167176f, - -0.9416322304731812f, - -0.9415881558950302f, - -0.9415440651830209f, - -0.9414999583379081f, - -0.9414558353604482f, - -0.9414116962513969f, - -0.9413675410115105f, - -0.9413233696415453f, - -0.9412791821422588f, - -0.9412349785144077f, - -0.9411907587587497f, - -0.941146522876042f, - -0.9411022708670431f, - -0.9410580027325111f, - -0.9410137184732044f, - -0.9409694180898815f, - -0.9409251015833023f, - -0.9408807689542253f, - -0.9408364202034111f, - -0.9407920553316185f, - -0.9407476743396084f, - -0.9407032772281408f, - -0.9406588639979773f, - -0.9406144346498777f, - -0.9405699891846041f, - -0.940525527602918f, - -0.9404810499055809f, - -0.9404365560933549f, - -0.9403920461670028f, - -0.9403475201272871f, - -0.9403029779749704f, - -0.9402584197108165f, - -0.9402138453355886f, - -0.9401692548500504f, - -0.9401246482549658f, - -0.9400800255510996f, - -0.9400353867392162f, - -0.9399907318200803f, - -0.939946060794457f, - -0.939901373663112f, - -0.939856670426811f, - -0.9398119510863199f, - -0.9397672156424045f, - -0.9397224640958322f, - -0.9396776964473692f, - -0.9396329126977828f, - -0.93958811284784f, - -0.9395432968983091f, - -0.9394984648499576f, - -0.9394536167035537f, - -0.9394087524598655f, - -0.9393638721196625f, - -0.939318975683713f, - -0.9392740631527873f, - -0.9392291345276536f, - -0.9391841898090828f, - -0.9391392289978442f, - -0.9390942520947093f, - -0.9390492591004476f, - -0.9390042500158308f, - -0.9389592248416294f, - -0.9389141835786161f, - -0.9388691262275612f, - -0.938824052789238f, - -0.9387789632644178f, - -0.9387338576538741f, - -0.9386887359583792f, - -0.9386435981787066f, - -0.9385984443156291f, - -0.9385532743699211f, - -0.9385080883423564f, - -0.9384628862337091f, - -0.9384176680447538f, - -0.938372433776265f, - -0.9383271834290183f, - -0.9382819170037889f, - -0.9382366345013523f, - -0.9381913359224842f, - -0.9381460212679612f, - -0.9381006905385596f, - -0.9380553437350562f, - -0.9380099808582275f, - -0.9379646019088516f, - -0.9379192068877056f, - -0.9378737957955673f, - -0.9378283686332147f, - -0.9377829254014266f, - -0.9377374661009812f, - -0.9376919907326582f, - -0.9376464992972356f, - -0.937600991795494f, - -0.9375554682282123f, - -0.9375099285961717f, - -0.9374643729001509f, - -0.9374188011409318f, - -0.9373732133192945f, - -0.937327609436021f, - -0.9372819894918916f, - -0.9372363534876887f, - -0.9371907014241939f, - -0.9371450333021899f, - -0.9370993491224588f, - -0.9370536488857837f, - -0.9370079325929471f, - -0.9369622002447331f, - -0.9369164518419248f, - -0.9368706873853063f, - -0.9368249068756614f, - -0.936779110313775f, - -0.9367332977004318f, - -0.9366874690364165f, - -0.9366416243225142f, - -0.936595763559511f, - -0.9365498867481924f, - -0.9365039938893446f, - -0.9364580849837535f, - -0.9364121600322064f, - -0.93636621903549f, - -0.9363202619943913f, - -0.9362742889096975f, - -0.9362282997821972f, - -0.9361822946126779f, - -0.9361362734019278f, - -0.9360902361507356f, - -0.9360441828598898f, - -0.9359981135301801f, - -0.9359520281623953f, - -0.935905926757326f, - -0.9358598093157608f, - -0.935813675838491f, - -0.9357675263263063f, - -0.9357213607799986f, - -0.9356751792003574f, - -0.9356289815881751f, - -0.9355827679442428f, - -0.935536538269353f, - -0.9354902925642968f, - -0.9354440308298675f, - -0.9353977530668571f, - -0.9353514592760592f, - -0.9353051494582668f, - -0.9352588236142734f, - -0.9352124817448724f, - -0.9351661238508584f, - -0.9351197499330256f, - -0.9350733599921685f, - -0.9350269540290816f, - -0.9349805320445609f, - -0.934934094039401f, - -0.9348876400143985f, - -0.9348411699703484f, - -0.9347946839080477f, - -0.9347481818282922f, - -0.9347016637318799f, - -0.9346551296196064f, - -0.93460857949227f, - -0.9345620133506682f, - -0.9345154311955989f, - -0.9344688330278597f, - -0.9344222188482498f, - -0.9343755886575678f, - -0.9343289424566119f, - -0.9342822802461825f, - -0.9342356020270787f, - -0.9341889078001001f, - -0.9341421975660467f, - -0.9340954713257195f, - -0.9340487290799186f, - -0.9340019708294451f, - -0.9339551965751f, - -0.9339084063176855f, - -0.933861600058002f, - -0.9338147777968527f, - -0.9337679395350391f, - -0.9337210852733645f, - -0.9336742150126313f, - -0.9336273287536427f, - -0.9335804264972017f, - -0.9335335082441126f, - -0.9334865739951792f, - -0.9334396237512054f, - -0.9333926575129956f, - -0.933345675281355f, - -0.9332986770570885f, - -0.9332516628410013f, - -0.9332046326338985f, - -0.933157586436587f, - -0.9331105242498718f, - -0.9330634460745607f, - -0.9330163519114588f, - -0.9329692417613742f, - -0.9329221156251132f, - -0.9328749735034846f, - -0.9328278153972945f, - -0.9327806413073523f, - -0.9327334512344655f, - -0.9326862451794432f, - -0.9326390231430941f, - -0.9325917851262273f, - -0.932544531129652f, - -0.9324972611541783f, - -0.932449975200616f, - -0.9324026732697753f, - -0.9323553553624667f, - -0.9323080214795006f, - -0.9322606716216888f, - -0.9322133057898422f, - -0.9321659239847725f, - -0.9321185262072912f, - -0.9320711124582111f, - -0.9320236827383442f, - -0.9319762370485034f, - -0.9319287753895011f, - -0.9318812977621516f, - -0.9318338041672676f, - -0.9317862946056632f, - -0.931738769078152f, - -0.931691227585549f, - -0.9316436701286687f, - -0.9315960967083255f, - -0.9315485073253348f, - -0.9315009019805124f, - -0.9314532806746733f, - -0.9314056434086345f, - -0.9313579901832111f, - -0.9313103209992204f, - -0.9312626358574786f, - -0.9312149347588038f, - -0.9311672177040121f, - -0.9311194846939219f, - -0.9310717357293506f, - -0.9310239708111173f, - -0.9309761899400392f, - -0.9309283931169359f, - -0.9308805803426257f, - -0.9308327516179286f, - -0.9307849069436638f, - -0.930737046320651f, - -0.93068916974971f, - -0.930641277231662f, - -0.9305933687673271f, - -0.9305454443575262f, - -0.9304975040030802f, - -0.9304495477048111f, - -0.9304015754635405f, - -0.9303535872800902f, - -0.9303055831552822f, - -0.9302575630899397f, - -0.9302095270848851f, - -0.9301614751409417f, - -0.9301134072589327f, - -0.9300653234396813f, - -0.9300172236840122f, - -0.9299691079927493f, - -0.929920976366717f, - -0.9298728288067396f, - -0.9298246653136428f, - -0.9297764858882512f, - -0.9297282905313915f, - -0.9296800792438881f, - -0.9296318520265678f, - -0.9295836088802567f, - -0.9295353498057822f, - -0.92948707480397f, - -0.9294387838756482f, - -0.9293904770216436f, - -0.9293421542427849f, - -0.9292938155398989f, - -0.9292454609138147f, - -0.9291970903653601f, - -0.9291487038953649f, - -0.9291003015046576f, - -0.9290518831940676f, - -0.9290034489644243f, - -0.9289549988165583f, - -0.9289065327512993f, - -0.9288580507694778f, - -0.9288095528719241f, - -0.9287610390594702f, - -0.9287125093329467f, - -0.9286639636931852f, - -0.9286154021410172f, - -0.9285668246772757f, - -0.9285182313027923f, - -0.9284696220184f, - -0.9284209968249312f, - -0.9283723557232197f, - -0.9283236987140988f, - -0.928275025798402f, - -0.9282263369769632f, - -0.9281776322506172f, - -0.9281289116201983f, - -0.9280801750865411f, - -0.9280314226504806f, - -0.9279826543128527f, - -0.9279338700744927f, - -0.9278850699362361f, - -0.9278362538989203f, - -0.9277874219633803f, - -0.9277385741304537f, - -0.927689710400977f, - -0.9276408307757884f, - -0.9275919352557241f, - -0.927543023841623f, - -0.9274940965343224f, - -0.9274451533346614f, - -0.9273961942434782f, - -0.9273472192616117f, - -0.9272982283899008f, - -0.9272492216291858f, - -0.9272001989803057f, - -0.9271511604441007f, - -0.9271021060214109f, - -0.9270530357130771f, - -0.92700394951994f, - -0.9269548474428407f, - -0.9269057294826203f, - -0.9268565956401209f, - -0.9268074459161838f, - -0.9267582803116521f, - -0.9267090988273671f, - -0.9266599014641722f, - -0.92661068822291f, - -0.9265614591044248f, - -0.9265122141095585f, - -0.9264629532391561f, - -0.9264136764940609f, - -0.9263643838751183f, - -0.9263150753831717f, - -0.9262657510190667f, - -0.9262164107836485f, - -0.9261670546777618f, - -0.9261176827022533f, - -0.9260682948579685f, - -0.9260188911457535f, - -0.9259694715664548f, - -0.9259200361209197f, - -0.9258705848099948f, - -0.9258211176345277f, - -0.9257716345953655f, - -0.9257221356933568f, - -0.9256726209293493f, - -0.9256230903041917f, - -0.925573543818732f, - -0.9255239814738201f, - -0.9254744032703048f, - -0.9254248092090357f, - -0.9253751992908621f, - -0.9253255735166348f, - -0.9252759318872038f, - -0.9252262744034196f, - -0.9251766010661329f, - -0.9251269118761954f, - -0.9250772068344579f, - -0.925027485941773f, - -0.9249777491989913f, - -0.9249279966069662f, - -0.9248782281665495f, - -0.9248284438785948f, - -0.9247786437439539f, - -0.9247288277634811f, - -0.9246789959380294f, - -0.9246291482684534f, - -0.9245792847556062f, - -0.9245294054003431f, - -0.924479510203518f, - -0.9244295991659868f, - -0.924379672288604f, - -0.9243297295722251f, - -0.9242797710177059f, - -0.9242297966259028f, - -0.9241798063976718f, - -0.9241298003338695f, - -0.9240797784353524f, - -0.9240297407029783f, - -0.9239796871376041f, - -0.9239296177400877f, - -0.9238795325112866f, - -0.9238294314520596f, - -0.923779314563265f, - -0.9237291818457612f, - -0.9236790333004076f, - -0.923628868928063f, - -0.9235786887295874f, - -0.9235284927058406f, - -0.9234782808576826f, - -0.9234280531859733f, - -0.9233778096915742f, - -0.9233275503753458f, - -0.9232772752381493f, - -0.9232269842808457f, - -0.9231766775042975f, - -0.923126354909366f, - -0.9230760164969145f, - -0.9230256622678042f, - -0.9229752922228989f, - -0.9229249063630609f, - -0.9228745046891547f, - -0.9228240872020425f, - -0.9227736539025891f, - -0.9227232047916583f, - -0.9226727398701151f, - -0.9226222591388233f, - -0.9225717625986486f, - -0.9225212502504557f, - -0.9224707220951107f, - -0.9224201781334791f, - -0.922369618366427f, - -0.9223190427948202f, - -0.9222684514195263f, - -0.9222178442414116f, - -0.9221672212613432f, - -0.9221165824801884f, - -0.9220659278988153f, - -0.9220152575180917f, - -0.9219645713388857f, - -0.9219138693620654f, - -0.9218631515885005f, - -0.9218124180190596f, - -0.9217616686546118f, - -0.9217109034960267f, - -0.9216601225441744f, - -0.921609325799925f, - -0.9215585132641488f, - -0.9215076849377161f, - -0.9214568408214985f, - -0.9214059809163668f, - -0.9213551052231923f, - -0.9213042137428478f, - -0.9212533064762036f, - -0.9212023834241333f, - -0.9211514445875086f, - -0.9211004899672035f, - -0.9210495195640898f, - -0.9209985333790416f, - -0.9209475314129321f, - -0.920896513666636f, - -0.9208454801410263f, - -0.9207944308369785f, - -0.9207433657553665f, - -0.920692284897066f, - -0.9206411882629519f, - -0.9205900758538998f, - -0.9205389476707851f, - -0.9204878037144847f, - -0.9204366439858743f, - -0.9203854684858308f, - -0.9203342772152305f, - -0.9202830701749514f, - -0.9202318473658705f, - -0.9201806087888654f, - -0.920129354444814f, - -0.9200780843345949f, - -0.9200267984590862f, - -0.9199754968191675f, - -0.9199241794157165f, - -0.9198728462496135f, - -0.9198214973217375f, - -0.9197701326329693f, - -0.9197187521841876f, - -0.919667355976274f, - -0.9196159440101088f, - -0.9195645162865724f, - -0.9195130728065468f, - -0.919461613570913f, - -0.9194101385805531f, - -0.9193586478363484f, - -0.9193071413391819f, - -0.919255619089936f, - -0.9192040810894934f, - -0.9191525273387369f, - -0.9191009578385504f, - -0.9190493725898173f, - -0.9189977715934216f, - -0.9189461548502469f, - -0.9188945223611785f, - -0.9188428741271008f, - -0.9187912101488985f, - -0.9187395304274568f, - -0.9186878349636618f, - -0.9186361237583989f, - -0.9185843968125542f, - -0.9185326541270138f, - -0.9184808957026648f, - -0.9184291215403937f, - -0.9183773316410878f, - -0.9183255260056341f, - -0.918273704634921f, - -0.9182218675298356f, - -0.9181700146912672f, - -0.9181181461201031f, - -0.9180662618172329f, - -0.918014361783545f, - -0.9179624460199298f, - -0.9179105145272752f, - -0.9178585673064724f, - -0.9178066043584107f, - -0.9177546256839815f, - -0.9177026312840739f, - -0.9176506211595801f, - -0.9175985953113903f, - -0.9175465537403971f, - -0.9174944964474914f, - -0.9174424234335653f, - -0.9173903346995109f, - -0.9173382302462213f, - -0.9172861100745889f, - -0.917233974185507f, - -0.9171818225798686f, - -0.9171296552585672f, - -0.9170774722224971f, - -0.9170252734725525f, - -0.9169730590096273f, - -0.9169208288346163f, - -0.916868582948415f, - -0.9168163213519182f, - -0.9167640440460214f, - -0.9167117510316201f, - -0.9166594423096108f, - -0.9166071178808897f, - -0.9165547777463533f, - -0.916502421906898f, - -0.9164500503634216f, - -0.9163976631168209f, - -0.9163452601679946f, - -0.916292841517839f, - -0.9162404071672535f, - -0.9161879571171357f, - -0.9161354913683857f, - -0.9160830099219007f, - -0.9160305127785812f, - -0.9159779999393259f, - -0.9159254714050359f, - -0.9158729271766096f, - -0.9158203672549485f, - -0.9157677916409525f, - -0.9157152003355231f, - -0.9156625933395611f, - -0.915609970653968f, - -0.9155573322796451f, - -0.9155046782174949f, - -0.9154520084684195f, - -0.9153993230333212f, - -0.9153466219131023f, - -0.9152939051086669f, - -0.9152411726209176f, - -0.9151884244507582f, - -0.9151356605990919f, - -0.9150828810668237f, - -0.9150300858548576f, - -0.9149772749640981f, - -0.9149244483954498f, - -0.9148716061498187f, - -0.9148187482281097f, - -0.9147658746312287f, - -0.9147129853600815f, - -0.9146600804155741f, - -0.9146071597986137f, - -0.9145542235101067f, - -0.9145012715509602f, - -0.914448303922081f, - -0.9143953206243776f, - -0.9143423216587571f, - -0.9142893070261285f, - -0.914236276727399f, - -0.9141832307634783f, - -0.9141301691352745f, - -0.9140770918436979f, - -0.9140239988896566f, - -0.9139708902740614f, - -0.9139177659978215f, - -0.913864626061848f, - -0.913811470467051f, - -0.9137582992143413f, - -0.9137051123046297f, - -0.9136519097388281f, - -0.913598691517848f, - -0.9135454576426011f, - -0.9134922081139992f, - -0.9134389429329555f, - -0.9133856621003823f, - -0.9133323656171924f, - -0.9132790534842989f, - -0.913225725702616f, - -0.9131723822730565f, - -0.9131190231965358f, - -0.9130656484739665f, - -0.9130122581062644f, - -0.9129588520943439f, - -0.9129054304391201f, - -0.912851993141508f, - -0.912798540202424f, - -0.9127450716227836f, - -0.9126915874035031f, - -0.9126380875454984f, - -0.9125845720496869f, - -0.9125310409169853f, - -0.9124774941483106f, - -0.9124239317445809f, - -0.9123703537067136f, - -0.9123167600356268f, - -0.9122631507322384f, - -0.9122095257974681f, - -0.9121558852322332f, - -0.9121022290374542f, - -0.9120485572140494f, - -0.9119948697629398f, - -0.9119411666850437f, - -0.9118874479812824f, - -0.9118337136525757f, - -0.911779963699845f, - -0.9117261981240111f, - -0.911672416925995f, - -0.911618620106718f, - -0.9115648076671026f, - -0.9115109796080704f, - -0.9114571359305439f, - -0.9114032766354452f, - -0.911349401723698f, - -0.9112955111962247f, - -0.9112416050539496f, - -0.9111876832977951f, - -0.9111337459286862f, - -0.9110797929475464f, - -0.9110258243553011f, - -0.9109718401528738f, - -0.9109178403411905f, - -0.9108638249211757f, - -0.910809793893756f, - -0.9107557472598559f, - -0.9107016850204025f, - -0.9106476071763213f, - -0.9105935137285398f, - -0.9105394046779844f, - -0.9104852800255824f, - -0.9104311397722611f, - -0.9103769839189477f, - -0.9103228124665711f, - -0.910268625416059f, - -0.9102144227683399f, - -0.9101602045243422f, - -0.9101059706849958f, - -0.9100517212512292f, - -0.9099974562239724f, - -0.9099431756041547f, - -0.9098888793927068f, - -0.9098345675905588f, - -0.9097802401986412f, - -0.9097258972178848f, - -0.9096715386492211f, - -0.9096171644935814f, - -0.9095627747518974f, - -0.9095083694251006f, - -0.9094539485141239f, - -0.9093995120198995f, - -0.9093450599433602f, - -0.9092905922854385f, - -0.9092361090470686f, - -0.9091816102291833f, - -0.9091270958327174f, - -0.9090725658586036f, - -0.9090180203077773f, - -0.9089634591811725f, - -0.9089088824797251f, - -0.9088542902043688f, - -0.9087996823560403f, - -0.9087450589356743f, - -0.9086904199442079f, - -0.9086357653825758f, - -0.9085810952517159f, - -0.908526409552564f, - -0.9084717082860578f, - -0.9084169914531344f, - -0.9083622590547312f, - -0.9083075110917859f, - -0.908252747565237f, - -0.9081979684760226f, - -0.9081431738250815f, - -0.908088363613352f, - -0.9080335378417741f, - -0.9079786965112869f, - -0.90792383962283f, - -0.907868967177343f, - -0.907814079175767f, - -0.9077591756190418f, - -0.9077042565081086f, - -0.9076493218439081f, - -0.9075943716273813f, - -0.9075394058594705f, - -0.9074844245411171f, - -0.9074294276732634f, - -0.9073744152568511f, - -0.9073193872928238f, - -0.9072643437821235f, - -0.9072092847256945f, - -0.9071542101244788f, - -0.9070991199794212f, - -0.9070440142914649f, - -0.9069888930615551f, - -0.9069337562906349f, - -0.9068786039796503f, - -0.9068234361295453f, - -0.9067682527412665f, - -0.906713053815758f, - -0.9066578393539665f, - -0.9066026093568376f, - -0.9065473638253183f, - -0.9064921027603547f, - -0.906436826162894f, - -0.9063815340338828f, - -0.9063262263742692f, - -0.9062709031850005f, - -0.9062155644670248f, - -0.9061602102212898f, - -0.9061048404487447f, - -0.9060494551503381f, - -0.9059940543270188f, - -0.9059386379797358f, - -0.9058832061094394f, - -0.9058277587170789f, - -0.9057722958036045f, - -0.9057168173699662f, - -0.9056613234171152f, - -0.9056058139460023f, - -0.9055502889575782f, - -0.9054947484527943f, - -0.9054391924326028f, - -0.9053836208979554f, - -0.9053280338498039f, - -0.9052724312891015f, - -0.9052168132168006f, - -0.9051611796338541f, - -0.9051055305412149f, - -0.9050498659398378f, - -0.9049941858306749f, - -0.9049384902146816f, - -0.9048827790928113f, - -0.9048270524660199f, - -0.9047713103352606f, - -0.9047155527014897f, - -0.9046597795656619f, - -0.9046039909287334f, - -0.90454818679166f, - -0.9044923671553979f, - -0.9044365320209029f, - -0.9043806813891327f, - -0.9043248152610439f, - -0.9042689336375938f, - -0.9042130365197393f, - -0.904157123908439f, - -0.9041011958046508f, - -0.9040452522093329f, - -0.9039892931234433f, - -0.9039333185479419f, - -0.9038773284837868f, - -0.9038213229319387f, - -0.9037653018933556f, - -0.9037092653689986f, - -0.9036532133598272f, - -0.9035971458668028f, - -0.9035410628908846f, - -0.9034849644330349f, - -0.9034288504942141f, - -0.9033727210753846f, - -0.9033165761775068f, - -0.903260415801544f, - -0.903204239948458f, - -0.903148048619211f, - -0.9030918418147665f, - -0.9030356195360874f, - -0.9029793817841367f, - -0.902923128559878f, - -0.9028668598642758f, - -0.9028105756982938f, - -0.9027542760628966f, - -0.9026979609590483f, - -0.9026416303877148f, - -0.9025852843498607f, - -0.9025289228464517f, - -0.902472545878453f, - -0.9024161534468315f, - -0.9023597455525529f, - -0.9023033221965838f, - -0.9022468833798908f, - -0.9021904291034415f, - -0.9021339593682031f, - -0.9020774741751428f, - -0.9020209735252284f, - -0.9019644574194287f, - -0.9019079258587113f, - -0.901851378844046f, - -0.9017948163764002f, - -0.9017382384567443f, - -0.9016816450860469f, - -0.9016250362652788f, - -0.9015684119954086f, - -0.9015117722774076f, - -0.9014551171122456f, - -0.9013984465008943f, - -0.9013417604443236f, - -0.9012850589435055f, - -0.9012283419994112f, - -0.901171609613013f, - -0.9011148617852828f, - -0.9010580985171929f, - -0.9010013198097155f, - -0.9009445256638243f, - -0.900887716080492f, - -0.9008308910606921f, - -0.900774050605398f, - -0.9007171947155841f, - -0.9006603233922245f, - -0.9006034366362935f, - -0.900546534448766f, - -0.9004896168306166f, - -0.9004326837828212f, - -0.900375735306355f, - -0.9003187714021939f, - -0.9002617920713133f, - -0.9002047973146907f, - -0.900147787133302f, - -0.9000907615281242f, - -0.900033720500134f, - -0.8999766640503095f, - -0.899919592179628f, - -0.8998625048890674f, - -0.8998054021796056f, - -0.8997482840522216f, - -0.8996911505078935f, - -0.8996340015476013f, - -0.8995768371723228f, - -0.8995196573830386f, - -0.8994624621807278f, - -0.8994052515663714f, - -0.8993480255409482f, - -0.8992907841054399f, - -0.8992335272608267f, - -0.8991762550080903f, - -0.8991189673482117f, - -0.8990616642821725f, - -0.8990043458109541f, - -0.8989470119355396f, - -0.898889662656911f, - -0.8988322979760507f, - -0.8987749178939415f, - -0.8987175224115672f, - -0.898660111529911f, - -0.8986026852499566f, - -0.8985452435726875f, - -0.8984877864990889f, - -0.8984303140301447f, - -0.8983728261668399f, - -0.8983153229101589f, - -0.898257804261088f, - -0.8982002702206123f, - -0.8981427207897177f, - -0.8980851559693898f, - -0.8980275757606156f, - -0.8979699801643817f, - -0.8979123691816747f, - -0.8978547428134819f, - -0.8977971010607902f, - -0.8977394439245882f, - -0.8976817714058628f, - -0.8976240835056037f, - -0.8975663802247976f, - -0.8975086615644344f, - -0.8974509275255025f, - -0.8973931781089921f, - -0.8973354133158913f, - -0.897277633147191f, - -0.8972198376038805f, - -0.8971620266869511f, - -0.8971042003973921f, - -0.8970463587361954f, - -0.8969885017043512f, - -0.8969306293028518f, - -0.8968727415326884f, - -0.8968148383948529f, - -0.896756919890337f, - -0.896698986020134f, - -0.896641036785236f, - -0.8965830721866361f, - -0.8965250922253272f, - -0.8964670969023033f, - -0.896409086218558f, - -0.8963510601750851f, - -0.8962930187728786f, - -0.8962349620129337f, - -0.8961768898962446f, - -0.8961188024238073f, - -0.8960606995966156f, - -0.8960025814156664f, - -0.8959444478819549f, - -0.8958862989964774f, - -0.8958281347602298f, - -0.8957699551742095f, - -0.895711760239413f, - -0.8956535499568372f, - -0.8955953243274801f, - -0.8955370833523391f, - -0.8954788270324121f, - -0.8954205553686969f, - -0.8953622683621928f, - -0.8953039660138982f, - -0.8952456483248119f, - -0.8951873152959329f, - -0.8951289669282615f, - -0.8950706032227972f, - -0.8950122241805398f, - -0.8949538298024894f, - -0.8948954200896473f, - -0.8948369950430138f, - -0.8947785546635904f, - -0.8947200989523776f, - -0.8946616279103781f, - -0.8946031415385933f, - -0.8945446398380253f, - -0.8944861228096763f, - -0.8944275904545496f, - -0.8943690427736477f, - -0.894310479767974f, - -0.8942519014385313f, - -0.8941933077863243f, - -0.8941346988123562f, - -0.8940760745176323f, - -0.8940174349031557f, - -0.8939587799699322f, - -0.8939001097189662f, - -0.8938414241512641f, - -0.8937827232678298f, - -0.8937240070696705f, - -0.8936652755577914f, - -0.8936065287332f, - -0.8935477665969013f, - -0.8934889891499035f, - -0.8934301963932129f, - -0.8933713883278375f, - -0.8933125649547848f, - -0.8932537262750626f, - -0.8931948722896788f, - -0.8931360029996425f, - -0.893077118405962f, - -0.8930182185096466f, - -0.892959303311705f, - -0.8929003728131468f, - -0.8928414270149823f, - -0.8927824659182211f, - -0.8927234895238736f, - -0.8926644978329498f, - -0.8926054908464615f, - -0.8925464685654191f, - -0.8924874309908343f, - -0.8924283781237179f, - -0.8923693099650828f, - -0.8923102265159407f, - -0.892251127777304f, - -0.8921920137501848f, - -0.8921328844355968f, - -0.8920737398345525f, - -0.8920145799480665f, - -0.8919554047771509f, - -0.8918962143228207f, - -0.8918370085860895f, - -0.8917777875679729f, - -0.891718551269484f, - -0.891659299691639f, - -0.8916000328354525f, - -0.891540750701941f, - -0.8914814532921189f, - -0.8914221406070033f, - -0.8913628126476097f, - -0.8913034694149556f, - -0.8912441109100573f, - -0.891184737133932f, - -0.8911253480875965f, - -0.8910659437720694f, - -0.891006524188368f, - -0.8909470893375105f, - -0.890887639220515f, - -0.8908281738384008f, - -0.8907686931921867f, - -0.8907091972828914f, - -0.8906496861115345f, - -0.8905901596791361f, - -0.8905306179867161f, - -0.8904710610352944f, - -0.8904114888258912f, - -0.8903519013595281f, - -0.8902922986372258f, - -0.8902326806600055f, - -0.8901730474288886f, - -0.8901133989448967f, - -0.8900537352090526f, - -0.8899940562223778f, - -0.889934361985896f, - -0.8898746525006287f, - -0.8898149277676f, - -0.8897551877878324f, - -0.8896954325623508f, - -0.8896356620921777f, - -0.8895758763783381f, - -0.889516075421856f, - -0.8894562592237568f, - -0.8893964277850643f, - -0.8893365811068046f, - -0.8892767191900025f, - -0.8892168420356844f, - -0.889156949644876f, - -0.8890970420186034f, - -0.8890371191578929f, - -0.8889771810637719f, - -0.888917227737267f, - -0.8888572591794056f, - -0.8887972753912149f, - -0.8887372763737232f, - -0.8886772621279585f, - -0.8886172326549491f, - -0.8885571879557229f, - -0.8884971280313099f, - -0.8884370528827381f, - -0.8883769625110383f, - -0.8883168569172384f, - -0.8882567361023697f, - -0.8881966000674616f, - -0.8881364488135448f, - -0.8880762823416495f, - -0.8880161006528074f, - -0.8879559037480493f, - -0.8878956916284068f, - -0.887835464294911f, - -0.8877752217485948f, - -0.88771496399049f, - -0.8876546910216288f, - -0.8875944028430445f, - -0.88753409945577f, - -0.8874737808608385f, - -0.8874134470592832f, - -0.8873530980521389f, - -0.8872927338404383f, - -0.8872323544252168f, - -0.8871719598075081f, - -0.8871115499883484f, - -0.8870511249687711f, - -0.8869906847498129f, - -0.8869302293325085f, - -0.8868697587178948f, - -0.8868092729070072f, - -0.8867487719008823f, - -0.8866882557005564f, - -0.8866277243070673f, - -0.8865671777214515f, - -0.8865066159447467f, - -0.8864460389779901f, - -0.8863854468222205f, - -0.8863248394784754f, - -0.8862642169477944f, - -0.8862035792312147f, - -0.8861429263297764f, - -0.8860822582445181f, - -0.8860215749764806f, - -0.8859608765267019f, - -0.8859001628962233f, - -0.8858394340860843f, - -0.8857786900973269f, - -0.88571793093099f, - -0.8856571565881161f, - -0.8855963670697456f, - -0.8855355623769211f, - -0.8854747425106839f, - -0.8854139074720763f, - -0.8853530572621405f, - -0.885292191881919f, - -0.8852313113324553f, - -0.8851704156147921f, - -0.8851095047299732f, - -0.8850485786790415f, - -0.8849876374630419f, - -0.8849266810830183f, - -0.8848657095400151f, - -0.8848047228350765f, - -0.8847437209692485f, - -0.884682703943576f, - -0.8846216717591041f, - -0.8845606244168787f, - -0.8844995619179462f, - -0.8844384842633527f, - -0.8843773914541447f, - -0.8843162834913687f, - -0.8842551603760724f, - -0.8841940221093029f, - -0.8841328686921077f, - -0.8840717001255342f, - -0.8840105164106313f, - -0.8839493175484467f, - -0.8838881035400302f, - -0.883826874386429f, - -0.8837656300886936f, - -0.8837043706478723f, - -0.8836430960650162f, - -0.8835818063411737f, - -0.8835205014773959f, - -0.8834591814747327f, - -0.8833978463342355f, - -0.8833364960569547f, - -0.8832751306439419f, - -0.8832137500962478f, - -0.8831523544149252f, - -0.8830909436010256f, - -0.8830295176556012f, - -0.8829680765797042f, - -0.8829066203743883f, - -0.8828451490407058f, - -0.8827836625797102f, - -0.8827221609924547f, - -0.8826606442799938f, - -0.8825991124433812f, - -0.8825375654836713f, - -0.8824760034019187f, - -0.8824144261991776f, - -0.8823528338765043f, - -0.8822912264349535f, - -0.8822296038755809f, - -0.8821679661994419f, - -0.8821063134075937f, - -0.882044645501092f, - -0.8819829624809936f, - -0.881921264348355f, - -0.8818595511042343f, - -0.881797822749688f, - -0.881736079285775f, - -0.8816743207135517f, - -0.8816125470340775f, - -0.8815507582484101f, - -0.8814889543576094f, - -0.8814271353627329f, - -0.8813653012648408f, - -0.881303452064992f, - -0.8812415877642477f, - -0.8811797083636658f, - -0.8811178138643081f, - -0.8810559042672343f, - -0.8809939795735061f, - -0.880932039784184f, - -0.8808700849003295f, - -0.8808081149230035f, - -0.8807461298532689f, - -0.8806841296921873f, - -0.8806221144408211f, - -0.8805600841002325f, - -0.880498038671485f, - -0.8804359781556416f, - -0.8803739025537656f, - -0.8803118118669201f, - -0.88024970609617f, - -0.880187585242579f, - -0.8801254493072116f, - -0.8800632982911318f, - -0.8800011321954058f, - -0.879938951021098f, - -0.879876754769274f, - -0.8798145434409991f, - -0.8797523170373401f, - -0.8796900755593628f, - -0.8796278190081334f, - -0.8795655473847197f, - -0.8795032606901872f, - -0.8794409589256044f, - -0.8793786420920379f, - -0.8793163101905567f, - -0.8792539632222273f, - -0.8791916011881191f, - -0.8791292240893f, - -0.8790668319268401f, - -0.8790044247018065f, - -0.8789420024152701f, - -0.8788795650682995f, - -0.8788171126619654f, - -0.8787546451973375f, - -0.8786921626754861f, - -0.8786296650974815f, - -0.8785671524643954f, - -0.8785046247772985f, - -0.8784420820372623f, - -0.8783795242453578f, - -0.8783169514026579f, - -0.8782543635102342f, - -0.8781917605691595f, - -0.8781291425805057f, - -0.8780665095453466f, - -0.8780038614647547f, - -0.8779411983398048f, - -0.8778785201715686f, - -0.8778158269611218f, - -0.8777531187095374f, - -0.8776903954178913f, - -0.8776276570872565f, - -0.8775649037187094f, - -0.8775021353133248f, - -0.877439351872178f, - -0.8773765533963447f, - -0.8773137398869015f, - -0.8772509113449245f, - -0.8771880677714896f, - -0.8771252091676747f, - -0.8770623355345561f, - -0.8769994468732115f, - -0.8769365431847178f, - -0.8768736244701538f, - -0.8768106907305971f, - -0.8767477419671262f, - -0.8766847781808191f, - -0.8766217993727556f, - -0.8765588055440144f, - -0.876495796695675f, - -0.8764327728288164f, - -0.8763697339445193f, - -0.8763066800438638f, - -0.8762436111279299f, - -0.8761805271977982f, - -0.8761174282545502f, - -0.8760543142992667f, - -0.8759911853330293f, - -0.8759280413569192f, - -0.8758648823720191f, - -0.8758017083794104f, - -0.875738519380177f, - -0.8756753153753998f, - -0.875612096366163f, - -0.875548862353549f, - -0.8754856133386427f, - -0.8754223493225262f, - -0.8753590703062846f, - -0.8752957762910013f, - -0.8752324672777623f, - -0.8751691432676506f, - -0.8751058042617524f, - -0.8750424502611522f, - -0.8749790812669366f, - -0.8749156972801907f, - -0.8748522983020008f, - -0.8747888843334526f, - -0.8747254553756337f, - -0.8746620114296304f, - -0.8745985524965298f, - -0.874535078577419f, - -0.8744715896733861f, - -0.874408085785519f, - -0.8743445669149054f, - -0.8742810330626339f, - -0.8742174842297927f, - -0.8741539204174715f, - -0.874090341626759f, - -0.8740267478587448f, - -0.8739631391145178f, - -0.873899515395169f, - -0.8738358767017881f, - -0.8737722230354655f, - -0.8737085543972916f, - -0.8736448707883581f, - -0.8735811722097556f, - -0.8735174586625758f, - -0.87345373014791f, - -0.8733899866668507f, - -0.8733262282204897f, - -0.8732624548099205f, - -0.8731986664362342f, - -0.8731348631005252f, - -0.8730710448038856f, - -0.8730072115474106f, - -0.8729433633321918f, - -0.8728795001593248f, - -0.872815622029903f, - -0.8727517289450217f, - -0.8726878209057755f, - -0.872623897913259f, - -0.8725599599685674f, - -0.8724960070727971f, - -0.8724320392270434f, - -0.8723680564324025f, - -0.8723040586899701f, - -0.8722400460008437f, - -0.8721760183661198f, - -0.8721119757868955f, - -0.8720479182642676f, - -0.8719838457993347f, - -0.8719197583931942f, - -0.8718556560469441f, - -0.8717915387616826f, - -0.8717274065385089f, - -0.8716632593785216f, - -0.8715990972828199f, - -0.8715349202525028f, - -0.8714707282886706f, - -0.8714065213924229f, - -0.87134229956486f, - -0.8712780628070821f, - -0.8712138111201895f, - -0.8711495445052841f, - -0.8710852629634662f, - -0.8710209664958385f, - -0.870956655103501f, - -0.8708923287875568f, - -0.8708279875491076f, - -0.8707636313892569f, - -0.8706992603091058f, - -0.8706348743097585f, - -0.8705704733923174f, - -0.8705060575578872f, - -0.8704416268075702f, - -0.8703771811424714f, - -0.8703127205636944f, - -0.8702482450723443f, - -0.8701837546695258f, - -0.8701192493563437f, - -0.8700547291339029f, - -0.8699901940033098f, - -0.8699256439656698f, - -0.8698610790220889f, - -0.869796499173673f, - -0.8697319044215295f, - -0.8696672947667643f, - -0.8696026702104859f, - -0.8695380307537997f, - -0.8694733763978147f, - -0.8694087071436379f, - -0.8693440229923787f, - -0.8692793239451436f, - -0.8692146100030427f, - -0.8691498811671842f, - -0.8690851374386772f, - -0.8690203788186308f, - -0.8689556053081554f, - -0.8688908169083606f, - -0.8688260136203557f, - -0.8687611954452524f, - -0.8686963623841607f, - -0.8686315144381915f, - -0.8685666516084555f, - -0.8685017738960651f, - -0.8684368813021314f, - -0.8683719738277663f, - -0.8683070514740816f, - -0.8682421142421911f, - -0.8681771621332056f, - -0.8681121951482395f, - -0.868047213288405f, - -0.8679822165548163f, - -0.867917204948587f, - -0.8678521784708308f, - -0.8677871371226615f, - -0.8677220809051945f, - -0.8676570098195442f, - -0.8675919238668254f, - -0.8675268230481529f, - -0.867461707364643f, - -0.8673965768174112f, - -0.8673314314075734f, - -0.8672662711362453f, - -0.8672010960045445f, - -0.8671359060135868f, - -0.8670707011644904f, - -0.867005481458371f, - -0.8669402468963472f, - -0.8668749974795361f, - -0.8668097332090571f, - -0.8667444540860265f, - -0.8666791601115643f, - -0.8666138512867884f, - -0.8665485276128188f, - -0.8664831890907742f, - -0.8664178357217742f, - -0.8663524675069383f, - -0.8662870844473873f, - -0.8662216865442413f, - -0.8661562737986206f, - -0.8660908462116461f, - -0.8660254037844386f, - -0.8659599465181201f, - -0.8658944744138121f, - -0.8658289874726359f, - -0.8657634856957137f, - -0.8656979690841684f, - -0.8656324376391223f, - -0.8655668913616983f, - -0.865501330253019f, - -0.8654357543142086f, - -0.8653701635463904f, - -0.8653045579506883f, - -0.8652389375282258f, - -0.8651733022801283f, - -0.8651076522075202f, - -0.865041987311526f, - -0.8649763075932707f, - -0.8649106130538805f, - -0.8648449036944801f, - -0.8647791795161969f, - -0.8647134405201551f, - -0.8646476867074826f, - -0.8645819180793052f, - -0.864516134636751f, - -0.8644503363809456f, - -0.8643845233130175f, - -0.8643186954340938f, - -0.8642528527453037f, - -0.8641869952477734f, - -0.864121122942633f, - -0.8640552358310102f, - -0.8639893339140347f, - -0.8639234171928354f, - -0.8638574856685418f, - -0.863791539342283f, - -0.8637255782151901f, - -0.8636596022883928f, - -0.8635936115630214f, - -0.8635276060402064f, - -0.8634615857210796f, - -0.8633955506067718f, - -0.8633295006984145f, - -0.863263435997139f, - -0.8631973565040781f, - -0.8631312622203638f, - -0.8630651531471286f, - -0.862999029285505f, - -0.8629328906366258f, - -0.8628667372016251f, - -0.862800568981636f, - -0.8627343859777922f, - -0.8626681881912274f, - -0.8626019756230766f, - -0.8625357482744735f, - -0.8624695061465544f, - -0.8624032492404524f, - -0.8623369775573041f, - -0.8622706910982443f, - -0.8622043898644101f, - -0.8621380738569355f, - -0.8620717430769586f, - -0.8620053975256147f, - -0.8619390372040421f, - -0.8618726621133761f, - -0.8618062722547553f, - -0.8617398676293164f, - -0.8616734482381981f, - -0.8616070140825381f, - -0.8615405651634747f, - -0.861474101482146f, - -0.8614076230396918f, - -0.8613411298372506f, - -0.8612746218759619f, - -0.8612080991569648f, - -0.8611415616814f, - -0.8610750094504073f, - -0.8610084424651268f, - -0.8609418607266989f, - -0.8608752642362651f, - -0.8608086529949663f, - -0.8607420270039439f, - -0.8606753862643389f, - -0.860608730777294f, - -0.8605420605439512f, - -0.8604753755654526f, - -0.8604086758429405f, - -0.8603419613775585f, - -0.8602752321704495f, - -0.8602084882227569f, - -0.8601417295356236f, - -0.8600749561101948f, - -0.8600081679476139f, - -0.859941365049025f, - -0.8598745474155735f, - -0.8598077150484039f, - -0.8597408679486614f, - -0.859674006117491f, - -0.8596071295560397f, - -0.8595402382654515f, - -0.8594733322468739f, - -0.8594064115014526f, - -0.859339476030335f, - -0.8592725258346677f, - -0.8592055609155979f, - -0.8591385812742723f, - -0.8590715869118398f, - -0.8590045778294477f, - -0.8589375540282442f, - -0.8588705155093773f, - -0.8588034622739967f, - -0.8587363943232508f, - -0.8586693116582886f, - -0.8586022142802594f, - -0.8585351021903137f, - -0.8584679753896005f, - -0.8584008338792714f, - -0.858333677660475f, - -0.8582665067343632f, - -0.8581993211020864f, - -0.858132120764797f, - -0.8580649057236446f, - -0.8579976759797823f, - -0.8579304315343611f, - -0.8578631723885347f, - -0.8577958985434537f, - -0.8577286100002722f, - -0.8576613067601422f, - -0.8575939888242179f, - -0.8575266561936523f, - -0.8574593088695991f, - -0.8573919468532123f, - -0.8573245701456457f, - -0.8572571787480545f, - -0.8571897726615934f, - -0.8571223518874169f, - -0.8570549164266801f, - -0.8569874662805393f, - -0.8569200014501498f, - -0.8568525219366676f, - -0.8567850277412484f, - -0.8567175188650498f, - -0.8566499953092278f, - -0.8565824570749396f, - -0.8565149041633421f, - -0.8564473365755935f, - -0.8563797543128511f, - -0.856312157376273f, - -0.856244545767017f, - -0.8561769194862424f, - -0.8561092785351078f, - -0.8560416229147718f, - -0.8559739526263934f, - -0.8559062676711331f, - -0.8558385680501497f, - -0.8557708537646046f, - -0.8557031248156561f, - -0.8556353812044662f, - -0.8555676229321948f, - -0.8554998500000043f, - -0.8554320624090539f, - -0.8553642601605068f, - -0.8552964432555237f, - -0.8552286116952675f, - -0.8551607654809003f, - -0.8550929046135842f, - -0.8550250290944817f, - -0.854957138924757f, - -0.8548892341055726f, - -0.8548213146380921f, - -0.8547533805234788f, - -0.8546854317628979f, - -0.8546174683575128f, - -0.8545494903084885f, - -0.8544814976169889f, - -0.8544134902841802f, - -0.8543454683112273f, - -0.8542774316992954f, - -0.8542093804495506f, - -0.8541413145631583f, - -0.854073234041286f, - -0.8540051388850994f, - -0.8539370290957655f, - -0.8538689046744509f, - -0.8538007656223237f, - -0.8537326119405511f, - -0.8536644436303007f, - -0.8535962606927403f, - -0.8535280631290391f, - -0.8534598509403646f, - -0.8533916241278872f, - -0.8533233826927737f, - -0.8532551266361953f, - -0.8531868559593202f, - -0.8531185706633198f, - -0.8530502707493621f, - -0.8529819562186192f, - -0.8529136270722603f, - -0.8528452833114577f, - -0.8527769249373807f, - -0.852708551951202f, - -0.8526401643540921f, - -0.8525717621472239f, - -0.8525033453317687f, - -0.8524349139088991f, - -0.8523664678797871f, - -0.8522980072456064f, - -0.8522295320075296f, - -0.85216104216673f, - -0.8520925377243808f, - -0.8520240186816564f, - -0.8519554850397308f, - -0.8518869367997781f, - -0.8518183739629724f, - -0.8517497965304895f, - -0.8516812045035039f, - -0.851612597883191f, - -0.8515439766707258f, - -0.8514753408672852f, - -0.8514066904740445f, - -0.8513380254921802f, - -0.8512693459228684f, - -0.8512006517672869f, - -0.851131943026612f, - -0.8510632197020208f, - -0.8509944817946923f, - -0.8509257293058022f, - -0.8508569622365302f, - -0.8507881805880535f, - -0.850719384361552f, - -0.850650573558203f, - -0.8505817481791864f, - -0.850512908225681f, - -0.8504440536988677f, - -0.8503751845999243f, - -0.8503063009300323f, - -0.8502374026903712f, - -0.8501684898821222f, - -0.8500995625064659f, - -0.8500306205645833f, - -0.8499616640576552f, - -0.849892692986864f, - -0.8498237073533911f, - -0.8497547071584186f, - -0.8496856924031283f, - -0.8496166630887038f, - -0.8495476192163272f, - -0.8494785607871815f, - -0.8494094878024498f, - -0.8493404002633166f, - -0.8492712981709646f, - -0.8492021815265792f, - -0.849133050331343f, - -0.8490639045864418f, - -0.8489947442930594f, - -0.8489255694523825f, - -0.8488563800655944f, - -0.8487871761338819f, - -0.8487179576584305f, - -0.8486487246404262f, - -0.8485794770810549f, - -0.8485102149815038f, - -0.8484409383429595f, - -0.8483716471666084f, - -0.8483023414536389f, - -0.8482330212052379f, - -0.8481636864225932f, - -0.8480943371068925f, - -0.8480249732593249f, - -0.8479555948810784f, - -0.847886201973342f, - -0.8478167945373041f, - -0.8477473725741548f, - -0.8476779360850835f, - -0.8476084850712796f, - -0.8475390195339328f, - -0.8474695394742345f, - -0.8474000448933746f, - -0.8473305357925438f, - -0.8472610121729327f, - -0.8471914740357336f, - -0.8471219213821374f, - -0.8470523542133359f, - -0.8469827725305208f, - -0.846913176334885f, - -0.8468435656276204f, - -0.846773940409921f, - -0.846704300682978f, - -0.846634646447986f, - -0.8465649777061376f, - -0.8464952944586279f, - -0.8464255967066491f, - -0.8463558844513969f, - -0.8462861576940647f, - -0.8462164164358489f, - -0.8461466606779423f, - -0.8460768904215419f, - -0.846007105667842f, - -0.8459373064180394f, - -0.8458674926733296f, - -0.8457976644349088f, - -0.8457278217039731f, - -0.8456579644817201f, - -0.8455880927693463f, - -0.8455182065680491f, - -0.8454483058790258f, - -0.8453783907034736f, - -0.8453084610425916f, - -0.8452385168975776f, - -0.8451685582696299f, - -0.8450985851599467f, - -0.8450285975697281f, - -0.8449585955001729f, - -0.8448885789524804f, - -0.8448185479278497f, - -0.8447485024274821f, - -0.8446784424525771f, - -0.844608368004335f, - -0.8445382790839564f, - -0.844468175692643f, - -0.844398057831595f, - -0.8443279255020155f, - -0.844257778705104f, - -0.8441876174420642f, - -0.844117441714097f, - -0.8440472515224064f, - -0.8439770468681934f, - -0.843906827752662f, - -0.8438365941770147f, - -0.8437663461424564f, - -0.8436960836501887f, - -0.843625806701417f, - -0.8435555152973444f, - -0.8434852094391766f, - -0.8434148891281176f, - -0.8433445543653723f, - -0.8432742051521454f, - -0.8432038414896432f, - -0.8431334633790711f, - -0.8430630708216349f, - -0.8429926638185402f, - -0.8429222423709944f, - -0.8428518064802039f, - -0.8427813561473751f, - -0.8427108913737152f, - -0.8426404121604323f, - -0.8425699185087335f, - -0.8424994104198268f, - -0.8424288878949199f, - -0.842358350935222f, - -0.8422877995419413f, - -0.8422172337162869f, - -0.842146653459467f, - -0.8420760587726923f, - -0.842005449657172f, - -0.8419348261141155f, - -0.8418641881447334f, - -0.8417935357502354f, - -0.841722868931833f, - -0.8416521876907361f, - -0.8415814920281575f, - -0.8415107819453063f, - -0.8414400574433957f, - -0.8413693185236365f, - -0.8412985651872423f, - -0.8412277974354235f, - -0.8411570152693942f, - -0.8410862186903663f, - -0.8410154076995536f, - -0.8409445822981693f, - -0.8408737424874265f, - -0.840802888268539f, - -0.8407320196427216f, - -0.8406611366111881f, - -0.8405902391751532f, - -0.8405193273358312f, - -0.8404484010944381f, - -0.8403774604521886f, - -0.8403065054102984f, - -0.8402355359699828f, - -0.8401645521324588f, - -0.8400935538989416f, - -0.8400225412706493f, - -0.8399515142487968f, - -0.8398804728346024f, - -0.8398094170292831f, - -0.8397383468340563f, - -0.8396672622501393f, - -0.8395961632787511f, - -0.8395250499211094f, - -0.8394539221784328f, - -0.8393827800519397f, - -0.8393116235428497f, - -0.8392404526523819f, - -0.8391692673817552f, - -0.8390980677321903f, - -0.8390268537049066f, - -0.8389556253011246f, - -0.838884382522064f, - -0.8388131253689466f, - -0.838741853842993f, - -0.8386705679454243f, - -0.8385992676774615f, - -0.8385279530403278f, - -0.8384566240352432f, - -0.8383852806634313f, - -0.8383139229261136f, - -0.8382425508245139f, - -0.8381711643598545f, - -0.8380997635333587f, - -0.8380283483462493f, - -0.8379569187997511f, - -0.8378854748950875f, - -0.8378140166334825f, - -0.8377425440161603f, - -0.8376710570443464f, - -0.8375995557192653f, - -0.8375280400421421f, - -0.8374565100142016f, - -0.8373849656366706f, - -0.8373134069107739f, - -0.8372418338377393f, - -0.837170246418791f, - -0.8370986446551573f, - -0.8370270285480638f, - -0.8369553980987394f, - -0.8368837533084094f, - -0.8368120941783027f, - -0.8367404207096465f, - -0.8366687329036697f, - -0.8365970307616002f, - -0.8365253142846666f, - -0.8364535834740973f, - -0.8363818383311222f, - -0.8363100788569704f, - -0.8362383050528712f, - -0.8361665169200546f, - -0.8360947144597501f, - -0.8360228976731892f, - -0.8359510665616017f, - -0.8358792211262185f, - -0.8358073613682702f, - -0.835735487288989f, - -0.8356635988896062f, - -0.8355916961713532f, - -0.8355197791354618f, - -0.8354478477831653f, - -0.8353759021156955f, - -0.8353039421342853f, - -0.8352319678401673f, - -0.8351599792345756f, - -0.8350879763187433f, - -0.8350159590939042f, - -0.8349439275612918f, - -0.8348718817221411f, - -0.8347998215776858f, - -0.8347277471291621f, - -0.834655658377803f, - -0.8345835553248452f, - -0.834511437971523f, - -0.8344393063190739f, - -0.8343671603687317f, - -0.8342950001217341f, - -0.8342228255793166f, - -0.8341506367427173f, - -0.8340784336131712f, - -0.8340062161919171f, - -0.8339339844801912f, - -0.8338617384792323f, - -0.8337894781902777f, - -0.8337172036145657f, - -0.8336449147533342f, - -0.8335726116078228f, - -0.8335002941792699f, - -0.8334279624689146f, - -0.8333556164779958f, - -0.8332832562077542f, - -0.8332108816594291f, - -0.8331384928342608f, - -0.8330660897334888f, - -0.832993672358355f, - -0.8329212407100997f, - -0.8328487947899639f, - -0.832776334599189f, - -0.8327038601390161f, - -0.832631371410688f, - -0.8325588684154464f, - -0.8324863511545334f, - -0.8324138196291913f, - -0.8323412738406636f, - -0.8322687137901926f, - -0.8321961394790232f, - -0.8321235509083966f, - -0.8320509480795584f, - -0.8319783309937513f, - -0.8319056996522214f, - -0.8318330540562111f, - -0.8317603942069666f, - -0.831687720105732f, - -0.831615031753754f, - -0.8315423291522761f, - -0.8314696123025455f, - -0.8313968812058072f, - -0.8313241358633086f, - -0.8312513762762953f, - -0.8311786024460144f, - -0.8311058143737121f, - -0.8310330120606368f, - -0.8309601955080353f, - -0.8308873647171554f, - -0.8308145196892445f, - -0.8307416604255516f, - -0.8306687869273249f, - -0.8305958991958129f, - -0.8305229972322641f, - -0.8304500810379286f, - -0.8303771506140554f, - -0.8303042059618939f, - -0.8302312470826938f, - -0.830158273977706f, - -0.8300852866481805f, - -0.8300122850953678f, - -0.8299392693205183f, - -0.8298662393248842f, - -0.8297931951097164f, - -0.8297201366762662f, - -0.8296470640257853f, - -0.8295739771595264f, - -0.8295008760787416f, - -0.8294277607846829f, - -0.8293546312786045f, - -0.8292814875617577f, - -0.8292083296353971f, - -0.8291351575007753f, - -0.8290619711591476f, - -0.8289887706117659f, - -0.8289155558598862f, - -0.8288423269047618f, - -0.8287690837476486f, - -0.8286958263898011f, - -0.8286225548324744f, - -0.8285492690769236f, - -0.8284759691244055f, - -0.8284026549761754f, - -0.8283293266334896f, - -0.8282559840976041f, - -0.8281826273697765f, - -0.8281092564512634f, - -0.828035871343322f, - -0.8279624720472091f, - -0.8278890585641834f, - -0.8278156308955018f, - -0.827742189042424f, - -0.8276687330062065f, - -0.8275952627881094f, - -0.8275217783893903f, - -0.8274482798113104f, - -0.8273747670551266f, - -0.8273012401221003f, - -0.8272276990134901f, - -0.8271541437305578f, - -0.8270805742745618f, - -0.8270069906467641f, - -0.826933392848425f, - -0.8268597808808051f, - -0.8267861547451668f, - -0.826712514442771f, - -0.8266388599748797f, - -0.8265651913427544f, - -0.8264915085476583f, - -0.8264178115908535f, - -0.8263441004736027f, - -0.8262703751971686f, - -0.8261966357628152f, - -0.8261228821718059f, - -0.826049114425404f, - -0.8259753325248732f, - -0.8259015364714787f, - -0.8258277262664846f, - -0.8257539019111554f, - -0.8256800634067557f, - -0.8256062107545518f, - -0.8255323439558084f, - -0.8254584630117914f, - -0.8253845679237661f, - -0.8253106586929997f, - -0.8252367353207577f, - -0.8251627978083081f, - -0.8250888461569159f, - -0.8250148803678498f, - -0.824940900442376f, - -0.8248669063817639f, - -0.8247928981872791f, - -0.8247188758601913f, - -0.8246448394017679f, - -0.8245707888132789f, - -0.8244967240959913f, - -0.8244226452511756f, - -0.8243485522801f, - -0.8242744451840351f, - -0.8242003239642505f, - -0.8241261886220158f, - -0.8240520391586011f, - -0.8239778755752779f, - -0.8239036978733163f, - -0.8238295060539875f, - -0.8237553001185621f, - -0.8236810800683128f, - -0.8236068459045106f, - -0.8235325976284277f, - -0.8234583352413362f, - -0.823384058744508f, - -0.823309768139217f, - -0.8232354634267355f, - -0.8231611446083368f, - -0.8230868116852936f, - -0.823012464658881f, - -0.822938103530372f, - -0.8228637283010409f, - -0.8227893389721618f, - -0.82271493554501f, - -0.8226405180208601f, - -0.8225660864009872f, - -0.822491640686666f, - -0.8224171808791734f, - -0.8223427069797841f, - -0.8222682189897755f, - -0.8221937169104223f, - -0.8221192007430023f, - -0.8220446704887914f, - -0.8219701261490682f, - -0.8218955677251079f, - -0.8218209952181896f, - -0.8217464086295901f, - -0.8216718079605889f, - -0.8215971932124622f, - -0.8215225643864901f, - -0.8214479214839503f, - -0.8213732645061228f, - -0.8212985934542862f, - -0.8212239083297203f, - -0.8211492091337039f, - -0.8210744958675182f, - -0.8209997685324429f, - -0.8209250271297583f, - -0.8208502716607446f, - -0.8207755021266839f, - -0.8207007185288566f, - -0.8206259208685444f, - -0.820551109147028f, - -0.8204762833655906f, - -0.8204014435255138f, - -0.8203265896280798f, - -0.8202517216745709f, - -0.8201768396662709f, - -0.8201019436044622f, - -0.8200270334904284f, - -0.8199521093254523f, - -0.8198771711108188f, - -0.8198022188478116f, - -0.8197272525377143f, - -0.819652272181813f, - -0.8195772777813904f, - -0.8195022693377331f, - -0.8194272468521253f, - -0.819352210325854f, - -0.819277159760203f, - -0.8192020951564597f, - -0.8191270165159092f, - -0.8190519238398396f, - -0.8189768171295356f, - -0.8189016963862856f, - -0.8188265616113758f, - -0.8187514128060945f, - -0.818676249971729f, - -0.8186010731095672f, - -0.8185258822208965f, - -0.8184506773070066f, - -0.8183754583691853f, - -0.8183002254087217f, - -0.8182249784269043f, - -0.8181497174250235f, - -0.8180744424043683f, - -0.8179991533662285f, - -0.8179238503118937f, - -0.8178485332426553f, - -0.8177732021598025f, - -0.817697857064628f, - -0.8176224979584206f, - -0.817547124842473f, - -0.8174717377180759f, - -0.8173963365865224f, - -0.8173209214491025f, - -0.81724549230711f, - -0.8171700491618367f, - -0.8170945920145748f, - -0.8170191208666184f, - -0.8169436357192601f, - -0.8168681365737932f, - -0.816792623431511f, - -0.8167170962937085f, - -0.816641555161679f, - -0.8165660000367172f, - -0.8164904309201171f, - -0.8164148478131745f, - -0.8163392507171842f, - -0.8162636396334412f, - -0.8161880145632407f, - -0.8161123755078797f, - -0.8160367224686537f, - -0.8159610554468588f, - -0.8158853744437913f, - -0.8158096794607487f, - -0.8157339704990276f, - -0.8156582475599253f, - -0.815582510644739f, - -0.8155067597547669f, - -0.8154309948913071f, - -0.8153552160556573f, - -0.8152794232491157f, - -0.815203616472982f, - -0.815127795728554f, - -0.8150519610171324f, - -0.8149761123400148f, - -0.814900249698502f, - -0.8148243730938931f, - -0.8147484825274899f, - -0.8146725780005903f, - -0.8145966595144969f, - -0.8145207270705092f, - -0.8144447806699299f, - -0.8143688203140583f, - -0.8142928460041975f, - -0.8142168577416482f, - -0.8141408555277136f, - -0.8140648393636954f, - -0.8139888092508961f, - -0.813912765190618f, - -0.8138367071841649f, - -0.8137606352328398f, - -0.813684549337946f, - -0.8136084495007874f, - -0.8135323357226673f, - -0.8134562080048907f, - -0.8133800663487619f, - -0.8133039107555855f, - -0.8132277412266656f, - -0.8131515577633087f, - -0.8130753603668196f, - -0.8129991490385038f, - -0.8129229237796666f, - -0.8128466845916154f, - -0.8127704314756558f, - -0.8126941644330944f, - -0.8126178834652374f, - -0.8125415885733933f, - -0.812465279758868f, - -0.8123889570229705f, - -0.8123126203670068f, - -0.8122362697922864f, - -0.8121599053001163f, - -0.8120835268918067f, - -0.8120071345686642f, - -0.8119307283319994f, - -0.8118543081831203f, - -0.8117778741233381f, - -0.8117014261539603f, - -0.8116249642762984f, - -0.8115484884916614f, - -0.8114719988013609f, - -0.8113954952067068f, - -0.8113189777090103f, - -0.8112424463095815f, - -0.8111659010097333f, - -0.8110893418107765f, - -0.811012768714023f, - -0.8109361817207841f, - -0.8108595808323735f, - -0.8107829660501029f, - -0.8107063373752854f, - -0.8106296948092332f, - -0.8105530383532608f, - -0.8104763680086808f, - -0.8103996837768075f, - -0.8103229856589539f, - -0.8102462736564354f, - -0.8101695477705659f, - -0.81009280800266f, - -0.8100160543540328f, - -0.8099392868259988f, - -0.8098625054198745f, - -0.8097857101369749f, - -0.8097089009786158f, - -0.8096320779461131f, - -0.8095552410407839f, - -0.809478390263944f, - -0.8094015256169114f, - -0.8093246471010014f, - -0.8092477547175327f, - -0.8091708484678218f, - -0.8090939283531882f, - -0.8090169943749476f, - -0.8089400465344199f, - -0.8088630848329225f, - -0.8087861092717751f, - -0.8087091198522963f, - -0.8086321165758052f, - -0.8085550994436208f, - -0.8084780684570637f, - -0.8084010236174533f, - -0.8083239649261097f, - -0.8082468923843529f, - -0.8081698059935044f, - -0.8080927057548847f, - -0.8080155916698147f, - -0.8079384637396154f, - -0.8078613219656093f, - -0.8077841663491172f, - -0.8077069968914626f, - -0.8076298135939659f, - -0.807552616457951f, - -0.8074754054847402f, - -0.8073981806756564f, - -0.8073209420320224f, - -0.8072436895551627f, - -0.8071664232464005f, - -0.8070891431070597f, - -0.8070118491384639f, - -0.8069345413419386f, - -0.8068572197188081f, - -0.8067798842703965f, - -0.80670253499803f, - -0.8066251719030336f, - -0.8065477949867328f, - -0.8064704042504528f, - -0.8063929996955214f, - -0.8063155813232628f, - -0.806238149135005f, - -0.8061607031320739f, - -0.806083243315798f, - -0.8060057696875023f, - -0.8059282822485161f, - -0.805850781000166f, - -0.805773265943781f, - -0.8056957370806888f, - -0.8056181944122177f, - -0.8055406379396961f, - -0.8054630676644537f, - -0.8053854835878194f, - -0.8053078857111223f, - -0.8052302740356916f, - -0.8051526485628583f, - -0.8050750092939514f, - -0.8049973562303027f, - -0.8049196893732407f, - -0.8048420087240978f, - -0.804764314284204f, - -0.8046866060548922f, - -0.8046088840374918f, - -0.8045311482333359f, - -0.8044533986437558f, - -0.8043756352700849f, - -0.8042978581136538f, - -0.8042200671757967f, - -0.8041422624578457f, - -0.8040644439611346f, - -0.8039866116869965f, - -0.803908765636765f, - -0.8038309058117741f, - -0.8037530322133573f, - -0.8036751448428497f, - -0.8035972437015859f, - -0.8035193287909003f, - -0.8034414001121275f, - -0.803363457666604f, - -0.8032855014556647f, - -0.8032075314806453f, - -0.8031295477428813f, - -0.80305155024371f, - -0.8029735389844673f, - -0.8028955139664901f, - -0.8028174751911145f, - -0.8027394226596789f, - -0.8026613563735202f, - -0.8025832763339761f, - -0.8025051825423837f, - -0.8024270750000824f, - -0.80234895370841f, - -0.802270818668705f, - -0.8021926698823056f, - -0.8021145073505522f, - -0.8020363310747829f, - -0.8019581410563388f, - -0.8018799372965575f, - -0.8018017197967806f, - -0.8017234885583474f, - -0.8016452435825999f, - -0.8015669848708766f, - -0.8014887124245201f, - -0.8014104262448706f, - -0.8013321263332709f, - -0.8012538126910608f, - -0.8011754853195835f, - -0.8010971442201802f, - -0.8010187893941942f, - -0.8009404208429677f, - -0.8008620385678435f, - -0.8007836425701641f, - -0.8007052328512739f, - -0.8006268094125158f, - -0.8005483722552337f, - -0.8004699213807709f, - -0.8003914567904727f, - -0.8003129784856833f, - -0.8002344864677471f, - -0.8001559807380088f, - -0.8000774612978143f, - -0.7999989281485087f, - -0.7999203812914376f, - -0.7998418207279469f, - -0.7997632464593821f, - -0.7996846584870907f, - -0.7996060568124187f, - -0.7995274414367131f, - -0.79944881236132f, - -0.7993701695875882f, - -0.7992915131168639f, - -0.7992128429504965f, - -0.799134159089832f, - -0.79905546153622f, - -0.798976750291008f, - -0.7988980253555463f, - -0.7988192867311819f, - -0.7987405344192651f, - -0.7986617684211447f, - -0.7985829887381716f, - -0.7985041953716937f, - -0.7984253883230626f, - -0.7983465675936278f, - -0.7982677331847406f, - -0.7981888850977517f, - -0.7981100233340117f, - -0.7980311478948716f, - -0.7979522587816839f, - -0.7978733559957998f, - -0.7977944395385713f, - -0.79771550941135f, - -0.7976365656154897f, - -0.7975576081523422f, - -0.7974786370232606f, - -0.7973996522295974f, - -0.7973206537727072f, - -0.797241641653943f, - -0.7971626158746585f, - -0.7970835764362076f, - -0.7970045233399454f, - -0.796925456587226f, - -0.7968463761794043f, - -0.7967672821178347f, - -0.7966881744038734f, - -0.7966090530388754f, - -0.7965299180241961f, - -0.7964507693611924f, - -0.7963716070512198f, - -0.796292431095635f, - -0.7962132414957939f, - -0.7961340382530551f, - -0.7960548213687736f, - -0.7959755908443082f, - -0.7958963466810157f, - -0.7958170888802554f, - -0.7957378174433831f, - -0.795658532371759f, - -0.7955792336667402f, - -0.7954999213296867f, - -0.7954205953619571f, - -0.7953412557649103f, - -0.7952619025399056f, - -0.7951825356883034f, - -0.7951031552114635f, - -0.7950237611107457f, - -0.79494435338751f, - -0.7948649320431181f, - -0.7947854970789304f, - -0.7947060484963079f, - -0.7946265862966113f, - -0.7945471104812035f, - -0.7944676210514451f, - -0.7943881180086997f, - -0.7943086013543273f, - -0.7942290710896923f, - -0.7941495272161562f, - -0.7940699697350835f, - -0.7939903986478354f, - -0.7939108139557768f, - -0.7938312156602703f, - -0.7937516037626815f, - -0.7936719782643723f, - -0.7935923391667088f, - -0.793512686471055f, - -0.793433020178775f, - -0.7933533402912352f, - -0.7932736468098002f, - -0.7931939397358356f, - -0.7931142190707066f, - -0.7930344848157802f, - -0.7929547369724222f, - -0.792874975541999f, - -0.7927952005258768f, - -0.7927154119254236f, - -0.7926356097420059f, - -0.7925557939769912f, - -0.7924759646317465f, - -0.7923961217076408f, - -0.7923162652060416f, - -0.7922363951283173f, - -0.7921565114758359f, - -0.7920766142499671f, - -0.7919967034520796f, - -0.7919167790835425f, - -0.7918368411457248f, - -0.7917568896399974f, - -0.791676924567729f, - -0.7915969459302914f, - -0.791516953729053f, - -0.7914369479653859f, - -0.79135692864066f, - -0.7912768957562479f, - -0.7911968493135191f, - -0.7911167893138464f, - -0.7910367157586008f, - -0.7909566286491558f, - -0.7908765279868816f, - -0.7907964137731522f, - -0.7907162860093395f, - -0.7906361446968173f, - -0.7905559898369585f, - -0.7904758214311363f, - -0.7903956394807239f, - -0.7903154439870963f, - -0.7902352349516271f, - -0.7901550123756906f, - -0.7900747762606609f, - -0.7899945266079139f, - -0.7899142634188242f, - -0.7898339866947669f, - -0.7897536964371177f, - -0.7896733926472517f, - -0.7895930753265459f, - -0.7895127444763762f, - -0.7894324000981189f, - -0.78935204219315f, - -0.7892716707628479f, - -0.7891912858085888f, - -0.7891108873317503f, - -0.7890304753337093f, - -0.7889500498158448f, - -0.7888696107795344f, - -0.7887891582261564f, - -0.7887086921570886f, - -0.7886282125737111f, - -0.7885477194774017f, - -0.7884672128695411f, - -0.7883866927515069f, - -0.7883061591246802f, - -0.7882256119904398f, - -0.7881450513501677f, - -0.788064477205242f, - -0.7879838895570448f, - -0.787903288406956f, - -0.7878226737563578f, - -0.787742045606631f, - -0.787661403959157f, - -0.7875807488153171f, - -0.7875000801764944f, - -0.7874193980440706f, - -0.787338702419428f, - -0.7872579933039491f, - -0.7871772706990176f, - -0.7870965346060163f, - -0.7870157850263284f, - -0.7869350219613372f, - -0.7868542454124275f, - -0.7867734553809829f, - -0.7866926518683878f, - -0.7866118348760259f, - -0.7865310044052835f, - -0.7864501604575446f, - -0.7863693030341947f, - -0.7862884321366188f, - -0.7862075477662036f, - -0.7861266499243345f, - -0.7860457386123975f, - -0.7859648138317792f, - -0.7858838755838655f, - -0.7858029238700446f, - -0.7857219586917022f, - -0.7856409800502275f, - -0.7855599879470058f, - -0.7854789823834264f, - -0.7853979633608763f, - -0.7853169308807455f, - -0.78523588494442f, - -0.7851548255532904f, - -0.7850737527087444f, - -0.7849926664121728f, - -0.7849115666649629f, - -0.7848304534685059f, - -0.7847493268241905f, - -0.784668186733408f, - -0.7845870331975481f, - -0.7845058662180013f, - -0.784424685796158f, - -0.7843434919334101f, - -0.7842622846311483f, - -0.7841810638907643f, - -0.784099829713649f, - -0.7840185821011955f, - -0.7839373210547947f, - -0.783856046575841f, - -0.7837747586657245f, - -0.7836934573258398f, - -0.783612142557579f, - -0.7835308143623368f, - -0.7834494727415048f, - -0.7833681176964783f, - -0.7832867492286506f, - -0.7832053673394161f, - -0.7831239720301688f, - -0.7830425633023043f, - -0.7829611411572169f, - -0.7828797055963015f, - -0.7827982566209543f, - -0.7827167942325705f, - -0.7826353184325457f, - -0.7825538292222759f, - -0.782472326603158f, - -0.7823908105765883f, - -0.7823092811439634f, - -0.7822277383066797f, - -0.7821461820661362f, - -0.782064612423728f, - -0.7819830293808546f, - -0.7819014329389127f, - -0.7818198230993014f, - -0.7817381998634189f, - -0.7816565632326633f, - -0.7815749132084332f, - -0.7814932497921286f, - -0.7814115729851484f, - -0.7813298827888919f, - -0.7812481792047585f, - -0.7811664622341491f, - -0.7810847318784635f, - -0.781002988139102f, - -0.7809212310174647f, - -0.7808394605149536f, - -0.7807576766329688f, - -0.7806758793729132f, - -0.7805940687361863f, - -0.7805122447241913f, - -0.7804304073383295f, - -0.7803485565800045f, - -0.7802666924506168f, - -0.7801848149515705f, - -0.7801029240842677f, - -0.7800210198501133f, - -0.7799391022505082f, - -0.7798571712868578f, - -0.779775226960565f, - -0.779693269273035f, - -0.7796112982256713f, - -0.7795293138198787f, - -0.7794473160570619f, - -0.7793653049386253f, - -0.7792832804659754f, - -0.7792012426405169f, - -0.7791191914636557f, - -0.7790371269367972f, - -0.7789550490613484f, - -0.7788729578387152f, - -0.7787908532703045f, - -0.7787087353575223f, - -0.7786266041017768f, - -0.7785444595044748f, - -0.7784623015670239f, - -0.7783801302908311f, - -0.7782979456773057f, - -0.7782157477278552f, - -0.7781335364438882f, - -0.7780513118268126f, - -0.7779690738780386f, - -0.7778868225989741f, - -0.7778045579910302f, - -0.7777222800556143f, - -0.7776399887941376f, - -0.7775576842080094f, - -0.7774753662986414f, - -0.777393035067442f, - -0.7773106905158234f, - -0.7772283326451955f, - -0.7771459614569713f, - -0.77706357695256f, - -0.7769811791333747f, - -0.7768987680008262f, - -0.7768163435563279f, - -0.7767339058012913f, - -0.776651454737129f, - -0.7765689903652535f, - -0.7764865126870786f, - -0.776404021704017f, - -0.7763215174174823f, - -0.7762389998288877f, - -0.776156468939648f, - -0.7760739247511769f, - -0.7759913672648887f, - -0.7759087964821976f, - -0.7758262124045193f, - -0.7757436150332686f, - -0.7756610043698606f, - -0.7755783804157103f, - -0.7754957431722345f, - -0.7754130926408487f, - -0.775330428822969f, - -0.7752477517200119f, - -0.7751650613333934f, - -0.7750823576645316f, - -0.7749996407148424f, - -0.774916910485745f, - -0.7748341669786544f, - -0.7747514101949903f, - -0.7746686401361694f, - -0.7745858568036119f, - -0.7745030601987339f, - -0.7744202503229558f, - -0.7743374271776953f, - -0.7742545907643733f, - -0.7741717410844069f, - -0.7740888781392175f, - -0.7740060019302237f, - -0.7739231124588467f, - -0.7738402097265064f, - -0.773757293734623f, - -0.7736743644846169f, - -0.7735914219779102f, - -0.7735084662159234f, - -0.773425497200078f, - -0.7733425149317952f, - -0.7732595194124977f, - -0.7731765106436075f, - -0.7730934886265465f, - -0.7730104533627369f, - -0.7729274048536026f, - -0.7728443431005654f, - -0.7727612681050504f, - -0.7726781798684786f, - -0.7725950783922756f, - -0.7725119636778647f, - -0.7724288357266699f, - -0.7723456945401151f, - -0.7722625401196261f, - -0.7721793724666272f, - -0.7720961915825433f, - -0.7720129974687991f, - -0.7719297901268214f, - -0.7718465695580352f, - -0.7717633357638661f, - -0.7716800887457412f, - -0.7715968285050866f, - -0.7715135550433287f, - -0.771430268361894f, - -0.7713469684622111f, - -0.7712636553457052f, - -0.7711803290138054f, - -0.7710969894679385f, - -0.7710136367095342f, - -0.7709302707400183f, - -0.7708468915608211f, - -0.7707634991733701f, - -0.7706800935790954f, - -0.7705966747794254f, - -0.7705132427757896f, - -0.7704297975696169f, - -0.7703463391623385f, - -0.7702628675553836f, - -0.7701793827501826f, - -0.7700958847481654f, - -0.7700123735507637f, - -0.7699288491594075f, - -0.7698453115755297f, - -0.7697617608005592f, - -0.7696781968359295f, - -0.7695946196830713f, - -0.7695110293434184f, - -0.7694274258184007f, - -0.7693438091094524f, - -0.7692601792180054f, - -0.7691765361454941f, - -0.7690928798933495f, - -0.7690092104630067f, - -0.7689255278558984f, - -0.7688418320734595f, - -0.7687581231171233f, - -0.7686744009883245f, - -0.7685906656884975f, - -0.7685069172190765f, - -0.7684231555814977f, - -0.7683393807771957f, - -0.768255592807606f, - -0.7681717916741637f, - -0.7680879773783058f, - -0.7680041499214679f, - -0.7679203093050865f, - -0.7678364555305974f, - -0.7677525885994386f, - -0.7676687085130467f, - -0.7675848152728588f, - -0.7675009088803121f, - -0.767416989336845f, - -0.7673330566438952f, - -0.7672491108029008f, - -0.7671651518152995f, - -0.7670811796825313f, - -0.7669971944060342f, - -0.7669131959872475f, - -0.7668291844276097f, - -0.7667451597285616f, - -0.7666611218915418f, - -0.766577070917992f, - -0.7664930068093498f, - -0.7664089295670579f, - -0.7663248391925552f, - -0.7662407356872847f, - -0.7661566190526851f, - -0.7660724892901992f, - -0.7659883464012678f, - -0.7659041903873334f, - -0.7658200212498377f, - -0.7657358389902229f, - -0.7656516436099308f, - -0.765567435110405f, - -0.7654832134930882f, - -0.7653989787594234f, - -0.7653147309108532f, - -0.7652304699488225f, - -0.7651461958747743f, - -0.7650619086901529f, - -0.7649776083964017f, - -0.7648932949949664f, - -0.7648089684872912f, - -0.764724628874821f, - -0.7646402761590008f, - -0.7645559103412755f, - -0.7644715314230918f, - -0.7643871394058949f, - -0.7643027342911309f, - -0.7642183160802455f, - -0.7641338847746862f, - -0.7640494403758993f, - -0.7639649828853317f, - -0.7638805123044299f, - -0.7637960286346424f, - -0.7637115318774157f, - -0.7636270220341995f, - -0.7635424991064393f, - -0.7634579630955853f, - -0.7633734140030849f, - -0.7632888518303883f, - -0.7632042765789423f, - -0.7631196882501978f, - -0.7630350868456031f, - -0.7629504723666093f, - -0.7628658448146642f, - -0.7627812041912196f, - -0.7626965504977246f, - -0.7626118837356307f, - -0.7625272039063883f, - -0.7624425110114482f, - -0.762357805052261f, - -0.7622730860302795f, - -0.7621883539469546f, - -0.7621036088037381f, - -0.7620188506020816f, - -0.7619340793434385f, - -0.7618492950292608f, - -0.7617644976610014f, - -0.7616796872401124f, - -0.7615948637680483f, - -0.761510027246262f, - -0.7614251776762072f, - -0.7613403150593371f, - -0.7612554393971068f, - -0.7611705506909704f, - -0.7610856489423822f, - -0.7610007341527963f, - -0.7609158063236692f, - -0.7608308654564552f, - -0.7607459115526093f, - -0.7606609446135889f, - -0.7605759646408475f, - -0.7604909716358431f, - -0.7604059656000308f, - -0.7603209465348688f, - -0.7602359144418117f, - -0.760150869322318f, - -0.7600658111778441f, - -0.7599807400098489f, - -0.759895655819788f, - -0.759810558609121f, - -0.7597254483793046f, - -0.7596403251317985f, - -0.7595551888680606f, - -0.7594700395895498f, - -0.7593848772977245f, - -0.7592997019940451f, - -0.7592145136799704f, - -0.7591293123569601f, - -0.7590440980264735f, - -0.758958870689972f, - -0.7588736303489152f, - -0.7587883770047639f, - -0.7587031106589781f, - -0.7586178313130201f, - -0.7585325389683498f, - -0.7584472336264306f, - -0.7583619152887218f, - -0.7582765839566871f, - -0.7581912396317873f, - -0.7581058823154867f, - -0.7580205120092454f, - -0.7579351287145281f, - -0.757849732432797f, - -0.7577643231655155f, - -0.7576789009141465f, - -0.7575934656801547f, - -0.7575080174650036f, - -0.7574225562701568f, - -0.7573370820970796f, - -0.7572515949472362f, - -0.7571660948220912f, - -0.7570805817231091f, - -0.7569950556517565f, - -0.756909516609498f, - -0.7568239645977995f, - -0.7567383996181263f, - -0.7566528216719455f, - -0.7565672307607231f, - -0.7564816268859256f, - -0.7563960100490191f, - -0.756310380251472f, - -0.7562247374947509f, - -0.7561390817803232f, - -0.756053413109656f, - -0.7559677314842185f, - -0.755882036905478f, - -0.755796329374903f, - -0.7557106088939616f, - -0.7556248754641237f, - -0.755539129086857f, - -0.7554533697636328f, - -0.7553675974959178f, - -0.7552818122851838f, - -0.7551960141328994f, - -0.7551102030405364f, - -0.755024379009563f, - -0.7549385420414514f, - -0.7548526921376713f, - -0.7547668292996953f, - -0.7546809535289926f, - -0.7545950648270361f, - -0.7545091631952965f, - -0.7544232486352468f, - -0.7543373211483585f, - -0.754251380736104f, - -0.7541654273999554f, - -0.7540794611413864f, - -0.7539934819618695f, - -0.7539074898628783f, - -0.7538214848458851f, - -0.7537354669123649f, - -0.7536494360637913f, - -0.7535633923016382f, - -0.7534773356273798f, - -0.7533912660424904f, - -0.7533051835484458f, - -0.7532190881467202f, - -0.7531329798387892f, - -0.7530468586261274f, - -0.7529607245102117f, - -0.7528745774925174f, - -0.7527884175745206f, - -0.7527022447576972f, - -0.7526160590435246f, - -0.7525298604334786f, - -0.752443648929038f, - -0.7523574245316775f, - -0.7522711872428764f, - -0.7521849370641112f, - -0.7520986739968615f, - -0.7520123980426029f, - -0.7519261092028158f, - -0.7518398074789772f, - -0.7517534928725679f, - -0.7516671653850644f, - -0.7515808250179477f, - -0.7514944717726959f, - -0.75140810565079f, - -0.7513217266537092f, - -0.7512353347829337f, - -0.751148930039943f, - -0.7510625124262189f, - -0.7509760819432416f, - -0.750889638592492f, - -0.7508031823754507f, - -0.7507167132936003f, - -0.7506302313484219f, - -0.7505437365413973f, - -0.7504572288740079f, - -0.7503707083477372f, - -0.7502841749640671f, - -0.7501976287244804f, - -0.7501110696304595f, - -0.7500244976834886f, - -0.7499379128850505f, - -0.7498513152366288f, - -0.7497647047397069f, - -0.74967808139577f, - -0.7495914452063016f, - -0.7495047961727864f, - -0.749418134296709f, - -0.7493314595795537f, - -0.7492447720228068f, - -0.7491580716279527f, - -0.7490713583964785f, - -0.7489846323298678f, - -0.7488978934296083f, - -0.7488111416971853f, - -0.7487243771340867f, - -0.7486375997417971f, - -0.7485508095218051f, - -0.7484640064755965f, - -0.7483771906046606f, - -0.7482903619104825f, - -0.7482035203945518f, - -0.7481166660583554f, - -0.7480297989033825f, - -0.7479429189311212f, - -0.74785602614306f, - -0.7477691205406872f, - -0.7476822021254933f, - -0.7475952708989667f, - -0.7475083268625972f, - -0.7474213700178738f, - -0.7473344003662877f, - -0.747247417909328f, - -0.7471604226484869f, - -0.7470734145852527f, - -0.7469863937211179f, - -0.7468993600575724f, - -0.7468123135961093f, - -0.7467252543382179f, - -0.7466381822853915f, - -0.7465510974391216f, - -0.7464639998009003f, - -0.7463768893722195f, - -0.7462897661545729f, - -0.7462026301494528f, - -0.7461154813583516f, - -0.7460283197827638f, - -0.7459411454241823f, - -0.7458539582841008f, - -0.7457667583640126f, - -0.7456795456654132f, - -0.745592320189796f, - -0.745505081938656f, - -0.7454178309134872f, - -0.7453305671157864f, - -0.7452432905470465f, - -0.7451560012087648f, - -0.7450686991024358f, - -0.7449813842295564f, - -0.7448940565916223f, - -0.7448067161901297f, - -0.7447193630265747f, - -0.7446319971024553f, - -0.7445446184192677f, - -0.7444572269785092f, - -0.7443698227816767f, - -0.744282405830269f, - -0.7441949761257832f, - -0.7441075336697177f, - -0.74402007846357f, - -0.7439326105088399f, - -0.7438451298070248f, - -0.7437576363596256f, - -0.743670130168139f, - -0.7435826112340663f, - -0.7434950795589057f, - -0.7434075351441591f, - -0.7433199779913241f, - -0.7432324081019026f, - -0.743144825477394f, - -0.7430572301193001f, - -0.7429696220291214f, - -0.7428820012083589f, - -0.7427943676585135f, - -0.7427067213810878f, - -0.7426190623775831f, - -0.7425313906495014f, - -0.7424437061983449f, - -0.7423560090256155f, - -0.742268299132817f, - -0.7421805765214518f, - -0.7420928411930229f, - -0.7420050931490331f, - -0.741917332390987f, - -0.7418295589203878f, - -0.7417417727387396f, - -0.7416539738475459f, - -0.7415661622483124f, - -0.7414783379425429f, - -0.7413905009317425f, - -0.7413026512174156f, - -0.7412147888010686f, - -0.7411269136842065f, - -0.7410390258683348f, - -0.7409511253549591f, - -0.7408632121455866f, - -0.7407752862417226f, - -0.7406873476448753f, - -0.7405993963565493f, - -0.7405114323782532f, - -0.7404234557114933f, - -0.7403354663577786f, - -0.7402474643186145f, - -0.7401594495955108f, - -0.7400714221899742f, - -0.739983382103515f, - -0.7398953293376391f, - -0.7398072638938574f, - -0.7397191857736775f, - -0.7396310949786097f, - -0.7395429915101629f, - -0.7394548753698468f, - -0.7393667465591706f, - -0.7392786050796454f, - -0.7391904509327811f, - -0.7391022841200882f, - -0.7390141046430767f, - -0.7389259125032588f, - -0.7388377077021449f, - -0.7387494902412466f, - -0.7386612601220747f, - -0.7385730173461423f, - -0.7384847619149608f, - -0.7383964938300424f, - -0.7383082130928995f, - -0.7382199197050443f, - -0.7381316136679907f, - -0.7380432949832515f, - -0.7379549636523398f, - -0.7378666196767685f, - -0.7377782630580526f, - -0.7376898937977049f, - -0.7376015118972413f, - -0.737513117358174f, - -0.7374247101820192f, - -0.7373362903702907f, - -0.7372478579245052f, - -0.7371594128461756f, - -0.7370709551368192f, - -0.7369824847979506f, - -0.7368940018310873f, - -0.7368055062377433f, - -0.7367169980194365f, - -0.7366284771776824f, - -0.736539943713999f, - -0.7364513976299026f, - -0.7363628389269106f, - -0.7362742676065395f, - -0.7361856836703085f, - -0.7360970871197345f, - -0.736008477956336f, - -0.7359198561816302f, - -0.7358312217971373f, - -0.7357425748043751f, - -0.7356539152048628f, - -0.7355652430001186f, - -0.7354765581916635f, - -0.735387860781016f, - -0.7352991507696964f, - -0.7352104281592239f, - -0.7351216929511198f, - -0.7350329451469042f, - -0.7349441847480976f, - -0.7348554117562205f, - -0.7347666261727949f, - -0.7346778279993417f, - -0.7345890172373823f, - -0.7345001938884381f, - -0.7344113579540321f, - -0.7343225094356858f, - -0.7342336483349212f, - -0.7341447746532619f, - -0.7340558883922302f, - -0.7339669895533493f, - -0.7338780781381417f, - -0.7337891541481326f, - -0.7337002175848434f, - -0.7336112684497998f, - -0.7335223067445248f, - -0.7334333324705437f, - -0.7333443456293807f, - -0.7332553462225604f, - -0.7331663342516073f, - -0.7330773097180476f, - -0.7329882726234064f, - -0.7328992229692091f, - -0.732810160756981f, - -0.7327210859882495f, - -0.73263199866454f, - -0.7325428987873791f, - -0.7324537863582931f, - -0.7323646613788098f, - -0.7322755238504554f, - -0.7321863737747588f, - -0.7320972111532454f, - -0.7320080359874447f, - -0.7319188482788834f, - -0.7318296480290917f, - -0.7317404352395953f, - -0.7316512099119249f, - -0.7315619720476081f, - -0.7314727216481757f, - -0.7313834587151546f, - -0.7312941832500763f, - -0.7312048952544696f, - -0.731115594729864f, - -0.7310262816777908f, - -0.7309369560997798f, - -0.7308476179973614f, - -0.7307582673720661f, - -0.7306689042254257f, - -0.7305795285589711f, - -0.7304901403742338f, - -0.7304007396727445f, - -0.7303113264560366f, - -0.7302219007256413f, - -0.7301324624830912f, - -0.7300430117299177f, - -0.7299535484676553f, - -0.7298640726978359f, - -0.7297745844219928f, - -0.7296850836416588f, - -0.7295955703583686f, - -0.7295060445736555f, - -0.7294165062890534f, - -0.7293269555060958f, - -0.7292373922263186f, - -0.7291478164512556f, - -0.7290582281824418f, - -0.7289686274214116f, - -0.7288790141697015f, - -0.7287893884288458f, - -0.728699750200382f, - -0.7286100994858437f, - -0.7285204362867688f, - -0.7284307606046924f, - -0.7283410724411529f, - -0.7282513717976847f, - -0.7281616586758266f, - -0.7280719330771146f, - -0.7279821950030873f, - -0.7278924444552818f, - -0.7278026814352359f, - -0.7277129059444871f, - -0.7276231179845748f, - -0.727533317557037f, - -0.7274435046634123f, - -0.7273536793052391f, - -0.7272638414840578f, - -0.7271739912014069f, - -0.7270841284588262f, - -0.7269942532578548f, - -0.7269043656000338f, - -0.726814465486903f, - -0.7267245529200026f, - -0.7266346279008734f, - -0.7265446904310554f, - -0.7264547405120911f, - -0.7263647781455211f, - -0.726274803332887f, - -0.7261848160757295f, - -0.7260948163755921f, - -0.7260048042340163f, - -0.7259147796525441f, - -0.7258247426327178f, - -0.7257346931760811f, - -0.725644631284176f, - -0.7255545569585473f, - -0.7254644702007361f, - -0.7253743710122879f, - -0.7252842593947452f, - -0.7251941353496537f, - -0.7251039988785556f, - -0.7250138499829969f, - -0.7249236886645212f, - -0.7248335149246751f, - -0.7247433287650012f, - -0.7246531301870469f, - -0.7245629191923564f, - -0.7244726957824766f, - -0.7243824599589529f, - -0.7242922117233315f, - -0.724201951077158f, - -0.7241116780219804f, - -0.7240213925593448f, - -0.7239310946907983f, - -0.7238407844178875f, - -0.7237504617421608f, - -0.7236601266651657f, - -0.7235697791884497f, - -0.7234794193135604f, - -0.7233890470420474f, - -0.7232986623754585f, - -0.7232082653153423f, - -0.7231178558632474f, - -0.723027434020724f, - -0.7229369997893208f, - -0.7228465531705874f, - -0.722756094166073f, - -0.7226656227773288f, - -0.7225751390059044f, - -0.7224846428533496f, - -0.7223941343212169f, - -0.7223036134110545f, - -0.7222130801244157f, - -0.72212253446285f, - -0.7220319764279112f, - -0.7219414060211481f, - -0.7218508232441149f, - -0.721760228098362f, - -0.7216696205854439f, - -0.7215790007069107f, - -0.7214883684643169f, - -0.7213977238592141f, - -0.7213070668931567f, - -0.7212163975676977f, - -0.7211257158843907f, - -0.7210350218447886f, - -0.7209443154504468f, - -0.720853596702919f, - -0.7207628656037596f, - -0.7206721221545225f, - -0.720581366356764f, - -0.7204905982120384f, - -0.720399817721901f, - -0.7203090248879068f, - -0.7202182197116127f, - -0.7201274021945733f, - -0.7200365723383467f, - -0.7199457301444867f, - -0.7198548756145517f, - -0.7197640087500974f, - -0.7196731295526824f, - -0.7195822380238615f, - -0.719491334165194f, - -0.7194004179782368f, - -0.7193094894645473f, - -0.7192185486256846f, - -0.7191275954632063f, - -0.719036629978671f, - -0.7189456521736366f, - -0.7188546620496634f, - -0.7187636596083098f, - -0.718672644851135f, - -0.718581617779698f, - -0.7184905783955596f, - -0.7183995267002794f, - -0.7183084626954174f, - -0.7182173863825333f, - -0.7181262977631889f, - -0.7180351968389445f, - -0.7179440836113609f, - -0.7178529580819987f, - -0.7177618202524207f, - -0.7176706701241878f, - -0.7175795076988619f, - -0.7174883329780044f, - -0.7173971459631787f, - -0.7173059466559468f, - -0.7172147350578713f, - -0.7171235111705143f, - -0.7170322749954404f, - -0.7169410265342115f, - -0.7168497657883931f, - -0.7167584927595464f, - -0.7166672074492372f, - -0.7165759098590283f, - -0.7164845999904861f, - -0.7163932778451726f, - -0.7163019434246545f, - -0.7162105967304954f, - -0.7161192377642625f, - -0.7160278665275186f, - -0.7159364830218313f, - -0.7158450872487653f, - -0.7157536792098876f, - -0.715662258906764f, - -0.715570826340961f, - -0.7154793815140446f, - -0.7153879244275828f, - -0.7152964550831423f, - -0.7152049734822903f, - -0.7151134796265942f, - -0.7150219735176212f, - -0.7149304551569405f, - -0.7148389245461196f, - -0.7147473816867269f, - -0.7146558265803302f, - -0.7145642592284998f, - -0.7144726796328037f, - -0.7143810877948112f, - -0.7142894837160914f, - -0.7141978673982146f, - -0.7141062388427504f, - -0.7140145980512688f, - -0.7139229450253392f, - -0.7138312797665335f, - -0.7137396022764211f, - -0.7136479125565746f, - -0.7135562106085627f, - -0.7134644964339586f, - -0.7133727700343323f, - -0.7132810314112578f, - -0.713189280566304f, - -0.7130975175010454f, - -0.7130057422170528f, - -0.7129139547159007f, - -0.7128221549991594f, - -0.7127303430684035f, - -0.7126385189252052f, - -0.7125466825711391f, - -0.712454834007778f, - -0.7123629732366957f, - -0.7122711002594658f, - -0.7121792150776637f, - -0.7120873176928632f, - -0.7119954081066387f, - -0.7119034863205648f, - -0.7118115523362174f, - -0.7117196061551715f, - -0.7116276477790024f, - -0.7115356772092852f, - -0.711443694447597f, - -0.7113516994955134f, - -0.7112596923546105f, - -0.7111676730264643f, - -0.7110756415126528f, - -0.7109835978147523f, - -0.7108915419343399f, - -0.710799473872993f, - -0.7107073936322885f, - -0.7106153012138055f, - -0.7105231966191212f, - -0.710431079849814f, - -0.7103389509074615f, - -0.7102468097936436f, - -0.7101546565099379f, - -0.7100624910579252f, - -0.7099703134391824f, - -0.7098781236552906f, - -0.7097859217078284f, - -0.7096937075983774f, - -0.7096014813285152f, - -0.709509242899824f, - -0.7094169923138828f, - -0.7093247295722739f, - -0.7092324546765774f, - -0.7091401676283743f, - -0.7090478684292454f, - -0.7089555570807735f, - -0.7088632335845396f, - -0.7087708979421258f, - -0.7086785501551134f, - -0.7085861902250862f, - -0.708493818153626f, - -0.7084014339423157f, - -0.7083090375927376f, - -0.7082166291064761f, - -0.7081242084851134f, - -0.7080317757302348f, - -0.7079393308434219f, - -0.7078468738262604f, - -0.707754404680334f, - -0.707661923407227f, - -0.7075694300085236f, - -0.7074769244858097f, - -0.7073844068406699f, - -0.7072918770746893f, - -0.707199335189453f, - -0.7071067811865477f, - -0.7070142150675587f, - -0.7069216368340716f, - -0.7068290464876738f, - -0.7067364440299512f, - -0.7066438294624906f, - -0.7065512027868783f, - -0.7064585640047025f, - -0.7063659131175503f, - -0.7062732501270089f, - -0.7061805750346655f, - -0.7060878878421101f, - -0.7059951885509281f, - -0.7059024771627099f, - -0.705809753679043f, - -0.7057170181015172f, - -0.7056242704317209f, - -0.7055315106712434f, - -0.7054387388216734f, - -0.7053459548846019f, - -0.705253158861618f, - -0.7051603507543117f, - -0.7050675305642727f, - -0.7049746982930927f, - -0.7048818539423617f, - -0.7047889975136705f, - -0.7046961290086097f, - -0.7046032484287716f, - -0.7045103557757467f, - -0.7044174510511284f, - -0.7043245342565062f, - -0.704231605393474f, - -0.7041386644636227f, - -0.704045711468547f, - -0.703952746409837f, - -0.7038597692890874f, - -0.7037667801078903f, - -0.7036737788678401f, - -0.7035807655705298f, - -0.7034877402175532f, - -0.7033947028105036f, - -0.7033016533509765f, - -0.7032085918405655f, - -0.7031155182808653f, - -0.7030224326734705f, - -0.7029293350199758f, - -0.7028362253219773f, - -0.7027431035810701f, - -0.7026499697988496f, - -0.7025568239769111f, - -0.7024636661168518f, - -0.7023704962202675f, - -0.7022773142887544f, - -0.7021841203239086f, - -0.7020909143273283f, - -0.7019976963006098f, - -0.7019044662453504f, - -0.7018112241631471f, - -0.7017179700555987f, - -0.7016247039243023f, - -0.7015314257708563f, - -0.7014381355968581f, - -0.7013448334039076f, - -0.7012515191936023f, - -0.7011581929675428f, - -0.7010648547273259f, - -0.7009715044745528f, - -0.7008781422108217f, - -0.7007847679377343f, - -0.7006913816568878f, - -0.7005979833698845f, - -0.7005045730783234f, - -0.7004111507838069f, - -0.7003177164879333f, - -0.7002242701923056f, - -0.7001308118985234f, - -0.7000373416081895f, - -0.699943859322905f, - -0.6998503650442716f, - -0.6997568587738905f, - -0.6996633405133654f, - -0.699569810264298f, - -0.6994762680282908f, - -0.6993827138069462f, - -0.6992891476018682f, - -0.6991955694146597f, - -0.699101979246924f, - -0.6990083771002641f, - -0.6989147629762852f, - -0.6988211368765906f, - -0.6987274988027846f, - -0.6986338487564717f, - -0.698540186739256f, - -0.6984465127527435f, - -0.6983528267985386f, - -0.6982591288782467f, - -0.6981654189934727f, - -0.6980716971458235f, - -0.6979779633369038f, - -0.6978842175683214f, - -0.6977904598416802f, - -0.6976966901585887f, - -0.6976029085206522f, - -0.6975091149294796f, - -0.6974153093866756f, - -0.6973214918938493f, - -0.6972276624526068f, - -0.6971338210645581f, - -0.6970399677313085f, - -0.6969461024544679f, - -0.6968522252356435f, - -0.6967583360764451f, - -0.696664434978481f, - -0.6965705219433598f, - -0.6964765969726904f, - -0.6963826600680832f, - -0.6962887112311473f, - -0.6961947504634924f, - -0.6961007777667281f, - -0.6960067931424655f, - -0.6959127965923145f, - -0.6958187881178859f, - -0.6957247677207895f, - -0.695630735402638f, - -0.6955366911650417f, - -0.695442635009612f, - -0.6953485669379601f, - -0.695254486951699f, - -0.6951603950524401f, - -0.6950662912417956f, - -0.6949721755213774f, - -0.6948780478927994f, - -0.6947839083576737f, - -0.6946897569176134f, - -0.6945955935742312f, - -0.6945014183291418f, - -0.6944072311839582f, - -0.6943130321402937f, - -0.6942188211997642f, - -0.6941245983639815f, - -0.6940303636345619f, - -0.693936117013119f, - -0.6938418585012694f, - -0.6937475881006259f, - -0.6936533058128054f, - -0.6935590116394221f, - -0.6934647055820934f, - -0.6933703876424342f, - -0.6932760578220608f, - -0.6931817161225887f, - -0.693087362545636f, - -0.6929929970928184f, - -0.6928986197657531f, - -0.6928042305660564f, - -0.6927098294953471f, - -0.6926154165552421f, - -0.6925209917473589f, - -0.6924265550733151f, - -0.6923321065347299f, - -0.6922376461332205f, - -0.6921431738704072f, - -0.6920486897479065f, - -0.691954193767339f, - -0.6918596859303228f, - -0.691765166238479f, - -0.6916706346934246f, - -0.6915760912967814f, - -0.6914815360501682f, - -0.6913869689552069f, - -0.6912923900135154f, - -0.6911977992267162f, - -0.6911031965964294f, - -0.6910085821242755f, - -0.6909139558118768f, - -0.6908193176608541f, - -0.690724667672829f, - -0.6906300058494228f, - -0.6905353321922586f, - -0.690440646702958f, - -0.6903459493831435f, - -0.6902512402344371f, - -0.6901565192584627f, - -0.6900617864568428f, - -0.6899670418312007f, - -0.689872285383159f, - -0.6897775171143428f, - -0.6896827370263752f, - -0.6895879451208802f, - -0.6894931413994814f, - -0.6893983258638046f, - -0.6893034985154736f, - -0.6892086593561134f, - -0.6891138083873485f, - -0.6890189456108052f, - -0.6889240710281078f, - -0.6888291846408838f, - -0.6887342864507566f, - -0.6886393764593541f, - -0.6885444546683013f, - -0.6884495210792266f, - -0.688354575693754f, - -0.6882596185135124f, - -0.6881646495401275f, - -0.6880696687752286f, - -0.6879746762204404f, - -0.6878796718773927f, - -0.6877846557477121f, - -0.6876896278330278f, - -0.6875945881349674f, - -0.6874995366551597f, - -0.6874044733952325f, - -0.6873093983568159f, - -0.6872143115415384f, - -0.6871192129510295f, - -0.6870241025869178f, - -0.6869289804508343f, - -0.6868338465444084f, - -0.68673870086927f, - -0.6866435434270496f, - -0.6865483742193769f, - -0.6864531932478839f, - -0.6863580005142008f, - -0.686262796019959f, - -0.6861675797667888f, - -0.6860723517563232f, - -0.6859771119901932f, - -0.6858818604700306f, - -0.685786597197467f, - -0.6856913221741361f, - -0.6855960354016696f, - -0.6855007368817002f, - -0.6854054266158602f, - -0.6853101046057842f, - -0.6852147708531039f, - -0.685119425359455f, - -0.6850240681264685f, - -0.6849286991557804f, - -0.6848333184490233f, - -0.6847379260078336f, - -0.6846425218338432f, - -0.684547105928689f, - -0.6844516782940042f, - -0.6843562389314256f, - -0.6842607878425877f, - -0.6841653250291261f, - -0.6840698504926758f, - -0.683974364234874f, - -0.6838788662573564f, - -0.683783356561759f, - -0.683687835149718f, - -0.6835923020228714f, - -0.6834967571828552f, - -0.6834012006313067f, - -0.6833056323698627f, - -0.683210052400162f, - -0.6831144607238415f, - -0.6830188573425393f, - -0.6829232422578929f, - -0.6828276154715418f, - -0.6827319769851241f, - -0.6826363268002784f, - -0.682540664918643f, - -0.6824449913418583f, - -0.6823493060715631f, - -0.6822536091093968f, - -0.6821579004569986f, - -0.6820621801160098f, - -0.6819664480880698f, - -0.6818707043748183f, - -0.6817749489778978f, - -0.6816791818989464f, - -0.6815834031396071f, - -0.6814876127015196f, - -0.6813918105863273f, - -0.681295996795669f, - -0.6812001713311886f, - -0.6811043341945267f, - -0.6810084853873273f, - -0.6809126249112302f, - -0.6808167527678798f, - -0.6807208689589177f, - -0.680624973485988f, - -0.6805290663507333f, - -0.6804331475547969f, - -0.6803372170998218f, - -0.6802412749874528f, - -0.6801453212193334f, - -0.6800493557971076f, - -0.6799533787224191f, - -0.6798573899969139f, - -0.679761389622236f, - -0.6796653776000303f, - -0.6795693539319414f, - -0.6794733186196158f, - -0.6793772716646977f, - -0.679281213068835f, - -0.679185142833671f, - -0.6790890609608536f, - -0.6789929674520288f, - -0.6788968623088427f, - -0.6788007455329417f, - -0.678704617125974f, - -0.678608477089586f, - -0.6785123254254245f, - -0.6784161621351382f, - -0.6783199872203742f, - -0.6782238006827807f, - -0.6781276025240047f, - -0.6780313927456961f, - -0.6779351713495029f, - -0.6778389383370736f, - -0.6777426937100566f, - -0.6776464374701023f, - -0.6775501696188594f, - -0.6774538901579773f, - -0.6773575990891052f, - -0.6772612964138943f, - -0.6771649821339941f, - -0.6770686562510548f, - -0.6769723187667264f, - -0.6768759696826608f, - -0.6767796090005084f, - -0.6766832367219202f, - -0.6765868528485469f, - -0.6764904573820413f, - -0.6763940503240545f, - -0.6762976316762384f, - -0.6762012014402444f, - -0.6761047596177262f, - -0.6760083062103348f, - -0.6759118412197251f, - -0.6758153646475474f, - -0.6757188764954566f, - -0.6756223767651047f, - -0.6755258654581473f, - -0.6754293425762352f, - -0.6753328081210246f, - -0.6752362620941681f, - -0.675139704497322f, - -0.6750431353321381f, - -0.6749465546002732f, - -0.6748499623033807f, - -0.6747533584431171f, - -0.674656743021137f, - -0.6745601160390958f, - -0.6744634774986487f, - -0.6743668274014527f, - -0.6742701657491633f, - -0.6741734925434368f, - -0.6740768077859296f, - -0.6739801114782978f, - -0.6738834036221996f, - -0.6737866842192912f, - -0.67368995327123f, - -0.6735932107796729f, - -0.6734964567462787f, - -0.6733996911727047f, - -0.6733029140606089f, - -0.6732061254116489f, - -0.6731093252274846f, - -0.6730125135097736f, - -0.6729156902601753f, - -0.6728188554803476f, - -0.6727220091719512f, - -0.6726251513366444f, - -0.6725282819760886f, - -0.6724314010919411f, - -0.6723345086858639f, - -0.6722376047595157f, - -0.6721406893145592f, - -0.6720437623526522f, - -0.6719468238754576f, - -0.671849873884635f, - -0.6717529123818478f, - -0.6716559393687545f, - -0.6715589548470187f, - -0.6714619588183011f, - -0.6713649512842648f, - -0.6712679322465714f, - -0.6711709017068835f, - -0.6710738596668628f, - -0.6709768061281735f, - -0.6708797410924778f, - -0.670782664561439f, - -0.6706855765367199f, - -0.6705884770199853f, - -0.6704913660128982f, - -0.6703942435171227f, - -0.6702971095343223f, - -0.6701999640661628f, - -0.6701028071143078f, - -0.6700056386804224f, - -0.6699084587661706f, - -0.669811267373219f, - -0.6697140645032325f, - -0.6696168501578762f, - -0.6695196243388162f, - -0.6694223870477176f, - -0.6693251382862478f, - -0.6692278780560728f, - -0.6691306063588588f, - -0.669033323196272f, - -0.6689360285699806f, - -0.6688387224816504f, - -0.6687414049329508f, - -0.6686440759255464f, - -0.6685467354611072f, - -0.6684493835412996f, - -0.6683520201677937f, - -0.6682546453422552f, - -0.6681572590663545f, - -0.6680598613417591f, - -0.667962452170139f, - -0.6678650315531629f, - -0.6677675994924999f, - -0.6676701559898187f, - -0.6675727010467905f, - -0.6674752346650844f, - -0.6673777568463705f, - -0.6672802675923183f, - -0.6671827669045998f, - -0.6670852547848847f, - -0.666987731234844f, - -0.6668901962561481f, - -0.6667926498504695f, - -0.6666950920194783f, - -0.6665975227648482f, - -0.6664999420882483f, - -0.6664023499913525f, - -0.6663047464758325f, - -0.6662071315433608f, - -0.6661095051956092f, - -0.6660118674342518f, - -0.665914218260961f, - -0.6658165576774099f, - -0.6657188856852714f, - -0.6656212022862202f, - -0.6655235074819297f, - -0.6654258012740728f, - -0.6653280836643254f, - -0.665230354654361f, - -0.6651326142458542f, - -0.665034862440479f, - -0.6649370992399126f, - -0.6648393246458272f, - -0.6647415386599003f, - -0.664643741283806f, - -0.664545932519222f, - -0.6644481123678219f, - -0.6643502808312833f, - -0.6642524379112816f, - -0.6641545836094945f, - -0.664056717927598f, - -0.6639588408672691f, - -0.6638609524301841f, - -0.6637630526180217f, - -0.6636651414324588f, - -0.6635672188751729f, - -0.6634692849478413f, - -0.6633713396521435f, - -0.6632733829897564f, - -0.6631754149623602f, - -0.6630774355716312f, - -0.6629794448192502f, - -0.6628814427068948f, - -0.6627834292362463f, - -0.6626854044089815f, - -0.662587368226782f, - -0.6624893206913263f, - -0.6623912618042963f, - -0.6622931915673697f, - -0.6621951099822289f, - -0.662097017050553f, - -0.6619989127740243f, - -0.6619007971543232f, - -0.6618026701931307f, - -0.6617045318921282f, - -0.6616063822529966f, - -0.6615082212774192f, - -0.661410048967077f, - -0.6613118653236523f, - -0.6612136703488268f, - -0.6611154640442845f, - -0.6610172464117071f, - -0.6609190174527779f, - -0.6608207771691792f, - -0.6607225255625957f, - -0.6606242626347102f, - -0.6605259883872064f, - -0.6604277028217677f, - -0.6603294059400793f, - -0.6602310977438249f, - -0.6601327782346891f, - -0.6600344474143558f, - -0.6599361052845112f, - -0.6598377518468397f, - -0.6597393871030266f, - -0.6596410110547567f, - -0.659542623703717f, - -0.6594442250515918f, - -0.6593458151000694f, - -0.6592473938508333f, - -0.6591489613055718f, - -0.6590505174659702f, - -0.6589520623337175f, - -0.6588535959104979f, - -0.6587551181980005f, - -0.6586566291979115f, - -0.6585581289119204f, - -0.6584596173417124f, - -0.6583610944889774f, - -0.6582625603554022f, - -0.6581640149426766f, - -0.6580654582524883f, - -0.6579668902865263f, - -0.6578683110464787f, - -0.6577697205340359f, - -0.6576711187508867f, - -0.6575725056987205f, - -0.6574738813792265f, - -0.6573752457940958f, - -0.6572765989450178f, - -0.6571779408336829f, - -0.6570792714617815f, - -0.6569805908310037f, - -0.6568818989430415f, - -0.6567831957995856f, - -0.6566844814023269f, - -0.6565857557529565f, - -0.6564870188531672f, - -0.6563882707046501f, - -0.6562895113090974f, - -0.6561907406682005f, - -0.6560919587836532f, - -0.6559931656571468f, - -0.6558943612903761f, - -0.6557955456850314f, - -0.6556967188428078f, - -0.6555978807653974f, - -0.6554990314544958f, - -0.655400170911794f, - -0.655301299138988f, - -0.6552024161377707f, - -0.6551035219098383f, - -0.6550046164568827f, - -0.6549056997806006f, - -0.6548067718826857f, - -0.6547078327648341f, - -0.6546088824287408f, - -0.6545099208761012f, - -0.6544109481086102f, - -0.6543119641279651f, - -0.6542129689358612f, - -0.6541139625339949f, - -0.6540149449240619f, - -0.6539159161077601f, - -0.6538168760867858f, - -0.653717824862836f, - -0.6536187624376072f, - -0.6535196888127981f, - -0.6534206039901057f, - -0.6533215079712278f, - -0.6532224007578616f, - -0.6531232823517068f, - -0.653024152754461f, - -0.6529250119678228f, - -0.6528258599934902f, - -0.6527266968331635f, - -0.6526275224885413f, - -0.6525283369613221f, - -0.6524291402532068f, - -0.6523299323658943f, - -0.6522307133010848f, - -0.6521314830604775f, - -0.6520322416457748f, - -0.6519329890586745f, - -0.6518337253008791f, - -0.6517344503740883f, - -0.6516351642800051f, - -0.6515358670203282f, - -0.6514365585967608f, - -0.6513372390110033f, - -0.6512379082647588f, - -0.6511385663597287f, - -0.6510392132976152f, - -0.6509398490801199f, - -0.6508404737089469f, - -0.6507410871857983f, - -0.6506416895123769f, - -0.6505422806903852f, - -0.650442860721528f, - -0.6503434296075081f, - -0.6502439873500293f, - -0.6501445339507946f, - -0.6500450694115099f, - -0.6499455937338776f, - -0.6498461069196046f, - -0.6497466089703928f, - -0.6496470998879491f, - -0.6495475796739771f, - -0.6494480483301841f, - -0.6493485058582731f, - -0.6492489522599514f, - -0.6491493875369236f, - -0.6490498116908978f, - -0.6489502247235776f, - -0.6488506266366711f, - -0.6487510174318846f, - -0.6486513971109239f, - -0.6485517656754974f, - -0.6484521231273117f, - -0.648352469468074f, - -0.6482528046994912f, - -0.6481531288232725f, - -0.6480534418411249f, - -0.6479537437547568f, - -0.6478540345658755f, - -0.6477543142761912f, - -0.6476545828874116f, - -0.6475548404012458f, - -0.647455086819402f, - -0.6473553221435909f, - -0.6472555463755212f, - -0.6471557595169026f, - -0.6470559615694443f, - -0.6469561525348575f, - -0.6468563324148519f, - -0.6467565012111377f, - -0.6466566589254249f, - -0.6465568055594257f, - -0.6464569411148496f, - -0.6463570655934098f, - -0.646257178996815f, - -0.6461572813267786f, - -0.6460573725850112f, - -0.6459574527732266f, - -0.6458575218931342f, - -0.6457575799464482f, - -0.6456576269348799f, - -0.645557662860144f, - -0.6454576877239506f, - -0.6453577015280147f, - -0.6452577042740484f, - -0.6451576959637663f, - -0.6450576765988814f, - -0.6449576461811073f, - -0.6448576047121577f, - -0.6447575521937478f, - -0.6446574886275914f, - -0.6445574140154032f, - -0.6444573283588972f, - -0.6443572316597896f, - -0.644257123919795f, - -0.6441570051406285f, - -0.6440568753240058f, - -0.6439567344716418f, - -0.6438565825852539f, - -0.6437564196665574f, - -0.6436562457172685f, - -0.6435560607391031f, - -0.6434558647337791f, - -0.6433556577030127f, - -0.643255439648521f, - -0.6431552105720204f, - -0.6430549704752296f, - -0.6429547193598657f, - -0.6428544572276464f, - -0.642754184080289f, - -0.6426538999195129f, - -0.6425536047470352f, - -0.6424532985645764f, - -0.6423529813738527f, - -0.6422526531765846f, - -0.6421523139744904f, - -0.642051963769291f, - -0.6419516025627032f, - -0.641851230356449f, - -0.6417508471522466f, - -0.6416504529518174f, - -0.6415500477568812f, - -0.6414496315691582f, - -0.6413492043903684f, - -0.6412487662222338f, - -0.641148317066475f, - -0.6410478569248129f, - -0.6409473857989683f, - -0.6408469036906641f, - -0.6407464106016213f, - -0.6406459065335619f, - -0.6405453914882073f, - -0.6404448654672811f, - -0.6403443284725052f, - -0.6402437805056022f, - -0.6401432215682943f, - -0.6400426516623059f, - -0.6399420707893596f, - -0.6398414789511788f, - -0.6397408761494865f, - -0.6396402623860078f, - -0.6395396376624659f, - -0.6394390019805852f, - -0.6393383553420899f, - -0.639237697748704f, - -0.6391370292021534f, - -0.6390363497041619f, - -0.6389356592564565f, - -0.6388349578607598f, - -0.6387342455187994f, - -0.6386335222322996f, - -0.6385327880029883f, - -0.6384320428325888f, - -0.6383312867228295f, - -0.6382305196754352f, - -0.6381297416921348f, - -0.6380289527746523f, - -0.6379281529247168f, - -0.637827342144054f, - -0.6377265204343928f, - -0.6376256877974599f, - -0.6375248442349831f, - -0.6374239897486896f, - -0.637323124340309f, - -0.6372222480115688f, - -0.6371213607641976f, - -0.6370204625999232f, - -0.636919553520476f, - -0.6368186335275836f, - -0.6367177026229774f, - -0.636616760808384f, - -0.6365158080855351f, - -0.6364148444561591f, - -0.636313869921988f, - -0.6362128844847493f, - -0.6361118881461755f, - -0.6360108809079962f, - -0.6359098627719423f, - -0.6358088337397441f, - -0.6357077938131339f, - -0.6356067429938425f, - -0.6355056812836004f, - -0.635404608684141f, - -0.6353035251971952f, - -0.6352024308244951f, - -0.6351013255677724f, - -0.6350002094287607f, - -0.6348990824091919f, - -0.634797944510799f, - -0.634696795735314f, - -0.6345956360844722f, - -0.6344944655600043f, - -0.6343932841636459f, - -0.6342920918971293f, - -0.6341908887621897f, - -0.6340896747605606f, - -0.6339884498939761f, - -0.6338872141641702f, - -0.6337859675728788f, - -0.633684710121836f, - -0.633583441812777f, - -0.6334821626474362f, - -0.6333808726275503f, - -0.6332795717548543f, - -0.6331782600310839f, - -0.6330769374579744f, - -0.6329756040372634f, - -0.6328742597706857f, - -0.6327729046599798f, - -0.6326715387068799f, - -0.6325701619131247f, - -0.63246877428045f, - -0.6323673758105951f, - -0.6322659665052947f, - -0.6321645463662884f, - -0.6320631153953127f, - -0.6319616735941077f, - -0.6318602209644089f, - -0.6317587575079564f, - -0.6316572832264876f, - -0.6315557981217427f, - -0.6314543021954597f, - -0.631352795449378f, - -0.6312512778852366f, - -0.6311497495047744f, - -0.6310482103097325f, - -0.63094666030185f, - -0.6308450994828668f, - -0.6307435278545227f, - -0.6306419454185593f, - -0.6305403521767166f, - -0.6304387481307352f, - -0.6303371332823555f, - -0.63023550763332f, - -0.6301338711853695f, - -0.6300322239402452f, - -0.6299305658996883f, - -0.629828897065442f, - -0.6297272174392478f, - -0.6296255270228477f, - -0.6295238258179837f, - -0.6294221138263997f, - -0.6293203910498372f, - -0.6292186574900411f, - -0.629116913148752f, - -0.6290151580277151f, - -0.6289133921286728f, - -0.6288116154533708f, - -0.6287098280035504f, - -0.6286080297809575f, - -0.6285062207873352f, - -0.62840440102443f, - -0.6283025704939836f, - -0.6282007291977433f, - -0.6280988771374525f, - -0.6279970143148578f, - -0.6278951407317038f, - -0.6277932563897364f, - -0.6276913612907002f, - -0.627589455436343f, - -0.62748753882841f, - -0.6273856114686476f, - -0.6272836733588014f, - -0.6271817245006197f, - -0.6270797648958486f, - -0.6269777945462351f, - -0.6268758134535258f, - -0.6267738216194696f, - -0.6266718190458131f, - -0.6265698057343044f, - -0.6264677816866907f, - -0.6263657469047215f, - -0.6262637013901443f, - -0.6261616451447078f, - -0.6260595781701608f, - -0.6259575004682514f, - -0.6258554120407299f, - -0.6257533128893443f, - -0.6256512030158462f, - -0.6255490824219824f, - -0.6254469511095047f, - -0.6253448090801618f, - -0.6252426563357059f, - -0.6251404928778845f, - -0.6250383187084505f, - -0.624936133829153f, - -0.6248339382417452f, - -0.6247317319479752f, - -0.6246295149495964f, - -0.6245272872483589f, - -0.6244250488460158f, - -0.6243227997443183f, - -0.6242205399450181f, - -0.6241182694498669f, - -0.6240159882606185f, - -0.6239136963790248f, - -0.6238113938068385f, - -0.6237090805458118f, - -0.623606756597699f, - -0.623504421964253f, - -0.6234020766472274f, - -0.6232997206483747f, - -0.6231973539694504f, - -0.6230949766122071f, - -0.6229925885784011f, - -0.6228901898697841f, - -0.6227877804881126f, - -0.6226853604351408f, - -0.6225829297126235f, - -0.6224804883223153f, - -0.6223780362659727f, - -0.6222755735453506f, - -0.6221731001622047f, - -0.6220706161182901f, - -0.6219681214153643f, - -0.6218656160551826f, - -0.6217631000395011f, - -0.6216605733700774f, - -0.6215580360486678f, - -0.6214554880770291f, - -0.6213529294569179f, - -0.6212503601900935f, - -0.6211477802783106f, - -0.621045189723329f, - -0.6209425885269051f, - -0.6208399766907992f, - -0.6207373542167666f, - -0.6206347211065677f, - -0.62053207736196f, - -0.6204294229847034f, - -0.6203267579765563f, - -0.6202240823392777f, - -0.6201213960746265f, - -0.6200186991843633f, - -0.6199159916702471f, - -0.619813273534038f, - -0.6197105447774951f, - -0.6196078054023803f, - -0.6195050554104523f, - -0.619402294803474f, - -0.6192995235832033f, - -0.6191967417514033f, - -0.6190939493098336f, - -0.6189911462602579f, - -0.6188883326044347f, - -0.6187855083441277f, - -0.6186826734810975f, - -0.6185798280171084f, - -0.6184769719539196f, - -0.6183741052932956f, - -0.6182712280369976f, - -0.61816834018679f, - -0.6180654417444349f, - -0.6179625327116953f, - -0.6178596130903348f, - -0.6177566828821159f, - -0.617653742088804f, - -0.617550790712162f, - -0.617447828753954f, - -0.6173448562159436f, - -0.6172418730998966f, - -0.6171388794075768f, - -0.6170358751407491f, - -0.6169328603011777f, - -0.616829834890629f, - -0.6167267989108678f, - -0.6166237523636595f, - -0.6165206952507691f, - -0.6164176275739639f, - -0.6163145493350091f, - -0.616211460535671f, - -0.6161083611777153f, - -0.6160052512629101f, - -0.6159021307930211f, - -0.6157989997698157f, - -0.61569585819506f, - -0.6155927060705229f, - -0.6154895433979702f, - -0.6153863701791721f, - -0.6152831864158933f, - -0.6151799921099039f, - -0.615076787262971f, - -0.6149735718768649f, - -0.6148703459533513f, - -0.6147671094942012f, - -0.6146638625011821f, - -0.6145606049760644f, - -0.6144573369206168f, - -0.6143540583366087f, - -0.6142507692258091f, - -0.6141474695899892f, - -0.6140441594309184f, - -0.6139408387503668f, - -0.613837507550104f, - -0.6137341658319022f, - -0.6136308135975311f, - -0.6135274508487619f, - -0.6134240775873648f, - -0.6133206938151127f, - -0.6132172995337761f, - -0.6131138947451268f, - -0.6130104794509365f, - -0.6129070536529765f, - -0.6128036173530205f, - -0.6127001705528401f, - -0.6125967132542077f, - -0.6124932454588955f, - -0.6123897671686777f, - -0.6122862783853267f, - -0.6121827791106156f, - -0.6120792693463174f, - -0.6119757490942069f, - -0.6118722183560567f, - -0.6117686771336427f, - -0.6116651254287362f, - -0.6115615632431138f, - -0.6114579905785485f, - -0.6113544074368171f, - -0.6112508138196918f, - -0.6111472097289495f, - -0.6110435951663643f, - -0.6109399701337135f, - -0.61083633463277f, - -0.6107326886653116f, - -0.6106290322331129f, - -0.6105253653379514f, - -0.6104216879816027f, - -0.6103180001658433f, - -0.6102143018924492f, - -0.6101105931631985f, - -0.6100068739798676f, - -0.6099031443442338f, - -0.6097994042580737f, - -0.6096956537231661f, - -0.6095918927412883f, - -0.6094881213142181f, - -0.6093843394437329f, - -0.6092805471316125f, - -0.6091767443796343f, - -0.6090729311895774f, - -0.6089691075632195f, - -0.6088652735023412f, - -0.608761429008721f, - -0.608657574084138f, - -0.6085537087303714f, - -0.608449832949202f, - -0.6083459467424092f, - -0.6082420501117721f, - -0.6081381430590732f, - -0.6080342255860902f, - -0.6079302976946057f, - -0.6078263593863991f, - -0.6077224106632535f, - -0.607618451526947f, - -0.6075144819792634f, - -0.6074105020219824f, - -0.607306511656888f, - -0.6072025108857593f, - -0.6070984997103802f, - -0.6069944781325316f, - -0.6068904461539973f, - -0.6067864037765593f, - -0.6066823510020001f, - -0.606578287832102f, - -0.6064742142686496f, - -0.6063701303134253f, - -0.6062660359682127f, - -0.6061619312347947f, - -0.6060578161149563f, - -0.6059536906104811f, - -0.605849554723153f, - -0.6057454084547559f, - -0.6056412518070755f, - -0.6055370847818952f, - -0.6054329073810019f, - -0.605328719606178f, - -0.6052245214592106f, - -0.6051203129418838f, - -0.6050160940559854f, - -0.6049118648032983f, - -0.6048076251856105f, - -0.6047033752047074f, - -0.6045991148623754f, - -0.6044948441604002f, - -0.6043905631005698f, - -0.6042862716846704f, - -0.6041819699144884f, - -0.6040776577918121f, - -0.6039733353184285f, - -0.6038690024961249f, - -0.6037646593266882f, - -0.6036603058119081f, - -0.6035559419535717f, - -0.6034515677534673f, - -0.6033471832133825f, - -0.6032427883351076f, - -0.6031383831204303f, - -0.6030339675711399f, - -0.6029295416890247f, - -0.6028251054758753f, - -0.6027206589334806f, - -0.6026162020636302f, - -0.6025117348681134f, - -0.6024072573487214f, - -0.6023027695072438f, - -0.602198271345471f, - -0.6020937628651928f, - -0.6019892440682013f, - -0.601884714956286f, - -0.6017801755312403f, - -0.6016756257948523f, - -0.6015710657489158f, - -0.6014664953952208f, - -0.6013619147355614f, - -0.6012573237717266f, - -0.6011527225055108f, - -0.6010481109387047f, - -0.6009434890731029f, - -0.6008388569104955f, - -0.6007342144526774f, - -0.60062956170144f, - -0.600524898658578f, - -0.6004202253258841f, - -0.600315541705152f, - -0.6002108477981745f, - -0.6001061436067469f, - -0.6000014291326627f, - -0.5998967043777161f, - -0.5997919693437016f, - -0.5996872240324129f, - -0.5995824684456464f, - -0.5994777025851964f, - -0.5993729264528579f, - -0.5992681400504254f, - -0.599163343379696f, - -0.5990585364424645f, - -0.598953719240527f, - -0.5988488917756785f, - -0.5987440540497168f, - -0.5986392060644374f, - -0.598534347821637f, - -0.5984294793231115f, - -0.5983246005706593f, - -0.598219711566076f, - -0.5981148123111609f, - -0.5980099028077087f, - -0.5979049830575192f, - -0.5978000530623885f, - -0.5976951128241168f, - -0.5975901623444995f, - -0.5974852016253368f, - -0.5973802306684259f, - -0.5972752494755676f, - -0.597170258048558f, - -0.5970652563891978f, - -0.5969602444992852f, - -0.5968552223806207f, - -0.5967501900350033f, - -0.5966451474642326f, - -0.5965400946701077f, - -0.5964350316544302f, - -0.5963299584189996f, - -0.5962248749656162f, - -0.5961197812960799f, - -0.596014677412193f, - -0.5959095633157556f, - -0.5958044390085688f, - -0.5956993044924332f, - -0.5955941597691516f, - -0.5954890048405251f, - -0.5953838397083554f, - -0.5952786643744437f, - -0.5951734788405935f, - -0.5950682831086066f, - -0.5949630771802855f, - -0.594857861057432f, - -0.5947526347418506f, - -0.5946473982353434f, - -0.5945421515397137f, - -0.5944368946567649f, - -0.5943316275882996f, - -0.5942263503361234f, - -0.5941210629020384f, - -0.5940157652878508f, - -0.5939104574953622f, - -0.5938051395263791f, - -0.5936998113827047f, - -0.5935944730661458f, - -0.5934891245785046f, - -0.5933837659215881f, - -0.5932783970972005f, - -0.5931730181071494f, - -0.5930676289532373f, - -0.5929622296372724f, - -0.5928568201610591f, - -0.5927514005264051f, - -0.592645970735116f, - -0.5925405307889983f, - -0.592435080689858f, - -0.5923296204395033f, - -0.5922241500397406f, - -0.5921186694923771f, - -0.5920131787992194f, - -0.5919076779620767f, - -0.5918021669827549f, - -0.5916966458630645f, - -0.5915911146048103f, - -0.591485573209803f, - -0.5913800216798495f, - -0.5912744600167604f, - -0.5911688882223419f, - -0.5910633062984049f, - -0.5909577142467577f, - -0.5908521120692098f, - -0.5907464997675699f, - -0.590640877343649f, - -0.5905352447992562f, - -0.5904296021362009f, - -0.5903239493562946f, - -0.5902182864613468f, - -0.5901126134531682f, - -0.5900069303335687f, - -0.5899012371043605f, - -0.5897955337673539f, - -0.5896898203243603f, - -0.5895840967771901f, - -0.5894783631276573f, - -0.5893726193775705f, - -0.5892668655287437f, - -0.5891611015829877f, - -0.5890553275421162f, - -0.5889495434079407f, - -0.5888437491822739f, - -0.5887379448669279f, - -0.5886321304637169f, - -0.5885263059744533f, - -0.5884204714009506f, - -0.5883146267450213f, - -0.5882087720084805f, - -0.5881029071931414f, - -0.5879970323008178f, - -0.5878911473333231f, - -0.5877852522924734f, - -0.5876793471800812f, - -0.5875734319979637f, - -0.5874675067479328f, - -0.5873615714318056f, - -0.5872556260513957f, - -0.5871496706085209f, - -0.5870437051049935f, - -0.5869377295426317f, - -0.5868317439232497f, - -0.586725748248665f, - -0.5866197425206932f, - -0.5865137267411504f, - -0.5864077009118528f, - -0.5863016650346183f, - -0.5861956191112632f, - -0.5860895631436045f, - -0.5859834971334595f, - -0.585877421082645f, - -0.5857713349929797f, - -0.585665238866281f, - -0.5855591327043664f, - -0.5854530165090538f, - -0.5853468902821625f, - -0.5852407540255105f, - -0.5851346077409161f, - -0.5850284514301977f, - -0.5849222850951755f, - -0.584816108737668f, - -0.5847099223594945f, - -0.5846037259624737f, - -0.5844975195484267f, - -0.5843913031191725f, - -0.5842850766765313f, - -0.5841788402223225f, - -0.5840725937583677f, - -0.5839663372864862f, - -0.5838600708085007f, - -0.5837537943262291f, - -0.5836475078414948f, - -0.5835412113561173f, - -0.5834349048719202f, - -0.5833285883907222f, - -0.5832222619143472f, - -0.5831159254446157f, - -0.5830095789833516f, - -0.5829032225323745f, - -0.5827968560935088f, - -0.5826904796685758f, - -0.5825840932593995f, - -0.5824776968678023f, - -0.582371290495607f, - -0.5822648741446363f, - -0.582158447816715f, - -0.5820520115136659f, - -0.581945565237313f, - -0.5818391089894792f, - -0.5817326427719902f, - -0.5816261665866695f, - -0.5815196804353416f, - -0.5814131843198305f, - -0.5813066782419621f, - -0.5812001622035609f, - -0.5810936362064518f, - -0.5809871002524604f, - -0.5808805543434112f, - -0.5807739984811314f, - -0.580667432667446f, - -0.580560856904181f, - -0.5804542711931618f, - -0.5803476755362164f, - -0.5802410699351694f, - -0.5801344543918501f, - -0.580027828908082f, - -0.5799211934856946f, - -0.5798145481265135f, - -0.5797078928323681f, - -0.5796012276050833f, - -0.5794945524464886f, - -0.5793878673584106f, - -0.5792811723426795f, - -0.5791744674011207f, - -0.5790677525355644f, - -0.578961027747838f, - -0.5788542930397714f, - -0.578747548413193f, - -0.5786407938699316f, - -0.5785340294118159f, - -0.5784272550406766f, - -0.5783204707583426f, - -0.5782136765666435f, - -0.5781068724674086f, - -0.5780000584624693f, - -0.577893234553655f, - -0.5777864007427965f, - -0.5776795570317232f, - -0.5775727034222677f, - -0.5774658399162599f, - -0.5773589665155309f, - -0.5772520832219111f, - -0.5771451900372337f, - -0.5770382869633295f, - -0.57693137400203f, - -0.5768244511551666f, - -0.5767175184245726f, - -0.57661057581208f, - -0.5765036233195209f, - -0.5763966609487271f, - -0.5762896887015331f, - -0.5761827065797709f, - -0.576075714585273f, - -0.5759687127198747f, - -0.5758617009854068f, - -0.575754679383705f, - -0.5756476479166014f, - -0.5755406065859324f, - -0.5754335553935293f, - -0.5753264943412282f, - -0.5752194234308624f, - -0.5751123426642679f, - -0.5750052520432788f, - -0.57489815156973f, - -0.5747910412454561f, - -0.5746839210722936f, - -0.5745767910520774f, - -0.5744696511866431f, - -0.5743625014778259f, - -0.574255341927463f, - -0.57414817253739f, - -0.5740409933094431f, - -0.5739338042454583f, - -0.5738266053472735f, - -0.573719396616724f, - -0.5736121780556492f, - -0.5735049496658832f, - -0.5733977114492655f, - -0.5732904634076323f, - -0.5731832055428233f, - -0.5730759378566735f, - -0.572968660351023f, - -0.5728613730277087f, - -0.5727540758885709f, - -0.5726467689354453f, - -0.5725394521701727f, - -0.5724321255945913f, - -0.5723247892105393f, - -0.5722174430198574f, - -0.5721100870243844f, - -0.5720027212259594f, - -0.5718953456264216f, - -0.5717879602276124f, - -0.5716805650313709f, - -0.5715731600395373f, - -0.5714657452539513f, - -0.571358320676455f, - -0.5712508863088882f, - -0.5711434421530918f, - -0.571035988210906f, - -0.5709285244841735f, - -0.5708210509747351f, - -0.5707135676844322f, - -0.5706060746151057f, - -0.5704985717685991f, - -0.5703910591467536f, - -0.5702835367514113f, - -0.570176004584414f, - -0.5700684626476056f, - -0.5699609109428273f, - -0.5698533494719243f, - -0.5697457782367367f, - -0.5696381972391098f, - -0.5695306064808856f, - -0.5694230059639097f, - -0.569315395690023f, - -0.5692077756610716f, - -0.5691001458788979f, - -0.5689925063453485f, - -0.5688848570622648f, - -0.5687771980314934f, - -0.5686695292548776f, - -0.5685618507342639f, - -0.5684541624714964f, - -0.5683464644684204f, - -0.5682387567268806f, - -0.568131039248724f, - -0.5680233120357955f, - -0.567915575089941f, - -0.5678078284130057f, - -0.5677000720068375f, - -0.5675923058732819f, - -0.5674845300141855f, - -0.5673767444313942f, - -0.5672689491267565f, - -0.5671611441021186f, - -0.5670533293593276f, - -0.5669455049002311f, - -0.5668376707266758f, - -0.5667298268405109f, - -0.5666219732435835f, - -0.5665141099377417f, - -0.5664062369248329f, - -0.566298354206707f, - -0.5661904617852118f, - -0.566082559662196f, - -0.5659746478395077f, - -0.5658667263189975f, - -0.565758795102513f, - -0.565650854191906f, - -0.5655429035890228f, - -0.5654349432957156f, - -0.5653269733138326f, - -0.5652189936452262f, - -0.5651110042917434f, - -0.5650030052552372f, - -0.5648949965375563f, - -0.5647869781405536f, - -0.5646789500660773f, - -0.5645709123159803f, - -0.5644628648921126f, - -0.5643548077963271f, - -0.5642467410304742f, - -0.5641386645964059f, - -0.5640305784959734f, - -0.5639224827310299f, - -0.563814377303427f, - -0.5637062622150171f, - -0.563598137467652f, - -0.5634900030631858f, - -0.5633818590034706f, - -0.5632737052903594f, - -0.5631655419257048f, - -0.5630573689113615f, - -0.5629491862491822f, - -0.5628409939410207f, - -0.5627327919887302f, - -0.5626245803941661f, - -0.5625163591591816f, - -0.5624081282856315f, - -0.5622998877753692f, - -0.5621916376302509f, - -0.5620833778521309f, - -0.5619751084428634f, - -0.5618668294043055f, - -0.56175854073831f, - -0.5616502424467342f, - -0.5615419345314326f, - -0.5614336169942632f, - -0.561325289837079f, - -0.5612169530617382f, - -0.5611086066700959f, - -0.5610002506640106f, - -0.5608918850453362f, - -0.5607835098159315f, - -0.5606751249776522f, - -0.5605667305323568f, - -0.560458326481902f, - -0.5603499128281451f, - -0.5602414895729431f, - -0.5601330567181553f, - -0.5600246142656389f, - -0.559916162217252f, - -0.5598077005748522f, - -0.5596992293402995f, - -0.5595907485154517f, - -0.5594822581021675f, - -0.5593737581023053f, - -0.5592652485177255f, - -0.5591567293502862f, - -0.5590482006018487f, - -0.5589396622742699f, - -0.5588311143694118f, - -0.5587225568891327f, - -0.5586139898352951f, - -0.5585054132097562f, - -0.5583968270143786f, - -0.5582882312510223f, - -0.5581796259215474f, - -0.5580710110278159f, - -0.5579623865716885f, - -0.5578537525550262f, - -0.55774510897969f, - -0.5576364558475427f, - -0.5575277931604454f, - -0.55741912092026f, - -0.5573104391288478f, - -0.5572017477880725f, - -0.5570930468997959f, - -0.5569843364658803f, - -0.556875616488188f, - -0.556766886968583f, - -0.5566581479089279f, - -0.5565493993110858f, - -0.5564406411769194f, - -0.5563318735082937f, - -0.5562230963070716f, - -0.556114309575117f, - -0.5560055133142933f, - -0.555896707526466f, - -0.5557878922134988f, - -0.5556790673772563f, - -0.5555702330196022f, - -0.5554613891424031f, - -0.5553525357475224f, - -0.5552436728368275f, - -0.5551348004121809f, - -0.5550259184754501f, - -0.5549170270284994f, - -0.5548081260731969f, - -0.5546992156114054f, - -0.5545902956449936f, - -0.5544813661758262f, - -0.5543724272057718f, - -0.5542634787366941f, - -0.5541545207704622f, - -0.5540455533089417f, - -0.553936576354001f, - -0.5538275899075066f, - -0.5537185939713262f, - -0.5536095885473264f, - -0.5535005736373767f, - -0.5533915492433442f, - -0.553282515367097f, - -0.5531734720105034f, - -0.553064419175431f, - -0.55295535686375f, - -0.5528462850773284f, - -0.5527372038180349f, - -0.5526281130877381f, - -0.5525190128883086f, - -0.5524099032216151f, - -0.5523007840895271f, - -0.5521916554939137f, - -0.5520825174366462f, - -0.5519733699195939f, - -0.5518642129446271f, - -0.5517550465136152f, - -0.5516458706284305f, - -0.551536685290942f, - -0.551427490503023f, - -0.5513182862665413f, - -0.5512090725833706f, - -0.5510998494553806f, - -0.550990616884445f, - -0.5508813748724326f, - -0.5507721234212173f, - -0.5506628625326698f, - -0.5505535922086644f, - -0.5504443124510705f, - -0.5503350232617626f, - -0.5502257246426122f, - -0.5501164165954933f, - -0.5500070991222782f, - -0.5498977722248402f, - -0.5497884359050516f, - -0.5496790901647873f, - -0.5495697350059204f, - -0.5494603704303246f, - -0.549350996439873f, - -0.5492416130364413f, - -0.5491322202219028f, - -0.5490228179981321f, - -0.5489134063670031f, - -0.5488039853303919f, - -0.5486945548901726f, - -0.5485851150482204f, - -0.5484756658064097f, - -0.5483662071666173f, - -0.5482567391307183f, - -0.548147261700588f, - -0.5480377748781025f, - -0.547928278665137f, - -0.5478187730635694f, - -0.5477092580752749f, - -0.5475997337021304f, - -0.5474901999460116f, - -0.5473806568087969f, - -0.5472711042923617f, - -0.5471615423985856f, - -0.5470519711293427f, - -0.5469423904865128f, - -0.5468328004719721f, - -0.5467232010876006f, - -0.5466135923352733f, - -0.5465039742168705f, - -0.5463943467342689f, - -0.5462847098893486f, - -0.5461750636839874f, - -0.546065408120064f, - -0.5459557431994566f, - -0.5458460689240459f, - -0.5457363852957101f, - -0.5456266923163289f, - -0.545516989987781f, - -0.5454072783119475f, - -0.5452975572907076f, - -0.5451878269259415f, - -0.5450780872195284f, - -0.5449683381733504f, - -0.5448585797892864f, - -0.5447488120692193f, - -0.544639035015027f, - -0.5445292486285928f, - -0.5444194529117968f, - -0.5443096478665208f, - -0.5441998334946452f, - -0.5440900097980531f, - -0.5439801767786259f, - -0.5438703344382452f, - -0.5437604827787925f, - -0.5436506218021515f, - -0.5435407515102041f, - -0.543430871904832f, - -0.5433209829879195f, - -0.5432110847613487f, - -0.5431011772270027f, - -0.542991260386764f, - -0.5428813342425175f, - -0.542771398796146f, - -0.5426614540495333f, - -0.5425515000045624f, - -0.5424415366631196f, - -0.542331564027086f, - -0.5422215820983485f, - -0.5421115908787899f, - -0.5420015903702964f, - -0.541891580574752f, - -0.5417815614940418f, - -0.5416715331300502f, - -0.5415614954846639f, - -0.5414514485597678f, - -0.5413413923572472f, - -0.5412313268789876f, - -0.541121252126876f, - -0.541011168102798f, - -0.5409010748086398f, - -0.540790972246287f, - -0.5406808604176278f, - -0.5405707393245474f, - -0.5404606089689349f, - -0.5403504693526743f, - -0.5402403204776552f, - -0.5401301623457635f, - -0.5400199949588887f, - -0.5399098183189158f, - -0.5397996324277348f, - -0.5396894372872322f, - -0.5395792328992975f, - -0.5394690192658186f, - -0.5393587963886837f, - -0.5392485642697815f, - -0.5391383229110002f, - -0.53902807231423f, - -0.5389178124813595f, - -0.5388075434142778f, - -0.5386972651148737f, - -0.5385869775850383f, - -0.5384766808266606f, - -0.5383663748416303f, - -0.5382560596318369f, - -0.5381457351991721f, - -0.5380354015455255f, - -0.5379250586727876f, - -0.5378147065828486f, - -0.5377043452776005f, - -0.5375939747589337f, - -0.5374835950287393f, - -0.5373732060889082f, - -0.537262807941333f, - -0.5371524005879047f, - -0.5370419840305152f, - -0.5369315582710555f, - -0.5368211233114195f, - -0.5367106791534978f, - -0.5366002257991851f, - -0.536489763250371f, - -0.5363792915089505f, - -0.536268810576815f, - -0.5361583204558599f, - -0.5360478211479752f, - -0.5359373126550566f, - -0.5358267949789963f, - -0.5357162681216902f, - -0.5356057320850289f, - -0.5354951868709089f, - -0.5353846324812229f, - -0.5352740689178664f, - -0.5351634961827335f, - -0.5350529142777187f, - -0.5349423232047159f, - -0.5348317229656218f, - -0.5347211135623304f, - -0.5346104949967374f, - -0.5344998672707372f, - -0.5343892303862269f, - -0.5342785843451014f, - -0.5341679291492568f, - -0.5340572648005883f, - -0.5339465913009936f, - -0.5338359086523683f, - -0.5337252168566089f, - -0.5336145159156122f, - -0.5335038058312741f, - -0.5333930866054931f, - -0.5332823582401658f, - -0.5331716207371893f, - -0.5330608740984604f, - -0.5329501183258781f, - -0.5328393534213388f, - -0.5327285793867427f, - -0.5326177962239848f, - -0.5325070039349655f, - -0.5323962025215818f, - -0.5322853919857347f, - -0.5321745723293195f, - -0.5320637435542376f, - -0.5319529056623865f, - -0.5318420586556675f, - -0.531731202535977f, - -0.5316203373052169f, - -0.531509462965285f, - -0.5313985795180829f, - -0.5312876869655097f, - -0.5311767853094654f, - -0.5310658745518498f, - -0.5309549546945646f, - -0.5308440257395097f, - -0.5307330876885858f, - -0.530622140543693f, - -0.5305111843067342f, - -0.5304002189796093f, - -0.5302892445642201f, - -0.5301782610624671f, - -0.5300672684762536f, - -0.5299562668074808f, - -0.5298452560580504f, - -0.5297342362298639f, - -0.5296232073248253f, - -0.5295121693448359f, - -0.5294011222917987f, - -0.5292900661676155f, - -0.5291790009741908f, - -0.5290679267134268f, - -0.528956843387226f, - -0.5288457509974935f, - -0.5287346495461319f, - -0.5286235390350449f, - -0.5285124194661356f, - -0.5284012908413103f, - -0.5282901531624701f, - -0.5281790064315216f, - -0.5280678506503679f, - -0.5279566858209156f, - -0.5278455119450667f, - -0.5277343290247282f, - -0.5276231370618039f, - -0.5275119360582003f, - -0.5274007260158223f, - -0.5272895069365754f, - -0.5271782788223645f, - -0.5270670416750968f, - -0.5269557954966778f, - -0.5268445402890137f, - -0.5267332760540099f, - -0.5266220027935745f, - -0.5265107205096133f, - -0.5263994292040333f, - -0.5262881288787404f, - -0.5261768195356433f, - -0.526065501176648f, - -0.5259541738036638f, - -0.5258428374185955f, - -0.5257314920233529f, - -0.5256201376198425f, - -0.5255087742099747f, - -0.5253974017956543f, - -0.5252860203787922f, - -0.5251746299612954f, - -0.5250632305450745f, - -0.5249518221320356f, - -0.5248404047240899f, - -0.5247289783231456f, - -0.5246175429311112f, - -0.5245060985498977f, - -0.5243946451814139f, - -0.5242831828275696f, - -0.5241717114902738f, - -0.5240602311714381f, - -0.5239487418729718f, - -0.5238372435967855f, - -0.5237257363447887f, - -0.5236142201188938f, - -0.5235026949210105f, - -0.5233911607530501f, - -0.5232796176169228f, - -0.5231680655145413f, - -0.5230565044478164f, - -0.5229449344186596f, - -0.5228333554289819f, - -0.5227217674806965f, - -0.522610170575715f, - -0.5224985647159495f, - -0.5223869499033112f, - -0.5222753261397146f, - -0.5221636934270707f, - -0.5220520517672943f, - -0.5219404011622957f, - -0.52182874161399f, - -0.5217170731242889f, - -0.5216053956951084f, - -0.5214937093283588f, - -0.5213820140259562f, - -0.5212703097898128f, - -0.5211585966218449f, - -0.5210468745239639f, - -0.5209351434980861f, - -0.5208234035461248f, - -0.5207116546699957f, - -0.5205998968716132f, - -0.5204881301528921f, - -0.5203763545157467f, - -0.5202645699620939f, - -0.5201527764938482f, - -0.5200409741129252f, - -0.5199291628212398f, - -0.5198173426207094f, - -0.5197055135132493f, - -0.5195936755007757f, - -0.5194818285852049f, - -0.5193699727684524f, - -0.5192581080524366f, - -0.5191462344390733f, - -0.5190343519302796f, - -0.5189224605279716f, - -0.5188105602340684f, - -0.5186986510504863f, - -0.5185867329791429f, - -0.5184748060219553f, - -0.5183628701808427f, - -0.5182509254577223f, - -0.5181389718545123f, - -0.5180270093731303f, - -0.5179150380154962f, - -0.5178030577835271f, - -0.5176910686791439f, - -0.5175790707042627f, - -0.5174670638608047f, - -0.5173550481506874f, - -0.517243023575833f, - -0.5171309901381573f, - -0.5170189478395827f, - -0.5169068966820273f, - -0.5167948366674127f, - -0.5166827677976581f, - -0.5165706900746839f, - -0.5164586035004097f, - -0.5163465080767576f, - -0.5162344038056477f, - -0.5161222906890007f, - -0.516010168728737f, - -0.515898037926779f, - -0.5157858982850476f, - -0.5156737498054643f, - -0.5155615924899497f, - -0.5154494263404273f, - -0.5153372513588184f, - -0.5152250675470447f, - -0.515112874907028f, - -0.515000673440692f, - -0.5148884631499587f, - -0.5147762440367507f, - -0.5146640161029901f, - -0.5145517793506013f, - -0.5144395337815068f, - -0.5143272793976298f, - -0.5142150162008939f, - -0.5141027441932219f, - -0.513990463376539f, - -0.5138781737527676f, - -0.513765875323834f, - -0.5136535680916594f, - -0.5135412520581705f, - -0.5134289272252902f, - -0.5133165935949454f, - -0.513204251169058f, - -0.5130918999495552f, - -0.5129795399383604f, - -0.5128671711374014f, - -0.5127547935486005f, - -0.5126424071738854f, - -0.5125300120151806f, - -0.5124176080744131f, - -0.5123051953535083f, - -0.5121927738543924f, - -0.5120803435789909f, - -0.5119679045292319f, - -0.5118554567070411f, - -0.5117430001143454f, - -0.5116305347530709f, - -0.5115180606251462f, - -0.5114055777324975f, - -0.5112930860770526f, - -0.511180585660738f, - -0.5110680764854829f, - -0.5109555585532136f, - -0.5108430318658604f, - -0.5107304964253483f, - -0.510617952233608f, - -0.5105053992925669f, - -0.5103928376041538f, - -0.5102802671702964f, - -0.5101676879929254f, - -0.5100551000739688f, - -0.5099425034153552f, - -0.5098298980190152f, - -0.5097172838868778f, - -0.5096046610208723f, - -0.5094920294229279f, - -0.509379389094976f, - -0.5092667400389459f, - -0.5091540822567677f, - -0.5090414157503712f, - -0.5089287405216882f, - -0.5088160565726488f, - -0.5087033639051838f, - -0.5085906625212233f, - -0.5084779524226999f, - -0.5083652336115442f, - -0.5082525060896875f, - -0.5081397698590607f, - -0.508027024921597f, - -0.5079142712792275f, - -0.5078015089338841f, - -0.5076887378874984f, - -0.507575958142004f, - -0.5074631696993327f, - -0.507350372561417f, - -0.507237566730189f, - -0.5071247522075832f, - -0.5070119289955309f, - -0.5068990970959678f, - -0.5067862565108241f, - -0.5066734072420355f, - -0.5065605492915342f, - -0.5064476826612563f, - -0.5063348073531326f, - -0.5062219233690995f, - -0.5061090307110898f, - -0.5059961293810402f, - -0.505883219380882f, - -0.5057703007125522f, - -0.5056573733779843f, - -0.5055444373791147f, - -0.5054314927178776f, - -0.5053185393962085f, - -0.505205577416042f, - -0.5050926067793151f, - -0.504979627487963f, - -0.5048666395439213f, - -0.5047536429491262f, - -0.5046406377055129f, - -0.5045276238150194f, - -0.5044146012795814f, - -0.5043015701011355f, - -0.5041885302816177f, - -0.5040754818229664f, - -0.5039624247271178f, - -0.5038493589960094f, - -0.5037362846315774f, - -0.503623201635761f, - -0.5035101100104973f, - -0.5033970097577237f, - -0.5032839008793777f, - -0.5031707833773987f, - -0.5030576572537235f, - -0.5029445225102929f, - -0.5028313791490422f, - -0.5027182271719124f, - -0.5026050665808408f, - -0.5024918973777687f, - -0.5023787195646322f, - -0.5022655331433729f, - -0.5021523381159284f, - -0.502039134484241f, - -0.501925922250247f, - -0.5018127014158887f, - -0.5016994719831046f, - -0.5015862339538364f, - -0.5014729873300235f, - -0.5013597321136065f, - -0.5012464683065252f, - -0.5011331959107218f, - -0.5010199149281365f, - -0.5009066253607103f, - -0.5007933272103836f, - -0.5006800204790993f, - -0.5005667051687982f, - -0.5004533812814218f, - -0.5003400488189111f, - -0.5002267077832097f, - -0.5001133581762587f, - -0.5000000000000004f, - -0.4998866332563765f, - -0.49977325794733096f, - -0.4996598740748056f, - -0.49954648164074333f, - -0.4994330806470871f, - -0.49931967109577907f, - -0.49920625298876425f, - -0.4990928263279851f, - -0.4989793911153852f, - -0.4988659473529075f, - -0.4987524950424973f, - -0.4986390341860971f, - -0.4985255647856533f, - -0.4984120868431071f, - -0.4982986003604052f, - -0.4981851053394906f, - -0.4980716017823104f, - -0.4979580896908063f, - -0.49784456906692565f, - -0.497731039912612f, - -0.49761750222981227f, - -0.49750395602047104f, - -0.49739040128653395f, - -0.49727683802994593f, - -0.4971632662526544f, - -0.49704968595660465f, - -0.49693609714374276f, - -0.4968224998160144f, - -0.49670889397536744f, - -0.4965952796237478f, - -0.4964816567631022f, - -0.4963680253953767f, - -0.49625438552252005f, - -0.4961407371464778f, - -0.49602708026919956f, - -0.49591341489262974f, - -0.4957997410187184f, - -0.49568605864941234f, - -0.49557236778665964f, - -0.4954586684324075f, - -0.4953449605886057f, - -0.49523124425720183f, - -0.4951175194401444f, - -0.4950037861393813f, - -0.49489004435686273f, - -0.49477629409453705f, - -0.4946625353543524f, - -0.49454876813825965f, - -0.4944349924482073f, - -0.494321208286145f, - -0.4942074156540216f, - -0.49409361455378914f, - -0.4939798049873945f, - -0.4938659869567902f, - -0.49375216046392484f, - -0.49363832551075115f, - -0.49352448209921657f, - -0.49341063023127407f, - -0.49329676990887295f, - -0.4931829011339658f, - -0.49306902390850277f, - -0.49295513823443526f, - -0.4928412441137139f, - -0.4927273415482917f, - -0.49261343054011963f, - -0.49249951109114953f, - -0.49238558320333253f, - -0.4922716468786224f, - -0.49215770211896986f, - -0.4920437489263295f, - -0.49192978730265097f, - -0.4918158172498892f, - -0.4917018387699955f, - -0.49158785186492515f, - -0.49147385653662823f, - -0.49135985278706035f, - -0.49124584061817334f, - -0.4911318200319231f, - -0.49101779103026033f, - -0.49090375361514105f, - -0.4907897077885179f, - -0.4906756535523464f, - -0.49056159090858015f, - -0.49044751985917356f, - -0.49033344040608123f, - -0.4902193525512571f, - -0.4901052562966576f, - -0.4899911516442369f, - -0.4898770385959502f, - -0.48976291715375203f, - -0.4896487873195993f, - -0.48953464909544697f, - -0.48942050248325064f, - -0.4893063474849655f, - -0.489192184102549f, - -0.4890780123379566f, - -0.4889638321931446f, - -0.48884964367006867f, - -0.4887354467706869f, - -0.48862124149695535f, - -0.4885070278508308f, - -0.4883928058342695f, - -0.4882785754492302f, - -0.48816433669766945f, - -0.48805008958154467f, - -0.48793583410281266f, - -0.48782157026343276f, - -0.4877072980653612f, - -0.4875930175105585f, - -0.48747872860097957f, - -0.4873644313385851f, - -0.487250125725332f, - -0.4871358117631812f, - -0.4870214894540883f, - -0.4869071588000145f, - -0.48679281980291733f, - -0.4866784724647575f, - -0.4865641167874935f, - -0.48644975277308483f, - -0.4863353804234902f, - -0.4862209997406711f, - -0.4861066107265865f, - -0.4859922133831964f, - -0.48587780771246036f, - -0.48576339371634003f, - -0.4856489713967952f, - -0.4855345407557865f, - -0.4854201017952738f, - -0.4853056545172195f, - -0.48519119892358403f, - -0.4850767350163284f, - -0.484962262797414f, - -0.48484778226880143f, - -0.4847332934324539f, - -0.48461879629033233f, - -0.4845042908443986f, - -0.48438977709661396f, - -0.4842752550489422f, - -0.4841607247033447f, - -0.484046186061784f, - -0.4839316391262219f, - -0.48381708389862266f, - -0.4837025203809477f, - -0.4835879485751622f, - -0.4834733684832263f, - -0.48335878010710565f, - -0.48324418344876213f, - -0.4831295785101616f, - -0.4830149652932647f, - -0.48290034380003766f, - -0.4827857140324429f, - -0.48267107599244696f, - -0.48255642968201096f, - -0.48244177510310166f, - -0.4823271122576821f, - -0.48221244114771855f, - -0.4820977617751751f, - -0.4819830741420168f, - -0.4818683782502079f, - -0.4817536741017153f, - -0.4816389616985037f, - -0.48152424104253855f, - -0.48140951213578487f, - -0.48129477498021f, - -0.4811800295777792f, - -0.48106527593045867f, - -0.4809505140402138f, - -0.4808357439090125f, - -0.48072096553882065f, - -0.48060617893160495f, - -0.48049138408933145f, - -0.4803765810139687f, - -0.48026176970748297f, - -0.48014695017184156f, - -0.4800321224090111f, - -0.4799172864209607f, - -0.4798024422096573f, - -0.4796875897770678f, - -0.4795727291251619f, - -0.4794578602559068f, - -0.47934298317127083f, - -0.4792280978732215f, - -0.47911320436372984f, - -0.47899830264476123f, - -0.47888339271828695f, - -0.47876847458627425f, - -0.4786535482506947f, - -0.47853861371351436f, - -0.4784236709767049f, - -0.47830872004223435f, - -0.47819376091207383f, - -0.47807879358819244f, - -0.47796381807256005f, - -0.47784883436714604f, - -0.4777338424739221f, - -0.47761884239485786f, - -0.4775038341319237f, - -0.4773888176870897f, - -0.477273793062328f, - -0.47715876025960874f, - -0.47704371928090306f, - -0.4769286701281814f, - -0.47681361280341655f, - -0.4766985473085785f, - -0.47658347364564124f, - -0.4764683918165733f, - -0.47635330182334895f, - -0.47623820366793873f, - -0.47612309735231706f, - -0.47600798287845325f, - -0.475892860248322f, - -0.47577772946389435f, - -0.47566259052714543f, - -0.475547443440045f, - -0.47543228820456834f, - -0.4753171248226879f, - -0.4752019532963761f, - -0.47508677362760804f, - -0.47497158581835647f, - -0.4748563898705951f, - -0.4747411857862969f, - -0.47462597356743763f, - -0.4745107532159905f, - -0.47439552473392976f, - -0.47428028812322914f, - -0.4741650433858647f, - -0.4740497905238103f, - -0.47393452953904086f, - -0.47381926043353045f, - -0.4737039832092559f, - -0.47358869786819147f, - -0.47347340441231267f, - -0.47335810284359425f, - -0.4732427931640134f, - -0.4731274753755451f, - -0.4730121494801654f, - -0.4728968154798495f, - -0.47278147337657517f, - -0.47266612317231727f, - -0.4725507648690546f, - -0.4724353984687607f, - -0.47232002397341466f, - -0.4722046413849918f, - -0.47208925070547153f, - -0.47197385193682795f, - -0.47185844508104074f, - -0.47174303014008573f, - -0.4716276071159429f, - -0.4715121760105869f, - -0.4713967368259979f, - -0.47128128956415244f, - -0.4711658342270302f, - -0.4710503708166086f, - -0.4709348993348662f, - -0.4708194197837807f, - -0.4707039321653325f, - -0.47058843648149956f, - -0.4704729327342609f, - -0.47035742092559485f, - -0.4702419010574822f, - -0.4701263731319017f, - -0.47001083715083275f, - -0.4698952931162551f, - -0.46977974103014775f, - -0.46966418089449224f, - -0.4695486127112679f, - -0.46943303648245494f, - -0.46931745221003296f, - -0.46920185989598395f, - -0.46908625954228783f, - -0.46897065115092545f, - -0.4688550347238768f, - -0.46873941026312466f, - -0.4686237777706493f, - -0.4685081372484321f, - -0.4683924886984538f, - -0.4682768321226975f, - -0.46816116752314346f, - -0.4680454949017758f, - -0.4679298142605735f, - -0.467814125601521f, - -0.4676984289265991f, - -0.4675827242377925f, - -0.4674670115370807f, - -0.4673512908264488f, - -0.4672355621078779f, - -0.4671198253833527f, - -0.4670040806548555f, - -0.4668883279243695f, - -0.4667725671938774f, - -0.46665679846536423f, - -0.4665410217408129f, - -0.46642523702220723f, - -0.4663094443115303f, - -0.4661936436107678f, - -0.4660778349219032f, - -0.4659620182469208f, - -0.4658461935878043f, - -0.46573036094653997f, - -0.4656145203251117f, - -0.46549867172550435f, - -0.4653828151497023f, - -0.46526695059969225f, - -0.46515107807745865f, - -0.465035197584987f, - -0.4649193091242621f, - -0.4648034126972712f, - -0.4646875083059994f, - -0.46457159595243275f, - -0.4644556756385573f, - -0.46433974736635847f, - -0.46422381113782435f, - -0.46410786695493983f, - -0.463991914819694f, - -0.46387595473407045f, - -0.4637599867000585f, - -0.46364401071964373f, - -0.4635280267948157f, - -0.46341203492755856f, - -0.4632960351198621f, - -0.46318002737371256f, - -0.46306401169109995f, - -0.462947988074009f, - -0.4628319565244301f, - -0.46271591704434994f, - -0.4625998696357583f, - -0.4624838143006429f, - -0.46236775104099226f, - -0.46225167985879434f, - -0.46213560075603954f, - -0.4620195137347161f, - -0.46190341879681307f, - -0.461787315944319f, - -0.46167120517922483f, - -0.46155508650351845f, - -0.461438959919192f, - -0.461322825428232f, - -0.4612066830326308f, - -0.4610905327343769f, - -0.4609743745354629f, - -0.46085820843787595f, - -0.4607420344436089f, - -0.4606258525546515f, - -0.46050966277299465f, - -0.4603934651006283f, - -0.46027725953954507f, - -0.4601610460917354f, - -0.46004482475918973f, - -0.45992859554390103f, - -0.4598123584478601f, - -0.45969611347305867f, - -0.4595798606214877f, - -0.4594635998951408f, - -0.45934733129600924f, - -0.4592310548260852f, - -0.4591147704873604f, - -0.45899847828182955f, - -0.45888217821148225f, - -0.45876587027831356f, - -0.4586495544843149f, - -0.45853323083148073f, - -0.4584168993218036f, - -0.45830055995727664f, - -0.4581842127398927f, - -0.4580678576716468f, - -0.45795149475453195f, - -0.457835123990542f, - -0.45771874538167f, - -0.4576023589299118f, - -0.4574859646372608f, - -0.4573695625057114f, - -0.4572531525372573f, - -0.45713673473389477f, - -0.45702030909761704f, - -0.4569038756304213f, - -0.4567874343342995f, - -0.45667098521124927f, - -0.45655452826326426f, - -0.45643806349234234f, - -0.4563215909004759f, - -0.4562051104896631f, - -0.45608862226189817f, - -0.45597212621917954f, - -0.4558556223635001f, - -0.4557391106968585f, - -0.4556225912212496f, - -0.4555060639386715f, - -0.45538952885112f, - -0.45527298596059196f, - -0.45515643526908434f, - -0.45503987677859337f, - -0.45492331049111784f, - -0.45480673640865427f, - -0.4546901545332001f, - -0.45457356486675227f, - -0.45445696741131f, - -0.4543403621688703f, - -0.45422374914143127f, - -0.4541071283309902f, - -0.45399049973954697f, - -0.4538738633690992f, - -0.4537572192216454f, - -0.45364056729918345f, - -0.4535239076037137f, - -0.4534072401372343f, - -0.4532905649017444f, - -0.4531738818992423f, - -0.45305719113172893f, - -0.4529404926012023f, - -0.45282378630966413f, - -0.4527070722591112f, - -0.4525903504515457f, - -0.45247362088896603f, - -0.4523568835733747f, - -0.4522401385067688f, - -0.45212338569115107f, - -0.45200662512852047f, - -0.45188985682088006f, - -0.45177308077022743f, - -0.4516562969785659f, - -0.451539505447895f, - -0.45142270618021746f, - -0.4513058991775338f, - -0.4511890844418454f, - -0.4510722619751532f, - -0.45095543177946046f, - -0.4508385938567682f, - -0.45072174820907845f, - -0.45060489483839256f, - -0.45048803374671426f, - -0.45037116493604523f, - -0.45025428840838794f, - -0.45013740416574427f, - -0.45002051221011863f, - -0.4499036125435131f, - -0.4497867051679306f, - -0.4496697900853745f, - -0.44955286729784727f, - -0.44943593680735383f, - -0.4493189986158971f, - -0.4492020527254807f, - -0.4490850991381077f, - -0.4489681378557836f, - -0.44885116888051096f, - -0.44873419221429645f, - -0.44861720785914116f, - -0.448500215817052f, - -0.448383216090032f, - -0.4482662086800884f, - -0.4481491935892227f, - -0.4480321708194425f, - -0.4479151403727513f, - -0.4477981022511568f, - -0.4476810564566612f, - -0.4475640029912724f, - -0.4474469418569946f, - -0.44732987305583505f, - -0.447212796589799f, - -0.44709571246089247f, - -0.44697862067112093f, - -0.4468615212224923f, - -0.4467444141170122f, - -0.44662729935668727f, - -0.44651017694352346f, - -0.44639304687952913f, - -0.44627590916671056f, - -0.44615876380707487f, - -0.4460416108026285f, - -0.4459244501553804f, - -0.44580728186733737f, - -0.44569010594050695f, - -0.4455729223768962f, - -0.4454557311785146f, - -0.4453385323473694f, - -0.44522132588546875f, - -0.4451041117948202f, - -0.4449868900774337f, - -0.4448696607353171f, - -0.44475242377047897f, - -0.44463517918492745f, - -0.4445179269806731f, - -0.44440066715972415f, - -0.444283399724089f, - -0.4441661246757786f, - -0.4440488420168017f, - -0.4439315517491679f, - -0.443814253874886f, - -0.44369694839596835f, - -0.44357963531442185f, - -0.4434623146322589f, - -0.44334498635148817f, - -0.4432276504741217f, - -0.44311030700216913f, - -0.4429929559376412f, - -0.4428755972825479f, - -0.44275823103890166f, - -0.4426408572087127f, - -0.44252347579399226f, - -0.4424060867967508f, - -0.4422886902190014f, - -0.4421712860627548f, - -0.44205387433002263f, - -0.441936455022816f, - -0.44181902814314833f, - -0.4417015936930302f, - -0.4415841516744762f, - -0.44146670208949546f, - -0.44134924494010286f, - -0.4412317802283094f, - -0.44111430795613016f, - -0.4409968281255748f, - -0.44087934073865875f, - -0.4407618457973935f, - -0.44064434330379476f, - -0.4405268332598726f, - -0.44040931566764296f, - -0.4402917905291179f, - -0.4401742578463127f, - -0.44005671762124055f, - -0.4399391698559154f, - -0.43982161455235147f, - -0.4397040517125622f, - -0.4395864813385636f, - -0.4394689034323694f, - -0.4393513179959942f, - -0.43923372503145214f, - -0.4391161245407596f, - -0.43899851652593097f, - -0.4388809009889813f, - -0.4387632779319252f, - -0.43864564735677963f, - -0.43852800926555946f, - -0.43841036366028024f, - -0.43829271054295715f, - -0.43817504991560763f, - -0.43805738178024706f, - -0.43793970613889155f, - -0.4378220229935567f, - -0.4377043323462606f, - -0.437586634199019f, - -0.4374689285538486f, - -0.43735121541276556f, - -0.4372334947777884f, - -0.43711576665093255f, - -0.4369980310342178f, - -0.4368802879296582f, - -0.4367625373392737f, - -0.4366447792650804f, - -0.4365270137090983f, - -0.4364092406733422f, - -0.4362914601598324f, - -0.43617367217058556f, - -0.4360558767076214f, - -0.4359380737729577f, - -0.4358202633686128f, - -0.4357024454966047f, - -0.43558462015895366f, - -0.43546678735767785f, - -0.43534894709479627f, - -0.4352310993723273f, - -0.4351132441922918f, - -0.43499538155670847f, - -0.43487751146759673f, - -0.4347596339269756f, - -0.4346417489368663f, - -0.4345238564992881f, - -0.434405956616261f, - -0.43428804928980524f, - -0.43417013452194025f, - -0.4340522123146881f, - -0.43393428267006856f, - -0.4338163455901023f, - -0.4336984010768094f, - -0.43358044913221233f, - -0.4334624897583314f, - -0.43334452295718784f, - -0.43322654873080213f, - -0.4331085670811974f, - -0.4329905780103935f, - -0.4328725815204147f, - -0.4327545776132795f, - -0.4326365662910123f, - -0.4325185475556337f, - -0.43240052140916824f, - -0.432282487853635f, - -0.43216444689105893f, - -0.43204639852346105f, - -0.43192834275286646f, - -0.43181027958129475f, - -0.4316922090107714f, - -0.4315741310433179f, - -0.43145604568095897f, - -0.43133795292571736f, - -0.4312198527796164f, - -0.431101745244679f, - -0.4309836303229304f, - -0.4308655080163938f, - -0.43074737832709303f, - -0.4306292412570516f, - -0.4305110968082952f, - -0.4303929449828475f, - -0.430274785782733f, - -0.4301566192099754f, - -0.4300384452666012f, - -0.4299202639546344f, - -0.4298020752761f, - -0.42968387923302237f, - -0.4295656758274284f, - -0.42944746506134257f, - -0.4293292469367905f, - -0.4292110214557969f, - -0.42909278862038924f, - -0.4289745484325926f, - -0.42885630089443216f, - -0.4287380460079364f, - -0.42861978377512855f, - -0.4285015141980372f, - -0.42838323727868743f, - -0.4282649530191082f, - -0.4281466614213231f, - -0.4280283624873615f, - -0.42791005621924866f, - -0.4277917426190142f, - -0.4276734216886823f, - -0.42755509343028253f, - -0.427436757845841f, - -0.4273184149373869f, - -0.42720006470694727f, - -0.42708170715654986f, - -0.426963342288222f, - -0.42684497010399347f, - -0.42672659060589163f, - -0.42660820379594494f, - -0.42648980967618116f, - -0.4263714082486305f, - -0.426252999515321f, - -0.4261345834782815f, - -0.42601616013954013f, - -0.42589772950112786f, - -0.4257792915650722f, - -0.42566084633340506f, - -0.4255423938081527f, - -0.42542393399134715f, - -0.42530546688501664f, - -0.42518699249119346f, - -0.42506851081190444f, - -0.4249500218491821f, - -0.424831525605056f, - -0.4247130220815564f, - -0.4245945112807132f, - -0.4244759932045585f, - -0.4243574678551223f, - -0.4242389352344348f, - -0.4241203953445285f, - -0.42400184818743386f, - -0.4238832937651821f, - -0.42376473207980375f, - -0.4236461631333321f, - -0.4235275869277978f, - -0.4234090034652328f, - -0.42329041274766804f, - -0.4231718147771373f, - -0.42305320955567177f, - -0.4229345970853038f, - -0.422815977368065f, - -0.42269735040598944f, - -0.42257871620110893f, - -0.4224600747554563f, - -0.4223414260710637f, - -0.4222227701499656f, - -0.42210410699419443f, - -0.4219854366057834f, - -0.4218667589867651f, - -0.4217480741391747f, - -0.42162938206504413f, - -0.4215106827664097f, - -0.42139197624530195f, - -0.4212732625037573f, - -0.4211545415438083f, - -0.4210358133674917f, - -0.4209170779768385f, - -0.4207983353738857f, - -0.4206795855606663f, - -0.4205608285392175f, - -0.4204420643115709f, - -0.42032329287976394f, - -0.42020451424583005f, - -0.4200857284118062f, - -0.41996693537972685f, - -0.4198481351516275f, - -0.41972932772954297f, - -0.4196105131155107f, - -0.41949169131156555f, - -0.41937286231974363f, - -0.419254026142081f, - -0.4191351827806131f, - -0.41901633223737794f, - -0.41889747451441106f, - -0.41877860961374913f, - -0.4186597375374281f, - -0.41854085828748633f, - -0.4184219718659601f, - -0.41830307827488633f, - -0.41818417751630155f, - -0.4180652695922447f, - -0.41794635450475237f, - -0.4178274322558622f, - -0.417708502847611f, - -0.4175895662820383f, - -0.4174706225611804f, - -0.41735167168707776f, - -0.4172327136617654f, - -0.41711374848728394f, - -0.4169947761656704f, - -0.4168757966989655f, - -0.4167568100892049f, - -0.4166378163384298f, - -0.4165188154486774f, - -0.4163998074219893f, - -0.4162807922604013f, - -0.4161617699659553f, - -0.4160427405406889f, - -0.4159237039866434f, - -0.4158046603058576f, - -0.41568560950037126f, - -0.4155665515722235f, - -0.4154474865234559f, - -0.41532841435610796f, - -0.4152093350722198f, - -0.41509024867383104f, - -0.41497115516298383f, - -0.414852054541718f, - -0.4147329468120743f, - -0.41461383197609275f, - -0.414494710035816f, - -0.4143755809932844f, - -0.4142564448505392f, - -0.41413730160962087f, - -0.4140181512725726f, - -0.41389899384143514f, - -0.41377982931825025f, - -0.413660657705059f, - -0.4135414790039049f, - -0.4134222932168293f, - -0.41330310034587436f, - -0.4131839003930825f, - -0.4130646933604953f, - -0.412945479250157f, - -0.41282625806410866f, - -0.4127070298043955f, - -0.4125877944730573f, - -0.4124685520721395f, - -0.41234930260368374f, - -0.4122300460697356f, - -0.41211078247233546f, - -0.41199151181352917f, - -0.41187223409535884f, - -0.4117529493198706f, - -0.4116336574891053f, - -0.4115143586051092f, - -0.411395052669925f, - -0.4112757396855985f, - -0.4111564196541733f, - -0.41103709257769394f, - -0.4109177584582042f, - -0.4107984172977506f, - -0.410679069098377f, - -0.41055971386212853f, - -0.41044035159104947f, - -0.41032098228718666f, - -0.41020160595258387f, - -0.41008222258928906f, - -0.4099628321993445f, - -0.40984343478479834f, - -0.40972403034769483f, - -0.40960461889008243f, - -0.4094852004140039f, - -0.4093657749215079f, - -0.4092463424146399f, - -0.40912690289544645f, - -0.40900745636597324f, - -0.40888800282826854f, - -0.40876854228437837f, - -0.40864907473634887f, - -0.4085296001862287f, - -0.40841011863606413f, - -0.4082906300879026f, - -0.40817113454379056f, - -0.40805163200577727f, - -0.40793212247590943f, - -0.4078126059562349f, - -0.4076930824488008f, - -0.4075735519556574f, - -0.40745401447884977f, - -0.40733447002042844f, - -0.4072149185824402f, - -0.40709536016693515f, - -0.40697579477596113f, - -0.40685622241156677f, - -0.40673664307580015f, - -0.40661705677071186f, - -0.40649746349835014f, - -0.4063778632607642f, - -0.40625825606000254f, - -0.40613864189811627f, - -0.40601902077715407f, - -0.40589939269916564f, - -0.4057797576662f, - -0.4056601156803086f, - -0.4055404667435399f, - -0.4054208108579465f, - -0.40530114802557543f, - -0.4051814782484795f, - -0.4050618015287075f, - -0.4049421178683127f, - -0.4048224272693425f, - -0.4047027297338501f, - -0.40458302526388495f, - -0.40446331386149986f, - -0.4043435955287451f, - -0.40422387026767204f, - -0.4041041380803314f, - -0.40398439896877636f, - -0.40386465293505774f, - -0.4037448999812274f, - -0.4036251401093373f, - -0.40350537332143865f, - -0.40338559961958526f, - -0.4032658190058286f, - -0.40314603148222106f, - -0.4030262370508144f, - -0.40290643571366286f, - -0.40278662747281835f, - -0.40266681233033386f, - -0.40254699028826146f, - -0.40242716134865597f, - -0.4023073255135698f, - -0.4021874827850562f, - -0.402067633165168f, - -0.4019477766559604f, - -0.4018279132594862f, - -0.4017080429777992f, - -0.4015881658129527f, - -0.4014682817670022f, - -0.40134839084200036f, - -0.4012284930400039f, - -0.401108588363064f, - -0.40098867681323763f, - -0.4008687583925778f, - -0.4007488331031417f, - -0.40062890094698095f, - -0.4005089619261531f, - -0.40038901604271154f, - -0.400269063298714f, - -0.40014910369621254f, - -0.40002913723726513f, - -0.39990916392392567f, - -0.3997891837582516f, - -0.39966919674229784f, - -0.3995492028781204f, - -0.39942920216777444f, - -0.3993091946133179f, - -0.39918918021680616f, - -0.3990691589802956f, - -0.3989491309058421f, - -0.39882909599550376f, - -0.3987090542513366f, - -0.3985890056753976f, - -0.3984689502697428f, - -0.39834888803643104f, - -0.39822881897751866f, - -0.39810874309506306f, - -0.3979886603911217f, - -0.39786857086775135f, - -0.39774847452701134f, - -0.3976283713709587f, - -0.3975082614016513f, - -0.39738814462114647f, - -0.39726802103150394f, - -0.39714789063478034f, - -0.3970277534330366f, - -0.3969076094283279f, - -0.39678745862271536f, - -0.39666730101825615f, - -0.39654713661701146f, - -0.39642696542103717f, - -0.39630678743239467f, - -0.39618660265314165f, - -0.39606641108533985f, - -0.39594621273104547f, - -0.3958260075923205f, - -0.39570579567122305f, - -0.3955855769698145f, - -0.39546535149015394f, - -0.39534511923430143f, - -0.3952248802043163f, - -0.39510463440226046f, - -0.3949843818301934f, - -0.3948641224901757f, - -0.3947438563842671f, - -0.39462358351453003f, - -0.3945033038830244f, - -0.3943830174918113f, - -0.3942627243429509f, - -0.39414242443850606f, - -0.39402211778053725f, - -0.3939018043711059f, - -0.3937814842122727f, - -0.393661157306101f, - -0.39354082365465176f, - -0.3934204832599868f, - -0.3933001361241673f, - -0.39317978224925704f, - -0.39305942163731744f, - -0.39293905429041087f, - -0.39281868021059896f, - -0.3926982993999458f, - -0.3925779118605135f, - -0.39245751759436387f, - -0.3923371166035623f, - -0.39221670889016863f, - -0.39209629445624844f, - -0.39197587330386335f, - -0.3918554454350792f, - -0.3917350108519562f, - -0.3916145695565605f, - -0.3914941215509541f, - -0.3913736668372025f, - -0.39125320541736885f, - -0.3911327372935172f, - -0.39101226246771104f, - -0.39089178094201615f, - -0.3907712927184962f, - -0.39065079779921574f, - -0.3905302961862386f, - -0.3904097878816311f, - -0.39028927288745735f, - -0.3901687512057824f, - -0.39004822283867047f, - -0.3899276877881884f, - -0.38980714605640004f, - -0.38968659764537306f, - -0.3895660425571699f, - -0.3894454807938587f, - -0.3893249123575036f, - -0.3892043372501729f, - -0.38908375547392937f, - -0.38896316703084166f, - -0.38884257192297433f, - -0.38872197015239623f, - -0.38860136172117055f, - -0.38848074663136634f, - -0.3883601248850495f, - -0.388239496484286f, - -0.38811886143114444f, - -0.38799821972769105f, - -0.387877571375993f, - -0.3877569163781167f, - -0.3876362547361313f, - -0.38751558645210327f, - -0.38739491152810046f, - -0.38727422996618965f, - -0.3871535417684403f, - -0.3870328469369197f, - -0.3869121454736958f, - -0.38679143738083593f, - -0.38667072266041014f, - -0.386550001314486f, - -0.386429273345132f, - -0.386308538754416f, - -0.38618779754440835f, - -0.38606704971717715f, - -0.3859462952747913f, - -0.3858255342193192f, - -0.3857047665528316f, - -0.38558399227739615f, - -0.3854632113950849f, - -0.3853424239079639f, - -0.3852216298181055f, - -0.3851008291275777f, - -0.3849800218384528f, - -0.3848592079527977f, - -0.3847383874726848f, - -0.38461756040018275f, - -0.3844967267373644f, - -0.38437588648629684f, - -0.3842550396490531f, - -0.3841341862277023f, - -0.3840133262243168f, - -0.3838924596409667f, - -0.383771586479723f, - -0.38365070674265606f, - -0.3835298204318387f, - -0.38340892754934147f, - -0.3832880280972359f, - -0.3831671220775926f, - -0.38304620949248513f, - -0.38292529034398426f, - -0.382804364634162f, - -0.3826834323650904f, - -0.38256249353884075f, - -0.38244154815748693f, - -0.3823205962231005f, - -0.38219963773775395f, - -0.38207867270351903f, - -0.38195770112247013f, - -0.38183672299667915f, - -0.38171573832821915f, - -0.38159474711916225f, - -0.38147374937158324f, - -0.3813527450875546f, - -0.38123173426914975f, - -0.3811107169184413f, - -0.38098969303750446f, - -0.38086866262841135f, - -0.3807476256932382f, - -0.38062658223405577f, - -0.3805055322529405f, - -0.3803844757519649f, - -0.3802634127332057f, - -0.380142343198734f, - -0.38002126715062684f, - -0.3799001845909571f, - -0.3797790955218019f, - -0.3796579999452329f, - -0.37953689786332745f, - -0.379415789278159f, - -0.3792946741918043f, - -0.37917355260633784f, - -0.37905242452383503f, - -0.37893128994637043f, - -0.37881014887602144f, - -0.3786890013148628f, - -0.37856784726497056f, - -0.37844668672841963f, - -0.3783255197072878f, - -0.3782043462036504f, - -0.37808316621958366f, - -0.3779619797571632f, - -0.3778407868184672f, - -0.3777195874055714f, - -0.3775983815205525f, - -0.3774771691654865f, - -0.377355950342452f, - -0.3772347250535253f, - -0.3771134933007834f, - -0.37699225508630296f, - -0.3768710104121628f, - -0.37674975928043974f, - -0.37662850169321055f, - -0.37650723765255534f, - -0.3763859671605487f, - -0.376264690219271f, - -0.37614340683079867f, - -0.37602211699721233f, - -0.375900820720587f, - -0.3757795180030034f, - -0.3756582088465385f, - -0.37553689325327333f, - -0.37541557122528335f, - -0.37529424276464973f, - -0.37517290787344987f, - -0.37505156655376437f, - -0.37493021880767163f, - -0.3748088646372509f, - -0.3746875040445807f, - -0.37456613703174213f, - -0.374444763600814f, - -0.374323383753876f, - -0.3742019974930072f, - -0.37408060482028904f, - -0.3739592057378008f, - -0.3738378002476226f, - -0.3737163883518338f, - -0.3735949700525165f, - -0.37347354535174954f, - -0.3733521142516159f, - -0.373230676754193f, - -0.3731092328615641f, - -0.3729877825758085f, - -0.37286632589900964f, - -0.37274486283324537f, - -0.3726233933805994f, - -0.37250191754315226f, - -0.3723804353229846f, - -0.3722589467221796f, - -0.37213745174281804f, - -0.3720159503869819f, - -0.37189444265675203f, - -0.37177292855421223f, - -0.3716514080814437f, - -0.37152988124052877f, - -0.37140834803354883f, - -0.371286808462588f, - -0.37116526252972804f, - -0.3710437102370515f, - -0.3709221515866405f, - -0.37080058658057946f, - -0.3706790152209505f, - -0.3705574375098368f, - -0.3704358534493207f, - -0.37031426304148707f, - -0.3701926662884187f, - -0.3700710631921989f, - -0.3699494537549106f, - -0.3698278379786393f, - -0.36970621586546776f, - -0.3695845874174802f, - -0.3694629526367597f, - -0.3693413115253921f, - -0.3692196640854602f, - -0.3690980103190507f, - -0.3689763502282448f, - -0.36885468381512976f, - -0.36873301108178846f, - -0.3686113320303083f, - -0.3684896466627709f, - -0.3683679549812638f, - -0.3682462569878705f, - -0.3681245526846787f, - -0.36800284207377043f, - -0.3678811251572338f, - -0.3677594019371526f, - -0.36763767241561424f, - -0.3675159365947037f, - -0.36739419447650684f, - -0.36727244606310894f, - -0.36715069135659767f, - -0.36702893035905854f, - -0.3669071630725778f, - -0.366785389499242f, - -0.36666360964113676f, - -0.36654182350035047f, - -0.3664200310789691f, - -0.36629823237907944f, - -0.36617642740276773f, - -0.3660546161521227f, - -0.36593279862923067f, - -0.365810974836179f, - -0.3656891447750543f, - -0.36556730844794577f, - -0.3654454658569401f, - -0.36532361700412513f, - -0.3652017618915879f, - -0.36507990052141787f, - -0.3649580328957016f, - -0.3648361590165297f, - -0.3647142788859871f, - -0.3645923925061647f, - -0.36447049987914937f, - -0.3643486010070321f, - -0.3642266958918983f, - -0.36410478453583933f, - -0.36398286694094245f, - -0.3638609431092991f, - -0.3637390130429951f, - -0.36361707674412225f, - -0.3634951342147682f, - -0.3633731854570241f, - -0.3632512304729785f, - -0.36312926926472133f, - -0.3630073018343414f, - -0.36288532818393016f, - -0.36276334831557694f, - -0.3626413622313717f, - -0.3625193699334039f, - -0.36239737142376544f, - -0.3622753667045459f, - -0.3621533557778359f, - -0.3620313386457251f, - -0.36190931531030596f, - -0.36178728577366853f, - -0.3616652500379036f, - -0.36154320810510154f, - -0.36142115997735513f, - -0.36129910565675477f, - -0.36117704514539184f, - -0.36105497844535783f, - -0.36093290555874347f, - -0.3608108264876421f, - -0.36068874123414474f, - -0.3605666498003432f, - -0.3604445521883287f, - -0.36032244840019506f, - -0.36020033843803273f, - -0.36007822230393655f, - -0.35995609999999567f, - -0.35983397152830515f, - -0.35971183689095587f, - -0.3595896960900431f, - -0.3594675491276563f, - -0.3593453960058911f, - -0.35922323672683876f, - -0.35910107129259417f, - -0.35897889970524965f, - -0.3588567219668987f, - -0.358734538079634f, - -0.3586123480455507f, - -0.35849015186674166f, - -0.35836794954530077f, - -0.358245741083321f, - -0.35812352648289814f, - -0.3580013057461254f, - -0.3578790788750969f, - -0.3577568458719063f, - -0.35763460673864966f, - -0.3575123614774198f, - -0.3573901100903139f, - -0.3572678525794233f, - -0.35714558894684545f, - -0.3570233191946744f, - -0.3569010433250052f, - -0.35677876133993225f, - -0.3566564732415524f, - -0.3565341790319603f, - -0.3564118787132513f, - -0.3562895722875203f, - -0.3561672597568645f, - -0.3560449411233789f, - -0.3559226163891587f, - -0.35580028555630133f, - -0.3556779486269023f, - -0.3555556056030576f, - -0.3554332564868629f, - -0.35531090128041704f, - -0.3551885399858132f, - -0.3550661726051505f, - -0.35494379914052404f, - -0.3548214195940331f, - -0.35469903396777136f, - -0.35457664226383834f, - -0.35445424448432955f, - -0.3543318406313438f, - -0.35420943070697775f, - -0.35408701471332876f, - -0.35396459265249364f, - -0.35384216452657163f, - -0.35371973033765974f, - -0.35359729008785584f, - -0.3534748437792571f, - -0.3533523914139632f, - -0.35322993299407074f, - -0.35310746852168046f, - -0.3529849979988874f, - -0.3528625214277926f, - -0.35274003881049304f, - -0.35261755014908985f, - -0.35249505544567855f, - -0.3523725547023605f, - -0.35225004792123316f, - -0.352127535104398f, - -0.35200501625395103f, - -0.35188249137199407f, - -0.3517599604606248f, - -0.3516374235219445f, - -0.3515148805580519f, - -0.3513923315710468f, - -0.3512697765630291f, - -0.3511472155360978f, - -0.35102464849235465f, - -0.350902075433899f, - -0.35077949636283107f, - -0.3506569112812504f, - -0.3505343201912592f, - -0.350411723094957f, - -0.3502891199944447f, - -0.35016651089182205f, - -0.3500438957891917f, - -0.3499212746886538f, - -0.34979864759230933f, - -0.34967601450225877f, - -0.34955337542060494f, - -0.3494307303494485f, - -0.34930807929089086f, - -0.34918542224703286f, - -0.3490627592199778f, - -0.34894009021182665f, - -0.34881741522468135f, - -0.348694734260643f, - -0.3485720473218155f, - -0.34844935441029923f, - -0.34832665552819914f, - -0.34820395067761417f, - -0.3480812398606495f, - -0.3479585230794059f, - -0.3478358003359887f, - -0.3477130716324974f, - -0.34759033697103736f, - -0.34746759635371f, - -0.34734484978262087f, - -0.34722209725986997f, - -0.34709933878756305f, - -0.3469765743678019f, - -0.34685380400269167f, - -0.3467310276943353f, - -0.34660824544483637f, - -0.346485457256298f, - -0.34636266313082575f, - -0.34623986307052285f, - -0.3461170570774934f, - -0.34599424515384086f, - -0.34587142730167125f, - -0.3457486035230882f, - -0.3456257738201962f, - -0.34550293819509914f, - -0.34538009664990343f, - -0.345257249186713f, - -0.34513439580763294f, - -0.34501153651476824f, - -0.3448886713102232f, - -0.3447658001961048f, - -0.34464292317451756f, - -0.34452004024756694f, - -0.3443971514173577f, - -0.34427425668599715f, - -0.34415135605558933f, - -0.3440284495282427f, - -0.34390553710605987f, - -0.3437826187911494f, - -0.3436596945856158f, - -0.34353676449156784f, - -0.3434138285111086f, - -0.343290886646347f, - -0.3431679388993879f, - -0.3430449852723406f, - -0.3429220257673085f, - -0.34279906038640096f, - -0.3426760891317233f, - -0.34255311200538424f, - -0.34243012900949016f, - -0.3423071401461484f, - -0.34218414541746534f, - -0.3420611448255503f, - -0.34193813837250986f, - -0.3418151260604519f, - -0.3416921078914832f, - -0.3415690838677134f, - -0.3414460539912496f, - -0.3413230182642f, - -0.34119997668867175f, - -0.34107692926677496f, - -0.3409538760006171f, - -0.34083081689230676f, - -0.3407077519439516f, - -0.34058468115766194f, - -0.3404616045355458f, - -0.34033852207971205f, - -0.3402154337922688f, - -0.3400923396753269f, - -0.33996923973099463f, - -0.33984613396138047f, - -0.3397230223685954f, - -0.3395999049547481f, - -0.3394767817219483f, - -0.3393536526723046f, - -0.33923051780792945f, - -0.33910737713092937f, - -0.3389842306434168f, - -0.33886107834750023f, - -0.33873792024529226f, - -0.33861475633889987f, - -0.338491586630436f, - -0.3383684111220093f, - -0.33824522981573224f, - -0.3381220427137145f, - -0.3379988498180669f, - -0.3378756511308995f, - -0.3377524466543249f, - -0.3376292363904534f, - -0.33750602034139615f, - -0.3373827985092636f, - -0.33725957089616876f, - -0.3371363375042223f, - -0.3370130983355358f, - -0.33688985339222f, - -0.33676660267638847f, - -0.33664334619015135f, - -0.33652008393562305f, - -0.33639681591491244f, - -0.33627354213013405f, - -0.33615026258339853f, - -0.3360269772768208f, - -0.3359036862125099f, - -0.33578038939258087f, - -0.3356570868191448f, - -0.33553377849431687f, - -0.33541046442020667f, - -0.33528714459892955f, - -0.33516381903259784f, - -0.3350404877233238f, - -0.3349171506732223f, - -0.33479380788440594f, - -0.33467045935898815f, - -0.3345471050990816f, - -0.3344237451068016f, - -0.3343003793842611f, - -0.33417700793357397f, - -0.3340536307568532f, - -0.3339302478562145f, - -0.3338068592337713f, - -0.3336834648916377f, - -0.33356006483192724f, - -0.33343665905675607f, - -0.33331324756823777f, - -0.33318983036848704f, - -0.3330664074596178f, - -0.3329429788437464f, - -0.33281954452298707f, - -0.33269610449945475f, - -0.3325726587752637f, - -0.3324492073525308f, - -0.33232575023336974f, - -0.33220228741989843f, - -0.33207881891422897f, - -0.33195534471847954f, - -0.33183186483476407f, - -0.33170837926520097f, - -0.33158488801190267f, - -0.3314613910769878f, - -0.3313378884625707f, - -0.33121438017077f, - -0.33109086620369876f, - -0.33096734656347576f, - -0.3308438212522159f, - -0.33072029027203736f, - -0.33059675362505603f, - -0.33047321131338864f, - -0.33034966333915117f, - -0.3302261097044623f, - -0.3301025504114383f, - -0.3299789854621963f, - -0.32985541485885267f, - -0.3297318386035264f, - -0.3296082566983342f, - -0.3294846691453936f, - -0.3293610759468222f, - -0.3292374771047369f, - -0.3291138726212572f, - -0.32899026249850016f, - -0.3288666467385839f, - -0.32874302534362565f, - -0.3286193983157453f, - -0.3284957656570604f, - -0.32837212736968924f, - -0.3282484834557496f, - -0.3281248339173617f, - -0.3280011787566434f, - -0.3278775179757135f, - -0.3277538515766901f, - -0.3276301795616938f, - -0.32750650193284214f, - -0.32738281869225666f, - -0.32725912984205335f, - -0.3271354353843541f, - -0.3270117353212767f, - -0.3268880296549433f, - -0.32676431838747005f, - -0.3266406015209794f, - -0.3265168790575894f, - -0.32639315099942173f, - -0.32626941734859566f, - -0.3261456781072312f, - -0.32602193327744783f, - -0.32589818286136757f, - -0.32577442686111f, - -0.3256506652787956f, - -0.3255268981165442f, - -0.32540312537647825f, - -0.3252793470607176f, - -0.3251555631713832f, - -0.3250317737105953f, - -0.32490797868047655f, - -0.32478417808314736f, - -0.32466037192072905f, - -0.3245365601953421f, - -0.3244127429091097f, - -0.32428892006415266f, - -0.32416509166259255f, - -0.32404125770655035f, - -0.32391741819814956f, - -0.3237935731395113f, - -0.32366972253275766f, - -0.3235458663800108f, - -0.32342200468339205f, - -0.3232981374450255f, - -0.3231742646670318f, - -0.32305038635153616f, - -0.3229265025006577f, - -0.3228026131165217f, - -0.32267871820124927f, - -0.3225548177569659f, - -0.32243091178579114f, - -0.3223070002898507f, - -0.322183083271266f, - -0.32205916073216295f, - -0.32193523267466145f, - -0.32181129910088757f, - -0.3216873600129632f, - -0.32156341541301364f, - -0.32143946530316186f, - -0.3213155096855317f, - -0.3211915485622462f, - -0.32106758193543117f, - -0.3209436098072098f, - -0.32081963217970644f, - -0.3206956490550445f, - -0.32057166043535007f, - -0.3204476663227469f, - -0.32032366671935947f, - -0.3201996616273118f, - -0.32007565104873015f, - -0.3199516349857379f, - -0.31982761344046257f, - -0.3197035864150258f, - -0.31957955391155524f, - -0.31945551593217536f, - -0.3193314724790115f, - -0.31920742355418835f, - -0.31908336915983304f, - -0.3189593092980704f, - -0.31883524397102536f, - -0.31871117318082537f, - -0.3185870969295955f, - -0.31846301521946185f, - -0.3183389280525496f, - -0.31821483543098666f, - -0.31809073735689847f, - -0.31796663383241147f, - -0.3178425248596512f, - -0.31771841044074606f, - -0.31759429057782174f, - -0.31747016527300503f, - -0.317346034528422f, - -0.31722189834620124f, - -0.31709775672846896f, - -0.3169736096773523f, - -0.3168494571949776f, - -0.3167252992834739f, - -0.31660113594496775f, - -0.3164769671815867f, - -0.3163527929954575f, - -0.31622861338870945f, - -0.3161044283634695f, - -0.31598023792186564f, - -0.3158560420660249f, - -0.3157318407980771f, - -0.31560763412014864f, - -0.3154834220343703f, - -0.3153592045428671f, - -0.3152349816477699f, - -0.3151107533512057f, - -0.3149865196553055f, - -0.31486228056219473f, - -0.31473803607400463f, - -0.3146137861928625f, - -0.3144895309208999f, - -0.31436527026024236f, - -0.31424100421302176f, - -0.31411673278136554f, - -0.3139924559674049f, - -0.31386817377326826f, - -0.3137438862010853f, - -0.3136195932529848f, - -0.31349529493109807f, - -0.3133709912375542f, - -0.31324668217448304f, - -0.3131223677440146f, - -0.3129980479482782f, - -0.31287372278940556f, - -0.31274939226952625f, - -0.3126250563907706f, - -0.3125007151552682f, - -0.3123763685651514f, - -0.3122520166225498f, - -0.31212765932959435f, - -0.31200329668841487f, - -0.3118789287011441f, - -0.3117545553699121f, - -0.31163017669685f, - -0.31150579268408823f, - -0.31138140333375963f, - -0.31125700864799405f, - -0.31113260862892533f, - -0.3110082032786817f, - -0.31088379259939747f, - -0.3107593765932026f, - -0.3106349552622314f, - -0.31051052860861245f, - -0.31038609663448036f, - -0.31026165934196553f, - -0.31013721673320266f, - -0.3100127688103207f, - -0.30988831557545454f, - -0.30976385703073495f, - -0.3096393931782962f, - -0.3095149240202701f, - -0.3093904495587894f, - -0.3092659697959861f, - -0.3091414847339948f, - -0.3090169943749477f, - -0.3088924987209778f, - -0.3087679977742176f, - -0.30864349153680204f, - -0.3085189800108636f, - -0.3083944631985358f, - -0.30826994110195133f, - -0.30814541372324555f, - -0.3080208810645514f, - -0.3078963431280026f, - -0.30777179991573234f, - -0.30764725142987626f, - -0.3075226976725677f, - -0.30739813864594073f, - -0.3072735743521297f, - -0.3071490047932682f, - -0.30702442997149226f, - -0.3068998498889349f, - -0.30677526454773313f, - -0.30665067395001844f, - -0.3065260780979281f, - -0.3064014769935954f, - -0.30627687063915787f, - -0.3061522590367472f, - -0.30602764218850115f, - -0.30590302009655324f, - -0.3057783927630414f, - -0.3056537601900978f, - -0.3055291223798604f, - -0.3054044793344632f, - -0.30527983105604356f, - -0.30515517754673654f, - -0.305030518808678f, - -0.304905854844003f, - -0.30478118565484946f, - -0.30465651124335263f, - -0.30453183161164876f, - -0.3044071467618734f, - -0.3042824566961647f, - -0.3041577614166583f, - -0.3040330609254908f, - -0.30390835522479814f, - -0.3037836443167187f, - -0.3036589282033878f, - -0.3035342068869449f, - -0.3034094803695236f, - -0.3032847486532637f, - -0.3031600117403016f, - -0.30303526963277455f, - -0.30291052233281923f, - -0.30278576984257477f, - -0.30266101216417796f, - -0.3025362492997664f, - -0.3024114812514772f, - -0.30228670802144975f, - -0.30216192961182126f, - -0.30203714602472886f, - -0.3019123572623124f, - -0.3017875633267093f, - -0.30166276422005783f, - -0.3015379599444955f, - -0.30141315050216344f, - -0.30128833589519677f, - -0.3011635161257367f, - -0.3010386911959203f, - -0.3009138611078889f, - -0.30078902586377815f, - -0.30066418546572954f, - -0.3005393399158805f, - -0.3004144892163719f, - -0.3002896333693422f, - -0.30016477237693073f, - -0.3000399062412762f, - -0.2999150349645197f, - -0.29979015854880015f, - -0.2996652769962572f, - -0.29954039030902985f, - -0.2994154984892597f, - -0.299290601539085f, - -0.2991656994606484f, - -0.29904079225608665f, - -0.2989158799275426f, - -0.2987909624771548f, - -0.29866603990706636f, - -0.29854111221941426f, - -0.2984161794163417f, - -0.2982912414999877f, - -0.29816629847249554f, - -0.29804135033600276f, - -0.2979163970926528f, - -0.29779143874458497f, - -0.29766647529394213f, - -0.29754150674286467f, - -0.2974165330934939f, - -0.29729155434797117f, - -0.29716657050843714f, - -0.29704158157703503f, - -0.29691658755590566f, - -0.29679158844719083f, - -0.29666658425303144f, - -0.2965415749755711f, - -0.296416560616951f, - -0.2962915411793132f, - -0.2961665166647991f, - -0.29604148707555256f, - -0.2959164524137151f, - -0.2957914126814292f, - -0.2956663678808365f, - -0.2955413180140813f, - -0.2954162630833055f, - -0.29529120309065177f, - -0.29516613803826225f, - -0.29504106792828155f, - -0.29491599276285185f, - -0.29479091254411627f, - -0.2946658272742172f, - -0.2945407369552997f, - -0.29441564158950534f, - -0.2942905411789802f, - -0.29416543572586445f, - -0.2940403252323043f, - -0.2939152097004417f, - -0.29379008913242316f, - -0.29366496353038907f, - -0.29353983289648605f, - -0.2934146972328564f, - -0.29328955654164607f, - -0.29316441082499844f, - -0.29303926008505776f, - -0.29291410432396775f, - -0.2927889435438745f, - -0.29266377774692187f, - -0.2925386069352544f, - -0.29241343111101614f, - -0.2922882502763535f, - -0.2921630644334107f, - -0.2920378735843328f, - -0.2919126777312639f, - -0.291787476876351f, - -0.29166227102173853f, - -0.2915370601695718f, - -0.29141184432199635f, - -0.2912866234811568f, - -0.2911613976492005f, - -0.2910361668282723f, - -0.29091093102051807f, - -0.29078569022808276f, - -0.290660444453114f, - -0.2905351936977571f, - -0.29040993796415815f, - -0.2902846772544625f, - -0.29015941157081815f, - -0.2900341409153699f, - -0.2899088652902666f, - -0.2897835846976516f, - -0.289658299139674f, - -0.2895330086184788f, - -0.2894077131362155f, - -0.28928241269502747f, - -0.2891571072970643f, - -0.28903179694447134f, - -0.28890648163939836f, - -0.2887811613839892f, - -0.28865583618039364f, - -0.2885305060307575f, - -0.28840517093722995f, - -0.2882798309019577f, - -0.2881544859270884f, - -0.28802913601476904f, - -0.28790378116714904f, - -0.28777842138637555f, - -0.28765305667459656f, - -0.2875276870339593f, - -0.2874023124666137f, - -0.2872769329747071f, - -0.2871515485603878f, - -0.2870261592258035f, - -0.28690076497310435f, - -0.2867753658044381f, - -0.2866499617219534f, - -0.28652455272779825f, - -0.2863991388241231f, - -0.2862737200130761f, - -0.28614829629680627f, - -0.2860228676774618f, - -0.28589743415719365f, - -0.28577199573815015f, - -0.28564655242247994f, - -0.28552110421233484f, - -0.2853956511098611f, - -0.28527019311721086f, - -0.28514473023653203f, - -0.285019262469977f, - -0.2848937898196922f, - -0.28476831228783017f, - -0.28464282987653916f, - -0.28451734258797184f, - -0.28439185042427506f, - -0.28426635338760153f, - -0.28414085148010004f, - -0.2840153447039227f, - -0.2838898330612191f, - -0.28376431655414f, - -0.28363879518483504f, - -0.28351326895545687f, - -0.2833877378681554f, - -0.2832622019250816f, - -0.28313666112838565f, - -0.28301111548022034f, - -0.2828855649827361f, - -0.28276000963808406f, - -0.2826344494484148f, - -0.28250888441588146f, - -0.2823833145426339f, - -0.2822577398308262f, - -0.2821321602826066f, - -0.2820065759001296f, - -0.2818809866855453f, - -0.2817553926410081f, - -0.28162979376866665f, - -0.2815041900706756f, - -0.2813785815491863f, - -0.2812529682063511f, - -0.2811273500443214f, - -0.28100172706525134f, - -0.2808760992712926f, - -0.2807504666645969f, - -0.2806248292473187f, - -0.2804991870216098f, - -0.28037353998962317f, - -0.2802478881535108f, - -0.2801222315154275f, - -0.2799965700775254f, - -0.2798709038419577f, - -0.27974523281087676f, - -0.27961955698643776f, - -0.2794938763707932f, - -0.27936819096609655f, - -0.2792425007745006f, - -0.2791168057981606f, - -0.27899110603922966f, - -0.27886540149986144f, - -0.278739692182209f, - -0.2786139780884282f, - -0.27848825922067205f, - -0.2783625355810949f, - -0.27823680717185f, - -0.27811107399509344f, - -0.2779853360529779f, - -0.27785959334766047f, - -0.27773384588129224f, - -0.27760809365603045f, - -0.27748233667402816f, - -0.27735657493744265f, - -0.27723080844842546f, - -0.27710503720913415f, - -0.276979261221722f, - -0.2768534804883468f, - -0.27672769501116024f, - -0.2766019047923203f, - -0.2764761098339805f, - -0.2763503101382982f, - -0.27622450570742796f, - -0.2760986965435254f, - -0.2759728826487455f, - -0.27584706402524556f, - -0.2757212406751808f, - -0.275595412600707f, - -0.27546957980397946f, - -0.2753437422871559f, - -0.2752179000523917f, - -0.2750920531018432f, - -0.27496620143766665f, - -0.27484034506201765f, - -0.27471448397705445f, - -0.2745886181849328f, - -0.27446274768780937f, - -0.27433687248784f, - -0.27421099258718334f, - -0.2740851079879954f, - -0.27395921869243317f, - -0.27383332470265287f, - -0.27370742602081344f, - -0.27358152264907115f, - -0.2734556145895834f, - -0.2733297018445067f, - -0.2732037844160003f, - -0.27307786230622f, - -0.272951935517326f, - -0.2728260040514726f, - -0.27270006791082024f, - -0.272574127097525f, - -0.2724481816137474f, - -0.27232223146164214f, - -0.27219627664336987f, - -0.2720703171610871f, - -0.2719443530169538f, - -0.27181838421312743f, - -0.27169241075176653f, - -0.2715664326350287f, - -0.27144044986507426f, - -0.27131446244406104f, - -0.27118847037414784f, - -0.2710624736574926f, - -0.27093647229625595f, - -0.27081046629259603f, - -0.27068445564867194f, - -0.270558440366642f, - -0.2704324204486671f, - -0.27030639589690575f, - -0.27018036671351736f, - -0.2700543329006605f, - -0.26992829446049643f, - -0.269802251395184f, - -0.26967620370688283f, - -0.26955015139775196f, - -0.2694240944699529f, - -0.2692980329256448f, - -0.2691719667669876f, - -0.26904589599614154f, - -0.26891982061526587f, - -0.26879374062652256f, - -0.26866765603207027f, - -0.268541566834072f, - -0.2684154730346848f, - -0.26828937463607183f, - -0.2681632716403921f, - -0.2680371640498088f, - -0.26791105186647945f, - -0.26778493509256746f, - -0.2676588137302321f, - -0.26753268778163697f, - -0.2674065572489398f, - -0.26728042213430436f, - -0.26715428243989026f, - -0.2670281381678606f, - -0.26690198932037584f, - -0.2667758358995977f, - -0.26664967790768673f, - -0.26652351534680646f, - -0.2663973482191178f, - -0.2662711765267825f, - -0.2661450002719617f, - -0.26601881945681904f, - -0.265892634083515f, - -0.26576644415421413f, - -0.26564024967107536f, - -0.26551405063626354f, - -0.26538784705193935f, - -0.2652616389202678f, - -0.265135426243408f, - -0.2650092090235252f, - -0.26488298726278114f, - -0.2647567609633387f, - -0.2646305301273598f, - -0.26450429475700915f, - -0.2643780548544489f, - -0.26425181042184115f, - -0.2641255614613509f, - -0.26399930797514054f, - -0.26387304996537336f, - -0.2637467874342119f, - -0.2636205203838214f, - -0.2634942488163644f, - -0.2633679727340047f, - -0.2632416921389051f, - -0.26311540703323183f, - -0.26298911741914555f, - -0.26286282329881255f, - -0.2627365246743953f, - -0.2626102215480595f, - -0.26248391392196857f, - -0.2623576017982866f, - -0.2622312851791772f, - -0.2621049640668064f, - -0.26197863846333785f, - -0.26185230837093615f, - -0.261725973791765f, - -0.26159963472799086f, - -0.26147329118177765f, - -0.2613469431552902f, - -0.2612205906506927f, - -0.2610942336701518f, - -0.26096787221583084f, - -0.2608415062898976f, - -0.26071513589451395f, - -0.2605887610318477f, - -0.2604623817040626f, - -0.2603359979133267f, - -0.260209609661802f, - -0.26008321695165687f, - -0.2599568197850552f, - -0.2598304181641645f, - -0.2597040120911498f, - -0.25957760156817705f, - -0.2594511865974113f, - -0.25932476718102043f, - -0.25919834332116976f, - -0.2590719150200255f, - -0.258945482279754f, - -0.2588190451025207f, - -0.2586926034904939f, - -0.25856615744583916f, - -0.2584397069707232f, - -0.2583132520673118f, - -0.2581867927377735f, - -0.2580603289842743f, - -0.257933860808981f, - -0.25780738821405985f, - -0.25768091120167963f, - -0.2575544297740066f, - -0.257427943933208f, - -0.25730145368145024f, - -0.2571749590209025f, - -0.25704845995373127f, - -0.25692195648210414f, - -0.2567954486081878f, - -0.2566689363341517f, - -0.2565424196621619f, - -0.25641589859438874f, - -0.2562893731329967f, - -0.25616284328015637f, - -0.2560363090380341f, - -0.25590977040880053f, - -0.25578322739462045f, - -0.2556566799976647f, - -0.2555301282201f, - -0.2554035720640973f, - -0.25527701153182164f, - -0.2551504466254443f, - -0.25502387734713206f, - -0.2548973036990554f, - -0.2547707256833824f, - -0.25464414330228174f, - -0.2545175565579217f, - -0.2543909654524729f, - -0.2542643699881037f, - -0.25413777016698313f, - -0.2540111659912797f, - -0.25388455746316446f, - -0.2537579445848059f, - -0.2536313273583735f, - -0.25350470578603596f, - -0.25337807986996463f, - -0.25325144961232837f, - -0.25312481501529693f, - -0.2529981760810402f, - -0.2528715328117272f, - -0.25274488520952965f, - -0.25261823327661675f, - -0.25249157701515873f, - -0.25236491642732484f, - -0.25223825151528717f, - -0.25211158228121433f, - -0.2519849087272794f, - -0.25185823085564935f, - -0.25173154866849745f, - -0.25160486216799266f, - -0.2514781713563082f, - -0.2513514762356115f, - -0.251224776808076f, - -0.25109807307587095f, - -0.25097136504117f, - -0.2508446527061408f, - -0.2507179360729571f, - -0.25059121514378846f, - -0.2504644899208079f, - -0.25033776040618594f, - -0.2502110266020941f, - -0.2500842885107031f, - -0.2499575461341862f, - -0.24983079947471426f, - -0.24970404853445907f, - -0.24957729331559164f, - -0.24945053382028556f, - -0.24932377005071196f, - -0.24919700200904293f, - -0.24907022969744974f, - -0.2489434531181063f, - -0.24881667227318408f, - -0.24868988716485535f, - -0.24856309779529176f, - -0.2484363041666675f, - -0.24830950628115428f, - -0.24818270414092475f, - -0.2480558977481508f, - -0.24792908710500688f, - -0.24780227221366505f, - -0.24767545307629824f, - -0.2475486296950786f, - -0.2474218020721809f, - -0.24729497020977748f, - -0.2471681341100407f, - -0.24704129377514558f, - -0.2469144492072646f, - -0.24678760040857128f, - -0.24666074738123822f, - -0.24653389012744162f, - -0.24640702864935168f, - -0.24628016294914476f, - -0.24615329302899291f, - -0.24602641889107174f, - -0.24589954053755436f, - -0.2457726579706148f, - -0.24564577119242623f, - -0.24551888020516463f, - -0.24539198501100334f, - -0.2452650856121167f, - -0.24513818201067822f, - -0.24501127420886404f, - -0.2448843622088479f, - -0.24475744601280436f, - -0.24463052562290727f, - -0.24450360104133306f, - -0.24437667227025484f, - -0.24424973931185007f, - -0.2441228021682903f, - -0.24399586084175312f, - -0.2438689153344119f, - -0.24374196564844444f, - -0.24361501178602255f, - -0.24348805374932408f, - -0.24336109154052274f, - -0.24323412516179657f, - -0.24310715461531765f, - -0.24298017990326418f, - -0.2428532010278101f, - -0.2427262179911329f, - -0.24259923079540752f, - -0.24247223944280988f, - -0.2423452439355159f, - -0.2422182442757008f, - -0.24209124046554237f, - -0.24196423250721594f, - -0.24183722040289773f, - -0.24171020415476324f, - -0.24158318376499058f, - -0.24145615923575534f, - -0.24132913056923402f, - -0.24120209776760237f, - -0.24107506083303884f, - -0.24094801976771926f, - -0.24082097457382043f, - -0.24069392525351843f, - -0.2405668718089919f, - -0.240439814242417f, - -0.24031275255597087f, - -0.24018568675182975f, - -0.24005861683217267f, - -0.23993154279917603f, - -0.23980446465501723f, - -0.23967738240187283f, - -0.23955029604192213f, - -0.23942320557734093f, - -0.23929611101030954f, - -0.2391690123430022f, - -0.2390419095775993f, - -0.238914802716277f, - -0.23878769176121584f, - -0.23866057671459034f, - -0.23853345757858122f, - -0.23840633435536487f, - -0.23827920704712127f, - -0.23815207565602783f, - -0.2380249401842629f, - -0.23789780063400406f, - -0.23777065700743155f, - -0.2376435093067231f, - -0.23751635753405728f, - -0.23738920169161198f, - -0.2372620417815677f, - -0.23713487780610246f, - -0.23700770976739513f, - -0.23688053766762387f, - -0.23675336150896945f, - -0.23662618129361015f, - -0.23649899702372515f, - -0.23637180870149374f, - -0.23624461632909438f, - -0.23611741990870821f, - -0.23599021944251383f, - -0.2358630149326908f, - -0.23573580638141786f, - -0.23560859379087645f, - -0.2354813771632454f, - -0.23535415650070463f, - -0.23522693180543305f, - -0.23509970307961242f, - -0.23497247032542104f, - -0.2348452335450416f, - -0.23471799274065078f, - -0.23459074791443144f, - -0.23446349906856215f, - -0.23433624620522586f, - -0.2342089893265996f, - -0.2340817284348664f, - -0.2339544635322052f, - -0.2338271946207992f, - -0.23369992170282566f, - -0.23357264478046794f, - -0.2334453638559052f, - -0.2333180789313201f, - -0.23319079000889273f, - -0.23306349709080418f, - -0.23293620017923472f, - -0.23280889927636725f, - -0.23268159438438218f, - -0.23255428550546087f, - -0.23242697264178383f, - -0.23229965579553427f, - -0.23217233496889286f, - -0.23204501016404122f, - -0.23191768138316016f, - -0.23179034862843315f, - -0.23166301190204114f, - -0.231535671206166f, - -0.23140832654298885f, - -0.23128097791469338f, - -0.23115362532346082f, - -0.23102626877147336f, - -0.23089890826091233f, - -0.23077154379396175f, - -0.23064417537280313f, - -0.230516802999618f, - -0.23038942667659143f, - -0.2302620464059026f, - -0.23013466218973663f, - -0.23000727403027454f, - -0.22987988192970168f, - -0.22975248589019745f, - -0.22962508591394729f, - -0.22949768200313245f, - -0.22937027415993855f, - -0.22924286238654526f, - -0.2291154466851383f, - -0.2289880270578992f, - -0.22886060350701298f, - -0.22873317603466217f, - -0.22860574464303018f, - -0.22847830933429963f, - -0.22835087011065586f, - -0.2282234269742816f, - -0.2280959799273606f, - -0.22796852897207573f, - -0.22784107411061258f, - -0.22771361534515416f, - -0.22758615267788448f, - -0.22745868611098669f, - -0.22733121564664663f, - -0.22720374128704673f, - -0.22707626303437384f, - -0.2269487808908088f, - -0.22682129485853858f, - -0.22669380493974586f, - -0.2265663111366178f, - -0.22643881345133549f, - -0.2263113118860861f, - -0.22618380644305355f, - -0.2260562971244226f, - -0.2259287839323772f, - -0.22580126686910396f, - -0.22567374593678705f, - -0.22554622113761058f, - -0.22541869247376142f, - -0.22529115994742385f, - -0.22516362356078315f, - -0.2250360833160237f, - -0.22490853921533263f, - -0.2247809912608945f, - -0.22465343945489483f, - -0.2245258837995183f, - -0.22439832429695225f, - -0.22427076094938156f, - -0.22414319375899194f, - -0.22401562272796843f, - -0.22388804785849858f, - -0.2237604691527675f, - -0.22363288661296127f, - -0.22350530024126505f, - -0.22337771003986678f, - -0.2232501160109518f, - -0.2231225181567064f, - -0.22299491647931602f, - -0.2228673109809689f, - -0.22273970166384974f, - -0.2226120885301477f, - -0.22248447158204593f, - -0.2223568508217337f, - -0.22222922625139604f, - -0.22210159787322237f, - -0.2219739656893961f, - -0.22184632970210674f, - -0.2217186899135396f, - -0.22159104632588433f, - -0.22146339894132464f, - -0.22133574776205028f, - -0.22120809279024684f, - -0.22108043402810332f, - -0.22095277147780631f, - -0.22082510514154324f, - -0.22069743502150083f, - -0.2205697611198683f, - -0.22044208343883256f, - -0.22031440198058125f, - -0.22018671674730217f, - -0.22005902774118233f, - -0.21993133496441136f, - -0.2198036384191764f, - -0.21967593810766547f, - -0.2195482340320658f, - -0.21942052619456737f, - -0.21929281459735744f, - -0.21916509924262442f, - -0.21903738013255575f, - -0.21890965726934164f, - -0.21878193065516965f, - -0.21865420029222843f, - -0.21852646618270566f, - -0.2183987283287918f, - -0.2182709867326739f, - -0.2181432413965433f, - -0.2180154923225855f, - -0.21788773951299195f, - -0.21775998296995003f, - -0.21763222269565136f, - -0.21750445869228158f, - -0.21737669096203258f, - -0.2172489195070918f, - -0.2171211443296512f, - -0.21699336543189676f, - -0.21686558281602047f, - -0.21673779648421015f, - -0.2166100064386571f, - -0.21648221268155013f, - -0.2163544152150789f, - -0.21622661404143237f, - -0.21609880916280208f, - -0.21597100058137708f, - -0.21584318829934732f, - -0.215715372318902f, - -0.2155875526422329f, - -0.21545972927152934f, - -0.21533190220898152f, - -0.21520407145677886f, - -0.21507623701711345f, - -0.21494839889217482f, - -0.21482055708415346f, - -0.214692711595239f, - -0.21456486242762382f, - -0.21443700958349768f, - -0.2143091530650513f, - -0.21418129287447463f, - -0.21405342901396024f, - -0.21392556148569816f, - -0.21379769029187937f, - -0.21366981543469493f, - -0.21354193691633505f, - -0.21341405473899266f, - -0.21328616890485722f, - -0.21315827941612264f, - -0.21303038627497678f, - -0.21290248948361368f, - -0.21277458904422306f, - -0.2126466849589991f, - -0.21251877723012988f, - -0.2123908658598097f, - -0.21226295085022856f, - -0.21213503220357996f, - -0.2120071099220549f, - -0.21187918400784528f, - -0.21175125446314222f, - -0.2116233212901395f, - -0.21149538449102834f, - -0.2113674440680009f, - -0.21123950002324854f, - -0.21111155235896528f, - -0.2109836010773426f, - -0.21085564618057293f, - -0.21072768767084785f, - -0.21059972555036163f, - -0.21047175982130514f, - -0.21034379048587368f, - -0.21021581754625643f, - -0.2100878410046488f, - -0.20995986086324278f, - -0.2098318771242313f, - -0.2097038897898064f, - -0.20957589886216285f, - -0.20944790434349292f, - -0.20931990623598973f, - -0.2091919045418456f, - -0.2090638992632556f, - -0.20893589040241217f, - -0.20880787796150782f, - -0.20867986194273777f, - -0.20855184234829466f, - -0.20842381918037206f, - -0.20829579244116278f, - -0.20816776213286223f, - -0.20803972825766331f, - -0.20791169081775987f, - -0.2077836498153449f, - -0.20765560525261495f, - -0.20752755713176058f, - -0.20739950545497843f, - -0.20727145022446095f, - -0.207143391442404f, - -0.20701532911100104f, - -0.2068872632324463f, - -0.20675919380893337f, - -0.20663112084265836f, - -0.20650304433581493f, - -0.2063749642905976f, - -0.20624688070920016f, - -0.20611879359381902f, - -0.205990702946648f, - -0.20586260876988197f, - -0.2057345110657149f, - -0.20560640983634337f, - -0.20547830508396073f, - -0.20535019681076458f, - -0.20522208501894654f, - -0.2050939697107044f, - -0.2049658508882316f, - -0.2048377285537261f, - -0.20470960270937968f, - -0.2045814733573904f, - -0.204453340499952f, - -0.2043252041392617f, - -0.20419706427751422f, - -0.20406892091690523f, - -0.20394077405962951f, - -0.2038126237078846f, - -0.20368446986386549f, - -0.20355631252976797f, - -0.20342815170778805f, - -0.2032999874001208f, - -0.2031718196089641f, - -0.20304364833651317f, - -0.20291547358496415f, - -0.20278729535651246f, - -0.2026591136533561f, - -0.20253092847769058f, - -0.20240273983171234f, - -0.20227454771761694f, - -0.2021463521376027f, - -0.2020181530938653f, - -0.20188995058860146f, - -0.20176174462400698f, - -0.20163353520228036f, - -0.2015053223256176f, - -0.2013771059962156f, - -0.2012488862162704f, - -0.20112066298798079f, - -0.20099243631354208f, - -0.20086420619515402f, - -0.2007359726350103f, - -0.20060773563531079f, - -0.20047949519825106f, - -0.20035125132603107f, - -0.2002230040208448f, - -0.20009475328489232f, - -0.1999664991203694f, - -0.1998382415294763f, - -0.1997099805144072f, - -0.19958171607736236f, - -0.1994534482205379f, - -0.19932517694613336f, - -0.19919690225634573f, - -0.19906862415337304f, - -0.19894034263941235f, - -0.19881205771666352f, - -0.1986837693873238f, - -0.19855547765359136f, - -0.19842718251766356f, - -0.1982988839817405f, - -0.19817058204801963f, - -0.19804227671869937f, - -0.19791396799597732f, - -0.19778565588205377f, - -0.19765734037912644f, - -0.197529021489394f, - -0.19740069921505513f, - -0.19727237355830773f, - -0.1971440445213524f, - -0.1970157121063871f, - -0.19688737631561082f, - -0.19675903715122164f, - -0.1966306946154204f, - -0.19650234871040448f, - -0.1963739994383756f, - -0.1962456468015296f, - -0.1961172908020683f, - -0.19598893144218935f, - -0.19586056872409474f, - -0.19573220264998045f, - -0.19560383322204863f, - -0.1954754604424971f, - -0.19534708431352812f, - -0.19521870483733786f, - -0.19509032201612872f, - -0.19496193585209873f, - -0.19483354634744954f, - -0.19470515350438014f, - -0.19457675732509055f, - -0.1944483578117799f, - -0.19431995496665008f, - -0.19419154879190031f, - -0.19406313928973082f, - -0.193934726462341f, - -0.19380631031193288f, - -0.19367789084070602f, - -0.19354946805086082f, - -0.1934210419445969f, - -0.19329261252411653f, - -0.19316417979161948f, - -0.1930357437493064f, - -0.19290730439937714f, - -0.1927788617440342f, - -0.19265041578547754f, - -0.19252196652590806f, - -0.1923935139675258f, - -0.19226505811253355f, - -0.19213659896313146f, - -0.19200813652152066f, - -0.19187967078990145f, - -0.19175120177047678f, - -0.1916227294654471f, - -0.1914942538770128f, - -0.19136577500737798f, - -0.19123729285874053f, - -0.1911088074333046f, - -0.19098031873327004f, - -0.19085182676084106f, - -0.19072333151821583f, - -0.19059483300759872f, - -0.19046633123118975f, - -0.19033782619119255f, - -0.1902093178898081f, - -0.19008080632923838f, - -0.18995229151168452f, - -0.18982377343935034f, - -0.18969525211443708f, - -0.1895667275391469f, - -0.18943819971568124f, - -0.18930966864624404f, - -0.18918113433303682f, - -0.189052596778262f, - -0.1889240559841211f, - -0.18879551195281843f, - -0.18866696468655478f, - -0.18853841418753542f, - -0.18840986045795952f, - -0.18828130350003244f, - -0.18815274331595522f, - -0.1880241799079333f, - -0.18789561327816612f, - -0.18776704342885925f, - -0.18763847036221393f, - -0.18750989408043586f, - -0.18738131458572468f, - -0.18725273188028618f, - -0.18712414596632268f, - -0.18699555684603664f, - -0.18686696452163312f, - -0.18673836899531465f, - -0.18660977026928466f, - -0.18648116834574582f, - -0.1863525632269034f, - -0.18622395491496016f, - -0.18609534341211975f, - -0.18596672872058506f, - -0.18583811084256158f, - -0.18570948978025226f, - -0.185580865535861f, - -0.1854522381115909f, - -0.18532360750964766f, - -0.18519497373223448f, - -0.18506633678155543f, - -0.18493769665981385f, - -0.1848090533692157f, - -0.1846804069119643f, - -0.18455175729026402f, - -0.1844231045063184f, - -0.18429444856233357f, - -0.18416578946051226f, - -0.18403712720306167f, - -0.18390846179218287f, - -0.18377979323008314f, - -0.18365112151896543f, - -0.18352244666103712f, - -0.1833937686584995f, - -0.18326508751356008f, - -0.18313640322842203f, - -0.18300771580529293f, - -0.18287902524637434f, - -0.1827503315538739f, - -0.18262163472999504f, - -0.18249293477694467f, - -0.18236423169692717f, - -0.18223552549214783f, - -0.18210681616481111f, - -0.1819781037171242f, - -0.18184938815129162f, - -0.1817206694695189f, - -0.18159194767401074f, - -0.1814632227669745f, - -0.18133449475061494f, - -0.1812057636271378f, - -0.18107702939874887f, - -0.1809482920676531f, - -0.18081955163605806f, - -0.1806908081061689f, - -0.18056206148019152f, - -0.18043331176033114f, - -0.18030455894879557f, - -0.18017580304779013f, - -0.18004704405952096f, - -0.17991828198619345f, - -0.17978951683001568f, - -0.1796607485931931f, - -0.1795319772779321f, - -0.17940320288643835f, - -0.17927442542092004f, - -0.179145644883582f, - -0.1790168612766335f, - -0.17888807460227765f, - -0.17875928486272388f, - -0.1786304920601772f, - -0.17850169619684703f, - -0.17837289727493677f, - -0.17824409529665597f, - -0.17811529026420989f, - -0.17798648217980817f, - -0.17785767104565442f, - -0.17772885686395842f, - -0.17760003963692558f, - -0.1774712193667649f, - -0.17734239605568286f, - -0.17721356970588675f, - -0.17708474031958313f, - -0.1769559078989812f, - -0.1768270724462876f, - -0.17669823396370987f, - -0.17656939245345477f, - -0.1764405479177317f, - -0.17631170035874752f, - -0.17618284977871f, - -0.17605399617982603f, - -0.1759251395643053f, - -0.17579627993435484f, - -0.17566741729218263f, - -0.17553855163999577f, - -0.17540968298000414f, - -0.175280811314415f, - -0.1751519366454365f, - -0.175023058975276f, - -0.17489417830614357f, - -0.17476529464024662f, - -0.17463640797979268f, - -0.17450751832699282f, - -0.17437862568405205f, - -0.1742497300531815f, - -0.17412083143658805f, - -0.1739919298364829f, - -0.17386302525507133f, - -0.17373411769456465f, - -0.17360520715716993f, - -0.17347629364509862f, - -0.17334737716055615f, - -0.1732184577057541f, - -0.17308953528289966f, - -0.17296060989420367f, - -0.1728316815418744f, - -0.1727027502281209f, - -0.1725738159551516f, - -0.17244487872517744f, - -0.1723159385404069f, - -0.17218699540304927f, - -0.17205804931531316f, - -0.1719291002794097f, - -0.17180014829754756f, - -0.1716711933719363f, - -0.17154223550478465f, - -0.171413274698304f, - -0.1712843109547023f, - -0.171155344276192f, - -0.17102637466497936f, - -0.17089740212327686f, - -0.17076842665329267f, - -0.17063944825723937f, - -0.17051046693732347f, - -0.17038148269575767f, - -0.1702524955347512f, - -0.1701235054565133f, - -0.16999451246325603f, - -0.16986551655718868f, - -0.1697365177405216f, - -0.16960751601546425f, - -0.16947851138422884f, - -0.16934950384902492f, - -0.169220493412063f, - -0.16909148007555277f, - -0.16896246384170657f, - -0.1688334447127342f, - -0.1687044226908464f, - -0.16857539777825298f, - -0.16844636997716655f, - -0.16831733928979709f, - -0.1681883057183555f, - -0.16805926926505182f, - -0.16793022993209886f, - -0.1678011877217068f, - -0.16767214263608668f, - -0.16754309467744885f, - -0.1674140438480062f, - -0.16728499014996917f, - -0.167155933585549f, - -0.16702687415695622f, - -0.16689781186640393f, - -0.16676874671610187f, - -0.16663967870826413f, - -0.16651060784509875f, - -0.16638153412881998f, - -0.1662524575616377f, - -0.1661233781457662f, - -0.16599429588341377f, - -0.16586521077679478f, - -0.16573612282811936f, - -0.165607032039602f, - -0.16547793841345113f, - -0.16534884195188135f, - -0.16521974265710299f, - -0.16509064053132982f, - -0.16496153557677315f, - -0.16483242779564514f, - -0.1647033171901571f, - -0.16457420376252313f, - -0.1644450875149546f, - -0.16431596844966395f, - -0.16418684656886356f, - -0.16405772187476506f, - -0.16392859436958268f, - -0.16379946405552812f, - -0.16367033093481398f, - -0.16354119500965209f, - -0.16341205628225686f, - -0.1632829147548402f, - -0.1631537704296149f, - -0.16302462330879297f, - -0.162895473394589f, - -0.16276632068921515f, - -0.16263716519488433f, - -0.16250800691380876f, - -0.16237884584820328f, - -0.16224968200027926f, - -0.1621205153722525f, - -0.1619913459663328f, - -0.161862173784736f, - -0.1617329988296737f, - -0.16160382110336194f, - -0.1614746406080106f, - -0.16134545734583577f, - -0.16121627131904925f, - -0.16108708252986725f, - -0.16095789098049984f, - -0.16082869667316335f, - -0.16069949961006968f, - -0.1605702997934344f, - -0.16044109722547042f, - -0.16031189190839157f, - -0.1601826838444109f, - -0.16005347303574408f, - -0.15992425948460423f, - -0.15979504319320542f, - -0.15966582416376082f, - -0.15953660239848635f, - -0.1594073778995953f, - -0.15927815066930187f, - -0.1591489207098195f, - -0.15901968802336428f, - -0.15889045261214962f, - -0.15876121447838998f, - -0.15863197362429898f, - -0.1585027300520928f, - -0.1583734837639852f, - -0.15824423476219074f, - -0.15811498304892405f, - -0.15798572862639898f, - -0.157856471496832f, - -0.15772721166243703f, - -0.15759794912542888f, - -0.1574686838880216f, - -0.15733941595243184f, - -0.1572101453208728f, - -0.15708087199556214f, - -0.15695159597871144f, - -0.15682231727253843f, - -0.15669303587925648f, - -0.15656375180108348f, - -0.1564344650402311f, - -0.15630517559891732f, - -0.1561758834793557f, - -0.1560465886837634f, - -0.15591729121435494f, - -0.15578799107334584f, - -0.1556586882629507f, - -0.1555293827853869f, - -0.15540007464286912f, - -0.15527076383761304f, - -0.1551414503718335f, - -0.15501213424774798f, - -0.15488281546757143f, - -0.1547534940335197f, - -0.15462416994780775f, - -0.15449484321265333f, - -0.1543655138302706f, - -0.1542361818028783f, - -0.15410684713268888f, - -0.15397750982192118f, - -0.15384816987279043f, - -0.15371882728751288f, - -0.15358948206830386f, - -0.15346013421738142f, - -0.15333078373696107f, - -0.15320143062925914f, - -0.15307207489649122f, - -0.15294271654087552f, - -0.1528133555646277f, - -0.15268399196996343f, - -0.1525546257591011f, - -0.15242525693425646f, - -0.15229588549764622f, - -0.15216651145148624f, - -0.15203713479799597f, - -0.1519077555393887f, - -0.15177837367788397f, - -0.15164898921569694f, - -0.15151960215504717f, - -0.15139021249814824f, - -0.15126082024721976f, - -0.15113142540447713f, - -0.15100202797213924f, - -0.15087262795242237f, - -0.1507432253475438f, - -0.1506138201597199f, - -0.15048441239116978f, - -0.1503550020441099f, - -0.15022558912075767f, - -0.1500961736233297f, - -0.1499667555540452f, - -0.14983733491512f, - -0.1497079117087743f, - -0.1495784859372222f, - -0.14944905760268404f, - -0.14931962670737578f, - -0.14919019325351782f, - -0.14906075724332443f, - -0.14893131867901613f, - -0.14880187756280902f, - -0.14867243389692372f, - -0.14854298768357466f, - -0.14841353892498252f, - -0.1482840876233636f, - -0.1481546337809378f, - -0.14802517739992235f, - -0.1478957184825355f, - -0.14776625703099544f, - -0.14763679304751962f, - -0.14750732653432813f, - -0.14737785749363844f, - -0.14724838592766898f, - -0.14711891183863732f, - -0.14698943522876373f, - -0.1468599561002659f, - -0.1467304744553624f, - -0.14660099029627094f, - -0.14647150362521202f, - -0.14634201444440345f, - -0.14621252275606403f, - -0.14608302856241162f, - -0.14595353186566687f, - -0.14582403266804778f, - -0.1456945309717733f, - -0.1455650267790615f, - -0.14543552009213317f, - -0.1453060109132065f, - -0.1451764992445006f, - -0.14504698508823372f, - -0.1449174684466268f, - -0.14478794932189734f, - -0.14465842771626725f, - -0.1445289036319523f, - -0.14439937707117456f, - -0.1442698480361516f, - -0.1441403165291055f, - -0.1440107825522523f, - -0.1438812461078141f, - -0.14375170719800875f, - -0.1436221658250585f, - -0.14349262199117946f, - -0.14336307569859402f, - -0.1432335269495201f, - -0.14310397574617928f, - -0.1429744220907905f, - -0.14284486598557364f, - -0.14271530743274768f, - -0.14258574643453437f, - -0.14245618299315282f, - -0.1423266171108231f, - -0.1421970487897643f, - -0.1420674780321984f, - -0.14193790484034466f, - -0.14180832921642322f, - -0.14167875116265355f, - -0.14154917068125758f, - -0.14141958777445485f, - -0.14129000244446566f, - -0.14116041469351048f, - -0.14103082452380883f, - -0.140901231937583f, - -0.1407716369370526f, - -0.14064203952443824f, - -0.14051243970195967f, - -0.14038283747183927f, - -0.14025323283629598f, - -0.14012362579755322f, - -0.13999401635782824f, - -0.13986440451934445f, - -0.13973479028432104f, - -0.13960517365498148f, - -0.13947555463354322f, - -0.1393459332222299f, - -0.1392163094232608f, - -0.1390866832388596f, - -0.1389570546712439f, - -0.13882742372263746f, - -0.13869779039525976f, - -0.13856815469133377f, - -0.1384385166130799f, - -0.13830887616271945f, - -0.13817923334247287f, - -0.13804958815456334f, - -0.13791994060121143f, - -0.13779029068463858f, - -0.13766063840706547f, - -0.13753098377071535f, - -0.137401326777809f, - -0.13727166743056807f, - -0.13714200573121327f, - -0.13701234168196816f, - -0.1368826752850536f, - -0.13675300654269135f, - -0.13662333545710242f, - -0.13649366203051042f, - -0.1363639862651364f, - -0.1362343081632023f, - -0.1361046277269293f, - -0.13597494495854112f, - -0.135845259860259f, - -0.13571557243430415f, - -0.13558588268290053f, - -0.13545619060826944f, - -0.13532649621263312f, - -0.13519679949821298f, - -0.13506710046723394f, - -0.13493739912191488f, - -0.13480769546448082f, - -0.13467798949715243f, - -0.13454828122215484f, - -0.13441857064170704f, - -0.13428885775803423f, - -0.13415914257335723f, - -0.13402942508990046f, - -0.1338997053098857f, - -0.13376998323553566f, - -0.13364025886907221f, - -0.13351053221271994f, - -0.13338080326870075f, - -0.1332510720392375f, - -0.13312133852655228f, - -0.13299160273286978f, - -0.13286186466041208f, - -0.13273212431140222f, - -0.1326023816880624f, - -0.13247263679261745f, - -0.1323428896272888f, - -0.13221314019430225f, - -0.1320833884958775f, - -0.13195363453424044f, - -0.13182387831161263f, - -0.13169411983022006f, - -0.13156435909228253f, - -0.13143459610002614f, - -0.13130483085567257f, - -0.131175063361448f, - -0.13104529361957235f, - -0.13091552163227188f, - -0.13078574740176932f, - -0.13065597093028744f, - -0.13052619222005168f, - -0.13039641127328488f, - -0.1302666280922108f, - -0.13013684267905234f, - -0.13000705503603513f, - -0.12987726516538217f, - -0.12974747306931736f, - -0.12961767875006375f, - -0.1294878822098471f, - -0.12935808345089062f, - -0.1292282824754183f, - -0.12909847928565338f, - -0.1289686738838218f, - -0.1288388662721468f, - -0.12870905645285266f, - -0.12857924442816274f, - -0.12844943020030306f, - -0.12831961377149712f, - -0.12818979514396925f, - -0.12805997431994298f, - -0.12793015130164453f, - -0.12780032609129666f, - -0.12767049869112645f, - -0.127540669103355f, - -0.1274108373302095f, - -0.12728100337391285f, - -0.12715116723669234f, - -0.1270213289207692f, - -0.12689148842837075f, - -0.12676164576172008f, - -0.1266318009230446f, - -0.12650195391456567f, - -0.1263721047385108f, - -0.12624225339710318f, - -0.12611239989256956f, - -0.125982544227134f, - -0.1258526864030216f, - -0.12572282642245655f, - -0.1255929642876657f, - -0.12546310000087335f, - -0.12533323356430465f, - -0.125203364980184f, - -0.12507349425073838f, - -0.12494362137819225f, - -0.1248137463647709f, - -0.12468386921269972f, - -0.12455398992420326f, - -0.12442410850150872f, - -0.12429422494684068f, - -0.12416433926242468f, - -0.12403445145048539f, - -0.12390456151325016f, - -0.12377466945294376f, - -0.12364477527179182f, - -0.12351487897201918f, - -0.12338498055585334f, - -0.1232550800255192f, - -0.12312517738324256f, - -0.12299527263124839f, - -0.12286536577176432f, - -0.12273545680701453f, - -0.1226055457392276f, - -0.12247563257062602f, - -0.12234571730343845f, - -0.12221579993988917f, - -0.12208588048220693f, - -0.12195595893261436f, - -0.12182603529334027f, - -0.12169610956660909f, - -0.12156618175464882f, - -0.12143625185968489f, - -0.12130631988394358f, - -0.12117638582965037f, - -0.12104644969903341f, - -0.12091651149431823f, - -0.1207865712177313f, - -0.12065662887149822f, - -0.12052668445784728f, - -0.12039673797900417f, - -0.12026678943719547f, - -0.12013683883464696f, - -0.12000688617358704f, - -0.11987693145624155f, - -0.11974697468483723f, - -0.11961701586159997f, - -0.11948705498875833f, - -0.11935709206853828f, - -0.11922712710316673f, - -0.11909716009486966f, - -0.11896719104587582f, - -0.11883721995841129f, - -0.11870724683470311f, - -0.11857727167697833f, - -0.11844729448746315f, - -0.11831731526838646f, - -0.11818733402197365f, - -0.11805735075045458f, - -0.11792736545605292f, - -0.1177973781409986f, - -0.11766738880751715f, - -0.11753739745783855f, - -0.11740740409418662f, - -0.11727740871879143f, - -0.11714741133387865f, - -0.11701741194167838f, - -0.11688741054441461f, - -0.11675740714431752f, - -0.11662740174361293f, - -0.11649739434453019f, - -0.11636738494929606f, - -0.11623737356013825f, - -0.11610736017928355f, - -0.11597734480896149f, - -0.11584732745139895f, - -0.11571730810882376f, - -0.11558728678346288f, - -0.11545726347754594f, - -0.1153272381932991f, - -0.11519721093295296f, - -0.11506718169873197f, - -0.11493715049286679f, - -0.11480711731758371f, - -0.11467708217511344f, - -0.1145470450676806f, - -0.11441700599751596f, - -0.11428696496684684f, - -0.11415692197790145f, - -0.11402687703290716f, - -0.11389683013409402f, - -0.11376678128368946f, - -0.11363673048392096f, - -0.11350667773701867f, - -0.11337662304521012f, - -0.11324656641072377f, - -0.11311650783578721f, - -0.11298644732263073f, - -0.112856384873482f, - -0.1127263204905696f, - -0.11259625417612128f, - -0.11246618593236832f, - -0.11233611576153589f, - -0.11220604366585535f, - -0.11207596964755367f, - -0.11194589370886142f, - -0.11181581585200652f, - -0.11168573607921783f, - -0.11155565439272334f, - -0.11142557079475374f, - -0.11129548528753708f, - -0.11116539787330235f, - -0.11103530855427768f, - -0.11090521733269387f, - -0.11077512421077912f, - -0.11064502919076255f, - -0.11051493227487241f, - -0.11038483346533966f, - -0.11025473276439171f, - -0.11012463017426048f, - -0.10999452569717169f, - -0.1098644193353573f, - -0.1097343110910449f, - -0.10960420096646646f, - -0.1094740889638479f, - -0.10934397508542129f, - -0.10921385933341432f, - -0.10908374171005913f, - -0.10895362221758174f, - -0.10882350085821435f, - -0.1086933776341848f, - -0.10856325254772445f, - -0.10843312560106211f, - -0.10830299679642746f, - -0.10817286613605022f, - -0.10804273362215924f, - -0.10791259925698611f, - -0.10778246304275975f, - -0.10765232498171f, - -0.10752218507606585f, - -0.107392043328059f, - -0.1072618997399185f, - -0.10713175431387433f, - -0.1070016070521556f, - -0.10687145795699413f, - -0.1067413070306191f, - -0.1066111542752606f, - -0.10648099969314792f, - -0.10635084328651294f, - -0.10622068505758499f, - -0.1060905250085943f, - -0.10596036314177025f, - -0.10583019945934488f, - -0.10570003396354676f, - -0.10556986665660886f, - -0.10543969754075806f, - -0.10530952661822741f, - -0.10517935389124561f, - -0.10504917936204573f, - -0.1049190030328548f, - -0.10478882490590598f, - -0.10465864498342806f, - -0.1045284632676543f, - -0.1043982797608118f, - -0.10426809446513387f, - -0.1041379073828494f, - -0.10400771851619094f, - -0.1038775278673883f, - -0.10374733543867229f, - -0.10361714123227284f, - -0.10348694525042254f, - -0.1033567474953514f, - -0.1032265479692903f, - -0.10309634667446932f, - -0.10296614361312117f, - -0.10283593878747596f, - -0.10270573219976474f, - -0.10257552385221765f, - -0.10244531374706756f, - -0.10231510188654468f, - -0.10218488827288018f, - -0.10205467290830435f, - -0.10192445579505015f, - -0.10179423693534793f, - -0.10166401633142896f, - -0.10153379398552455f, - -0.10140356989986511f, - -0.1012733440766838f, - -0.1011431165182102f, - -0.1010128872266784f, - -0.10088265620431629f, - -0.100752423453358f, - -0.10062218897603328f, - -0.1004919527745763f, - -0.10036171485121509f, - -0.1002314752081839f, - -0.10010123384771258f, - -0.09997099077203542f, - -0.09984074598338057f, - -0.0997104994839824f, - -0.09958025127607087f, - -0.09945000136187954f, - -0.09931974974363929f, - -0.09918949642358195f, - -0.09905924140393851f, - -0.09892898468694263f, - -0.0987987262748253f, - -0.0986684661698185f, - -0.09853820437415331f, - -0.0984079408900635f, - -0.09827767571978019f, - -0.09814740886553545f, - -0.0980171403295605f, - -0.09788687011408923f, - -0.09775659822135199f, - -0.09762632465358362f, - -0.09749604941301278f, - -0.09736577250187436f, - -0.09723549392239973f, - -0.09710521367682118f, - -0.09697493176737015f, - -0.09684464819628075f, - -0.09671436296578445f, - -0.09658407607811369f, - -0.09645378753549998f, - -0.09632349734017756f, - -0.09619320549437806f, - -0.09606291200033307f, - -0.09593261686027692f, - -0.0958023200764413f, - -0.0956720216510588f, - -0.09554172158636118f, - -0.09541141988458374f, - -0.09528111654795562f, - -0.0951508115787122f, - -0.09502050497908444f, - -0.09489019675130778f, - -0.09475988689761146f, - -0.09462957542023095f, - -0.09449926232139737f, - -0.09436894760334533f, - -0.09423863126830687f, - -0.09410831331851491f, - -0.09397799375620156f, - -0.09384767258360155f, - -0.09371734980294703f, - -0.09358702541647103f, - -0.09345669942640576f, - -0.09332637183498607f, - -0.09319604264444334f, - -0.09306571185701336f, - -0.09293537947492578f, - -0.09280504550041646f, - -0.09267470993571687f, - -0.09254437278306295f, - -0.09241403404468441f, - -0.09228369372281728f, - -0.09215335181969309f, - -0.09202300833754787f, - -0.0918926632786115f, - -0.09176231664512007f, - -0.09163196843930523f, - -0.09150161866340226f, - -0.09137126731964378f, - -0.0912409144102633f, - -0.09111055993749442f, - -0.09098020390356981f, - -0.09084984631072489f, - -0.09071948716119238f, - -0.09058912645720597f, - -0.09045876420099848f, - -0.09032840039480539f, - -0.09019803504085955f, - -0.09006766814139475f, - -0.08993729969864389f, - -0.08980692971484261f, - -0.08967655819222384f, - -0.08954618513302147f, - -0.08941581053946852f, - -0.0892854344138007f, - -0.08915505675825108f, - -0.08902467757505367f, - -0.08889429686644156f, - -0.08876391463465057f, - -0.08863353088191389f, - -0.0885031456104656f, - -0.08837275882253894f, - -0.0882423705203698f, - -0.08811198070619063f, - -0.08798158938223821f, - -0.08785119655074328f, - -0.0877208022139427f, - -0.087590406374069f, - -0.08746000903335911f, - -0.08732961019404382f, - -0.08719920985836016f, - -0.0870688080285407f, - -0.08693840470682161f, - -0.08680799989543646f, - -0.08667759359661967f, - -0.08654718581260486f, - -0.08641677654562827f, - -0.08628636579792358f, - -0.0861559535717253f, - -0.08602553986926717f, - -0.08589512469278553f, - -0.08576470804451414f, - -0.08563428992668763f, - -0.08550387034153983f, - -0.08537344929130719f, - -0.08524302677822355f, - -0.0851126028045237f, - -0.08498217737244237f, - -0.08485175048421353f, - -0.08472132214207374f, - -0.08459089234825698f, - -0.08446046110499814f, - -0.08433002841453123f, - -0.08419959427909295f, - -0.08406915870091737f, - -0.08393872168223947f, - -0.08380828322529336f, - -0.08367784333231584f, - -0.08354740200554021f, - -0.08341695924720419f, - -0.08328651505953932f, - -0.08315606944478342f, - -0.08302562240516984f, - -0.08289517394293643f, - -0.08276472406031482f, - -0.08263427275954292f, - -0.0825038200428542f, - -0.08237336591248658f, - -0.08224291037067182f, - -0.08211245341964789f, - -0.08198199506164837f, - -0.0818515352989104f, - -0.08172107413366848f, - -0.08159061156815804f, - -0.08146014760461363f, - -0.08132968224527248f, - -0.08119921549236919f, - -0.08106874734813929f, - -0.08093827781481741f, - -0.0808078068946409f, - -0.08067733458984445f, - -0.08054686090266366f, - -0.0804163858353333f, - -0.08028590939009077f, - -0.08015543156917086f, - -0.0800249523748093f, - -0.07989447180924092f, - -0.07976398987470322f, - -0.07963350657343111f, - -0.07950302190766038f, - -0.07937253587962596f, - -0.07924204849156548f, - -0.07911155974571389f, - -0.07898106964430622f, - -0.07885057818958102f, - -0.0787200853837707f, - -0.07858959122911387f, - -0.07845909572784475f, - -0.07832859888220198f, - -0.07819810069441806f, - -0.0780676011667317f, - -0.0779371003013772f, - -0.0778065981005933f, - -0.0776760945666126f, - -0.0775455897016739f, - -0.07741508350801157f, - -0.07728457598786359f, - -0.07715406714346529f, - -0.07702355697705288f, - -0.07689304549086175f, - -0.07676253268712994f, - -0.07663201856809287f, - -0.07650150313598687f, - -0.0763709863930474f, - -0.07624046834151259f, - -0.07610994898361795f, - -0.0759794283215999f, - -0.07584890635769398f, - -0.07571838309413843f, - -0.07558785853316796f, - -0.07545733267702173f, - -0.07532680552793272f, - -0.07519627708814013f, - -0.07506574735987875f, - -0.07493521634538786f, - -0.0748046840469005f, - -0.07467415046665596f, - -0.07454361560689005f, - -0.07441307946983941f, - -0.07428254205773988f, - -0.07415200337282994f, - -0.07402146341734546f, - -0.07389092219352231f, - -0.07376037970359905f, - -0.07362983594981164f, - -0.07349929093439686f, - -0.0733687446595907f, - -0.07323819712763181f, - -0.0731076483407562f, - -0.07297709830120079f, - -0.07284654701120163f, - -0.07271599447299745f, - -0.07258544068882435f, - -0.07245488566091933f, - -0.07232432939151855f, - -0.07219377188286079f, - -0.07206321313718225f, - -0.07193265315672004f, - -0.07180209194371036f, - -0.07167152950039211f, - -0.07154096582900157f, - -0.07141040093177592f, - -0.07127983481095145f, - -0.07114926746876714f, - -0.07101869890745847f, - -0.07088812912926537f, - -0.07075755813642155f, - -0.07062698593116697f, - -0.07049641251573718f, - -0.07036583789237218f, - -0.07023526206330578f, - -0.07010468503077803f, - -0.06997410679702457f, - -0.06984352736428544f, - -0.06971294673479458f, - -0.0695823649107921f, - -0.0694517818945137f, - -0.06932119768819868f, - -0.06919061229408366f, - -0.06906002571440618f, - -0.06892943795140294f, - -0.06879884900731328f, - -0.06866825888437394f, - -0.06853766758482253f, - -0.06840707511089583f, - -0.06827648146483326f, - -0.06814588664887161f, - -0.06801529066524861f, - -0.067884693516202f, - -0.06775409520396859f, - -0.06762349573078796f, - -0.067492895098897f, - -0.06736229331053352f, - -0.06723169036793446f, - -0.06710108627333942f, - -0.06697048102898541f, - -0.06683987463711029f, - -0.06670926709995109f, - -0.06657865841974751f, - -0.06644804859873572f, - -0.06631743763915635f, - -0.06618682554324382f, - -0.0660562123132388f, - -0.06592559795137755f, - -0.06579498245990076f, - -0.06566436584104295f, - -0.06553374809704485f, - -0.0654031292301428f, - -0.06527250924257756f, - -0.06514188813658375f, - -0.06501126591440216f, - -0.06488064257826921f, - -0.06475001813042487f, - -0.06461939257310646f, - -0.06448876590855222f, - -0.06435813813899952f, - -0.06422750926668837f, - -0.06409687929385621f, - -0.06396624822274136f, - -0.06383561605558122f, - -0.06370498279461594f, - -0.06357434844208298f, - -0.06344371300022074f, - -0.06331307647126674f, - -0.06318243885746117f, - -0.06305180016104156f, - -0.0629211603842464f, - -0.06279051952931326f, - -0.06265987759848243f, - -0.06252923459399153f, - -0.06239859051807907f, - -0.06226794537298274f, - -0.06213729916094288f, - -0.06200665188419718f, - -0.06187600354498425f, - -0.06174535414554272f, - -0.061614703688110346f, - -0.06148405217492755f, - -0.061353399608231246f, - -0.06122274599026279f, - -0.061092091323257346f, - -0.060961435609456306f, - -0.060830778851096654f, - -0.06070012105041981f, - -0.06056946220966102f, - -0.06043880233106175f, - -0.060308141416859036f, - -0.06017747946929439f, - -0.06004681649060312f, - -0.059916152483026744f, - -0.05978548744880241f, - -0.05965482139017078f, - -0.05952415430936991f, - -0.05939348620863873f, - -0.059262817090215324f, - -0.05913214695634044f, - -0.0590014758092522f, - -0.05887080365118961f, - -0.058740130484390814f, - -0.058609456311096646f, - -0.058478781133544384f, - -0.058348104953975785f, - -0.05821742777462639f, - -0.05808674959773799f, - -0.05795607042554794f, - -0.05782539026029806f, - -0.05769470910422396f, - -0.0575640269595675f, - -0.057433343828566984f, - -0.057302659713461636f, - -0.05717197461648981f, - -0.057041288539892536f, - -0.05691060148590819f, - -0.056779913456775175f, - -0.05664922445473457f, - -0.056518534482024804f, - -0.056387843540885225f, - -0.05625715163355429f, - -0.05612645876227315f, - -0.0559957649292803f, - -0.055865070136815145f, - -0.055734374387116224f, - -0.05560367768242563f, - -0.05547298002497926f, - -0.05534228141701925f, - -0.055211581860783315f, - -0.05508088135851273f, - -0.05495017991244612f, - -0.05481947752482303f, - -0.05468877419788211f, - -0.05455806993386471f, - -0.05442736473500951f, - -0.05429665860355613f, - -0.054165951541743286f, - -0.05403524355181238f, - -0.05390453463600218f, - -0.05377382479655233f, - -0.05364311403570164f, - -0.053512402355691574f, - -0.05338168975876006f, - -0.05325097624714949f, - -0.053120261823096045f, - -0.05298954648884216f, - -0.05285883024662582f, - -0.05272811309868948f, - -0.052597395047269395f, - -0.05246667609460805f, - -0.05233595624294348f, - -0.05220523549451734f, - -0.05207451385156859f, - -0.05194379131633711f, - -0.051813067891061916f, - -0.05168234357798469f, - -0.051551618379344466f, - -0.051420892297381185f, - -0.051290165334334815f, - -0.05115943749244443f, - -0.051028708773951784f, - -0.050897979181096f, - -0.050767248716117104f, - -0.05063651738125422f, - -0.05050578517874918f, - -0.05037505211084116f, - -0.05024431817977022f, - -0.050113583387775586f, - -0.04998284773709913f, - -0.049852111229980074f, - -0.04972137386865856f, - -0.049590635655373846f, - -0.04945989659236789f, - -0.049329156681879954f, - -0.04919841592615025f, - -0.04906767432741809f, - -0.04893693188792548f, - -0.04880618860991087f, - -0.04867544449561718f, - -0.04854469954728113f, - -0.04841395376714565f, - -0.048283207157449264f, - -0.048152459720434936f, - -0.04802171145833946f, - -0.04789096237340581f, - -0.04776021246787257f, - -0.04762946174398277f, - -0.047498710203973234f, - -0.04736795785008702f, - -0.04723720468456275f, - -0.04710645070964264f, - -0.046975695927566216f, - -0.04684494034057393f, - -0.04671418395090537f, - -0.046583426760802765f, - -0.046452668772505736f, - -0.04632190998825477f, - -0.04619115041028951f, - -0.04606039004085225f, - -0.04592962888218265f, - -0.04579886693652127f, - -0.04566810420610779f, - -0.04553734069318457f, - -0.04540657639999132f, - -0.04527581132876865f, - -0.045145045481757184f, - -0.045014278861196674f, - -0.04488351146932954f, - -0.04475274330839557f, - -0.04462197438063543f, - -0.044491204688288925f, - -0.044360434233598534f, - -0.044229663018803204f, - -0.04409889104614632f, - -0.043968118317865075f, - -0.04383734483620289f, - -0.04370657060339876f, - -0.04357579562169612f, - -0.04344501989333222f, - -0.043314243420550534f, - -0.0431834662055901f, - -0.043052688250694415f, - -0.04292190955810077f, - -0.04279113013005269f, - -0.042660349968789264f, - -0.042529569076553156f, - -0.042398787455584376f, - -0.04226800510812382f, - -0.042137222036411535f, - -0.042006438242690215f, - -0.04187565372919993f, - -0.04174486849818163f, - -0.0416140825518754f, - -0.041483295892523996f, - -0.04135250852236752f, - -0.041221720443646984f, - -0.04109093165860252f, - -0.040960142169476924f, - -0.04082935197851036f, - -0.04069856108794389f, - -0.04056776950001767f, - -0.040436977216974576f, - -0.040306184241054796f, - -0.040175390574499446f, - -0.040044596219548735f, - -0.03991380117844558f, - -0.03978300545343023f, - -0.03965220904674382f, - -0.03952141196062663f, - -0.03939061419732162f, - -0.039259815759069075f, - -0.039129016648109305f, - -0.038998216866685295f, - -0.03886741641703737f, - -0.03873661530140677f, - -0.03860581352203384f, - -0.038475011081162504f, - -0.03834420798103047f, - -0.03821340422388168f, - -0.03808259981195565f, - -0.037951794747495445f, - -0.03782098903274149f, - -0.0376901826699351f, - -0.03755937566131673f, - -0.03742856800912949f, - -0.03729775971561385f, - -0.03716695078301118f, - -0.037036141213561954f, - -0.036905331009509344f, - -0.03677452017309386f, - -0.03664370870655691f, - -0.036512896612139016f, - -0.03638208389208339f, - -0.0362512705486297f, - -0.03612045658402206f, - -0.03598964200049838f, - -0.03585882680030279f, - -0.03572801098567501f, - -0.03559719455885919f, - -0.03546637752209328f, - -0.03533555987762146f, - -0.03520474162768347f, - -0.035073922774523536f, - -0.03494310332037963f, - -0.03481228326749597f, - -0.034681462618113244f, - -0.03455064137447214f, - -0.03441981953881602f, - -0.03428899711338559f, - -0.034158174100422455f, - -0.03402735050216735f, - -0.03389652632086367f, - -0.03376570155875217f, - -0.033634876218074504f, - -0.033504050301071425f, - -0.033373223809986384f, - -0.03324239674706017f, - -0.03311156911453447f, - -0.03298074091465009f, - -0.032849912149650516f, - -0.032719082821776574f, - -0.03258825293326998f, - -0.03245742248637159f, - -0.032326591483324923f, - -0.032195759926370845f, - -0.03206492781775112f, - -0.031934095159706626f, - -0.03180326195448093f, - -0.031672428204314935f, - -0.031541593911450436f, - -0.03141075907812836f, - -0.0312799237065923f, - -0.031149087799082313f, - -0.031018251357842894f, - -0.030887414385112343f, - -0.03075657688313518f, - -0.030625738854151496f, - -0.030494900300405824f, - -0.030364061224136495f, - -0.030233221627588073f, - -0.030102381513000674f, - -0.02997154088261799f, - -0.029840699738681052f, - -0.029709858083431784f, - -0.029579015919111235f, - -0.02944817324796313f, - -0.02931733007222853f, - -0.0291864863941494f, - -0.029055642215966824f, - -0.028924797539924555f, - -0.028793952368263695f, - -0.028663106703226242f, - -0.02853226054705331f, - -0.02840141390198869f, - -0.028270566770273516f, - -0.028139719154149815f, - -0.02800887105585963f, - -0.02787802247764412f, - -0.027747173421747113f, - -0.027616323890409786f, - -0.02748547388587421f, - -0.027354623410381577f, - -0.02722377246617575f, - -0.02709292105549794f, - -0.026962069180590242f, - -0.026831216843693887f, - -0.026700364047052765f, - -0.026569510792907234f, - -0.026438657083502088f, - -0.02630780292107592f, - -0.026176948307873545f, - -0.026046093246135344f, - -0.025915237738106146f, - -0.025784381786024577f, - -0.02565352539213548f, - -0.025522668558679268f, - -0.0253918112879008f, - -0.025260953582038732f, - -0.025130095443337937f, - -0.024999236874038856f, - -0.024868377876385492f, - -0.024737518452619192f, - -0.0246066586049822f, - -0.02447579833571587f, - -0.024344937647064233f, - -0.02421407654126867f, - -0.024083215020571445f, - -0.023952353087213954f, - -0.023821490743440248f, - -0.02369062799149173f, - -0.02355976483361071f, - -0.02342890127203859f, - -0.023298037309019467f, - -0.023167172946794767f, - -0.02303630818760682f, - -0.022905443033697067f, - -0.022774577487309624f, - -0.02264371155068595f, - -0.022512845226068393f, - -0.02238197851569843f, - -0.022251111421820194f, - -0.02212024394667518f, - -0.021989376092504873f, - -0.021858507861554324f, - -0.021727639256062373f, - -0.02159677027827408f, - -0.021465900930430073f, - -0.02133503121477543f, - -0.021204161133549018f, - -0.021073290688995917f, - -0.02094241988335679f, - -0.020811548718876728f, - -0.020680677197794626f, - -0.020549805322355598f, - -0.020418933094800317f, - -0.020288060517373023f, - -0.020157187592315294f, - -0.0200263143218696f, - -0.01989544070827753f, - -0.01976456675378335f, - -0.019633692460628658f, - -0.01950281783105595f, - -0.019371942867306837f, - -0.019241067571625605f, - -0.01911019194625388f, - -0.01897931599343418f, - -0.018848439715408137f, - -0.01871756311442006f, - -0.01858668619271071f, - -0.01845580895252529f, - -0.01832493139610279f, - -0.01819405352568843f, - -0.01806317534352299f, - -0.017932296851851697f, - -0.01780141805291357f, - -0.017670538948953835f, - -0.017539659542214193f, - -0.017408779834936335f, - -0.017277899829364625f, - -0.01714701952774077f, - -0.017016138932307367f, - -0.016885258045306134f, - -0.016754376868981454f, - -0.01662349540557505f, - -0.016492613657329548f, - -0.016361731626486676f, - -0.01623084931529084f, - -0.016099966725983787f, - -0.015969083860808152f, - -0.01583820072200569f, - -0.01570731731182083f, - -0.015576433632495331f, - -0.015445549686271848f, - -0.015314665475392156f, - -0.015183781002100697f, - -0.015052896268639253f, - -0.014922011277250498f, - -0.014791126030176223f, - -0.014660240529660886f, - -0.01452935477794629f, - -0.014398468777275124f, - -0.014267582529889198f, - -0.014136696038032989f, - -0.014005809303947422f, - -0.013874922329877875f, - -0.013744035118063505f, - -0.013613147670749694f, - -0.013482259990177388f, - -0.013351372078591975f, - -0.013220483938232634f, - -0.013089595571344759f, - -0.012958706980169312f, - -0.012827818166951699f, - -0.01269692913393111f, - -0.01256603988335296f, - -0.012435150417458221f, - -0.012304260738491429f, - -0.012173370848694453f, - -0.012042480750310057f, - -0.011911590445580118f, - -0.011780699936749182f, - -0.011649809226059136f, - -0.011518918315752757f, - -0.011388027208072823f, - -0.011257135905261232f, - -0.011126244409562547f, - -0.01099535272321867f, - -0.010864460848472394f, - -0.01073356878756563f, - -0.010602676542742951f, - -0.010471784116246274f, - -0.010340891510318407f, - -0.010209998727201268f, - -0.010079105769139448f, - -0.009948212638374872f, - -0.009817319337150361f, - -0.009686425867707849f, - -0.009555532232291932f, - -0.009424638433143666f, - -0.00929374447250854f, - -0.00916285035262584f, - -0.009031956075741062f, - -0.008901061644095268f, - -0.008770167059933963f, - -0.00863927232549644f, - -0.008508377443028207f, - -0.008377482414770338f, - -0.008246587242968346f, - -0.008115691929861535f, - -0.007984796477695422f, - -0.00785390088871109f, - -0.007723005165153177f, - -0.007592109309263657f, - -0.0074612133232853945f, - -0.00733031720946037f, - -0.007199420970033229f, - -0.007068524607245954f, - -0.006937628123341419f, - -0.006806731520561613f, - -0.006675834801151189f, - -0.00654493796735214f, - -0.006414041021407347f, - -0.006283143965558805f, - -0.006152246802051177f, - -0.006021349533126463f, - -0.005890452161027551f, - -0.005759554687996444f, - -0.005628657116277812f, - -0.00549775944811366f, - -0.005366861685746886f, - -0.005235963831420387f, - -0.005105065887376174f, - -0.004974167855858924f, - -0.004843269739110653f, - -0.004712371539374262f, - -0.004581473258891771f, - -0.004450574899907861f, - -0.004319676464663663f, - -0.004188777955404753f, - -0.004057879374370489f, - -0.003926980723806445f, - -0.0037960820059537597f, - -0.003665183223058011f, - -0.003534284377358562f, - -0.0034033854711009925f, - -0.0032724865065264447f, - -0.003141587485879613f, - -0.003010688411402528f, - -0.0028797892853381106f, - -0.002748890109928394f, - -0.002617990887418076f, - -0.002487091620049191f, - -0.002356192310064663f, - -0.002225292959706529f, - -0.0020943935712194888f, - -0.001963494146845581f, - -0.001832594688827731f, - -0.0017016951994079782f, - -0.001570795680831026f, - -0.001439896135338026f, - -0.001308996565174571f, - -0.0011780969725800373f, - -0.0010471973598000183f, - -0.0009162977290765556f, - -0.0007853980826525788f, - -0.0006544984227701298f, - -0.0005235987516739153f, - -0.00039269907160597775f, - -0.0002617993848092476f, - -0.00013089969352576765f, - }; -} // namespace WaveTable diff --git a/Gems/AudioSystem/Code/audiosystem_tests_files.cmake b/Gems/AudioSystem/Code/audiosystem_tests_files.cmake index 5cc8fd6809..c163473703 100644 --- a/Gems/AudioSystem/Code/audiosystem_tests_files.cmake +++ b/Gems/AudioSystem/Code/audiosystem_tests_files.cmake @@ -10,5 +10,4 @@ set(FILES Tests/AudioSystemTest.cpp Tests/Mocks/ATLEntitiesMock.h Tests/Mocks/FileCacheManagerMock.h - Tests/Mocks/IAudioSystemImplementationMock.h ) From bce3320fb50bb6d9cf95468da66a550d7701aec6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:18:54 -0800 Subject: [PATCH 240/620] Remove unused files from Gems/AWSCore Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Disabled/HttpClientComponent_white.png | 3 - .../Icons/Components/HttpClientComponent.png | 3 - .../Viewport/HttpClientComponent.png | 3 - .../Editor/Translation/scriptcanvas_en_us.ts | 171 ------------------ .../Include/Framework/HttpClientComponent.h | 69 ------- .../Code/Include/Framework/JobExecuter.h | 66 ------- .../Include/Framework/MultipartFormData.h | 76 -------- .../Source/Framework/MultipartFormData.cpp | 123 ------------- Gems/AWSCore/Code/awscore_files.cmake | 4 - 9 files changed, 518 deletions(-) delete mode 100644 Assets/Editor/Icons/Components/Disabled/HttpClientComponent_white.png delete mode 100644 Assets/Editor/Icons/Components/HttpClientComponent.png delete mode 100644 Assets/Editor/Icons/Components/Viewport/HttpClientComponent.png delete mode 100644 Gems/AWSCore/Code/Include/Framework/HttpClientComponent.h delete mode 100644 Gems/AWSCore/Code/Include/Framework/JobExecuter.h delete mode 100644 Gems/AWSCore/Code/Include/Framework/MultipartFormData.h delete mode 100644 Gems/AWSCore/Code/Source/Framework/MultipartFormData.cpp diff --git a/Assets/Editor/Icons/Components/Disabled/HttpClientComponent_white.png b/Assets/Editor/Icons/Components/Disabled/HttpClientComponent_white.png deleted file mode 100644 index 12b5be2ccc..0000000000 --- a/Assets/Editor/Icons/Components/Disabled/HttpClientComponent_white.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bfc2ef8c6dbf2fba078e27e4e94384099e090468e679327dd826a5cbf22b04ed -size 1019 diff --git a/Assets/Editor/Icons/Components/HttpClientComponent.png b/Assets/Editor/Icons/Components/HttpClientComponent.png deleted file mode 100644 index 7a619a5a59..0000000000 --- a/Assets/Editor/Icons/Components/HttpClientComponent.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:708b12d41229afab78e0f7d59097ae3de855fea8525a920c5c214fc0ce79f1bd -size 1209 diff --git a/Assets/Editor/Icons/Components/Viewport/HttpClientComponent.png b/Assets/Editor/Icons/Components/Viewport/HttpClientComponent.png deleted file mode 100644 index 16e4917180..0000000000 --- a/Assets/Editor/Icons/Components/Viewport/HttpClientComponent.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fab63af9b50790dca25330058e70517987ea8bf11c00f9353dd951ebdbd1dbe5 -size 5008 diff --git a/Assets/Editor/Translation/scriptcanvas_en_us.ts b/Assets/Editor/Translation/scriptcanvas_en_us.ts index 6d436b7caf..bfbd8cf316 100644 --- a/Assets/Editor/Translation/scriptcanvas_en_us.ts +++ b/Assets/Editor/Translation/scriptcanvas_en_us.ts @@ -49513,106 +49513,6 @@ An Entity can be selected by using the pick button, or by dragging an Entity fro - - Handler: HttpClientComponentNotificationBus - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_NAME - HttpClientComponentNotificationBus - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_CATEGORY - Networking - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_NAME - Class/Bus: HttpClientComponentNotificationBus Event/Method: OnHttpRequestSuccess - OnHttpRequestSuccess - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_CATEGORY - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_OUT_NAME - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_OUT_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_IN_NAME - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_IN_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_OUTPUT0_NAME - Simple Type: Number C++ Type: int - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_OUTPUT0_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_OUTPUT1_NAME - Simple Type: String C++ Type: AZStd::basic_string<char, AZStd::char_traits<char>, allocator> - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_OUTPUT1_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_NAME - Class/Bus: HttpClientComponentNotificationBus Event/Method: OnHttpRequestFailure - OnHttpRequestFailure - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_CATEGORY - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_OUT_NAME - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_OUT_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_IN_NAME - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_IN_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_OUTPUT0_NAME - Simple Type: Number C++ Type: int - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_OUTPUT0_TOOLTIP - - - Handler: InputEventNotificationBus @@ -79046,77 +78946,6 @@ The element is removed from its current parent and added as a child of the new p - - EBus: HttpClientComponentRequestBus - - HTTPCLIENTCOMPONENTREQUESTBUS_NAME - HttpClientComponentRequestBus - - - HTTPCLIENTCOMPONENTREQUESTBUS_TOOLTIP - - - - HTTPCLIENTCOMPONENTREQUESTBUS_CATEGORY - Networking - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_NAME - Class/Bus: HttpClientComponentRequestBus Event/Method: MakeHttpRequest - MakeHttpRequest - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_TOOLTIP - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_CATEGORY - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_OUT_NAME - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_OUT_TOOLTIP - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_IN_NAME - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_IN_TOOLTIP - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_PARAM0_NAME - Simple Type: String C++ Type: AZStd::basic_string<char, AZStd::char_traits<char>, allocator> - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_PARAM0_TOOLTIP - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_PARAM1_NAME - Simple Type: String C++ Type: AZStd::basic_string<char, AZStd::char_traits<char>, allocator> - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_PARAM1_TOOLTIP - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_PARAM2_NAME - Simple Type: String C++ Type: AZStd::basic_string<char, AZStd::char_traits<char>, allocator> - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_PARAM2_TOOLTIP - - - Handler: AWSBehaviorURLNotificationsBus diff --git a/Gems/AWSCore/Code/Include/Framework/HttpClientComponent.h b/Gems/AWSCore/Code/Include/Framework/HttpClientComponent.h deleted file mode 100644 index 48b59cc56a..0000000000 --- a/Gems/AWSCore/Code/Include/Framework/HttpClientComponent.h +++ /dev/null @@ -1,69 +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 - * - */ - -#pragma once - -#include -#include -#include -#include -#include -#include - - - -#include - - -namespace AWSCore -{ - ///////////////////////////////////////////// - // EBus Definitions - ///////////////////////////////////////////// - class HttpClientComponentRequests - : public AZ::ComponentBus - { - public: - virtual ~HttpClientComponentRequests() {} - virtual void MakeHttpRequest(AZStd::string url, AZStd::string method, AZStd::string jsonBody) {} - }; - - using HttpClientComponentRequestBus = AZ::EBus; - - class HttpClientComponentNotifications - : public AZ::ComponentBus - { - public: - ~HttpClientComponentNotifications() override = default; - virtual void OnHttpRequestSuccess(int responseCode, AZStd::string responseBody) {} - virtual void OnHttpRequestFailure(int responseCode) {} - }; - - using HttpClientComponentNotificationBus = AZ::EBus; - - ///////////////////////////////////////////// - // Entity Component - ///////////////////////////////////////////// - class HttpClientComponent - : public AZ::Component - , public HttpClientComponentRequestBus::Handler - { - public: - AZ_COMPONENT(HttpClientComponent, "{23ECDBDF-129A-4670-B9B4-1E0B541ACD61}"); - ~HttpClientComponent() override = default; - - void Init() override; - void Activate() override; - void Deactivate() override; - - void MakeHttpRequest(AZStd::string, AZStd::string, AZStd::string) override; - - static void Reflect(AZ::ReflectContext*); - }; - -} // namespace AWSCore diff --git a/Gems/AWSCore/Code/Include/Framework/JobExecuter.h b/Gems/AWSCore/Code/Include/Framework/JobExecuter.h deleted file mode 100644 index 899644ed61..0000000000 --- a/Gems/AWSCore/Code/Include/Framework/JobExecuter.h +++ /dev/null @@ -1,66 +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 - * - */ - -#pragma once - -#include -#include - -#include - -namespace AWSCore -{ - - /// AZ:Job type used by the JobExecuter. It is used call the callback - /// function provided by the AWS SDK. - using ExecuterJob = AZ::JobFunction>; - - /// This class provides a simple alternative to using the the AwsRequestJob, - /// AwsApiClientJob, or AwsApiJob classes. Those classes provide configuration - /// management and more abstracted usage patterns. With JobExecutor you need - /// to do all the configuration management and work directly with the AWS API. - /// - /// An AWS API async executer that uses the AZ::Job system to make AWS service calls. - /// To use, set the Aws::Client::ClientConfiguration executor field so it points to - /// an instance of this class, then use that client configuration object when creating - /// AWS service client objects. This will cause the Async APIs on the AWS service - /// client object to use the AZ::Job system to execute the request. - class JobExecuter - : public Aws::Utils::Threading::Executor - { - - public: - /// Initialize a JobExecuter object. - /// - /// \param context - The JobContext that will be used to execute the jobs created - /// by the JobExecuter. - /// - /// By default the global JobContext is used. However, the AWS SDK currently - /// only supports blocking calls, so, to avoid impacting other jobs, it is - /// recommended that you create a JobContext with a JobManager dedicated to - /// dedicated to processing these jobs. This context can also be used with - /// AwsApiCore::HttpJob. - JobExecuter(AZ::JobContext* context) - : m_context{ context } - { - } - - protected: - AZ::JobContext* m_context; - - /// Called by the AWS SDK to queue a callback for execution. - bool SubmitToThread(std::function&& callback) override - { - ExecuterJob* job = aznew ExecuterJob(callback, true, m_context); - job->Start(); - } - - }; - -} // namespace AWCore - diff --git a/Gems/AWSCore/Code/Include/Framework/MultipartFormData.h b/Gems/AWSCore/Code/Include/Framework/MultipartFormData.h deleted file mode 100644 index 153cbac644..0000000000 --- a/Gems/AWSCore/Code/Include/Framework/MultipartFormData.h +++ /dev/null @@ -1,76 +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 - * - */ - -#pragma once - -#include -#include -#include - -namespace AWSCore -{ - /// Class for generating multi-part form data capable of sending files via HTTP POST. - /// The current implementation writes the entire contents of the file to an output buffer in a single operation, - /// i.e. there is no streaming for large files. - /// A stream-based solution would require better bridging of types between CGF and AWS. - class MultipartFormData - { - public: - struct ComposeResult - { - AZStd::string m_content; // Use for the request body - AZStd::string m_contentLength; // Use for the 'Content-Length' HTTP header field - AZStd::string m_contentType; // Use for the 'Content-Type' HTTP header field - }; - - public: - AZ_CLASS_ALLOCATOR(MultipartFormData, AZ::SystemAllocator, 0); - - /// Add a field/value pair to the form - void AddField(AZStd::string name, AZStd::string value); - - /// Add a file's contents to the form - void AddFile(AZStd::string fieldName, AZStd::string fileName, const char* path); - void AddFileBytes(AZStd::string fieldName, AZStd::string fileName, const void* bytes, size_t length); - - /// Set a custom boundary delimiter to use in the form. This is optional; a random one will be generated normally. - void SetCustomBoundary(AZStd::string boundary); - - /// Compose the form's contents and returns those contents along with metadata. - ComposeResult ComposeForm(); - - private: - struct Field - { - AZStd::string m_fieldName; - AZStd::string m_value; - }; - - struct FileField - { - AZStd::string m_fieldName; - AZStd::string m_fileName; - AZStd::vector m_fileData; - }; - - using Fields = AZStd::vector; - using FileFields = AZStd::vector; - - private: - void Prepare(); - size_t EstimateBodySize() const; - - private: - AZStd::string m_boundary; - AZStd::string m_separator; - AZStd::string m_composedBody; - Fields m_fields; - FileFields m_fileFields; - }; - -} // namespace AWSCore diff --git a/Gems/AWSCore/Code/Source/Framework/MultipartFormData.cpp b/Gems/AWSCore/Code/Source/Framework/MultipartFormData.cpp deleted file mode 100644 index 47059ac156..0000000000 --- a/Gems/AWSCore/Code/Source/Framework/MultipartFormData.cpp +++ /dev/null @@ -1,123 +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 - * - */ - -#include -#include - -namespace AWSCore -{ - namespace Detail - { - namespace - { - const char FIELD_HEADER_FMT[] = "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n"; - const char FILE_HEADER_FMT[] = "--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\n\r\n"; - const char FOOTER_FMT[] = "--%s--\r\n"; - const char ENTRY_SEPARATOR[] = "\r\n"; - } - } - - void MultipartFormData::AddField(AZStd::string name, AZStd::string value) - { - m_fields.emplace_back(Field{ std::move(name), std::move(value) }); - } - - void MultipartFormData::AddFile(AZStd::string fieldName, AZStd::string fileName, const char* path) - { - AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetDirectInstance(); - - AZ::IO::HandleType fileHandle; - - if (fileIO->Open(path, AZ::IO::OpenMode::ModeRead | AZ::IO::OpenMode::ModeBinary, fileHandle)) { - m_fileFields.emplace_back(FileField{ std::move(fieldName), std::move(fileName) , AZStd::vector{} }); - auto destFileBuffer = &m_fileFields.back().m_fileData; - AZ::u64 size; - if (fileIO->Size(path, size) && size > 0) { - destFileBuffer->resize(size); - fileIO->Read(fileHandle, &destFileBuffer->at(0), destFileBuffer->size()); - } - } - fileIO->Close(fileHandle); - } - - void MultipartFormData::AddFileBytes(AZStd::string fieldName, AZStd::string fileName, const void* bytes, size_t length) - { - m_fileFields.emplace_back(FileField{ std::move(fieldName), std::move(fileName) , AZStd::vector{} }); - m_fileFields.back().m_fileData.reserve(length); - m_fileFields.back().m_fileData.assign(static_cast(bytes), static_cast(bytes) + length); - } - - void MultipartFormData::SetCustomBoundary(AZStd::string boundary) - { - m_boundary = boundary; - } - - void MultipartFormData::Prepare() - { - if (m_boundary.empty()) - { - char buffer[33]; - AZ::Uuid::CreateRandom().ToString(buffer, sizeof(buffer), false, false); - m_boundary = buffer; - } - } - - size_t MultipartFormData::EstimateBodySize() const - { - // Estimate the size of the final string as best we can to avoid unnecessary copies - const size_t boundarySize = m_boundary.length(); - const size_t individualFieldBaseSize = boundarySize + sizeof(Detail::FIELD_HEADER_FMT) + sizeof(Detail::ENTRY_SEPARATOR); - const size_t individualFileBaseSize = boundarySize + sizeof(Detail::FILE_HEADER_FMT) + sizeof(Detail::ENTRY_SEPARATOR); - size_t estimatedSize = sizeof(Detail::FOOTER_FMT) + boundarySize; - - for (const auto& field : m_fields) - { - estimatedSize += individualFieldBaseSize + field.m_fieldName.length() + field.m_value.length(); - } - - for (const auto& fileField : m_fileFields) - { - estimatedSize += individualFileBaseSize + fileField.m_fieldName.length() + fileField.m_fileName.length() + fileField.m_fileData.size(); - } - - return estimatedSize; - } - - MultipartFormData::ComposeResult MultipartFormData::ComposeForm() - { - ComposeResult result; - Prepare(); - - // Build the form body - result.m_content.reserve(EstimateBodySize()); - - for (const auto& field : m_fields) - { - result.m_content.append(AZStd::string::format(Detail::FIELD_HEADER_FMT, m_boundary.c_str(), field.m_fieldName.c_str())); - result.m_content.append(field.m_value); - result.m_content.append(Detail::ENTRY_SEPARATOR); - } - - for (const auto& fileField : m_fileFields) - { - result.m_content.append(AZStd::string::format(Detail::FILE_HEADER_FMT, m_boundary.c_str(), fileField.m_fieldName.c_str(), fileField.m_fileName.c_str())); - result.m_content.append(fileField.m_fileData.begin(), fileField.m_fileData.end()); - result.m_content.append(Detail::ENTRY_SEPARATOR); - } - - result.m_content.append(AZStd::string::format(Detail::FOOTER_FMT, m_boundary.c_str())); - - // Populate the metadata - result.m_contentLength = AZStd::string::format("%zu", result.m_content.length()); - result.m_contentType = AZStd::string::format("multipart/form-data; boundary=%s", m_boundary.c_str()); - - return result; - } - - -} // namespace AWSCore diff --git a/Gems/AWSCore/Code/awscore_files.cmake b/Gems/AWSCore/Code/awscore_files.cmake index 9abc162f8a..c59802119c 100644 --- a/Gems/AWSCore/Code/awscore_files.cmake +++ b/Gems/AWSCore/Code/awscore_files.cmake @@ -16,13 +16,10 @@ set(FILES Include/Framework/AWSApiRequestJob.h Include/Framework/AWSApiRequestJobConfig.h Include/Framework/Error.h - Include/Framework/HttpClientComponent.h Include/Framework/HttpRequestJob.h Include/Framework/HttpRequestJobConfig.h - Include/Framework/JobExecuter.h Include/Framework/JsonObjectHandler.h Include/Framework/JsonWriter.h - Include/Framework/MultipartFormData.h Include/Framework/RequestBuilder.h Include/Framework/ServiceClientJob.h Include/Framework/ServiceClientJobConfig.h @@ -61,7 +58,6 @@ set(FILES Source/Framework/HttpRequestJob.cpp Source/Framework/HttpRequestJobConfig.cpp Source/Framework/JsonObjectHandler.cpp - Source/Framework/MultipartFormData.cpp Source/Framework/RequestBuilder.cpp Source/Framework/ServiceJob.cpp Source/Framework/ServiceJobConfig.cpp From 4fe43c81cf3e5d4b4afd329f470b351d27e04bc4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:27:14 -0800 Subject: [PATCH 241/620] Removes ExporterFileProcessor from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../CommandSystem/Source/ActorCommands.cpp | 1 - .../Source/AnimGraphCommands.cpp | 1 - .../CommandSystem/Source/MotionCommands.cpp | 1 - .../Source/MotionSetCommands.cpp | 1 - .../Exporter/ExporterFileProcessor.cpp | 127 ------------------ .../Exporter/ExporterFileProcessor.h | 46 ------- .../ExporterLib/exporterlib_files.cmake | 2 - .../Behaviors/ActorGroupBehavior.cpp | 1 + .../SceneAPIExt/Groups/MotionGroup.cpp | 1 - .../Code/EMotionFX/Source/MotionManager.h | 1 + 10 files changed, 2 insertions(+), 180 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.cpp delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp index ef573ab40c..fc22a81726 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp index b1a830c838..69a7068f58 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionCommands.cpp index 2bec066549..5da75006dd 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionCommands.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionSetCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionSetCommands.cpp index 34fee273c2..08d1e62528 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionSetCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionSetCommands.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include namespace CommandSystem diff --git a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.cpp b/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.cpp deleted file mode 100644 index 1d6687f135..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.cpp +++ /dev/null @@ -1,127 +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 - * - */ - -// include the required headers -#include "ExporterFileProcessor.h" -#include "Exporter.h" -#include -#include -#include - - -namespace ExporterLib -{ -#define PREPARE_DISKFILE_SAVE(EXTENSION) \ - AZ::Debug::Timer saveTimer; \ - saveTimer.Stamp(); \ - if (filenameWithoutExtension.empty()) \ - { \ - MCore::LogError("Cannot save file. Empty FileName."); \ - return false; \ - } \ - AZStd::string extension; \ - AzFramework::StringFunc::Path::GetExtension(filenameWithoutExtension.c_str(), extension); \ - if (!extension.empty()) \ - { \ - AzFramework::StringFunc::Replace(filenameWithoutExtension, extension.c_str(), EXTENSION(), true, false, true); \ - } \ - else \ - { \ - filenameWithoutExtension += EXTENSION(); \ - } \ - \ - MCore::MemoryFile memoryFile; \ - memoryFile.Open(); \ - - -#define FINISH_DISKFILE_SAVE \ - bool result = memoryFile.SaveToDiskFile(filenameWithoutExtension.c_str()); \ - const float saveTime = saveTimer.GetDeltaTimeInSeconds() * 1000.0f; \ - MCore::LogInfo("Saved file '%s' in %.2f ms.", filenameWithoutExtension.c_str(), saveTime); \ - return result; - - - // constructor - Exporter::Exporter() - : EMotionFX::BaseObject() - { - } - - - // destructor - Exporter::~Exporter() - { - } - - - // create the exporter - Exporter* Exporter::Create() - { - return new Exporter(); - } - - - void Exporter::Delete() - { - delete this; - } - - - // make the memory file ready for saving - void Exporter::ResetMemoryFile(MCore::MemoryFile* file) - { - // make sure the file is valid - MCORE_ASSERT(file); - - // reset the incoming memory file - file->Close(); - file->Open(); - file->SetPreAllocSize(262144); // 256kB - file->Seek(0); - } - - - // actor - bool Exporter::SaveActor(MCore::MemoryFile* file, const EMotionFX::Actor* actor, MCore::Endian::EEndianType targetEndianType) - { - ResetMemoryFile(file); - ExporterLib::SaveActor(file, actor, targetEndianType); - return true; - } - - - bool Exporter::SaveActor(AZStd::string filenameWithoutExtension, const EMotionFX::Actor* actor, MCore::Endian::EEndianType targetEndianType) - { - PREPARE_DISKFILE_SAVE(GetActorExtension); - if (SaveActor(&memoryFile, actor, targetEndianType) == false) - { - return false; - } - FINISH_DISKFILE_SAVE - } - - - // skeletal motion - bool Exporter::SaveMotion(MCore::MemoryFile* file, EMotionFX::Motion* motion, MCore::Endian::EEndianType targetEndianType) - { - ResetMemoryFile(file); - ExporterLib::SaveMotion(file, motion, targetEndianType); - return true; - } - - - bool Exporter::SaveMotion(AZStd::string filenameWithoutExtension, EMotionFX::Motion* motion, MCore::Endian::EEndianType targetEndianType) - { - PREPARE_DISKFILE_SAVE(GetMotionExtension); - if (SaveMotion(&memoryFile, motion, targetEndianType) == false) - { - return false; - } - FINISH_DISKFILE_SAVE - } -} // namespace ExporterLib diff --git a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h b/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h deleted file mode 100644 index db1c6d4f3c..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h +++ /dev/null @@ -1,46 +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 - * - */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include - - -namespace ExporterLib -{ - class Exporter - : public EMotionFX::BaseObject - { - MCORE_MEMORYOBJECTCATEGORY(Exporter, EMFX_DEFAULT_ALIGNMENT, EMotionFX::EMFX_MEMCATEGORY_FILEPROCESSORS); - - public: - static Exporter* Create(); - - // actor - bool SaveActor(MCore::MemoryFile* file, const EMotionFX::Actor* actor, MCore::Endian::EEndianType targetEndianType); - bool SaveActor(AZStd::string filenameWithoutExtension, const EMotionFX::Actor* actor, MCore::Endian::EEndianType targetEndianType); - - // motion - bool SaveMotion(MCore::MemoryFile* file, EMotionFX::Motion* motion, MCore::Endian::EEndianType targetEndianType); - bool SaveMotion(AZStd::string filenameWithoutExtension, EMotionFX::Motion* motion, MCore::Endian::EEndianType targetEndianType); - - private: - void ResetMemoryFile(MCore::MemoryFile* file); - - Exporter(); - virtual ~Exporter(); - - void Delete() override; - }; -} // namespace ExporterLib diff --git a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake index 8837238e3c..63e65fa1e2 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake @@ -10,8 +10,6 @@ set(FILES Exporter/EndianConversion.cpp Exporter/Exporter.h Exporter/ExporterActor.cpp - Exporter/ExporterFileProcessor.cpp - Exporter/ExporterFileProcessor.h Exporter/FileHeaderExport.cpp Exporter/MorphTargetExport.cpp Exporter/MotionEventExport.cpp diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp index d89e41f1a6..36173a2d2c 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Groups/MotionGroup.cpp b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Groups/MotionGroup.cpp index e033d7ebb0..226a760292 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Groups/MotionGroup.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Groups/MotionGroup.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/MotionManager.h b/Gems/EMotionFX/Code/EMotionFX/Source/MotionManager.h index 24c8c784f3..aa2c83aebe 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/MotionManager.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/MotionManager.h @@ -15,6 +15,7 @@ #include #include #include +#include namespace EMotionFX { From 83879a0c53eb7e7049e45a320be0870b9736b5eb Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:33:12 -0800 Subject: [PATCH 242/620] Removes Light.h from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Rendering/OpenGL2/Source/Light.h | 31 ------------------- .../EMotionFX/Rendering/rendering_files.cmake | 1 - 2 files changed, 32 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Light.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Light.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Light.h deleted file mode 100644 index 7fa9fa25ba..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Light.h +++ /dev/null @@ -1,31 +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 - * - */ - -#pragma once - -#include "RenderGLConfig.h" -#include -#include - -namespace RenderGL -{ - struct RENDERGL_API Light - { - Light() - : m_dir(-1.0f, 0.0f, -1.0f) - , m_diffuse(1.0f, 1.0f, 1.0f, 1.0f) - , m_specular(1.0f, 1.0f, 1.0f, 1.0f) - , m_ambient(0.0f, 0.0f, 0.0f, 0.0f) - {} - - AZ::Vector3 m_dir; - AZ::Color m_diffuse; - AZ::Color m_specular; - AZ::Color m_ambient; - }; -} diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/rendering_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Rendering/rendering_files.cmake index b0a5376290..a53f329d66 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/rendering_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/rendering_files.cmake @@ -42,7 +42,6 @@ set(FILES OpenGL2/Source/GraphicsManager.h OpenGL2/Source/IndexBuffer.cpp OpenGL2/Source/IndexBuffer.h - OpenGL2/Source/Light.h OpenGL2/Source/Material.cpp OpenGL2/Source/Material.h OpenGL2/Source/PostProcessShader.cpp From f768bb23c2d5524a884144221a1d52342a421bcb Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:45:22 -0800 Subject: [PATCH 243/620] Removes EMotionFX.h from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/EMotionFX/Source/EMotionFX.h | 141 ------------------ .../Code/EMotionFX/emotionfx_files.cmake | 1 - 2 files changed, 142 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/EMotionFX.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFX.h b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFX.h deleted file mode 100644 index b02c33b5df..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFX.h +++ /dev/null @@ -1,141 +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 - * - */ - -/* - NOTE: To minimize your compile times, please consider manually including only the required header files instead of using this main include. -*/ - -#pragma once - -#include "Actor.h" -#include "ActorInstance.h" -#include "ActorManager.h" -#include "ActorUpdateScheduler.h" -#include "Algorithms.h" -#include "Attachment.h" -#include "AttachmentSkin.h" -#include "AttachmentNode.h" -#include "BaseObject.h" -#include "AnimGraph.h" -#include "AnimGraphAttributeTypes.h" -#include "AnimGraphBindPoseNode.h" -#include "AnimGraphEntryNode.h" -#include "AnimGraphEventBuffer.h" -#include "AnimGraphExitNode.h" -#include "AnimGraphGameControllerSettings.h" -#include "AnimGraphInstance.h" -#include "AnimGraphManager.h" -#include "AnimGraphMotionCondition.h" -#include "AnimGraphMotionNode.h" -#include "AnimGraphNode.h" -#include "AnimGraphNodeData.h" -#include "AnimGraphNodeGroup.h" -#include "AnimGraphObject.h" -#include "AnimGraphObjectData.h" -#include "AnimGraphObjectFactory.h" -#include "AnimGraphParameterCondition.h" -#include "AnimGraphPlayTimeCondition.h" -#include "AnimGraphPose.h" -#include "AnimGraphPosePool.h" -#include "AnimGraphRefCountedData.h" -#include "AnimGraphRefCountedDataPool.h" -#include "AnimGraphStateCondition.h" -#include "AnimGraphStateMachine.h" -#include "AnimGraphStateTransition.h" -#include "AnimGraphSyncTrack.h" -#include "AnimGraphTimeCondition.h" -#include "AnimGraphTransitionCondition.h" -#include "AnimGraphVector2Condition.h" -#include "BlendSpace2DNode.h" -#include "BlendSpace1DNode.h" -#include "BlendTree.h" -#include "BlendTreeAccumTransformNode.h" -#include "BlendTreeBlend2Node.h" -#include "BlendTreeBlendNNode.h" -#include "BlendTreeBoolLogicNode.h" -#include "BlendTreeConnection.h" -#include "BlendTreeDirectionToWeightNode.h" -#include "BlendTreeFinalNode.h" -#include "BlendTreeFloatConditionNode.h" -#include "BlendTreeFloatMath1Node.h" -#include "BlendTreeFloatMath2Node.h" -#include "BlendTreeFloatSwitchNode.h" -#include "BlendTreeLookAtNode.h" -#include "BlendTreeMaskNode.h" -#include "BlendTreeMirrorPoseNode.h" -#include "BlendTreeMotionFrameNode.h" -#include "BlendTreeParameterNode.h" -#include "BlendTreePoseSwitchNode.h" -#include "BlendTreeRangeRemapperNode.h" -#include "BlendTreeSmoothingNode.h" -#include "BlendTreeTransformNode.h" -#include "BlendTreeTwoLinkIKNode.h" -#include "BlendTreeVector2ComposeNode.h" -#include "BlendTreeVector2DecomposeNode.h" -#include "BlendTreeVector3ComposeNode.h" -#include "BlendTreeVector3DecomposeNode.h" -#include "BlendTreeVector3Math1Node.h" -#include "BlendTreeVector3Math2Node.h" -#include "BlendTreeVector4ComposeNode.h" -#include "BlendTreeVector4DecomposeNode.h" -#include "CompressedKeyFrames.h" -#include "DualQuatSkinDeformer.h" -#include "EMotionFX.h" -#include "EMotionFXConfig.h" -#include "EMotionFXManager.h" -#include "EventHandler.h" -#include "EventInfo.h" -#include "EventManager.h" -#include "KeyFrame.h" -#include "KeyFrameFinder.h" -#include "KeyTrackLinearDynamic.h" -#include "LayerPass.h" -#include "Material.h" -#include "MemoryCategories.h" -#include "Mesh.h" -#include "MeshDeformer.h" -#include "MeshDeformerStack.h" -#include "MorphMeshDeformer.h" -#include "MorphSetup.h" -#include "MorphSetupInstance.h" -#include "MorphTarget.h" -#include "MorphTargetStandard.h" -#include "Motion.h" -#include "MotionEvent.h" -#include "MotionEventTable.h" -#include "MotionEventTrack.h" -#include "MotionInstance.h" -#include "MotionInstancePool.h" -#include "MotionLayerSystem.h" -#include "MotionManager.h" -#include "MotionQueue.h" -#include "MotionSet.h" -#include "MotionSystem.h" -#include "MultiThreadScheduler.h" -#include "Node.h" -#include "NodeAttribute.h" -#include "NodeGroup.h" -#include "NodeMap.h" -#include "PlayBackInfo.h" -#include "Pose.h" -#include "Recorder.h" -#include "RepositioningLayerPass.h" -#include "SingleThreadScheduler.h" -#include "Skeleton.h" -#include "SkinningInfoVertexAttributeLayer.h" -#include "SoftSkinDeformer.h" -#include "SoftSkinManager.h" -#include "StandardMaterial.h" -#include "SubMesh.h" -#include "ThreadData.h" -#include "Transform.h" -#include "TransformData.h" -#include "VertexAttributeLayer.h" -#include "VertexAttributeLayerAbstractData.h" -#include "Importer/ChunkProcessors.h" -#include "Importer/Importer.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake b/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake index 52c9d6aa15..6e8082e631 100644 --- a/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake @@ -36,7 +36,6 @@ set(FILES Source/DebugDraw.cpp Source/DualQuatSkinDeformer.cpp Source/DualQuatSkinDeformer.h - Source/EMotionFX.h Source/EMotionFXConfig.h Source/EMotionFXManager.cpp Source/EMotionFXManager.h From d934967caf7ac9e8d0d9726555b9bb4feaa4badd Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:48:20 -0800 Subject: [PATCH 244/620] Removes MeshBuilderInvalidIndex.h from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Source/MeshBuilderInvalidIndex.h | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/MeshBuilderInvalidIndex.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/MeshBuilderInvalidIndex.h b/Gems/EMotionFX/Code/EMotionFX/Source/MeshBuilderInvalidIndex.h deleted file mode 100644 index b94f46a3e7..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Source/MeshBuilderInvalidIndex.h +++ /dev/null @@ -1,19 +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 - * - */ - -#pragma once - -#include - -namespace AZ::MeshBuilder -{ - template - inline static constexpr IndexType InvalidIndexT = static_cast(-1); - - inline static constexpr size_t InvalidIndex = InvalidIndexT; -} // namespace AZ::MeshBuilder From 4ec93b2e2396060ad8b027b340d2419ff4d31b4e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:54:10 -0800 Subject: [PATCH 245/620] Removes EMStudioCore.h from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../EMStudioSDK/Source/Commands.cpp | 1 + .../EMStudioSDK/Source/EMStudioCore.h | 17 ----------------- .../Source/RenderPlugin/CommandCallbacks.cpp | 1 - .../RenderPlugin/RenderUpdateCallback.cpp | 1 - .../Source/RenderPlugin/RenderViewWidget.cpp | 1 - .../EMStudioSDK/emstudiosdk_files.cmake | 1 - .../Source/OpenGLRender/GLWidget.cpp | 1 - .../Source/OpenGLRender/OpenGLRenderPlugin.cpp | 1 - .../MorphTargetsWindowPlugin.cpp | 1 - .../MotionSetManagementWindow.cpp | 1 - .../Source/MotionSetsWindow/MotionSetWindow.cpp | 1 - .../MotionSetsWindow/MotionSetsWindowPlugin.cpp | 1 - .../Source/NodeGroups/NodeGroupsPlugin.cpp | 1 - 13 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Commands.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Commands.cpp index e2e2224c67..0d177ad82c 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Commands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Commands.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h deleted file mode 100644 index 2899ebc33a..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h +++ /dev/null @@ -1,17 +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 - * - */ - -#pragma once - -// include all headers -#include "EMStudioConfig.h" -#include "EMStudioManager.h" -//#include "MainWindow.h" -#include "PluginManager.h" -#include "EMStudioPlugin.h" -#include "LayoutManager.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp index 90d748a9d3..a04e2a87c8 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp @@ -8,7 +8,6 @@ // include the required headers #include "RenderPlugin.h" -#include "../EMStudioCore.h" #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp index 5cc88db0b0..49bb5509b6 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp @@ -9,7 +9,6 @@ // include the required headers #include "RenderUpdateCallback.h" #include "RenderPlugin.h" -#include "../EMStudioCore.h" #include #include #include "RenderWidget.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp index fe8fb61f02..f729e2e323 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp @@ -8,7 +8,6 @@ #include "RenderViewWidget.h" #include "RenderPlugin.h" -#include "../EMStudioCore.h" #include "../PreferencesWindow.h" #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake index 073d7c1bdb..22c7223d57 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake @@ -14,7 +14,6 @@ set(FILES Source/DockWidgetPlugin.cpp Source/DockWidgetPlugin.h Source/EMStudioConfig.h - Source/EMStudioCore.h Source/EMStudioManager.cpp Source/EMStudioManager.h Source/EMStudioPlugin.cpp diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp index be9d704727..c6cab07a44 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp @@ -12,7 +12,6 @@ #include #include #include -#include "../../../../EMStudioSDK/Source/EMStudioCore.h" #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.cpp index 5626e482eb..7943420a09 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.cpp @@ -8,7 +8,6 @@ #include "OpenGLRenderPlugin.h" #include "GLWidget.h" -#include "../../../../EMStudioSDK/Source/EMStudioCore.h" #include "../../../../EMStudioSDK/Source/MainWindow.h" #include "../../../../EMStudioSDK/Source/RenderPlugin/RenderViewWidget.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MorphTargetsWindow/MorphTargetsWindowPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MorphTargetsWindow/MorphTargetsWindowPlugin.cpp index 1ceeb155fa..67e1bd9ad0 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MorphTargetsWindow/MorphTargetsWindowPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MorphTargetsWindow/MorphTargetsWindowPlugin.cpp @@ -10,7 +10,6 @@ #include #include #include -#include "../../../../EMStudioSDK/Source/EMStudioCore.h" #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetManagementWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetManagementWindow.cpp index ca62d6d927..80c35f2a01 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetManagementWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetManagementWindow.cpp @@ -10,7 +10,6 @@ #include "AzCore/std/iterator.h" #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetWindow.cpp index 3a4c2628b3..20e3dd402b 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetWindow.cpp @@ -28,7 +28,6 @@ #include #include #include -#include "../../../../EMStudioSDK/Source/EMStudioCore.h" #include #include #include "../../../../EMStudioSDK/Source/EMStudioManager.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetsWindowPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetsWindowPlugin.cpp index cf23c2e79e..6429af8970 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetsWindowPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetsWindowPlugin.cpp @@ -18,7 +18,6 @@ #include #include #include -#include "../../../../EMStudioSDK/Source/EMStudioCore.h" #include "../../../../EMStudioSDK/Source/MainWindow.h" #include "../../../../EMStudioSDK/Source/SaveChangedFilesManager.h" #include "../../../../EMStudioSDK/Source/FileManager.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupsPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupsPlugin.cpp index 3fe5c589a7..17fb621725 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupsPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupsPlugin.cpp @@ -8,7 +8,6 @@ // include required headers #include "NodeGroupsPlugin.h" -#include "../../../../EMStudioSDK/Source/EMStudioCore.h" #include #include #include From c5986d50745fe596ea860613129bfe6eefd2295f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:21:07 -0800 Subject: [PATCH 246/620] Removes unused plugin files from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../EMStudioSDK/Source/EMStudioPlugin.cpp | 16 ------- .../EMStudioSDK/Source/EMStudioPlugin.h | 1 - .../EMStudioSDK/Source/InvisiblePlugin.cpp | 27 ------------ .../EMStudioSDK/Source/InvisiblePlugin.h | 42 ------------------- .../EMStudioSDK/Source/PluginOptions.cpp | 14 ------- .../Source/RenderPlugin/RenderViewWidget.cpp | 3 +- .../EMStudioSDK/emstudiosdk_files.cmake | 4 -- .../Source/OpenGLRender/OpenGLRenderPlugin.h | 1 + .../RenderPlugins/Source/RegisterPlugins.cpp | 30 ------------- 9 files changed, 3 insertions(+), 135 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.cpp delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/PluginOptions.cpp delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/RegisterPlugins.cpp diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp index 05ed5f24d7..e69de29bb2 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp @@ -1,16 +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 - * - */ - -// include the required headers -#include "EMStudioPlugin.h" - -namespace EMStudio -{ -} // namespace EMStudio - -#include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h index f1cabccc31..2dc86ba01b 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h @@ -42,7 +42,6 @@ namespace EMStudio class EMSTUDIO_API EMStudioPlugin : public QObject { - Q_OBJECT MCORE_MEMORYOBJECTCATEGORY(EMStudioPlugin, MCore::MCORE_DEFAULT_ALIGNMENT, MEMCATEGORY_EMSTUDIOSDK) public: diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.cpp deleted file mode 100644 index 202eadb826..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.cpp +++ /dev/null @@ -1,27 +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 - * - */ - -// include required headers -#include "InvisiblePlugin.h" - -namespace EMStudio -{ - // constructor - InvisiblePlugin::InvisiblePlugin() - : EMStudioPlugin() - { - } - - - // destructor - InvisiblePlugin::~InvisiblePlugin() - { - } -} // namespace EMStudio - -#include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h deleted file mode 100644 index 127705867a..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h +++ /dev/null @@ -1,42 +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 - * - */ - -#pragma once - -// include MCore -#if !defined(Q_MOC_RUN) -#include -#include "EMStudioConfig.h" -#include "EMStudioPlugin.h" -#endif - - -namespace EMStudio -{ - /** - * - * - */ - class EMSTUDIO_API InvisiblePlugin - : public EMStudioPlugin - { - Q_OBJECT - MCORE_MEMORYOBJECTCATEGORY(InvisiblePlugin, MCore::MCORE_DEFAULT_ALIGNMENT, MEMCATEGORY_EMSTUDIOSDK) - public: - InvisiblePlugin(); - virtual ~InvisiblePlugin(); - - EMStudioPlugin::EPluginType GetPluginType() const override { return EMStudioPlugin::PLUGINTYPE_INVISIBLE; } - - bool Init() override { return true; } // for this type of plugin, perform the init inside the constructor - bool GetHasWindowWithObjectName(const AZStd::string& objectName) override { MCORE_UNUSED(objectName); return false; } - QString GetObjectName() const override { return objectName(); } - void SetObjectName(const QString& objectName) override { setObjectName(objectName); } - void CreateBaseInterface(const char* objectName) override { MCORE_UNUSED(objectName); } - }; -} // namespace EMStudio diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/PluginOptions.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/PluginOptions.cpp deleted file mode 100644 index 02af548668..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/PluginOptions.cpp +++ /dev/null @@ -1,14 +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 - * - */ - -#include "PluginOptions.h" - -namespace EMotionFX -{ - -} diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp index f729e2e323..fba20c5bfd 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp @@ -14,9 +14,10 @@ #include #include #include +#include #include - +#include namespace EMStudio { diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake index 22c7223d57..962f2b8b83 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake @@ -16,14 +16,11 @@ set(FILES Source/EMStudioConfig.h Source/EMStudioManager.cpp Source/EMStudioManager.h - Source/EMStudioPlugin.cpp Source/EMStudioPlugin.h Source/FileManager.cpp Source/FileManager.h Source/GUIOptions.cpp Source/GUIOptions.h - Source/InvisiblePlugin.cpp - Source/InvisiblePlugin.h Source/KeyboardShortcutsWindow.cpp Source/KeyboardShortcutsWindow.h Source/LayoutManager.cpp @@ -35,7 +32,6 @@ set(FILES Source/MotionEventPresetManager.h Source/PluginManager.cpp Source/PluginManager.h - Source/PluginOptions.cpp Source/PluginOptions.h Source/PluginOptionsBus.h Source/PreferencesWindow.cpp diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.h index ba2bb0f462..a0e7d1e3b4 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.h @@ -17,6 +17,7 @@ #include "../../../../EMStudioSDK/Source/RenderPlugin/RenderWidget.h" #include "../../../../EMStudioSDK/Source/RenderPlugin/RenderLayouts.h" #include "../../../../EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.h" +#include #include "GLWidget.h" #endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/RegisterPlugins.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/RegisterPlugins.cpp deleted file mode 100644 index f6bde013fb..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/RegisterPlugins.cpp +++ /dev/null @@ -1,30 +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 - * - */ - -// include the EMotion Studio SDK -#include "RenderPluginsConfig.h" -#include "../../../EMStudioSDK/Source/EMStudioConfig.h" -#include "../../../EMStudioSDK/Source/EMStudioManager.h" -#include "../../../EMStudioSDK/Source/PluginManager.h" - -// include the plugin interfaces -#include "OpenGLRender/OpenGLRenderPlugin.h" - -extern "C" -{ -// the main register function which is executed when loading the plugin library -// we register our plugins to the plugin manager here -RENDERPLUGINS_API void MCORE_CDECL RegisterPlugins() -{ - // get the plugin manager - EMStudio::PluginManager* pluginManager = EMStudio::GetPluginManager(); - - // register the plugins - pluginManager->RegisterPlugin(new EMStudio::OpenGLRenderPlugin()); -} -} From a857ad53b6da2170174be2f38ff71772eda78acf Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:26:58 -0800 Subject: [PATCH 247/620] Removes AnimGraphNodeWidget.cpp from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Source/AnimGraph/AnimGraphNodeWidget.cpp | 11 ----------- .../Source/AnimGraph/AnimGraphNodeWidget.h | 2 -- .../StandardPlugins/standardplugins_files.cmake | 1 - 3 files changed, 14 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.cpp diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.cpp deleted file mode 100644 index 3200325adc..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.cpp +++ /dev/null @@ -1,11 +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 - * - */ - -#include - -#include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.h index d96dd35636..90ac968942 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.h @@ -23,8 +23,6 @@ namespace EMStudio class AnimGraphNodeWidget : public QWidget { - Q_OBJECT - public: AnimGraphNodeWidget(QWidget* parent = nullptr) : QWidget(parent) diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake index 65af4d50ee..05a636be0a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake @@ -52,7 +52,6 @@ set(FILES Source/AnimGraph/AnimGraphHierarchyWidget.cpp Source/AnimGraph/AnimGraphHierarchyWidget.h Source/AnimGraph/AnimGraphNodeWidget.h - Source/AnimGraph/AnimGraphNodeWidget.cpp Source/AnimGraph/AnimGraphOptions.cpp Source/AnimGraph/AnimGraphOptions.h Source/AnimGraph/AnimGraphPlugin.cpp From 87f32e0659895174d40d9ef7638748dd8f88c525 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:33:45 -0800 Subject: [PATCH 248/620] Removes DebugEventHandler from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Source/AnimGraph/AnimGraphPlugin.cpp | 1 - .../Source/AnimGraph/DebugEventHandler.cpp | 92 ------------------- .../Source/AnimGraph/DebugEventHandler.h | 46 ---------- .../standardplugins_files.cmake | 2 - 4 files changed, 141 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.cpp delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.cpp index 4baec366f0..46ad92a910 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.cpp @@ -16,7 +16,6 @@ #include "AttributesWindow.h" #include "NodeGroupWindow.h" #include "BlendTreeVisualNode.h" -#include "DebugEventHandler.h" #include "StateGraphNode.h" #include "ParameterWindow.h" #include "GraphNodeFactory.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.cpp deleted file mode 100644 index e03392f6bc..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.cpp +++ /dev/null @@ -1,92 +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 - * - */ - -// include the required headers -#include "DebugEventHandler.h" -#include - - -namespace EMStudio -{ - // constructor - AnimGraphInstanceDebugEventHandler::AnimGraphInstanceDebugEventHandler() - { - } - - - // destructor - AnimGraphInstanceDebugEventHandler::~AnimGraphInstanceDebugEventHandler() - { - } - - - void AnimGraphInstanceDebugEventHandler::OnStateEnter(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state) - { - MCORE_UNUSED(animGraphInstance); - MCore::LogError("Entered '%s'", state->GetName()); - } - - - void AnimGraphInstanceDebugEventHandler::OnStateEntering(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state) - { - MCORE_UNUSED(animGraphInstance); - if (state == nullptr) - { - return; - } - - MCore::LogError("Entering '%s'", state->GetName()); - } - - - void AnimGraphInstanceDebugEventHandler::OnStateExit(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state) - { - MCORE_UNUSED(animGraphInstance); - if (state == nullptr) - { - return; - } - - MCore::LogError("Exit '%s'", state->GetName()); - } - - - void AnimGraphInstanceDebugEventHandler::OnStateEnd(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state) - { - MCORE_UNUSED(animGraphInstance); - if (state == nullptr) - { - return; - } - - MCore::LogError("End '%s'", state->GetName()); - } - - - void AnimGraphInstanceDebugEventHandler::OnStartTransition(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphStateTransition* transition) - { - if (transition == nullptr) - { - return; - } - - MCore::LogError("Start transition from '%s' to '%s'", transition->GetSourceNode(animGraphInstance)->GetName(), transition->GetTargetNode()->GetName()); - } - - - void AnimGraphInstanceDebugEventHandler::OnEndTransition(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphStateTransition* transition) - { - if (transition == nullptr) - { - return; - } - - MCore::LogError("End transition from '%s' to '%s'", transition->GetSourceNode(animGraphInstance)->GetName(), transition->GetTargetNode()->GetName()); - } -} // namespace EMStudio - diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.h deleted file mode 100644 index 4786527f62..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.h +++ /dev/null @@ -1,46 +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 - * - */ - -#pragma once - -// include MCore -#if !defined(Q_MOC_RUN) -#include "../StandardPluginsConfig.h" -#include -#include -#include -#include -#include -#include -#include "../StandardPluginsConfig.h" -#endif - - - - -namespace EMStudio -{ - class AnimGraphInstanceDebugEventHandler - : public EMotionFX::AnimGraphInstanceEventHandler - { - MCORE_MEMORYOBJECTCATEGORY(AnimGraphInstanceDebugEventHandler, MCore::MCORE_DEFAULT_ALIGNMENT, MEMCATEGORY_STANDARDPLUGINS_ANIMGRAPH) - - public: - AnimGraphInstanceDebugEventHandler(); - virtual ~AnimGraphInstanceDebugEventHandler(); - - void OnStateEnter(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state); - void OnStateEntering(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state); - void OnStateExit(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state); - void OnStateEnd(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state); - void OnStartTransition(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphStateTransition* transition); - void OnEndTransition(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphStateTransition* transition); - - private: - }; -} // namespace EMStudio diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake index 05a636be0a..f74e20a6f2 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake @@ -58,8 +58,6 @@ set(FILES Source/AnimGraph/AnimGraphPlugin.h Source/AnimGraph/AnimGraphPluginCallbacks.cpp Source/AnimGraph/ContextMenu.cpp - Source/AnimGraph/DebugEventHandler.cpp - Source/AnimGraph/DebugEventHandler.h Source/AnimGraph/GameController.cpp Source/AnimGraph/GameController.h Source/AnimGraph/GameControllerWindow.cpp From 6cefe610b82196976fd7b4dc38a028ceba461900 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:46:33 -0800 Subject: [PATCH 249/620] Removes GraphWidgetCallback from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Source/AnimGraph/GraphWidgetCallback.h | 37 ------------------- .../Source/AnimGraph/NodeGraphWidget.h | 4 -- 2 files changed, 41 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GraphWidgetCallback.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GraphWidgetCallback.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GraphWidgetCallback.h deleted file mode 100644 index 2ce33f9011..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GraphWidgetCallback.h +++ /dev/null @@ -1,37 +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 - * - */ - -#pragma once - -// include required headers -#include -#include "../StandardPluginsConfig.h" -#include - - -namespace EMStudio -{ - // forward declarations - class NodeGraphWidget; - - // the graph widget callback base class - class GraphWidgetCallback - { - MCORE_MEMORYOBJECTCATEGORY(GraphWidgetCallback, EMFX_DEFAULT_ALIGNMENT, MEMCATEGORY_STANDARDPLUGINS_ANIMGRAPH); - - public: - // constructor and destructor - GraphWidgetCallback(NodeGraphWidget* graphWidget) { m_graphWidget = graphWidget; } - virtual ~GraphWidgetCallback() {} - - virtual void DrawOverlay(QPainter& painter) = 0; - - protected: - NodeGraphWidget* m_graphWidget; - }; -} // namespace EMStudio diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/NodeGraphWidget.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/NodeGraphWidget.h index f3bea6d5f9..b3282bfe7b 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/NodeGraphWidget.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/NodeGraphWidget.h @@ -27,7 +27,6 @@ namespace EMStudio // forward declarations class NodeGraph; class GraphNode; - class GraphWidgetCallback; class NodePort; class NodeConnection; class AnimGraphPlugin; @@ -53,8 +52,6 @@ namespace EMStudio void SetActiveGraph(NodeGraph* graph); NodeGraph* GetActiveGraph() const; - void SetCallback(GraphWidgetCallback* callback); - MCORE_INLINE GraphWidgetCallback* GetCallback() { return m_callback; } MCORE_INLINE const QPoint& GetMousePos() const { return m_mousePos; } MCORE_INLINE void SetMousePos(const QPoint& pos) { m_mousePos = pos; } MCORE_INLINE void SetShowFPS(bool showFPS) { m_showFps = showFPS; } @@ -138,7 +135,6 @@ namespace EMStudio int m_curHeight; GraphNode* m_moveNode; // the node we're moving NodeGraph* m_activeGraph = nullptr; - GraphWidgetCallback* m_callback; QFont m_font; QFontMetrics* m_fontMetrics; AZ::Debug::Timer m_renderTimer; From a5005deba7a4b299ef953c458532397abeba01a4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:57:36 -0800 Subject: [PATCH 250/620] Removes BoundingSphere from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/MCore/Source/BoundingSphere.cpp | 106 ------------------ .../Code/MCore/Source/BoundingSphere.h | 26 ----- Gems/EMotionFX/Code/MCore/mcore_files.cmake | 1 - 3 files changed, 133 deletions(-) delete mode 100644 Gems/EMotionFX/Code/MCore/Source/BoundingSphere.cpp diff --git a/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.cpp b/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.cpp deleted file mode 100644 index 376052563f..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.cpp +++ /dev/null @@ -1,106 +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 - * - */ - -// include required headers -#include "BoundingSphere.h" -#include "AABB.h" - - -namespace MCore -{ - // encapsulate a point in the sphere - void BoundingSphere::Encapsulate(const AZ::Vector3& v) - { - // calculate the squared distance from the center to the point - const AZ::Vector3 diff = v - m_center; - const float dist = diff.Dot(diff); - - // if the current sphere doesn't contain the point, grow the sphere so that it contains the point - if (dist > m_radiusSq) - { - const AZ::Vector3 diff2 = diff.GetNormalized() * m_radius; - const AZ::Vector3 delta = 0.5f * (diff - diff2); - m_center += delta; - // TODO: KB- Was a 'safe' function, is there an AZ equivalent? - float length = delta.GetLengthSq(); - if (length >= FLT_EPSILON) - { - m_radius += sqrtf(length); - } - else - { - m_radius = 0.0f; - } - m_radiusSq = m_radius * m_radius; - } - } - - - // check if the sphere intersects with a given AABB - bool BoundingSphere::Intersects(const AABB& b) const - { - float distance = 0.0f; - - for (int32_t t = 0; t < 3; ++t) - { - const AZ::Vector3& minVec = b.GetMin(); - if (m_center.GetElement(t) < minVec.GetElement(t)) - { - distance += (m_center.GetElement(t) - minVec.GetElement(t)) * (m_center.GetElement(t) - minVec.GetElement(t)); - if (distance > m_radiusSq) - { - return false; - } - } - else - { - const AZ::Vector3& maxVec = b.GetMax(); - if (m_center.GetElement(t) > maxVec.GetElement(t)) - { - distance += (m_center.GetElement(t) - maxVec.GetElement(t)) * (m_center.GetElement(t) - maxVec.GetElement(t)); - if (distance > m_radiusSq) - { - return false; - } - } - } - } - - return true; - } - - - // check if the sphere completely contains a given AABB - bool BoundingSphere::Contains(const AABB& b) const - { - float distance = 0.0f; - for (int32_t t = 0; t < 3; ++t) - { - const AZ::Vector3& maxVec = b.GetMax(); - if (m_center.GetElement(t) < maxVec.GetElement(t)) - { - distance += (m_center.GetElement(t) - maxVec.GetElement(t)) * (m_center.GetElement(t) - maxVec.GetElement(t)); - } - else - { - const AZ::Vector3& minVec = b.GetMin(); - if (m_center.GetElement(t) > minVec.GetElement(t)) - { - distance += (m_center.GetElement(t) - minVec.GetElement(t)) * (m_center.GetElement(t) - minVec.GetElement(t)); - } - } - - if (distance > m_radiusSq) - { - return false; - } - } - - return true; - } -} // namespace MCore diff --git a/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.h b/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.h index 1687f72799..ec63bb4b5d 100644 --- a/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.h +++ b/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.h @@ -108,32 +108,6 @@ namespace MCore */ MCORE_INLINE bool Intersects(const BoundingSphere& s) const { return ((m_center - s.m_center).GetLengthSq() <= (m_radiusSq + s.m_radiusSq)); } - /** - * Encapsulate a given 3D point with this sphere. - * Automatically adjust the center and radius of the sphere after 'adding' the given point to the sphere. - * Note that you should only use this method when the center of the bounding sphere isnt exactly known yet. - * This encapsulation method will adjust the center of the sphere as well. If the center of the sphere is known upfront and it is - * known upfront as well that this center point won't change, you should use the Encapsulate() method instead. - * @param v The vector representing the 3D point to use in the encapsulation. - */ - void Encapsulate(const AZ::Vector3& v); - - /** - * Checks if this sphere completely contains a given Axis Aligned Bounding Box (AABB). - * Note that the border of the sphere is counted as 'inside'. - * @param 'b' The box to perform the test with. - * @result Returns true when 'b' is COMPLETELY inside the spheres volume, otherwise false is returned. - */ - bool Contains(const AABB& b) const; - - /** - * Checks if a given Axis Aligned Bounding Box (AABB) intersects this sphere. - * Note that the border of the sphere is counted as inside. - * @param 'b' The box to perform the test with. - * @result Returns true when 'b' is completely or partially inside the volume of this sphere. - */ - bool Intersects(const AABB& b) const; - /** * Get the radius of the sphere. * @result Returns the radius of the sphere. diff --git a/Gems/EMotionFX/Code/MCore/mcore_files.cmake b/Gems/EMotionFX/Code/MCore/mcore_files.cmake index fd4eeb23c4..d33041eaf8 100644 --- a/Gems/EMotionFX/Code/MCore/mcore_files.cmake +++ b/Gems/EMotionFX/Code/MCore/mcore_files.cmake @@ -34,7 +34,6 @@ set(FILES Source/AttributeVector3.h Source/AttributeVector4.h Source/AzCoreConversions.h - Source/BoundingSphere.cpp Source/BoundingSphere.h Source/Color.cpp Source/Color.h From d28fc46a5397ed54b26fa62daee093f1f06b3ee5 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 17:14:46 -0800 Subject: [PATCH 251/620] Removes Matrix4 from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/EMotionFX/Code/MCore/Source/Matrix4.cpp | 2730 ----------------- Gems/EMotionFX/Code/MCore/Source/Matrix4.h | 917 ------ Gems/EMotionFX/Code/MCore/Source/Matrix4.inl | 330 -- Gems/EMotionFX/Code/MCore/mcore_files.cmake | 3 - Gems/EMotionFX/Code/Tests/Matchers.h | 25 - .../Code/Tests/TransformUnitTests.cpp | 1 - 6 files changed, 4006 deletions(-) delete mode 100644 Gems/EMotionFX/Code/MCore/Source/Matrix4.cpp delete mode 100644 Gems/EMotionFX/Code/MCore/Source/Matrix4.h delete mode 100644 Gems/EMotionFX/Code/MCore/Source/Matrix4.inl diff --git a/Gems/EMotionFX/Code/MCore/Source/Matrix4.cpp b/Gems/EMotionFX/Code/MCore/Source/Matrix4.cpp deleted file mode 100644 index f454df04ab..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/Matrix4.cpp +++ /dev/null @@ -1,2730 +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 - * - */ - -// include required headers -#include "Matrix4.h" -#include -#include -#include - - -namespace MCore -{ - // set the matrix to identity - void Matrix::Identity() - { - TMAT(0, 0) = 1.0f; - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 1.0f; - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - // calculate the matrix determinant - float Matrix::CalcDeterminant() const - { - return - TMAT(0, 0) * TMAT(1, 1) * TMAT(2, 2) + - TMAT(0, 1) * TMAT(1, 2) * TMAT(2, 0) + - TMAT(0, 2) * TMAT(1, 0) * TMAT(2, 1) - - TMAT(0, 2) * TMAT(1, 1) * TMAT(2, 0) - - TMAT(0, 1) * TMAT(1, 0) * TMAT(2, 2) - - TMAT(0, 0) * TMAT(1, 2) * TMAT(2, 1); - } - - - // add operator - Matrix Matrix::operator + (const Matrix& right) const - { - Matrix r; - for (uint32 i = 0; i < 4; ++i) - { - MMAT(r, i, 0) = TMAT(i, 0) + MMAT(right, i, 0); - MMAT(r, i, 1) = TMAT(i, 1) + MMAT(right, i, 1); - MMAT(r, i, 2) = TMAT(i, 2) + MMAT(right, i, 2); - MMAT(r, i, 3) = TMAT(i, 3) + MMAT(right, i, 3); - } - return r; - } - - - // subtract operator - Matrix Matrix::operator - (const Matrix& right) const - { - Matrix r; - for (uint32 i = 0; i < 4; ++i) - { - MMAT(r, i, 0) = TMAT(i, 0) - MMAT(right, i, 0); - MMAT(r, i, 1) = TMAT(i, 1) - MMAT(right, i, 1); - MMAT(r, i, 2) = TMAT(i, 2) - MMAT(right, i, 2); - MMAT(r, i, 3) = TMAT(i, 3) - MMAT(right, i, 3); - } - return r; - } - - - - Matrix Matrix::operator * (const Matrix& right) const - { - Matrix r; - - #if (AZ_TRAIT_USE_PLATFORM_SIMD_SSE && defined(MCORE_MATRIX_ROWMAJOR)) - const float* m = right.m_m16; - const float* n = m_m16; - float* t = r.m_m16; - - __m128 x0; - __m128 x1; - __m128 x2; - __m128 x3; - __m128 x4; - __m128 x5; - __m128 x6; - __m128 x7; - x0 = _mm_loadu_ps(&m[0]); - x1 = _mm_loadu_ps(&m[4]); - x2 = _mm_loadu_ps(&m[8]); - x3 = _mm_loadu_ps(&m[12]); - x4 = _mm_load_ps1(&n[0]); - x5 = _mm_load_ps1(&n[1]); - x6 = _mm_load_ps1(&n[2]); - x7 = _mm_load_ps1(&n[3]); - x4 = _mm_mul_ps(x4, x0); - x5 = _mm_mul_ps(x5, x1); - x6 = _mm_mul_ps(x6, x2); - x7 = _mm_mul_ps(x7, x3); - x4 = _mm_add_ps(x4, x5); - x6 = _mm_add_ps(x6, x7); - x4 = _mm_add_ps(x4, x6); - x5 = _mm_load_ps1(&n[4]); - x6 = _mm_load_ps1(&n[5]); - x7 = _mm_load_ps1(&n[6]); - x5 = _mm_mul_ps(x5, x0); - x6 = _mm_mul_ps(x6, x1); - x7 = _mm_mul_ps(x7, x2); - x5 = _mm_add_ps(x5, x6); - x5 = _mm_add_ps(x5, x7); - x6 = _mm_load_ps1(&n[7]); - x6 = _mm_mul_ps(x6, x3); - x5 = _mm_add_ps(x5, x6); - x6 = _mm_load_ps1(&n[8]); - x7 = _mm_load_ps1(&n[9]); - x6 = _mm_mul_ps(x6, x0); - x7 = _mm_mul_ps(x7, x1); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[10]); - x7 = _mm_mul_ps(x7, x2); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[11]); - x7 = _mm_mul_ps(x7, x3); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[12]); - x0 = _mm_mul_ps(x0, x7); - x7 = _mm_load_ps1(&n[13]); - x1 = _mm_mul_ps(x1, x7); - x7 = _mm_load_ps1(&n[14]); - x2 = _mm_mul_ps(x2, x7); - x7 = _mm_load_ps1(&n[15]); - x3 = _mm_mul_ps(x3, x7); - x0 = _mm_add_ps(x0, x1); - x2 = _mm_add_ps(x2, x3); - x0 = _mm_add_ps(x0, x2); - - //store result - _mm_storeu_ps(&t[0], x4); - _mm_storeu_ps(&t[4], x5); - _mm_storeu_ps(&t[8], x6); - _mm_storeu_ps(&t[12], x0); - #else - for (uint32 i = 0; i < 4; ++i) - { - MMAT(r, i, 0) = TMAT(i, 0) * MMAT(right, 0, 0) + TMAT(i, 1) * MMAT(right, 1, 0) + TMAT(i, 2) * MMAT(right, 2, 0) + TMAT(i, 3) * MMAT(right, 3, 0); - MMAT(r, i, 1) = TMAT(i, 0) * MMAT(right, 0, 1) + TMAT(i, 1) * MMAT(right, 1, 1) + TMAT(i, 2) * MMAT(right, 2, 1) + TMAT(i, 3) * MMAT(right, 3, 1); - MMAT(r, i, 2) = TMAT(i, 0) * MMAT(right, 0, 2) + TMAT(i, 1) * MMAT(right, 1, 2) + TMAT(i, 2) * MMAT(right, 2, 2) + TMAT(i, 3) * MMAT(right, 3, 2); - MMAT(r, i, 3) = TMAT(i, 0) * MMAT(right, 0, 3) + TMAT(i, 1) * MMAT(right, 1, 3) + TMAT(i, 2) * MMAT(right, 2, 3) + TMAT(i, 3) * MMAT(right, 3, 3); - } - #endif - - return r; - } - - - - Matrix& Matrix::operator += (const Matrix& right) - { - for (uint32 i = 0; i < 4; ++i) - { - TMAT(i, 0) += MMAT(right, i, 0); - TMAT(i, 1) += MMAT(right, i, 1); - TMAT(i, 2) += MMAT(right, i, 2); - TMAT(i, 3) += MMAT(right, i, 3); - } - return *this; - } - - - Matrix Matrix::operator * (float value) const - { - Matrix result(*this); - for (uint32 i = 0; i < 4; ++i) - { - MMAT(result, i, 0) *= value; - MMAT(result, i, 1) *= value; - MMAT(result, i, 2) *= value; - MMAT(result, i, 3) *= value; - } - return result; - } - - - Matrix& Matrix::operator -= (const Matrix& right) - { - for (uint32 i = 0; i < 4; ++i) - { - TMAT(i, 0) -= MMAT(right, i, 0); - TMAT(i, 1) -= MMAT(right, i, 1); - TMAT(i, 2) -= MMAT(right, i, 2); - TMAT(i, 3) -= MMAT(right, i, 3); - } - return *this; - } - - - - Matrix& Matrix::operator *= (const Matrix& right) - { - #if (AZ_TRAIT_USE_PLATFORM_SIMD_SSE && defined(MCORE_MATRIX_ROWMAJOR)) - const float* m = right.m_m16; - const float* n = m_m16; - float* t = this->m_m16; - - __m128 x0; - __m128 x1; - __m128 x2; - __m128 x3; - __m128 x4; - __m128 x5; - __m128 x6; - __m128 x7; - x0 = _mm_loadu_ps(&m[0]); - x1 = _mm_loadu_ps(&m[4]); - x2 = _mm_loadu_ps(&m[8]); - x3 = _mm_loadu_ps(&m[12]); - x4 = _mm_load_ps1(&n[0]); - x5 = _mm_load_ps1(&n[1]); - x6 = _mm_load_ps1(&n[2]); - x7 = _mm_load_ps1(&n[3]); - x4 = _mm_mul_ps(x4, x0); - x5 = _mm_mul_ps(x5, x1); - x6 = _mm_mul_ps(x6, x2); - x7 = _mm_mul_ps(x7, x3); - x4 = _mm_add_ps(x4, x5); - x6 = _mm_add_ps(x6, x7); - x4 = _mm_add_ps(x4, x6); - x5 = _mm_load_ps1(&n[4]); - x6 = _mm_load_ps1(&n[5]); - x7 = _mm_load_ps1(&n[6]); - x5 = _mm_mul_ps(x5, x0); - x6 = _mm_mul_ps(x6, x1); - x7 = _mm_mul_ps(x7, x2); - x5 = _mm_add_ps(x5, x6); - x5 = _mm_add_ps(x5, x7); - x6 = _mm_load_ps1(&n[7]); - x6 = _mm_mul_ps(x6, x3); - x5 = _mm_add_ps(x5, x6); - x6 = _mm_load_ps1(&n[8]); - x7 = _mm_load_ps1(&n[9]); - x6 = _mm_mul_ps(x6, x0); - x7 = _mm_mul_ps(x7, x1); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[10]); - x7 = _mm_mul_ps(x7, x2); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[11]); - x7 = _mm_mul_ps(x7, x3); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[12]); - x0 = _mm_mul_ps(x0, x7); - x7 = _mm_load_ps1(&n[13]); - x1 = _mm_mul_ps(x1, x7); - x7 = _mm_load_ps1(&n[14]); - x2 = _mm_mul_ps(x2, x7); - x7 = _mm_load_ps1(&n[15]); - x3 = _mm_mul_ps(x3, x7); - x0 = _mm_add_ps(x0, x1); - x2 = _mm_add_ps(x2, x3); - x0 = _mm_add_ps(x0, x2); - - //store result - _mm_storeu_ps(&t[0], x4); - _mm_storeu_ps(&t[4], x5); - _mm_storeu_ps(&t[8], x6); - _mm_storeu_ps(&t[12], x0); - #else - float v[4]; - for (uint32 i = 0; i < 4; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - v[3] = TMAT(i, 3); - TMAT(i, 0) = v[0] * MMAT(right, 0, 0) + v[1] * MMAT(right, 1, 0) + v[2] * MMAT(right, 2, 0) + v[3] * MMAT(right, 3, 0); - TMAT(i, 1) = v[0] * MMAT(right, 0, 1) + v[1] * MMAT(right, 1, 1) + v[2] * MMAT(right, 2, 1) + v[3] * MMAT(right, 3, 1); - TMAT(i, 2) = v[0] * MMAT(right, 0, 2) + v[1] * MMAT(right, 1, 2) + v[2] * MMAT(right, 2, 2) + v[3] * MMAT(right, 3, 2); - TMAT(i, 3) = v[0] * MMAT(right, 0, 3) + v[1] * MMAT(right, 1, 3) + v[2] * MMAT(right, 2, 3) + v[3] * MMAT(right, 3, 3); - } - #endif - - return *this; - } - - - - // calculate euler angles - AZ::Vector3 Matrix::CalcEulerAngles() const - { - AZ::Vector3 v; - /* - // Version with smooth transitions to poles, but slow - float SignCosY = 1; - float NearPole = Math::Pow(Math::Abs(m44[2][0]), 12); - v.y = Math::ASin( -m44[2][0] ); - v.z = Math::ATan( m44[1][0] / m44[0][0] ); - if( Math::Abs(v.y) < Math::Abs(v.z) ) - { - SignCosY = Math::SignOfCos(v.y); - v.z = Math::ATan2( SignCosY * m44[1][0], SignCosY * m44[0][0] ); - } - else - { - v.y = Math::ATan2( -m44[2][0], Math::Sqrt( m44[0][0]*m44[0][0] + m44[1][0]*m44[1][0] ) - * Math::SignOfFloat(Math::SignOfCos(v.z) * m44[0][0])); - SignCosY = Math::SignOfCos(v.y); - } - v.x = (1 - NearPole) * Math::ATan2( SignCosY * m44[2][1], SignCosY * m44[2][2] ) - + NearPole * 0.5 * Math::ATan2(-m44[1][2], m44[1][1]); - v.y = (1 - NearPole) * v.y + NearPole * Math::ATan2(-m44[2][0], m44[0][0]); - v.z = (1 - NearPole) * v.z - NearPole * Math::SignOfSin(v.y) * 0.5 * Math::ATan2(-m44[1][2], m44[1][1]); - */ - - if (Math::Abs(TMAT(2, 0)) < 0.9f) - { - float SignCosY = 1.0f; - v.SetY(Math::ASin(-TMAT(2, 0))); - v.SetZ(Math::ATan(TMAT(1, 0) / TMAT(0, 0))); - if (Math::Abs(v.GetY()) < Math::Abs(v.GetZ())) - { - SignCosY = Math::SignOfCos(v.GetY()); - v.SetZ(Math::ATan2(SignCosY * TMAT(1, 0), SignCosY * TMAT(0, 0))); - } - else - { - v.SetY(Math::ATan2(-TMAT(2, 0), Math::Sqrt(TMAT(0, 0) * TMAT(0, 0) + TMAT(1, 0) * TMAT(1, 0)) * Math::SignOfFloat(Math::SignOfCos(v.GetZ()) * TMAT(0, 0)))); - SignCosY = Math::SignOfCos(v.GetY()); - } - v.SetX(Math::ATan2(SignCosY * m44[2][1], SignCosY * TMAT(2, 2))); - } - else - { - v.SetZ(0.5f * Math::ATan2(-TMAT(1, 2), TMAT(1, 1))); - v.SetY(Math::ATan2(-TMAT(2, 0), TMAT(0, 0))); - v.SetX(-Math::SignOfSin(v.GetY()) * v.GetZ()); - } - - v.SetY(-v.GetY()); - v.SetZ(-v.GetZ()); - - // get the angles in the range [-pi, pi] - v.SetX(v.GetX() + Math::twoPi * Math::Floor((-v.GetX()) / Math::twoPi + 0.5f)); - v.SetY(v.GetY() + Math::twoPi * Math::Floor((-v.GetY()) / Math::twoPi + 0.5f)); - v.SetZ(v.GetZ() + Math::twoPi * Math::Floor((-v.GetZ()) / Math::twoPi + 0.5f)); - - return v; - } - - - - - /* - void Matrix::SetRotationMatrixEulerXYZ(const Vector3& v) - { - const float sy = Math::Sin(v.x); - const float cy = Math::Cos(v.x); - const float sp = Math::Sin(v.y); - const float cp = Math::Cos(v.y); - const float sr = Math::Sin(v.z); - const float cr = Math::Cos(v.z); - const float spsy = sp * sy; - const float spcy = sp * cy; - - m44[0][0] = cr * cp; - m44[0][1] = sr * cp; - m44[0][2] = -sp; - m44[0][3] = 0; - m44[1][0] = cr * spsy - sr * cy; - m44[1][1] = sr * spsy + cr * cy; - m44[1][2] = cp * sy; - m44[1][3] = 0; - m44[2][0] = cr * spcy + sr * sy; - m44[2][1] = sr * spcy - cr * sy; - m44[2][2] = cp * cy; - m44[2][3] = 0; - m44[3][0] = 0; - m44[3][1] = 0; - m44[3][2] = 0; - m44[3][3] = 1; - } - */ - - - // setup as scale matrix - void Matrix::SetScaleMatrix(const AZ::Vector3& s) - { - TMAT(0, 0) = s.GetX(); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = s.GetY(); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = s.GetZ(); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - // setup as translation matrix - void Matrix::SetTranslationMatrix(const AZ::Vector3& t) - { - TMAT(0, 0) = 1.0f; - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 1.0f; - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = t.GetX(); - TMAT(3, 1) = t.GetY(); - TMAT(3, 2) = t.GetZ(); - TMAT(3, 3) = 1.0f; - } - - - // setup as rotation matrix - void Matrix::SetRotationMatrixX(float angle) - { - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - - TMAT(0, 0) = 1.0f; - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = c; - TMAT(1, 2) = s; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = -s; - TMAT(2, 2) = c; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - // setup as rotation matrix - void Matrix::SetRotationMatrixY(float angle) - { - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - - TMAT(0, 0) = c; - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = -s; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 1.0f; - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = s; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = c; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - // setup as rotation matrix - void Matrix::SetRotationMatrixZ(float angle) - { - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - - TMAT(0, 0) = c; - TMAT(0, 1) = s; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = -s; - TMAT(1, 1) = c; - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - void Matrix::SetRotationMatrixEulerZYX(const AZ::Vector3& v) - { - *this = Matrix::RotationMatrixX(v.GetZ()); - this->MultMatrix4x3(Matrix::RotationMatrixY(v.GetY())); - this->MultMatrix4x3(Matrix::RotationMatrixZ(v.GetX())); - } - - - - void Matrix::SetRotationMatrixEulerXYZ(const AZ::Vector3& v) - { - *this = Matrix::RotationMatrixX(v.GetX()); - this->MultMatrix4x3(Matrix::RotationMatrixY(v.GetY())); - this->MultMatrix4x3(Matrix::RotationMatrixZ(v.GetZ())); - } - - - - void Matrix::SetRotationMatrixAxisAngle(const AZ::Vector3& axis, float angle) - { - const float length2 = axis.GetLengthSq(); - if (Math::Abs(length2) < 0.00001f) - { - Identity(); - return; - } - - const AZ::Vector3 n = axis / Math::Sqrt(length2); - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - const float k = 1.0f - c; - const float xx = n.GetX() * n.GetX() * k + c; - const float yy = n.GetY() * n.GetY() * k + c; - const float zz = n.GetZ() * n.GetZ() * k + c; - const float xy = n.GetX() * n.GetY() * k; - const float yz = n.GetY() * n.GetZ() * k; - const float zx = n.GetZ() * n.GetX() * k; - const float xs = n.GetX() * s; - const float ys = n.GetY() * s; - const float zs = n.GetZ() * s; - - TMAT(0, 0) = xx; - TMAT(0, 1) = xy + zs; - TMAT(0, 2) = zx - ys; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = xy - zs; - TMAT(1, 1) = yy; - TMAT(1, 2) = yz + xs; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = zx + ys; - TMAT(2, 1) = yz - xs; - TMAT(2, 2) = zz; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - void Matrix::Scale3x3(const AZ::Vector3& scale) - { - TMAT(0, 0) *= scale.GetX(); - TMAT(0, 1) *= scale.GetY(); - TMAT(0, 2) *= scale.GetZ(); - - TMAT(1, 0) *= scale.GetX(); - TMAT(1, 1) *= scale.GetY(); - TMAT(1, 2) *= scale.GetZ(); - - TMAT(2, 0) *= scale.GetX(); - TMAT(2, 1) *= scale.GetY(); - TMAT(2, 2) *= scale.GetZ(); - } - - - AZ::Vector3 Matrix::ExtractScale() - { - const AZ::Vector4 x = GetRow4D(0); - const AZ::Vector4 y = GetRow4D(1); - const AZ::Vector4 z = GetRow4D(2); - const float lengthX = x.GetLength(); - const float lengthY = y.GetLength(); - const float lengthZ = z.GetLength(); - SetRow(0, x / lengthX); - SetRow(1, y / lengthY); - SetRow(2, z / lengthZ); - - return AZ::Vector3(lengthX, lengthY, lengthZ); - } - - void Matrix::RotateX(float angle) - { - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - - for (uint32 i = 0; i < 3; ++i) - { - const float x = TMAT(2, i); - const float z = TMAT(1, i); - TMAT(2, i) = x * c - z * s; - TMAT(1, i) = x * s + z * c; - } - } - - - - void Matrix::RotateY(float angle) - { - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - - for (uint32 i = 0; i < 3; ++i) - { - const float x = TMAT(0, i); - const float z = TMAT(2, i); - TMAT(0, i) = x * c - z * s; - TMAT(2, i) = x * s + z * c; - } - } - - - - void Matrix::RotateZ(float angle) - { - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - - for (uint32 i = 0; i < 3; ++i) - { - const float x = TMAT(1, i); - const float z = TMAT(0, i); - TMAT(1, i) = x * c - z * s; - TMAT(0, i) = x * s + z * c; - } - } - - /* - void Matrix::RotateXYZ(const float yaw, const float pitch, const float roll) - { - const float sy = Math::Sin(yaw); - const float cy = Math::Cos(yaw); - const float sp = Math::Sin(pitch); - const float cp = Math::Cos(pitch); - const float sr = Math::Sin(roll); - const float cr = Math::Cos(roll); - const float spsy = sp * sy; - const float spcy = sp * cy; - const float m00 = cr * cp; - const float m01 = sr * cp; - const float m02 = -sp; - const float m10 = cr * spsy - sr * cy; - const float m11 = sr * spsy + cr * cy; - const float m12 = cp * sy; - const float m20 = cr * spcy + sr * sy; - const float m21 = sr * spcy - cr * sy; - const float m22 = cp * cy; - - for ( int32 i=0; i<4; i++ ) - { - const float x = m44[i][0]; - const float y = m44[i][1]; - const float z = m44[i][2]; - m44[i][0] = x * m00 + y * m10 + z * m20; - m44[i][1] = x * m01 + y * m11 + z * m21; - m44[i][2] = x * m02 + y * m12 + z * m22; - } - } - */ - - - void Matrix::MultMatrix(const Matrix& right) - { - #if (AZ_TRAIT_USE_PLATFORM_SIMD_SSE && defined(MCORE_MATRIX_ROWMAJOR)) - const float* m = right.m_m16; - const float* n = m_m16; - float* t = this->m_m16; - - __m128 x0; - __m128 x1; - __m128 x2; - __m128 x3; - __m128 x4; - __m128 x5; - __m128 x6; - __m128 x7; - x0 = _mm_loadu_ps(&m[0]); - x1 = _mm_loadu_ps(&m[4]); - x2 = _mm_loadu_ps(&m[8]); - x3 = _mm_loadu_ps(&m[12]); - x4 = _mm_load_ps1(&n[0]); - x5 = _mm_load_ps1(&n[1]); - x6 = _mm_load_ps1(&n[2]); - x7 = _mm_load_ps1(&n[3]); - x4 = _mm_mul_ps(x4, x0); - x5 = _mm_mul_ps(x5, x1); - x6 = _mm_mul_ps(x6, x2); - x7 = _mm_mul_ps(x7, x3); - x4 = _mm_add_ps(x4, x5); - x6 = _mm_add_ps(x6, x7); - x4 = _mm_add_ps(x4, x6); - x5 = _mm_load_ps1(&n[4]); - x6 = _mm_load_ps1(&n[5]); - x7 = _mm_load_ps1(&n[6]); - x5 = _mm_mul_ps(x5, x0); - x6 = _mm_mul_ps(x6, x1); - x7 = _mm_mul_ps(x7, x2); - x5 = _mm_add_ps(x5, x6); - x5 = _mm_add_ps(x5, x7); - x6 = _mm_load_ps1(&n[7]); - x6 = _mm_mul_ps(x6, x3); - x5 = _mm_add_ps(x5, x6); - x6 = _mm_load_ps1(&n[8]); - x7 = _mm_load_ps1(&n[9]); - x6 = _mm_mul_ps(x6, x0); - x7 = _mm_mul_ps(x7, x1); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[10]); - x7 = _mm_mul_ps(x7, x2); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[11]); - x7 = _mm_mul_ps(x7, x3); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[12]); - x0 = _mm_mul_ps(x0, x7); - x7 = _mm_load_ps1(&n[13]); - x1 = _mm_mul_ps(x1, x7); - x7 = _mm_load_ps1(&n[14]); - x2 = _mm_mul_ps(x2, x7); - x7 = _mm_load_ps1(&n[15]); - x3 = _mm_mul_ps(x3, x7); - x0 = _mm_add_ps(x0, x1); - x2 = _mm_add_ps(x2, x3); - x0 = _mm_add_ps(x0, x2); - - //store result - _mm_storeu_ps(&t[0], x4); - _mm_storeu_ps(&t[4], x5); - _mm_storeu_ps(&t[8], x6); - _mm_storeu_ps(&t[12], x0); - #else - float v[4]; - for (uint32 i = 0; i < 4; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - v[3] = TMAT(i, 3); - TMAT(i, 0) = v[0] * MMAT(right, 0, 0) + v[1] * MMAT(right, 1, 0) + v[2] * MMAT(right, 2, 0) + v[3] * MMAT(right, 3, 0); - TMAT(i, 1) = v[0] * MMAT(right, 0, 1) + v[1] * MMAT(right, 1, 1) + v[2] * MMAT(right, 2, 1) + v[3] * MMAT(right, 3, 1); - TMAT(i, 2) = v[0] * MMAT(right, 0, 2) + v[1] * MMAT(right, 1, 2) + v[2] * MMAT(right, 2, 2) + v[3] * MMAT(right, 3, 2); - TMAT(i, 3) = v[0] * MMAT(right, 0, 3) + v[1] * MMAT(right, 1, 3) + v[2] * MMAT(right, 2, 3) + v[3] * MMAT(right, 3, 3); - } - #endif - } - - - // init from position, rotation, scale and shear - // use this to reconstruct a matrix that has been decomposed using the DecomposeQRGramSchmidt method - void Matrix::InitFromPosRotScaleShear(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale, const AZ::Vector3& shear) - { - // convert quat to matrix - const float xx = rot.GetX() * rot.GetX(); - const float xy = rot.GetX() * rot.GetY(), yy = rot.GetY() * rot.GetY(); - const float xz = rot.GetX() * rot.GetZ(), yz = rot.GetY() * rot.GetZ(), zz = rot.GetZ() * rot.GetZ(); - const float xw = rot.GetX() * rot.GetW(), yw = rot.GetY() * rot.GetW(), zw = rot.GetZ() * rot.GetW(), ww = rot.GetW() * rot.GetW(); - TMAT(0, 0) = +xx - yy - zz + ww; - TMAT(0, 1) = +xy + zw + xy + zw; - TMAT(0, 2) = +xz - yw + xz - yw; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = +xy - zw + xy - zw; - TMAT(1, 1) = -xx + yy - zz + ww; - TMAT(1, 2) = +yz + xw + yz + xw; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = +xz + yw + xz + yw; - TMAT(2, 1) = +yz - xw + yz - xw; - TMAT(2, 2) = -xx - yy + zz + ww; - TMAT(2, 3) = 0.0f; - - // scale - TMAT(0, 0) *= scale.GetX(); - TMAT(0, 1) *= scale.GetY(); - TMAT(0, 2) *= scale.GetZ(); - TMAT(1, 0) *= scale.GetX(); - TMAT(1, 1) *= scale.GetY(); - TMAT(1, 2) *= scale.GetZ(); - TMAT(2, 0) *= scale.GetX(); - TMAT(2, 1) *= scale.GetY(); - TMAT(2, 2) *= scale.GetZ(); - - // multiply with the shear matrix - float v[3]; - v[0] = TMAT(0, 0); - v[1] = TMAT(0, 1); - v[2] = TMAT(0, 2); - TMAT(0, 1) = v[0] * shear.GetX() + v[1]; - TMAT(0, 2) = v[0] * shear.GetY() + v[1] * shear.GetZ() + v[2]; - - v[0] = TMAT(1, 0); - v[1] = TMAT(1, 1); - v[2] = TMAT(1, 2); - TMAT(1, 1) = v[0] * shear.GetX() + v[1]; - TMAT(1, 2) = v[0] * shear.GetY() + v[1] * shear.GetZ() + v[2]; - - v[0] = TMAT(2, 0); - v[1] = TMAT(2, 1); - v[2] = TMAT(2, 2); - TMAT(2, 1) = v[0] * shear.GetX() + v[1]; - TMAT(2, 2) = v[0] * shear.GetY() + v[1] * shear.GetZ() + v[2]; - - // translation - TMAT(3, 0) = pos.GetX(); - TMAT(3, 1) = pos.GetY(); - TMAT(3, 2) = pos.GetZ(); - TMAT(3, 3) = 1.0f; - } - - - // init from position, rotation, scale, scale rotation - // use this to reconstruct a matrix decomposed using the MatrixDecomposer class using polar decomposition - void Matrix::InitFromPosRotScaleScaleRot(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale, const AZ::Quaternion& scaleRot) - { - float xx = scaleRot.GetX() * scaleRot.GetX(); - float xy = scaleRot.GetX() * scaleRot.GetY(), yy = scaleRot.GetY() * scaleRot.GetY(); - float xz = scaleRot.GetX() * scaleRot.GetZ(), yz = scaleRot.GetY() * scaleRot.GetZ(), zz = scaleRot.GetZ() * scaleRot.GetZ(); - float xw = scaleRot.GetX() * scaleRot.GetW(), yw = scaleRot.GetY() * scaleRot.GetW(), zw = scaleRot.GetZ() * scaleRot.GetW(), ww = scaleRot.GetW() * scaleRot.GetW(); - - // init on the inversed scale rotation - TMAT(0, 0) = +xx - yy - zz + ww; - TMAT(1, 0) = +xy + zw + xy + zw; - TMAT(2, 0) = +xz - yw + xz - yw; // translation part not initialized - TMAT(0, 1) = +xy - zw + xy - zw; - TMAT(1, 1) = -xx + yy - zz + ww; - TMAT(2, 1) = +yz + xw + yz + xw; - TMAT(0, 2) = +xz + yw + xz + yw; - TMAT(1, 2) = +yz - xw + yz - xw; - TMAT(2, 2) = -xx - yy + zz + ww; - TMAT(0, 3) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 3) = 0.0f; - TMAT(3, 3) = 1.0f; - - // copy the 3x3 part into a temp buffer, so that we have the inverse scale rotation, before scaling applied to it - float r33[3][3]; - uint32 i; - for (i = 0; i < 3; ++i) - { -#ifdef MCORE_MATRIX_ROWMAJOR - r33[i][0] = TMAT(i, 0); - r33[i][1] = TMAT(i, 1); - r33[i][2] = TMAT(i, 2); -#else - r33[0][i] = TMAT(i, 0); - r33[1][i] = TMAT(i, 1); - r33[2][i] = TMAT(i, 2); -#endif - } - - // apply scaling - TMAT(0, 0) *= scale.GetX(); - TMAT(0, 1) *= scale.GetY(); - TMAT(0, 2) *= scale.GetZ(); - TMAT(1, 0) *= scale.GetX(); - TMAT(1, 1) *= scale.GetY(); - TMAT(1, 2) *= scale.GetZ(); - TMAT(2, 0) *= scale.GetX(); - TMAT(2, 1) *= scale.GetY(); - TMAT(2, 2) *= scale.GetZ(); - - // undo the scale rotation - float v[3]; - for (i = 0; i < 3; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - -#ifdef MCORE_MATRIX_ROWMAJOR - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[0][1] + v[2] * r33[0][2]; // transposed multiply - TMAT(i, 1) = v[0] * r33[1][0] + v[1] * r33[1][1] + v[2] * r33[1][2]; - TMAT(i, 2) = v[0] * r33[2][0] + v[1] * r33[2][1] + v[2] * r33[2][2]; -#else - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[1][0] + v[2] * r33[2][0]; // transposed multiply - TMAT(i, 1) = v[0] * r33[0][1] + v[1] * r33[1][1] + v[2] * r33[2][1]; - TMAT(i, 2) = v[0] * r33[0][2] + v[1] * r33[1][2] + v[2] * r33[2][2]; -#endif - } - - // apply regular rotation - xx = rot.GetX() * rot.GetX(); - xy = rot.GetX() * rot.GetY(); - yy = rot.GetY() * rot.GetY(); - xz = rot.GetX() * rot.GetZ(); - yz = rot.GetY() * rot.GetZ(); - zz = rot.GetZ() * rot.GetZ(); - xw = rot.GetX() * rot.GetW(); - yw = rot.GetY() * rot.GetW(); - zw = rot.GetZ() * rot.GetW(); - ww = rot.GetW() * rot.GetW(); - -#ifdef MCORE_MATRIX_ROWMAJOR - r33[0][0] = +xx - yy - zz + ww; - r33[0][1] = +xy + zw + xy + zw; - r33[0][2] = +xz - yw + xz - yw; - r33[1][0] = +xy - zw + xy - zw; - r33[1][1] = -xx + yy - zz + ww; - r33[1][2] = +yz + xw + yz + xw; - r33[2][0] = +xz + yw + xz + yw; - r33[2][1] = +yz - xw + yz - xw; - r33[2][2] = -xx - yy + zz + ww; -#else - r33[0][0] = +xx - yy - zz + ww; - r33[1][0] = +xy + zw + xy + zw; - r33[2][0] = +xz - yw + xz - yw; - r33[0][1] = +xy - zw + xy - zw; - r33[1][1] = -xx + yy - zz + ww; - r33[2][1] = +yz + xw + yz + xw; - r33[0][2] = +xz + yw + xz + yw; - r33[1][2] = +yz - xw + yz - xw; - r33[2][2] = -xx - yy + zz + ww; -#endif - - // mult 3x3 matrix - for (i = 0; i < 3; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - -#ifdef MCORE_MATRIX_ROWMAJOR - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[1][0] + v[2] * r33[2][0]; - TMAT(i, 1) = v[0] * r33[0][1] + v[1] * r33[1][1] + v[2] * r33[2][1]; - TMAT(i, 2) = v[0] * r33[0][2] + v[1] * r33[1][2] + v[2] * r33[2][2]; -#else - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[0][1] + v[2] * r33[0][2]; - TMAT(i, 1) = v[0] * r33[1][0] + v[1] * r33[1][1] + v[2] * r33[1][2]; - TMAT(i, 2) = v[0] * r33[2][0] + v[1] * r33[2][1] + v[2] * r33[2][2]; -#endif - } - - // apply translation - TMAT(3, 0) = pos.GetX(); - TMAT(3, 1) = pos.GetY(); - TMAT(3, 2) = pos.GetZ(); - } - - - // init from pos/rot/scale - void Matrix::InitFromPosRotScale(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale) - { - // init on a scale + translation matrix - TMAT(0, 0) = scale.GetX(); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = scale.GetY(); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = scale.GetZ(); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = pos.GetX(); - TMAT(3, 1) = pos.GetY(); - TMAT(3, 2) = pos.GetZ(); - TMAT(3, 3) = 1.0f; - - // multiply it with a rotation matrix built from the AZ::Quaternion - // don't rotate the translation part - const float xx = rot.GetX() * rot.GetX(); - const float xy = rot.GetX() * rot.GetY(), yy = rot.GetY() * rot.GetY(); - const float xz = rot.GetX() * rot.GetZ(), yz = rot.GetY() * rot.GetZ(), zz = rot.GetZ() * rot.GetZ(); - const float xw = rot.GetX() * rot.GetW(), yw = rot.GetY() * rot.GetW(), zw = rot.GetZ() * rot.GetW(), ww = rot.GetW() * rot.GetW(); - - float r33[3][3]; - #ifdef MCORE_MATRIX_ROWMAJOR - r33[0][0] = +xx - yy - zz + ww; - r33[0][1] = +xy + zw + xy + zw; - r33[0][2] = +xz - yw + xz - yw; - r33[1][0] = +xy - zw + xy - zw; - r33[1][1] = -xx + yy - zz + ww; - r33[1][2] = +yz + xw + yz + xw; - r33[2][0] = +xz + yw + xz + yw; - r33[2][1] = +yz - xw + yz - xw; - r33[2][2] = -xx - yy + zz + ww; - #else - r33[0][0] = +xx - yy - zz + ww; - r33[1][0] = +xy + zw + xy + zw; - r33[2][0] = +xz - yw + xz - yw; - r33[0][1] = +xy - zw + xy - zw; - r33[1][1] = -xx + yy - zz + ww; - r33[2][1] = +yz + xw + yz + xw; - r33[0][2] = +xz + yw + xz + yw; - r33[1][2] = +yz - xw + yz - xw; - r33[2][2] = -xx - yy + zz + ww; - #endif - - // perform the matrix mul - float v[3]; - for (uint32 i = 0; i < 3; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - - #ifdef MCORE_MATRIX_ROWMAJOR - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[1][0] + v[2] * r33[2][0]; - TMAT(i, 1) = v[0] * r33[0][1] + v[1] * r33[1][1] + v[2] * r33[2][1]; - TMAT(i, 2) = v[0] * r33[0][2] + v[1] * r33[1][2] + v[2] * r33[2][2]; - #else - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[0][1] + v[2] * r33[0][2]; - TMAT(i, 1) = v[0] * r33[1][0] + v[1] * r33[1][1] + v[2] * r33[1][2]; - TMAT(i, 2) = v[0] * r33[2][0] + v[1] * r33[2][1] + v[2] * r33[2][2]; - #endif - } - } - - - // init from pos/rot/scale with parent scale compensation - void Matrix::InitFromNoScaleInherit(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale, const AZ::Vector3& invParentScale) - { - // init on a scale + translation matrix - TMAT(0, 0) = scale.GetX(); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = scale.GetY(); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = scale.GetZ(); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = pos.GetX(); - TMAT(3, 1) = pos.GetY(); - TMAT(3, 2) = pos.GetZ(); - TMAT(3, 3) = 1.0f; - - // multiply it with a rotation matrix built from the AZ::Quaternion - // don't rotate the translation part - const float xx = rot.GetX() * rot.GetX(); - const float xy = rot.GetX() * rot.GetY(), yy = rot.GetY() * rot.GetY(); - const float xz = rot.GetX() * rot.GetZ(), yz = rot.GetY() * rot.GetZ(), zz = rot.GetZ() * rot.GetZ(); - const float xw = rot.GetX() * rot.GetW(), yw = rot.GetY() * rot.GetW(), zw = rot.GetZ() * rot.GetW(), ww = rot.GetW() * rot.GetW(); - - float r33[3][3]; - #ifdef MCORE_MATRIX_ROWMAJOR - r33[0][0] = +xx - yy - zz + ww; - r33[0][1] = +xy + zw + xy + zw; - r33[0][2] = +xz - yw + xz - yw; - r33[1][0] = +xy - zw + xy - zw; - r33[1][1] = -xx + yy - zz + ww; - r33[1][2] = +yz + xw + yz + xw; - r33[2][0] = +xz + yw + xz + yw; - r33[2][1] = +yz - xw + yz - xw; - r33[2][2] = -xx - yy + zz + ww; - #else - r33[0][0] = +xx - yy - zz + ww; - r33[1][0] = +xy + zw + xy + zw; - r33[2][0] = +xz - yw + xz - yw; - r33[0][1] = +xy - zw + xy - zw; - r33[1][1] = -xx + yy - zz + ww; - r33[2][1] = +yz + xw + yz + xw; - r33[0][2] = +xz + yw + xz + yw; - r33[1][2] = +yz - xw + yz - xw; - r33[2][2] = -xx - yy + zz + ww; - #endif - - // perform the matrix mul - float v[3]; - for (uint32 i = 0; i < 3; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - - #ifdef MCORE_MATRIX_ROWMAJOR - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[1][0] + v[2] * r33[2][0]; - TMAT(i, 1) = v[0] * r33[0][1] + v[1] * r33[1][1] + v[2] * r33[2][1]; - TMAT(i, 2) = v[0] * r33[0][2] + v[1] * r33[1][2] + v[2] * r33[2][2]; - #else - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[0][1] + v[2] * r33[0][2]; - TMAT(i, 1) = v[0] * r33[1][0] + v[1] * r33[1][1] + v[2] * r33[1][2]; - TMAT(i, 2) = v[0] * r33[2][0] + v[1] * r33[2][1] + v[2] * r33[2][2]; - #endif - } - - // multiply this with the 3x3 scale inverse parent scale matrix - TMAT(0, 0) *= invParentScale.GetX(); - TMAT(0, 1) *= invParentScale.GetY(); - TMAT(0, 2) *= invParentScale.GetZ(); - TMAT(1, 0) *= invParentScale.GetX(); - TMAT(1, 1) *= invParentScale.GetY(); - TMAT(1, 2) *= invParentScale.GetZ(); - TMAT(2, 0) *= invParentScale.GetX(); - TMAT(2, 1) *= invParentScale.GetY(); - TMAT(2, 2) *= invParentScale.GetZ(); - } - - - void Matrix::InitFromPosRot(const AZ::Vector3& pos, const AZ::Quaternion& rot) - { - const float xx = rot.GetX() * rot.GetX(); - const float xy = rot.GetX() * rot.GetY(), yy = rot.GetY() * rot.GetY(); - const float xz = rot.GetX() * rot.GetZ(), yz = rot.GetY() * rot.GetZ(), zz = rot.GetZ() * rot.GetZ(); - const float xw = rot.GetX() * rot.GetW(), yw = rot.GetY() * rot.GetW(), zw = rot.GetZ() * rot.GetW(), ww = rot.GetW() * rot.GetW(); - - TMAT(0, 0) = +xx - yy - zz + ww; - TMAT(0, 1) = +xy + zw + xy + zw; - TMAT(0, 2) = +xz - yw + xz - yw; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = +xy - zw + xy - zw; - TMAT(1, 1) = -xx + yy - zz + ww; - TMAT(1, 2) = +yz + xw + yz + xw; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = +xz + yw + xz + yw; - TMAT(2, 1) = +yz - xw + yz - xw; - TMAT(2, 2) = -xx - yy + zz + ww; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = pos.GetX(); - TMAT(3, 1) = pos.GetY(); - TMAT(3, 2) = pos.GetZ(); - TMAT(3, 3) = 1.0f; - } - - /* - // optimized routine for handling scale rotation, rotation, scale and translation - void Matrix::Set(const AZ::Quaternion& scaleRot, const AZ::Quaternion& rotation, const Vector3& scale, const Vector3& translation) - { - float xx=scaleRot.x*scaleRot.x; - float xy=scaleRot.x*scaleRot.y, yy=scaleRot.y*scaleRot.y; - float xz=scaleRot.x*scaleRot.z, yz=scaleRot.y*scaleRot.z, zz=scaleRot.z*scaleRot.z; - float xw=scaleRot.x*scaleRot.w, yw=scaleRot.y*scaleRot.w, zw=scaleRot.z*scaleRot.w, ww=scaleRot.w*scaleRot.w; - - // init on the inversed scale rotation - TMAT(0,0) = +xx-yy-zz+ww; TMAT(1,0) = +xy+zw+xy+zw; TMAT(2,0) = +xz-yw+xz-yw; // translation part not initialized - TMAT(0,1) = +xy-zw+xy-zw; TMAT(1,1) = -xx+yy-zz+ww; TMAT(2,1) = +yz+xw+yz+xw; - TMAT(0,2) = +xz+yw+xz+yw; TMAT(1,2) = +yz-xw+yz-xw; TMAT(2,2) = -xx-yy+zz+ww; - TMAT(0,3) = 0.0f; TMAT(1,3) = 0.0f; TMAT(2,3) = 0.0f; TMAT(3,3) = 1.0f; - - // copy the 3x3 part into a temp buffer, so that we have the inverse scale rotation, before scaling applied to it - float r33[3][3]; - uint32 i; - for (i=0; i<3; ++i) - { - #ifdef MCORE_MATRIX_ROWMAJOR - r33[i][0] = TMAT(i,0); - r33[i][1] = TMAT(i,1); - r33[i][2] = TMAT(i,2); - #else - r33[0][i] = TMAT(i,0); - r33[1][i] = TMAT(i,1); - r33[2][i] = TMAT(i,2); - #endif - } - - // apply scaling - TMAT(0,0) *= scale.x; - TMAT(0,1) *= scale.y; - TMAT(0,2) *= scale.z; - TMAT(1,0) *= scale.x; - TMAT(1,1) *= scale.y; - TMAT(1,2) *= scale.z; - TMAT(2,0) *= scale.x; - TMAT(2,1) *= scale.y; - TMAT(2,2) *= scale.z; - - // undo the scale rotation - float v[3]; - for (i=0; i<3; ++i) - { - v[0] = TMAT(i,0); - v[1] = TMAT(i,1); - v[2] = TMAT(i,2); - - #ifdef MCORE_MATRIX_ROWMAJOR - TMAT(i,0) = v[0]*r33[0][0] + v[1]*r33[0][1] + v[2]*r33[0][2]; // transposed multiply - TMAT(i,1) = v[0]*r33[1][0] + v[1]*r33[1][1] + v[2]*r33[1][2]; - TMAT(i,2) = v[0]*r33[2][0] + v[1]*r33[2][1] + v[2]*r33[2][2]; - #else - TMAT(i,0) = v[0]*r33[0][0] + v[1]*r33[1][0] + v[2]*r33[2][0]; // transposed multiply - TMAT(i,1) = v[0]*r33[0][1] + v[1]*r33[1][1] + v[2]*r33[2][1]; - TMAT(i,2) = v[0]*r33[0][2] + v[1]*r33[1][2] + v[2]*r33[2][2]; - #endif - } - - // apply regular rotation - xx=rotation.x*rotation.x; - xy=rotation.x*rotation.y; yy=rotation.y*rotation.y; - xz=rotation.x*rotation.z; yz=rotation.y*rotation.z; zz=rotation.z*rotation.z; - xw=rotation.x*rotation.w; yw=rotation.y*rotation.w; zw=rotation.z*rotation.w; ww=rotation.w*rotation.w; - - #ifdef MCORE_MATRIX_ROWMAJOR - r33[0][0] = +xx-yy-zz+ww; r33[0][1] = +xy+zw+xy+zw; r33[0][2] = +xz-yw+xz-yw; - r33[1][0] = +xy-zw+xy-zw; r33[1][1] = -xx+yy-zz+ww; r33[1][2] = +yz+xw+yz+xw; - r33[2][0] = +xz+yw+xz+yw; r33[2][1] = +yz-xw+yz-xw; r33[2][2] = -xx-yy+zz+ww; - #else - r33[0][0] = +xx-yy-zz+ww; r33[1][0] = +xy+zw+xy+zw; r33[2][0] = +xz-yw+xz-yw; - r33[0][1] = +xy-zw+xy-zw; r33[1][1] = -xx+yy-zz+ww; r33[2][1] = +yz+xw+yz+xw; - r33[0][2] = +xz+yw+xz+yw; r33[1][2] = +yz-xw+yz-xw; r33[2][2] = -xx-yy+zz+ww; - #endif - - // mult 3x3 matrix - for (i=0; i<3; ++i) - { - v[0] = TMAT(i,0); - v[1] = TMAT(i,1); - v[2] = TMAT(i,2); - - #ifdef MCORE_MATRIX_ROWMAJOR - TMAT(i,0) = v[0]*r33[0][0] + v[1]*r33[1][0] + v[2]*r33[2][0]; - TMAT(i,1) = v[0]*r33[0][1] + v[1]*r33[1][1] + v[2]*r33[2][1]; - TMAT(i,2) = v[0]*r33[0][2] + v[1]*r33[1][2] + v[2]*r33[2][2]; - #else - TMAT(i,0) = v[0]*r33[0][0] + v[1]*r33[0][1] + v[2]*r33[0][2]; - TMAT(i,1) = v[0]*r33[1][0] + v[1]*r33[1][1] + v[2]*r33[1][2]; - TMAT(i,2) = v[0]*r33[2][0] + v[1]*r33[2][1] + v[2]*r33[2][2]; - #endif - } - - // apply translation - TMAT(3,0) = translation.x; - TMAT(3,1) = translation.y; - TMAT(3,2) = translation.z; - } - */ - - - void Matrix::MultMatrix4x3(const Matrix& right) - { - #if (AZ_TRAIT_USE_PLATFORM_SIMD_SSE && defined(MCORE_MATRIX_ROWMAJOR)) - const float* m = right.m_m16; - const float* n = m_m16; - float* t = this->m_m16; - - __m128 x0; - __m128 x1; - __m128 x2; - __m128 x3; - __m128 x4; - __m128 x5; - __m128 x6; - __m128 x7; - x0 = _mm_loadu_ps(&m[0]); - x1 = _mm_loadu_ps(&m[4]); - x2 = _mm_loadu_ps(&m[8]); - x3 = _mm_loadu_ps(&m[12]); - x4 = _mm_load_ps1(&n[0]); - x5 = _mm_load_ps1(&n[1]); - x6 = _mm_load_ps1(&n[2]); - x7 = _mm_load_ps1(&n[3]); - x4 = _mm_mul_ps(x4, x0); - x5 = _mm_mul_ps(x5, x1); - x6 = _mm_mul_ps(x6, x2); - x7 = _mm_mul_ps(x7, x3); - x4 = _mm_add_ps(x4, x5); - x6 = _mm_add_ps(x6, x7); - x4 = _mm_add_ps(x4, x6); - x5 = _mm_load_ps1(&n[4]); - x6 = _mm_load_ps1(&n[5]); - x7 = _mm_load_ps1(&n[6]); - x5 = _mm_mul_ps(x5, x0); - x6 = _mm_mul_ps(x6, x1); - x7 = _mm_mul_ps(x7, x2); - x5 = _mm_add_ps(x5, x6); - x5 = _mm_add_ps(x5, x7); - x6 = _mm_load_ps1(&n[7]); - x6 = _mm_mul_ps(x6, x3); - x5 = _mm_add_ps(x5, x6); - x6 = _mm_load_ps1(&n[8]); - x7 = _mm_load_ps1(&n[9]); - x6 = _mm_mul_ps(x6, x0); - x7 = _mm_mul_ps(x7, x1); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[10]); - x7 = _mm_mul_ps(x7, x2); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[11]); - x7 = _mm_mul_ps(x7, x3); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[12]); - x0 = _mm_mul_ps(x0, x7); - x7 = _mm_load_ps1(&n[13]); - x1 = _mm_mul_ps(x1, x7); - x7 = _mm_load_ps1(&n[14]); - x2 = _mm_mul_ps(x2, x7); - x7 = _mm_load_ps1(&n[15]); - x3 = _mm_mul_ps(x3, x7); - x0 = _mm_add_ps(x0, x1); - x2 = _mm_add_ps(x2, x3); - x0 = _mm_add_ps(x0, x2); - - //store result - _mm_storeu_ps(&t[0], x4); - _mm_storeu_ps(&t[4], x5); - _mm_storeu_ps(&t[8], x6); - _mm_storeu_ps(&t[12], x0); - #else - float v[3]; - - for (uint32 i = 0; i < 4; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - TMAT(i, 0) = v[0] * MMAT(right, 0, 0) + v[1] * MMAT(right, 1, 0) + v[2] * MMAT(right, 2, 0); - TMAT(i, 1) = v[0] * MMAT(right, 0, 1) + v[1] * MMAT(right, 1, 1) + v[2] * MMAT(right, 2, 1); - TMAT(i, 2) = v[0] * MMAT(right, 0, 2) + v[1] * MMAT(right, 1, 2) + v[2] * MMAT(right, 2, 2); - } - - TMAT(3, 0) += MMAT(right, 3, 0); - TMAT(3, 1) += MMAT(right, 3, 1); - TMAT(3, 2) += MMAT(right, 3, 2); - #endif - } - - - // *this = left * right - void Matrix::MultMatrix(const Matrix& left, const Matrix& right) - { - #if (AZ_TRAIT_USE_PLATFORM_SIMD_SSE && defined(MCORE_MATRIX_ROWMAJOR)) - const float* m = right.m_m16; - const float* n = left.m_m16; - float* t = this->m_m16; - - __m128 x0; - __m128 x1; - __m128 x2; - __m128 x3; - __m128 x4; - __m128 x5; - __m128 x6; - __m128 x7; - x0 = _mm_loadu_ps(&m[0]); - x1 = _mm_loadu_ps(&m[4]); - x2 = _mm_loadu_ps(&m[8]); - x3 = _mm_loadu_ps(&m[12]); - x4 = _mm_load_ps1(&n[0]); - x5 = _mm_load_ps1(&n[1]); - x6 = _mm_load_ps1(&n[2]); - x7 = _mm_load_ps1(&n[3]); - x4 = _mm_mul_ps(x4, x0); - x5 = _mm_mul_ps(x5, x1); - x6 = _mm_mul_ps(x6, x2); - x7 = _mm_mul_ps(x7, x3); - x4 = _mm_add_ps(x4, x5); - x6 = _mm_add_ps(x6, x7); - x4 = _mm_add_ps(x4, x6); - x5 = _mm_load_ps1(&n[4]); - x6 = _mm_load_ps1(&n[5]); - x7 = _mm_load_ps1(&n[6]); - x5 = _mm_mul_ps(x5, x0); - x6 = _mm_mul_ps(x6, x1); - x7 = _mm_mul_ps(x7, x2); - x5 = _mm_add_ps(x5, x6); - x5 = _mm_add_ps(x5, x7); - x6 = _mm_load_ps1(&n[7]); - x6 = _mm_mul_ps(x6, x3); - x5 = _mm_add_ps(x5, x6); - x6 = _mm_load_ps1(&n[8]); - x7 = _mm_load_ps1(&n[9]); - x6 = _mm_mul_ps(x6, x0); - x7 = _mm_mul_ps(x7, x1); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[10]); - x7 = _mm_mul_ps(x7, x2); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[11]); - x7 = _mm_mul_ps(x7, x3); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[12]); - x0 = _mm_mul_ps(x0, x7); - x7 = _mm_load_ps1(&n[13]); - x1 = _mm_mul_ps(x1, x7); - x7 = _mm_load_ps1(&n[14]); - x2 = _mm_mul_ps(x2, x7); - x7 = _mm_load_ps1(&n[15]); - x3 = _mm_mul_ps(x3, x7); - x0 = _mm_add_ps(x0, x1); - x2 = _mm_add_ps(x2, x3); - x0 = _mm_add_ps(x0, x2); - - //store result - _mm_storeu_ps(&t[0], x4); - _mm_storeu_ps(&t[4], x5); - _mm_storeu_ps(&t[8], x6); - _mm_storeu_ps(&t[12], x0); - #else - float v[4]; - for (uint32 i = 0; i < 4; ++i) - { - v[0] = MMAT(left, i, 0); - v[1] = MMAT(left, i, 1); - v[2] = MMAT(left, i, 2); - v[3] = MMAT(left, i, 3); - TMAT(i, 0) = v[0] * MMAT(right, 0, 0) + v[1] * MMAT(right, 1, 0) + v[2] * MMAT(right, 2, 0) + v[3] * MMAT(right, 3, 0); - TMAT(i, 1) = v[0] * MMAT(right, 0, 1) + v[1] * MMAT(right, 1, 1) + v[2] * MMAT(right, 2, 1) + v[3] * MMAT(right, 3, 1); - TMAT(i, 2) = v[0] * MMAT(right, 0, 2) + v[1] * MMAT(right, 1, 2) + v[2] * MMAT(right, 2, 2) + v[3] * MMAT(right, 3, 2); - TMAT(i, 3) = v[0] * MMAT(right, 0, 3) + v[1] * MMAT(right, 1, 3) + v[2] * MMAT(right, 2, 3) + v[3] * MMAT(right, 3, 3); - } - #endif - } - - - - void Matrix::MultMatrix4x3(const Matrix& left, const Matrix& right) - { - #if (AZ_TRAIT_USE_PLATFORM_SIMD_SSE && defined(MCORE_MATRIX_ROWMAJOR)) - const float* m = right.m_m16; - const float* n = left.m_m16; - float* t = this->m_m16; - - __m128 x0; - __m128 x1; - __m128 x2; - __m128 x3; - __m128 x4; - __m128 x5; - __m128 x6; - __m128 x7; - x0 = _mm_loadu_ps(&m[0]); - x1 = _mm_loadu_ps(&m[4]); - x2 = _mm_loadu_ps(&m[8]); - x3 = _mm_loadu_ps(&m[12]); - x4 = _mm_load_ps1(&n[0]); - x5 = _mm_load_ps1(&n[1]); - x6 = _mm_load_ps1(&n[2]); - x7 = _mm_load_ps1(&n[3]); - x4 = _mm_mul_ps(x4, x0); - x5 = _mm_mul_ps(x5, x1); - x6 = _mm_mul_ps(x6, x2); - x7 = _mm_mul_ps(x7, x3); - x4 = _mm_add_ps(x4, x5); - x6 = _mm_add_ps(x6, x7); - x4 = _mm_add_ps(x4, x6); - x5 = _mm_load_ps1(&n[4]); - x6 = _mm_load_ps1(&n[5]); - x7 = _mm_load_ps1(&n[6]); - x5 = _mm_mul_ps(x5, x0); - x6 = _mm_mul_ps(x6, x1); - x7 = _mm_mul_ps(x7, x2); - x5 = _mm_add_ps(x5, x6); - x5 = _mm_add_ps(x5, x7); - x6 = _mm_load_ps1(&n[7]); - x6 = _mm_mul_ps(x6, x3); - x5 = _mm_add_ps(x5, x6); - x6 = _mm_load_ps1(&n[8]); - x7 = _mm_load_ps1(&n[9]); - x6 = _mm_mul_ps(x6, x0); - x7 = _mm_mul_ps(x7, x1); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[10]); - x7 = _mm_mul_ps(x7, x2); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[11]); - x7 = _mm_mul_ps(x7, x3); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[12]); - x0 = _mm_mul_ps(x0, x7); - x7 = _mm_load_ps1(&n[13]); - x1 = _mm_mul_ps(x1, x7); - x7 = _mm_load_ps1(&n[14]); - x2 = _mm_mul_ps(x2, x7); - x7 = _mm_load_ps1(&n[15]); - x3 = _mm_mul_ps(x3, x7); - x0 = _mm_add_ps(x0, x1); - x2 = _mm_add_ps(x2, x3); - x0 = _mm_add_ps(x0, x2); - - //store result - _mm_storeu_ps(&t[0], x4); - _mm_storeu_ps(&t[4], x5); - _mm_storeu_ps(&t[8], x6); - _mm_storeu_ps(&t[12], x0); - #else - float v[3]; - for (uint32 i = 0; i < 4; ++i) - { - v[0] = MMAT(left, i, 0); - v[1] = MMAT(left, i, 1); - v[2] = MMAT(left, i, 2); - TMAT(i, 0) = v[0] * MMAT(right, 0, 0) + v[1] * MMAT(right, 1, 0) + v[2] * MMAT(right, 2, 0); - TMAT(i, 1) = v[0] * MMAT(right, 0, 1) + v[1] * MMAT(right, 1, 1) + v[2] * MMAT(right, 2, 1); - TMAT(i, 2) = v[0] * MMAT(right, 0, 2) + v[1] * MMAT(right, 1, 2) + v[2] * MMAT(right, 2, 2); - } - - TMAT(0, 3) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 3) = 0.0f; - TMAT(3, 3) = 1.0f; - TMAT(3, 0) += MMAT(right, 3, 0); - TMAT(3, 1) += MMAT(right, 3, 1); - TMAT(3, 2) += MMAT(right, 3, 2); - #endif - } - - - void Matrix::MultMatrix3x3(const Matrix& right) - { - float v[3]; - for (uint32 i = 0; i < 4; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - TMAT(i, 0) = v[0] * MMAT(right, 0, 0) + v[1] * MMAT(right, 1, 0) + v[2] * MMAT(right, 2, 0); - TMAT(i, 1) = v[0] * MMAT(right, 0, 1) + v[1] * MMAT(right, 1, 1) + v[2] * MMAT(right, 2, 1); - TMAT(i, 2) = v[0] * MMAT(right, 0, 2) + v[1] * MMAT(right, 1, 2) + v[2] * MMAT(right, 2, 2); - } - } - - - void Matrix::Transpose() - { - Matrix v; - - MMAT(v, 0, 0) = TMAT(0, 0); - MMAT(v, 0, 1) = TMAT(1, 0); - MMAT(v, 0, 2) = TMAT(2, 0); - MMAT(v, 0, 3) = TMAT(3, 0); - MMAT(v, 1, 0) = TMAT(0, 1); - MMAT(v, 1, 1) = TMAT(1, 1); - MMAT(v, 1, 2) = TMAT(2, 1); - MMAT(v, 1, 3) = TMAT(3, 1); - MMAT(v, 2, 0) = TMAT(0, 2); - MMAT(v, 2, 1) = TMAT(1, 2); - MMAT(v, 2, 2) = TMAT(2, 2); - MMAT(v, 2, 3) = TMAT(3, 2); - MMAT(v, 3, 0) = TMAT(0, 3); - MMAT(v, 3, 1) = TMAT(1, 3); - MMAT(v, 3, 2) = TMAT(2, 3); - MMAT(v, 3, 3) = TMAT(3, 3); - - *this = v; - } - - - void Matrix::TransposeTranslation() - { - AZ::Vector3 temp; - - temp.SetX(TMAT(3, 0)); - temp.SetY(TMAT(3, 1)); - temp.SetZ(TMAT(3, 2)); - - TMAT(3, 0) = TMAT(0, 3); - TMAT(3, 1) = TMAT(1, 3); - TMAT(3, 2) = TMAT(2, 3); - - TMAT(0, 3) = temp.GetX(); - TMAT(1, 3) = temp.GetY(); - TMAT(2, 3) = temp.GetZ(); - } - - - - void Matrix::Adjoint() - { - Matrix v; - - MMAT(v, 0, 0) = TMAT(1, 1) * TMAT(2, 2) - TMAT(1, 2) * TMAT(2, 1); - MMAT(v, 0, 1) = TMAT(2, 1) * TMAT(0, 2) - TMAT(2, 2) * TMAT(0, 1); - MMAT(v, 0, 2) = TMAT(0, 1) * TMAT(1, 2) - TMAT(0, 2) * TMAT(1, 1); - MMAT(v, 0, 3) = TMAT(0, 3); - MMAT(v, 1, 0) = TMAT(1, 2) * TMAT(2, 0) - TMAT(1, 0) * TMAT(2, 2); - MMAT(v, 1, 1) = TMAT(2, 2) * TMAT(0, 0) - TMAT(2, 0) * TMAT(0, 2); - MMAT(v, 1, 2) = TMAT(0, 2) * TMAT(1, 0) - TMAT(0, 0) * TMAT(1, 2); - MMAT(v, 1, 3) = TMAT(1, 3); - MMAT(v, 2, 0) = TMAT(1, 0) * TMAT(2, 1) - TMAT(1, 1) * TMAT(2, 0); - MMAT(v, 2, 1) = TMAT(2, 0) * TMAT(0, 1) - TMAT(2, 1) * TMAT(0, 0); - MMAT(v, 2, 2) = TMAT(0, 0) * TMAT(1, 1) - TMAT(0, 1) * TMAT(1, 0); - MMAT(v, 2, 3) = TMAT(2, 3); - MMAT(v, 3, 0) = -(TMAT(0, 0) * TMAT(3, 0) + TMAT(1, 0) * TMAT(3, 1) + TMAT(2, 0) * TMAT(3, 2)); - MMAT(v, 3, 1) = -(TMAT(0, 1) * TMAT(3, 0) + TMAT(1, 1) * TMAT(3, 1) + TMAT(2, 1) * TMAT(3, 2)); - MMAT(v, 3, 2) = -(TMAT(0, 2) * TMAT(3, 0) + TMAT(1, 2) * TMAT(3, 1) + TMAT(2, 2) * TMAT(3, 2)); - MMAT(v, 3, 3) = TMAT(3, 3); - - *this = v; - } - - - - AZ::Vector3 Matrix::InverseRot(const AZ::Vector3& v) - { - Matrix m(*this); - m.Inverse(); - m.SetTranslation(0.0f, 0.0f, 0.0f); - return v * m; - } - - - - void Matrix::Inverse() - { - Matrix v; - - const float s = 1.0f / CalcDeterminant(); - MMAT(v, 0, 0) = (TMAT(1, 1) * TMAT(2, 2) - TMAT(1, 2) * TMAT(2, 1)) * s; - MMAT(v, 0, 1) = (TMAT(2, 1) * TMAT(0, 2) - TMAT(2, 2) * TMAT(0, 1)) * s; - MMAT(v, 0, 2) = (TMAT(0, 1) * TMAT(1, 2) - TMAT(0, 2) * TMAT(1, 1)) * s; - MMAT(v, 0, 3) = TMAT(0, 3); - MMAT(v, 1, 0) = (TMAT(1, 2) * TMAT(2, 0) - TMAT(1, 0) * TMAT(2, 2)) * s; - MMAT(v, 1, 1) = (TMAT(2, 2) * TMAT(0, 0) - TMAT(2, 0) * TMAT(0, 2)) * s; - MMAT(v, 1, 2) = (TMAT(0, 2) * TMAT(1, 0) - TMAT(0, 0) * TMAT(1, 2)) * s; - MMAT(v, 1, 3) = TMAT(1, 3); - MMAT(v, 2, 0) = (TMAT(1, 0) * TMAT(2, 1) - TMAT(1, 1) * TMAT(2, 0)) * s; - MMAT(v, 2, 1) = (TMAT(2, 0) * TMAT(0, 1) - TMAT(2, 1) * TMAT(0, 0)) * s; - MMAT(v, 2, 2) = (TMAT(0, 0) * TMAT(1, 1) - TMAT(0, 1) * TMAT(1, 0)) * s; - MMAT(v, 2, 3) = TMAT(2, 3); - MMAT(v, 3, 0) = -(MMAT(v, 0, 0) * TMAT(3, 0) + MMAT(v, 1, 0) * TMAT(3, 1) + MMAT(v, 2, 0) * TMAT(3, 2)); - MMAT(v, 3, 1) = -(MMAT(v, 0, 1) * TMAT(3, 0) + MMAT(v, 1, 1) * TMAT(3, 1) + MMAT(v, 2, 1) * TMAT(3, 2)); - MMAT(v, 3, 2) = -(MMAT(v, 0, 2) * TMAT(3, 0) + MMAT(v, 1, 2) * TMAT(3, 1) + MMAT(v, 2, 2) * TMAT(3, 2)); - MMAT(v, 3, 3) = TMAT(3, 3); - - *this = v; - } - - - - void Matrix::OrthoNormalize() - { - AZ::Vector3 x = GetRight(); - AZ::Vector3 y = GetUp(); - //Vector3 z = GetForward(); - - x.Normalize(); - y -= x * x.Dot(y); - y.Normalize(); - AZ::Vector3 z = x.Cross(y); - - SetRight(x); - SetUp(y); - SetForward(z); - } - - - - void Matrix::Mirror(const Matrix& transform, const PlaneEq& plane) - { - // components - AZ::Vector3 x = transform.GetRight(); - AZ::Vector3 y = transform.GetForward(); - AZ::Vector3 z = transform.GetUp(); - AZ::Vector3 t = transform.GetTranslation(); - AZ::Vector3 n = plane.GetNormal(); - AZ::Vector3 n2 = n * -2.0f; - float d = plane.GetDist(); - - // mirror translation - AZ::Vector3 mt = t + n2 * (t.Dot(n) - d); - - // mirror x rotation - x += t; - x += n2 * (x.Dot(n) - d); - x -= mt; - - // mirror y rotation - y += t; - y += n2 * (y.Dot(n) - d); - y -= mt; - - // mirror z rotation - z += t; - z += n2 * (z.Dot(n) - d); - z -= mt; - - // write result - SetRight(x); - SetForward(y); - SetUp(z); - SetTranslation(mt); - - TMAT(0, 3) = 0; - TMAT(1, 3) = 0; - TMAT(2, 3) = 0; - TMAT(3, 3) = 1; - } - - - void Matrix::LookAt(const AZ::Vector3& view, const AZ::Vector3& target, const AZ::Vector3& up) - { - const AZ::Vector3 z = (target - view).GetNormalized(); - const AZ::Vector3 x = (up.Cross(z)).GetNormalized(); - const AZ::Vector3 y = z.Cross(x); - - TMAT(0, 0) = x.GetX(); - TMAT(0, 1) = y.GetX(); - TMAT(0, 2) = z.GetX(); - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = x.GetY(); - TMAT(1, 1) = y.GetY(); - TMAT(1, 2) = z.GetY(); - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = x.GetZ(); - TMAT(2, 1) = y.GetZ(); - TMAT(2, 2) = z.GetZ(); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = -x.Dot(view); - TMAT(3, 1) = -y.Dot(view); - TMAT(3, 2) = -z.Dot(view); - TMAT(3, 3) = 1.0f; - - // DirectX: - // zaxis = normal(cameraTarget - cameraPosition) - // xaxis = normal(cross(cameraUpVector, zaxis)) - // yaxis = cross(zaxis, xaxis) - // xaxis.x yaxis.x zaxis.x 0 - // xaxis.y yaxis.y zaxis.y 0 - // xaxis.z yaxis.z zaxis.z 0 - // -dot(xaxis, cameraPosition) -dot(yaxis, cameraPosition) -dot(zaxis, cameraPosition) 1 - } - - - void Matrix::LookAtRH(const AZ::Vector3& view, const AZ::Vector3& target, const AZ::Vector3& up) - { - const AZ::Vector3 z = (view - target).GetNormalized(); - const AZ::Vector3 x = (up.Cross(z)).GetNormalized(); - const AZ::Vector3 y = z.Cross(x); - - TMAT(0, 0) = x.GetX(); - TMAT(0, 1) = y.GetX(); - TMAT(0, 2) = z.GetX(); - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = x.GetY(); - TMAT(1, 1) = y.GetY(); - TMAT(1, 2) = z.GetY(); - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = x.GetZ(); - TMAT(2, 1) = y.GetZ(); - TMAT(2, 2) = z.GetZ(); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = -x.Dot(view); - TMAT(3, 1) = -y.Dot(view); - TMAT(3, 2) = -z.Dot(view); - TMAT(3, 3) = 1.0f; - - // DirectX: - // zaxis = normal(cameraPosition - cameraTarget) - // xaxis = normal(cross(cameraUpVector, zaxis)) - // yaxis = cross(zaxis, xaxis) - // xaxis.x yaxis.x zaxis.x 0 - // xaxis.y yaxis.y zaxis.y 0 - // xaxis.z yaxis.z zaxis.z 0 - // -dot(xaxis, cameraPosition) -dot(yaxis, cameraPosition) -dot(zaxis, cameraPosition) 1 - } - - // ortho projection matrix - void Matrix::OrthoOffCenter(float left, float right, float top, float bottom, float znear, float zfar) - { - TMAT(0, 0) = 2.0f / (right - left); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 2.0f / (top - bottom); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f / (zfar - znear); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = (left + right) / (left - right); - TMAT(3, 1) = (top + bottom) / (bottom - top); - TMAT(3, 2) = znear / (znear - zfar); - TMAT(3, 3) = 1.0f; - - // DirectX: - // 2/(right-l) 0 0 0 - // 0 2/(top-bottom) 0 0 - // 0 0 1/(zfarPlane-znearPlane) 0 - // (l+right)/(l-right) (top+bottom)/(bottom-top) znearPlane/(znearPlane-zfarPlane) 1 - } - - - // ortho projection matrix - void Matrix::OrthoOffCenterRH(float left, float right, float top, float bottom, float znear, float zfar) - { - TMAT(0, 0) = 2.0f / (right - left); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 2.0f / (top - bottom); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f / (znear - zfar); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = (left + right) / (left - right); - TMAT(3, 1) = (top + bottom) / (bottom - top); - TMAT(3, 2) = znear / (znear - zfar); - TMAT(3, 3) = 1.0f; - - // DirectX: - // 2/(right-left) 0 0 0 - // 0 2/(top-bottom) 0 0 - // 0 0 1/(znearPlane-zfarPlane) 0 - // (l+right)/(l-rright) (top+bottom)/(bottom-top) znearPlane/(znearPlane-zfarPlane) 1 - } - - - // ortho projection matrix - void Matrix::Ortho(float left, float right, float top, float bottom, float znear, float zfar) - { - TMAT(0, 0) = 2.0f / (right - left); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 2.0f / (top - bottom); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f / (zfar - znear); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = znear / (znear - zfar); - TMAT(3, 3) = 1.0f; - - // DirectX: - // 2/width 0 0 0 - // 0 2/height 0 0 - // 0 0 1/(zfarPlane-znearPlane) 0 - // 0 0 znearPlane/(znearPlane-zfarPlane) 1 - } - - - // ortho projection matrix, right handed - void Matrix::OrthoRH(float left, float right, float top, float bottom, float znear, float zfar) - { - TMAT(0, 0) = 2.0f / (right - left); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 2.0f / (top - bottom); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f / (znear - zfar); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = znear / (znear - zfar); - TMAT(3, 3) = 1.0f; - - // DirectX: - // 2/width 0 0 0 - // 0 2/height 0 0 - // 0 0 1/(znearPlane-zfarPlane) 0 - // 0 0 znearPlane/(znearPlane-zfarPlane) 1 - } - - - // frustum matrix - void Matrix::Frustum(float left, float right, float top, float bottom, float znear, float zfar) - { - TMAT(0, 0) = 2.0f * znear / (right - left); - TMAT(1, 0) = 0.0f; - TMAT(2, 0) = (right + left) / (right - left); - TMAT(3, 0) = 0.0f; - TMAT(0, 1) = 0.0f; - TMAT(1, 1) = 2.0f * znear / (top - bottom); - TMAT(2, 1) = (top + bottom) / (top - bottom); - TMAT(3, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(1, 2) = 0.0f; - TMAT(2, 2) = (zfar + znear) / (zfar - znear); - TMAT(3, 2) = 2.0f * zfar * znear / (zfar - znear); - TMAT(0, 3) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 3) = -1.0f; - TMAT(3, 3) = 0.0f; - } - - - // setup perspective projection matrix - void Matrix::Perspective(float fov, float aspect, float zNear, float zFar) - { - const float yScale = 1.0f / Math::Tan(fov * 0.5f); - const float xScale = yScale / aspect; - const float d = zFar / (zFar - zNear); - - MCore::MemSet(m44, 0, 16 * sizeof(float)); - TMAT(0, 0) = xScale; - TMAT(1, 1) = yScale; - TMAT(2, 2) = d; - TMAT(2, 3) = 1.0f; - TMAT(3, 2) = -zNear * d; - } - - - // setup perspective projection matrix, right handed - void Matrix::PerspectiveRH(float fov, float aspect, float zNear, float zFar) - { - const float yScale = 1.0f / Math::Tan(fov * 0.5f); - const float xScale = yScale / aspect; - const float d = zFar / (zNear - zFar); - - MCore::MemSet(m44, 0, 16 * sizeof(float)); - TMAT(0, 0) = xScale; - TMAT(1, 1) = yScale; - TMAT(2, 2) = d; - TMAT(2, 3) = -1.0f; - TMAT(3, 2) = zNear * d; - } - - - // check if the matrix is symmetric or not - bool Matrix::CheckIfIsSymmetric(float tolerance) const - { - // if no tolerance check is needed - if (MCore::Math::IsFloatZero(tolerance)) - { - if (TMAT(1, 0) != TMAT(0, 1)) - { - return false; - } - if (TMAT(2, 0) != TMAT(0, 2)) - { - return false; - } - if (TMAT(2, 1) != TMAT(1, 2)) - { - return false; - } - if (TMAT(3, 0) != TMAT(0, 3)) - { - return false; - } - if (TMAT(3, 1) != TMAT(1, 3)) - { - return false; - } - if (TMAT(3, 2) != TMAT(2, 3)) - { - return false; - } - } - else // tolerance check needed - { - if (Math::Abs(TMAT(1, 0) - TMAT(0, 1)) > tolerance) - { - return false; - } - if (Math::Abs(TMAT(2, 0) - TMAT(0, 2)) > tolerance) - { - return false; - } - if (Math::Abs(TMAT(2, 1) - TMAT(1, 2)) > tolerance) - { - return false; - } - if (Math::Abs(TMAT(3, 0) - TMAT(0, 3)) > tolerance) - { - return false; - } - if (Math::Abs(TMAT(3, 1) - TMAT(1, 3)) > tolerance) - { - return false; - } - if (Math::Abs(TMAT(3, 2) - TMAT(2, 3)) > tolerance) - { - return false; - } - } - - // yeah, we have a symmetric matrix here - return true; - } - - - // check if this matrix is a diagonal matrix or not. - bool Matrix::CheckIfIsDiagonal(float tolerance) const - { - if (tolerance <= Math::epsilon) - { - // for all entries - for (uint32 y = 0; y < 4; ++y) - { - for (uint32 x = 0; x < 4; ++x) - { - // if we are on the diagonal - if (x == y) - { - if (TMAT(y, x) == 0) - { - return false; // if this entry on the diagonal is 0, we have no diagonal matrix - } - } - else // we are not on the diagonal - if (TMAT(y, x) != 0) - { - return false; // if the entry isn't equal to 0, it isn't a diagonal matrix - } - } - } - } - else - { - // for all entries - for (uint32 y = 0; y < 4; ++y) - { - for (uint32 x = 0; x < 4; ++x) - { - // if we are on the diagonal - if (x == y) - { - if (Math::Abs(TMAT(y, x)) < tolerance) - { - return false; // if this entry on the diagonal is 0, we have no diagonal matrix - } - } - else // we are not on the diagonal - { - if (Math::Abs(TMAT(y, x)) > tolerance) - { - return false; // if the entry isn't equal to 0, it isn't a diagonal matrix - } - } - } - } - } - - // yeaaah, we have a diagonal matrix here - return true; - } - - - // prints the matrix into the logfile or debug output, using MCore::LOG() - void Matrix::Log() const - { - MCore::LogDetailedInfo(""); - MCore::LogDetailedInfo("(%.8f, %.8f, %.8f, %.8f)", m_m16[0], m_m16[1], m_m16[2], m_m16[3]); - MCore::LogDetailedInfo("(%.8f, %.8f, %.8f, %.8f)", m_m16[4], m_m16[5], m_m16[6], m_m16[7]); - MCore::LogDetailedInfo("(%.8f, %.8f, %.8f, %.8f)", m_m16[8], m_m16[9], m_m16[10], m_m16[11]); - MCore::LogDetailedInfo("(%.8f, %.8f, %.8f, %.8f)", m_m16[12], m_m16[13], m_m16[14], m_m16[15]); - MCore::LogDetailedInfo(""); - } - - - // check if the matrix is orthogonal or not - bool Matrix::CheckIfIsOrthogonal(float tolerance) const - { - // get the matrix vectors - AZ::Vector3 right = GetRight(); - AZ::Vector3 up = GetUp(); - AZ::Vector3 forward = GetForward(); - - // check if the vectors form an orthonormal set - if (Math::Abs(right.Dot(up)) > tolerance) - { - return false; - } - if (Math::Abs(right.Dot(forward)) > tolerance) - { - return false; - } - if (Math::Abs(forward.Dot(up)) > tolerance) - { - return false; - } - - // the vector set is not orthonormal, so the matrix is not an orthogonal one - return true; - } - - - // check if the matrix is an identity matrix or not - bool Matrix::CheckIfIsIdentity(float tolerance) const - { - // for all entries - for (uint32 y = 0; y < 4; ++y) - { - for (uint32 x = 0; x < 4; ++x) - { - // if we are on the diagonal - if (x == y) - { - if (Math::Abs(1.0f - TMAT(y, x)) > tolerance) - { - return false; // if this entry on the diagonal not 1, we have no identity matrix - } - } - else // we are not on the diagonal - { - if (Math::Abs(TMAT(y, x)) > tolerance) - { - return false; // if the entry isn't equal to 0, it isn't an identity matrix - } - } - } - } - - // yup, we have an identity matrix here :) - return true; - } - - - // calculate the handedness of the matrix - float Matrix::CalcHandedness() const - { - // get the matrix vectors - AZ::Vector3 right = GetRight(); - AZ::Vector3 up = GetUp(); - AZ::Vector3 forward = GetForward(); - - // calculate the handedness (negative result means left handed, positive means right handed) - return (right.Cross(up)).Dot(forward); - } - - - // check if the matrix is right handed or not - bool Matrix::CheckIfIsRightHanded() const - { - return (CalcHandedness() <= 0.0f); - } - - - // check if the matrix is right handed or not - - bool Matrix::CheckIfIsLeftHanded() const - { - return (CalcHandedness() > 0.0f); - } - - - // check if this matrix is a pure rotation matrix or not - bool Matrix::CheckIfIsPureRotationMatrix(float tolerance) const - { - return (Math::Abs(1.0f - CalcDeterminant()) < tolerance); - } - - - // check if the matrix is reflected (mirrored) or not - bool Matrix::CheckIfIsReflective() const - { - float determinant = CalcDeterminant(); - return (determinant < 0.0f); - //return ((determinant > (-1.0 - tolerance)) && (determinant < (-1.0 + tolerance))); // if the determinant is near -1, it will reflect - } - - - // calculate the inverse transpose - void Matrix::InverseTranspose() - { - Inverse(); - Transpose(); - } - - - // return the inverse transposed version of this matrix - Matrix Matrix::InverseTransposed() const - { - Matrix result(*this); - result.InverseTranspose(); - return result; - } - - - // normalize a matrix - void Matrix::Normalize() - { - // get the current vectors - AZ::Vector3 right = GetRight(); - AZ::Vector3 up = GetUp(); - AZ::Vector3 forward = GetForward(); - - // normalize them - right.Normalize(); - up.Normalize(); - forward.Normalize(); - - // update them again with the normalized versions - SetRight(right); - SetUp(up); - SetForward(forward); - } - - - // creates a shear matrix - void Matrix::SetShearMatrix(const AZ::Vector3& s) - { - TMAT(0, 0) = 1; - TMAT(0, 1) = s.GetX(); - TMAT(0, 2) = s.GetY(); - TMAT(0, 3) = 0; - TMAT(1, 0) = 0; - TMAT(1, 1) = 1; - TMAT(1, 2) = s.GetZ(); - TMAT(1, 3) = 0; - TMAT(2, 0) = 0; - TMAT(2, 1) = 0; - TMAT(2, 2) = 1; - TMAT(2, 3) = 0; - TMAT(3, 0) = 0; - TMAT(3, 1) = 0; - TMAT(3, 2) = 0; - TMAT(3, 3) = 1; - } - - - - void Matrix::SetRotationMatrix(const AZ::Quaternion& rotation) - { - const float xx = rotation.GetX() * rotation.GetX(); - const float xy = rotation.GetX() * rotation.GetY(), yy = rotation.GetY() * rotation.GetY(); - const float xz = rotation.GetX() * rotation.GetZ(), yz = rotation.GetY() * rotation.GetZ(), zz = rotation.GetZ() * rotation.GetZ(); - const float xw = rotation.GetX() * rotation.GetW(), yw = rotation.GetY() * rotation.GetW(), zw = rotation.GetZ() * rotation.GetW(), ww = rotation.GetW() * rotation.GetW(); - - TMAT(0, 0) = +xx - yy - zz + ww; - TMAT(0, 1) = +xy + zw + xy + zw; - TMAT(0, 2) = +xz - yw + xz - yw; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = +xy - zw + xy - zw; - TMAT(1, 1) = -xx + yy - zz + ww; - TMAT(1, 2) = +yz + xw + yz + xw; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = +xz + yw + xz + yw; - TMAT(2, 1) = +yz - xw + yz - xw; - TMAT(2, 2) = -xx - yy + zz + ww; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - // calculate a rotation matrix from two vectors - void Matrix::SetRotationMatrixTwoVectors(const AZ::Vector3& from, const AZ::Vector3& to) - { - // calculate intermediate values - const float lengths = SafeLength(to) * SafeLength(from); - const float D = (lengths > Math::epsilon) ? 1.0f / lengths : 0.0f; - const float C = (to.GetX() * from.GetX() + to.GetY() * from.GetY() + to.GetZ() * from.GetZ()) * D; - const float vzwy = (to.GetY() * from.GetZ()) - (to.GetZ() * from.GetY()); - const float wxuz = (to.GetZ() * from.GetX()) - (to.GetX() * from.GetZ()); - const float uyvx = (to.GetX() * from.GetY()) - (to.GetY() * from.GetX()); - const float A = vzwy * vzwy + wxuz * wxuz + uyvx * uyvx; - - // return identity if the cross product of the two vectors is small - if (A < Math::epsilon) - { - Identity(); - return; - } - - // set the components of the rotation matrix - const float t = (1.0f - C) / A; - TMAT(0, 0) = t * vzwy * vzwy + C; - TMAT(1, 1) = t * wxuz * wxuz + C; - TMAT(2, 2) = t * uyvx * uyvx + C; - TMAT(3, 3) = 1.0f; - TMAT(0, 1) = t * vzwy * wxuz + D * uyvx; - TMAT(0, 2) = t * vzwy * uyvx - D * wxuz; - TMAT(1, 2) = t * wxuz * uyvx + D * vzwy; - TMAT(1, 0) = t * vzwy * wxuz - D * uyvx; - TMAT(2, 0) = t * vzwy * uyvx + D * wxuz; - TMAT(2, 1) = t * wxuz * uyvx - D * vzwy; - TMAT(0, 3) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - } - - - - // output: x=pitch, y=yaw, z=roll - // reconstruction: roll*pitch*yaw (zxy) - AZ::Vector3 Matrix::CalcPitchYawRoll() const - { - const float pitch = Math::ASin(-TMAT(2, 1)); - const float cosPitch = Math::Cos(pitch); - const float threshold = 0.0001f; - float roll; - float yaw; - - if (cosPitch > threshold) - { - roll = Math::ATan2(TMAT(0, 1), TMAT(1, 1)); - yaw = Math::ATan2(TMAT(2, 0), TMAT(2, 2)); - } - else - { - roll = Math::ATan2(-TMAT(1, 0), TMAT(0, 0)); - yaw = 0.0f; - } - - return AZ::Vector3(pitch, yaw, roll); - } - - - - // init the matrix from a yaw/pitch/roll angle set - void Matrix::SetRotationMatrixPitchYawRoll(float pitch, float yaw, float roll) - { - const float cosX = Math::Cos(pitch); - const float cosY = Math::Cos(yaw); - const float cosZ = Math::Cos(roll); - const float sinX = Math::Sin(pitch); - const float sinY = Math::Sin(yaw); - const float sinZ = Math::Sin(roll); - - TMAT(0, 0) = cosZ * cosY + sinZ * sinX * sinY; - TMAT(0, 1) = sinZ * cosX; - TMAT(0, 2) = cosZ * -sinY + sinZ * sinX * cosY; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = -sinZ * cosY + cosZ * sinX * sinY; - TMAT(1, 1) = cosZ * cosX; - TMAT(1, 2) = sinZ * sinY + cosZ * sinX * cosY; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = cosX * sinY; - TMAT(2, 1) = -sinX; - TMAT(2, 2) = cosX * cosY; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - - - // - void Matrix::DecomposeQRGramSchmidt(AZ::Vector3& translation, Matrix& rot, AZ::Vector3& scale, AZ::Vector3& shear) const - { - // build orthogonal matrix Q - float invLength = Math::InvSqrt(TMAT(0, 0) * TMAT(0, 0) + TMAT(1, 0) * TMAT(1, 0) + TMAT(2, 0) * TMAT(2, 0)); - MMAT(rot, 0, 0) = TMAT(0, 0) * invLength; - MMAT(rot, 1, 0) = TMAT(1, 0) * invLength; - MMAT(rot, 2, 0) = TMAT(2, 0) * invLength; - - float fDot = MMAT(rot, 0, 0) * TMAT(0, 1) + MMAT(rot, 1, 0) * TMAT(1, 1) + MMAT(rot, 2, 0) * TMAT(2, 1); - MMAT(rot, 0, 1) = TMAT(0, 1) - fDot * MMAT(rot, 0, 0); - MMAT(rot, 1, 1) = TMAT(1, 1) - fDot * MMAT(rot, 1, 0); - MMAT(rot, 2, 1) = TMAT(2, 1) - fDot * MMAT(rot, 2, 0); - invLength = Math::InvSqrt(MMAT(rot, 0, 1) * MMAT(rot, 0, 1) + MMAT(rot, 1, 1) * MMAT(rot, 1, 1) + MMAT(rot, 2, 1) * MMAT(rot, 2, 1)); - MMAT(rot, 0, 1) *= invLength; - MMAT(rot, 1, 1) *= invLength; - MMAT(rot, 2, 1) *= invLength; - - fDot = MMAT(rot, 0, 0) * TMAT(0, 2) + MMAT(rot, 1, 0) * TMAT(1, 2) + MMAT(rot, 2, 0) * TMAT(2, 2); - MMAT(rot, 0, 2) = TMAT(0, 2) - fDot * MMAT(rot, 0, 0); - MMAT(rot, 1, 2) = TMAT(1, 2) - fDot * MMAT(rot, 1, 0); - MMAT(rot, 2, 2) = TMAT(2, 2) - fDot * MMAT(rot, 2, 0); - fDot = MMAT(rot, 0, 1) * TMAT(0, 2) + MMAT(rot, 1, 1) * TMAT(1, 2) + MMAT(rot, 2, 1) * TMAT(2, 2); - MMAT(rot, 0, 2) -= fDot * MMAT(rot, 0, 1); - MMAT(rot, 1, 2) -= fDot * MMAT(rot, 1, 1); - MMAT(rot, 2, 2) -= fDot * MMAT(rot, 2, 1); - invLength = Math::InvSqrt(MMAT(rot, 0, 2) * MMAT(rot, 0, 2) + MMAT(rot, 1, 2) * MMAT(rot, 1, 2) + MMAT(rot, 2, 2) * MMAT(rot, 2, 2)); - MMAT(rot, 0, 2) *= invLength; - MMAT(rot, 1, 2) *= invLength; - MMAT(rot, 2, 2) *= invLength; - - // guarantee that orthogonal matrix has determinant 1 (no reflections) - float fDet = MMAT(rot, 0, 0) * MMAT(rot, 1, 1) * MMAT(rot, 2, 2) + MMAT(rot, 0, 1) * MMAT(rot, 1, 2) * MMAT(rot, 2, 0) + - MMAT(rot, 0, 2) * MMAT(rot, 1, 0) * MMAT(rot, 2, 1) - MMAT(rot, 0, 2) * MMAT(rot, 1, 1) * MMAT(rot, 2, 0) - - MMAT(rot, 0, 1) * MMAT(rot, 1, 0) * MMAT(rot, 2, 2) - MMAT(rot, 0, 0) * MMAT(rot, 1, 2) * MMAT(rot, 2, 1); - - if (fDet < 0.0f) - { - for (uint32 r = 0; r < 3; ++r) - { - for (uint32 c = 0; c < 3; ++c) - { - MMAT(rot, r, c) = -MMAT(rot, r, c); - } - } - } - - // build "right" matrix R - Matrix R; - MMAT(R, 0, 0) = MMAT(rot, 0, 0) * TMAT(0, 0) + MMAT(rot, 1, 0) * TMAT(1, 0) + MMAT(rot, 2, 0) * TMAT(2, 0); - MMAT(R, 0, 1) = MMAT(rot, 0, 0) * TMAT(0, 1) + MMAT(rot, 1, 0) * TMAT(1, 1) + MMAT(rot, 2, 0) * TMAT(2, 1); - MMAT(R, 1, 1) = MMAT(rot, 0, 1) * TMAT(0, 1) + MMAT(rot, 1, 1) * TMAT(1, 1) + MMAT(rot, 2, 1) * TMAT(2, 1); - MMAT(R, 0, 2) = MMAT(rot, 0, 0) * TMAT(0, 2) + MMAT(rot, 1, 0) * TMAT(1, 2) + MMAT(rot, 2, 0) * TMAT(2, 2); - MMAT(R, 1, 2) = MMAT(rot, 0, 1) * TMAT(0, 2) + MMAT(rot, 1, 1) * TMAT(1, 2) + MMAT(rot, 2, 1) * TMAT(2, 2); - MMAT(R, 2, 2) = MMAT(rot, 0, 2) * TMAT(0, 2) + MMAT(rot, 1, 2) * TMAT(1, 2) + MMAT(rot, 2, 2) * TMAT(2, 2); - - // the scaling component - scale.SetX(MMAT(R, 0, 0)); - scale.SetY(MMAT(R, 1, 1)); - scale.SetZ(MMAT(R, 2, 2)); - - // the shear component - const float invScaleX = 1.0f / scale.GetX(); - shear.SetX(MMAT(R, 0, 1) * invScaleX); - shear.SetY(MMAT(R, 0, 2) * invScaleX); - shear.SetZ(MMAT(R, 1, 2) / scale.GetY()); - - translation = GetTranslation(); - } - - - // - void Matrix::DecomposeQRGramSchmidt(AZ::Vector3& translation, Matrix& rot, AZ::Vector3& scale) const - { - // build orthogonal matrix Q - float invLength = Math::InvSqrt(TMAT(0, 0) * TMAT(0, 0) + TMAT(1, 0) * TMAT(1, 0) + TMAT(2, 0) * TMAT(2, 0)); - MMAT(rot, 0, 0) = TMAT(0, 0) * invLength; - MMAT(rot, 1, 0) = TMAT(1, 0) * invLength; - MMAT(rot, 2, 0) = TMAT(2, 0) * invLength; - - float fDot = MMAT(rot, 0, 0) * TMAT(0, 1) + MMAT(rot, 1, 0) * TMAT(1, 1) + MMAT(rot, 2, 0) * TMAT(2, 1); - MMAT(rot, 0, 1) = TMAT(0, 1) - fDot * MMAT(rot, 0, 0); - MMAT(rot, 1, 1) = TMAT(1, 1) - fDot * MMAT(rot, 1, 0); - MMAT(rot, 2, 1) = TMAT(2, 1) - fDot * MMAT(rot, 2, 0); - invLength = Math::InvSqrt(MMAT(rot, 0, 1) * MMAT(rot, 0, 1) + MMAT(rot, 1, 1) * MMAT(rot, 1, 1) + MMAT(rot, 2, 1) * MMAT(rot, 2, 1)); - MMAT(rot, 0, 1) *= invLength; - MMAT(rot, 1, 1) *= invLength; - MMAT(rot, 2, 1) *= invLength; - - fDot = MMAT(rot, 0, 0) * TMAT(0, 2) + MMAT(rot, 1, 0) * TMAT(1, 2) + MMAT(rot, 2, 0) * TMAT(2, 2); - MMAT(rot, 0, 2) = TMAT(0, 2) - fDot * MMAT(rot, 0, 0); - MMAT(rot, 1, 2) = TMAT(1, 2) - fDot * MMAT(rot, 1, 0); - MMAT(rot, 2, 2) = TMAT(2, 2) - fDot * MMAT(rot, 2, 0); - fDot = MMAT(rot, 0, 1) * TMAT(0, 2) + MMAT(rot, 1, 1) * TMAT(1, 2) + MMAT(rot, 2, 1) * TMAT(2, 2); - MMAT(rot, 0, 2) -= fDot * MMAT(rot, 0, 1); - MMAT(rot, 1, 2) -= fDot * MMAT(rot, 1, 1); - MMAT(rot, 2, 2) -= fDot * MMAT(rot, 2, 1); - invLength = Math::InvSqrt(MMAT(rot, 0, 2) * MMAT(rot, 0, 2) + MMAT(rot, 1, 2) * MMAT(rot, 1, 2) + MMAT(rot, 2, 2) * MMAT(rot, 2, 2)); - MMAT(rot, 0, 2) *= invLength; - MMAT(rot, 1, 2) *= invLength; - MMAT(rot, 2, 2) *= invLength; - - // guarantee that orthogonal matrix has determinant 1 (no reflections) - float fDet = MMAT(rot, 0, 0) * MMAT(rot, 1, 1) * MMAT(rot, 2, 2) + MMAT(rot, 0, 1) * MMAT(rot, 1, 2) * MMAT(rot, 2, 0) + - MMAT(rot, 0, 2) * MMAT(rot, 1, 0) * MMAT(rot, 2, 1) - MMAT(rot, 0, 2) * MMAT(rot, 1, 1) * MMAT(rot, 2, 0) - - MMAT(rot, 0, 1) * MMAT(rot, 1, 0) * MMAT(rot, 2, 2) - MMAT(rot, 0, 0) * MMAT(rot, 1, 2) * MMAT(rot, 2, 1); - - if (fDet < 0.0f) - { - for (uint32 r = 0; r < 3; ++r) - { - for (uint32 c = 0; c < 3; ++c) - { - MMAT(rot, r, c) = -MMAT(rot, r, c); - } - } - } - - // build "right" matrix R - Matrix R; - MMAT(R, 0, 0) = MMAT(rot, 0, 0) * TMAT(0, 0) + MMAT(rot, 1, 0) * TMAT(1, 0) + MMAT(rot, 2, 0) * TMAT(2, 0); - MMAT(R, 0, 1) = MMAT(rot, 0, 0) * TMAT(0, 1) + MMAT(rot, 1, 0) * TMAT(1, 1) + MMAT(rot, 2, 0) * TMAT(2, 1); - MMAT(R, 1, 1) = MMAT(rot, 0, 1) * TMAT(0, 1) + MMAT(rot, 1, 1) * TMAT(1, 1) + MMAT(rot, 2, 1) * TMAT(2, 1); - MMAT(R, 0, 2) = MMAT(rot, 0, 0) * TMAT(0, 2) + MMAT(rot, 1, 0) * TMAT(1, 2) + MMAT(rot, 2, 0) * TMAT(2, 2); - MMAT(R, 1, 2) = MMAT(rot, 0, 1) * TMAT(0, 2) + MMAT(rot, 1, 1) * TMAT(1, 2) + MMAT(rot, 2, 1) * TMAT(2, 2); - MMAT(R, 2, 2) = MMAT(rot, 0, 2) * TMAT(0, 2) + MMAT(rot, 1, 2) * TMAT(1, 2) + MMAT(rot, 2, 2) * TMAT(2, 2); - - // the scaling component - scale.SetX(MMAT(R, 0, 0)); - scale.SetY(MMAT(R, 1, 1)); - scale.SetZ(MMAT(R, 2, 2)); - - translation = GetTranslation(); - } - - - // decompose into translation and rotation - void Matrix::DecomposeQRGramSchmidt(AZ::Vector3& translation, Matrix& rot) const - { - // build orthogonal matrix Q - float invLength = Math::InvSqrt(TMAT(0, 0) * TMAT(0, 0) + TMAT(1, 0) * TMAT(1, 0) + TMAT(2, 0) * TMAT(2, 0)); - MMAT(rot, 0, 0) = TMAT(0, 0) * invLength; - MMAT(rot, 1, 0) = TMAT(1, 0) * invLength; - MMAT(rot, 2, 0) = TMAT(2, 0) * invLength; - - float fDot = MMAT(rot, 0, 0) * TMAT(0, 1) + MMAT(rot, 1, 0) * TMAT(1, 1) + MMAT(rot, 2, 0) * TMAT(2, 1); - MMAT(rot, 0, 1) = TMAT(0, 1) - fDot * MMAT(rot, 0, 0); - MMAT(rot, 1, 1) = TMAT(1, 1) - fDot * MMAT(rot, 1, 0); - MMAT(rot, 2, 1) = TMAT(2, 1) - fDot * MMAT(rot, 2, 0); - invLength = Math::InvSqrt(MMAT(rot, 0, 1) * MMAT(rot, 0, 1) + MMAT(rot, 1, 1) * MMAT(rot, 1, 1) + MMAT(rot, 2, 1) * MMAT(rot, 2, 1)); - MMAT(rot, 0, 1) *= invLength; - MMAT(rot, 1, 1) *= invLength; - MMAT(rot, 2, 1) *= invLength; - - fDot = MMAT(rot, 0, 0) * TMAT(0, 2) + MMAT(rot, 1, 0) * TMAT(1, 2) + MMAT(rot, 2, 0) * TMAT(2, 2); - MMAT(rot, 0, 2) = TMAT(0, 2) - fDot * MMAT(rot, 0, 0); - MMAT(rot, 1, 2) = TMAT(1, 2) - fDot * MMAT(rot, 1, 0); - MMAT(rot, 2, 2) = TMAT(2, 2) - fDot * MMAT(rot, 2, 0); - fDot = MMAT(rot, 0, 1) * TMAT(0, 2) + MMAT(rot, 1, 1) * TMAT(1, 2) + MMAT(rot, 2, 1) * TMAT(2, 2); - MMAT(rot, 0, 2) -= fDot * MMAT(rot, 0, 1); - MMAT(rot, 1, 2) -= fDot * MMAT(rot, 1, 1); - MMAT(rot, 2, 2) -= fDot * MMAT(rot, 2, 1); - invLength = Math::InvSqrt(MMAT(rot, 0, 2) * MMAT(rot, 0, 2) + MMAT(rot, 1, 2) * MMAT(rot, 1, 2) + MMAT(rot, 2, 2) * MMAT(rot, 2, 2)); - MMAT(rot, 0, 2) *= invLength; - MMAT(rot, 1, 2) *= invLength; - MMAT(rot, 2, 2) *= invLength; - - // guarantee that orthogonal matrix has determinant 1 (no reflections) - float fDet = MMAT(rot, 0, 0) * MMAT(rot, 1, 1) * MMAT(rot, 2, 2) + MMAT(rot, 0, 1) * MMAT(rot, 1, 2) * MMAT(rot, 2, 0) + - MMAT(rot, 0, 2) * MMAT(rot, 1, 0) * MMAT(rot, 2, 1) - MMAT(rot, 0, 2) * MMAT(rot, 1, 1) * MMAT(rot, 2, 0) - - MMAT(rot, 0, 1) * MMAT(rot, 1, 0) * MMAT(rot, 2, 2) - MMAT(rot, 0, 0) * MMAT(rot, 1, 2) * MMAT(rot, 2, 1); - - if (fDet < 0.0f) - { - for (uint32 r = 0; r < 3; ++r) - { - for (uint32 c = 0; c < 3; ++c) - { - MMAT(rot, r, c) = -MMAT(rot, r, c); - } - } - } - - translation = GetTranslation(); - } - - /* - // init from pos/rot/scale/shear - void Matrix::Set(const Vector3& translation, const AZ::Quaternion& rotation, const Vector3& scale, const Vector3& shear) - { - // convert quat to matrix - const float xx=rotation.x*rotation.x; - const float xy=rotation.x*rotation.y, yy=rotation.y*rotation.y; - const float xz=rotation.x*rotation.z, yz=rotation.y*rotation.z, zz=rotation.z*rotation.z; - const float xw=rotation.x*rotation.w, yw=rotation.y*rotation.w, zw=rotation.z*rotation.w, ww=rotation.w*rotation.w; - TMAT(0,0) = +xx-yy-zz+ww; TMAT(0,1) = +xy+zw+xy+zw; TMAT(0,2) = +xz-yw+xz-yw; TMAT(0,3) = 0.0f; - TMAT(1,0) = +xy-zw+xy-zw; TMAT(1,1) = -xx+yy-zz+ww; TMAT(1,2) = +yz+xw+yz+xw; TMAT(1,3) = 0.0f; - TMAT(2,0) = +xz+yw+xz+yw; TMAT(2,1) = +yz-xw+yz-xw; TMAT(2,2) = -xx-yy+zz+ww; TMAT(2,3) = 0.0f; - TMAT(3,0) = translation.x; TMAT(3,1) = translation.y; TMAT(3,2) = translation.z; TMAT(3,3) = 1.0f; - - // scale - TMAT(0,0) *= scale.x; - TMAT(0,1) *= scale.y; - TMAT(0,2) *= scale.z; - TMAT(1,0) *= scale.x; - TMAT(1,1) *= scale.y; - TMAT(1,2) *= scale.z; - TMAT(2,0) *= scale.x; - TMAT(2,1) *= scale.y; - TMAT(2,2) *= scale.z; - - // multiply with the shear matrix - float v[3]; - v[0] = TMAT(0,0); - v[1] = TMAT(0,1); - v[2] = TMAT(0,2); - TMAT(0,1) = v[0]*shear.x + v[1]; - TMAT(0,2) = v[0]*shear.y + v[1]*shear.z + v[2]; - - v[0] = TMAT(1,0); - v[1] = TMAT(1,1); - v[2] = TMAT(1,2); - TMAT(1,1) = v[0]*shear.x + v[1]; - TMAT(1,2) = v[0]*shear.y + v[1]*shear.z + v[2]; - - v[0] = TMAT(2,0); - v[1] = TMAT(2,1); - v[2] = TMAT(2,2); - TMAT(2,1) = v[0]*shear.x + v[1]; - TMAT(2,2) = v[0]*shear.y + v[1]*shear.z + v[2]; - - // translation - TMAT(3,0) = translation.x; - TMAT(3,1) = translation.y; - TMAT(3,2) = translation.z; - TMAT(3,3) = 1.0f; - } - */ - - //------------------------------------------------------- - /* - // decompose using QR decomposition (householder) - void Matrix::DecomposeQRHouseHolder(Vector3& outTranslation, AZ::Quaternion& outRotation, Vector3& outScale, Vector3& outShear) - { - // extract translation - outTranslation = GetTranslation(); - SetTranslation( Vector3(0.0f, 0.0f, 0.0f) ); - - // decompose into the two matrices first - Matrix Q; - Matrix R; - DecomposeQRHouseHolder(Q, R); - SetTranslation( outTranslation ); - - // extract scale - outScale.Set( MMAT(R,0,0), MMAT(R,1,1), MMAT(R,2,2) ); - - // extract shear - const float invScaleX = 1.0f / outScale.x; // TODO: handle 0 scale? - outShear.x = MMAT(R, 0, 1) * invScaleX; - outShear.y = MMAT(R, 0, 2) * invScaleX; - outShear.z = MMAT(R, 1, 2) / outScale.y; - - // convert the rotation into a AZ::Quaternion - outRotation.FromMatrix( Q ); - } - - - - // decompose using QR decomposition - void Matrix::DecomposeQRHouseHolder(Vector3& outTranslation, AZ::Quaternion& outRotation, Vector3& outScale) - { - // extract translation - outTranslation = GetTranslation(); - SetTranslation( Vector3(0.0f, 0.0f, 0.0f) ); - - // decompose into the two matrices first - Matrix Q; - Matrix R; - DecomposeQRHouseHolder(Q, R); - SetTranslation( outTranslation ); - - // extract scale - outScale.Set( MMAT(R,0,0), MMAT(R,1,1), MMAT(R,2,2) ); - - // convert the rotation into a AZ::Quaternion - outRotation.FromMatrix( Q ); - } - - - // decompose using QR decomposition - void Matrix::DecomposeQRHouseHolder(Vector3& outTranslation, AZ::Quaternion& outRotation) - { - // extract translation - outTranslation = GetTranslation(); - SetTranslation( Vector3(0.0f, 0.0f, 0.0f) ); - - // decompose into the two matrices first - Matrix Q; - Matrix R; - DecomposeQRHouseHolder(Q, R); - SetTranslation( outTranslation ); - - // convert the rotation into a AZ::Quaternion - outRotation.FromMatrix( Q ); - } - - - // decompose into Q (rotation) and R (scale/shear/translation) matrices - void Matrix::DecomposeQRHouseHolder(Matrix& Q, Matrix& R) - { - float mag; - float alpha; - Vector4 u; - Vector4 v; - Matrix P; - Matrix I; - - I.Identity(); - P.Identity(); - - Q.Identity(); - R = *this; - - for (uint32 i=0; i<4; i++) - { - u.Zero(); - v.Zero(); - - mag = 0.0f; - for (uint32 j=i; j<4; ++j) - { - u[j] = MMAT(R, j, i); - mag += u[j] * u[j]; - } - - mag = Math::SafeSqrt(mag); - alpha = u[i] < 0 ? mag : -mag; - - mag = 0.0f; - for (uint32 j=i; j<4; ++j) - { - v[j] = (j == i) ? u[j] + alpha : u[j]; - mag += v[j] * v[j]; - } - - mag = Math::SafeSqrt(mag); - if (mag < Math::epsilon) - continue; - - const float invMag = 1.0f / mag; - for (uint32 j=i; j<4; j++) - v[j] *= invMag; - - //P = I - (v * v.Transpose()) * 2.0; - P = I - OuterProduct(v, v) * 2.0f; - - //R = P * R; - //Q = Q * P; - R.MultMatrix(P, R); - Q.MultMatrix(P); - } - } - //------------------------------------------------------- - */ - - // basically does (vecA * vecB.Transposed()) and results in a 4x4 matrix - Matrix Matrix::OuterProduct(const AZ::Vector4& column, const AZ::Vector4& row) - { - Matrix result; - - for (uint32 r = 0; r < 4; ++r) - { - for (uint32 c = 0; c < 4; ++c) - { - MMAT(result, r, c) = column.GetElement(r) * row.GetElement(c); - } - } - - return result; - } -} // namespace MCore diff --git a/Gems/EMotionFX/Code/MCore/Source/Matrix4.h b/Gems/EMotionFX/Code/MCore/Source/Matrix4.h deleted file mode 100644 index 5d6da79bf5..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/Matrix4.h +++ /dev/null @@ -1,917 +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 - * - */ - -#pragma once - -// includes -#include -#include "StandardHeaders.h" -#include "Vector.h" -#include "PlaneEq.h" -#include "LogManager.h" -#include -#include -#include - -// matrix order -#define MCORE_MATRIX_ROWMAJOR - -// matrix element access -#ifdef MCORE_MATRIX_ROWMAJOR - #define MMAT(matrix, row, col) matrix.m44[row][col] - #define TMAT(row, col) m44[row][col] -#else - #define MMAT(matrix, row, col) matrix.m44[col][row] - #define TMAT(row, col) m44[col][row] -#endif - - -namespace AZ { class Quaternion; } - -namespace MCore -{ - /** - * Depracated. Please use AZ::Transform instead. - * A 4x4 matrix class. - * Matrices can for example be used to transform points or vectors. - * Transforming means moving to another coordinate system. With matrices you can do things like: translate (move), rotate and scale. - * One single matrix can store a translation, rotation and scale. If we have only a rotation inside the matrix, this means that if we - * multiply the matrix with a vector, the vector will rotate by the rotation inside the matrix! The cool thing is that you can also - * concatenate matrices. In other words, you can multiply matrices with eachother. If you have a rotation matrix, like described above, and - * also have a translation matrix, then multiplying these two matrices with eachother will result in a new matrix, which contains both the - * rotation and the translation! So when you multiply this resulting matrix with a vector, it will both translate and rotate. - * But, does it first rotate and then translate in the rotated space? Or does it first translate and then rotate? - * For example if you want to rotate a planet, while it's moving, you want to rotate it in it's local coordinate system. Like when you spin - * a globe you can have on your desk. So where it spins around it's own center. However, if the planet is at location (10,10,10) in 3D space for example - * it is also possible that rotates around the origin in world space (0,0,0). The order of multiplication between matrices matters. - * This means that (matrixA * matrixB) does not have to not result in the same as (matrixB * matrixA). - * - * Here is some information about how the matrices are stored internally: - * - * [00 01 02 03] // m16 offsets
- * [04 05 06 07]
- * [08 09 10 11]
- * [12 13 14 15]
- * - * [00 01 02 03] // m44 offsets --> [row][column]
- * [10 11 12 13]
- * [20 21 22 23]
- * [30 31 32 33]
- * - * [Xx Xy Xz 0] // right
- * [Yx Yy Yz 0] // up
- * [Zx Zy Zz 0] // forward
- * [Tx Ty Tz 1] // translation
- * - */ - class MCORE_API alignas(16) Matrix - { - public: - /** - * Default constructor. - * This leaves the matrix uninitialized. - */ - MCORE_INLINE Matrix() {} - - /** - * Init the matrix using given float data. - * The number of elements stored at the float pointer location that is used as parameter must be at least 16 floats in size. - * @param elementData A pointer to the matrix float data, which must be 16 floats in size, or more, although only the first 16 floats are used. - */ - MCORE_INLINE explicit Matrix(const float* elementData) { MCore::MemCopy(m_m16, elementData, sizeof(float) * 16); } - - /** - * Copy constructor. - * @param m The matrix to copy the data from. - */ - MCORE_INLINE Matrix(const Matrix& m); - - MCORE_INLINE Matrix(const AZ::Matrix4x4& m) - { - TMAT(0, 0) = m.GetElement(0, 0); - TMAT(0, 1) = m.GetElement(0, 1); - TMAT(0, 2) = m.GetElement(0, 2); - TMAT(0, 3) = m.GetElement(0, 3); - TMAT(1, 0) = m.GetElement(1, 0); - TMAT(1, 1) = m.GetElement(1, 1); - TMAT(1, 2) = m.GetElement(1, 2); - TMAT(1, 3) = m.GetElement(1, 3); - TMAT(2, 0) = m.GetElement(2, 0); - TMAT(2, 1) = m.GetElement(2, 1); - TMAT(2, 2) = m.GetElement(2, 2); - TMAT(2, 3) = m.GetElement(2, 3); - TMAT(3, 0) = m.GetElement(3, 0); - TMAT(3, 1) = m.GetElement(3, 1); - TMAT(3, 2) = m.GetElement(3, 2); - TMAT(3, 3) = m.GetElement(3, 3); - } - - void InitFromPosRot(const AZ::Vector3& pos, const AZ::Quaternion& rot); - void InitFromPosRotScale(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale); - void InitFromNoScaleInherit(const AZ::Vector3& translation, const AZ::Quaternion& rotation, const AZ::Vector3& scale, const AZ::Vector3& invParentScale); - void InitFromPosRotScaleScaleRot(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale, const AZ::Quaternion& scaleRot); - void InitFromPosRotScaleShear(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale, const AZ::Vector3& shear); - - /** - * Sets the matrix to identity. - * When a matrix is an identity matrix it will have no influence. - */ - void Identity(); - - /** - * Makes the matrix a scaling matrix. - * Values of 1.0 would have no influence on the scale. Values of for example 2.0 would scale up by a factor of two. - * @param s The vector containing the scale values for each axis. - */ - void SetScaleMatrix(const AZ::Vector3& s); - - /** - * Makes this matrix a shear matrix from three different shear matrices: XY, XZ and YZ. - * The multiplication order is YZ * XZ * XY. - * @param s The shear values (x=XY, y=XZ, z=YZ) - */ - void SetShearMatrix(const AZ::Vector3& s); - - /** - * Makes this matrix a translation matrix. - * @param t The translation value. - */ - void SetTranslationMatrix(const AZ::Vector3& t); - - /** - * Initialize this matrix into a rotation matrix from a AZ::Quaternion. - * @param rotation The AZ::Quaternion representing the rotatation. - */ - void SetRotationMatrix(const AZ::Quaternion& rotation); - - /** - * Makes the matrix an rotation matrix along the x-axis. - * @param angle The angle to rotate around this axis, in radians. - */ - void SetRotationMatrixX(float angle); - - /** - * Makes the matrix a rotation matrix along the y-axis. - * @param angle The angle to rotate around this axis, in radians. - */ - void SetRotationMatrixY(float angle); - - /** - * Makes the matrix a rotation matrix along the z-axis. - * @param angle The angle to rotate around this axis, in radians. - */ - void SetRotationMatrixZ(float angle); - - /** - * Makes the matrix a rotation matrix around a given axis with a given angle. - * @param axis The axis to rotate around. - * @param angle The angle to rotate around this axis, in radians. - */ - void SetRotationMatrixAxisAngle(const AZ::Vector3& axis, float angle); - - /** - * Makes the matrix a rotation matrix given the euler angles. - * The multiplication order is RotMatrix(v.z) * RotMatrix(v.y) * RotMatrix(v.x). - * @param anglevec The vector containing the angles for each axis, in radians, so (pitch, yaw, roll) as (x,y,z). - */ - void SetRotationMatrixEulerZYX(const AZ::Vector3& anglevec); - - /** - * Initialize the matrix from a yaw, pitch and roll. - * Pitch is the rotation around the x-axis. - * Yaw is the rotation aroudn the y-axis. - * Roll is the rotation around the z-axis. - * All angles are in radians. - * @param pitch The pitch angle (rotation around x-axis), in radians. - * @param yaw The yaw angle (rotation around y-axis), in radians. - * @param roll The roll angle (rotation around z-axis), in radians. - */ - void SetRotationMatrixPitchYawRoll(float pitch, float yaw, float roll); - - /** - * Initialize the matrix from a yaw, pitch and roll. - * Pitch is the rotation around the x-axis. - * Yaw is the rotation aroudn the y-axis. - * Roll is the rotation around the z-axis. - * All angles are in radians. - * @param angles The angle for each axis, in radians. - */ - MCORE_INLINE void SetRotationMatrixPitchYawRoll(const AZ::Vector3& angles) { SetRotationMatrixPitchYawRoll(angles.GetX(), angles.GetY(), angles.GetZ()); } - - /** - * Makes the matrix a rotation matrix given the euler angles. - * The multiplication order is RotMatrix(v.x) * RotMatrix(v.y) * RotMatrix(v.z). - * @param anglevec The vector containing the angles for each axis, in radians, so (pitch, yaw, roll) as (x,y,z). - */ - void SetRotationMatrixEulerXYZ(const AZ::Vector3& anglevec); - - /** - * Inverse rotate a vector with this matrix. - * This means that the vector will be multiplied with the inverse rotation of this matrix. - * @param v The vector to rotate. - * @result The rotated vector. - */ - AZ::Vector3 InverseRot(const AZ::Vector3& v); - - /** - * Multiply this matrix with another matrix and stores the result in itself. - * @param right The matrix to multiply with. - */ - void MultMatrix(const Matrix& right); - - /** - * Multiply this matrix with another matrix, but only multiply the 4x3 part. - * So treat the other matrix as 4x3 matrix instead of 4x4 matrix. Stores the result in itself. - * @param right The matrix to multiply with. - */ - void MultMatrix4x3(const Matrix& right); - - /** - * Multiply two matrices together, but only the 4x3 part, and store the result in itself. - * @param left The left matrix. - * @param right The right matrix. - */ - void MultMatrix4x3(const Matrix& left, const Matrix& right); - - /** - * Multiply the left matrix with the right matrix and store the result in this matrix object. - * So basically this is a fast version of:
- *
-         * Matrix result = left * right;    // where left and right are also Matrix objects
-         * 
- * - * @param left The left matrix of the matrix multiply. - * @param right The right matrix of the matrix multiply. - */ - void MultMatrix(const Matrix& left, const Matrix& right); - - /** - * Multiply this matrix with the 3x3 rotation part of the other given matrix, and modify itself. - * @param right The matrix to multiply with. - */ - void MultMatrix3x3(const Matrix& right); - - MCORE_INLINE void Skin(const AZ::Vector3* inPos, const AZ::Vector3* inNormal, AZ::Vector3* outPos, AZ::Vector3* outNormal, float weight); - MCORE_INLINE void Skin(const AZ::Vector3* inPos, const AZ::Vector3* inNormal, const AZ::Vector4* inTangent, AZ::Vector3* outPos, AZ::Vector3* outNormal, AZ::Vector4* outTangent, float weight); - MCORE_INLINE void Skin(const AZ::Vector3* inPos, const AZ::Vector3* inNormal, const AZ::Vector4* inTangent, const AZ::Vector3* inBitangent, AZ::Vector3* outPos, AZ::Vector3* outNormal, AZ::Vector4* outTangent, AZ::Vector3* outBitangent, float weight); - - /** - * Perform skinning on an input vertex, and add the result to the output, weighted by a weight value. - * The calculation performed is: - * - *
-         * out += (in * thisMatrix) * weight;
-         * 
- * - * Only the 4x3 part of the matrix is used during the matrix multiply. - * So this should be used when skinning for example positions. - * @param in The input vector to skin. - * @param out The output vector. Keep in mind that the result will be added to the output vector. - * @param weight The weight value. - */ - MCORE_INLINE void Skin4x3(const AZ::Vector3& in, AZ::Vector3& out, float weight); - - /** - * Perform skinning on an input vertex, and add the result to the output, weighted by a weight value. - * The calculation performed is: - * - *
-         * out += (in * thisMatrix) * weight;
-         * 
- * - * Only the 3x3 part of the matrix is used during the matrix multiply. - * So this should be used to skin normals and tangents. - * @param in The input vector to skin. - * @param out The output vector. Keep in mind that the result will be added to the output vector. - * @param weight The weight value. - */ - MCORE_INLINE void Skin3x3(const AZ::Vector3& in, AZ::Vector3& out, float weight); - - /** - * Transpose the matrix (swap rows with columns). - */ - void Transpose(); - - /** - * Transpose the translation 1x3 translation part. - * Leaves the rotation in tact. - */ - void TransposeTranslation(); - - /** - * Adjoint this matrix. - */ - void Adjoint(); - - /** - * Inverse this matrix. - */ - void Inverse(); - - /** - * Makes this the inverse tranpose version of this matrix. - * The inverse transpose is the transposed version of the inverse. - */ - MCORE_INLINE void InverseTranspose(); - - /** - * Returns the inverse transposed version of this matrix. - * The inverse transpose is the transposed version of the inverse. - * @result The inverse transposed version of this matrix. - */ - MCORE_INLINE Matrix InverseTransposed() const; - - /** - * Orthonormalize this matrix (to prevent skewing or other errors). - * This normalizes the x, y and z vectors of the matrix. - * It makes sure that the axis vectors are perpendicular to eachother. - */ - void OrthoNormalize(); - - /** - * Normalizes the matrix, which means that all axis vectors (right, up, forward) - * will be made of unit length. - */ - void Normalize(); - - /** - * Returns a normalized version of this matrix. - * @result The normalized version of this matrix, where the right, up and forward vectors are of unit length. - */ - MCORE_INLINE Matrix Normalized() const; - - /** - * Scale this matrix. - * @param scale The scale factors for each axis. - */ - MCORE_INLINE void Scale(const AZ::Vector3& scale); - - /** - * Scale only the upper left 3x3 part of this matrix. - * So this doesn't scale the translation part. - * @param scale The scale factors for each axis. - */ - void Scale3x3(const AZ::Vector3& scale); - - AZ::Vector3 ExtractScale(); - - /** - * Rotate this matrix around the x-axis. - * @param angle The rotation in radians. - */ - void RotateX(float angle); - - /** - * Rotate this matrix around the y-axis. - * @param angle The rotation in radians. - */ - void RotateY(float angle); - - /** - * Rotate this matrix around the z-axis. - * @param angle The rotation in radians. - */ - void RotateZ(float angle); - - /** - * Initialize the matrix as a rotation matrix given two vectors. The resulting matrix rotates the vector 'from' such that it points - * in the same direction as the vector 'to'. - * @param from The vector that the resulting matrix rotates from. - * @param to The vector that the resulting matrix rotates to. - */ - void SetRotationMatrixTwoVectors(const AZ::Vector3& from, const AZ::Vector3& to); - - /** - * Multiply a vector with the 3x3 rotation part of this matrix. - * @param v The vector to transform. - * @result The transformed (rotated) vector. - */ - MCORE_INLINE AZ::Vector3 Mul3x3(const AZ::Vector3& v) const; - - /** - * Returns the inversed version of this matrix. - * @result The inversed version of this matrix. - */ - MCORE_INLINE Matrix Inversed() const { Matrix m(*this); m.Inverse(); return m; } - - /** - * Returns the transposed version of this matrix. - * @result The transposed version of this matrix. - */ - MCORE_INLINE Matrix Transposed() const { Matrix m(*this); m.Transpose(); return m; } - - /** - * Returns the adjointed version of this matrix. - * @result The adjointed version of this matrix. - */ - MCORE_INLINE Matrix Adjointed() const { Matrix m(*this); m.Adjoint(); return m; } - - /** - * Translate the matrix. - * @param x The number of units to add to the current translation along the x-axis. - * @param y The number of units to add to the current translation along the y-axis. - * @param z The number of units to add to the current translation along the z-axis. - */ - MCORE_INLINE void Translate(float x, float y, float z) { TMAT(3, 0) += x; TMAT(3, 1) += y; TMAT(3, 2) += z; } - - /** - * Translate the matrix. - * @param t The vector containing the translation to add to the current translation of the matrix. - */ - MCORE_INLINE void Translate(const AZ::Vector3& t) { TMAT(3, 0) += t.GetX(); TMAT(3, 1) += t.GetY(); TMAT(3, 2) += t.GetZ(); } - - /** - * Set the values for a given row, using a 3D vector. - * Only the first 3 values on the row will be touched, so the 4th value will remain untouched inside the specified row of the matrix. - * @param row A zero-based index of the row. - * @param value The values to set in the row. - */ - MCORE_INLINE void SetRow(uint32 row, const AZ::Vector3& value) { TMAT(row, 0) = value.GetX(); TMAT(row, 1) = value.GetY(); TMAT(row, 2) = value.GetZ(); } - - /** - * Set the values in the given row, using a 4D vector. - * @param row A zero-based index of the row. - * @param value The values to set in the row. - */ - MCORE_INLINE void SetRow(uint32 row, const AZ::Vector4& value) { TMAT(row, 0) = value.GetX(); TMAT(row, 1) = value.GetY(); TMAT(row, 2) = value.GetZ(); TMAT(row, 3) = value.GetW(); } - - /** - * Set the values for a given column, using a 3D vector. - * Only the first 3 values on the column will be touched, so the 4th value will remain untouched inside the specified column of the matrix. - * @param column A zero-based index of the column. - * @param value The values to set in the column. - */ - MCORE_INLINE void SetColumn(uint32 column, const AZ::Vector3& value) { TMAT(0, column) = value.GetX(); TMAT(1, column) = value.GetY(); TMAT(2, column) = value.GetZ(); } - - /** - * Set the values for a given column, using a 4D vector. - * @param column A zero-based index of the column. - * @param value The values to set in the column. - */ - MCORE_INLINE void SetColumn(uint32 column, const AZ::Vector4& value) { TMAT(0, column) = value.GetX(); TMAT(1, column) = value.GetY(); TMAT(2, column) = value.GetZ(); TMAT(3, column) = value.GetW(); } - - /** - * Get the values of a given row as 3D vector. - * @param row A zero-based index of the row number ot get. - * @result The vector containing the values of the specified row. - */ - MCORE_INLINE AZ::Vector3 GetRow(uint32 row) const { return AZ::Vector3(TMAT(row, 0), TMAT(row, 1), TMAT(row, 2)); } - - /** - * Get the values of a given row as 4D vector. - * @param column A zero-based index of the row number ot get. - * @result The vector containing the values of the specified row. - */ - MCORE_INLINE AZ::Vector3 GetColumn(uint32 column) const { return AZ::Vector3(TMAT(0, column), TMAT(1, column), TMAT(2, column)); } - - /** - * Get the values of a given column as 3D vector. - * @param row A zero-based index of the column number ot get. - * @result The vector containing the values of the specified column. - */ - MCORE_INLINE AZ::Vector4 GetRow4D(uint32 row) const { return AZ::Vector4(TMAT(row, 0), TMAT(row, 1), TMAT(row, 2), TMAT(row, 3)); } - - /** - * Get the values of a given column as 4D vector. - * @param column A zero-based index of the column number ot get. - * @result The vector containing the values of the specified column. - */ - MCORE_INLINE AZ::Vector4 GetColumn4D(uint32 column) const { return AZ::Vector4(TMAT(0, column), TMAT(1, column), TMAT(2, column), TMAT(3, column)); } - - /** - * Set the right vector (must be normalized). - * @param xx The x component of the right vector. - * @param xy The y component of the right vector. - * @param xz The z component of the right vector. - */ - MCORE_INLINE void SetRight(float xx, float xy, float xz); - - /** - * Set the right vector. - * @param x The right vector, must be normalized. - */ - MCORE_INLINE void SetRight(const AZ::Vector3& x); - - /** - * Set the up vector (must be normalized). - * @param yx The x component of the up vector. - * @param yy The y component of the up vector. - * @param yz The z component of the up vector. - */ - MCORE_INLINE void SetUp(float yx, float yy, float yz); - - /** - * Set the up vector (must be normalized). - * @param y The up vector. - */ - MCORE_INLINE void SetUp(const AZ::Vector3& y); - - /** - * Set the forward vector (must be normalized). - * @param zx The x component of the forward vector. - * @param zy The y component of the forward vector. - * @param zz The z component of the forward vector. - */ - MCORE_INLINE void SetForward(float zx, float zy, float zz); - - /** - * Set the forward vector (must be normalized). - * @param z The forward vector. - */ - MCORE_INLINE void SetForward(const AZ::Vector3& z); - - /** - * Set the translation part of the matrix. - * @param tx The translation along the x-axis. - * @param ty The translation along the y-axis. - * @param tz The translation along the z-axis. - */ - MCORE_INLINE void SetTranslation(float tx, float ty, float tz); - - /** - * Set the translation part of the matrix. - * @param t The translation vector. - */ - MCORE_INLINE void SetTranslation(const AZ::Vector3& t); - - /** - * Get the right vector. - * @result The right vector (x-axis). - */ - MCORE_INLINE AZ::Vector3 GetRight() const; - - /** - * Get the up vector. - * @result The up vector (z-axis). - */ - MCORE_INLINE AZ::Vector3 GetUp() const; - - /** - * Get the forward vector. - * @result The forward vector (y-axis). - */ - MCORE_INLINE AZ::Vector3 GetForward() const; - - /** - * Get the translation part of the matrix. - * @result The vector containing the translation. - */ - MCORE_INLINE AZ::Vector3 GetTranslation() const; - - /** - * Calculates the determinant of the matrix. - * @result The determinant. - */ - float CalcDeterminant() const; - - /** - * Calculates the euler angles. - * @result The euler angles, describing the rotation along each axis, in radians. - */ - AZ::Vector3 CalcEulerAngles() const; - - /** - * Calculate the pitch, yaw and roll. - * Pitch is the rotation around the x axis. - * Yaw is the rotation around the y axis. - * Roll is the rotation around the z axis. - * All angles returned are in radians. - * @result The vector containing the rotation around each axis (x=pitch, y=yaw, z=roll). - */ - AZ::Vector3 CalcPitchYawRoll() const; - - /** - * Makes this matrix a mirrored version of a specified matrix. - * After executing this operation this matrix is the mirrored version of the specified matrix. - * @param transform The transformation matrix to mirror (so the original matrix). - * @param plane The plane to use as mirror. - */ - void Mirror(const Matrix& transform, const PlaneEq& plane); - - /** - * Makes this matrix a lookat matrix (also known as camera or view matrix). - * @param view The view position, so the position of the camera. - * @param target The target position, so where the camera is looking at. - * @param up The up vector, describing the roll of the camera, where (0,1,0) would mean the camera is straight up and has no roll and - * where (0,-1,0) would mean the camera is upside down, etc. - */ - void LookAt(const AZ::Vector3& view, const AZ::Vector3& target, const AZ::Vector3& up); - - /** - * Makes this matrix a lookat matrix (also known as camera or view matrix), in right handed mode. - * @param view The view position, so the position of the camera. - * @param target The target position, so where the camera is looking at. - * @param up The up vector, describing the roll of the camera, where (0,1,0) would mean the camera is straight up and has no roll and - * where (0,-1,0) would mean the camera is upside down, etc. - */ - void LookAtRH(const AZ::Vector3& view, const AZ::Vector3& target, const AZ::Vector3& up); - - /** - * Makes this matrix a perspective projection matrix. - * @param fov The field of view, in radians. - * @param aspect The aspect ratio which is the width divided by height. - * @param zNear The distance to the near plane. - * @param zFar The distance to the far plane. - */ - void Perspective(float fov, float aspect, float zNear, float zFar); - - /** - * Makes this matrix a perspective projection matrix, in right handed mode. - * @param fov The field of view, in radians. - * @param aspect The aspect ratio which is the width divided by height. - * @param zNear The distance to the near plane. - * @param zFar The distance to the far plane. - */ - void PerspectiveRH(float fov, float aspect, float zNear, float zFar); - - /** - * Makes this matrix an ortho projection matrix, so without perspective. - * @param left The left of the image plane. - * @param right The right of the image plane. - * @param top The top of the image plane. - * @param bottom The bottom of the image plane. - * @param znear The distance to the near plane. - * @param zfar The distance to the far plane. - */ - void Ortho(float left, float right, float top, float bottom, float znear, float zfar); - - /** - * Makes this matrix an ortho projection matrix, so without perspective. - * @param left The left of the image plane. - * @param right The right of the image plane. - * @param top The top of the image plane. - * @param bottom The bottom of the image plane. - * @param znear The distance to the near plane. - * @param zfar The distance to the far plane. - */ - void OrthoRH(float left, float right, float top, float bottom, float znear, float zfar); - - /** - * Makes this matrix an ortho projection matrix, so without perspective. - * @param left The left of the image plane. - * @param right The right of the image plane. - * @param top The top of the image plane. - * @param bottom The bottom of the image plane. - * @param znear The distance to the near plane. - * @param zfar The distance to the far plane. - */ - void OrthoOffCenter(float left, float right, float top, float bottom, float znear, float zfar); - - /** - * Makes this matrix an ortho projection matrix, so without perspective. - * @param left The left of the image plane. - * @param right The right of the image plane. - * @param top The top of the image plane. - * @param bottom The bottom of the image plane. - * @param znear The distance to the near plane. - * @param zfar The distance to the far plane. - */ - void OrthoOffCenterRH(float left, float right, float top, float bottom, float znear, float zfar); - - /** - * Makes this matrix a frustum matrix. - * @param left The left of the image plane. - * @param right The right of the image plane. - * @param top The top of the image plane. - * @param bottom The bottom of the image plane. - * @param znear The distance to the near plane. - * @param zfar The distance to the far plane. - */ - void Frustum(float left, float right, float top, float bottom, float znear, float zfar); - - - // QR Gram-Schmidt decomposition - void DecomposeQRGramSchmidt(AZ::Vector3& translation, Matrix& rot) const; - void DecomposeQRGramSchmidt(AZ::Vector3& translation, Matrix& rot, AZ::Vector3& scale) const; - void DecomposeQRGramSchmidt(AZ::Vector3& translation, Matrix& rot, AZ::Vector3& scale, AZ::Vector3& shear) const; - - static Matrix OuterProduct(const AZ::Vector4& column, const AZ::Vector4& row); - - /** - * Get the handedness of the matrix, which described if the matrix is left- or right-handed. - * The value returned by this method is the dot product between the forward vector and the result of the - * cross product between the right and up vector. So: DotProduct( Cross(right, up), forward ); - * If the value returned by this method is positive we are dealing with a matrix which is in a right-handed - * coordinate system, otherwise we are dealing with a left-handed coordinate system. - * Performing an odd number of reflections reverses the handedness. An even number of reflections is always - * equivalent to a rotation, so any series of reflections can always be regarded as a single rotation followed - * by at most one reflection. - * If a reflection is present (think of a mirror) the handedness will be reversed. A reflection can be detected - * by looking at the determinant of the matrix. If the determinant is negative, then a reflection is present. - * @result The handedness of the matrix. If this value is positive we are dealing with a matrix in a right handed - * coordinate system. Otherwise we are dealing with one in a left-handed coordinate system. - * @see IsRightHanded() - * @see IsLeftHanded() - */ - float CalcHandedness() const; - - /** - * Check if this matrix is symmetric or not. - * A materix is said to be symmetric if and only if M(i, j) = M(j, i). - * That is, a matrix whose entries are symmetric about the main diagonal. - * @param tolerance The maximum difference tolerance between the M(i, j) and M(j, i) entries. - * The reason for having this tolerance is of course floating point inaccuracy which might have - * caused some entries to be a bit different. - * @result Returns true when the matrix is symmetric, or false when not. - */ - bool CheckIfIsSymmetric(float tolerance = 0.00001f) const; - - /** - * Check if this matrix is a diagonal matrix or not. - * A matrix is said to be a diagonal matrix when only the entries on the diagonal contain non-zero values. - * The tolerance value is needed because of possible floating point inaccuracies. - * @param tolerance The maximum difference between 0 and the entry on the diagonal. - * @result Returns true when the matrix is a diagonal matrix, otherwise false is returned. - */ - bool CheckIfIsDiagonal(float tolerance = 0.00001f) const; - - /** - * Check if the matrix is orthogonal or not. - * A matrix is orthogonal if the vectors in the matrix form an orthonormal set. - * This is when the vectors (right, up and forward) are perpendicular to eachother. - * If a matrix is orthogonal, the inverse of the matrix is equal to the transpose of the matrix. - * This assumption can be used to optimize specific calculations, since the inverse is slower to calculate than - * the transpose of the matrix. Also it can speed up by transforming normals with the matrix. - * In that example instead of having to use the inverse transpose matrix, you could just use the transpose of the matrix. - * @param tolerance The maximum tolerance in the orthonormal test. - * @result Returns true when the matrix is orthogonal, otherwise false is returned. - */ - bool CheckIfIsOrthogonal(float tolerance = 0.00001f) const; - - /** - * Check if the matrix is an identity matrix or not. - * @param tolerance The maximum error value per entry in the matrix. - * @result Returns true if this matrix is an identity matrix, otherwise false is returned. - */ - bool CheckIfIsIdentity(float tolerance = 0.00001f) const; - - /** - * Check if the matrix is left handed or not. - * @result Returns true when the matrix is left handed, otherwise false is returned (so then it is right handed). - */ - bool CheckIfIsLeftHanded() const; - - /** - * Check if the matrix is right handed or not. - * @result Returns true when the matrix is right handed, otherwise false is returned (so then it is left handed). - */ - bool CheckIfIsRightHanded() const; - - /** - * Check if this matrix is a pure rotation matrix or not. - * @param tolerance The maximum error in the measurement. - * @result Returns true when the matrix represents only a rotation, otherwise false is returned. - */ - bool CheckIfIsPureRotationMatrix(float tolerance = 0.00001f) const; - - /** - * Check if this matrix contains a reflection or not. - * @result Returns true when the matrix represents a reflection, otherwise false is returned. - */ - bool CheckIfIsReflective() const; - - AZ::Matrix4x4 ToAzMatrix() const - { -#ifdef MCORE_MATRIX_ROWMAJOR - return AZ::Matrix4x4::CreateFromRowMajorFloat16(m_m16); -#else - return AZ::Matrix4x4::CreateFromColumnMajorFloat16(m16); -#endif - } - - /** - * Prints the matrix into the logfile or debug output, using MCore::LogDetailedInfo(). - * Please note that the values are printed using floats or doubles. So it is not possible - * to use this method for printing matrices of vectors or something other than real numbers. - */ - void Log() const; - - /** - * Returns a translation matrix. - * @param v The translation of the matrix. - * @result The translation matrix having the specified translation. - */ - static MCORE_INLINE Matrix TranslationMatrix(const AZ::Vector3& v) { Matrix m; m.SetTranslationMatrix(v); return m; } - - /** - * Returns a rotation matrix from a AZ::Quaternion. - * @param rot The AZ::Quaternion that represents the rotation. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrix(const AZ::Quaternion& rot) { Matrix m; m.SetRotationMatrix(rot); return m; } - - /** - * Returns a rotation matrix, including a translation, where the rotation is represented by a AZ::Quaternion. - * @param rot The AZ::Quaternion that represents the rotation. - * @param trans The translation of the matrix. - * @result The rotation matrix, that includes a translation as well. - */ - static MCORE_INLINE Matrix RotationTranslationMatrix(const AZ::Quaternion& rot, const AZ::Vector3& trans) { Matrix m; m.InitFromPosRot(trans, rot); return m; } - - /** - * Returns a rotation matrix along the x-axis. - * @param rad The angle of rotation, in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixX(float rad) { Matrix m; m.SetRotationMatrixX(rad); return m; } - - /** - * Returns a rotation matrix along the y-axis. - * @param rad The angle of rotation, in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixY(float rad) { Matrix m; m.SetRotationMatrixY(rad); return m; } - - /** - * Returns a rotation matrix along the z-axis. - * @param rad The angle of rotation, in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixZ(float rad) { Matrix m; m.SetRotationMatrixZ(rad); return m; } - - /** - * Returns a rotation matrix along the x, y and z-axis. - * The multiplication order is RotMatrix(v.x) * RotMatrix(v.y) * RotMatrix(v.z). - * @param eulerAngles The euler angles in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixEulerXYZ(const AZ::Vector3& eulerAngles) { Matrix m; m.SetRotationMatrixEulerXYZ(eulerAngles); return m; } - - /** - * Returns a rotation matrix along the x, y and z-axis. - * The multiplication order is RotMatrix(v.z) * RotMatrix(v.y) * RotMatrix(v.x). - * @param eulerAngles The euler angles in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixEulerZYX(const AZ::Vector3& eulerAngles) { Matrix m; m.SetRotationMatrixEulerZYX(eulerAngles); return m; } - - /** - * Returns a rotation matrix given a pitch, yaw and roll. - * Pitch is the rotation around the x-axis. - * Yaw is the rotation aroudn the y-axis. - * Roll is the rotation around the z-axis. - * @param angles The rotation angles for each axis, in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixPitchYawRoll(const AZ::Vector3& angles) { Matrix m; m.SetRotationMatrixPitchYawRoll(angles); return m; } - - /** - * Constructs a rotation matrix given two vectors. The resulting matrix rotates the vector 'from' such that it points - * in the same direction as the vector 'to'. - * @param from The vector that the resulting matrix rotates to. - * @param to The vector that the resulting matrix rotates from. - * @result The rotation matrix that rotates the vector 'from' into the vector 'to'. - */ - static MCORE_INLINE Matrix RotationMatrixTwoVectors(const AZ::Vector3& from, const AZ::Vector3& to) { Matrix m; m.SetRotationMatrixTwoVectors(from, to); return m; } - - /** - * Returns a rotation matrix from a given axis and angle. - * @param axis The axis to rotate around. - * @param angle The angle of rotation, in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixAxisAngle(const AZ::Vector3& axis, float angle) { Matrix m; m.SetRotationMatrixAxisAngle(axis, angle); return m; } - - /** - * Returns a scale matrix from a given scaling factor. - * @param s The vector containing the scaling factors for each axis. - * @result A scaling matrix. - */ - static MCORE_INLINE Matrix ScaleMatrix(const AZ::Vector3& s) { Matrix m; m.SetScaleMatrix(s); return m; } - - /** - * Returns a shear matrix created from three different shear matrices: XY, XZ and YZ. - * The multiplication order is YZ * XZ * XY. - * @param s The shear values (x=XY, y=XZ, z=YZ) - * @result The shear matrix. - */ - static MCORE_INLINE Matrix ShearMatrix(const AZ::Vector3& s) { Matrix m; m.SetShearMatrix(s); return m; } - - // operators - Matrix operator + (const Matrix& right) const; - Matrix operator - (const Matrix& right) const; - Matrix operator * (const Matrix& right) const; - Matrix operator * (float value) const; - Matrix& operator += (const Matrix& right); - Matrix& operator -= (const Matrix& right); - Matrix& operator *= (const Matrix& right); - Matrix& operator *= (float value); - MCORE_INLINE void operator = (const Matrix& right); - - // attributes - union - { - float m_m16[16]; // 16 floats as 1D array - float m44[4][4]; // as 2D array - }; - }; - - - // include inline code -#include "Matrix4.inl" -} // namespace MCore diff --git a/Gems/EMotionFX/Code/MCore/Source/Matrix4.inl b/Gems/EMotionFX/Code/MCore/Source/Matrix4.inl deleted file mode 100644 index 99900abcee..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/Matrix4.inl +++ /dev/null @@ -1,330 +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 - * - */ - -MCORE_INLINE Matrix::Matrix(const Matrix& m) -{ - MCore::MemCopy(m_m16, m.m_m16, sizeof(Matrix)); -} - - -MCORE_INLINE void Matrix::operator = (const Matrix& right) -{ - MCore::MemCopy(m_m16, right.m_m16, sizeof(Matrix)); -} - - - -MCORE_INLINE void Matrix::SetRight(float xx, float xy, float xz) -{ - TMAT(0, 0) = xx; - TMAT(0, 1) = xy; - TMAT(0, 2) = xz; -} - - - -MCORE_INLINE void Matrix::SetUp(float yx, float yy, float yz) -{ - TMAT(1, 0) = yx; - TMAT(1, 1) = yy; - TMAT(1, 2) = yz; -} - - - -MCORE_INLINE void Matrix::SetForward(float zx, float zy, float zz) -{ - TMAT(2, 0) = zx; - TMAT(2, 1) = zy; - TMAT(2, 2) = zz; -} - - - -MCORE_INLINE void Matrix::SetTranslation(float tx, float ty, float tz) -{ - TMAT(3, 0) = tx; - TMAT(3, 1) = ty; - TMAT(3, 2) = tz; -} - - - -MCORE_INLINE void Matrix::SetRight(const AZ::Vector3& x) -{ - TMAT(0, 0) = x.GetX(); - TMAT(0, 1) = x.GetY(); - TMAT(0, 2) = x.GetZ(); -} - - - -MCORE_INLINE void Matrix::SetUp(const AZ::Vector3& y) -{ - TMAT(1, 0) = y.GetX(); - TMAT(1, 1) = y.GetY(); - TMAT(1, 2) = y.GetZ(); -} - - - -MCORE_INLINE void Matrix::SetForward(const AZ::Vector3& z) -{ - TMAT(2, 0) = z.GetX(); - TMAT(2, 1) = z.GetY(); - TMAT(2, 2) = z.GetZ(); -} - - - -MCORE_INLINE void Matrix::SetTranslation(const AZ::Vector3& t) -{ - TMAT(3, 0) = t.GetX(); - TMAT(3, 1) = t.GetY(); - TMAT(3, 2) = t.GetZ(); -} - - - -MCORE_INLINE AZ::Vector3 Matrix::GetRight() const -{ - //return *reinterpret_cast( m16/* + 0*/); - return AZ::Vector3(TMAT(0, 0), TMAT(0, 1), TMAT(0, 2)); -} - - - -MCORE_INLINE AZ::Vector3 Matrix::GetForward() const -{ - // return *reinterpret_cast(m16+4); - return AZ::Vector3(TMAT(1, 0), TMAT(1, 1), TMAT(1, 2)); -} - - - -MCORE_INLINE AZ::Vector3 Matrix::GetUp() const -{ - // return *reinterpret_cast(m16+8); - return AZ::Vector3(TMAT(2, 0), TMAT(2, 1), TMAT(2, 2)); -} - - - -MCORE_INLINE AZ::Vector3 Matrix::GetTranslation() const -{ - //return *reinterpret_cast(m16+12); - return AZ::Vector3(TMAT(3, 0), TMAT(3, 1), TMAT(3, 2)); -} - - - -MCORE_INLINE AZ::Vector3 Matrix::Mul3x3(const AZ::Vector3& v) const -{ - return AZ::Vector3( - v.GetX() * TMAT(0, 0) + v.GetY() * TMAT(1, 0) + v.GetZ() * TMAT(2, 0), - v.GetX() * TMAT(0, 1) + v.GetY() * TMAT(1, 1) + v.GetZ() * TMAT(2, 1), - v.GetX() * TMAT(0, 2) + v.GetY() * TMAT(1, 2) + v.GetZ() * TMAT(2, 2)); -} - - - -MCORE_INLINE void operator *= (AZ::Vector3& v, const Matrix& m) -{ - v = AZ::Vector3( - v.GetX() * MMAT(m, 0, 0) + v.GetY() * MMAT(m, 1, 0) + v.GetZ() * MMAT(m, 2, 0) + MMAT(m, 3, 0), - v.GetX() * MMAT(m, 0, 1) + v.GetY() * MMAT(m, 1, 1) + v.GetZ() * MMAT(m, 2, 1) + MMAT(m, 3, 1), - v.GetX() * MMAT(m, 0, 2) + v.GetY() * MMAT(m, 1, 2) + v.GetZ() * MMAT(m, 2, 2) + MMAT(m, 3, 2)); -} - - - -MCORE_INLINE void operator *= (AZ::Vector4& v, const Matrix& m) -{ - v = AZ::Vector4( - v.GetX() * MMAT(m, 0, 0) + v.GetY() * MMAT(m, 1, 0) + v.GetZ() * MMAT(m, 2, 0) + v.GetW() * MMAT(m, 3, 0), - v.GetX() * MMAT(m, 0, 1) + v.GetY() * MMAT(m, 1, 1) + v.GetZ() * MMAT(m, 2, 1) + v.GetW() * MMAT(m, 3, 1), - v.GetX() * MMAT(m, 0, 2) + v.GetY() * MMAT(m, 1, 2) + v.GetZ() * MMAT(m, 2, 2) + v.GetW() * MMAT(m, 3, 2), - v.GetX() * MMAT(m, 0, 3) + v.GetY() * MMAT(m, 1, 3) + v.GetZ() * MMAT(m, 2, 3) + v.GetW() * MMAT(m, 3, 3)); -} - - - -MCORE_INLINE AZ::Vector3 operator * (const AZ::Vector3& v, const Matrix& m) -{ - return AZ::Vector3( - v.GetX() * MMAT(m, 0, 0) + v.GetY() * MMAT(m, 1, 0) + v.GetZ() * MMAT(m, 2, 0) + MMAT(m, 3, 0), - v.GetX() * MMAT(m, 0, 1) + v.GetY() * MMAT(m, 1, 1) + v.GetZ() * MMAT(m, 2, 1) + MMAT(m, 3, 1), - v.GetX() * MMAT(m, 0, 2) + v.GetY() * MMAT(m, 1, 2) + v.GetZ() * MMAT(m, 2, 2) + MMAT(m, 3, 2)); -} - - - - -// skin a vertex position -MCORE_INLINE void Matrix::Skin4x3(const AZ::Vector3& in, AZ::Vector3& out, float weight) -{ - out.Set( - out.GetX() + (in.GetX() * TMAT(0, 0) + in.GetY() * TMAT(1, 0) + in.GetZ() * TMAT(2, 0) + TMAT(3, 0)) * weight, - out.GetY() + (in.GetX() * TMAT(0, 1) + in.GetY() * TMAT(1, 1) + in.GetZ() * TMAT(2, 1) + TMAT(3, 1)) * weight, - out.GetZ() + (in.GetX() * TMAT(0, 2) + in.GetY() * TMAT(1, 2) + in.GetZ() * TMAT(2, 2) + TMAT(3, 2)) * weight - ); -} - - -// skin a position and normal -MCORE_INLINE void Matrix::Skin(const AZ::Vector3* inPos, const AZ::Vector3* inNormal, AZ::Vector3* outPos, AZ::Vector3* outNormal, float weight) -{ - const float mat00 = TMAT(0, 0); - const float mat10 = TMAT(1, 0); - const float mat20 = TMAT(2, 0); - const float mat30 = TMAT(3, 0); - const float mat01 = TMAT(0, 1); - const float mat11 = TMAT(1, 1); - const float mat21 = TMAT(2, 1); - const float mat31 = TMAT(3, 1); - const float mat02 = TMAT(0, 2); - const float mat12 = TMAT(1, 2); - const float mat22 = TMAT(2, 2); - const float mat32 = TMAT(3, 2); - - outPos->Set( - outPos->GetX() + (inPos->GetX() * mat00 + inPos->GetY() * mat10 + inPos->GetZ() * mat20 + mat30) * weight, - outPos->GetY() + (inPos->GetX() * mat01 + inPos->GetY() * mat11 + inPos->GetZ() * mat21 + mat31) * weight, - outPos->GetZ() + (inPos->GetX() * mat02 + inPos->GetY() * mat12 + inPos->GetZ() * mat22 + mat32) * weight - ); - - outNormal->Set( - outNormal->GetX() + (inNormal->GetX() * mat00 + inNormal->GetY() * mat10 + inNormal->GetZ() * mat20) * weight, - outNormal->GetY() + (inNormal->GetX() * mat01 + inNormal->GetY() * mat11 + inNormal->GetZ() * mat21) * weight, - outNormal->GetZ() + (inNormal->GetX() * mat02 + inNormal->GetY() * mat12 + inNormal->GetZ() * mat22) * weight - ); -} - - -// skin a position, normal, and tangent -MCORE_INLINE void Matrix::Skin(const AZ::Vector3* inPos, const AZ::Vector3* inNormal, const AZ::Vector4* inTangent, AZ::Vector3* outPos, AZ::Vector3* outNormal, AZ::Vector4* outTangent, float weight) -{ - const float mat00 = TMAT(0, 0); - const float mat10 = TMAT(1, 0); - const float mat20 = TMAT(2, 0); - const float mat30 = TMAT(3, 0); - const float mat01 = TMAT(0, 1); - const float mat11 = TMAT(1, 1); - const float mat21 = TMAT(2, 1); - const float mat31 = TMAT(3, 1); - const float mat02 = TMAT(0, 2); - const float mat12 = TMAT(1, 2); - const float mat22 = TMAT(2, 2); - const float mat32 = TMAT(3, 2); - - outPos->Set( - outPos->GetX() + (inPos->GetX() * mat00 + inPos->GetY() * mat10 + inPos->GetZ() * mat20 + mat30) * weight, - outPos->GetY() + (inPos->GetX() * mat01 + inPos->GetY() * mat11 + inPos->GetZ() * mat21 + mat31) * weight, - outPos->GetZ() + (inPos->GetX() * mat02 + inPos->GetY() * mat12 + inPos->GetZ() * mat22 + mat32) * weight - ); - - outNormal->Set( - outNormal->GetX() + (inNormal->GetX() * mat00 + inNormal->GetY() * mat10 + inNormal->GetZ() * mat20) * weight, - outNormal->GetY() + (inNormal->GetX() * mat01 + inNormal->GetY() * mat11 + inNormal->GetZ() * mat21) * weight, - outNormal->GetZ() + (inNormal->GetX() * mat02 + inNormal->GetY() * mat12 + inNormal->GetZ() * mat22) * weight - ); - - outTangent->Set( - outTangent->GetX() + (inTangent->GetX() * mat00 + inTangent->GetY() * mat10 + inTangent->GetZ() * mat20) * weight, - outTangent->GetY() + (inTangent->GetX() * mat01 + inTangent->GetY() * mat11 + inTangent->GetZ() * mat21) * weight, - outTangent->GetZ() + (inTangent->GetX() * mat02 + inTangent->GetY() * mat12 + inTangent->GetZ() * mat22) * weight, - inTangent->GetW() - ); -} - -// skin a position, normal, and tangent and bitangent -MCORE_INLINE void Matrix::Skin(const AZ::Vector3* inPos, const AZ::Vector3* inNormal, const AZ::Vector4* inTangent, const AZ::Vector3* inBitangent, AZ::Vector3* outPos, AZ::Vector3* outNormal, AZ::Vector4* outTangent, AZ::Vector3* outBitangent, float weight) -{ - const float mat00 = TMAT(0, 0); - const float mat10 = TMAT(1, 0); - const float mat20 = TMAT(2, 0); - const float mat30 = TMAT(3, 0); - const float mat01 = TMAT(0, 1); - const float mat11 = TMAT(1, 1); - const float mat21 = TMAT(2, 1); - const float mat31 = TMAT(3, 1); - const float mat02 = TMAT(0, 2); - const float mat12 = TMAT(1, 2); - const float mat22 = TMAT(2, 2); - const float mat32 = TMAT(3, 2); - - outPos->Set( - outPos->GetX() + (inPos->GetX() * mat00 + inPos->GetY() * mat10 + inPos->GetZ() * mat20 + mat30) * weight, - outPos->GetY() + (inPos->GetX() * mat01 + inPos->GetY() * mat11 + inPos->GetZ() * mat21 + mat31) * weight, - outPos->GetZ() + (inPos->GetX() * mat02 + inPos->GetY() * mat12 + inPos->GetZ() * mat22 + mat32) * weight - ); - - outNormal->Set( - outNormal->GetX() + (inNormal->GetX() * mat00 + inNormal->GetY() * mat10 + inNormal->GetZ() * mat20) * weight, - outNormal->GetY() + (inNormal->GetX() * mat01 + inNormal->GetY() * mat11 + inNormal->GetZ() * mat21) * weight, - outNormal->GetZ() + (inNormal->GetX() * mat02 + inNormal->GetY() * mat12 + inNormal->GetZ() * mat22) * weight - ); - - outTangent->Set( - outTangent->GetX() + (inTangent->GetX() * mat00 + inTangent->GetY() * mat10 + inTangent->GetZ() * mat20) * weight, - outTangent->GetY() + (inTangent->GetX() * mat01 + inTangent->GetY() * mat11 + inTangent->GetZ() * mat21) * weight, - outTangent->GetZ() + (inTangent->GetX() * mat02 + inTangent->GetY() * mat12 + inTangent->GetZ() * mat22) * weight, - inTangent->GetW() - ); - - outBitangent->Set( - outBitangent->GetX() + (inBitangent->GetX() * mat00 + inBitangent->GetY() * mat10 + inBitangent->GetZ() * mat20) * weight, - outBitangent->GetY() + (inBitangent->GetX() * mat01 + inBitangent->GetY() * mat11 + inBitangent->GetZ() * mat21) * weight, - outBitangent->GetZ() + (inBitangent->GetX() * mat02 + inBitangent->GetY() * mat12 + inBitangent->GetZ() * mat22) * weight - ); -} - - -// skin a normal -MCORE_INLINE void Matrix::Skin3x3(const AZ::Vector3& in, AZ::Vector3& out, float weight) -{ - out.Set( - out.GetX() + (in.GetX() * TMAT(0, 0) + in.GetY() * TMAT(1, 0) + in.GetZ() * TMAT(2, 0)) * weight, - out.GetY() + (in.GetX() * TMAT(0, 1) + in.GetY() * TMAT(1, 1) + in.GetZ() * TMAT(2, 1)) * weight, - out.GetZ() + (in.GetX() * TMAT(0, 2) + in.GetY() * TMAT(1, 2) + in.GetZ() * TMAT(2, 2)) * weight - ); -} - - -// multiply by a float -MCORE_INLINE Matrix& Matrix::operator *= (float value) -{ - for (uint32 i = 0; i < 16; ++i) - { - m_m16[i] *= value; - } - - return *this; -} - - -// scale (uniform) -MCORE_INLINE void Matrix::Scale(const AZ::Vector3& scale) -{ - for (uint32 i = 0; i < 4; ++i) - { - TMAT(i, 0) *= scale.GetX(); - TMAT(i, 1) *= scale.GetY(); - TMAT(i, 2) *= scale.GetZ(); - } -} - - -// returns a normalized version of this matrix -Matrix Matrix::Normalized() const -{ - Matrix result(*this); - result.Normalize(); - return result; -} - diff --git a/Gems/EMotionFX/Code/MCore/mcore_files.cmake b/Gems/EMotionFX/Code/MCore/mcore_files.cmake index d33041eaf8..c1203cb72e 100644 --- a/Gems/EMotionFX/Code/MCore/mcore_files.cmake +++ b/Gems/EMotionFX/Code/MCore/mcore_files.cmake @@ -79,9 +79,6 @@ set(FILES Source/LogManager.cpp Source/LogManager.h Source/Macros.h - Source/Matrix4.cpp - Source/Matrix4.h - Source/Matrix4.inl Source/MCoreSystem.cpp Source/MCoreSystem.h Source/MemoryCategoriesCore.h diff --git a/Gems/EMotionFX/Code/Tests/Matchers.h b/Gems/EMotionFX/Code/Tests/Matchers.h index 9f7b9017ba..61370aafa0 100644 --- a/Gems/EMotionFX/Code/Tests/Matchers.h +++ b/Gems/EMotionFX/Code/Tests/Matchers.h @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -89,27 +88,3 @@ inline bool IsCloseMatcherP::gmock_Impl -template<> -inline bool IsCloseMatcherP::gmock_Impl::MatchAndExplain(const MCore::Matrix& arg, ::testing::MatchResultListener* result_listener) const -{ - using ::testing::FloatEq; - using ::testing::ExplainMatchResult; - return ExplainMatchResult(FloatEq(expected.m_m16[0]), arg.m_m16[0], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[1]), arg.m_m16[1], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[2]), arg.m_m16[2], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[3]), arg.m_m16[3], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[4]), arg.m_m16[4], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[5]), arg.m_m16[5], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[6]), arg.m_m16[6], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[7]), arg.m_m16[7], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[8]), arg.m_m16[8], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[9]), arg.m_m16[9], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[10]), arg.m_m16[10], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[11]), arg.m_m16[11], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[12]), arg.m_m16[12], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[13]), arg.m_m16[13], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[14]), arg.m_m16[14], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[15]), arg.m_m16[15], result_listener); -} diff --git a/Gems/EMotionFX/Code/Tests/TransformUnitTests.cpp b/Gems/EMotionFX/Code/Tests/TransformUnitTests.cpp index b5f98bc5e8..bc63f6f9bd 100644 --- a/Gems/EMotionFX/Code/Tests/TransformUnitTests.cpp +++ b/Gems/EMotionFX/Code/Tests/TransformUnitTests.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include From 0abbdcd4ac235d9b31b4b5e5fc527d453c070c45 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 17:20:31 -0800 Subject: [PATCH 252/620] Removes PlaneEq.cpp/inl and TriangleListOptimizer.h from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/EMotionFX/Code/MCore/Source/PlaneEq.cpp | 81 ------- Gems/EMotionFX/Code/MCore/Source/PlaneEq.h | 39 --- Gems/EMotionFX/Code/MCore/Source/PlaneEq.inl | 33 --- .../Code/MCore/Source/TriangleListOptimizer.h | 223 ------------------ Gems/EMotionFX/Code/MCore/mcore_files.cmake | 3 - 5 files changed, 379 deletions(-) delete mode 100644 Gems/EMotionFX/Code/MCore/Source/PlaneEq.cpp delete mode 100644 Gems/EMotionFX/Code/MCore/Source/PlaneEq.inl delete mode 100644 Gems/EMotionFX/Code/MCore/Source/TriangleListOptimizer.h diff --git a/Gems/EMotionFX/Code/MCore/Source/PlaneEq.cpp b/Gems/EMotionFX/Code/MCore/Source/PlaneEq.cpp deleted file mode 100644 index fd64974fb1..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/PlaneEq.cpp +++ /dev/null @@ -1,81 +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 - * - */ - -// include required headers -#include "PlaneEq.h" - -namespace MCore -{ - // clip points against the plane - bool PlaneEq::Clip(const AZStd::vector& pointsIn, AZStd::vector& pointsOut) const - { - size_t numPoints = pointsIn.size(); - - MCORE_ASSERT(&pointsIn != &pointsOut); - MCORE_ASSERT(numPoints >= 2); - - size_t vert1 = numPoints - 1; - float firstDist = CalcDistanceTo(pointsIn[vert1]); - float nextDist = firstDist; - bool firstIn = (firstDist >= 0.0f); - bool nextIn = firstIn; - - pointsOut.clear(); - - if (numPoints == 2) - { - numPoints = 1; - } - - for (int32 vert2 = 0; vert2 < numPoints; vert2++) - { - float dist = nextDist; - bool in = nextIn; - - nextDist = CalcDistanceTo(pointsIn[vert2]); - nextIn = (nextDist >= 0.0f); - - if (in) - { - pointsOut.emplace_back(pointsIn[vert1]); - } - - if ((in != nextIn) && (dist != 0.0f) && (nextDist != 0.0f)) - { - AZ::Vector3 dir = (pointsIn[vert2] - pointsIn[vert1]); - - float frac = dist / (dist - nextDist); - if ((frac > 0.0f) && (frac < 1.0f)) - { - pointsOut.emplace_back(pointsIn[vert1] + frac * dir); - } - } - - vert1 = vert2; - } - - //if (numPoints == 1) - // return (pointsOut.GetLength() > 1); - - return (pointsOut.size() > 1); - } - - - // clip a set of vectors to this plane - bool PlaneEq::Clip(AZStd::vector& points) const - { - AZStd::vector pointsOut; - if (Clip(points, pointsOut)) - { - points = pointsOut; - return true; - } - - return false; - } -} // namespace MCore diff --git a/Gems/EMotionFX/Code/MCore/Source/PlaneEq.h b/Gems/EMotionFX/Code/MCore/Source/PlaneEq.h index df8738a1ee..3c8954a29a 100644 --- a/Gems/EMotionFX/Code/MCore/Source/PlaneEq.h +++ b/Gems/EMotionFX/Code/MCore/Source/PlaneEq.h @@ -147,43 +147,6 @@ namespace MCore */ MCORE_INLINE float GetDist() const { return m_dist; } - /** - * Checks if a given axis aligned bounding box (AABB) is partially above (aka in front) this plane or not. - * The Frustum class uses this method to check if a box is partially inside a the frustum or not. - * @param box The axis aligned bounding box to perform the test with. - * @result Returns true when 'box' is partially (or completely) above the plane or not. - */ - MCORE_INLINE bool PartiallyAbove(const AABB& box) const; - - /** - * Check if a given axis aligned bounding box (AABB) is completely above (aka in front) this plane or not. - * The Frustum class uses this method to check if a box is completely inside a the frustum or not. - * @param box The axis aligned bounding box to perform the test with. - * @result Returns true when 'box' is completely above the plane or not. - */ - MCORE_INLINE bool CompletelyAbove(const AABB& box) const; - - /** - * Clips a set of 3D points to this plane. - * Actually these are not just points, but edges. The edges go from point 0 to 1, from 1 to 2, etc. - * Beware that the clipped number of points can be higher as the ones you input to this method. - * This method can be used to pretty easily clip polygon data against the plane. - * @param pointsIn The array of points (and edges) to be clipped to the planes. - * @param pointsOut The array of clipped points (and edges). Note that (pointsOut.GetLength() > pointsIn.GetLength()) can be true. - * @result Returns true when the points have been clipped. False is returned when the clipping resulted in 0 output points. - */ - bool Clip(const AZStd::vector& pointsIn, AZStd::vector& pointsOut) const; - - /** - * Clip a set of 3D points to this plane. - * Actually these are not just points, but edges. The edges go from point 0 to 1, from 1 to 2, etc. - * Beware that the clipped number of points can be higher as the ones you input to this method. - * This method can be used to pretty easily clip polygon data against the plane. - * @param points The set of points (or edges) to clip. When done, points contains the clipped points. - * @result Returns true when the points have been clipped. False is returned when the clipping resulted in 0 points. In that last case 'points' won't be effected and contains just the original input points. - */ - bool Clip(AZStd::vector& points) const; - /** * Project a vector onto the plane. * @param vectorToProject The vector you wish to project onto the plane. @@ -197,6 +160,4 @@ namespace MCore float m_dist; /**< The D in the plane equation (Ax + By + Cz + D = 0). */ }; - // include the inline code -#include "PlaneEq.inl" } // namespace MCore diff --git a/Gems/EMotionFX/Code/MCore/Source/PlaneEq.inl b/Gems/EMotionFX/Code/MCore/Source/PlaneEq.inl deleted file mode 100644 index 62ccb19551..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/PlaneEq.inl +++ /dev/null @@ -1,33 +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 - * - */ - - -// check if the box is partially above the plane -MCORE_INLINE bool PlaneEq::PartiallyAbove(const AABB& box) const -{ - const AZ::Vector3 minVec = box.GetMin(); - const AZ::Vector3 maxVec = box.GetMax(); - const AZ::Vector3 testPoint(IsNegative(float(m_normal.GetX())) ? minVec.GetX() : maxVec.GetX(), - IsNegative(static_cast(m_normal.GetY())) ? minVec.GetY() : maxVec.GetY(), - IsNegative(static_cast(m_normal.GetZ())) ? minVec.GetZ() : maxVec.GetZ()); - - return IsPositive(m_normal.Dot(testPoint) + m_dist); -} - - -// check if the box is completely above the plane -MCORE_INLINE bool PlaneEq::CompletelyAbove(const AABB& box) const -{ - const AZ::Vector3 minVec = box.GetMin(); - const AZ::Vector3 maxVec = box.GetMax(); - const AZ::Vector3 testPoint(IsPositive(m_normal.GetX()) ? minVec.GetX() : maxVec.GetX(), - IsPositive(m_normal.GetY()) ? minVec.GetY() : maxVec.GetY(), - IsPositive(m_normal.GetZ()) ? minVec.GetZ() : maxVec.GetZ()); - - return IsPositive(m_normal.Dot(testPoint) + m_dist); -} diff --git a/Gems/EMotionFX/Code/MCore/Source/TriangleListOptimizer.h b/Gems/EMotionFX/Code/MCore/Source/TriangleListOptimizer.h deleted file mode 100644 index 38e5df8de4..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/TriangleListOptimizer.h +++ /dev/null @@ -1,223 +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 - * - */ - -#pragma once - -#include -#include - -namespace MCore -{ - /** - * The triangle list optimizer. - * This can be used to improve cache efficiency. It reorders the index buffers to maximize the number of cache hits. - */ - template - class TriangleListOptimizer - { - public: - /** - * The constructor. - * @param numCacheEntries The cache size in number of elements. Smaller values often result in better optimizations. - */ - TriangleListOptimizer(size_t numCacheEntries = 8); - - /** - * Optimizes an index buffer. - * This will modify the input triangle list index buffer. - * Each triangle needs three indices. - * @param triangleList The index buffer. - * @param numIndices The number of indices inside the specified index buffer. - */ - void OptimizeIndexBuffer(IndexType* triangleList, size_t numIndices); - - /** - * Calculate the number of cache hits that the a given triange list would get. - * Higher values will be better than lower values. - * @param triangleList The index buffer, with three indices per triangle. - * @param numIndices The number of indices. - * @result The number of cache hits. - */ - size_t CalcNumCacheHits(IndexType* triangleList, size_t numIndices); - - private: - AZStd::vector m_entries{}; - size_t m_numUsedEntries = 0; /**< The number of used cache entries. */ - size_t m_oldestEntry = 0; /**< The index to the oldest entry, which will be overwritten first when the cache is full. */ - - void Flush(); - - /** - * Calculate the number of cache hits for a given triangle. - * @param indexA The first vertex index. - * @param indexB The second vertex index. - * @param indexC The third vertex index. - * @result The number of cache hits that this triangle would give. - */ - size_t CalcNumCacheHits(IndexType indexA, IndexType indexB, IndexType indexC) const; - - /** - * Add an index value to the cache. - * @param vertexIndex The vertex index value. - */ - void AddToCache(IndexType vertexIndex); - }; - - template - TriangleListOptimizer::TriangleListOptimizer(size_t numCacheEntries) - { - // We never push more items than this capacity. The vector stores the - // max number of entries for us in its capacity() method. - m_entries.set_capacity(numCacheEntries); - } - - template - void TriangleListOptimizer::OptimizeIndexBuffer(IndexType* triangleList, size_t numIndices) - { - Flush(); - - // create a temporary buffer - AZStd::vector newBuffer(numIndices); - size_t maxIndices = numIndices; - - // for all triangles in the triangle list - for (size_t f = 0; f < numIndices; f += 3) - { - size_t mostEfficient = 0; - size_t mostHits = 0; - - for (size_t i = 0; i < maxIndices; i += 3) - { - // get the triangle indices - const IndexType indexA = triangleList[i]; - const IndexType indexB = triangleList[i + 1]; - const IndexType indexC = triangleList[i + 2]; - - // calculate how many hits this triangle would give - size_t numHits = CalcNumCacheHits(indexA, indexB, indexC); - - // if the number of hits is the maximum hits we can score, use this triangle - if (numHits == 3) - { - mostHits = numHits; - mostEfficient = i; - break; - } - - // check if this gives more hits than any other triangle we tested before - if (numHits > mostHits) - { - mostHits = numHits; - mostEfficient = i; - } - } - - // insert the triangle that gave most cache hits to the new triangle list - AddToCache(triangleList[mostEfficient]); - AddToCache(triangleList[mostEfficient + 1]); - AddToCache(triangleList[mostEfficient + 2]); - newBuffer[f] = triangleList[mostEfficient]; - newBuffer[f + 1] = triangleList[mostEfficient + 1]; - newBuffer[f + 2] = triangleList[mostEfficient + 2]; - - // remove the triangle from the old list, so that we don't test it anymore next time, since we already inserted it inside the new optimized list - AZStd::move( - /*input first*/ triangleList + mostEfficient + 3, - /*input last*/ triangleList + maxIndices, - /*output first*/ triangleList + mostEfficient); - - // we need to test one less triangle next time, since we just added one of the triangles to the new list - // so there is one less left - maxIndices -= 3; - } - - // copy the results - AZStd::copy(begin(newBuffer), end(newBuffer), triangleList); - } - - // calculate the number of cache hits - template - size_t TriangleListOptimizer::CalcNumCacheHits(IndexType* triangleList, size_t numIndices) - { - // clear the cache - Flush(); - - size_t totalHits = 0; - - // for all triangles in the triangle list - for (size_t f = 0; f < numIndices; f += 3) - { - const IndexType indexA = triangleList[f]; - const IndexType indexB = triangleList[f + 1]; - const IndexType indexC = triangleList[f + 2]; - - totalHits += CalcNumCacheHits(indexA, indexB, indexC); - - AddToCache(indexA); - AddToCache(indexB); - AddToCache(indexC); - } - - return totalHits; - } - - template - void TriangleListOptimizer::Flush() - { - m_numUsedEntries = 0; - m_oldestEntry = 0; - m_entries.clear(); - } - - // calculate the number of cache hits for a triangle - template - size_t TriangleListOptimizer::CalcNumCacheHits(IndexType indexA, IndexType indexB, IndexType indexC) const - { - size_t total = 0; - - // check all cache entries - for (IndexType entryValue : m_entries) - { - if (entryValue == indexA || entryValue == indexB || entryValue == indexC) - { - total++; - } - if (total == 3) - { - break; - } - } - - return total; - } - - // get a value from the cache - template - void TriangleListOptimizer::AddToCache(IndexType vertexIndex) - { - // check if this entry is already in the cache, if so we have a cache hit and can quit - const auto entryIt = AZStd::find(m_entries.begin(), m_entries.end(), vertexIndex); - if (entryIt != m_entries.end()) - { - return; - } - - // the entry is not inside the cache and the cache is not full yet, we can simply insert the cache entry and return - if (m_numUsedEntries < m_entries.capacity()) - { - m_entries.emplace_back(vertexIndex); - ++m_numUsedEntries; - return; - } - - // the cache is full, remove one of the entries - // since we simulate a FIFO cache, we have to remove the oldest entry - m_entries[m_oldestEntry] = vertexIndex; - ++m_oldestEntry %= m_entries.capacity(); - } -} // namespace MCore diff --git a/Gems/EMotionFX/Code/MCore/mcore_files.cmake b/Gems/EMotionFX/Code/MCore/mcore_files.cmake index c1203cb72e..7468b4f60d 100644 --- a/Gems/EMotionFX/Code/MCore/mcore_files.cmake +++ b/Gems/EMotionFX/Code/MCore/mcore_files.cmake @@ -91,9 +91,7 @@ set(FILES Source/MemoryTracker.cpp Source/MemoryTracker.h Source/MultiThreadManager.h - Source/PlaneEq.cpp Source/PlaneEq.h - Source/PlaneEq.inl Source/Random.cpp Source/Random.h Source/Ray.cpp @@ -109,6 +107,5 @@ set(FILES Source/StringIdPool.h Source/ReflectionSerializer.cpp Source/ReflectionSerializer.h - Source/TriangleListOptimizer.h Source/Vector.h ) From 94fa49da4997e84d26d2d1d663b8222c6331d3bb Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 17:28:41 -0800 Subject: [PATCH 253/620] Removes Tests/Mocks/AnimGraphObjectData.h from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Tests/AnimGraphParameterCommandsTests.cpp | 1 - .../Code/Tests/Mocks/AnimGraphObjectData.h | 14 -------------- Gems/EMotionFX/Code/emotionfx_tests_files.cmake | 1 - 3 files changed, 16 deletions(-) delete mode 100644 Gems/EMotionFX/Code/Tests/Mocks/AnimGraphObjectData.h diff --git a/Gems/EMotionFX/Code/Tests/AnimGraphParameterCommandsTests.cpp b/Gems/EMotionFX/Code/Tests/AnimGraphParameterCommandsTests.cpp index 2f5a661850..1eae86587c 100644 --- a/Gems/EMotionFX/Code/Tests/AnimGraphParameterCommandsTests.cpp +++ b/Gems/EMotionFX/Code/Tests/AnimGraphParameterCommandsTests.cpp @@ -102,7 +102,6 @@ namespace AnimGraphParameterCommandsTests #include #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/Tests/Mocks/AnimGraphObjectData.h b/Gems/EMotionFX/Code/Tests/Mocks/AnimGraphObjectData.h deleted file mode 100644 index 83831708d1..0000000000 --- a/Gems/EMotionFX/Code/Tests/Mocks/AnimGraphObjectData.h +++ /dev/null @@ -1,14 +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 - * - */ - -namespace EMotionFX -{ - class AnimGraphObjectData - { - }; -} diff --git a/Gems/EMotionFX/Code/emotionfx_tests_files.cmake b/Gems/EMotionFX/Code/emotionfx_tests_files.cmake index c418998a8f..98d7809fe9 100644 --- a/Gems/EMotionFX/Code/emotionfx_tests_files.cmake +++ b/Gems/EMotionFX/Code/emotionfx_tests_files.cmake @@ -132,7 +132,6 @@ set(FILES Tests/Mocks/AnimGraphManager.h Tests/Mocks/AnimGraphNode.h Tests/Mocks/AnimGraphObject.h - Tests/Mocks/AnimGraphObjectData.h Tests/Mocks/AnimGraphStateTransition.h Tests/Mocks/BlendTreeParameterNode.h Tests/Mocks/Command.h From b982d5627b6cf9949aee43c67a42637fc7869c24 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 12:45:55 -0800 Subject: [PATCH 254/620] Removes unused IRecognizerMock.h from Gems/Gestures Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/Gestures/Code/Mocks/IRecognizerMock.h | 25 ---------------------- 1 file changed, 25 deletions(-) delete mode 100644 Gems/Gestures/Code/Mocks/IRecognizerMock.h diff --git a/Gems/Gestures/Code/Mocks/IRecognizerMock.h b/Gems/Gestures/Code/Mocks/IRecognizerMock.h deleted file mode 100644 index c698c8285a..0000000000 --- a/Gems/Gestures/Code/Mocks/IRecognizerMock.h +++ /dev/null @@ -1,25 +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 - * - */ -#include - -namespace Gestures -{ - class RecognizerMock - : public IRecognizer - { - public: - MOCK_CONST_METHOD0(GetPriority, - int32_t()); - MOCK_METHOD2(OnPressedEvent, - bool(const Vec2&screenPositionPixels, uint32_t pointerIndex)); - MOCK_METHOD2(OnDownEvent, - bool(const Vec2&screenPositionPixels, uint32_t pointerIndex)); - MOCK_METHOD2(OnReleasedEvent, - bool(const Vec2&screenPositionPixels, uint32_t pointerIndex)); - }; -} From 02acf2f65ea3ecb606a6f9411efc257fd3e51f3c Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Sat, 18 Sep 2021 23:57:52 -0700 Subject: [PATCH 255/620] Updated MaterialPropertyId class in preparation for nested material property sets. Here the class has been generalized for a list of group names and a final property name, rather than assuming a single group containing the property. This included removing the unused GetPropertyName and GetGroupName functions. All that's really need from this class is conversion to a full property ID string. Testing: New unit test. Reprocessed all core material types and StandardPBR test materials used in Atom Sample Viewer's material screenshot test. Atom Sample Viewer material screenshot test script. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../RPI.Edit/Material/MaterialPropertyId.h | 18 +-- .../RPI.Edit/Material/MaterialPropertyId.cpp | 83 ++++++----- .../Material/MaterialTypeSourceData.cpp | 12 +- .../Material/MaterialPropertyIdTests.cpp | 131 ++++++++++++++++++ Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake | 1 + .../Code/Source/Document/MaterialDocument.cpp | 8 +- .../MaterialInspector/MaterialInspector.cpp | 4 +- .../EditorMaterialComponentInspector.cpp | 2 +- .../Material/EditorMaterialComponentUtil.cpp | 4 +- .../EditorMaterialModelUvNameMapInspector.cpp | 4 +- 10 files changed, 210 insertions(+), 57 deletions(-) create mode 100644 Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h index 77d49f3407..4b6d78c092 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h @@ -9,6 +9,7 @@ #pragma once #include +#include namespace AZ { @@ -16,27 +17,28 @@ namespace AZ { class MaterialAsset; - //! Utility for building material property names consisting of a group name and a property sub-name. - //! Represented as "[groupName].[propertyName]". - //! The group name is optional, in which case the ID will just be "[propertyName]". + //! Utility for building material property IDs. + //! These IDs are represented like "groupA.groupB.[...].propertyName". + //! The groups are optional, in which case the full property ID will just be like "propertyName". class MaterialPropertyId { public: static bool IsValidName(AZStd::string_view name); static bool IsValidName(const AZ::Name& name); - //! Creates a MaterialPropertyId from a full name string like "[groupName].[propertyName]" or just "[propertyName]" + //! Creates a MaterialPropertyId from a full name string like "groupA.groupB.[...].propertyName" or just "propertyName". + //! Also checks the name for validity. static MaterialPropertyId Parse(AZStd::string_view fullPropertyId); MaterialPropertyId() = default; + explicit MaterialPropertyId(AZStd::string_view propertyName); MaterialPropertyId(AZStd::string_view groupName, AZStd::string_view propertyName); MaterialPropertyId(const Name& groupName, const Name& propertyName); + MaterialPropertyId(const AZStd::array_view names); AZ_DEFAULT_COPY_MOVE(MaterialPropertyId); - const Name& GetGroupName() const; - const Name& GetPropertyName() const; - const Name& GetFullName() const; + operator const Name&() const; //! Returns a pointer to the full name ("[groupName].[propertyName]"). //! This is included for convenience so it can be used for error messages in the same way an AZ::Name is used. @@ -52,8 +54,6 @@ namespace AZ private: Name m_fullName; - Name m_groupName; - Name m_propertyName; }; } // namespace RPI diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp index e74ec3e6e0..1be5c4485c 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp @@ -27,63 +27,84 @@ namespace AZ bool MaterialPropertyId::IsValid() const { - const bool groupNameIsValid = m_groupName.IsEmpty() || IsValidName(m_groupName); - const bool propertyNameIsValid = IsValidName(m_propertyName); - return groupNameIsValid && propertyNameIsValid; + return !m_fullName.IsEmpty(); } MaterialPropertyId MaterialPropertyId::Parse(AZStd::string_view fullPropertyId) { AZStd::vector tokens; - AzFramework::StringFunc::Tokenize(fullPropertyId.data(), tokens, '.', true, true); + AzFramework::StringFunc::Tokenize(fullPropertyId, tokens, '.', true, true); - if (tokens.size() == 1) + if (tokens.empty()) { - return MaterialPropertyId{"", tokens[0]}; + AZ_Error("MaterialPropertyId", false, "Property ID is empty.", fullPropertyId.data()); + return MaterialPropertyId{}; } - else if (tokens.size() == 2) + + for (const auto& token : tokens) { - return MaterialPropertyId{tokens[0], tokens[1]}; + if (!IsValidName(token)) + { + AZ_Error("MaterialPropertyId", false, "Property ID '%.*s' is not a valid identifier.", AZ_STRING_ARG(fullPropertyId)); + return MaterialPropertyId{}; + } + } + + MaterialPropertyId id; + id.m_fullName = fullPropertyId; + return id; + } + + MaterialPropertyId::MaterialPropertyId(AZStd::string_view propertyName) + { + if (!IsValidName(propertyName)) + { + AZ_Error("MaterialPropertyId", false, "Property name '%.*s' is not a valid identifier.", AZ_STRING_ARG(propertyName)); } else { - AZ_Error("MaterialPropertyId", false, "Property ID '%s' is not a valid identifier.", fullPropertyId.data()); - return MaterialPropertyId{}; + m_fullName = propertyName; } } MaterialPropertyId::MaterialPropertyId(AZStd::string_view groupName, AZStd::string_view propertyName) - : MaterialPropertyId(Name{groupName}, Name{propertyName}) { - } - - MaterialPropertyId::MaterialPropertyId(const Name& groupName, const Name& propertyName) - { - AZ_Error("MaterialPropertyId", groupName.IsEmpty() || IsValidName(groupName), "Group name '%s' is not a valid identifier.", groupName.GetCStr()); - AZ_Error("MaterialPropertyId", IsValidName(propertyName), "Property name '%s' is not a valid identifier.", propertyName.GetCStr()); - m_groupName = groupName; - m_propertyName = propertyName; - if (groupName.IsEmpty()) + if (!IsValidName(groupName)) { - m_fullName = m_propertyName.GetStringView(); + AZ_Error("MaterialPropertyId", false, "Group name '%.*s' is not a valid identifier.", AZ_STRING_ARG(groupName)); + } + else if (!IsValidName(propertyName)) + { + AZ_Error("MaterialPropertyId", false, "Property name '%.*s' is not a valid identifier.", AZ_STRING_ARG(propertyName)); } else { - m_fullName = AZStd::string::format("%s.%s", m_groupName.GetCStr(), m_propertyName.GetCStr()); + m_fullName = AZStd::string::format("%.*s.%.*s", AZ_STRING_ARG(groupName), AZ_STRING_ARG(propertyName)); } } - - const Name& MaterialPropertyId::GetGroupName() const + + MaterialPropertyId::MaterialPropertyId(const Name& groupName, const Name& propertyName) + : MaterialPropertyId(groupName.GetStringView(), propertyName.GetStringView()) { - return m_groupName; + } + + MaterialPropertyId::MaterialPropertyId(const AZStd::array_view names) + { + for (const auto& name : names) + { + if (!IsValidName(name)) + { + AZ_Error("MaterialPropertyId", false, "'%s' is not a valid identifier.", name.c_str()); + return; + } + } + + AZStd::string fullName; + AzFramework::StringFunc::Join(fullName, names.begin(), names.end(), "."); + m_fullName = fullName; } - const Name& MaterialPropertyId::GetPropertyName() const - { - return m_propertyName; - } - - const Name& MaterialPropertyId::GetFullName() const + MaterialPropertyId::operator const Name&() const { return m_fullName; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index 87c064f571..ddc2bc842b 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -400,7 +400,7 @@ namespace AZ continue; } - materialTypeAssetCreator.BeginMaterialProperty(propertyId.GetFullName(), property.m_dataType); + materialTypeAssetCreator.BeginMaterialProperty(propertyId, property.m_dataType); if (property.m_dataType == MaterialPropertyDataType::Enum) { @@ -454,18 +454,18 @@ namespace AZ if (result == MaterialUtils::GetImageAssetResult::Missing) { materialTypeAssetCreator.ReportError( - "Material property '%s': Could not find the image '%s'", propertyId.GetFullName().GetCStr(), + "Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), property.m_value.GetValue().data()); } else { - materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAsset); + materialTypeAssetCreator.SetPropertyValue(propertyId, imageAsset); } } break; case MaterialPropertyDataType::Enum: { - MaterialPropertyIndex propertyIndex = materialTypeAssetCreator.GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId.GetFullName()); + MaterialPropertyIndex propertyIndex = materialTypeAssetCreator.GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAssetCreator.GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); AZ::Name enumName = AZ::Name(property.m_value.GetValue()); @@ -476,12 +476,12 @@ namespace AZ } else { - materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), enumValue); + materialTypeAssetCreator.SetPropertyValue(propertyId, enumValue); } } break; default: - materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), property.m_value); + materialTypeAssetCreator.SetPropertyValue(propertyId, property.m_value); break; } } diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp new file mode 100644 index 0000000000..2b729ed8ef --- /dev/null +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp @@ -0,0 +1,131 @@ +/* + * 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 + * + */ + +#include +#include +#include +#include + +namespace UnitTest +{ + using namespace AZ; + using namespace RPI; + + class MaterialPropertyIdTests + : public RPITestFixture + { + }; + + TEST_F(MaterialPropertyIdTests, TestConstructWithPropertyName) + { + MaterialPropertyId id{"color"}; + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "color"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"color"}); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithPropertyName_BadName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + MaterialPropertyId id{"color?"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithTwoNames) + { + MaterialPropertyId id{"baseColor", "factor"}; + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "baseColor.factor"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"baseColor.factor"}); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithTwoNames_BadGroupName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + MaterialPropertyId id{"layer1.baseColor", "factor"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithTwoNames_BadPropertyName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + MaterialPropertyId id{"baseColor", ".factor"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithMultipleNames) + { + AZStd::vector names{"layer1", "clearCoat", "normal", "factor"}; + MaterialPropertyId id{names}; + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "layer1.clearCoat.normal.factor"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"layer1.clearCoat.normal.factor"}); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithMultipleNames_BadName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + AZStd::vector names{"layer1", "clear-coat", "normal", "factor"}; + MaterialPropertyId id{names}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestParse) + { + MaterialPropertyId id = MaterialPropertyId::Parse("layer1.clearCoat.normal.factor"); + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "layer1.clearCoat.normal.factor"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"layer1.clearCoat.normal.factor"}); + } + + TEST_F(MaterialPropertyIdTests, TestParse_BadName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + MaterialPropertyId id = MaterialPropertyId::Parse("layer1.clearCoat.normal,factor"); + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestNameValidity) + { + EXPECT_TRUE(MaterialPropertyId::IsValidName("a")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("z")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("A")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("Z")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("_")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("m_layer10bazBAZ")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("1layer")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("base-color")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("base.color")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("base/color")); + } +} diff --git a/Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake index 5d67948ac8..57ee71e412 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake @@ -37,6 +37,7 @@ set(FILES Tests/Material/MaterialSourceDataTests.cpp Tests/Material/MaterialFunctorTests.cpp Tests/Material/MaterialFunctorSourceDataSerializerTests.cpp + Tests/Material/MaterialPropertyIdTests.cpp Tests/Material/MaterialPropertyValueSourceDataTests.cpp Tests/Material/MaterialTests.cpp Tests/Model/ModelTests.cpp diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index 641d586ea7..8f25e41827 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -589,7 +589,7 @@ namespace MaterialEditor const MaterialPropertyId propertyId(groupName, propertyName); - const auto it = m_properties.find(propertyId.GetFullName()); + const auto it = m_properties.find(propertyId); if (it != m_properties.end() && propertyFilter(it->second)) { MaterialPropertyValue propertyValue = AtomToolsFramework::ConvertToRuntimeType(it->second.GetValue()); @@ -597,7 +597,7 @@ namespace MaterialEditor { if (!AtomToolsFramework::ConvertToExportFormat(exportPath, propertyId.GetFullName(), propertyDefinition, propertyValue)) { - AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.GetFullName().GetCStr(), m_absolutePath.c_str()); + AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.GetCStr(), m_absolutePath.c_str()); result = false; return false; } @@ -783,7 +783,7 @@ namespace MaterialEditor AtomToolsFramework::DynamicPropertyConfig propertyConfig; // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = MaterialPropertyId(groupName, propertyName).GetCStr(); + propertyConfig.m_id = MaterialPropertyId(groupName, propertyName); const auto& propertyIndex = m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); const bool propertyIndexInBounds = propertyIndex.IsValid() && propertyIndex.GetIndex() < m_materialAsset->GetPropertyValues().size(); @@ -854,7 +854,7 @@ namespace MaterialEditor propertyConfig = {}; propertyConfig.m_dataType = AtomToolsFramework::DynamicPropertyType::String; - propertyConfig.m_id = MaterialPropertyId(UvGroupName, shaderInput).GetCStr(); + propertyConfig.m_id = MaterialPropertyId(UvGroupName, shaderInput); propertyConfig.m_name = shaderInput; propertyConfig.m_displayName = shaderInput; propertyConfig.m_groupName = "UV Sets"; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp index 7790b9bef5..0af051894d 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp @@ -152,7 +152,7 @@ namespace MaterialEditor AtomToolsFramework::DynamicProperty property; AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult( property, m_documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetProperty, - AZ::RPI::MaterialPropertyId(groupName, uvNamePair.m_shaderInput.ToString()).GetFullName()); + AZ::RPI::MaterialPropertyId(groupName, uvNamePair.m_shaderInput.ToString())); group.m_properties.push_back(property); property.SetValue(property.GetConfig().m_parentValue); @@ -189,7 +189,7 @@ namespace MaterialEditor AtomToolsFramework::DynamicProperty property; AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult( property, m_documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetProperty, - AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name).GetFullName()); + AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name)); group.m_properties.push_back(property); } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp index bfa9f1d36f..b20fe5802d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp @@ -310,7 +310,7 @@ namespace AZ AtomToolsFramework::DynamicPropertyConfig propertyConfig; // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name).GetFullName(); + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name); AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, propertyDefinition); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp index d3e125426c..f46876fdfb 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp @@ -116,7 +116,7 @@ namespace AZ editData.m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& groupName, const AZStd::string& propertyName, const auto& propertyDefinition){ const AZ::RPI::MaterialPropertyId propertyId(groupName, propertyName); const AZ::RPI::MaterialPropertyIndex propertyIndex = - editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId.GetFullName()); + editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); AZ::RPI::MaterialPropertyValue propertyValue = editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]; @@ -128,7 +128,7 @@ namespace AZ } // Check for and apply any property overrides before saving property values - auto propertyOverrideItr = editData.m_materialPropertyOverrideMap.find(propertyId.GetFullName()); + auto propertyOverrideItr = editData.m_materialPropertyOverrideMap.find(propertyId); if (propertyOverrideItr != editData.m_materialPropertyOverrideMap.end()) { propertyValue = AZ::RPI::MaterialPropertyValue::FromAny(propertyOverrideItr->second); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialModelUvNameMapInspector.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialModelUvNameMapInspector.cpp index 0cf6410fc5..53d7980fdc 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialModelUvNameMapInspector.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialModelUvNameMapInspector.cpp @@ -96,7 +96,7 @@ namespace AZ const AZStd::string materialUvName = m_materialUvNames[i].m_uvName.GetStringView(); propertyConfig.m_dataType = AtomToolsFramework::DynamicPropertyType::Enum; - propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput).GetFullName(); + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput); propertyConfig.m_name = shaderInput; propertyConfig.m_displayName = materialUvName; propertyConfig.m_description = shaderInput; @@ -248,7 +248,7 @@ namespace AZ const AZStd::string materialUvName = m_materialUvNames[i].m_uvName.GetStringView(); propertyConfig.m_dataType = AtomToolsFramework::DynamicPropertyType::Enum; - propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput).GetFullName(); + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput); propertyConfig.m_name = shaderInput; propertyConfig.m_displayName = materialUvName; propertyConfig.m_description = shaderInput; From 8d5a53ab9313069b758ea904fe572911e331b218 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 12 Jan 2022 15:31:37 -0800 Subject: [PATCH 256/620] Minor changes per code review feedback. Added explicit keyword. Renmoved unnecessary local variable. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h | 2 +- .../RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h index 4b6d78c092..5b3c0488cb 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h @@ -34,7 +34,7 @@ namespace AZ explicit MaterialPropertyId(AZStd::string_view propertyName); MaterialPropertyId(AZStd::string_view groupName, AZStd::string_view propertyName); MaterialPropertyId(const Name& groupName, const Name& propertyName); - MaterialPropertyId(const AZStd::array_view names); + explicit MaterialPropertyId(const AZStd::array_view names); AZ_DEFAULT_COPY_MOVE(MaterialPropertyId); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp index 1be5c4485c..a1fee51d0a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp @@ -99,9 +99,7 @@ namespace AZ } } - AZStd::string fullName; - AzFramework::StringFunc::Join(fullName, names.begin(), names.end(), "."); - m_fullName = fullName; + AzFramework::StringFunc::Join(m_fullName, names.begin(), names.end(), "."); } MaterialPropertyId::operator const Name&() const From 534843df0f478a122cc082ba9814f3967e5b5c75 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 12 Jan 2022 15:32:49 -0800 Subject: [PATCH 257/620] Added MaterialPropertyId::GetStringView() utility function. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Include/Atom/RPI.Edit/Material/MaterialPropertyId.h | 6 ++++++ .../Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h index 5b3c0488cb..fd63494f30 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h @@ -41,8 +41,14 @@ namespace AZ operator const Name&() const; //! Returns a pointer to the full name ("[groupName].[propertyName]"). + //! Same as Name::GetCStr() //! This is included for convenience so it can be used for error messages in the same way an AZ::Name is used. const char* GetCStr() const; + + //! Returns a string_view of the full name ("[groupName].[propertyName]"). + //! Same as Name::GetStringView() + //! This is included for convenience so it can be used for string comparison in the same way an AZ::Name is used. + AZStd::string_view GetStringView() const; //! Returns a hash of the full name. This is needed for compatibility with NameIdReflectionMap. Name::Hash GetHash() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp index a1fee51d0a..4880de33fe 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp @@ -111,6 +111,11 @@ namespace AZ { return m_fullName.GetCStr(); } + + AZStd::string_view MaterialPropertyId::GetStringView() const + { + return m_fullName.GetStringView(); + } Name::Hash MaterialPropertyId::GetHash() const { From e2d157006c260e99bc3e122d7368de04f5a280af Mon Sep 17 00:00:00 2001 From: evanchia Date: Thu, 20 Jan 2022 15:57:09 -0800 Subject: [PATCH 258/620] Temporary fix for editor log stomping during python tests Signed-off-by: evanchia --- Code/Editor/CryEdit.cpp | 2 -- Tools/LyTestTools/ly_test_tools/o3de/editor_test.py | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index 1c4e22b99e..cf233dc285 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -2134,8 +2134,6 @@ bool CCryEditApp::FixDanglingSharedMemory(const QString& sharedMemName) const int CCryEditApp::ExitInstance(int exitCode) { - AZ_TracePrintf("Exit", "Called ExitInstance() with exit code: 0x%x", exitCode); - if (m_pEditor) { m_pEditor->OnBeginShutdownSequence(); diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py index 8bd4fbe29a..672259b076 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py @@ -315,7 +315,7 @@ class EditorTestSuite(): return 8 ## Internal ## - _TIMEOUT_CRASH_LOG = 20 # Maximum time (seconds) for waiting for a crash file, in secondss + _TIMEOUT_CRASH_LOG = 20 # Maximum time (seconds) for waiting for a crash file, in seconds _TEST_FAIL_RETCODE = 0xF # Return code for test failure @pytest.fixture(scope="class") @@ -772,7 +772,8 @@ class EditorTestSuite(): return_code = editor.get_returncode() editor_log_content = editor_utils.retrieve_editor_log_content(run_id, log_name, workspace) # Save the editor log - workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(run_id, workspace), log_name)) + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(run_id, workspace), log_name), + f'({run_id}){log_name}') if return_code == 0: test_result = Result.Pass.create(test_spec, output, editor_log_content) else: @@ -847,7 +848,8 @@ class EditorTestSuite(): return_code = editor.get_returncode() editor_log_content = editor_utils.retrieve_editor_log_content(run_id, log_name, workspace) # Save the editor log - workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(run_id, workspace), log_name)) + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(run_id, workspace), log_name), + f'({run_id}){log_name}') if return_code == 0: # No need to scrap the output, as all the tests have passed for test_spec in test_spec_list: From 8c6cc2ea046140219934819aafa7799861686b39 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 12:49:10 -0800 Subject: [PATCH 259/620] Removes EditorGradientComponentBase.cpp from Gems/GradientSignal Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/Gestures/Code/gestures_test_files.cmake | 1 - .../Editor/EditorGradientComponentBase.cpp | 16 ---------------- .../Code/gradientsignal_editor_files.cmake | 1 - 3 files changed, 18 deletions(-) delete mode 100644 Gems/GradientSignal/Code/Source/Editor/EditorGradientComponentBase.cpp diff --git a/Gems/Gestures/Code/gestures_test_files.cmake b/Gems/Gestures/Code/gestures_test_files.cmake index 26667e96e2..c3b648b55d 100644 --- a/Gems/Gestures/Code/gestures_test_files.cmake +++ b/Gems/Gestures/Code/gestures_test_files.cmake @@ -11,5 +11,4 @@ set(FILES Tests/GestureRecognizerClickOrTapTests.cpp Tests/GestureRecognizerPinchTests.cpp Tests/GesturesTest.cpp - Mocks/IRecognizerMock.h ) diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorGradientComponentBase.cpp b/Gems/GradientSignal/Code/Source/Editor/EditorGradientComponentBase.cpp deleted file mode 100644 index 9edfd92c3a..0000000000 --- a/Gems/GradientSignal/Code/Source/Editor/EditorGradientComponentBase.cpp +++ /dev/null @@ -1,16 +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 - * - */ - -#include - -#include -#include - -namespace GradientSignal -{ -} //namespace GradientSignal diff --git a/Gems/GradientSignal/Code/gradientsignal_editor_files.cmake b/Gems/GradientSignal/Code/gradientsignal_editor_files.cmake index 787b767002..3470fa6b87 100644 --- a/Gems/GradientSignal/Code/gradientsignal_editor_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_editor_files.cmake @@ -21,7 +21,6 @@ set(FILES Source/Editor/EditorConstantGradientComponent.h Source/Editor/EditorDitherGradientComponent.cpp Source/Editor/EditorDitherGradientComponent.h - Source/Editor/EditorGradientComponentBase.cpp Source/Editor/EditorGradientSurfaceDataComponent.cpp Source/Editor/EditorGradientSurfaceDataComponent.h Source/Editor/EditorGradientTransformComponent.cpp From 78ae3fdb805733266ae0a644b8ab1305d9f93a2c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 14:19:05 -0800 Subject: [PATCH 260/620] Removes tools.cpp from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/GraphCanvas/Code/Source/tools.cpp | 85 ------------------- Gems/GraphCanvas/Code/graphcanvas_files.cmake | 1 - 2 files changed, 86 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/Source/tools.cpp diff --git a/Gems/GraphCanvas/Code/Source/tools.cpp b/Gems/GraphCanvas/Code/Source/tools.cpp deleted file mode 100644 index 79d32dbf5e..0000000000 --- a/Gems/GraphCanvas/Code/Source/tools.cpp +++ /dev/null @@ -1,85 +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 - * - */ - -#include - -#include -#include -#include - -#include - -////////// -// Tools -////////// - -QDebug operator<<(QDebug debug, const AZ::Entity* entity) -{ - QDebugStateSaver saver(debug); - if (!entity) - { - debug.nospace() << "Entity(nullptr)"; - return debug; - } - - const AZStd::string id = entity->GetId().ToString(); - const AZStd::string& name = entity->GetName(); - - QString state; - switch (entity->GetState()) - { - case AZ::Entity::State::Init: - state = "ES_INIT"; - break; - case AZ::Entity::State::Constructed: - state = "ES_CONSTRUCTED"; - break; - case AZ::Entity::State::Active: - state = "ES_ACTIVE"; - break; - default: - state = "ES_BAD_STATE"; - break; - } - - debug.nospace() << "Entity(" << QString(id.c_str()) << ", " << state << ", \"" << QString(name.c_str()) << "\")"; - - return debug; -} - -QDebug operator<<(QDebug debug, const AZ::EntityId& entity) -{ - const AZ::Entity* actual = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(actual, &AZ::ComponentApplicationRequests::FindEntity, entity); - - return operator<<(debug, actual); -} - -QDebug operator<<(QDebug debug, const AZ::Component* component) -{ - QDebugStateSaver saver(debug); - if (!component) - { - debug.nospace() << "Component(nullptr)"; - return debug; - } - - std::ostringstream converter; - converter << std::hex << component->GetId(); - - debug.nospace() << "Component(" << QString::fromStdString(converter.str()) << " {" << component->GetEntity() << "})"; - - return debug; -} - -QDebug operator<<(QDebug debug, const AZ::Vector2& position) -{ - QDebugStateSaver saver(debug); - debug.nospace() << "Vector2(" << position.GetX() << ", " << position.GetY() << ")"; - return debug; -} diff --git a/Gems/GraphCanvas/Code/graphcanvas_files.cmake b/Gems/GraphCanvas/Code/graphcanvas_files.cmake index cf586e16ac..8ba9fd3073 100644 --- a/Gems/GraphCanvas/Code/graphcanvas_files.cmake +++ b/Gems/GraphCanvas/Code/graphcanvas_files.cmake @@ -16,7 +16,6 @@ set(FILES Source/GraphCanvas.h Source/GraphCanvasModule.h Source/GraphCanvasEditorModule.cpp - Source/tools.cpp Source/Components/BookmarkManagerComponent.cpp Source/Components/BookmarkManagerComponent.h Source/Components/GeometryComponent.cpp From 640f4980cd2c664233bcfe3def857e169ca2ac5d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 14:21:00 -0800 Subject: [PATCH 261/620] Removes VariableReferenceNodePropertyDisplay.h/cpp from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../VariableReferenceNodePropertyDisplay.cpp | 420 ------------------ .../VariableReferenceNodePropertyDisplay.h | 159 ------- 2 files changed, 579 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.cpp delete mode 100644 Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.h diff --git a/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.cpp b/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.cpp deleted file mode 100644 index 2d8ff18c3a..0000000000 --- a/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.cpp +++ /dev/null @@ -1,420 +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 - * - */ - -#include - -#include - -#include -#include -#include - -namespace GraphCanvas -{ - ////////////////////// - // VariableItemModel - ////////////////////// - - VariableItemModel::VariableItemModel() - { - } - - VariableItemModel::~VariableItemModel() - { - } - - int VariableItemModel::rowCount(const QModelIndex& parent) const - { - return static_cast(m_variableIds.size()); - } - - QVariant VariableItemModel::data(const QModelIndex& index, int role) const - { - int row = index.row(); - AZ::EntityId variableId = FindVariableIdForRow(row); - - if (variableId.IsValid()) - { - switch (role) - { - case Qt::DisplayRole: - { - AZStd::string variableName; - VariableRequestBus::EventResult(variableName, variableId, &VariableRequests::GetVariableName); - return QString(variableName.c_str()); - } - case Qt::EditRole: - { - AZStd::string variableName; - VariableRequestBus::EventResult(variableName, variableId, &VariableRequests::GetVariableName); - return QString(variableName.c_str()); - } - default: - break; - } - } - else - { - switch (role) - { - case Qt::DisplayRole: - { - return QString("Unreferenced"); - } - case Qt::EditRole: - { - return QString("Unreferenced"); - } - default: - break; - } - } - - return QVariant(); - } - - QVariant VariableItemModel::headerData(int section, Qt::Orientation orientation, int role) const - { - return QVariant(); - } - - Qt::ItemFlags VariableItemModel::flags(const QModelIndex& index) const - { - return Qt::ItemFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); - } - - void VariableItemModel::SetSceneId(const AZ::EntityId& sceneId) - { - m_sceneId = sceneId; - } - - void VariableItemModel::SetDataType(const AZ::Uuid& variableType) - { - if (m_dataType != variableType) - { - m_dataType = variableType; - } - } - - void VariableItemModel::RefreshData() - { - layoutAboutToBeChanged(); - ClearData(); - - m_variableIds.emplace_back(AZ::EntityId()); - - if (m_dataType == AZStd::any::TYPEINFO_Uuid()) - { - SceneVariableRequestBus::EnumerateHandlersId(m_sceneId, [this](SceneVariableRequests* variableRequests) - { - m_variableIds.emplace_back(variableRequests->GetVariableId()); - return true; - }); - } - else - { - SceneVariableRequestBus::EnumerateHandlersId(m_sceneId, [this](SceneVariableRequests* variableRequests) - { - AZ::EntityId variableId = variableRequests->GetVariableId(); - AZ::Uuid dataType; - VariableRequestBus::EventResult(dataType, variableId, &VariableRequests::GetDataType); - - if (dataType == m_dataType) - { - m_variableIds.emplace_back(variableRequests->GetVariableId()); - } - return true; - }); - } - - layoutChanged(); - } - - void VariableItemModel::ClearData() - { - layoutAboutToBeChanged(); - m_variableIds.clear(); - layoutChanged(); - } - - int VariableItemModel::FindRowForVariable(const AZ::EntityId& variableId) const - { - int row = -1; - - for (int i = 0; i < static_cast(m_variableIds.size()); ++i) - { - if (m_variableIds[i] == variableId) - { - row = i; - break; - } - } - - return row; - } - - AZ::EntityId VariableItemModel::FindVariableIdForRow(int row) const - { - if (row >= 0 && row < m_variableIds.size()) - { - return m_variableIds[row]; - } - - return AZ::EntityId(); - } - - AZ::EntityId VariableItemModel::FindVariableIdForName(const AZStd::string& variableName) const - { - AZ::EntityId variableId; - - QString lowerName = QString(variableName.c_str()).toLower(); - - GraphCanvas::SceneVariableRequestBus::EnumerateHandlersId(m_sceneId, [&lowerName, &variableId](GraphCanvas::SceneVariableRequests* sceneVariable) - { - AZ::EntityId testId = sceneVariable->GetVariableId(); - - AZStd::string testName; - GraphCanvas::VariableRequestBus::EventResult(testName, testId, &GraphCanvas::VariableRequests::GetVariableName); - - QString lowerTextName = QString(testName.c_str()).toLower(); - - if (lowerTextName.compare(lowerName) == 0) - { - variableId = testId; - } - - return !variableId.IsValid(); - }); - - return variableId; - } - - //////////////////////////// - // VariableSelectionWidget - //////////////////////////// - - VariableSelectionWidget::VariableSelectionWidget() - : QWidget(nullptr) - , m_lineEdit(aznew Internal::FocusableLineEdit()) - , m_itemModel(aznew VariableItemModel()) - { - m_completer = new QCompleter(m_itemModel, this); - m_completer->setCaseSensitivity(Qt::CaseInsensitive); - m_completer->setCompletionMode(QCompleter::InlineCompletion); - - m_lineEdit->setCompleter(m_completer); - m_lineEdit->setPlaceholderText("Select Variable..."); - - m_layout = new QVBoxLayout(this); - m_layout->addWidget(m_lineEdit); - - setContentsMargins(0, 0, 0, 0); - m_layout->setContentsMargins(0, 0, 0, 0); - - setLayout(m_layout); - - QObject::connect(m_lineEdit, &Internal::FocusableLineEdit::OnFocusIn, this, &VariableSelectionWidget::HandleFocusIn); - QObject::connect(m_lineEdit, &Internal::FocusableLineEdit::OnFocusOut, this, &VariableSelectionWidget::HandleFocusOut); - QObject::connect(m_lineEdit, &Internal::FocusableLineEdit::returnPressed, this, &VariableSelectionWidget::SubmitName); - } - - VariableSelectionWidget::~VariableSelectionWidget() - { - } - - void VariableSelectionWidget::SetSceneId(const AZ::EntityId& sceneId) - { - m_itemModel->SetSceneId(sceneId); - } - - void VariableSelectionWidget::SetDataType(const AZ::Uuid& dataType) - { - m_itemModel->SetDataType(dataType); - } - - void VariableSelectionWidget::OnEscape() - { - SetSelectedVariable(m_initialVariable); - m_lineEdit->selectAll(); - } - - void VariableSelectionWidget::HandleFocusIn() - { - m_itemModel->RefreshData(); - emit OnFocusIn(); - - AzToolsFramework::EditorEvents::Bus::Handler::BusConnect(); - } - - void VariableSelectionWidget::HandleFocusOut() - { - m_itemModel->ClearData(); - emit OnFocusOut(); - - SetSelectedVariable(m_initialVariable); - - AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect(); - } - - void VariableSelectionWidget::SubmitName() - { - AZStd::string variableName = m_lineEdit->text().toUtf8().data(); - AZ::EntityId variableId = m_itemModel->FindVariableIdForName(variableName); - - if (variableId.IsValid()) - { - SetSelectedVariable(variableId); - m_lineEdit->selectAll(); - } - else - { - QSignalBlocker block(m_lineEdit); - m_lineEdit->setText(""); - } - - emit OnVariableSelected(variableId); - } - - void VariableSelectionWidget::SetSelectedVariable(const AZ::EntityId& variableId) - { - QSignalBlocker blocker(m_lineEdit); - - AZStd::string variableName; - VariableRequestBus::EventResult(variableName, variableId, &VariableRequests::GetVariableName); - - m_lineEdit->setText(variableName.c_str()); - - m_initialVariable = variableId; - } - - ///////////////////////////////////////// - // VariableReferenceNodePropertyDisplay - ///////////////////////////////////////// - - VariableReferenceNodePropertyDisplay::VariableReferenceNodePropertyDisplay(VariableReferenceDataInterface* dataInterface) - : m_variableReferenceDataInterface(dataInterface) - { - m_variableReferenceDataInterface->RegisterDisplay(this); - - m_disabledLabel = aznew GraphCanvasLabel(); - m_displayLabel = aznew GraphCanvasLabel(); - - m_proxyWidget = new QGraphicsProxyWidget(); - - m_variableSelectionWidget = aznew VariableSelectionWidget(); - m_variableSelectionWidget->setProperty("HasNoWindowDecorations", true); - - m_proxyWidget->setWidget(m_variableSelectionWidget); - - m_variableSelectionWidget->SetDataType(dataInterface->GetVariableDataType()); - - QObject::connect(m_variableSelectionWidget, &VariableSelectionWidget::OnFocusIn, [this]() { EditStart(); }); - QObject::connect(m_variableSelectionWidget, &VariableSelectionWidget::OnFocusOut, [this]() { EditFinished(); }); - QObject::connect(m_variableSelectionWidget, &VariableSelectionWidget::OnVariableSelected, [this](const AZ::EntityId& variableId) { AssignVariable(variableId); }); - - RegisterShortcutDispatcher(m_variableSelectionWidget); - } - - VariableReferenceNodePropertyDisplay::~VariableReferenceNodePropertyDisplay() - { - delete m_variableReferenceDataInterface; - - delete m_disabledLabel; - delete m_displayLabel; - } - - void VariableReferenceNodePropertyDisplay::RefreshStyle() - { - m_disabledLabel->SetSceneStyle(GetSceneId(), NodePropertyDisplay::CreateDisabledLabelStyle("variable").c_str()); - m_displayLabel->SetSceneStyle(GetSceneId(), NodePropertyDisplay::CreateDisplayLabelStyle("variable").c_str()); - - m_variableSelectionWidget->setMinimumSize(m_displayLabel->GetStyleHelper().GetMinimumSize().toSize()); - } - - void VariableReferenceNodePropertyDisplay::UpdateDisplay() - { - VariableNotificationBus::Handler::BusDisconnect(); - - AZ::EntityId variableId = m_variableReferenceDataInterface->GetVariableReference(); - - DisplayVariableString(variableId); - - m_variableSelectionWidget->SetSelectedVariable(variableId); - - if (variableId.IsValid()) - { - VariableNotificationBus::Handler::BusConnect(variableId); - } - } - - QGraphicsLayoutItem* VariableReferenceNodePropertyDisplay::GetDisabledGraphicsLayoutItem() const - { - return m_disabledLabel; - } - - QGraphicsLayoutItem* VariableReferenceNodePropertyDisplay::GetDisplayGraphicsLayoutItem() const - { - return m_displayLabel; - } - - QGraphicsLayoutItem* VariableReferenceNodePropertyDisplay::GetEditableGraphicsLayoutItem() const - { - return m_proxyWidget; - } - - void VariableReferenceNodePropertyDisplay::OnNameChanged() - { - AZ::EntityId variableId = m_variableReferenceDataInterface->GetVariableReference(); - - DisplayVariableString(variableId); - } - - void VariableReferenceNodePropertyDisplay::OnVariableActivated() - { - AZ::EntityId variableId = m_variableReferenceDataInterface->GetVariableReference(); - - DisplayVariableString(variableId); - } - - void VariableReferenceNodePropertyDisplay::OnIdSet() - { - m_variableSelectionWidget->SetSceneId(GetSceneId()); - } - - void VariableReferenceNodePropertyDisplay::DisplayVariableString(const AZ::EntityId& variableId) - { - AZStd::string variableName = "Select Variable"; - - if (variableId.IsValid()) - { - VariableRequestBus::EventResult(variableName, variableId, &VariableRequests::GetVariableName); - } - - m_displayLabel->SetLabel(variableName.c_str()); - } - - void VariableReferenceNodePropertyDisplay::EditStart() - { - NodePropertiesRequestBus::Event(GetNodeId(), &NodePropertiesRequests::LockEditState, this); - TryAndSelectNode(); - } - - void VariableReferenceNodePropertyDisplay::AssignVariable(const AZ::EntityId& variableId) - { - m_variableReferenceDataInterface->AssignVariableReference(variableId); - DisplayVariableString(m_variableReferenceDataInterface->GetVariableReference()); - } - - void VariableReferenceNodePropertyDisplay::EditFinished() - { - UpdateDisplay(); - NodePropertiesRequestBus::Event(GetNodeId(), &NodePropertiesRequests::UnlockEditState, this); - } - -#include -} diff --git a/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.h b/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.h deleted file mode 100644 index 0dba76b674..0000000000 --- a/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.h +++ /dev/null @@ -1,159 +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 - * - */ -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include -#include -#endif - -namespace GraphCanvas -{ - class GraphCanvasLabel; - - // TODO: Make this into a single static instance that gets updated for each scene - // rather then a 1:1 relationship with the number of variable elements we have. - class VariableItemModel - : public QAbstractListModel - { - public: - AZ_CLASS_ALLOCATOR(VariableItemModel, AZ::SystemAllocator, 0); - - VariableItemModel(); - ~VariableItemModel() override; - - // QAstractListModel - int rowCount(const QModelIndex& parent) const override; - QVariant data(const QModelIndex& index, int role) const override; - - QVariant headerData(int section, Qt::Orientation orientation, int role) const override; - - Qt::ItemFlags flags(const QModelIndex& index) const override; - //// - - void SetSceneId(const AZ::EntityId& sceneId); - void SetDataType(const AZ::Uuid& variableType); - void RefreshData(); - void ClearData(); - - int FindRowForVariable(const AZ::EntityId& variableId) const; - AZ::EntityId FindVariableIdForRow(int row) const; - AZ::EntityId FindVariableIdForName(const AZStd::string& variableName) const; - - private: - - AZ::EntityId m_sceneId; - - AZ::Uuid m_dataType; - AZStd::vector< AZ::EntityId > m_variableIds; - }; - - class VariableSelectionWidget - : public QWidget - , public AzToolsFramework::EditorEvents::Bus::Handler - { - Q_OBJECT - - public: - AZ_CLASS_ALLOCATOR(VariableSelectionWidget, AZ::SystemAllocator, 0); - - VariableSelectionWidget(); - ~VariableSelectionWidget(); - - void SetSceneId(const AZ::EntityId& sceneId); - void SetDataType(const AZ::Uuid& dataType); - void SetSelectedVariable(const AZ::EntityId& variableId); - - // AzToolsFramework::EditorEvents::Bus - void OnEscape() override; - //// - - public slots: - - // Line Edit - void HandleFocusIn(); - void HandleFocusOut(); - void SubmitName(); - - signals: - - void OnFocusIn(); - void OnFocusOut(); - - void OnVariableSelected(const AZ::EntityId& variableId); - - private: - - Internal::FocusableLineEdit* m_lineEdit; - VariableItemModel* m_itemModel; - - QCompleter* m_completer; - - QVBoxLayout* m_layout; - - AZ::EntityId m_initialVariable; - }; - - class VariableReferenceNodePropertyDisplay - : public NodePropertyDisplay - , public VariableNotificationBus::Handler - { - public: - AZ_CLASS_ALLOCATOR(VariableReferenceNodePropertyDisplay, AZ::SystemAllocator, 0); - VariableReferenceNodePropertyDisplay(VariableReferenceDataInterface* dataInterface); - ~VariableReferenceNodePropertyDisplay() override; - - // NodePropertyDisplay - void RefreshStyle() override; - void UpdateDisplay() override; - - QGraphicsLayoutItem* GetDisabledGraphicsLayoutItem() const override; - QGraphicsLayoutItem* GetDisplayGraphicsLayoutItem() const override; - QGraphicsLayoutItem* GetEditableGraphicsLayoutItem() const override; - //// - - // VariableNotificationBus - void OnNameChanged() override; - void OnVariableActivated() override; - //// - - private: - - // NodePropertyDisplay - void OnIdSet() override; - //// - - void DisplayVariableString(const AZ::EntityId& variableId); - - void EditStart(); - void AssignVariable(const AZ::EntityId& variableId); - void EditFinished(); - - VariableReferenceDataInterface* m_variableReferenceDataInterface; - - GraphCanvasLabel* m_disabledLabel; - GraphCanvasLabel* m_displayLabel; - - QGraphicsProxyWidget* m_proxyWidget; - VariableSelectionWidget* m_variableSelectionWidget; - }; -} From 886a9631c7d29141d13787ed466e94d32d200495 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 15:08:51 -0800 Subject: [PATCH 262/620] Removes CommentLayerControllerComponent from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Nodes/Comment/CommentLayerControllerComponent.cpp | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/Source/Components/Nodes/Comment/CommentLayerControllerComponent.cpp diff --git a/Gems/GraphCanvas/Code/Source/Components/Nodes/Comment/CommentLayerControllerComponent.cpp b/Gems/GraphCanvas/Code/Source/Components/Nodes/Comment/CommentLayerControllerComponent.cpp deleted file mode 100644 index 708520fe9d..0000000000 --- a/Gems/GraphCanvas/Code/Source/Components/Nodes/Comment/CommentLayerControllerComponent.cpp +++ /dev/null @@ -1,9 +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 - * - */ - -#include From 592a7dd9b3aba46fe4a191185bbaff775433c95e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 15:10:14 -0800 Subject: [PATCH 263/620] Removes DoubleDataInterface from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../NodePropertyDisplay/DoubleDataInterface.h | 37 ------------------- .../StaticLib/GraphCanvas/GraphCanvasBus.h | 2 +- .../Code/graphcanvas_staticlib_files.cmake | 1 - .../Integration/FloatDataInterface.h | 3 -- 4 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/DoubleDataInterface.h diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/DoubleDataInterface.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/DoubleDataInterface.h deleted file mode 100644 index 8c552a331f..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/DoubleDataInterface.h +++ /dev/null @@ -1,37 +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 - * - */ -#pragma once - -#include "DataInterface.h" -#include "NumericDataInterface.h" - -namespace GraphCanvas -{ - // Deprecated name for the NumericDataInterface - class DoubleDataInterface - : public NumericDataInterface - { - public: - AZ_DEPRECATED(DoubleDataInterface(), "DoubleDataInterface renamed to NumericDataInterface") - { - } - - virtual double GetDouble() const = 0; - virtual void SetDouble(double value) = 0; - - double GetNumber() const override final - { - return GetDouble(); - } - - void SetNumber(double value) override final - { - SetDouble(value); - } - }; -} diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/GraphCanvasBus.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/GraphCanvasBus.h index 0b09cb5cee..8791ec7c1f 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/GraphCanvasBus.h +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/GraphCanvasBus.h @@ -135,7 +135,7 @@ namespace GraphCanvas //! The PropertyDisplay will take ownership of the DataInterface virtual NodePropertyDisplay* CreateBooleanNodePropertyDisplay(BooleanDataInterface* dataInterface) const = 0; - //! Creates a DoubleNodeProperty display using the specified DoubleDataInterface + //! Creates a DoubleNodeProperty display using the specified NumericDataInterface //! param: dataInterface is the interface to local data to be used in the operation of the NodePropertyDisplay. //! The PropertyDisplay will take ownership of the DataInterface virtual NodePropertyDisplay* CreateNumericNodePropertyDisplay(NumericDataInterface* dataInterface) const = 0; diff --git a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake index 455b5673d3..ad26ac09d8 100644 --- a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake +++ b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake @@ -50,7 +50,6 @@ set(FILES StaticLib/GraphCanvas/Components/NodePropertyDisplay/BooleanDataInterface.h StaticLib/GraphCanvas/Components/NodePropertyDisplay/ComboBoxDataInterface.h StaticLib/GraphCanvas/Components/NodePropertyDisplay/DataInterface.h - StaticLib/GraphCanvas/Components/NodePropertyDisplay/DoubleDataInterface.h StaticLib/GraphCanvas/Components/NodePropertyDisplay/EntityIdDataInterface.h StaticLib/GraphCanvas/Components/NodePropertyDisplay/NodePropertyDisplay.cpp StaticLib/GraphCanvas/Components/NodePropertyDisplay/NodePropertyDisplay.h diff --git a/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h b/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h index cfd40cecdf..66c0f57fe4 100644 --- a/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h +++ b/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h @@ -8,9 +8,6 @@ #pragma once -// Graph Canvas -#include - // Graph Model #include From f2869463773d3894b67fd61abdbac77b0f14d938 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 15:21:19 -0800 Subject: [PATCH 264/620] Removes VariableDataInterface.h from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../VariableDataInterface.h | 27 ------------------- .../GraphCanvas/NodeDescriptorBus.h | 1 - 2 files changed, 28 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/VariableDataInterface.h diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/VariableDataInterface.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/VariableDataInterface.h deleted file mode 100644 index 967f332fa6..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/VariableDataInterface.h +++ /dev/null @@ -1,27 +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 - * - */ -#pragma once - -#include "DataInterface.h" - -namespace GraphCanvas -{ - class VariableReferenceDataInterface - : public DataInterface - { - public: - // Returns the Uuid that represents the varaible assigned to this value. - virtual AZ::Uuid GetVariableReference() const = 0; - - // Sets the entity reference that - virtual void AssignVariableReference(const AZ::Uuid& variableId) = 0; - - // Returns the type of variable that should be assigned to this value. - virtual AZ::Uuid GetVariableDataType() const = 0; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h index f5fc8f4292..8fa81b7f5a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h @@ -27,7 +27,6 @@ namespace GraphCanvas { class StringDataInterface; - class VariableReferenceDataInterface; } namespace ScriptCanvasEditor From 7292fea50fc536f064d58add78ce2f18edf6e328 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 15:23:42 -0800 Subject: [PATCH 265/620] Removes VariableNodeBus.h from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Nodes/Variable/VariableNodeBus.h | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/Nodes/Variable/VariableNodeBus.h diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/Nodes/Variable/VariableNodeBus.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/Nodes/Variable/VariableNodeBus.h deleted file mode 100644 index 59a531a117..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/Nodes/Variable/VariableNodeBus.h +++ /dev/null @@ -1,55 +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 - * - */ -#pragma once - -#include -#include - -#include - -class QGraphicsLayoutItem; -class QMimeData; - -namespace GraphCanvas -{ - namespace Deprecated - { - //! SceneVariableRequestBus - //! Requests to be made about variables in a particular scene. - class SceneVariableRequests : public AZ::EBusTraits - { - public: - // The BusId here is the SceneId of the scene that contains the variable. - // - // Should mainly be used with enumeration for collecting information and not as a way of directly interacting - // with variables inside of a particular scene. - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::EntityId; - - virtual AZ::EntityId GetVariableId() const = 0; - }; - - using SceneVariableRequestBus = AZ::EBus; - - //! VariableRequestBus - //! Requests to be made about a particular variable. - class VariableRequests : public AZ::EBusTraits - { - public: - // The BusId here is the VariableId of the variable that information is required about. - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::EntityId; - - virtual AZStd::string GetVariableName() const = 0; - virtual AZ::Uuid GetDataType() const = 0; - virtual AZStd::string GetDataTypeDisplayName() const = 0; - }; - - using VariableRequestBus = AZ::EBus; - } -} From 504009a63ba79745263ec694ef4230442b15abf0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 15:44:25 -0800 Subject: [PATCH 266/620] Removes definitions.cpp from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/StaticLib/GraphCanvas/Styling/Parser.cpp | 4 ++-- .../StaticLib/GraphCanvas/Styling/definitions.cpp | 15 --------------- .../Code/graphcanvas_staticlib_files.cmake | 1 - 3 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/definitions.cpp diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/Parser.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/Parser.cpp index 5d15c9fcd0..8cfb81715a 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/Parser.cpp +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/Parser.cpp @@ -47,7 +47,7 @@ namespace const QRegularExpression invalidStart(R"_(^\s*>\s*)_"); const QRegularExpression invalidEnd(R"_(\s*>\s*$)_"); const QRegularExpression splitNesting(R"_(\s*>\s*)_"); - const QRegularExpression selector(R"_(^(?:(?:(\w+)?(\.\w+)?)|(#\w+)?)(:\w+)?$)_"); + const QRegularExpression s_selectorRegex(R"_(^(?:(?:(\w+)?(\.\w+)?)|(#\w+)?)(:\w+)?$)_"); AZStd::string QtToAz(const QString& source) { @@ -1013,7 +1013,7 @@ namespace GraphCanvas nestedSelectors.reserve(parts.size()); for (const QString& part : parts) { - auto matches = selector.match(part); + auto matches = s_selectorRegex.match(part); if (!matches.hasMatch()) { qWarning() << "Invalid selector:" << part << "in" << candidate; diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/definitions.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/definitions.cpp deleted file mode 100644 index f8ba5ffab3..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/definitions.cpp +++ /dev/null @@ -1,15 +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 - * - */ - -#include -#include - -int LinkerWarningWorkaround() -{ - return 0; -} diff --git a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake index ad26ac09d8..9572219a13 100644 --- a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake +++ b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake @@ -76,7 +76,6 @@ set(FILES StaticLib/GraphCanvas/Editor/EditorTypes.h StaticLib/GraphCanvas/Editor/GraphCanvasProfiler.h StaticLib/GraphCanvas/Editor/GraphModelBus.h - StaticLib/GraphCanvas/Styling/definitions.cpp StaticLib/GraphCanvas/Styling/definitions.h StaticLib/GraphCanvas/Styling/PseudoElement.cpp StaticLib/GraphCanvas/Styling/PseudoElement.h From 0f59718ff07f548b2a53e962766eb778589cec9b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 14:59:09 -0800 Subject: [PATCH 267/620] Removes CommentConstructMenuActions.cpp/h from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../CommentConstructMenuActions.cpp | 55 ------------------- .../CommentConstructMenuActions.h | 26 --------- .../GraphCanvasConstructActionsMenuGroup.cpp | 1 - .../Code/graphcanvas_staticlib_files.cmake | 2 - 4 files changed, 84 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.cpp delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.h diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.cpp deleted file mode 100644 index d07ec91a3f..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.cpp +++ /dev/null @@ -1,55 +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 - * - */ -#include - -#include -#include -#include -#include - -#include - - -namespace GraphCanvas -{ - ///////////////////////// - // AddCommentMenuAction - ///////////////////////// - - AddCommentMenuAction::AddCommentMenuAction(QObject* parent) - : ConstructContextMenuAction("Add comment", parent) - { - } - - ContextMenuAction::SceneReaction AddCommentMenuAction::TriggerAction(const AZ::Vector2& scenePos) - { - const GraphId& graphId = GetGraphId(); - - SceneRequestBus::Event(graphId, &SceneRequests::ClearSelection); - - AZ::Entity* graphCanvasEntity = nullptr; - GraphCanvasRequestBus::BroadcastResult(graphCanvasEntity, &GraphCanvasRequests::CreateCommentNodeAndActivate); - - AZ_Assert(graphCanvasEntity, "Unable to create GraphCanvas Bus Node"); - - if (graphCanvasEntity) - { - SceneRequestBus::Event(graphId, &SceneRequests::AddNode, graphCanvasEntity->GetId(), scenePos, false); - CommentUIRequestBus::Event(graphCanvasEntity->GetId(), &CommentUIRequests::SetEditable, true); - } - - if (graphCanvasEntity != nullptr) - { - return SceneReaction::PostUndo; - } - else - { - return SceneReaction::Nothing; - } - } -} diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.h deleted file mode 100644 index 3c9c767619..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.h +++ /dev/null @@ -1,26 +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 - * - */ -#pragma once - -#include - -namespace GraphCanvas -{ - class AddCommentMenuAction - : public ConstructContextMenuAction - { - public: - AZ_CLASS_ALLOCATOR(AddCommentMenuAction, AZ::SystemAllocator, 0); - - AddCommentMenuAction(QObject* parent); - virtual ~AddCommentMenuAction() = default; - - using ConstructContextMenuAction::TriggerAction; - SceneReaction TriggerAction(const AZ::Vector2& scenePos) override; - }; -} diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/GraphCanvasConstructActionsMenuGroup.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/GraphCanvasConstructActionsMenuGroup.cpp index d075594ab0..e5a7cf8073 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/GraphCanvasConstructActionsMenuGroup.cpp +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/GraphCanvasConstructActionsMenuGroup.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include diff --git a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake index 9572219a13..eeba6ff4fb 100644 --- a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake +++ b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake @@ -144,8 +144,6 @@ set(FILES StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/AlignmentMenuActions/AlignmentContextMenuActions.h StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/BookmarkConstructMenuActions.cpp StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/BookmarkConstructMenuActions.h - StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.cpp - StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.h StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/ConstructContextMenuAction.h StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/ConstructPresetMenuActions.cpp StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/ConstructPresetMenuActions.h From 9ad837c952cf8dbdb235a5509502e827f013447c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 15:25:20 -0800 Subject: [PATCH 268/620] Removes SceneActionsMenuGroup.h/cpp from Gems/GraphCanvas Removes Resource.h from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Widgets/Bookmarks/BookmarkDockWidget.cpp | 1 - .../SceneActionsMenuGroup.cpp | 36 ------------------- .../SceneMenuActions/SceneActionsMenuGroup.h | 30 ---------------- .../GraphCanvas/Widgets/Resources/Resources.h | 10 ------ .../Code/graphcanvas_staticlib_files.cmake | 3 -- 5 files changed, 80 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.cpp delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.h delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Resources/Resources.h diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Bookmarks/BookmarkDockWidget.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Bookmarks/BookmarkDockWidget.cpp index 50e6be25e0..a68ed78ead 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Bookmarks/BookmarkDockWidget.cpp +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Bookmarks/BookmarkDockWidget.cpp @@ -19,7 +19,6 @@ #include #include #include -#include namespace { diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.cpp deleted file mode 100644 index 2160160f77..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.cpp +++ /dev/null @@ -1,36 +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 - * - */ -#include - -#include -#include - -namespace GraphCanvas -{ - ////////////////////////// - // SceneActionsMenuGroup - ////////////////////////// - - SceneActionsMenuGroup::SceneActionsMenuGroup(EditorContextMenu* contextMenu) - : m_removeUnusedNodesAction(nullptr) - { - contextMenu->AddActionGroup(SceneContextMenuAction::GetSceneContextMenuActionGroupId()); - - m_removeUnusedNodesAction = aznew RemoveUnusedNodesMenuAction(contextMenu); - contextMenu->AddMenuAction(m_removeUnusedNodesAction); - } - - SceneActionsMenuGroup::~SceneActionsMenuGroup() - { - } - - void SceneActionsMenuGroup::SetCleanUpGraphEnabled(bool enabled) - { - m_removeUnusedNodesAction->setEnabled(enabled); - } -} diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.h deleted file mode 100644 index f0c1d03419..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.h +++ /dev/null @@ -1,30 +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 - * - */ -#pragma once - -#include - -#include - -namespace GraphCanvas -{ - class SceneActionsMenuGroup - { - public: - AZ_CLASS_ALLOCATOR(SceneActionsMenuGroup, AZ::SystemAllocator, 0); - - SceneActionsMenuGroup(EditorContextMenu* contextMenu); - ~SceneActionsMenuGroup(); - - void SetCleanUpGraphEnabled(bool enabled); - - private: - - ContextMenuAction* m_removeUnusedNodesAction; - }; -} diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Resources/Resources.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Resources/Resources.h deleted file mode 100644 index 6a89627825..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Resources/Resources.h +++ /dev/null @@ -1,10 +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 - * - */ -#pragma once - - diff --git a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake index eeba6ff4fb..286391cf71 100644 --- a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake +++ b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake @@ -8,7 +8,6 @@ set(FILES StaticLib/GraphCanvas/Widgets/Resources/GraphCanvasEditorResources.qrc - StaticLib/GraphCanvas/Widgets/Resources/Resources.h StaticLib/GraphCanvas/Widgets/GraphCanvasMimeContainer.cpp StaticLib/GraphCanvas/Widgets/GraphCanvasMimeContainer.h StaticLib/GraphCanvas/Widgets/GraphCanvasMimeEvent.cpp @@ -174,8 +173,6 @@ set(FILES StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/NodeMenuActions/NodeContextMenuAction.h StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/NodeMenuActions/NodeContextMenuActions.cpp StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/NodeMenuActions/NodeContextMenuActions.h - StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.cpp - StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.h StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneContextMenuAction.h StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneContextMenuActions.cpp StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneContextMenuActions.h From 9a99d9b5ea5291fc214fbd1b19c8ec260062253d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 15:27:03 -0800 Subject: [PATCH 269/620] Removes ImGuiLYCurveEditor from Gems/ImGui Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Include/ImGuiLYCurveEditorBus.h | 27 ----------------- .../LYCommonMenu/ImGuiLYCurveEditor.cpp | 24 --------------- .../Source/LYCommonMenu/ImGuiLYCurveEditor.h | 29 ------------------- Gems/ImGui/Code/imgui_game_files.cmake | 3 -- 4 files changed, 83 deletions(-) delete mode 100644 Gems/ImGui/Code/Include/ImGuiLYCurveEditorBus.h delete mode 100644 Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.cpp delete mode 100644 Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.h diff --git a/Gems/ImGui/Code/Include/ImGuiLYCurveEditorBus.h b/Gems/ImGui/Code/Include/ImGuiLYCurveEditorBus.h deleted file mode 100644 index f764e56b58..0000000000 --- a/Gems/ImGui/Code/Include/ImGuiLYCurveEditorBus.h +++ /dev/null @@ -1,27 +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 - * - */ - -#pragma once - -#include - -namespace ImGui -{ - /// Bus for sending events and getting state from the ImGui manager. - class IImGuiCurveEditorRequests : public AZ::EBusTraits - { - public: - static const char* GetUniqueName() { return "IImGuiCurveEditorRequests"; } - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - using Bus = AZ::EBus; - }; - - using ImGuiCurveEditorRequestBus = AZ::EBus; - -} // namespace ImGui diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.cpp b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.cpp deleted file mode 100644 index e61ba25e9c..0000000000 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.cpp +++ /dev/null @@ -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 - * - */ - -#include "ImGuiLYCurveEditor.h" - -#ifdef IMGUI_ENABLED - -namespace ImGui -{ - ImGuiCurveEditor::~ImGuiCurveEditor() - { - } - - void ImGuiCurveEditor::CreateCurveEditor(const char * label, float * points, int num_points, int max_points) - { - } -} // namespace ImGui - -#endif diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.h b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.h deleted file mode 100644 index 6c7c0f5c90..0000000000 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.h +++ /dev/null @@ -1,29 +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 - * - */ - -#pragma once -#include "ImGuiManager.h" - -#ifdef IMGUI_ENABLED -#include "ImGuiLYCurveEditorBus.h" -#include -#include - -namespace ImGui -{ - class ImGuiCurveEditor - : public ImGuiCurveEditorRequestBus::Handler - { - ImGuiCurveEditor(); - ~ImGuiCurveEditor(); - - void CreateCurveEditor(const char* label, float* points, int num_points, int max_points); - - }; -} -#endif // IMGUI_ENABLED diff --git a/Gems/ImGui/Code/imgui_game_files.cmake b/Gems/ImGui/Code/imgui_game_files.cmake index 8b677c3041..8ebd25fb1a 100644 --- a/Gems/ImGui/Code/imgui_game_files.cmake +++ b/Gems/ImGui/Code/imgui_game_files.cmake @@ -8,7 +8,6 @@ set(FILES Include/ImGuiBus.h - Include/ImGuiLYCurveEditorBus.h Source/ImGuiGem.cpp Source/ImGuiColorDefines.h Source/ImGuiManager.h @@ -17,6 +16,4 @@ set(FILES Source/LYCommonMenu/ImGuiLYCommonMenu.cpp Source/LYCommonMenu/ImGuiLYEntityOutliner.h Source/LYCommonMenu/ImGuiLYEntityOutliner.cpp - Source/LYCommonMenu/ImGuiLYCurveEditor.h - Source/LYCommonMenu/ImGuiLYCurveEditor.cpp ) From 2dfdde0bb5f87dfd5c09553983da34f96d8fb0b6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 15:35:40 -0800 Subject: [PATCH 270/620] Removes LmbrCentral/Physics from Gems/LmbrCentral Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Editor/Translation/scriptcanvas_en_us.ts | 1018 ----------------- .../Physics/ForceVolumeRequestBus.h | 250 ---- .../Physics/WaterNotificationBus.h | 46 - .../Physics/WindVolumeRequestBus.h | 76 -- .../Code/lmbrcentral_headers_files.cmake | 3 - 5 files changed, 1393 deletions(-) delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Physics/ForceVolumeRequestBus.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WaterNotificationBus.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WindVolumeRequestBus.h diff --git a/Assets/Editor/Translation/scriptcanvas_en_us.ts b/Assets/Editor/Translation/scriptcanvas_en_us.ts index bfbd8cf316..5af338426c 100644 --- a/Assets/Editor/Translation/scriptcanvas_en_us.ts +++ b/Assets/Editor/Translation/scriptcanvas_en_us.ts @@ -69750,477 +69750,6 @@ The element is removed from its current parent and added as a child of the new p The name of the action triggered when the interactive element is released
- - EBus: ForceVolumeRequestBus - - FORCEVOLUMEREQUESTBUS_NAME - ForceVolumeRequestBus - - - FORCEVOLUMEREQUESTBUS_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_CATEGORY - Physics - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: SetAirDensity - SetAirDensity - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_PARAM0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: GetAirResistance - GetAirResistance - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUTPUT0_NAME - C++ Type: float - Number - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUTPUT0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: GetForceMassDependent - GetForceMassDependent - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_OUTPUT0_NAME - C++ Type: bool - Boolean - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_OUTPUT0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: SetAirResistance - SetAirResistance - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_PARAM0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: GetAirDensity - GetAirDensity - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_OUTPUT0_NAME - C++ Type: float - Number - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_OUTPUT0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: GetForceMode - GetForceMode - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_OUTPUT0_NAME - C++ Type: int - Number - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_OUTPUT0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: GetForceMagnitude - GetForceMagnitude - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_OUTPUT0_NAME - C++ Type: float - Number - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_OUTPUT0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: SetForceMode - SetForceMode - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_PARAM0_NAME - Simple Type: Number C++ Type: int - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_PARAM0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: SetForceMagnitude - SetForceMagnitude - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_PARAM0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: SetForceMassDependent - SetForceMassDependent - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_PARAM0_NAME - Simple Type: Boolean C++ Type: bool - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_PARAM0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: SetForceDirection - SetForceDirection - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_PARAM0_NAME - Simple Type: Vector3 C++ Type: const Vector3& - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_PARAM0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: GetForceDirection - GetForceDirection - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_OUTPUT0_NAME - C++ Type: const Vector3& - Vector3 - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_OUTPUT0_TOOLTIP - - - Handler: UiDraggableNotificationBus @@ -73260,553 +72789,6 @@ The element is removed from its current parent and added as a child of the new p The absolute position where the entity should spawn - - EBus: WindVolumeRequestBus - - WINDVOLUMEREQUESTBUS_NAME - Wind Volume - - - WINDVOLUMEREQUESTBUS_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_CATEGORY - Physics (Legacy) - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetVolumeSize - Get Volume Size - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_OUTPUT0_NAME - C++ Type: const Vector3& - Vector3 - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetAirResistance - Get Air Resistance - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUTPUT0_NAME - C++ Type: float - Number - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetAirResistance - Set Air Resistance - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_PARAM0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetAirDensity - Get Air Density - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_OUTPUT0_NAME - C++ Type: float - Number - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETSPEED_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetSpeed - Get Speed - - - WINDVOLUMEREQUESTBUS_GETSPEED_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETSPEED_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETSPEED_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETSPEED_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETSPEED_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETSPEED_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETSPEED_OUTPUT0_NAME - C++ Type: float - Number - - - WINDVOLUMEREQUESTBUS_GETSPEED_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetWindDirection - Set Wind Direction - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_PARAM0_NAME - Simple Type: Vector3 C++ Type: const Vector3& - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_PARAM0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetWindDirection - Get Wind Direction - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_OUTPUT0_NAME - C++ Type: const Vector3& - Vector3 - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETSPEED_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetSpeed - Set Speed - - - WINDVOLUMEREQUESTBUS_SETSPEED_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETSPEED_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETSPEED_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETSPEED_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETSPEED_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETSPEED_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETSPEED_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - WINDVOLUMEREQUESTBUS_SETSPEED_PARAM0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetVolumeSize - Set Volume Size - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_PARAM0_NAME - Simple Type: Vector3 C++ Type: const Vector3& - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_PARAM0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetEllipsoidal - Get Ellipsoidal - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_OUTPUT0_NAME - C++ Type: bool - Boolean - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetFalloffInner - Get Falloff Inner - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_OUTPUT0_NAME - C++ Type: float - Number - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetEllipsoidal - Set Ellipsoidal - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_PARAM0_NAME - Simple Type: Boolean C++ Type: bool - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_PARAM0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetFalloffInner - Set Falloff Inner - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_PARAM0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetAirDensity - Set Air Density - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_PARAM0_TOOLTIP - - - EBus: ActorComponentNotificationBus diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/ForceVolumeRequestBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/ForceVolumeRequestBus.h deleted file mode 100644 index 35a630c4ca..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/ForceVolumeRequestBus.h +++ /dev/null @@ -1,250 +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 - * - */ -#pragma once - -#include -#include -#include -#include -#include - -namespace LmbrCentral -{ - /** - * Parameters of an entity in the force volume. - * Used to calculate final force. - */ - struct EntityParams - { - AZ::EntityId m_id; - AZ::Vector3 m_position; - AZ::Vector3 m_velocity; - AZ::Aabb m_aabb; - float m_mass; - }; - - /** - * Parameters of the force volume. - * Used to calculate final force. - */ - struct VolumeParams - { - AZ::EntityId m_id; - AZ::Vector3 m_position; - AZ::Quaternion m_rotation; - AZ::SplinePtr m_spline; - AZ::Aabb m_aabb; - }; - - /** - * Represents a single force in the force volume. - * - * Developers should implement this interface and register - * their class with the EditContext to have their custom - * force appear in the ForceVolume dropdown box in the editor. - */ - class Force - { - public: - AZ_CLASS_ALLOCATOR(Force, AZ::SystemAllocator, 0); - AZ_RTTI(Force, "{9BD236BD-4580-4D6F-B02F-F8F431EBA593}"); - static void Reflect(AZ::SerializeContext& context) - { - context.Class(); - } - virtual ~Force() = default; - - /** - * Connect to any busses. - */ - virtual void Activate(AZ::EntityId /*entityId*/) {} - - /** - * Disconnect from any busses. - */ - virtual void Deactivate() {} - - /** - * Calculate the size and direction the force. - */ - virtual AZ::Vector3 CalculateForce(const EntityParams& /*entityParams*/, const VolumeParams& /*volumeParams*/) - { - return AZ::Vector3::CreateZero(); - } - }; - - /** - * Requests serviced by the WorldSpaceForce. - */ - class WorldSpaceForceRequests - : public AZ::ComponentBus - { - public: - /** - * @brief Sets the direction of the force in worldspace. - */ - virtual void SetDirection(const AZ::Vector3& direction) = 0; - - /** - * @brief Gets the direction of the force in world space. - */ - virtual const AZ::Vector3& GetDirection() = 0; - - /** - * @brief Sets the magnitude of the force. - */ - virtual void SetMagnitude(float magnitude) = 0; - - /** - * @brief Gets the magnitude of the force. - */ - virtual float GetMagnitude() = 0; - }; - - using WorldSpaceForceRequestBus = AZ::EBus; - - /** - * Requests serviced by the LocalSpaceForce. - */ - class LocalSpaceForceRequests - : public AZ::ComponentBus - { - public: - /** - * @brief Sets the direction of the force in localspace. - */ - virtual void SetDirection(const AZ::Vector3& direction) = 0; - - /** - * @brief Gets the direction of the force in local space. - */ - virtual const AZ::Vector3& GetDirection() = 0; - - /** - * @brief Sets the magnitude of the force. - */ - virtual void SetMagnitude(float magnitude) = 0; - - /** - * @brief Gets the magnitude of the force. - */ - virtual float GetMagnitude() = 0; - }; - - using LocalSpaceForceRequestBus = AZ::EBus; - - /** - * Requests serviced by the PointSpaceForce. - */ - class PointForceRequests - : public AZ::ComponentBus - { - public: - /** - * @brief Sets the magnitude of the force. - */ - virtual void SetMagnitude(float magnitude) = 0; - - /** - * @brief Gets the magnitude of the force. - */ - virtual float GetMagnitude() = 0; - }; - - using PointForceRequestBus = AZ::EBus; - - /** - * Requests serviced by the PointSpaceForce. - */ - class SplineFollowForceRequests - : public AZ::ComponentBus - { - public: - /** - * @brief Sets the damping ratio of the force. - */ - virtual void SetDampingRatio(float ratio) = 0; - - /** - * @brief Gets the damping ratio of the force. - */ - virtual float GetDampingRatio() = 0; - - /** - * @brief Sets the frequency of the force. - */ - virtual void SetFrequency(float frequency) = 0; - - /** - * @brief Gets the frequency of the force. - */ - virtual float GetFrequency() = 0; - - /** - * @brief Sets the traget speed of the force. - */ - virtual void SetTargetSpeed(float targetSpeed) = 0; - - /** - * @brief Gets the target speed of the force. - */ - virtual float GetTargetSpeed() = 0; - - /** - * @brief Sets the lookahead of the force. - */ - virtual void SetLookAhead(float lookAhead) = 0; - - /** - * @brief Gets the lookahead of the force. - */ - virtual float GetLookAhead() = 0; - }; - - using SplineFollowForceRequestBus = AZ::EBus; - - /** - * Requests serviced by the LocalSpaceForce. - */ - class SimpleDragForceRequests - : public AZ::ComponentBus - { - public: - /** - * @brief Sets the density of the volume. - */ - virtual void SetDensity(float density) = 0; - - /** - * @brief Gets the density of the volume. - */ - virtual float GetDensity() = 0; - }; - - using SimpleDragForceRequestBus = AZ::EBus; - - /** - * Requests serviced by the LocalSpaceForce. - */ - class LinearDampingForceRequests - : public AZ::ComponentBus - { - public: - /** - * @brief Sets the damping amount of the force. - */ - virtual void SetDamping(float damping) = 0; - - /** - * @brief Gets the damping amount of the force. - */ - virtual float GetDamping() = 0; - }; - - using LinearDampingForceRequestBus = AZ::EBus; -} diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WaterNotificationBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WaterNotificationBus.h deleted file mode 100644 index 8ad7b1aa8f..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WaterNotificationBus.h +++ /dev/null @@ -1,46 +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 - * - */ -#pragma once - -#include - -namespace AZ -{ - class Transform; -} - -namespace LmbrCentral -{ - /** - * Broadcasts change notifications from the water ocean and water volume components - */ - class WaterNotifications - : public AZ::EBusTraits - { - public: - //////////////////////////////////////////////////////////////////////// - // EBusTraits - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - //////////////////////////////////////////////////////////////////////// - - //! allows multiple threads to call - using MutexType = AZStd::recursive_mutex; - - //! Notifies when the height of the ocean changes - virtual void OceanHeightChanged([[maybe_unused]] float height) {} - - //! Notifies when a water volume is moved - virtual void WaterVolumeTransformChanged([[maybe_unused]] AZ::EntityId entityId, [[maybe_unused]] const AZ::Transform& worldTransform) {} - - //! Notifies when a water volume shape is changed - virtual void WaterVolumeShapeChanged([[maybe_unused]] AZ::EntityId entityId) {} - }; - - using WaterNotificationBus = AZ::EBus; -} diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WindVolumeRequestBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WindVolumeRequestBus.h deleted file mode 100644 index 4b814685d3..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WindVolumeRequestBus.h +++ /dev/null @@ -1,76 +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 - * - */ -#pragma once - -#include -#include - -namespace LmbrCentral -{ - /** - * Messages serviced by the WindVolumeComponent - */ - class WindVolumeRequests - : public AZ::ComponentBus - { - public: - /** - * Sets the falloff. Only affects the wind speed in the volume. A value of 0 will reduce the speed from the center towards the edge of the volume. - * A value of 1 or greater will have no effect. - */ - virtual void SetFalloff(float falloff) = 0; - - /** - * Gets the falloff. - */ - virtual float GetFalloff() = 0; - - /** - * Sets the speed of the wind. The air resistance must be non zero to affect physical objects. - */ - virtual void SetSpeed(float speed) = 0; - - /** - * Gets the speed of the wind. - */ - virtual float GetSpeed() = 0; - - /** - * Sets the air resistance causing objects moving through the volume to slow down. - */ - virtual void SetAirResistance(float airResistance) = 0; - - /** - * Gets the air resistance. - */ - virtual float GetAirResistance() = 0; - - /** - * Sets the density of the volume. - * Objects with lower density will experience a buoyancy force. Objects with higher density will sink. - */ - virtual void SetAirDensity(float airDensity) = 0; - - /** - * Gets the air density. - */ - virtual float GetAirDensity() = 0; - - /** - * Sets the direction the wind is blowing. If zero, then the direction is considered omnidirectional. - */ - virtual void SetWindDirection(const AZ::Vector3& direction) = 0; - - /** - * Gets the direction the wind is blowing. - */ - virtual const AZ::Vector3& GetWindDirection() = 0; - }; - - using WindVolumeRequestBus = AZ::EBus; -} diff --git a/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake b/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake index 270a46cf32..cd8f3eff21 100644 --- a/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake +++ b/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake @@ -27,9 +27,6 @@ set(FILES include/LmbrCentral/Dependency/DependencyMonitor.h include/LmbrCentral/Dependency/DependencyMonitor.inl include/LmbrCentral/Dependency/DependencyNotificationBus.h - include/LmbrCentral/Physics/WindVolumeRequestBus.h - include/LmbrCentral/Physics/ForceVolumeRequestBus.h - include/LmbrCentral/Physics/WaterNotificationBus.h include/LmbrCentral/Rendering/DecalComponentBus.h include/LmbrCentral/Rendering/LightComponentBus.h include/LmbrCentral/Rendering/MaterialAsset.h From 2a7fe4efcf4742522ca418e18250462822ae50eb Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:12:38 -0800 Subject: [PATCH 271/620] Removes multiple Rendering files from LmbrCentral that are no longer used Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/CryEditDoc.cpp | 44 +--- Code/Editor/CryEditDoc.h | 1 - .../SandboxIntegration.cpp | 1 - .../UI/AssetCatalogModel.cpp | 1 - Gems/LmbrCentral/Code/Source/LmbrCentral.cpp | 1 - .../LmbrCentral/Rendering/DecalComponentBus.h | 74 ------- .../Rendering/EditorLightComponentBus.h | 195 ------------------ .../LmbrCentral/Rendering/GiRegistrationBus.h | 39 ---- .../LmbrCentral/Rendering/LensFlareAsset.h | 32 --- .../LmbrCentral/Rendering/LightComponentBus.h | 164 --------------- .../LmbrCentral/Rendering/MaterialHandle.h | 54 ----- .../Rendering/MeshModificationBus.h | 132 ------------ .../Code/lmbrcentral_editor_files.cmake | 1 - .../Code/lmbrcentral_headers_files.cmake | 5 - 14 files changed, 2 insertions(+), 742 deletions(-) delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/DecalComponentBus.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/EditorLightComponentBus.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/GiRegistrationBus.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LensFlareAsset.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LightComponentBus.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MaterialHandle.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshModificationBus.h diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp index 9d93fd5f5b..bcd3efd770 100644 --- a/Code/Editor/CryEditDoc.cpp +++ b/Code/Editor/CryEditDoc.cpp @@ -57,7 +57,6 @@ // LmbrCentral #include -#include // for LmbrCentral::EditorLightComponentRequestBus static const char* kAutoBackupFolder = "_autobackup"; static const char* kHoldFolder = "$tmp_hold"; // conform to the ignored file types $tmp[0-9]*_ regex @@ -2130,52 +2129,13 @@ void CCryEditDoc::ReleaseXmlArchiveArray(TDocMultiArchive& arrXmlAr) ////////////////////////////////////////////////////////////////////////// // AzToolsFramework::EditorEntityContextNotificationBus interface implementation -void CCryEditDoc::OnSliceInstantiated(const AZ::Data::AssetId& sliceAssetId, AZ::SliceComponent::SliceInstanceAddress& sliceAddress, const AzFramework::SliceInstantiationTicket& /*ticket*/) +void CCryEditDoc::OnSliceInstantiated([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] AZ::SliceComponent::SliceInstanceAddress& sliceAddress, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& /*ticket*/) { - if (m_envProbeSliceAssetId == sliceAssetId) - { - const AZ::SliceComponent::EntityList& entities = sliceAddress.GetInstance()->GetInstantiated()->m_entities; - const AZ::Uuid editorEnvProbeComponentId("{8DBD6035-583E-409F-AFD9-F36829A0655D}"); - AzToolsFramework::EntityIdList entityIds; - entityIds.reserve(entities.size()); - for (const AZ::Entity* entity : entities) - { - if (entity->FindComponent(editorEnvProbeComponentId)) - { - // Update Probe Area size to cover the whole terrain - LmbrCentral::EditorLightComponentRequestBus::Event(entity->GetId(), &LmbrCentral::EditorLightComponentRequests::SetProbeAreaDimensions, AZ::Vector3(m_terrainSize, m_terrainSize, m_envProbeHeight)); - - // Force update the light to apply cubemap - LmbrCentral::EditorLightComponentRequestBus::Event(entity->GetId(), &LmbrCentral::EditorLightComponentRequests::RefreshLight); - } - entityIds.push_back(entity->GetId()); - } - - //Detach instantiated env probe entities from engine slice - AzToolsFramework::SliceEditorEntityOwnershipServiceRequestBus::Broadcast( - &AzToolsFramework::SliceEditorEntityOwnershipServiceRequests::DetachSliceEntities, entityIds); - - sliceAddress.SetInstance(nullptr); - sliceAddress.SetReference(nullptr); - SetModifiedFlag(true); - SetModifiedModules(eModifiedEntities); - - AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler::BusDisconnect(); - - //save after level default slice fully instantiated - Save(); - } GetIEditor()->ResumeUndo(); } - -void CCryEditDoc::OnSliceInstantiationFailed(const AZ::Data::AssetId& sliceAssetId, const AzFramework::SliceInstantiationTicket& /*ticket*/) +void CCryEditDoc::OnSliceInstantiationFailed([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& /*ticket*/) { - if (m_envProbeSliceAssetId == sliceAssetId) - { - AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler::BusDisconnect(); - AZ_Warning("Editor", false, "Failed to instantiate default environment probe slice."); - } GetIEditor()->ResumeUndo(); } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Editor/CryEditDoc.h b/Code/Editor/CryEditDoc.h index 5d20bddf45..3874914396 100644 --- a/Code/Editor/CryEditDoc.h +++ b/Code/Editor/CryEditDoc.h @@ -200,7 +200,6 @@ protected: QString m_pathName; QString m_slicePathName; QString m_title; - AZ::Data::AssetId m_envProbeSliceAssetId; float m_terrainSize; const char* m_envProbeSliceRelativePath = "EngineAssets/Slices/DefaultLevelSetup.slice"; const float m_envProbeHeight = 200.0f; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp index 69b195d243..b88c7f8d60 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp @@ -69,7 +69,6 @@ #include "ISourceControl.h" #include "UI/QComponentEntityEditorMainWindow.h" -#include #include #include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/AssetCatalogModel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/AssetCatalogModel.cpp index 60fda239dc..b1233b8387 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/AssetCatalogModel.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/AssetCatalogModel.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include diff --git a/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp b/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp index 84ef11b35d..76f50b5ea6 100644 --- a/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp +++ b/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp @@ -60,7 +60,6 @@ #include #include #include -#include // Scriptable Ebus Registration #include "Events/ReflectScriptableEvents.h" diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/DecalComponentBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/DecalComponentBus.h deleted file mode 100644 index a184f37b4e..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/DecalComponentBus.h +++ /dev/null @@ -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 - * - */ -#pragma once - -#include -#include - -namespace LmbrCentral -{ - /*! - * DecalComponentRequests::Bus - * Messages serviced by the Decal component. - */ - class DecalComponentRequests - : public AZ::ComponentBus - { - public: - - virtual ~DecalComponentRequests() {} - - /** - * Makes the decal visible. - */ - virtual void Show() = 0; - - /** - * Hides the decal. - */ - virtual void Hide() = 0; - - /** - * Specify the decal's visibility. - * \param visible true to make the decal visible, false to hide it. - */ - virtual void SetVisibility(bool visible) = 0; - }; - - using DecalComponentRequestBus = AZ::EBus; - - /*! - * DecalComponentEditorRequests::Bus - * Editor/UI messages serviced by the Decal component. - */ - class DecalComponentEditorRequests - : public AZ::ComponentBus - { - public: - - using Bus = AZ::EBus; - - virtual ~DecalComponentEditorRequests() {} - - virtual void RefreshDecal() {} - }; - - /*! - * DecalComponentEvents::Bus - * Events dispatched by the Decal component. - */ - class DecalComponentEvents - : public AZ::ComponentBus - { - public: - - using Bus = AZ::EBus; - - virtual ~DecalComponentEvents() {} - }; -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/EditorLightComponentBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/EditorLightComponentBus.h deleted file mode 100644 index d7747c5094..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/EditorLightComponentBus.h +++ /dev/null @@ -1,195 +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 - * - */ -#pragma once - -#include -#include -#include - -namespace LmbrCentral -{ - class LightConfiguration; - - /*! - * EditorLightComponentRequestBus - * Editor/UI messages serviced by the light component. - */ - class EditorLightComponentRequests - : public AZ::ComponentBus - { - public: - virtual ~EditorLightComponentRequests() {} - - //! Recreates the render light. - virtual void RefreshLight() {} - - //! Sets the active cubemap resource. - virtual void SetCubemap(const AZStd::string& /*cubemap*/) {} - virtual void SetProjectorTexture(const AZStd::string& /*projectorTexture*/) {} - - //! Retrieves configured cubemap resolution for generation. - virtual AZ::u32 GetCubemapResolution() { return 0; } - //! Sets cubemap resolution for generation. See LightConfiguration::ResolutionSetting for options. - virtual void SetCubemapResolution(AZ::u32 /*resolution*/) = 0; - - //! Retrieves Configuration - virtual const LightConfiguration& GetConfiguration() const = 0; - - //! get if it's customized cubemap - virtual bool UseCustomizedCubemap() const { return false; } - //////////////////////////////////////////////////////////////////// - // Modifiers - these must match the same virtual methods in LightComponentRequests - - // General Light Settings - virtual void SetVisible(bool /*isVisible*/) {} - virtual bool GetVisible() { return true; } - - // Turned on by default? - virtual void SetOnInitially(bool /*onInitially*/) {} - virtual bool GetOnInitially() { return true; } - - virtual void SetColor(const AZ::Color& /*newColor*/) {} - virtual const AZ::Color GetColor() { return AZ::Color::CreateOne(); } - - virtual void SetDiffuseMultiplier(float /*newMultiplier*/) {} - virtual float GetDiffuseMultiplier() { return FLT_MAX; } - - virtual void SetSpecularMultiplier(float /*newMultiplier*/) {} - virtual float GetSpecularMultiplier() { return FLT_MAX; } - - virtual void SetAmbient(bool /*isAmbient*/) {} - virtual bool GetAmbient() { return true; } - - virtual void SetIndoorOnly(bool /*indoorOnly*/) {} - virtual bool GetIndoorOnly() { return false; } - - virtual void SetCastShadowSpec(AZ::u32 /*castShadowSpec*/) {} - virtual AZ::u32 GetCastShadowSpec() { return 0; } - - virtual void SetViewDistanceMultiplier(float /*viewDistanceMultiplier*/) {} - virtual float GetViewDistanceMultiplier() { return 0.0f; } - - virtual void SetVolumetricFog(bool /*volumetricFog*/) {} - virtual bool GetVolumetricFog() { return false; } - - virtual void SetVolumetricFogOnly(bool /*volumetricFogOnly*/) {} - virtual bool GetVolumetricFogOnly() { return false; } - - virtual void SetUseVisAreas(bool /*useVisAreas*/) {} - virtual bool GetUseVisAreas() { return false; } - - virtual void SetAffectsThisAreaOnly(bool /*affectsThisAreaOnly*/) {} - virtual bool GetAffectsThisAreaOnly() { return false; } - - // Point Light Specific Modifiers - virtual void SetPointMaxDistance(float /*newMaxDistance*/) {} - virtual float GetPointMaxDistance() { return FLT_MAX; } - - virtual void SetPointAttenuationBulbSize(float /*newAttenuationBulbSize*/) {} - virtual float GetPointAttenuationBulbSize() { return FLT_MAX; } - - // Area Light Specific Modifiers - virtual void SetAreaMaxDistance(float /*newMaxDistance*/) {} - virtual float GetAreaMaxDistance() { return FLT_MAX; } - - virtual void SetAreaWidth(float /*newWidth*/) {} - virtual float GetAreaWidth() { return FLT_MAX; } - - virtual void SetAreaHeight(float /*newHeight*/) {} - virtual float GetAreaHeight() { return FLT_MAX; } - - virtual void SetAreaFOV(float /*newFOV*/) {} - virtual float GetAreaFOV() { return FLT_MAX; } - - // Project Light Specific Modifiers - virtual void SetProjectorMaxDistance(float /*newMaxDistance*/) {} - virtual float GetProjectorMaxDistance() { return FLT_MAX; } - - virtual void SetProjectorAttenuationBulbSize(float /*newAttenuationBulbSize*/) {} - virtual float GetProjectorAttenuationBulbSize() { return FLT_MAX; } - - virtual void SetProjectorFOV(float /*newFOV*/) {} - virtual float GetProjectorFOV() { return FLT_MAX; } - - virtual void SetProjectorNearPlane(float /*newNearPlane*/) {} - virtual float GetProjectorNearPlane() { return FLT_MAX; } - - // Environment Probe Settings - virtual void SetProbeAreaDimensions(const AZ::Vector3& newDimensions) { (void)newDimensions; } - virtual const AZ::Vector3 GetProbeAreaDimensions() { return AZ::Vector3::CreateOne(); } - - virtual void SetProbeSortPriority(AZ::u32 newPriority) { (void)newPriority; } - virtual AZ::u32 GetProbeSortPriority() { return 0; } - - virtual void SetProbeBoxProjected(bool isProbeBoxProjected) { (void)isProbeBoxProjected; } - virtual bool GetProbeBoxProjected() { return false; } - - virtual void SetProbeBoxHeight(float newHeight) { (void)newHeight; } - virtual float GetProbeBoxHeight() { return FLT_MAX; } - - virtual void SetProbeBoxLength(float newLength) { (void)newLength; } - virtual float GetProbeBoxLength() { return FLT_MAX; } - - virtual void SetProbeBoxWidth(float newWidth) { (void)newWidth; } - virtual float GetProbeBoxWidth() { return FLT_MAX; } - - virtual void SetProbeAttenuationFalloff(float newAttenuationFalloff) { (void)newAttenuationFalloff; } - virtual float GetProbeAttenuationFalloff() { return FLT_MAX; } - - virtual void SetProbeFade(float fade) { (void)fade; } - virtual float GetProbeFade() { return 1.0f; } - - // Environment Light Specific Modifiers (probes) - virtual void SetProbeArea(const AZ::Vector3& /*probeArea*/) {} - virtual AZ::Vector3 GetProbeArea() { return AZ::Vector3::CreateZero(); } - - virtual void SetAttenuationFalloffMax(float /*attenFalloffMax*/) {} - virtual float GetAttenuationFalloffMax() { return 0; } - - virtual void SetBoxHeight(float /*boxHeight*/) {} - virtual float GetBoxHeight() { return 0.0f; } - - virtual void SetBoxWidth(float /*boxWidth*/) {} - virtual float GetBoxWidth() { return 0.0f; } - - virtual void SetBoxLength(float /*boxLength*/) {} - virtual float GetBoxLength() { return 0.0f; } - - virtual void SetBoxProjected(bool /*boxProjected*/) {} - virtual bool GetBoxProjected() { return false; } - //////////////////////////////////////////////////////////////////// - - // Shadow parameters - virtual void SetShadowBias(float /*shadowBias*/) {} - virtual float GetShadowBias() { return 0.0f; } - - virtual void SetShadowSlopeBias(float /*shadowSlopeBias*/) {} - virtual float GetShadowSlopeBias() { return 0.0f; } - - virtual void SetShadowResScale(float /*shadowResScale*/) {} - virtual float GetShadowResScale() { return 0.0f; } - - virtual void SetShadowUpdateMinRadius(float /*shadowUpdateMinRadius*/) {} - virtual float GetShadowUpdateMinRadius() { return 0.0f; } - - virtual void SetShadowUpdateRatio(float /*shadowUpdateRatio*/) {} - virtual float GetShadowUpdateRatio() { return 0.0f; } - - // Animation parameters - virtual void SetAnimIndex(AZ::u32 /*animIndex*/) {} - virtual AZ::u32 GetAnimIndex() { return 0; } - - virtual void SetAnimSpeed(float /*animSpeed*/) {} - virtual float GetAnimSpeed() { return 0.0f; } - - virtual void SetAnimPhase(float /*animPhase*/) {} - virtual float GetAnimPhase() { return 0.0f; } - }; - - using EditorLightComponentRequestBus = AZ::EBus; -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/GiRegistrationBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/GiRegistrationBus.h deleted file mode 100644 index 0bb4363add..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/GiRegistrationBus.h +++ /dev/null @@ -1,39 +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 - * - */ -#pragma once - -#include -#include - -namespace LmbrCentral -{ - /*! - * Messages for handling SVOGI registration. - */ - class GiRegistration - : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // EBusTraits overrides - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - using MutexType = AZStd::recursive_mutex; - // static const bool LocklessDispatch = true - - //Upsert will unpack the mesh, transform, world aabb and material and upsert to the gi system. - //If something is already registered on this entityId it will be removed then reinserted. - virtual void UpsertToGi(AZ::EntityId entityId, AZ::Transform transform, AZ::Aabb worldAabb, - AZ::Data::Asset meshAsset, _smart_ptr material) = 0; - //Remove will remove any data associated with the entityId. - virtual void RemoveFromGi(AZ::EntityId entityId) = 0; - }; - - using GiRegistrationBus = AZ::EBus; - -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LensFlareAsset.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LensFlareAsset.h deleted file mode 100644 index 3267397e72..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LensFlareAsset.h +++ /dev/null @@ -1,32 +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 - * - */ -#pragma once - -#include -#include -#include - -namespace LmbrCentral -{ - class LensFlareAsset - : public AZ::Data::AssetData - { - friend class LensFlareAssetHandler; - - public: - AZ_RTTI(LensFlareAsset, "{CF44D1F0-F178-4A3D-A9E6-D44721F50C20}", AZ::Data::AssetData); - AZ_CLASS_ALLOCATOR(LensFlareAsset, AZ::SystemAllocator, 0); - - const AZStd::vector& GetPaths() { return m_flarePaths; } - - private: - void AddPath(AZStd::string&& newPath) { m_flarePaths.emplace_back(std::move(newPath)); } - - AZStd::vector m_flarePaths; - }; -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LightComponentBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LightComponentBus.h deleted file mode 100644 index c360bec6cb..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LightComponentBus.h +++ /dev/null @@ -1,164 +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 - * - */ -#pragma once - -#include -#include -#include - -namespace LmbrCentral -{ - class LightConfiguration; - - /*! - * LightComponentRequestBus - * Messages serviced by the light component. - */ - class LightComponentRequests - : public AZ::ComponentBus - { - public: - - enum class State - { - Off = 0, - On, - }; - - virtual ~LightComponentRequests() {} - - //! Control light state. - virtual void SetLightState([[maybe_unused]] State state) {} - - //! Turns light on. Returns true if the light was successfully turned on - virtual bool TurnOnLight() { return false; } - - //! Turns light off. Returns true if the light was successfully turned off - virtual bool TurnOffLight() { return false; } - - //! Toggles light state. - virtual void ToggleLight() {} - - //////////////////////////////////////////////////////////////////// - // Modifiers - these must match the same virutal methods in LightComponentEditorRequests - - // General Settings Modifiers - virtual void SetVisible(bool isVisible) { (void)isVisible; } - virtual bool GetVisible() { return true; } - - virtual void SetColor(const AZ::Color& newColor) { (void)newColor; }; - virtual const AZ::Color GetColor() { return AZ::Color::CreateOne(); } - - virtual void SetDiffuseMultiplier(float newMultiplier) { (void)newMultiplier; }; - virtual float GetDiffuseMultiplier() { return FLT_MAX; } - - virtual void SetSpecularMultiplier(float newMultiplier) { (void)newMultiplier; }; - virtual float GetSpecularMultiplier() { return FLT_MAX; } - - virtual void SetAmbient(bool isAmbient) { (void)isAmbient; } - virtual bool GetAmbient() { return true; } - - // Point Light Specific Modifiers - virtual void SetPointMaxDistance(float newMaxDistance) { (void)newMaxDistance; }; - virtual float GetPointMaxDistance() { return FLT_MAX; } - - virtual void SetPointAttenuationBulbSize(float newAttenuationBulbSize) { (void)newAttenuationBulbSize; }; - virtual float GetPointAttenuationBulbSize() { return FLT_MAX; } - - // Area Light Specific Modifiers - virtual void SetAreaMaxDistance(float newMaxDistance) { (void)newMaxDistance; }; - virtual float GetAreaMaxDistance() { return FLT_MAX; } - - virtual void SetAreaWidth(float newWidth) { (void)newWidth; }; - virtual float GetAreaWidth() { return FLT_MAX; } - - virtual void SetAreaHeight(float newHeight) { (void)newHeight; }; - virtual float GetAreaHeight() { return FLT_MAX; } - - virtual void SetAreaFOV(float newFOV) { (void)newFOV; }; - virtual float GetAreaFOV() { return FLT_MAX; } - - // Project Light Specific Modifiers - virtual void SetProjectorMaxDistance(float newMaxDistance) { (void)newMaxDistance; }; - virtual float GetProjectorMaxDistance() { return FLT_MAX; } - - virtual void SetProjectorAttenuationBulbSize(float newAttenuationBulbSize) { (void)newAttenuationBulbSize; }; - virtual float GetProjectorAttenuationBulbSize() { return FLT_MAX; } - - virtual void SetProjectorFOV(float newFOV) { (void)newFOV; }; - virtual float GetProjectorFOV() { return FLT_MAX; } - - virtual void SetProjectorNearPlane(float newNearPlane) { (void)newNearPlane; }; - virtual float GetProjectorNearPlane() { return FLT_MAX; } - - // Environment Probe Settings - virtual void SetProbeAreaDimensions(const AZ::Vector3& newDimensions) { (void)newDimensions; } - virtual const AZ::Vector3 GetProbeAreaDimensions() { return AZ::Vector3::CreateOne(); } - - virtual void SetProbeSortPriority(AZ::u32 newPriority) { (void)newPriority; } - virtual AZ::u32 GetProbeSortPriority() { return 0; } - - virtual void SetProbeBoxProjected(bool isProbeBoxProjected) { (void)isProbeBoxProjected; } - virtual bool GetProbeBoxProjected() { return false; } - - virtual void SetProbeBoxHeight(float newHeight) { (void)newHeight; } - virtual float GetProbeBoxHeight() { return FLT_MAX; } - - virtual void SetProbeBoxLength(float newLength) { (void)newLength; } - virtual float GetProbeBoxLength() { return FLT_MAX; } - - virtual void SetProbeBoxWidth(float newWidth) { (void)newWidth; } - virtual float GetProbeBoxWidth() { return FLT_MAX; } - - virtual void SetProbeAttenuationFalloff(float newAttenuationFalloff) { (void)newAttenuationFalloff; } - virtual float GetProbeAttenuationFalloff() { return FLT_MAX; } - - virtual void SetProbeFade(float fade) { (void)fade; } - virtual float GetProbeFade() { return 1.0f; } - //////////////////////////////////////////////////////////////////// - }; - - using LightComponentRequestBus = AZ::EBus; - - /*! - * LightComponentNotificationBus - * Events dispatched by the light component. - */ - class LightComponentNotifications - : public AZ::ComponentBus - { - public: - - virtual ~LightComponentNotifications() {} - - // Sent when the light is turned on. - virtual void LightTurnedOn() {} - - // Sent when the light is turned off. - virtual void LightTurnedOff() {} - }; - - using LightComponentNotificationBus = AZ::EBus < LightComponentNotifications >; - - /*! - * LightSettingsNotifications - * Events dispatched by the light component or light component editor when settings have changed. - */ - class LightSettingsNotifications - : public AZ::ComponentBus - { - public: - - virtual ~LightSettingsNotifications() {} - - virtual void AnimationSettingsChanged() = 0; - }; - - using LightSettingsNotificationsBus = AZ::EBus < LightSettingsNotifications >; - -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MaterialHandle.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MaterialHandle.h deleted file mode 100644 index b8b9e316ff..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MaterialHandle.h +++ /dev/null @@ -1,54 +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 - * - */ - -#pragma once - -#include -#include - -struct IMaterial; - -namespace AZ -{ - class BehaviorContext; -} -namespace LmbrCentral -{ - //! Wraps a IMaterial pointer in a way that BehaviorContext can use it - class MaterialHandle - { - public: - AZ_CLASS_ALLOCATOR(MaterialHandle, AZ::SystemAllocator, 0); - AZ_TYPE_INFO(MaterialHandle, "{BF659DC6-ACDD-4062-A52E-4EC053286F4F}"); - - MaterialHandle() - { - } - - MaterialHandle(const MaterialHandle& handle) - : m_material(handle.m_material) - { - } - - ~MaterialHandle() - { - } - - MaterialHandle& operator=(const MaterialHandle& rhs) - { - m_material = rhs.m_material; - return *this; - } - - IMaterial* m_material; - - static void Reflect(AZ::BehaviorContext* behaviorContext); - static void Reflect(AZ::SerializeContext* serializeContext); - }; - -} diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshModificationBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshModificationBus.h deleted file mode 100644 index eb1e53edcd..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshModificationBus.h +++ /dev/null @@ -1,132 +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 - * - */ -#pragma once - -#include -#include -#include - -struct IRenderMesh; - -namespace LmbrCentral -{ - /* - * MeshModificationRequestBus - * Requests for a render mesh to be sent for editing. - */ - class MeshModificationRequests - : public AZ::ComponentBus - { - public: - - virtual void RequireSendingRenderMeshForModification(size_t lodIndex, size_t primitiveIndex) = 0; - - virtual void StopSendingRenderMeshForModification(size_t lodIndex, size_t primitiveIndex) = 0; - - protected: - ~MeshModificationRequests() = default; - }; - - using MeshModificationRequestBus = AZ::EBus; - - /* - * MeshModificationRequestHelper - * Helper class to manage storing indices for the render meshes to edit. - */ - class MeshModificationRequestHelper - : public MeshModificationRequestBus::Handler - , public AZ::TickBus::Handler - { - public: - struct MeshLODPrimIndex - { - size_t lodIndex; - size_t primitiveIndex; - - bool operator<(const MeshLODPrimIndex& right) const - { - return (lodIndex < right.lodIndex) - || (lodIndex == right.lodIndex && primitiveIndex < right.primitiveIndex); - } - }; - - void Connect(MeshModificationRequestBus::BusIdType busId) - { - MeshModificationRequestBus::Handler::BusConnect(busId); - AZ::TickBus::Handler::BusConnect(); - } - - bool IsConnected() - { - return MeshModificationRequestBus::Handler::BusIsConnected(); - } - - void Disconnect() - { - AZ::TickBus::Handler::BusDisconnect(); - MeshModificationRequestBus::Handler::BusDisconnect(); - } - - void RequireSendingRenderMeshForModification(size_t lodIndex, size_t primitiveIndex) override - { - m_meshesToSendForEditing.insert({ lodIndex, primitiveIndex }); - } - - void StopSendingRenderMeshForModification(size_t lodIndex, size_t primitiveIndex) override - { - m_meshesToSendForEditing.erase({ lodIndex, primitiveIndex }); - } - - const AZStd::set& MeshesToEdit() const - { - return m_meshesToSendForEditing; - } - - bool GetMeshModified() const - { - return m_meshModified; - } - - void SetMeshModified(bool value) - { - m_meshModified = value; - } - - private: - void OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) override - { - m_meshModified = false; - } - - int GetTickOrder() override - { - return AZ::TICK_PRE_RENDER; - } - - AZStd::set m_meshesToSendForEditing; - bool m_meshModified = false; - }; - - /* - * MeshModificationNotificationBus - * Sends an event when the render mesh data should be edited. - */ - class MeshModificationNotifications - : public AZ::ComponentBus - { - public: - using MutexType = AZStd::mutex; - - virtual void ModifyMesh([[maybe_unused]] size_t lodIndex, [[maybe_unused]] size_t primitiveIndex, [[maybe_unused]] IRenderMesh* renderMesh) {} - - protected: - ~MeshModificationNotifications() = default; - }; - - using MeshModificationNotificationBus = AZ::EBus; -}// namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/lmbrcentral_editor_files.cmake b/Gems/LmbrCentral/Code/lmbrcentral_editor_files.cmake index 24f9ff6dcd..665dbef5b7 100644 --- a/Gems/LmbrCentral/Code/lmbrcentral_editor_files.cmake +++ b/Gems/LmbrCentral/Code/lmbrcentral_editor_files.cmake @@ -8,7 +8,6 @@ set(FILES include/LmbrCentral/Rendering/EditorCameraCorrectionBus.h - include/LmbrCentral/Rendering/EditorLightComponentBus.h include/LmbrCentral/Shape/EditorPolygonPrismShapeComponentBus.h include/LmbrCentral/Shape/EditorSplineComponentBus.h include/LmbrCentral/Shape/EditorTubeShapeComponentBus.h diff --git a/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake b/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake index cd8f3eff21..9c2d4c1746 100644 --- a/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake +++ b/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake @@ -27,13 +27,8 @@ set(FILES include/LmbrCentral/Dependency/DependencyMonitor.h include/LmbrCentral/Dependency/DependencyMonitor.inl include/LmbrCentral/Dependency/DependencyNotificationBus.h - include/LmbrCentral/Rendering/DecalComponentBus.h - include/LmbrCentral/Rendering/LightComponentBus.h include/LmbrCentral/Rendering/MaterialAsset.h - include/LmbrCentral/Rendering/MaterialHandle.h include/LmbrCentral/Rendering/MeshAsset.h - include/LmbrCentral/Rendering/MeshModificationBus.h - include/LmbrCentral/Rendering/GiRegistrationBus.h include/LmbrCentral/Rendering/RenderBoundsBus.h include/LmbrCentral/Scripting/EditorTagComponentBus.h include/LmbrCentral/Scripting/GameplayNotificationBus.h From 55e557b5539534bf27836dfe9b3d082d09405259 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:15:00 -0800 Subject: [PATCH 272/620] Removes TerrainSystemRequestBus.h from Gems/LmbrCentral Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Terrain/TerrainSystemRequestBus.h | 34 ------------------- .../Code/lmbrcentral_headers_files.cmake | 1 - 2 files changed, 35 deletions(-) delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Terrain/TerrainSystemRequestBus.h diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Terrain/TerrainSystemRequestBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Terrain/TerrainSystemRequestBus.h deleted file mode 100644 index 1c5c319731..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Terrain/TerrainSystemRequestBus.h +++ /dev/null @@ -1,34 +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 - * - */ -#pragma once - -#include -#include - -namespace LmbrCentral -{ - // Shared interface for terrain system implementations - class TerrainSystemRequests - : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // EBusTraits overrides - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - ////////////////////////////////////////////////////////////////////////// - - // Get the terrain height at a specific location - virtual float GetElevation(const AZ::Vector3& position) const = 0; - - // Get the terrain surface normal at a specific location - virtual AZ::Vector3 GetNormal(const AZ::Vector3& position) const = 0; - }; - - using TerrainSystemRequestBus = AZ::EBus; -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake b/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake index 9c2d4c1746..f7c51c67b6 100644 --- a/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake +++ b/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake @@ -51,5 +51,4 @@ set(FILES include/LmbrCentral/Shape/ReferenceShapeComponentBus.h include/LmbrCentral/Shape/SplineAttribute.h include/LmbrCentral/Shape/SplineAttribute.inl - include/LmbrCentral/Terrain/TerrainSystemRequestBus.h ) From 837a139464b7864ae142eba9e64d4d7393c88680 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:18:39 -0800 Subject: [PATCH 273/620] =?UTF-8?q?=EF=BB=BFRemoves=20LmbrCentralReflectio?= =?UTF-8?q?nTest.cpp=20from=20Gems/LmbrCentral?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/LmbrCentral/Code/Tests/LmbrCentralReflectionTest.cpp | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 Gems/LmbrCentral/Code/Tests/LmbrCentralReflectionTest.cpp diff --git a/Gems/LmbrCentral/Code/Tests/LmbrCentralReflectionTest.cpp b/Gems/LmbrCentral/Code/Tests/LmbrCentralReflectionTest.cpp deleted file mode 100644 index 196f0931e0..0000000000 --- a/Gems/LmbrCentral/Code/Tests/LmbrCentralReflectionTest.cpp +++ /dev/null @@ -1,7 +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 - * - */ From d89b682e9c791954b86ee0aa59e4fcd73e9fd24f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:24:04 -0800 Subject: [PATCH 274/620] Removes CommandHierarchyItemToggleIsSelected.h/cpp from Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../CommandHierarchyItemToggleIsSelected.cpp | 67 ------------------- .../CommandHierarchyItemToggleIsSelected.h | 52 -------------- Gems/LyShine/Code/Editor/EditorCommon.h | 2 - .../Code/lyshine_uicanvaseditor_files.cmake | 2 - 4 files changed, 123 deletions(-) delete mode 100644 Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.cpp delete mode 100644 Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.h diff --git a/Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.cpp b/Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.cpp deleted file mode 100644 index 563fbe1935..0000000000 --- a/Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.cpp +++ /dev/null @@ -1,67 +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 - * - */ -#include "EditorCommon.h" - -CommandHierarchyItemToggleIsSelected::CommandHierarchyItemToggleIsSelected(UndoStack* stack, - HierarchyWidget* hierarchy, - HierarchyItem* item) - : QUndoCommand() - , m_stack(stack) - , m_hierarchy(hierarchy) - , m_id(item->GetEntityId()) - , m_toIsSelected(false) -{ - setText(QString("toggle selection of \"%1\"").arg(item->GetElement()->GetName().c_str())); - - EBUS_EVENT_ID_RESULT(m_toIsSelected, m_id, UiEditorBus, GetIsSelected); - m_toIsSelected = !m_toIsSelected; -} - -void CommandHierarchyItemToggleIsSelected::undo() -{ - UndoStackExecutionScope s(m_stack); - - SetIsSelected(!m_toIsSelected); -} - -void CommandHierarchyItemToggleIsSelected::redo() -{ - UndoStackExecutionScope s(m_stack); - - SetIsSelected(m_toIsSelected); -} - -void CommandHierarchyItemToggleIsSelected::SetIsSelected(bool isSelected) -{ - AZ::Entity* element = EntityHelpers::GetEntity(m_id); - if (!element) - { - // The element DOESN'T exist. - // Nothing to do. - return; - } - - // This will do both the Runtime-side and Editor-side. - HierarchyItem::RttiCast(HierarchyHelpers::ElementToItem(m_hierarchy, element, false))->SetIsSelected(isSelected); -} - -void CommandHierarchyItemToggleIsSelected::Push(UndoStack* stack, - HierarchyWidget* hierarchy, - HierarchyItem* item) -{ - if (stack->GetIsExecuting()) - { - // This is a redundant Qt notification. - // Nothing else to do. - return; - } - - stack->push(new CommandHierarchyItemToggleIsSelected(stack, - hierarchy, - item)); -} diff --git a/Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.h b/Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.h deleted file mode 100644 index 97a988e04b..0000000000 --- a/Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.h +++ /dev/null @@ -1,52 +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 - * - */ -#pragma once - -#include - -class CommandHierarchyItemToggleIsSelected - : public QUndoCommand -{ -public: - - void undo() override; - void redo() override; - - // IMPORTANT: We DON'T want this command to support mergeWith(). - // Otherwise we leave commands on the undo stack that have no - // effect (NOOP). - // - // To avoid the NOOPs, we can either: - // - // (1) Delete the NOPs from the undo stack. - // or - // (2) NOT support mergeWith(). - // - // The problem with (1) is that it only allows odd number of - // state changes to be undoable. (2) is more consistent - // by making all state changes undoable. - - static void Push(UndoStack* stack, - HierarchyWidget* hierarchy, - HierarchyItem* item); - -private: - - CommandHierarchyItemToggleIsSelected(UndoStack* stack, - HierarchyWidget* hierarchy, - HierarchyItem* item); - - void SetIsSelected(bool isSelected); - - UndoStack* m_stack; - - HierarchyWidget* m_hierarchy; - - AZ::EntityId m_id; - bool m_toIsSelected; -}; diff --git a/Gems/LyShine/Code/Editor/EditorCommon.h b/Gems/LyShine/Code/Editor/EditorCommon.h index 5a435e7dba..95b0bf753f 100644 --- a/Gems/LyShine/Code/Editor/EditorCommon.h +++ b/Gems/LyShine/Code/Editor/EditorCommon.h @@ -42,7 +42,6 @@ class CommandHierarchyItemRename; class CommandHierarchyItemReparent; class CommandHierarchyItemToggleIsExpanded; class CommandHierarchyItemToggleIsSelectable; -class CommandHierarchyItemToggleIsSelected; class CommandHierarchyItemToggleIsVisible; class CommandPropertiesChange; class CommandViewportInteractionMode; @@ -123,7 +122,6 @@ enum class FusibleCommand #include "CommandHierarchyItemReparent.h" #include "CommandHierarchyItemToggleIsExpanded.h" #include "CommandHierarchyItemToggleIsSelectable.h" -#include "CommandHierarchyItemToggleIsSelected.h" #include "CommandHierarchyItemToggleIsVisible.h" #include "CommandPropertiesChange.h" #include "CommandViewportInteractionMode.h" diff --git a/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake b/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake index 49fee653be..9750116ad1 100644 --- a/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake +++ b/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake @@ -50,8 +50,6 @@ set(FILES Editor/CommandHierarchyItemToggleIsExpanded.h Editor/CommandHierarchyItemToggleIsSelectable.cpp Editor/CommandHierarchyItemToggleIsSelectable.h - Editor/CommandHierarchyItemToggleIsSelected.cpp - Editor/CommandHierarchyItemToggleIsSelected.h Editor/CommandHierarchyItemToggleIsVisible.cpp Editor/CommandHierarchyItemToggleIsVisible.h Editor/CommandPropertiesChange.cpp From 4cfdbe3731f32678ff97558ec99a0b66952029d5 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:28:37 -0800 Subject: [PATCH 275/620] Removes CommandViewportInteractionMode from Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Editor/CommandViewportInteractionMode.cpp | 94 ------------------- .../Editor/CommandViewportInteractionMode.h | 43 --------- Gems/LyShine/Code/Editor/EditorCommon.h | 2 - .../Code/lyshine_uicanvaseditor_files.cmake | 2 - 4 files changed, 141 deletions(-) delete mode 100644 Gems/LyShine/Code/Editor/CommandViewportInteractionMode.cpp delete mode 100644 Gems/LyShine/Code/Editor/CommandViewportInteractionMode.h diff --git a/Gems/LyShine/Code/Editor/CommandViewportInteractionMode.cpp b/Gems/LyShine/Code/Editor/CommandViewportInteractionMode.cpp deleted file mode 100644 index 260ff4c4e4..0000000000 --- a/Gems/LyShine/Code/Editor/CommandViewportInteractionMode.cpp +++ /dev/null @@ -1,94 +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 - * - */ -#include "EditorCommon.h" - -CommandViewportInteractionMode::CommandViewportInteractionMode(UndoStack* stack, - ViewportInteraction* viewportInteraction, - QAction* from, - QAction* to) - : QUndoCommand() - , m_stack(stack) - , m_viewportInteraction(viewportInteraction) - , m_from(from) - , m_to(to) -{ - UpdateText(); -} - -void CommandViewportInteractionMode::undo() -{ - UndoStackExecutionScope s(m_stack); - - SetMode(m_from); -} - -void CommandViewportInteractionMode::redo() -{ - UndoStackExecutionScope s(m_stack); - - SetMode(m_to); -} - -int CommandViewportInteractionMode::id() const -{ - return (int)FusibleCommand::kViewportInteractionMode; -} - -bool CommandViewportInteractionMode::mergeWith(const QUndoCommand* other) -{ - if (other->id() != id()) - { - // NOT the same command type. - return false; - } - - const CommandViewportInteractionMode* subsequent = static_cast(other); - AZ_Assert(subsequent, "No command to merge with"); - - if (!((subsequent->m_stack == m_stack) && - (subsequent->m_viewportInteraction == m_viewportInteraction))) - { - // NOT the same context. - return false; - } - - m_to = subsequent->m_to; - - UpdateText(); - - return true; -} - -void CommandViewportInteractionMode::UpdateText() -{ - setText(QString("mode change to %1").arg(ViewportHelpers::InteractionModeToString(m_to->data().toInt()))); -} - -void CommandViewportInteractionMode::SetMode(QAction* action) const -{ - action->trigger(); - - // IMPORTANT: It's NOT necessary to prevent this from executing on the - // first run. We WON'T get a redundant Qt notification by this point. - m_viewportInteraction->SetMode((ViewportInteraction::InteractionMode)action->data().toInt()); -} - -void CommandViewportInteractionMode::Push(UndoStack* stack, - ViewportInteraction* viewportInteraction, - QAction* from, - QAction* to) -{ - if (stack->GetIsExecuting()) - { - // This is a redundant Qt notification. - // Nothing else to do. - return; - } - - stack->push(new CommandViewportInteractionMode(stack, viewportInteraction, from, to)); -} diff --git a/Gems/LyShine/Code/Editor/CommandViewportInteractionMode.h b/Gems/LyShine/Code/Editor/CommandViewportInteractionMode.h deleted file mode 100644 index be6f1bc6ab..0000000000 --- a/Gems/LyShine/Code/Editor/CommandViewportInteractionMode.h +++ /dev/null @@ -1,43 +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 - * - */ -#pragma once - -#include - -class CommandViewportInteractionMode - : public QUndoCommand -{ -public: - - void undo() override; - void redo() override; - - int id() const override; - bool mergeWith(const QUndoCommand* other) override; - - static void Push(UndoStack* stack, - ViewportInteraction* viewportInteraction, - QAction* from, - QAction* to); - -private: - - CommandViewportInteractionMode(UndoStack* stack, - ViewportInteraction* viewportInteraction, - QAction* from, - QAction* to); - - void UpdateText(); - void SetMode(QAction* action) const; - - UndoStack* m_stack; - - ViewportInteraction* m_viewportInteraction; - QAction* m_from; - QAction* m_to; -}; diff --git a/Gems/LyShine/Code/Editor/EditorCommon.h b/Gems/LyShine/Code/Editor/EditorCommon.h index 95b0bf753f..76f883b6ec 100644 --- a/Gems/LyShine/Code/Editor/EditorCommon.h +++ b/Gems/LyShine/Code/Editor/EditorCommon.h @@ -44,7 +44,6 @@ class CommandHierarchyItemToggleIsExpanded; class CommandHierarchyItemToggleIsSelectable; class CommandHierarchyItemToggleIsVisible; class CommandPropertiesChange; -class CommandViewportInteractionMode; class ComponentButton; class CoordinateSystemToolbarSection; class EditorMenu; @@ -124,7 +123,6 @@ enum class FusibleCommand #include "CommandHierarchyItemToggleIsSelectable.h" #include "CommandHierarchyItemToggleIsVisible.h" #include "CommandPropertiesChange.h" -#include "CommandViewportInteractionMode.h" #include "ComponentButton.h" #include "CoordinateSystemToolbarSection.h" #include "EditorWindow.h" diff --git a/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake b/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake index 9750116ad1..c53891dcfc 100644 --- a/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake +++ b/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake @@ -54,8 +54,6 @@ set(FILES Editor/CommandHierarchyItemToggleIsVisible.h Editor/CommandPropertiesChange.cpp Editor/CommandPropertiesChange.h - Editor/CommandViewportInteractionMode.cpp - Editor/CommandViewportInteractionMode.h Editor/ComponentAssetHelpers.h Editor/ComponentButton.cpp Editor/ComponentButton.h From 70ffece2a969f157c80ac45d3b5289474b5a8f31 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:33:41 -0800 Subject: [PATCH 276/620] Removes UiAnimViewSplitter from Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Editor/Animation/UiAnimViewSplitter.cpp | 67 ------------------- .../Editor/Animation/UiAnimViewSplitter.h | 36 ---------- 2 files changed, 103 deletions(-) delete mode 100644 Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.cpp delete mode 100644 Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.h diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.cpp deleted file mode 100644 index 5a1ffd73f7..0000000000 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.cpp +++ /dev/null @@ -1,67 +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 - * - */ - - -#include "UiAnimViewSplitter.h" - - -// CUiAnimViewSplitter - -IMPLEMENT_DYNAMIC(CUiAnimViewSplitter, CSplitterWnd) -CUiAnimViewSplitter::CUiAnimViewSplitter() -{ - m_cxSplitter = m_cySplitter = 3 + 1 + 1 - 1; - m_cxBorderShare = m_cyBorderShare = 0; - m_cxSplitterGap = m_cySplitterGap = 3 + 1 + 1 - 1; - m_cxBorder = m_cyBorder = 0; -} - -CUiAnimViewSplitter::~CUiAnimViewSplitter() -{ -} - - -BEGIN_MESSAGE_MAP(CUiAnimViewSplitter, CSplitterWnd) -END_MESSAGE_MAP() - - - -// CUiAnimViewSplitter message handlers - -void CUiAnimViewSplitter::SetPane(int row, int col, CWnd* pWnd, SIZE sizeInit) -{ - assert(pWnd != NULL); - - // set the initial size for that pane - m_pColInfo[col].nIdealSize = sizeInit.cx; - m_pRowInfo[row].nIdealSize = sizeInit.cy; - - pWnd->ModifyStyle(0, WS_BORDER, WS_CHILD | WS_VISIBLE); - pWnd->SetParent(this); - - CRect rect(CPoint(0, 0), sizeInit); - pWnd->MoveWindow(0, 0, sizeInit.cx, sizeInit.cy, FALSE); - pWnd->SetDlgCtrlID(IdFromRowCol(row, col)); - - ASSERT((int)::GetDlgCtrlID(pWnd->m_hWnd) == IdFromRowCol(row, col)); -} - -void CUiAnimViewSplitter::OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg) -{ - // Let CSplitterWnd handle everything but the border-drawing - //if((nType != splitBorder) || (pDC == NULL)) - { - CSplitterWnd::OnDrawSplitter(pDC, nType, rectArg); - return; - } - - ASSERT_VALID(pDC); - - // Draw border - pDC->Draw3dRect(rectArg, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); -} diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.h b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.h deleted file mode 100644 index 028861289b..0000000000 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.h +++ /dev/null @@ -1,36 +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 - * - */ - - -#pragma once - - - -// CUiAnimViewSplitter - -class CUiAnimViewSplitter - : public CSplitterWnd -{ - DECLARE_DYNAMIC(CUiAnimViewSplitter) - - virtual CWnd * GetActivePane(int* pRow = NULL, int* pCol = NULL) - { - return GetFocus(); - } - - void SetPane(int row, int col, CWnd* pWnd, SIZE sizeInit); - // Ovveride this for flat look. - void OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg); - -public: - CUiAnimViewSplitter(); - virtual ~CUiAnimViewSplitter(); - -protected: - DECLARE_MESSAGE_MAP() -}; From 5b0cb9cdff34288d1e6aae2e2f4e8cfba12c1b77 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:44:48 -0800 Subject: [PATCH 277/620] refactors some code to better pickup AZ_LOADSCREENCOMPONENT_ENABLED's value Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp | 2 +- Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp | 2 +- Code/Legacy/CrySystem/System.h | 2 +- Code/Legacy/CrySystem/SystemInit.cpp | 2 +- Gems/LmbrCentral/Code/Source/LmbrCentral.cpp | 6 ------ Gems/LyShine/Code/Source/LyShineModule.cpp | 2 ++ 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp b/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp index dbe92ee6aa..0b90e73bc0 100644 --- a/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp +++ b/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp @@ -15,7 +15,7 @@ #include #include "CryPath.h" -#include +#include #include #include diff --git a/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp b/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp index 095d296373..a890b76662 100644 --- a/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp +++ b/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp @@ -10,7 +10,7 @@ #include "SpawnableLevelSystem.h" #include "IMovieSystem.h" -#include +#include #include #include diff --git a/Code/Legacy/CrySystem/System.h b/Code/Legacy/CrySystem/System.h index 9b76e94eb4..63a24c9f9c 100644 --- a/Code/Legacy/CrySystem/System.h +++ b/Code/Legacy/CrySystem/System.h @@ -17,7 +17,7 @@ #include "CmdLine.h" #include -#include +#include #include #include diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index 19d94ba6ec..600a799bc1 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -51,7 +51,7 @@ #include #include -#include +#include #include #include #include diff --git a/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp b/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp index 76f50b5ea6..9062e7552c 100644 --- a/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp +++ b/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp @@ -219,9 +219,6 @@ namespace LmbrCentral PolygonPrismShapeDebugDisplayComponent::CreateDescriptor(), TubeShapeDebugDisplayComponent::CreateDescriptor(), AssetSystemDebugComponent::CreateDescriptor(), -#if AZ_LOADSCREENCOMPONENT_ENABLED - LoadScreenComponent::CreateDescriptor(), -#endif // if AZ_LOADSCREENCOMPONENT_ENABLED }); // This is an internal Amazon gem, so register it's components for metrics tracking, otherwise the name of the component won't get sent back. @@ -248,9 +245,6 @@ namespace LmbrCentral azrtti_typeid(), azrtti_typeid(), azrtti_typeid(), -#if AZ_LOADSCREENCOMPONENT_ENABLED - azrtti_typeid(), -#endif // if AZ_LOADSCREENCOMPONENT_ENABLED }; } diff --git a/Gems/LyShine/Code/Source/LyShineModule.cpp b/Gems/LyShine/Code/Source/LyShineModule.cpp index 1a6b2cdbda..604cd09e22 100644 --- a/Gems/LyShine/Code/Source/LyShineModule.cpp +++ b/Gems/LyShine/Code/Source/LyShineModule.cpp @@ -55,6 +55,8 @@ #include "Pipeline/LyShineBuilder/LyShineBuilderComponent.h" #endif // LYSHINE_BUILDER +#include + namespace LyShine { LyShineModule::LyShineModule() From aed48d0f25d6759105cb76fc8b1319f3da69fea4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:46:38 -0800 Subject: [PATCH 278/620] Removes resource.h from Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/LyShine/Code/Source/resource.h | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 Gems/LyShine/Code/Source/resource.h diff --git a/Gems/LyShine/Code/Source/resource.h b/Gems/LyShine/Code/Source/resource.h deleted file mode 100644 index 0d25f9094b..0000000000 --- a/Gems/LyShine/Code/Source/resource.h +++ /dev/null @@ -1,23 +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 - * - */ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by CryFont.rc -// -#define VS_VERSION_INFO 1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif From 16afbf6bc0f7258fbb08bef1aa8d73e4a0d97fb3 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:51:02 -0800 Subject: [PATCH 279/620] Removes UiEntityContext.cpp from Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/LyShine/Code/Source/UiEntityContext.cpp | 219 ------------------- 1 file changed, 219 deletions(-) delete mode 100644 Gems/LyShine/Code/Source/UiEntityContext.cpp diff --git a/Gems/LyShine/Code/Source/UiEntityContext.cpp b/Gems/LyShine/Code/Source/UiEntityContext.cpp deleted file mode 100644 index 2741c4c521..0000000000 --- a/Gems/LyShine/Code/Source/UiEntityContext.cpp +++ /dev/null @@ -1,219 +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 - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - - -//////////////////////////////////////////////////////////////////////////////////////////////////// -UiEntityContext::UiEntityContext() - : AzFramework::EntityContext(AzFramework::EntityContextId::CreateRandom()) -{ -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -UiEntityContext::~UiEntityContext() -{ -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::Activate() -{ - InitContext(); - - GetRootSlice()->Instantiate(); - - UiEntityContextRequestBus::Handler::BusConnect(GetContextId()); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::Deactivate() -{ - UiEntityContextRequestBus::Handler::BusDisconnect(); - - DestroyContext(); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -AZ::Entity* UiEntityContext::GetRootAssetEntity() -{ - return m_rootAsset.Get()->GetEntity(); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -AZ::Entity* UiEntityContext::CloneRootAssetEntity() -{ - AZ::SerializeContext* context = nullptr; - EBUS_EVENT_RESULT(context, AZ::ComponentApplicationBus, GetSerializeContext); - - AZ::Entity* rootAssetEntity = GetRootAssetEntity(); - - AZ::Entity* clonedRootAssetEntity = context->CloneObject(rootAssetEntity); - return clonedRootAssetEntity; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -AZ::Entity* UiEntityContext::CreateUiEntity(const char* name) -{ - AZ::Entity* entity = CreateEntity(name); - - if (entity) - { - // we don't currently do anything extra here, UI entities are not automatically - // Init'ed and Activate'd when they are created. We wait until the required components - // are added before Init and Activate - } - - return entity; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::AddUiEntity(AZ::Entity* entity) -{ - AZ_Assert(entity, "Supplied entity is invalid."); - - AddEntity(entity); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::AddUiEntities(const AzFramework::EntityContext::EntityList& entities) -{ - AZ::PrefabAsset* rootSlice = m_rootAsset.Get(); - - for (AZ::Entity* entity : entities) - { - AZ_Assert(!AzFramework::EntityIdContextQueryBus::MultiHandler::BusIsConnectedId(entity->GetId()), "Entity already in context."); - rootSlice->GetComponent()->AddEntity(entity); - } - - HandleEntitiesAdded(entities); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -bool UiEntityContext::CloneUiEntities(const AZStd::vector& sourceEntities, AzFramework::EntityContext::EntityList& resultEntities) -{ - resultEntities.clear(); - - AZ::PrefabComponent::InstantiatedContainer sourceObjects; - for (const AZ::EntityId& id : sourceEntities) - { - AZ::Entity* entity = nullptr; - EBUS_EVENT_RESULT(entity, AZ::ComponentApplicationBus, FindEntity, id); - if (entity) - { - sourceObjects.m_entities.push_back(entity); - } - } - - AZ::PrefabComponent::EntityIdToEntityIdMap idMap; - AZ::PrefabComponent::InstantiatedContainer* clonedObjects = - AZ::Utils::CloneObjectAndFixEntities(&sourceObjects, idMap); - if (!clonedObjects) - { - AZ_Error("UiEntityContext", false, "Failed to clone source entities."); - return false; - } - - resultEntities = clonedObjects->m_entities; - - AddUiEntities(resultEntities); - - sourceObjects.m_entities.clear(); - clonedObjects->m_entities.clear(); - delete clonedObjects; - - return true; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -bool UiEntityContext::DestroyUiEntity(AZ::EntityId entityId) -{ - if (DestroyEntity(entityId)) - { - return true; - } - - return false; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -bool UiEntityContext::HandleLoadedRootSliceEntity(AZ::Entity* rootEntity, bool remapIds, AZ::PrefabComponent::EntityIdToEntityIdMap* idRemapTable) -{ - AZ_Assert(m_rootAsset, "The context has not been initialized."); - - if (!AzFramework::EntityContext::HandleLoadedRootSliceEntity(rootEntity, remapIds, idRemapTable)) - { - return false; - } - - AZ::PrefabComponent::EntityList entities; - GetRootSlice()->GetEntities(entities); - - GetRootSlice()->SetIsDynamic(true); - - InitializeEntities(entities); - - return true; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::OnContextEntitiesAdded(const AzFramework::EntityContext::EntityList& entities) -{ - EntityContext::OnContextEntitiesAdded(entities); - - InitializeEntities(entities); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::OnContextEntityRemoved(const AZ::EntityId& entityId) -{ -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::SetupUiEntity(AZ::Entity* entity) -{ - InitializeEntities({ entity }); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::InitializeEntities(const AzFramework::EntityContext::EntityList& entities) -{ - // UI entities are now automatically activated on creation - - for (AZ::Entity* entity : entities) - { - if (entity->GetState() == AZ::Entity::ES_CONSTRUCTED) - { - entity->Init(); - } - } - - for (AZ::Entity* entity : entities) - { - if (entity->GetState() == AZ::Entity::ES_INIT) - { - entity->Activate(); - } - } -} From 845d72c54295aba6e35bc648abf85b344f228835 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:58:08 -0800 Subject: [PATCH 280/620] Removes AnimTrack.cpp and AnimSplineTrack.cpp from Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../LyShine/Code/Source/Animation/AnimSplineTrack.cpp | 11 ----------- Gems/LyShine/Code/Source/Animation/AnimTrack.cpp | 10 ---------- Gems/LyShine/Code/lyshine_static_files.cmake | 3 --- 3 files changed, 24 deletions(-) delete mode 100644 Gems/LyShine/Code/Source/Animation/AnimSplineTrack.cpp delete mode 100644 Gems/LyShine/Code/Source/Animation/AnimTrack.cpp diff --git a/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.cpp b/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.cpp deleted file mode 100644 index 5e44bfdc2b..0000000000 --- a/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.cpp +++ /dev/null @@ -1,11 +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 - * - */ - - -#include "AnimSplineTrack.h" - diff --git a/Gems/LyShine/Code/Source/Animation/AnimTrack.cpp b/Gems/LyShine/Code/Source/Animation/AnimTrack.cpp deleted file mode 100644 index 080e0b05a6..0000000000 --- a/Gems/LyShine/Code/Source/Animation/AnimTrack.cpp +++ /dev/null @@ -1,10 +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 - * - */ - - -#include "AnimTrack.h" diff --git a/Gems/LyShine/Code/lyshine_static_files.cmake b/Gems/LyShine/Code/lyshine_static_files.cmake index 925658e756..376a53f724 100644 --- a/Gems/LyShine/Code/lyshine_static_files.cmake +++ b/Gems/LyShine/Code/lyshine_static_files.cmake @@ -102,7 +102,6 @@ set(FILES Source/UiImageSequenceComponent.h Source/UiRenderer.cpp Source/UiRenderer.h - Source/resource.h Include/LyShine/LyShineBus.h Source/EditorPropertyTypes.cpp Source/EditorPropertyTypes.h @@ -207,10 +206,8 @@ set(FILES Source/Animation/AnimNode.h Source/Animation/AnimSequence.cpp Source/Animation/AnimSequence.h - Source/Animation/AnimSplineTrack.cpp Source/Animation/AnimSplineTrack.h Source/Animation/AnimSplineTrack_Vec2Specialization.h - Source/Animation/AnimTrack.cpp Source/Animation/AnimTrack.h Source/Animation/AzEntityNode.cpp Source/Animation/AzEntityNode.h From ba6cad1ac1183aea08830909f8f987d7072cdfac Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:06:54 -0800 Subject: [PATCH 281/620] Removes AnimTrack.cpp and AnimSplineTrack.cpp from Gems/Maestro Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Source/Cinematics/AnimSplineTrack.cpp | 11 ----------- Gems/Maestro/Code/Source/Cinematics/AnimTrack.cpp | 10 ---------- Gems/Maestro/Code/maestro_static_files.cmake | 2 -- 3 files changed, 23 deletions(-) delete mode 100644 Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.cpp delete mode 100644 Gems/Maestro/Code/Source/Cinematics/AnimTrack.cpp diff --git a/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.cpp b/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.cpp deleted file mode 100644 index 5e44bfdc2b..0000000000 --- a/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.cpp +++ /dev/null @@ -1,11 +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 - * - */ - - -#include "AnimSplineTrack.h" - diff --git a/Gems/Maestro/Code/Source/Cinematics/AnimTrack.cpp b/Gems/Maestro/Code/Source/Cinematics/AnimTrack.cpp deleted file mode 100644 index 080e0b05a6..0000000000 --- a/Gems/Maestro/Code/Source/Cinematics/AnimTrack.cpp +++ /dev/null @@ -1,10 +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 - * - */ - - -#include "AnimTrack.h" diff --git a/Gems/Maestro/Code/maestro_static_files.cmake b/Gems/Maestro/Code/maestro_static_files.cmake index 4e576dfbe5..da92f90347 100644 --- a/Gems/Maestro/Code/maestro_static_files.cmake +++ b/Gems/Maestro/Code/maestro_static_files.cmake @@ -23,8 +23,6 @@ set(FILES Source/Cinematics/Movie.h Source/Cinematics/TCBSpline.h Source/Cinematics/resource.h - Source/Cinematics/AnimSplineTrack.cpp - Source/Cinematics/AnimTrack.cpp Source/Cinematics/AssetBlendTrack.cpp Source/Cinematics/BoolTrack.cpp Source/Cinematics/CaptureTrack.cpp From c8dd05b154728b10f1a4b4689a58c7fd3f3dbe4d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:10:20 -0800 Subject: [PATCH 282/620] Removes Cinematic/resource.h from Gems/Maestro Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Maestro/Code/Source/Cinematics/resource.h | 21 ------------------- Gems/Maestro/Code/maestro_static_files.cmake | 1 - 2 files changed, 22 deletions(-) delete mode 100644 Gems/Maestro/Code/Source/Cinematics/resource.h diff --git a/Gems/Maestro/Code/Source/Cinematics/resource.h b/Gems/Maestro/Code/Source/Cinematics/resource.h deleted file mode 100644 index eb3d76bc60..0000000000 --- a/Gems/Maestro/Code/Source/Cinematics/resource.h +++ /dev/null @@ -1,21 +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 - * - */ - - -#define VS_VERSION_INFO 1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/Gems/Maestro/Code/maestro_static_files.cmake b/Gems/Maestro/Code/maestro_static_files.cmake index da92f90347..688ae1d074 100644 --- a/Gems/Maestro/Code/maestro_static_files.cmake +++ b/Gems/Maestro/Code/maestro_static_files.cmake @@ -22,7 +22,6 @@ set(FILES Source/Cinematics/CharacterTrackAnimator.h Source/Cinematics/Movie.h Source/Cinematics/TCBSpline.h - Source/Cinematics/resource.h Source/Cinematics/AssetBlendTrack.cpp Source/Cinematics/BoolTrack.cpp Source/Cinematics/CaptureTrack.cpp From bc27465a3c1456465562f1b793658ffa8717be74 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:16:46 -0800 Subject: [PATCH 283/620] Removes TCBSpline.h from Gems/Maestro Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Source/Animation/AnimSplineTrack.h | 1 - .../Code/Source/Cinematics/AnimSplineTrack.h | 1 - .../Code/Source/Cinematics/TCBSpline.h | 856 ------------------ Gems/Maestro/Code/maestro_static_files.cmake | 1 - 4 files changed, 859 deletions(-) delete mode 100644 Gems/Maestro/Code/Source/Cinematics/TCBSpline.h diff --git a/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.h b/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.h index 8859118e00..882934d8ee 100644 --- a/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.h +++ b/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.h @@ -10,7 +10,6 @@ #pragma once #include -//#include "TCBSpline.h" #include "2DSpline.h" #define MIN_TIME_PRECISION 0.01f diff --git a/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.h b/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.h index 93f71d64ac..e621d0ef87 100644 --- a/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.h +++ b/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.h @@ -13,7 +13,6 @@ #pragma once #include "IMovieSystem.h" -#include "TCBSpline.h" #include "2DSpline.h" #define MIN_TIME_PRECISION 0.01f diff --git a/Gems/Maestro/Code/Source/Cinematics/TCBSpline.h b/Gems/Maestro/Code/Source/Cinematics/TCBSpline.h deleted file mode 100644 index 35eca3ed00..0000000000 --- a/Gems/Maestro/Code/Source/Cinematics/TCBSpline.h +++ /dev/null @@ -1,856 +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 : Classes for TCB Spline curves -// Notice : Deprecated by 2DSpline h - - -#ifndef CRYINCLUDE_CRYMOVIE_TCBSPLINE_H -#define CRYINCLUDE_CRYMOVIE_TCBSPLINE_H -#pragma once - - -#include - - - - -namespace spline -{ - //! Quaternion interpolation for angles > 2PI. - ILINE static Quat CreateSquadRev(f32 angle, // angle of rotation - const Vec3& axis, // the axis of rotation - const Quat& p, // start quaternion - const Quat& a, // start tangent quaternion - const Quat& b, // end tangent quaternion - const Quat& q, // end quaternion - f32 t) // Time parameter, in range [0,1] - { - f32 s, v; - f32 omega = 0.5f * angle; - f32 nrevs = 0; - Quat r, pp, qq; - - if (omega < (gf_PI - 0.00001f)) - { - return Quat::CreateSquad(p, a, b, q, t); - } - - while (omega > (gf_PI - 0.00001f)) - { - omega -= gf_PI; - nrevs += 1.0f; - } - if (omega < 0) - { - omega = 0; - } - s = t * angle / gf_PI; // 2t(omega+Npi)/pi - - if (s < 1.0f) - { - pp = p * Quat(0.0f, axis);//pp = p.Orthog( axis ); - r = Quat::CreateSquad(p, a, pp, pp, s); // in first 90 degrees. - } - else - { - v = s + 1.0f - 2.0f * (nrevs + (omega / gf_PI)); - if (v <= 0.0f) - { - // middle part, on great circle(p,q). - while (s >= 2.0f) - { - s -= 2.0f; - } - pp = p * Quat(0.0f, axis);//pp = p.Orthog(axis); - r = Quat::CreateSlerp(p, pp, s); - } - else - { - // in last 90 degrees. - qq = -q* Quat(0.0f, axis); - r = Quat::CreateSquad(qq, qq, b, q, v); - } - } - return r; - } - - - - - /** TCB spline key extended for tangent unify/break. - */ - template - struct TCBSplineKeyEx - : public TCBSplineKey - { - float theta_from_dd_to_ds; - float scale_from_dd_to_ds; - - void ComputeThetaAndScale() { assert(0); } - void SetOutTangentFromIn() { assert(0); } - void SetInTangentFromOut() { assert(0); } - - TCBSplineKeyEx() - : theta_from_dd_to_ds(gf_PI) - , scale_from_dd_to_ds(1.0f) {} - }; - - template <> - inline void TCBSplineKeyEx::ComputeThetaAndScale() - { - scale_from_dd_to_ds = (easeto + 1.0f) / (easefrom + 1.0f); - float out = atan_tpl(dd); - float in = atan_tpl(ds); - theta_from_dd_to_ds = in + gf_PI - out; - } - - template<> - inline void TCBSplineKeyEx::SetOutTangentFromIn() - { - assert((flags & SPLINE_KEY_TANGENT_ALL_MASK) == SPLINE_KEY_TANGENT_UNIFIED); - easefrom = (easeto + 1.0f) / scale_from_dd_to_ds - 1.0f; - if (easefrom > 1) - { - easefrom = 1.0f; - } - else if (easefrom < 0) - { - easefrom = 0; - } - float in = atan_tpl(ds); - dd = tan_tpl(in + gf_PI - theta_from_dd_to_ds); - } - - template<> - inline void TCBSplineKeyEx::SetInTangentFromOut() - { - assert((flags & SPLINE_KEY_TANGENT_ALL_MASK) == SPLINE_KEY_TANGENT_UNIFIED); - easeto = scale_from_dd_to_ds * (easefrom + 1.0f) - 1.0f; - if (easeto > 1) - { - easeto = 1.0f; - } - else if (easeto < 0) - { - easeto = 0; - } - float out = atan_tpl(dd); - ds = tan_tpl(out + theta_from_dd_to_ds - gf_PI); - } - - /**************************************************************************** - ** TCBSpline class implementation ** - ****************************************************************************/ - template > - class TCBSpline - : public TSpline< Key, HermitBasis > - { - public: - virtual void comp_deriv(); - - protected: - virtual void interp_keys(int key1, int key2, float u, T& val); - float calc_ease(float t, float a, float b); - - private: - void compMiddleDeriv(int curr); - void compFirstDeriv(); - void compLastDeriv(); - void comp2KeyDeriv(); - }; - - ////////////////////////////////////////////////////////////////////////// - template - inline void TCBSpline::compMiddleDeriv(int curr) - { - float dsA, dsB, ddA, ddB; - float A, B, cont1, cont2; - int last = this->num_keys() - 1; - - dsA = 0; - ddA = 0; - - // dsAdjust,ddAdjust apply speed correction when continuity is 0. - // Middle key. - if (curr == 0) - { - // First key. - float dts = (this->GetRangeEnd() - this->time(last)) + (this->time(0) - this->GetRangeStart()); - float fDiv = (dts + this->time(1) - this->time(0)); - if (fDiv != 0.0f) - { - float dt = 2.0f / fDiv; - dsA = dt * dts; - ddA = dt * (this->time(1) - this->time(0)); - } - } - else - { - if (curr == last) - { - // Last key. - float dts = (this->GetRangeEnd() - this->time(last)) + (this->time(0) - this->GetRangeStart()); - float fDiv = (dts + this->time(last) - this->time(last - 1)); - if (fDiv != 0.0f) - { - float dt = 2.0f / fDiv; - dsA = dt * dts; - ddA = dt * (this->time(last) - this->time(last - 1)); - } - } - else - { - // Middle key. - float fDiv = this->time(curr + 1) - this->time(curr - 1); - if (fDiv != 0.f) - { - float dt = 2.0f / fDiv; - dsA = dt * (this->time(curr) - this->time(curr - 1)); - ddA = dt * (this->time(curr + 1) - this->time(curr)); - } - } - } - typename TSpline::key_type& k = this->key(curr); - T ds0 = k.ds; - T dd0 = k.dd; - - float c = (float)fabs(k.cont); - float sa = dsA + c * (1.0f - dsA); - float da = ddA + c * (1.0f - ddA); - - A = 0.5f * (1.0f - k.tens) * (1.0f + k.bias); - B = 0.5f * (1.0f - k.tens) * (1.0f - k.bias); - cont1 = (1.0f - k.cont); - cont2 = (1.0f + k.cont); - //dsA = dsA * A * cont1; - //dsB = dsA * B * cont2; - //ddA = ddA * A * cont2; - //ddB = ddA * B * cont1; - dsA = sa * A * cont1; - dsB = sa * B * cont2; - ddA = da * A * cont2; - ddB = da * B * cont1; - - T qp, qn; - if (curr > 0) - { - qp = this->value(curr - 1); - } - else - { - qp = this->value(last); - } - if (curr < last) - { - qn = this->value(curr + 1); - } - else - { - qn = this->value(0); - } - k.ds = Concatenate(dsA * Subtract(k.value, qp), dsB * Subtract(qn, k.value)); - k.dd = Concatenate(ddA * Subtract(k.value, qp), ddB * Subtract(qn, k.value)); - - switch (this->GetInTangentType(curr)) - { - case SPLINE_KEY_TANGENT_STEP: - case SPLINE_KEY_TANGENT_ZERO: - Zero(k.ds); - break; - case SPLINE_KEY_TANGENT_LINEAR: - k.ds = Subtract(k.value, qp); - break; - case SPLINE_KEY_TANGENT_CUSTOM: - k.ds = ds0; - break; - } - switch (this->GetOutTangentType(curr)) - { - case SPLINE_KEY_TANGENT_STEP: - case SPLINE_KEY_TANGENT_ZERO: - Zero(k.dd); - break; - case SPLINE_KEY_TANGENT_LINEAR: - k.dd = Subtract(qn, k.value); - break; - case SPLINE_KEY_TANGENT_CUSTOM: - k.dd = dd0; - break; - } - } - - template - inline void TCBSpline::compFirstDeriv() - { - typename TSpline::key_type& k = this->key(0); - - if (this->GetInTangentType(0) != SPLINE_KEY_TANGENT_CUSTOM) - { - Zero(k.ds); - } - - if (this->GetOutTangentType(0) != SPLINE_KEY_TANGENT_CUSTOM) - { - k.dd = 0.5f * - (1.0f - k.tens) * (3.0f * - Subtract(Subtract(this->value(1), k.value), this->ds(1))); - } - } - - template - inline void TCBSpline::compLastDeriv() - { - int last = this->num_keys() - 1; - typename TSpline::key_type& k = this->key(last); - - if (this->GetInTangentType(last) != SPLINE_KEY_TANGENT_CUSTOM) - { - k.ds = -0.5f * (1.0f - - k.tens) * (3.0f * - Concatenate(Subtract(this->value(last - 1), k.value), this->dd(last - 1))); - } - - if (this->GetOutTangentType(last) != SPLINE_KEY_TANGENT_CUSTOM) - { - Zero(k.dd); - } - } - - template - inline void TCBSpline::comp2KeyDeriv() - { - typename TSpline::key_type& k1 = this->key(0); - typename TSpline::key_type& k2 = this->key(1); - - typename TSpline::value_type val = Subtract(this->value(1), this->value(0)); - - if (this->GetInTangentType(0) != SPLINE_KEY_TANGENT_CUSTOM) - { - Zero(k1.ds); - } - if (this->GetOutTangentType(0) != SPLINE_KEY_TANGENT_CUSTOM) - { - k1.dd = (1.0f - k1.tens) * val; - } - if (this->GetInTangentType(1) != SPLINE_KEY_TANGENT_CUSTOM) - { - k2.ds = (1.0f - k2.tens) * val; - } - if (this->GetOutTangentType(1) != SPLINE_KEY_TANGENT_CUSTOM) - { - Zero(k2.dd); - } - } - - template - inline void TCBSpline::comp_deriv() - { - if (this->num_keys() > 1) - { - if ((this->num_keys() == 2) && !this->closed()) - { - comp2KeyDeriv(); - return; - } - if (this->closed()) - { - for (int i = 0; i < this->num_keys(); ++i) - { - compMiddleDeriv(i); - } - } - else - { - for (int i = 1; i < (this->num_keys() - 1); ++i) - { - compMiddleDeriv(i); - } - compFirstDeriv(); - compLastDeriv(); - } - } - this->SetModified(false); - } - - template - inline float TCBSpline::calc_ease(float t, float a, float b) - { - float k; - float s = a + b; - - if (t == 0.0f || t == 1.0f) - { - return t; - } - if (s == 0.0f) - { - return t; - } - if (s > 1.0f) - { - k = 1.0f / s; - a *= k; - b *= k; - } - k = 1.0f / (2.0f - a - b); - if (t < a) - { - return ((k / a) * t * t); - } - else - { - if (t < 1.0f - b) - { - return (k * (2.0f * t - a)); - } - else - { - t = 1.0f - t; - return (1.0f - (k / b) * t * t); - } - } - } - - template - inline void TCBSpline::interp_keys(int from, int to, float u, T& val) - { - if (this->GetOutTangentType(from) == SPLINE_KEY_TANGENT_STEP) - { - val = this->value(to); - } - else if (this->GetInTangentType(to) == SPLINE_KEY_TANGENT_STEP) - { - val = this->value(from); - } - else - { - u = calc_ease(u, this->key(from).easefrom, this->key(to).easeto); - typename TSpline::basis_type basis(u); - val = Concatenate( - Concatenate( - Concatenate( - (basis[0] * this->value(from)), (basis[1] * this->value(to)) - ), - (basis[2] * this->dd(from)) - ), - (basis[3] * this->ds(to)) - ); - } - } - - - - /**************************************************************************** - ** TCBQuatSpline class implementation ** - ****************************************************************************/ - ////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// - class TCBQuatSpline - : public TCBSpline - { - public: - //void interpolate( float time,value_type& val ); - void comp_deriv(); - - protected: - void interp_keys(int key1, int key2, float u, value_type& val); - - private: - void compKeyDeriv(int curr); - - // Loacal function to add quaternions. - Quat AddQuat(const Quat& q1, const Quat& q2) - { - return Quat(q1.w + q2.w, q1.v.x + q2.v.x, q1.v.y + q2.v.y, q1.v.z + q2.v.z); - } - }; - - inline void TCBQuatSpline::interp_keys(int from, int to, float u, value_type& val) - { - u = calc_ease(u, key(from).easefrom, key(to).easeto); - basis_type basis(u); - //val = SquadRev( angle(to),axis(to), value(from), dd(from), ds(to), value(to), u ); - val = Quat::CreateSquad(value(from), dd(from), ds(to), value(to), u); - val = (val).GetNormalized(); // Normalize quaternion. - } - - - inline void TCBQuatSpline::comp_deriv() - { - if (num_keys() > 1) - { - for (int i = 0; i < num_keys(); ++i) - { - compKeyDeriv(i); - } - } - this->SetModified(false); - } - - - - inline void TCBQuatSpline::compKeyDeriv(int curr) - { - Quat qp, qm; - float fp, fn; - int last = num_keys() - 1; - - if (curr > 0 || closed()) - { - int prev = (curr != 0) ? curr - 1 : last; - qm = value(prev); - if ((qm | (value(curr))) < 0.0f) - { - qm = -qm; - } - qm = Quat::LnDif(qm.GetNormalizedSafe(), value(curr).GetNormalizedSafe()); - } - - if (curr < last || closed()) - { - int next = (curr != last) ? curr + 1 : 0; - Quat qnext = value(next); - if ((qnext | (value(curr))) < 0.0f) - { - qnext = -qnext; - } - qp = value(curr); - qp = Quat::LnDif(qp.GetNormalizedSafe(), qnext.GetNormalizedSafe()); - } - - if (curr == 0 && !closed()) - { - qm = qp; - } - if (curr == last && !closed()) - { - qp = qm; - } - - key_type& k = key(curr); - float c = (float)fabs(k.cont); - - fp = fn = 1.0f; - if ((curr > 0 && curr < last) || closed()) - { - if (curr == 0) - { - // First key. - float dts = (this->GetRangeEnd() - this->time(last)) + (this->time(0) - this->GetRangeStart()); - float fDiv = (dts + this->time(1) - this->time(0)); - if (fDiv != 0.0f) - { - float dt = 2.0f / fDiv; - fp = dt * dts; - fn = dt * (this->time(1) - this->time(0)); - } - } - else - { - if (curr == last) - { - // Last key. - float dts = (this->GetRangeEnd() - this->time(last)) + (this->time(0) - this->GetRangeStart()); - float fDiv = (dts + this->time(last) - this->time(last - 1)); - if (fDiv != 0.0f) - { - float dt = 2.0f / fDiv; - fp = dt * dts; - fn = dt * (this->time(last) - this->time(last - 1)); - } - } - else - { - // Middle key. - float fDiv = (this->time(curr + 1) - this->time(curr - 1)); - if (fDiv != 0.0f) - { - float dt = 2.0f / fDiv; - fp = dt * (this->time(curr) - this->time(curr - 1)); - fn = dt * (this->time(curr + 1) - this->time(curr)); - } - } - } - fp += c - c * fp; - fn += c - c * fn; - } - - float tm, cm, cp, bm, bp, tmcm, tmcp, ksm, ksp, kdm, kdp; - - cm = 1.0f - k.cont; - tm = 0.5f * (1.0f - k.tens); - cp = 2.0f - cm; - bm = 1.0f - k.bias; - bp = 2.0f - bm; - tmcm = tm * cm; - tmcp = tm * cp; - ksm = 1.0f - tmcm * bp * fp; - ksp = -tmcp * bm * fp; - kdm = tmcp * bp * fn; - kdp = tmcm * bm * fn - 1.0f; - - Quat qa = 0.5f * AddQuat(kdm * qm, kdp * qp); - Quat qb = 0.5f * AddQuat(ksm * qm, ksp * qp); - qa = Quat::exp(qa.v); - qb = Quat::exp(qb.v); - - // ds = qb, dd = qa. - k.ds = value(curr) * qb; - k.dd = value(curr) * qa; - } - - /**************************************************************************** - ** TCBAngleAxisSpline class implementation ** - ****************************************************************************/ - /////////////////////////////////////////////////////////////////////////////// - // - // TCBAngleAxisSpline takes as input relative Angle-Axis values. - // Interpolated result is returned as Normalized quaternion. - // - ////////////////////////////////////////////////////////////////////////// - struct SAngleAxis - { - float angle; - Vec3 axis; - }; - - - class TCBAngleAxisSpline - : public TCBSpline - { - public: - //void interpolate( float time,value_type& val ); - void comp_deriv(); - - // Angle axis used for quaternion. - float& angle(int i) { return key(i).angle; }; - Vec3& axis(int i) { return key(i).axis; }; - - protected: - void interp_keys(int key1, int key2, float u, value_type& val); - - private: - virtual void compKeyDeriv(int curr); - - // Loacal function to add quaternions. - Quat AddQuat(const Quat& q1, const Quat& q2) - { - return Quat(q1.w + q2.w, q1.v.x + q2.v.x, q1.v.y + q2.v.y, q1.v.z + q2.v.z); - } - }; - - ////////////////////////////////////////////////////////////////////////// - inline void TCBAngleAxisSpline::interp_keys(int from, int to, float u, value_type& val) - { - u = calc_ease(u, key(from).easefrom, key(to).easeto); - basis_type basis(u); - val = CreateSquadRev(angle(to), axis(to), value(from), dd(from), ds(to), value(to), u); - val = (val).GetNormalized(); // Normalize quaternion. - } - - ////////////////////////////////////////////////////////////////////////// - inline void TCBAngleAxisSpline::comp_deriv() - { - // Convert from relative angle-axis to absolute quaternion. - Quat q, lastq; - lastq.SetIdentity(); - for (int i = 0; i < num_keys(); ++i) - { - q.SetRotationAA(angle(i), axis(i)); - q.Normalize(); // Normalize quaternion - q = lastq * q; - lastq = q; - value(i) = q; - } - - if (num_keys() > 1) - { - for (int i = 0; i < num_keys(); ++i) - { - compKeyDeriv(i); - } - } - this->SetModified(false); - } - - ////////////////////////////////////////////////////////////////////////// - inline void TCBAngleAxisSpline::compKeyDeriv(int curr) - { - Quat qp, qm; - float fp, fn; - int last = num_keys() - 1; - - if (curr > 0 || closed()) - { - int prev = (curr != 0) ? curr - 1 : last; - if (angle(curr) > gf_PI2) - { - Vec3 a = axis(curr); - qm = Quat(0, Quat::log(Quat(0, a.x, a.y, a.z))); - } - else - { - qm = value(prev); - if ((qm | (value(curr))) < 0.0f) - { - qm = -qm; - } - qm = Quat::LnDif(qm, value(curr)); - } - } - - if (curr < last || closed()) - { - int next = (curr != last) ? curr + 1 : 0; - if (angle(next) > gf_PI2) - { - Vec3 a = axis(next); - qp = Quat(0, Quat::log(Quat(0, a.x, a.y, a.z))); - } - else - { - Quat qnext = value(next); - if ((qnext | (value(curr))) < 0.0f) - { - qnext = -qnext; - } - qp = value(curr); - qp = Quat::LnDif(qp, qnext); - } - } - - if (curr == 0 && !closed()) - { - qm = qp; - } - if (curr == last && !closed()) - { - qp = qm; - } - - key_type& k = key(curr); - float c = (float)fabs(k.cont); - - fp = fn = 1.0f; - if ((curr > 0 && curr < last) || closed()) - { - if (curr == 0) - { - // First key. - float dts = (this->GetRangeEnd() - this->time(last)) + (this->time(0) - this->GetRangeStart()); - float dt = 2.0f / (dts + this->time(1) - this->time(0)); - fp = dt * dts; - fn = dt * (this->time(1) - this->time(0)); - } - else - { - if (curr == last) - { - // Last key. - float dts = (this->GetRangeEnd() - this->time(last)) + (this->time(0) - this->GetRangeStart()); - float dt = 2.0f / (dts + this->time(last) - this->time(last - 1)); - fp = dt * dts; - fn = dt * (this->time(last) - this->time(last - 1)); - } - else - { - // Middle key. - float dt = 2.0f / (this->time(curr + 1) - this->time(curr - 1)); - fp = dt * (this->time(curr) - this->time(curr - 1)); - fn = dt * (this->time(curr + 1) - this->time(curr)); - } - } - fp += c - c * fp; - fn += c - c * fn; - } - - float tm, cm, cp, bm, bp, tmcm, tmcp, ksm, ksp, kdm, kdp; - - cm = 1.0f - k.cont; - tm = 0.5f * (1.0f - k.tens); - cp = 2.0f - cm; - bm = 1.0f - k.bias; - bp = 2.0f - bm; - tmcm = tm * cm; - tmcp = tm * cp; - ksm = 1.0f - tmcm * bp * fp; - ksp = -tmcp * bm * fp; - kdm = tmcp * bp * fn; - kdp = tmcm * bm * fn - 1.0f; - - const Vec3 va = 0.5f * (kdm * qm.v + kdp * qp.v); - const Vec3 vb = 0.5f * (ksm * qm.v + ksp * qp.v); - - const Quat qa = Quat::exp(va); - const Quat qb = Quat::exp(vb); - - // ds = qb, dd = qa. - k.ds = value(curr) * qb; - k.dd = value(curr) * qa; - } - - - ////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// - template - class TrackSplineInterpolator - : public spline::CBaseSplineInterpolator< T, spline::TCBSpline > > - { - typedef typename spline::CBaseSplineInterpolator< T, spline::TCBSpline > > I; - public: - virtual void SerializeSpline(XmlNodeRef& node, bool bLoading) {}; - virtual void SetKeyFlags(int k, int flags) - { - if (k >= 0 && k < this->num_keys()) - { - if ((this->key(k).flags & SPLINE_KEY_TANGENT_ALL_MASK) != SPLINE_KEY_TANGENT_UNIFIED - && (flags & SPLINE_KEY_TANGENT_ALL_MASK) == SPLINE_KEY_TANGENT_UNIFIED) - { - this->key(k).ComputeThetaAndScale(); - } - } - spline::CBaseSplineInterpolator< T, spline::TCBSpline > >::SetKeyFlags(k, flags); - } - virtual void SetKeyInTangent(int k, ISplineInterpolator::ValueType tin) - { - if (k >= 0 && k < this->num_keys()) - { - I::FromValueType(tin, this->key(k).ds); - if ((this->key(k).flags & SPLINE_KEY_TANGENT_ALL_MASK) == SPLINE_KEY_TANGENT_UNIFIED) - { - this->key(k).SetOutTangentFromIn(); - } - this->SetModified(true); - } - } - virtual void SetKeyOutTangent(int k, ISplineInterpolator::ValueType tout) - { - if (k >= 0 && k < this->num_keys()) - { - I::FromValueType(tout, this->key(k).dd); - if ((this->key(k).flags & SPLINE_KEY_TANGENT_ALL_MASK) == SPLINE_KEY_TANGENT_UNIFIED) - { - this->key(k).SetInTangentFromOut(); - } - this->SetModified(true); - } - } - }; - - template <> - class TrackSplineInterpolator - : public spline::CBaseSplineInterpolator< Quat, spline::TCBQuatSpline > - { - public: - virtual void SerializeSpline([[maybe_unused]] XmlNodeRef& node, [[maybe_unused]] bool bLoading) {}; - }; -}; // namespace spline - -#endif // CRYINCLUDE_CRYMOVIE_TCBSPLINE_H diff --git a/Gems/Maestro/Code/maestro_static_files.cmake b/Gems/Maestro/Code/maestro_static_files.cmake index 688ae1d074..809f4b3b22 100644 --- a/Gems/Maestro/Code/maestro_static_files.cmake +++ b/Gems/Maestro/Code/maestro_static_files.cmake @@ -21,7 +21,6 @@ set(FILES Source/Cinematics/AnimSequence.h Source/Cinematics/CharacterTrackAnimator.h Source/Cinematics/Movie.h - Source/Cinematics/TCBSpline.h Source/Cinematics/AssetBlendTrack.cpp Source/Cinematics/BoolTrack.cpp Source/Cinematics/CaptureTrack.cpp From 2a924dd7ceeeb8abd0d6ee5085c247861c6257a6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:25:10 -0800 Subject: [PATCH 284/620] Removes WAVUtil.h from Gems/Micropohone Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/Microphone/Code/CMakeLists.txt | 2 - .../Code/Include/Microphone/WAVUtil.h | 108 ------------------ Gems/Microphone/Code/microphone_files.cmake | 1 - 3 files changed, 111 deletions(-) delete mode 100644 Gems/Microphone/Code/Include/Microphone/WAVUtil.h diff --git a/Gems/Microphone/Code/CMakeLists.txt b/Gems/Microphone/Code/CMakeLists.txt index 873d05e98d..bde4f59e4e 100644 --- a/Gems/Microphone/Code/CMakeLists.txt +++ b/Gems/Microphone/Code/CMakeLists.txt @@ -17,8 +17,6 @@ ly_add_target( PLATFORM_INCLUDE_FILES ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake INCLUDE_DIRECTORIES - PRIVATE - Include PUBLIC Source BUILD_DEPENDENCIES diff --git a/Gems/Microphone/Code/Include/Microphone/WAVUtil.h b/Gems/Microphone/Code/Include/Microphone/WAVUtil.h deleted file mode 100644 index 9fdcc95a97..0000000000 --- a/Gems/Microphone/Code/Include/Microphone/WAVUtil.h +++ /dev/null @@ -1,108 +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 - * - */ - -#include - -namespace Audio -{ - struct WAVHeader - { - AZ::u8 riffTag[4]; - AZ::u32 fileSize; - AZ::u8 waveTag[4]; - AZ::u8 fmtTag[4]; - AZ::u32 fmtSize; - AZ::u16 audioFormat; - AZ::u16 channels; - AZ::u32 sampleRate; - AZ::u32 byteRate; - AZ::u16 blockAlign; - AZ::u16 bitsPerSample; - AZ::u8 dataTag[4]; - AZ::u32 dataSize; - - // defaults to 16 KHz 16 bit mono PCM format - inline WAVHeader() - : fileSize { 0 } - , fmtSize { 16 } - , audioFormat { 1 } - , channels { 1 } - , sampleRate { 16000 } - , bitsPerSample { 16 } - , byteRate { 16000 * 2 } // 16 bit is 2 bytes per sample - , blockAlign { 2 } - , dataSize { 0 } - { - memcpy(riffTag, "RIFF", 4); - memcpy(waveTag, "WAVE", 4); - memcpy(fmtTag, "fmt ", 4); - memcpy(dataTag, "data", 4); - } - }; - - - class WAVUtil - { - public: - WAVHeader m_wavHeader; - - inline WAVUtil(AZ::u32 sampleRate, AZ::u16 bitsPerSample, AZ::u16 channels, bool isFloat) - { - m_wavHeader.sampleRate = sampleRate; - m_wavHeader.bitsPerSample = bitsPerSample; - m_wavHeader.channels = channels; - m_wavHeader.byteRate = static_cast(sampleRate * channels * (bitsPerSample / 8)); - m_wavHeader.audioFormat = isFloat ? 3 : 1; // 1 = PCM 3 = IEEE Float - } - - // Set the wav buffer to use for class operations. This buffer should have reserved - // space at the beginning of the buffer in the amount of sizeof(WAVHeader) which - // this function will write over. The remaining data should be sound data that - // matches your format - inline bool SetBuffer(AZ::u8* buffer, AZStd::size_t bufferSize) - { - if(buffer == nullptr || bufferSize <= sizeof(WAVHeader)) - { - return false; - } - m_buffer = buffer; - m_bufferSize = bufferSize; - m_wavHeader.fileSize = bufferSize - 8; // the 'RIFF' tag and filesize aren't counted in this. - m_wavHeader.dataSize = bufferSize - sizeof(WAVHeader); - AZ::u8* headerBuff = reinterpret_cast(&m_wavHeader); - ::memcpy(m_buffer, headerBuff, sizeof(WAVHeader)); - return true; - } - - inline bool WriteWAVToFile(const AZStd::string& filePath) - { - if(m_buffer == nullptr || m_bufferSize == 0) - { - AZ_TracePrintf("WAVUtil", "WAV buffer invalid, unable to write file. Buffer Ptr: %d, Buffer Size: %d\n", m_buffer, m_bufferSize); - return false; - } - AZ::IO::FileIOStream fileStream(filePath.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeBinary); - if (fileStream.IsOpen()) - { - [[maybe_unused]] auto bytesWritten = fileStream.Write(m_bufferSize, m_buffer); - AZ_TracePrintf("WAVUtil", "Wrote WAV file: %s, %d bytes\n", filePath.c_str(), bytesWritten); - return true; - } - else - { - AZ_TracePrintf("WAVUtil", "Unable to write WAV file, can't open stream for file %s\n", filePath.c_str()); - return false; - } - } - - private: - AZ::u8* m_buffer = nullptr; - AZStd::size_t m_bufferSize = 0; - - }; -} diff --git a/Gems/Microphone/Code/microphone_files.cmake b/Gems/Microphone/Code/microphone_files.cmake index 7ae423e995..4a8acf232d 100644 --- a/Gems/Microphone/Code/microphone_files.cmake +++ b/Gems/Microphone/Code/microphone_files.cmake @@ -11,5 +11,4 @@ set(FILES Source/MicrophoneSystemComponent.h Source/SimpleDownsample.cpp Source/SimpleDownsample.h - Include/Microphone/WAVUtil.h ) From 919c671bfd33734f57021a5ae5a85196f24bdfae Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:27:04 -0800 Subject: [PATCH 285/620] Removes WAVUtil.h from another file Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Platform/Android/MicrophoneSystemComponent_Android.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Gems/Microphone/Code/Source/Platform/Android/MicrophoneSystemComponent_Android.cpp b/Gems/Microphone/Code/Source/Platform/Android/MicrophoneSystemComponent_Android.cpp index 1e696f7978..eb9656e2a0 100644 --- a/Gems/Microphone/Code/Source/Platform/Android/MicrophoneSystemComponent_Android.cpp +++ b/Gems/Microphone/Code/Source/Platform/Android/MicrophoneSystemComponent_Android.cpp @@ -25,8 +25,6 @@ #include #include -#include - namespace Audio { class MicrophoneSystemEventsAndroid : public AZ::EBusTraits From be2e2ed4d121303993ae09cd776e0c88deda7cfb Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:46:40 -0800 Subject: [PATCH 286/620] Removes PhysicsUtils.h and PhysicsUtils.cpp from Gems/Multiplayer Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Multiplayer/Physics/PhysicsUtils.h | 33 ------ .../Code/Source/Physics/PhysicsUtils.cpp | 100 ------------------ Gems/Multiplayer/Code/multiplayer_files.cmake | 1 - 3 files changed, 134 deletions(-) delete mode 100644 Gems/Multiplayer/Code/Include/Multiplayer/Physics/PhysicsUtils.h delete mode 100644 Gems/Multiplayer/Code/Source/Physics/PhysicsUtils.cpp diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/Physics/PhysicsUtils.h b/Gems/Multiplayer/Code/Include/Multiplayer/Physics/PhysicsUtils.h deleted file mode 100644 index a93dcc7a65..0000000000 --- a/Gems/Multiplayer/Code/Include/Multiplayer/Physics/PhysicsUtils.h +++ /dev/null @@ -1,33 +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 - * - */ - -#pragma once - -#include - -namespace Multiplayer -{ - namespace Physics - { - //! Performs rewind-aware ray cast in the default physics world. - //! @param request The ray cast request to make. - //! @return Returns a structure that contains a list of Hits. - AzPhysics::SceneQueryHits RayCast(const AzPhysics::RayCastRequest& request); - - //! Performs rewind-aware shape cast in the default physics world. - //! @param request The shape cast request to make. - //! @return Returns a structure that contains a list of Hits. - AzPhysics::SceneQueryHits ShapeCast(const AzPhysics::ShapeCastRequest& request); - - //! Performs rewind-aware overlap in the default physics world. - //! @param request The overlap request to make. - //! @return Returns a structure that contains a list of Hits. - AzPhysics::SceneQueryHits Overlap(const AzPhysics::OverlapRequest& request); - - } // namespace Physics -} // namespace Multiplayer diff --git a/Gems/Multiplayer/Code/Source/Physics/PhysicsUtils.cpp b/Gems/Multiplayer/Code/Source/Physics/PhysicsUtils.cpp deleted file mode 100644 index c6f5a56422..0000000000 --- a/Gems/Multiplayer/Code/Source/Physics/PhysicsUtils.cpp +++ /dev/null @@ -1,100 +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 - * - */ - -#include - -#include -#include -#include -#include - -namespace -{ - template - AzPhysics::SceneQueryHits SceneQueryInternal(const RequestT& request) - { - auto* sceneInterface = AZ::Interface::Get(); - if (!sceneInterface) - { - return {}; - } - - AzPhysics::SceneHandle sceneHandle = sceneInterface->GetSceneHandle(AzPhysics::DefaultPhysicsSceneName); - if (sceneHandle == AzPhysics::InvalidSceneHandle) - { - return {}; - } - - Multiplayer::INetworkTime* currentNetTime = Multiplayer::GetNetworkTime(); - - if(!currentNetTime->IsTimeRewound()) - { - // If the time is not rewound, we simply execute the scene query as is. - AzPhysics::SceneQueryHits result = sceneInterface->QueryScene(sceneHandle, &request); - return result; - } - - // If the time is rewound, we want to query against rigid bodies present at the same frame ID: the same as the current rewound time is. - RequestT netSceneQueryRequest = request; - netSceneQueryRequest.m_filterCallback = [&request, currentFrameId = (uint32_t)currentNetTime->GetHostFrameId()]( - const AzPhysics::SimulatedBody* body, const ::Physics::Shape* shape) - { - if (body->GetFrameId() == AzPhysics::SimulatedBody::UndefinedFrameId || body->GetFrameId() == currentFrameId) - { - if (request.m_filterCallback) - { - return request.m_filterCallback(body, shape); - } - - // Overlap filter callbacks return true/false rather than Touch/Block/None - if constexpr (AZStd::is_same_v) - { - return true; - } - else - { - return AzPhysics::SceneQuery::QueryHitType::Touch; - } - } - - if constexpr (AZStd::is_same_v) - { - return false; - } - else - { - return AzPhysics::SceneQuery::QueryHitType::None; - } - }; - - // Execute the scene query modified for the time rewind. - AzPhysics::SceneQueryHits result = sceneInterface->QueryScene(sceneHandle, &netSceneQueryRequest); - return result; - } -} - -namespace Multiplayer -{ - namespace Physics - { - AzPhysics::SceneQueryHits RayCast(const AzPhysics::RayCastRequest& request) - { - return SceneQueryInternal(request); - } - - AzPhysics::SceneQueryHits ShapeCast(const AzPhysics::ShapeCastRequest& request) - { - return SceneQueryInternal(request); - } - - AzPhysics::SceneQueryHits Overlap(const AzPhysics::OverlapRequest& request) - { - return SceneQueryInternal(request); - } - } // namespace Physics -} // namespace Multiplayer diff --git a/Gems/Multiplayer/Code/multiplayer_files.cmake b/Gems/Multiplayer/Code/multiplayer_files.cmake index 7c5f3a946b..9c83af49a3 100644 --- a/Gems/Multiplayer/Code/multiplayer_files.cmake +++ b/Gems/Multiplayer/Code/multiplayer_files.cmake @@ -57,7 +57,6 @@ set(FILES Include/Multiplayer/NetworkTime/RewindableFixedVector.inl Include/Multiplayer/NetworkTime/RewindableObject.h Include/Multiplayer/NetworkTime/RewindableObject.inl - Include/Multiplayer/Physics/PhysicsUtils.h Include/Multiplayer/ReplicationWindows/IReplicationWindow.h Include/Multiplayer/AutoGen/AutoComponentTypes_Header.jinja Include/Multiplayer/AutoGen/AutoComponentTypes_Source.jinja From 617b9d1136386d6ef5728ddfd85ff29e302b1fe8 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 4 Jan 2022 16:49:08 -0800 Subject: [PATCH 287/620] Removes BuilderSystemComponent.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Builder/BuilderSystemComponent.h | 51 ------------------- ...scriptcanvasgem_editor_builder_files.cmake | 1 - 2 files changed, 52 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Builder/BuilderSystemComponent.h diff --git a/Gems/ScriptCanvas/Code/Builder/BuilderSystemComponent.h b/Gems/ScriptCanvas/Code/Builder/BuilderSystemComponent.h deleted file mode 100644 index 3ad5ee4fb0..0000000000 --- a/Gems/ScriptCanvas/Code/Builder/BuilderSystemComponent.h +++ /dev/null @@ -1,51 +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 - * - */ - -#pragma once - - - -#include -#include - -namespace AZ -{ - namespace Data - { - class AssetHandler; - } -} - -namespace ScriptCanvasBuilder -{ - class BuilderSystemComponent - : public AZ::Component - { - public: - AZ_COMPONENT(BuilderSystemComponent, "{2FB1C848-B863-4562-9C4B-01E18BD61583}"); - - BuilderSystemComponent(); - ~BuilderSystemComponent() override; - - static void Reflect(AZ::ReflectContext* context); - - static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent); - - //////////////////////////////////////////////////////////////////////// - // AZ::Component... - void Init() override; - void Activate() override; - void Deactivate() override; - //////////////////////////////////////////////////////////////////////// - - private: - BuilderSystemComponent(const BuilderSystemComponent&) = delete; - - AZStd::unique_ptr m_scriptCanvasAssetHandler; - }; -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake index 6a3af2afc3..c1c0108b75 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake @@ -7,7 +7,6 @@ # set(FILES - Builder/BuilderSystemComponent.h Builder/ScriptCanvasBuilder.cpp Builder/ScriptCanvasBuilder.h Builder/ScriptCanvasBuilderComponent.cpp From 44f0646906bde3efd28b36651115bb274766fd67 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 4 Jan 2022 16:57:54 -0800 Subject: [PATCH 288/620] Removes empty Debugger files from Gems/ScriptCanvas/Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Code/Editor/Debugger/Debugger.cpp | 9 --------- Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.h | 14 -------------- .../Code/Editor/ScriptCanvasEditorGem.cpp | 2 -- 3 files changed, 25 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.h diff --git a/Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.cpp b/Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.cpp deleted file mode 100644 index 8ed679c751..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.cpp +++ /dev/null @@ -1,9 +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 - * - */ - - diff --git a/Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.h b/Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.h deleted file mode 100644 index 5820d1b01e..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.h +++ /dev/null @@ -1,14 +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 - * - */ - -#pragma once - -namespace DragonUI -{ - -} diff --git a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp index 1a3bb0e4f9..68b9d21939 100644 --- a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp @@ -26,8 +26,6 @@ #include #include -#include - #include #include From 364eb039bbd7aa5dc2bbba036f978ac61c022cbc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:54:15 -0800 Subject: [PATCH 289/620] Removes ScriptCanvasEnumDataInterface.h and ScriptCanvasReadOnlyDataInterface.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/Components/EditorGraph.cpp | 2 - .../ScriptCanvasEnumDataInterface.h | 98 ------------------- .../ScriptCanvasReadOnlyDataInterface.h | 44 --------- .../Code/scriptcanvasgem_editor_files.cmake | 2 - 4 files changed, 146 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasEnumDataInterface.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasReadOnlyDataInterface.h diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 469482e604..f59f05b462 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -49,11 +49,9 @@ AZ_POP_DISABLE_WARNING #include #include #include -#include #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasEnumDataInterface.h b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasEnumDataInterface.h deleted file mode 100644 index be548556d2..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasEnumDataInterface.h +++ /dev/null @@ -1,98 +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 - * - */ -#pragma once - -#include -#include - -#include - -#include "ScriptCanvasDataInterface.h" - -namespace ScriptCanvasEditor -{ - // Used for fixed values value input. - class ScriptCanvasEnumDataInterface - : public ScriptCanvasDataInterface - { - public: - AZ_CLASS_ALLOCATOR(ScriptCanvasEnumDataInterface, AZ::SystemAllocator, 0); - - ScriptCanvasEnumDataInterface(const AZ::EntityId& nodeId, const ScriptCanvas::SlotId& slotId) - : ScriptCanvasDataInterface(nodeId, slotId) - { - } - - ~ScriptCanvasEnumDataInterface() = default; - - void AddElement(int32_t element, const AZStd::string& displayName) - { - QString qtName = displayName.c_str(); - m_comboBoxModel.AddElement(element, qtName); - } - - // GraphCanvas::ComboBoxDataInterface - GraphCanvas::ComboBoxItemModelInterface* GetItemInterface() override - { - return &m_comboBoxModel; - } - - void AssignIndex(const QModelIndex& index) override - { - ScriptCanvas::ModifiableDatumView datumView; - ModifySlotObject(datumView); - - if (datumView.IsValid()) - { - int32_t value = m_comboBoxModel.GetValueForIndex(index); - - datumView.SetAs(value); - - PostUndoPoint(); - PropertyGridRequestBus::Broadcast(&PropertyGridRequests::RefreshPropertyGrid); - } - } - - QModelIndex GetAssignedIndex() const override - { - const ScriptCanvas::Datum* object = GetSlotObject(); - - if (object) - { - const int* element = object->GetAs(); - - if (element) - { - return m_comboBoxModel.GetIndexForValue(*element); - } - } - - return m_comboBoxModel.GetDefaultIndex(); - } - - QString GetDisplayString() const override - { - const ScriptCanvas::Datum* object = GetSlotObject(); - - if (object) - { - const int* element = object->GetAs(); - - if (element) - { - return m_comboBoxModel.GetNameForValue((*element)); - } - } - return GraphCanvas::ComboBoxDataInterface::GetDisplayString(); - } - //// - - private: - GraphCanvas::GraphCanvasListComboBoxModel m_comboBoxModel; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasReadOnlyDataInterface.h b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasReadOnlyDataInterface.h deleted file mode 100644 index 41ac73d0aa..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasReadOnlyDataInterface.h +++ /dev/null @@ -1,44 +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 - * - */ -#pragma once - -#include - -#include "ScriptCanvasDataInterface.h" - -namespace ScriptCanvasEditor -{ - class ScriptCanvasReadOnlyDataInterface - : public ScriptCanvasDataInterface - { - public: - AZ_CLASS_ALLOCATOR(ScriptCanvasReadOnlyDataInterface, AZ::SystemAllocator, 0); - ScriptCanvasReadOnlyDataInterface(const AZ::EntityId& nodeId, const ScriptCanvas::SlotId& slotId) - : ScriptCanvasDataInterface(nodeId, slotId) - { - } - - ~ScriptCanvasReadOnlyDataInterface() = default; - - // ReadOnlyDataInterface - AZStd::string GetString() const override - { - AZStd::string retVal; - - const ScriptCanvas::Datum* object = GetSlotObject(); - - if (object) - { - object->ToString(retVal); - } - - return retVal; - } - //// - }; -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index b2f98226b4..d920c69f45 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -94,12 +94,10 @@ set(FILES Editor/GraphCanvas/DataInterfaces/ScriptCanvasAssetIdDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasBoolDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasEntityIdDataInterface.h - Editor/GraphCanvas/DataInterfaces/ScriptCanvasEnumDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasColorDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasCRCDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasNumericDataInterface.h - Editor/GraphCanvas/DataInterfaces/ScriptCanvasReadOnlyDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasStringDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasVectorDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasVariableDataInterface.h From 7e4f708da444e53c8205ceb01f560f5f2c747fd7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:59:30 -0800 Subject: [PATCH 290/620] Removes unused buses from from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Bus/DocumentContextBus.h | 108 ------------------ .../Bus/ScriptCanvasAssetNodeBus.h | 44 ------- 2 files changed, 152 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/DocumentContextBus.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/ScriptCanvasAssetNodeBus.h diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/DocumentContextBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/DocumentContextBus.h deleted file mode 100644 index 7c5acbe209..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/DocumentContextBus.h +++ /dev/null @@ -1,108 +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 - * - */ - -#pragma once -#include -#include -#include -#include - -#include - -namespace AZ -{ - namespace Data - { - class AssetInfo; - } -} - -namespace ScriptCanvasEditor -{ - enum class ScriptCanvasFileState : AZ::s32 - { - NEW, - MODIFIED, - UNMODIFIED, - INVALID = -1 - }; - - struct ScriptCanvasAssetFileInfo - { - AZ_TYPE_INFO(ScriptCanvasAssetFileInfo, "{81F6B390-7CF3-4A97-B5A6-EC09330F184E}"); - AZ_CLASS_ALLOCATOR(ScriptCanvasAssetFileInfo, AZ::SystemAllocator, 0); - ScriptCanvasFileState m_fileModificationState = ScriptCanvasFileState::INVALID; - bool m_reloadable = false; - AZStd::string m_absolutePath; - }; - - //! Bus for handling transactions involving ScriptCanvas Assets, such as graph Saving, graph modification state, etc - class DocumentContextRequests - : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - - //! Creates a new ScriptCanvas asset and registers it with the document context - virtual AZ::Data::Asset CreateScriptCanvasAsset(AZStd::string_view relativeAssetPath) = 0; - - using SaveCB = AZStd::function; - // !Callback will fire when a new in-memory Script Canvas asset is saved to disk for the first time and a new AssetId is generated for it - using SourceFileChangedCB = AZStd::function; - //! Saves a ScriptCanvas asset using the supplied AssetPath structure - //! \param assetAbsolutePath path where ScriptCanvas asset will be saved on disk - virtual void SaveScriptCanvasAsset(AZStd::string_view/*assetAbsolutePath*/, AZ::Data::Asset, const SaveCB&, const SourceFileChangedCB&) = 0; - - //! Loads a ScriptCanvas asset by looking up the assetPath in the AssetCatalog - //! \param assetPath filepath to asset that will be looked up in the AssetCatalog for the AssetId - //! \param loadBlocking should the loading of the ScriptCanvas asset be blocking - virtual AZ::Data::Asset LoadScriptCanvasAsset(const char* assetPath, bool loadBlocking) = 0; - virtual AZ::Data::Asset LoadScriptCanvasAssetById(const AZ::Data::AssetId& assetId, bool loadBlocking) = 0; - - //! Registers a ScriptCanvas assetId with the DocumentContext for lookup. ScriptCanvasAssetFileInfo will be associated with the ScriptCanvasAsset - //! \return true if the assetId is newly registered, false if the assetId is already registered - virtual bool RegisterScriptCanvasAsset(const AZ::Data::AssetId& assetId, const ScriptCanvasAssetFileInfo& assetFileInfo) = 0; - - //! Unregisters a ScriptCanvas assetId with the DocumentContext for lookup - //! \return true if assetId was registered with the DocumentContext, false otherwise - virtual bool UnregisterScriptCanvasAsset(const AZ::Data::AssetId& assetId) = 0; - - virtual ScriptCanvasFileState GetScriptCanvasAssetModificationState(const AZ::Data::AssetId& assetId) = 0; - virtual void SetScriptCanvasAssetModificationState(const AZ::Data::AssetId& assetId, ScriptCanvasFileState) = 0; - - //! Retrieves the file information for the registered ScriptCanvas asset - virtual AZ::Outcome GetFileInfo(const AZ::Data::AssetId& assetId) const = 0; - virtual AZ::Outcome SetFileInfo(const AZ::Data::AssetId& assetId, const ScriptCanvasAssetFileInfo& fileInfo) = 0; - }; - - using DocumentContextRequestBus = AZ::EBus; - - class DocumentContextNotifications - : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::Data::AssetId; - - virtual void OnAssetModificationStateChanged(ScriptCanvasFileState) {} - - //! Notification which fires after an ScriptCanvasDocumentContext has received it's on AssetReady callback - //! \param scriptCanvasAsset Script Canvas asset which is now ready for use in the Editor - virtual void OnScriptCanvasAssetReady(const AZ::Data::Asset& /*scriptCanvasAsset*/) {} - - //! Notification which fires after an ScriptCanvasDocumentContext has received it's on AssetReloaded callback - //! \param scriptCanvasAsset Script Canvas asset which is now ready for use in the Editor - virtual void OnScriptCanvasAssetReloaded(const AZ::Data::Asset& /*scriptCanvaAsset */) {} - - //! Notification which fires after an ScriptCanvasDocumentContext has received it's on AssetReady callback - //! \param AssetId AssetId of unloaded ScriptCanvas - virtual void OnScriptCanvasAssetUnloaded(const AZ::Data::AssetId& /*assetId*/) {} - }; - - using DocumentContextNotificationBus = AZ::EBus; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/ScriptCanvasAssetNodeBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/ScriptCanvasAssetNodeBus.h deleted file mode 100644 index 1b0d5e5a04..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/ScriptCanvasAssetNodeBus.h +++ /dev/null @@ -1,44 +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 - * - */ - -#pragma once - -#include -#include -#include - -namespace AZ -{ - class Vector2; -} - -namespace GraphCanvas -{ - class SceneSliceInstance; - class SceneSliceReference; - struct ExposedEndpointInfo; - - //! SubSceneRequests - //! EBus for forwarding scene request for a node to the a contained sub scene - class SubSceneRequests - : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::EntityId; - - //! Retrieves the SceneSlice reference of the sub scene - virtual SceneSliceReference* GetReference() = 0; - virtual const SceneSliceReference* GetReferenceConst() const = 0; - - //! Retrieves the SceneSlice instance from the sub scene scene slice reference - virtual SceneSliceInstance* GetInstance() = 0; - }; - - using SubSceneRequestBus = AZ::EBus; -} From 5209c28021c0ac922ae214eca1760abd72ad0032 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 15:06:52 -0800 Subject: [PATCH 291/620] Removes LibraryDataModel.cpp/h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/Model/LibraryDataModel.cpp | 125 ------------------ .../Code/Editor/Model/LibraryDataModel.h | 56 -------- .../Code/scriptcanvasgem_editor_files.cmake | 2 - 3 files changed, 183 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.h diff --git a/Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.cpp b/Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.cpp deleted file mode 100644 index 40e43ca7e8..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.cpp +++ /dev/null @@ -1,125 +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 - * - */ - -#include "LibraryDataModel.h" - -#include - -#include -#include -#include - -#include -#include - -namespace ScriptCanvasEditor -{ - namespace Model - { - LibraryData::LibraryData(QObject* parent /*= nullptr*/) : QAbstractTableModel(parent) - { - Add("All", AZ::Uuid::CreateNull()); - - AZ::SerializeContext* serializeContext = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); - serializeContext->EnumerateDerived( - [this] - (const AZ::SerializeContext::ClassData* classData, [[maybe_unused]] const AZ::Uuid& classUuid) -> bool - { - Add(classData->m_name, classData->m_typeId); - return true; - }); - } - - int LibraryData::rowCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const - { - return m_data.size(); - } - - int LibraryData::columnCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const - { - return ColumnIndex::Count; - } - - QVariant LibraryData::data(const QModelIndex &index, int role /*= Qt::DisplayRole*/) const - { - switch (role) - { - case DataSetRole: - { - if (index.column() == ColumnIndex::Name) - { - const Data* data = &m_data[index.row()]; - return QVariant::fromValue(reinterpret_cast(const_cast(data))); - } - } - break; - - case Qt::DisplayRole: - { - if (index.column() == ColumnIndex::Name) - { - return m_data[index.row()].m_name; - } - } - break; - - case Qt::DecorationRole: - { - AZ::SerializeContext* serializeContext = nullptr; - EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); - const AZ::SerializeContext::ClassData* classData = serializeContext->FindClassData(m_data[index.row()].m_uuid); - - if (classData && classData->m_editData) - { - const auto& editorElementData = classData->m_editData->FindElementData(AZ::Edit::ClassElements::EditorData); - if (editorElementData) - { - if (auto iconAttribute = editorElementData->FindAttribute(AZ::Edit::Attributes::Icon)) - { - if (auto iconAttributeData = azdynamic_cast*>(iconAttribute)) - { - AZStd::string iconAttributeValue = iconAttributeData->Get(nullptr); - if (!iconAttributeValue.empty()) - { - return QVariant(QIcon(QString(iconAttributeValue.c_str()))); - } - } - } - } - } - else - { - QString defaultIcon = QStringLiteral("Icons/ScriptCanvas/Libraries/All.png"); - return QVariant(QIcon(defaultIcon)); - } - - return QVariant(); - } - break; - - default: - break; - } - - return QVariant(); - } - - Qt::ItemFlags LibraryData::flags([[maybe_unused]] const QModelIndex &index) const - { - return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled; - } - - void LibraryData::Add(const char* name, const AZ::Uuid& uuid) - { - m_data.push_back({ QString(name), uuid }); - } - - } -} - diff --git a/Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.h b/Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.h deleted file mode 100644 index 66f6a823bb..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.h +++ /dev/null @@ -1,56 +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 - * - */ - -#pragma once - -#include -#include - -namespace ScriptCanvasEditor -{ - namespace Model - { - //! Stores the data for the list of ScriptCanvas libraries - class LibraryData - : public QAbstractTableModel - { - public: - - enum Role - { - DataSetRole = Qt::UserRole - }; - - enum ColumnIndex - { - Name, - Count - }; - - LibraryData(QObject* parent = nullptr); - - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - int columnCount(const QModelIndex &parent = QModelIndex()) const override; - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - - Qt::ItemFlags flags(const QModelIndex &index) const override; - - void Add(const char* name, const AZ::Uuid& uuid); - - struct Data - { - QString m_name; - AZ::Uuid m_uuid; - }; - typedef QVector DataSet; - - DataSet m_data; - }; - } -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index d920c69f45..cead461ffe 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -106,8 +106,6 @@ set(FILES Editor/GraphCanvas/PropertyInterfaces/ScriptCanvasStringPropertyDataInterface.h Editor/Model/EntityMimeDataHandler.h Editor/Model/EntityMimeDataHandler.cpp - Editor/Model/LibraryDataModel.h - Editor/Model/LibraryDataModel.cpp Editor/Model/UnitTestBrowserFilterModel.h Editor/Model/UnitTestBrowserFilterModel.cpp Editor/Nodes/NodeCreateUtils.h From 7b1e06fac6c91f2dfc5426983dd5f0342d06537d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:02:41 -0800 Subject: [PATCH 292/620] Removes GenericLineEditCtrl.h/inl/cpp from Gems/ScriptCanvas (which lead to removing a target) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/ScriptCanvas/Code/CMakeLists.txt | 35 +---- .../View/EditCtrls/GenericLineEditCtrl.h | 133 ------------------ .../View/EditCtrls/GenericLineEditCtrl.inl | 123 ---------------- .../View/EditCtrls/GenericLineEditCtrl.cpp | 91 ------------ .../Code/Editor/SystemComponent.cpp | 1 - .../scriptcanvasgem_editor_static_files.cmake | 12 -- Gems/ScriptCanvasTesting/Code/CMakeLists.txt | 3 +- 7 files changed, 5 insertions(+), 393 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.inl delete mode 100644 Gems/ScriptCanvas/Code/Editor/Static/Source/View/EditCtrls/GenericLineEditCtrl.cpp delete mode 100644 Gems/ScriptCanvas/Code/scriptcanvasgem_editor_static_files.cmake diff --git a/Gems/ScriptCanvas/Code/CMakeLists.txt b/Gems/ScriptCanvas/Code/CMakeLists.txt index 7be5ec962e..cdaf7df338 100644 --- a/Gems/ScriptCanvas/Code/CMakeLists.txt +++ b/Gems/ScriptCanvas/Code/CMakeLists.txt @@ -137,32 +137,6 @@ ly_create_alias(NAME ScriptCanvas.Clients NAMESPACE Gem TARGETS Gem::ScriptCanv ly_create_alias(NAME ScriptCanvas.Servers NAMESPACE Gem TARGETS Gem::ScriptCanvas) if(PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_target( - NAME ScriptCanvasEditor STATIC - NAMESPACE Gem - AUTOMOC - FILES_CMAKE - scriptcanvasgem_editor_static_files.cmake - COMPILE_DEFINITIONS - PUBLIC - SCRIPTCANVAS_ERRORS_ENABLED - PRIVATE - SCRIPTCANVAS_EDITOR - ${SCRIPT_CANVAS_COMMON_DEFINES} - INCLUDE_DIRECTORIES - PUBLIC - . - Editor/Include - Editor/Static/Include - Editor/Assets - BUILD_DEPENDENCIES - PRIVATE - AZ::AzCore - AZ::AzToolsFramework - 3rdParty::Qt::Widgets - Gem::ScriptCanvas - ) - ly_add_target( NAME ScriptCanvas.Editor.Static STATIC NAMESPACE Gem @@ -181,11 +155,12 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) SCRIPTCANVAS_EDITOR ${SCRIPT_CANVAS_COMMON_DEFINES} INCLUDE_DIRECTORIES + PUBLIC + Editor/Include PRIVATE . Editor Tools - Editor/Include ${SCRIPT_CANVAS_AUTOGEN_BUILD_DIR} BUILD_DEPENDENCIES PUBLIC @@ -194,7 +169,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AssetBuilderSDK ${additional_dependencies} Gem::ScriptCanvas - Gem::ScriptCanvasEditor Gem::ScriptEvents.Static Gem::GraphCanvasWidgets Gem::ExpressionEvaluation.Static @@ -206,7 +180,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME ScriptCanvas.Editor GEM_MODULE - NAMESPACE Gem FILES_CMAKE scriptcanvasgem_editor_shared_files.cmake @@ -217,10 +190,11 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) SCRIPTCANVAS_EDITOR ${SCRIPT_CANVAS_COMMON_DEFINES} INCLUDE_DIRECTORIES + PUBLIC + Editor/Include PRIVATE . Editor - Editor/Include BUILD_DEPENDENCIES PRIVATE AZ::AzToolsFramework @@ -294,7 +268,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest - Gem::ScriptCanvasEditor Gem::ScriptCanvas.Editor.Static ) ly_add_googletest( diff --git a/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h b/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h deleted file mode 100644 index 950fa8ef2e..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h +++ /dev/null @@ -1,133 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include - -#include -#endif - -class QLineEdit; - -namespace ScriptCanvasEditor -{ - namespace EditCtrl - { - template using PropertyToStringCB = AZStd::function; - template using StringToPropertyCB = AZStd::function; - using StringValidatorCB = AZStd::function; - } - - template - class GenericLineEditHandler; - - class GenericLineEditCtrlBase - : public QWidget - { - Q_OBJECT - public: - template - friend class GenericLineEditHandler; - AZ_RTTI(GenericLineEditCtrlBase, "{0EC84840-666F-424E-9443-D20D8FEF743B}"); - AZ_CLASS_ALLOCATOR(GenericLineEditCtrlBase, AZ::SystemAllocator, 0); - - GenericLineEditCtrlBase(QWidget* pParent = nullptr); - ~GenericLineEditCtrlBase() override = default; - - AZStd::string value() const; - - QWidget* GetFirstInTabOrder(); - QWidget* GetLastInTabOrder(); - void UpdateTabOrder(); - - signals: - void valueChanged(AZStd::string& newValue); - - public: - void setValue(AZStd::string_view val); - void setMaxLen(int maxLen); - void onChildLineEditValueChange(const QString& value); - - protected: - void focusInEvent(QFocusEvent* e) override; - - private: - QLineEdit* m_pLineEdit; - }; - - template - class GenericLineEditCtrl - : public GenericLineEditCtrlBase - { - public: - friend class GenericLineEditHandler; - AZ_RTTI(((GenericLineEditCtrl), "{4A094311-8956-40C9-95B5-7D50C2574B45}", T), GenericLineEditCtrlBase); - AZ_CLASS_ALLOCATOR(GenericLineEditCtrl, AZ::SystemAllocator, 0); - - GenericLineEditCtrl(QWidget* pParent = nullptr) - : GenericLineEditCtrlBase(pParent) - {} - ~GenericLineEditCtrl() override = default; - - private: - // Stores per ctrl instance string <-> T conversion functions - EditCtrl::PropertyToStringCB m_propertyToStringCB; - EditCtrl::StringToPropertyCB m_stringToPropertyCB; - }; - - template - class GenericLineEditHandler - : QObject - , public AzToolsFramework::PropertyHandler - { - public: - AZ_CLASS_ALLOCATOR(GenericLineEditHandler, AZ::SystemAllocator, 0); - - GenericLineEditHandler(const EditCtrl::PropertyToStringCB& propertyToStringCB, const EditCtrl::StringToPropertyCB& stringToPropertyCB, - const EditCtrl::StringValidatorCB& stringValidatorCB = {}); - - AZ::u32 GetHandlerName(void) const override { return ScriptCanvas::Attributes::UIHandlers::GenericLineEdit; } - QWidget* GetFirstInTabOrder(GenericLineEditCtrlBase* widget) override { return widget->GetFirstInTabOrder(); } - QWidget* GetLastInTabOrder(GenericLineEditCtrlBase* widget) override { return widget->GetLastInTabOrder(); } - void UpdateWidgetInternalTabbing(GenericLineEditCtrlBase* widget) override { widget->UpdateTabOrder(); } - - QWidget* CreateGUI(QWidget* pParent) override; - void ConsumeAttribute(GenericLineEditCtrlBase* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override; - void WriteGUIValuesIntoProperty(size_t index, GenericLineEditCtrlBase* GUI, typename GenericLineEditHandler::property_t& instance, AzToolsFramework::InstanceDataNode* node) override; - bool ReadValuesIntoGUI(size_t index, GenericLineEditCtrlBase* GUI, const typename GenericLineEditHandler::property_t& instance, AzToolsFramework::InstanceDataNode* node) override; - - bool AutoDelete() const override { return false; } - - private: - // Stores per handler string <-> T conversion functions - // There is only 1 handler per instantiated T - EditCtrl::PropertyToStringCB m_propertyToStringCB; - EditCtrl::StringToPropertyCB m_stringToPropertyCB; - EditCtrl::StringValidatorCB m_stringValidatorCB; - }; - - template - AzToolsFramework::PropertyHandlerBase* RegisterGenericLineEditHandler(const EditCtrl::PropertyToStringCB& propertyToStringCB, const EditCtrl::StringToPropertyCB& stringToPropertyCB) - { - if (!AzToolsFramework::PropertyTypeRegistrationMessages::Bus::FindFirstHandler()) - { - return nullptr; - } - - auto propertyHandler(aznew GenericLineEditHandler(propertyToStringCB, stringToPropertyCB)); - AzToolsFramework::PropertyTypeRegistrationMessages::Bus::Broadcast(&AzToolsFramework::PropertyTypeRegistrationMessages::RegisterPropertyType, propertyHandler); - return propertyHandler; - } -} - -#include diff --git a/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.inl b/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.inl deleted file mode 100644 index e889a937ab..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.inl +++ /dev/null @@ -1,123 +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 - * - */ - -#include - -namespace ScriptCanvasEditor -{ - class GenericStringValidator - : public QValidator - { - public: - AZ_CLASS_ALLOCATOR(GenericStringValidator, AZ::SystemAllocator, 0); - GenericStringValidator(const EditCtrl::StringValidatorCB& stringValidatorCB) - : m_stringValidatorCB(stringValidatorCB) - {} - - QValidator::State validate(QString& input, int& pos) const override - { - return m_stringValidatorCB ? m_stringValidatorCB(input, pos) : QValidator::State::Acceptable; - } - - private: - EditCtrl::StringValidatorCB m_stringValidatorCB; - }; - - template - GenericLineEditHandler::GenericLineEditHandler(const EditCtrl::PropertyToStringCB& propertyToStringCB, const EditCtrl::StringToPropertyCB& stringToPropertyCB, - const EditCtrl::StringValidatorCB& stringValidatorCB) - : m_propertyToStringCB(propertyToStringCB) - , m_stringToPropertyCB(stringToPropertyCB) - , m_stringValidatorCB(stringValidatorCB) - { - } - - template - QWidget* GenericLineEditHandler::CreateGUI(QWidget* pParent) - { - auto newCtrl = aznew GenericLineEditCtrl(pParent); - if (m_stringValidatorCB) - { - newCtrl->m_pLineEdit->setValidator(aznew GenericStringValidator(m_stringValidatorCB)); - } - connect(newCtrl, &GenericLineEditCtrl::valueChanged, this, [newCtrl]() - { - AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestWrite, newCtrl); - }); - return newCtrl; - } - - template - void GenericLineEditHandler::ConsumeAttribute(GenericLineEditCtrlBase* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrReader, const char* debugName) - { - (void)debugName; - if (attrib == ScriptCanvas::Attributes::StringToProperty) - { - EditCtrl::StringToPropertyCB value; - if (attrReader->Read>(value)) - { - auto genericGUI = azrtti_cast*>(GUI); - genericGUI->m_stringToPropertyCB = value; - } - else - { - AZ_WarningOnce("Script Canvas", false, "Failed to read 'StringToProperty' attribute from property '%s'. Expected a function.", debugName, AZ::AzTypeInfo::Name()); - } - } - else if (attrib == ScriptCanvas::Attributes::PropertyToString) - { - EditCtrl::PropertyToStringCB value; - if (attrReader->Read>(value)) - { - auto genericGUI = azrtti_cast*>(GUI); - genericGUI->m_propertyToStringCB = value; - } - else - { - AZ_WarningOnce("Script Canvas", false, "Failed to read 'PropertyToString' attribute from property '%s'. Expected a function.", debugName, AZ::AzTypeInfo::Name()); - } - } - } - - template - void GenericLineEditHandler::WriteGUIValuesIntoProperty(size_t, GenericLineEditCtrlBase* GUI, typename GenericLineEditHandler::property_t& instance, AzToolsFramework::InstanceDataNode*) - { - // Invoke the ctrl string -> T override if it exist otherwise attempt to invoke the handler string -> T override - auto genericGUI = azrtti_cast*>(GUI); - if (genericGUI->m_stringToPropertyCB) - { - genericGUI->m_stringToPropertyCB(instance, genericGUI->value()); - } - else if (m_stringToPropertyCB) - { - m_stringToPropertyCB(instance, GUI->value()); - } - } - - template - bool GenericLineEditHandler::ReadValuesIntoGUI(size_t, GenericLineEditCtrlBase* GUI, const typename GenericLineEditHandler::property_t& instance, AzToolsFramework::InstanceDataNode*) - { - // Invoke the ctrl T -> string override if it exist otherwise attempt to invoke the handler T -> string override - auto genericGUI = azrtti_cast*>(GUI); - if (genericGUI->m_propertyToStringCB) - { - AZStd::string val; - genericGUI->m_propertyToStringCB(val, instance); - genericGUI->setValue(val); - return true; - } - else if (m_propertyToStringCB) - { - AZStd::string val; - m_propertyToStringCB(val, instance); - GUI->setValue(val); - return true; - } - return false; - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Static/Source/View/EditCtrls/GenericLineEditCtrl.cpp b/Gems/ScriptCanvas/Code/Editor/Static/Source/View/EditCtrls/GenericLineEditCtrl.cpp deleted file mode 100644 index 6eb2b63129..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Static/Source/View/EditCtrls/GenericLineEditCtrl.cpp +++ /dev/null @@ -1,91 +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 - * - */ -#include - -#include -#include - -#include - -namespace ScriptCanvasEditor -{ - GenericLineEditCtrlBase::GenericLineEditCtrlBase(QWidget* pParent) - : QWidget(pParent) - { - // create the gui, it consists of a layout, and in that layout, a text field for the value - // and then a slider for the value. - QHBoxLayout* pLayout = new QHBoxLayout(this); - m_pLineEdit = new QLineEdit(this); - - pLayout->setSpacing(4); - pLayout->setContentsMargins(1, 0, 1, 0); - - pLayout->addWidget(m_pLineEdit); - - m_pLineEdit->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed); - m_pLineEdit->setMinimumWidth(AzToolsFramework::PropertyQTConstant_MinimumWidth); - m_pLineEdit->setFixedHeight(AzToolsFramework::PropertyQTConstant_DefaultHeight); - - m_pLineEdit->setFocusPolicy(Qt::StrongFocus); - - setLayout(pLayout); - setFocusProxy(m_pLineEdit); - setFocusPolicy(m_pLineEdit->focusPolicy()); - - connect(m_pLineEdit, &QLineEdit::textChanged, this, &GenericLineEditCtrlBase::onChildLineEditValueChange); - connect(m_pLineEdit, &QLineEdit::editingFinished, this, [this]() - { - AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::OnEditingFinished, this); - }); - } - - void GenericLineEditCtrlBase::setValue(AZStd::string_view value) - { - QSignalBlocker signalBlocker(m_pLineEdit); - m_pLineEdit->setText(value.data()); - } - - void GenericLineEditCtrlBase::focusInEvent(QFocusEvent* e) - { - m_pLineEdit->event(e); - m_pLineEdit->selectAll(); - } - - AZStd::string GenericLineEditCtrlBase::value() const - { - return AZStd::string(m_pLineEdit->text().toUtf8().data()); - } - - void GenericLineEditCtrlBase::setMaxLen(int maxLen) - { - QSignalBlocker signalBlocker(m_pLineEdit); - m_pLineEdit->setMaxLength(maxLen); - } - - void GenericLineEditCtrlBase::onChildLineEditValueChange(const QString& newValue) - { - AZStd::string changedVal(newValue.toUtf8().data()); - emit valueChanged(changedVal); - } - - QWidget* GenericLineEditCtrlBase::GetFirstInTabOrder() - { - return m_pLineEdit; - } - QWidget* GenericLineEditCtrlBase::GetLastInTabOrder() - { - return m_pLineEdit; - } - - void GenericLineEditCtrlBase::UpdateTabOrder() - { - // There's only one QT widget on this property. - } -} - -#include diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 6087dfb98f..23c127b83b 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_static_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_static_files.cmake deleted file mode 100644 index 3ef141f0f7..0000000000 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_static_files.cmake +++ /dev/null @@ -1,12 +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 -# -# - -set(FILES - Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h - Editor/Static/Source/View/EditCtrls/GenericLineEditCtrl.cpp -) diff --git a/Gems/ScriptCanvasTesting/Code/CMakeLists.txt b/Gems/ScriptCanvasTesting/Code/CMakeLists.txt index 499bb84c2d..c90eff9389 100644 --- a/Gems/ScriptCanvasTesting/Code/CMakeLists.txt +++ b/Gems/ScriptCanvasTesting/Code/CMakeLists.txt @@ -29,7 +29,7 @@ ly_add_target( BUILD_DEPENDENCIES PUBLIC Gem::ScriptCanvas - Gem::ScriptCanvasEditor + Gem::ScriptCanvas.Editor Gem::GraphCanvasWidgets Gem::ScriptEvents.Editor PRIVATE @@ -44,7 +44,6 @@ ly_add_target( *.ScriptCanvasNodeable.xml,ScriptCanvasNodeable_Source.jinja,$path/$fileprefix.generated.cpp RUNTIME_DEPENDENCIES Gem::ScriptCanvas.Editor - Gem::ScriptCanvasEditor Gem::GraphCanvasWidgets Gem::ScriptEvents ) From 1342d54c7d9bb6840905bdc7cef3ba5f57da3a40 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:23:26 -0800 Subject: [PATCH 293/620] Removes Utilities/Command.cpp/h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/Utilities/Command.cpp | 14 --------- .../Code/Editor/Utilities/Command.h | 29 ------------------- .../Code/scriptcanvasgem_editor_files.cmake | 2 -- 3 files changed, 45 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Utilities/Command.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Utilities/Command.h diff --git a/Gems/ScriptCanvas/Code/Editor/Utilities/Command.cpp b/Gems/ScriptCanvas/Code/Editor/Utilities/Command.cpp deleted file mode 100644 index 482347f37e..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Utilities/Command.cpp +++ /dev/null @@ -1,14 +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 - * - */ - -#include "Command.h" - -namespace ScriptCanvasEditor -{ - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Utilities/Command.h b/Gems/ScriptCanvas/Code/Editor/Utilities/Command.h deleted file mode 100644 index a391a4d833..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Utilities/Command.h +++ /dev/null @@ -1,29 +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 - * - */ - -#pragma once -#include - -namespace ScriptCanvasEditor -{ - // Commands are named wrappers around ebus events - class Command - { - public: - - //template - //void Execute(const char* commandName, args&&... parameters); - - private: - - AZStd::string m_commandName; - AZStd::string m_description; - AZStd::string m_category; - AZStd::string m_iconPath; - }; -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index cead461ffe..a830ba08ff 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -119,8 +119,6 @@ set(FILES Editor/Undo/ScriptCanvasGraphCommand.h Editor/Undo/ScriptCanvasUndoManager.cpp Editor/Undo/ScriptCanvasUndoManager.h - Editor/Utilities/Command.h - Editor/Utilities/Command.cpp Editor/Utilities/CommonSettingsConfigurations.h Editor/Utilities/CommonSettingsConfigurations.cpp Editor/Utilities/RecentFiles.h From 3db71950e864367b423b1018497d2ffb1bf96cb3 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:31:10 -0800 Subject: [PATCH 294/620] Removes NewGraphDialog from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/SystemComponent.cpp | 1 - .../Editor/View/Dialogs/NewGraphDialog.cpp | 51 --------------- .../Code/Editor/View/Dialogs/NewGraphDialog.h | 42 ------------- .../Editor/View/Dialogs/NewGraphDialog.ui | 63 ------------------- .../Code/scriptcanvasgem_editor_files.cmake | 3 - 5 files changed, 160 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.ui diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 23c127b83b..59c52de05c 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.cpp b/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.cpp deleted file mode 100644 index 402d80fb32..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.cpp +++ /dev/null @@ -1,51 +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 - * - */ - -#include "NewGraphDialog.h" - -#include -#include - -#include "Editor/View/Dialogs/ui_NewGraphDialog.h" - - - -namespace ScriptCanvasEditor -{ - NewGraphDialog::NewGraphDialog(const QString& title, const QString& text, QWidget* pParent /*=nullptr*/) - : QDialog(pParent) - , ui(new Ui::NewGraphDialog) - , m_text(text) - { - ui->setupUi(this); - - setWindowTitle(title); - - QObject::connect(ui->GraphName, &QLineEdit::returnPressed, this, &NewGraphDialog::OnOK); - QObject::connect(ui->GraphName, &QLineEdit::textChanged, this, &NewGraphDialog::OnTextChanged); - QObject::connect(ui->ok, &QPushButton::clicked, this, &NewGraphDialog::OnOK); - QObject::connect(ui->cancel, &QPushButton::clicked, this, &QDialog::reject); - - ui->ok->setEnabled(false); - } - - void NewGraphDialog::OnTextChanged(const QString& text) - { - ui->ok->setEnabled(!text.isEmpty()); - } - - void NewGraphDialog::OnOK() - { - QString itemName = ui->GraphName->text(); - m_text = itemName.toLocal8Bit().constData(); - - accept(); - } - - #include -} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.h b/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.h deleted file mode 100644 index de6c2a102f..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.h +++ /dev/null @@ -1,42 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#endif - -namespace Ui -{ - class NewGraphDialog; -} - -namespace ScriptCanvasEditor -{ - class NewGraphDialog - : public QDialog - { - Q_OBJECT - - public: - NewGraphDialog(const QString& title, const QString& text, QWidget* pParent = nullptr); - - const QString& GetText() const { return m_text; } - - protected: - - void OnOK(); - void OnTextChanged(const QString& text); - - QString m_text; - - Ui::NewGraphDialog* ui; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.ui b/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.ui deleted file mode 100644 index 89861c0a49..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.ui +++ /dev/null @@ -1,63 +0,0 @@ - - - NewGraphDialog - - - - 0 - 0 - 300 - 72 - - - - - - - Name: - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 10 - - - - - - - - OK - - - - - - - Cancel - - - - - - - - - - diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index a830ba08ff..51843a8837 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -125,9 +125,6 @@ set(FILES Editor/Utilities/RecentFiles.cpp Editor/Utilities/RecentAssetPath.h Editor/Utilities/RecentAssetPath.cpp - Editor/View/Dialogs/NewGraphDialog.h - Editor/View/Dialogs/NewGraphDialog.cpp - Editor/View/Dialogs/NewGraphDialog.ui Editor/View/Dialogs/SettingsDialog.h Editor/View/Dialogs/SettingsDialog.cpp Editor/View/Dialogs/SettingsDialog.ui From 4015ffd0736ff4f5a75f66b81c9add1bacd3afe7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:34:17 -0800 Subject: [PATCH 295/620] Removes WidgetBus.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/View/Widgets/WidgetBus.h | 25 ------------------- .../Code/scriptcanvasgem_editor_files.cmake | 1 - 2 files changed, 26 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/WidgetBus.h diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/WidgetBus.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/WidgetBus.h deleted file mode 100644 index 8b78b07524..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/WidgetBus.h +++ /dev/null @@ -1,25 +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 - * - */ - -#pragma once - - -#include -#include - -namespace ScriptCanvasEditor -{ - class WidgetNotification : public AZ::EBusTraits - { - public: - virtual void OnLibrarySelected(const AZ::Uuid& library) = 0; - }; - - using WidgetNotificationBus = AZ::EBus; - -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 51843a8837..a9624185ea 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -161,7 +161,6 @@ set(FILES Editor/View/Widgets/ScriptCanvasNodePaletteToolbar.ui Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp - Editor/View/Widgets/WidgetBus.h Editor/View/Widgets/DataTypePalette/DataTypePaletteModel.cpp Editor/View/Widgets/DataTypePalette/DataTypePaletteModel.h Editor/View/Widgets/NodePalette/CreateNodeMimeEvent.cpp From d858c168317a58e86ab92198deaaef5cebac042a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:39:06 -0800 Subject: [PATCH 296/620] Removes LoggingTypes.cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../View/Widgets/LoggingPanel/LoggingTypes.cpp | 13 ------------- .../Code/scriptcanvasgem_editor_files.cmake | 1 - 2 files changed, 14 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingTypes.cpp diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingTypes.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingTypes.cpp deleted file mode 100644 index 8a99701802..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingTypes.cpp +++ /dev/null @@ -1,13 +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 - * - */ - -#include - -namespace ScriptCanvasEditor -{ -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index a9624185ea..90bf36ac8f 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -182,7 +182,6 @@ set(FILES Editor/View/Widgets/NodePalette/VariableNodePaletteTreeItemTypes.h Editor/View/Widgets/LoggingPanel/LoggingDataAggregator.cpp Editor/View/Widgets/LoggingPanel/LoggingDataAggregator.h - Editor/View/Widgets/LoggingPanel/LoggingTypes.cpp Editor/View/Widgets/LoggingPanel/LoggingTypes.h Editor/View/Widgets/LoggingPanel/LoggingWindow.cpp Editor/View/Widgets/LoggingPanel/LoggingWindow.h From 5c557f56a3555aec73bac449f38203c9755e5672 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:43:21 -0800 Subject: [PATCH 297/620] Removes LoggingAssetDataAggregator/LoggingAssetWindowSession from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../LoggingAssetDataAggregator.cpp | 70 ------------------- .../LoggingAssetDataAggregator.h | 44 ------------ .../LoggingAssetWindowSession.cpp | 48 ------------- .../LoggingAssetWindowSession.h | 40 ----------- .../Code/scriptcanvasgem_editor_files.cmake | 4 -- 5 files changed, 206 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.h diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.cpp deleted file mode 100644 index 08e80c30d7..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.cpp +++ /dev/null @@ -1,70 +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 - * - */ - -#include - -namespace ScriptCanvasEditor -{ - /////////////////////////////// - // LoggingAssetDataAggregator - /////////////////////////////// - - LoggingAssetDataAggregator::LoggingAssetDataAggregator(const AZ::Data::AssetId& assetId) - : m_assetId(assetId) - { - } - - LoggingAssetDataAggregator::~LoggingAssetDataAggregator() - { - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::AnnotateNodeSignal& /**/) - { - // call parent process function in the aggregator class - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::ExecutionThreadEnd& /*loggableEvent*/) - { - // call parent process function in the aggregator class - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::ExecutionThreadBeginning& /*loggableEvent*/) - { - // call parent process function in the aggregator class - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::GraphActivation& /*loggableEvent*/) - { - // call parent process function in the aggregator class - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::GraphDeactivation& /*loggableEvent*/) - { - // call parent process function in the aggregator class - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::NodeStateChange& loggableEvent) - { - ProcessNodeStateChanged(loggableEvent); - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::InputSignal& loggableEvent) - { - ProcessInputSignal(loggableEvent); - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::OutputSignal& loggableEvent) - { - ProcessOutputSignal(loggableEvent); - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::VariableChange& loggableEvent) - { - ProcessVariableChangedSignal(loggableEvent); - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.h deleted file mode 100644 index 71efcbb017..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.h +++ /dev/null @@ -1,44 +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 - * - */ -#pragma once - -#include -#include -#include - -namespace ScriptCanvasEditor -{ - class LoggingAssetDataAggregator - : public LoggingDataAggregator - , public ScriptCanvas::LoggableEventVisitor - { - public: - AZ_CLASS_ALLOCATOR(LoggingAssetDataAggregator, AZ::SystemAllocator, 0); - - LoggingAssetDataAggregator(const AZ::Data::AssetId& assetId); - ~LoggingAssetDataAggregator() override; - - bool CanCaptureData() const override { return false; } - bool IsCapturingData() const override { return false; } - - protected: - void Visit(ScriptCanvas::AnnotateNodeSignal&) override; - void Visit(ScriptCanvas::ExecutionThreadEnd&) override; - void Visit(ScriptCanvas::ExecutionThreadBeginning&) override; - void Visit(ScriptCanvas::GraphActivation&) override; - void Visit(ScriptCanvas::GraphDeactivation&) override; - void Visit(ScriptCanvas::NodeStateChange&) override; - void Visit(ScriptCanvas::InputSignal&) override; - void Visit(ScriptCanvas::OutputSignal&) override; - void Visit(ScriptCanvas::VariableChange&) override; - - private: - - AZ::Data::AssetId m_assetId; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.cpp deleted file mode 100644 index b761ead488..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.cpp +++ /dev/null @@ -1,48 +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 - * - */ - -#include - -namespace ScriptCanvasEditor -{ - ////////////////////////////// - // LoggingAssetWindowSession - ////////////////////////////// - - LoggingAssetWindowSession::LoggingAssetWindowSession(const AZ::Data::AssetId& assetId, QWidget* parent) - : LoggingWindowSession(parent) - , m_dataAggregator(assetId) - , m_assetId(assetId) - { - SetDataId(m_dataAggregator.GetDataId()); - - m_ui->captureButton->setEnabled(false); - - RegisterTreeRoot(m_dataAggregator.GetTreeRoot()); - } - - LoggingAssetWindowSession::~LoggingAssetWindowSession() - { - } - - void LoggingAssetWindowSession::OnCaptureButtonPressed() - { - } - - void LoggingAssetWindowSession::OnPlaybackButtonPressed() - { - // TODO - } - - void LoggingAssetWindowSession::OnOptionsButtonPressed() - { - // TODO - } - -#include -} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.h deleted file mode 100644 index c603f8e860..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.h +++ /dev/null @@ -1,40 +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 - * - */ -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#endif - -namespace ScriptCanvasEditor -{ - class LoggingAssetWindowSession - : public LoggingWindowSession - { - Q_OBJECT - - public: - AZ_CLASS_ALLOCATOR(LoggingAssetWindowSession, AZ::SystemAllocator, 0); - - LoggingAssetWindowSession(const AZ::Data::AssetId& assetId, QWidget* parent = nullptr); - ~LoggingAssetWindowSession() override; - - protected: - - void OnCaptureButtonPressed() override; - void OnPlaybackButtonPressed() override; - void OnOptionsButtonPressed() override; - - private: - - AZ::Data::AssetId m_assetId; - - LoggingAssetDataAggregator m_dataAggregator; - }; -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 90bf36ac8f..206a73a9e6 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -195,10 +195,6 @@ set(FILES Editor/View/Widgets/LoggingPanel/LiveWindowSession/LiveLoggingDataAggregator.h Editor/View/Widgets/LoggingPanel/LiveWindowSession/LiveLoggingWindowSession.cpp Editor/View/Widgets/LoggingPanel/LiveWindowSession/LiveLoggingWindowSession.h - Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.cpp - Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.h - Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.cpp - Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.h Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.h Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.ui From 9d95ad4a2ade1942c650e693121994d77ac532a4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:48:36 -0800 Subject: [PATCH 298/620] Removes CreateNodeContextMenu.cpp/h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../View/Windows/CreateNodeContextMenu.cpp | 266 ------------------ .../View/Windows/CreateNodeContextMenu.h | 140 --------- 2 files changed, 406 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.h diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.cpp deleted file mode 100644 index e54469c80c..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.cpp +++ /dev/null @@ -1,266 +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 - * - */ - -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ScriptCanvasContextMenus.h" - -namespace ScriptCanvasEditor -{ - ////////////////////////////// - // AddSelectedEntitiesAction - ////////////////////////////// - - AddSelectedEntitiesAction::AddSelectedEntitiesAction(QObject* parent) - : GraphCanvas::ContextMenuAction("", parent) - { - } - - GraphCanvas::ActionGroupId AddSelectedEntitiesAction::GetActionGroupId() const - { - return AZ_CRC("EntityActionGroup", 0x17e16dfe); - } - - void AddSelectedEntitiesAction::RefreshAction(const GraphCanvas::GraphId&, const AZ::EntityId&) - { - AzToolsFramework::EntityIdList selectedEntities; - AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - - setEnabled(!selectedEntities.empty()); - - if (selectedEntities.size() <= 1) - { - setText("Reference selected entity"); - } - else - { - setText("Reference selected entities"); - } - } - - GraphCanvas::ContextMenuAction::SceneReaction AddSelectedEntitiesAction::TriggerAction(const AZ::EntityId& graphCanvasGraphId, const AZ::Vector2& scenePos) - { - AzToolsFramework::EntityIdList selectedEntities; - AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - - AZ::EntityId scriptCanvasGraphId; - GeneralRequestBus::BroadcastResult(scriptCanvasGraphId, &GeneralRequests::GetScriptCanvasGraphId, graphCanvasGraphId); - - GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::ClearSelection); - - AZ::Vector2 addPosition = scenePos; - - for (const AZ::EntityId& id : selectedEntities) - { - NodeIdPair nodePair = Nodes::CreateEntityNode(id, scriptCanvasGraphId); - GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::AddNode, nodePair.m_graphCanvasId, addPosition); - addPosition += AZ::Vector2(20, 20); - } - - return GraphCanvas::ContextMenuAction::SceneReaction::PostUndo; - } - - //////////////////////////// - // EndpointSelectionAction - //////////////////////////// - - EndpointSelectionAction::EndpointSelectionAction(const GraphCanvas::Endpoint& proposedEndpoint) - : QAction(nullptr) - , m_endpoint(proposedEndpoint) - { - AZStd::string name; - GraphCanvas::SlotRequestBus::EventResult(name, proposedEndpoint.GetSlotId(), &GraphCanvas::SlotRequests::GetName); - - AZStd::string tooltip; - GraphCanvas::SlotRequestBus::EventResult(tooltip, proposedEndpoint.GetSlotId(), &GraphCanvas::SlotRequests::GetTooltip); - - setText(name.c_str()); - setToolTip(tooltip.c_str()); - } - - const GraphCanvas::Endpoint& EndpointSelectionAction::GetEndpoint() const - { - return m_endpoint; - } - - //////////////////////////////////// - // RemoveUnusedVariablesMenuAction - //////////////////////////////////// - - RemoveUnusedVariablesMenuAction::RemoveUnusedVariablesMenuAction(QObject* parent) - : SceneContextMenuAction("Variables", parent) - { - setToolTip("Removes all of the unused variables from the active graph"); - } - - void RemoveUnusedVariablesMenuAction::RefreshAction(const GraphCanvas::GraphId& graphId, const AZ::EntityId& targetId) - { - setEnabled(true); - } - - bool RemoveUnusedVariablesMenuAction::IsInSubMenu() const - { - return true; - } - - AZStd::string RemoveUnusedVariablesMenuAction::GetSubMenuPath() const - { - return "Remove Unused"; - } - - GraphCanvas::ContextMenuAction::SceneReaction RemoveUnusedVariablesMenuAction::TriggerAction(const GraphCanvas::GraphId& graphId, const AZ::Vector2& scenePos) - { - GraphCanvas::SceneRequestBus::Event(graphId, &GraphCanvas::SceneRequests::RemoveUnusedNodes); - return SceneReaction::PostUndo; - } - - ///////////////////// - // SceneContextMenu - ///////////////////// - - SceneContextMenu::SceneContextMenu(const NodePaletteModel& paletteModel, AzToolsFramework::AssetBrowser::AssetBrowserFilterModel* assetModel) - { - QWidgetAction* actionWidget = new QWidgetAction(this); - - const bool inContextMenu = true; - m_palette = aznew Widget::NodePaletteDockWidget(paletteModel, tr("Node Palette"), this, assetModel, inContextMenu); - - actionWidget->setDefaultWidget(m_palette); - - GraphCanvas::ContextMenuAction* menuAction = aznew AddSelectedEntitiesAction(this); - - AddActionGroup(menuAction->GetActionGroupId()); - AddMenuAction(menuAction); - - AddMenuAction(actionWidget); - - connect(this, &QMenu::aboutToShow, this, &SceneContextMenu::SetupDisplay); - connect(m_palette, &Widget::NodePaletteDockWidget::OnContextMenuSelection, this, &SceneContextMenu::HandleContextMenuSelection); - } - - void SceneContextMenu::ResetSourceSlotFilter() - { - m_palette->ResetSourceSlotFilter(); - } - - void SceneContextMenu::FilterForSourceSlot(const AZ::EntityId& scriptCanvasGraphId, const AZ::EntityId& sourceSlotId) - { - m_palette->FilterForSourceSlot(scriptCanvasGraphId, sourceSlotId); - } - - const Widget::NodePaletteDockWidget* SceneContextMenu::GetNodePalette() const - { - return m_palette; - } - - void SceneContextMenu::OnRefreshActions(const GraphCanvas::GraphId& graphId, const AZ::EntityId& targetMemberId) - { - // Don't want to overly manipulate the state. So we only modify this when we know we want to turn it on. - if (GraphVariablesTableView::HasCopyVariableData()) - { - m_editorActionsGroup.SetPasteEnabled(true); - } - } - - void SceneContextMenu::HandleContextMenuSelection() - { - close(); - } - - void SceneContextMenu::SetupDisplay() - { - m_palette->ResetDisplay(); - m_palette->FocusOnSearchFilter(); - } - - void SceneContextMenu::keyPressEvent(QKeyEvent* keyEvent) - { - if (!m_palette->hasFocus()) - { - QMenu::keyPressEvent(keyEvent); - } - } - - ////////////////////////// - // ConnectionContextMenu - ////////////////////////// - - ConnectionContextMenu::ConnectionContextMenu(const NodePaletteModel& nodePaletteModel, AzToolsFramework::AssetBrowser::AssetBrowserFilterModel* assetModel) - { - QWidgetAction* actionWidget = new QWidgetAction(this); - - const bool inContextMenu = true; - m_palette = aznew Widget::NodePaletteDockWidget(nodePaletteModel, tr("Node Palette"), this, assetModel, inContextMenu); - - actionWidget->setDefaultWidget(m_palette); - - AddMenuAction(actionWidget); - - connect(this, &QMenu::aboutToShow, this, &ConnectionContextMenu::SetupDisplay); - connect(m_palette, &Widget::NodePaletteDockWidget::OnContextMenuSelection, this, &ConnectionContextMenu::HandleContextMenuSelection); - } - - const Widget::NodePaletteDockWidget* ConnectionContextMenu::GetNodePalette() const - { - return m_palette; - } - - void ConnectionContextMenu::OnRefreshActions(const GraphCanvas::GraphId& graphId, const AZ::EntityId& targetMemberId) - { - GraphCanvas::ConnectionContextMenu::OnRefreshActions(graphId, targetMemberId); - - m_palette->ResetSourceSlotFilter(); - - m_connectionId = targetMemberId; - - // TODO: Filter nodes. - } - - void ConnectionContextMenu::HandleContextMenuSelection() - { - close(); - } - - void ConnectionContextMenu::SetupDisplay() - { - m_palette->ResetDisplay(); - m_palette->FocusOnSearchFilter(); - } - - void ConnectionContextMenu::keyPressEvent(QKeyEvent* keyEvent) - { - if (!m_palette->hasFocus()) - { - QMenu::keyPressEvent(keyEvent); - } - } - - #include "Editor/View/Windows/moc_ScriptCanvasContextMenus.cpp" -} - diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.h deleted file mode 100644 index 54f52df171..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.h +++ /dev/null @@ -1,140 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include - -#include -#include - -#include -#include -#include -#include -#endif - -namespace ScriptCanvasEditor -{ - class NodePaletteModel; - - namespace Widget - { - class NodePaletteDockWidget; - } - - class AddSelectedEntitiesAction - : public GraphCanvas::ContextMenuAction - { - Q_OBJECT - public: - AZ_CLASS_ALLOCATOR(AddSelectedEntitiesAction, AZ::SystemAllocator, 0); - - AddSelectedEntitiesAction(QObject* parent); - virtual ~AddSelectedEntitiesAction() = default; - - GraphCanvas::ActionGroupId GetActionGroupId() const override; - - void RefreshAction(const GraphCanvas::GraphId& graphCanvasGraphId, const AZ::EntityId& targetId) override; - SceneReaction TriggerAction(const GraphCanvas::GraphId& graphCanvasGraphId, const AZ::Vector2& scenePos) override; - }; - - class EndpointSelectionAction - : public QAction - { - Q_OBJECT - public: - AZ_CLASS_ALLOCATOR(EndpointSelectionAction, AZ::SystemAllocator, 0); - - EndpointSelectionAction(const GraphCanvas::Endpoint& endpoint); - ~EndpointSelectionAction() = default; - - const GraphCanvas::Endpoint& GetEndpoint() const; - - private: - GraphCanvas::Endpoint m_endpoint; - }; - - class RemoveUnusedVariablesMenuAction - : public GraphCanvas::SceneContextMenuAction - { - public: - AZ_CLASS_ALLOCATOR(RemoveUnusedVariablesMenuAction, AZ::SystemAllocator, 0); - - RemoveUnusedVariablesMenuAction(QObject* parent); - virtual ~RemoveUnusedVariablesMenuAction() = default; - - bool IsInSubMenu() const override; - AZStd::string GetSubMenuPath() const override; - - void RefreshAction(const GraphCanvas::GraphId& graphId, const AZ::EntityId& targetId) override; - GraphCanvas::ContextMenuAction::SceneReaction TriggerAction(const GraphCanvas::GraphId& graphId, const AZ::Vector2& scenePos) override; - }; - - class SceneContextMenu - : public GraphCanvas::SceneContextMenu - { - Q_OBJECT - public: - AZ_CLASS_ALLOCATOR(SceneContextMenu, AZ::SystemAllocator, 0); - - SceneContextMenu(const NodePaletteModel& nodePaletteModel, AzToolsFramework::AssetBrowser::AssetBrowserFilterModel* assetModel); - ~SceneContextMenu() = default; - - void ResetSourceSlotFilter(); - void FilterForSourceSlot(const AZ::EntityId& scriptCanvasGraphId, const AZ::EntityId& sourceSlotId); - const Widget::NodePaletteDockWidget* GetNodePalette() const; - - // EditConstructContextMenu - void OnRefreshActions(const GraphCanvas::GraphId& graphId, const AZ::EntityId& targetMemberId) override; - //// - - public slots: - - void HandleContextMenuSelection(); - void SetupDisplay(); - - protected: - void keyPressEvent(QKeyEvent* keyEvent) override; - - AZ::EntityId m_sourceSlotId; - Widget::NodePaletteDockWidget* m_palette; - }; - - class ConnectionContextMenu - : public GraphCanvas::ConnectionContextMenu - { - Q_OBJECT - public: - AZ_CLASS_ALLOCATOR(ConnectionContextMenu, AZ::SystemAllocator, 0); - - ConnectionContextMenu(const NodePaletteModel& nodePaletteModel, AzToolsFramework::AssetBrowser::AssetBrowserFilterModel* assetModel); - ~ConnectionContextMenu() = default; - - const Widget::NodePaletteDockWidget* GetNodePalette() const; - - protected: - - void OnRefreshActions(const GraphCanvas::GraphId& graphId, const AZ::EntityId& targetMemberId); - - public slots: - - void HandleContextMenuSelection(); - void SetupDisplay(); - - protected: - void keyPressEvent(QKeyEvent* keyEvent) override; - - private: - - AZ::EntityId m_connectionId; - Widget::NodePaletteDockWidget* m_palette; - }; -} From 2174f522cb3583382380211eedf9e7b4ac84e6a8 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:52:15 -0800 Subject: [PATCH 299/620] Removes MainWindowBus.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/View/Windows/MainWindowBus.h | 30 ------------------- .../Code/scriptcanvasgem_editor_files.cmake | 1 - 2 files changed, 31 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindowBus.h diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindowBus.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindowBus.h deleted file mode 100644 index 86c805eff1..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindowBus.h +++ /dev/null @@ -1,30 +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 - * - */ - -#pragma once - -#include - -namespace ScriptCanvasEditor -{ - class MainWindowNotifications : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - - virtual void PreOnActiveSceneChanged() {} - virtual void OnActiveSceneChanged(const AZ::EntityId& /*sceneId*/) {} - virtual void PostOnActiveSceneChanged() {} - - virtual void OnSceneLoaded(const AZ::EntityId& /*sceneId*/) {} - virtual void OnSceneRefreshed(const AZ::EntityId& /*oldSceneId*/, const AZ::EntityId& /*newSceneId*/) {} - virtual void OnSceneUnloaded(const AZ::EntityId& /*sceneId*/) {} - }; - - using MainWindowNotificationBus = AZ::EBus; -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 206a73a9e6..71ca1bc826 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -232,7 +232,6 @@ set(FILES Editor/View/Windows/MainWindow.cpp Editor/View/Windows/MainWindow.h Editor/View/Windows/mainwindow.ui - Editor/View/Windows/MainWindowBus.h Editor/View/Windows/ScriptCanvasContextMenus.cpp Editor/View/Windows/ScriptCanvasContextMenus.h Editor/View/Windows/ScriptCanvasEditorResources.qrc From 74b7ce8bd90ab91b3e83cf644b4c54ae84ae11a6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:53:20 -0800 Subject: [PATCH 300/620] Removes ScriptCanvasAssetData.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Asset/ScriptCanvasAssetData.h | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetData.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetData.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetData.h deleted file mode 100644 index 333ea12445..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetData.h +++ /dev/null @@ -1,14 +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 - * - */ - -#pragma once - -namespace ScriptCanvas -{ - -} From 2b75b127fe11b686d69cde9081d99f1cd6f233ff Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:57:49 -0800 Subject: [PATCH 301/620] Removes ContractBus.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Include/ScriptCanvas/Core/Contract.cpp | 1 - .../Include/ScriptCanvas/Core/ContractBus.h | 38 ------------------- .../Contracts/ConnectionLimitContract.cpp | 1 - .../Core/Contracts/ContractRTTI.cpp | 1 - .../DisallowReentrantExecutionContract.cpp | 1 - ...DisplayGroupConnectedSlotLimitContract.cpp | 1 - .../Core/Contracts/DynamicTypeContract.cpp | 1 - .../Contracts/IsReferenceTypeContract.cpp | 1 - .../Core/Contracts/MethodOverloadContract.cpp | 1 - .../Core/Contracts/RestrictedNodeContract.cpp | 1 - .../Core/Contracts/SlotTypeContract.cpp | 1 - .../Core/Contracts/SupportsMethodContract.cpp | 1 - .../Core/Contracts/TypeContract.cpp | 1 - .../Code/scriptcanvasgem_headers.cmake | 1 - 14 files changed, 51 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/ContractBus.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contract.cpp index cfa14b49f1..5053fa1375 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contract.cpp @@ -7,7 +7,6 @@ */ #include "Contract.h" -#include "ContractBus.h" #include "Slot.h" #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/ContractBus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/ContractBus.h deleted file mode 100644 index b357fc5ca6..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/ContractBus.h +++ /dev/null @@ -1,38 +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 - * - */ -#pragma once - -#include "Core.h" - -#include - -namespace ScriptCanvas -{ - class Contract; - class Slot; - - namespace Data - { - class Type; - } - - class ContractEvents : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // EBusTraits overrides - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - ////////////////////////////////////////////////////////////////////////// - - virtual void OnValidContract(const Contract*, const Slot&, const Slot&) = 0; - virtual void OnInvalidContract(const Contract*, const Slot&, const Slot&) = 0; - }; - - using ContractEventBus = AZ::EBus; - -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ConnectionLimitContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ConnectionLimitContract.cpp index 362ee24735..daa2d5e80d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ConnectionLimitContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ConnectionLimitContract.cpp @@ -7,7 +7,6 @@ */ #include "ConnectionLimitContract.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ContractRTTI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ContractRTTI.cpp index 3125bfd022..e3f86e1af0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ContractRTTI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ContractRTTI.cpp @@ -8,7 +8,6 @@ #include "ContractRTTI.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisallowReentrantExecutionContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisallowReentrantExecutionContract.cpp index 74a12b0f8a..b0f1f61382 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisallowReentrantExecutionContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisallowReentrantExecutionContract.cpp @@ -7,7 +7,6 @@ */ #include "DisallowReentrantExecutionContract.h" -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisplayGroupConnectedSlotLimitContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisplayGroupConnectedSlotLimitContract.cpp index 16259f9ddb..30790c4946 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisplayGroupConnectedSlotLimitContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisplayGroupConnectedSlotLimitContract.cpp @@ -8,7 +8,6 @@ #include "DisplayGroupConnectedSlotLimitContract.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DynamicTypeContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DynamicTypeContract.cpp index ad512d4e95..64a165be6e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DynamicTypeContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DynamicTypeContract.cpp @@ -8,7 +8,6 @@ #include "DynamicTypeContract.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/IsReferenceTypeContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/IsReferenceTypeContract.cpp index 7762f45271..e5722428f6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/IsReferenceTypeContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/IsReferenceTypeContract.cpp @@ -8,7 +8,6 @@ #include "IsReferenceTypeContract.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/MethodOverloadContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/MethodOverloadContract.cpp index cdf3b6353a..6fdfe34f71 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/MethodOverloadContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/MethodOverloadContract.cpp @@ -8,7 +8,6 @@ #include "MethodOverloadContract.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/RestrictedNodeContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/RestrictedNodeContract.cpp index ad28cc316c..200b8dbfe8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/RestrictedNodeContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/RestrictedNodeContract.cpp @@ -7,7 +7,6 @@ */ #include "RestrictedNodeContract.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SlotTypeContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SlotTypeContract.cpp index 6ba3610f18..41d0903682 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SlotTypeContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SlotTypeContract.cpp @@ -7,7 +7,6 @@ */ #include "SlotTypeContract.h" -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SupportsMethodContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SupportsMethodContract.cpp index fb10501e64..648f7a77bb 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SupportsMethodContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SupportsMethodContract.cpp @@ -7,7 +7,6 @@ */ #include "SupportsMethodContract.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/TypeContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/TypeContract.cpp index cc57570c2f..0ab98707d7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/TypeContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/TypeContract.cpp @@ -7,7 +7,6 @@ */ #include "TypeContract.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 9830535ad8..530d98e112 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -23,7 +23,6 @@ set(FILES Include/ScriptCanvas/Core/NodeBus.h Include/ScriptCanvas/Core/EBusNodeBus.h Include/ScriptCanvas/Core/NodelingBus.h - Include/ScriptCanvas/Core/ContractBus.h Include/ScriptCanvas/Core/Attributes.h Include/ScriptCanvas/Core/Connection.h Include/ScriptCanvas/Core/ConnectionBus.h From e97db10ac31ab9166e8328a6de4c57a2667f64e2 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:30:26 -0800 Subject: [PATCH 302/620] Removes StorageRequiredContract from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Contracts/StorageRequiredContract.cpp | 47 ------------------- .../Core/Contracts/StorageRequiredContract.h | 30 ------------ 2 files changed, 77 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.cpp deleted file mode 100644 index f730379ec2..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.cpp +++ /dev/null @@ -1,47 +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 - * - */ -#include "StorageRequiredContract.h" - -#include -#include -#include - -namespace ScriptCanvas -{ - AZ::Outcome StorageRequiredContract::OnEvaluate(const Slot& sourceSlot, const Slot& targetSlot) const - { - if (sourceSlot.GetType() == SlotType::DataOut && targetSlot.GetType() == SlotType::DataIn) - { - bool isSlotValidStorage{}; - NodeRequestBus::EventResult(isSlotValidStorage, targetSlot.GetNodeId(), &NodeRequests::IsSlotValidStorage, targetSlot.GetId()); - if (isSlotValidStorage) - { - return AZ::Success(); - } - } - - AZStd::string errorMessage = AZStd::string::format("Connection cannot be created between source slot \"%s\" and target slot \"%s\", Storage requirement is not met. (%s)" - , sourceSlot.GetName().data() - , targetSlot.GetName().data() - , RTTI_GetTypeName() - ); - - return AZ::Failure(errorMessage); - } - - void StorageRequiredContract::Reflect(AZ::ReflectContext* reflection) - { - AZ::SerializeContext* serializeContext = azrtti_cast(reflection); - if (serializeContext) - { - serializeContext->Class() - ->Version(0) - ; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.h deleted file mode 100644 index c8718ec47f..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.h +++ /dev/null @@ -1,30 +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 - * - */ -#pragma once - -#include - -namespace ScriptCanvas -{ - class StorageRequiredContract - : public Contract - { - public: - AZ_CLASS_ALLOCATOR(StorageRequiredContract, AZ::SystemAllocator, 0); - AZ_RTTI(StorageRequiredContract, "{AECE109D-121F-477C-995F-D044CA05F88D}", Contract); - - StorageRequiredContract() = default; - - ~StorageRequiredContract() override = default; - - static void Reflect(AZ::ReflectContext* reflection); - - protected: - AZ::Outcome OnEvaluate(const Slot& sourceSlot, const Slot& targetSlot) const override; - }; -} From b56512fd18a43dae6ca4aef6a081f0ed6cf79d57 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:36:50 -0800 Subject: [PATCH 303/620] Removes LogReader.h/cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Debugger/ClientTransceiver.h | 1 - .../ScriptCanvas/Debugger/LogReader.cpp | 65 ------------------- .../Include/ScriptCanvas/Debugger/LogReader.h | 53 --------------- .../Code/scriptcanvasgem_debugger_files.cmake | 2 - 4 files changed, 121 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/ClientTransceiver.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/ClientTransceiver.h index 78e293c4b0..9335bdd1eb 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/ClientTransceiver.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/ClientTransceiver.h @@ -17,7 +17,6 @@ #include "APIArguments.h" #include "Logger.h" -#include "LogReader.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.cpp deleted file mode 100644 index 1a47ba4553..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.cpp +++ /dev/null @@ -1,65 +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 - * - */ - -#include "LogReader.h" - -namespace ScriptCanvas -{ - namespace Debugger - { - LogReader::LogReader() - { - - } - - LogReader::~LogReader() - { - - } - - void LogReader::Visit([[maybe_unused]] ExecutionThreadEnd& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] ExecutionThreadBeginning& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] GraphActivation& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] GraphDeactivation& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] NodeStateChange& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] InputSignal& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] OutputSignal& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] VariableChange& loggableEvent) - { - - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.h deleted file mode 100644 index bb0fb0d0dc..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.h +++ /dev/null @@ -1,53 +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 - * - */ - -#pragma once - -#include -#include -#include -#include -#include - -#include "APIArguments.h" - -namespace ScriptCanvas -{ - namespace Debugger - { - class LogReader - : public LoggableEventVisitor - { - public: - AZ_CLASS_ALLOCATOR(LogReader, AZ::SystemAllocator, 0); - - LogReader(); - ~LogReader(); - - // start at the beginning, if possible - bool Start() { return false; } - // step back one event, if possible - bool StepBack() { return false; } - // step forward one event, if possible - bool StepForward() { return false; } - - protected: - void Visit(ExecutionThreadEnd&); - void Visit(ExecutionThreadBeginning&); - void Visit(GraphActivation&); - void Visit(GraphDeactivation&); - void Visit(NodeStateChange&); - void Visit(InputSignal&); - void Visit(OutputSignal&); - void Visit(VariableChange&); - - private: - size_t m_index = 0; - }; - } -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_debugger_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_debugger_files.cmake index 0a68a9b175..aaeeffae45 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_debugger_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_debugger_files.cmake @@ -18,8 +18,6 @@ set(FILES Include/ScriptCanvas/Debugger/Debugger.cpp Include/ScriptCanvas/Debugger/Logger.h Include/ScriptCanvas/Debugger/Logger.cpp - Include/ScriptCanvas/Debugger/LogReader.h - Include/ScriptCanvas/Debugger/LogReader.cpp Include/ScriptCanvas/Debugger/StatusBus.h Include/ScriptCanvas/Debugger/Messages/Notify.cpp Include/ScriptCanvas/Debugger/Messages/Notify.h From 5cca35370967b30883875165e2e4eb8dcbe2ce16 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:45:03 -0800 Subject: [PATCH 304/620] Removes NativeHostDeclarations and NativeHostDefinitions from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Execution/NativeHostDeclarations.cpp | 16 ----- .../Execution/NativeHostDeclarations.h | 25 ------- .../Execution/NativeHostDefinitions.cpp | 65 ------------------- .../Execution/NativeHostDefinitions.h | 24 ------- .../Code/scriptcanvasgem_common_files.cmake | 4 -- .../Code/scriptcanvasgem_headers.cmake | 4 -- 6 files changed, 138 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp deleted file mode 100644 index b3383a1044..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp +++ /dev/null @@ -1,16 +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 - * - */ - -#include "NativeHostDeclarations.h" - -namespace ScriptCanvas -{ - RuntimeContext::RuntimeContext(AZ::EntityId graphId) - : m_graphId(graphId) - {} -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.h deleted file mode 100644 index ea6c884a6f..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.h +++ /dev/null @@ -1,25 +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 - * - */ - -#pragma once - -#include - -namespace ScriptCanvas -{ - class RuntimeContext - { - public: - RuntimeContext(AZ::EntityId graphId); - - AZ_INLINE AZ::EntityId GetGraphId() const { return m_graphId; } - - protected: - AZ::EntityId m_graphId; - }; -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp deleted file mode 100644 index 036310fca4..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp +++ /dev/null @@ -1,65 +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 - * - */ - -#include "NativeHostDefinitions.h" -#include - -namespace NativeHostDefinitionsCPP -{ - using namespace ScriptCanvas; - - using FunctionMap = AZStd::unordered_map; - FunctionMap s_functionMap; -} - -namespace ScriptCanvas -{ - bool CallNativeGraphStart(AZStd::string_view name, const RuntimeContext& context) - { - using namespace NativeHostDefinitionsCPP; - - auto iter = s_functionMap.find(name); - if (iter != s_functionMap.end()) - { - iter->second(context); - return true; - } - - return false; - } - - bool RegisterNativeGraphStart(AZStd::string_view name, GraphStartFunction function) - { - using namespace NativeHostDefinitionsCPP; - - auto iter = s_functionMap.find(name); - if (iter == s_functionMap.end()) - { - s_functionMap.insert({ name, function }); - return true; - } - - return false; - } - - // this may never have to be necessary - bool UnregisterNativeGraphStart(AZStd::string_view name) - { - using namespace NativeHostDefinitionsCPP; - - auto iter = s_functionMap.find(name); - if (iter != s_functionMap.end()) - { - s_functionMap.erase(iter); - return true; - } - - return false; - } - -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.h deleted file mode 100644 index 457e8d4621..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.h +++ /dev/null @@ -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 - * - */ - -#include "NativeHostDeclarations.h" - -namespace ScriptCanvas -{ - typedef void (*GraphStartFunction)(const RuntimeContext&); - - using GraphStartFunction = void(*)(const RuntimeContext&); - - bool CallNativeGraphStart(AZStd::string_view name, const RuntimeContext& context); - - bool RegisterNativeGraphStart(AZStd::string_view name, GraphStartFunction function); - - // this may never have to be necessary - bool UnregisterNativeGraphStart(AZStd::string_view name); - -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index c0dcc04838..65aaeb1b33 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -68,8 +68,6 @@ set(FILES Include/ScriptCanvas/Execution/ExecutionObjectCloning.cpp Include/ScriptCanvas/Execution/ExecutionPerformanceTimer.cpp Include/ScriptCanvas/Execution/ExecutionState.cpp - Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp - Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp Include/ScriptCanvas/Execution/RuntimeComponent.cpp Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedCloningAPI.cpp @@ -90,8 +88,6 @@ set(FILES Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp Include/ScriptCanvas/Grammar/PrimitivesExecution.cpp Include/ScriptCanvas/Execution/ExecutionContext.cpp - Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp - Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp Include/ScriptCanvas/Execution/RuntimeComponent.cpp Include/ScriptCanvas/Internal/Nodeables/BaseTimer.cpp Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 530d98e112..c5e0d75b39 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -100,8 +100,6 @@ set(FILES Include/ScriptCanvas/Execution/ExecutionPerformanceTimer.h Include/ScriptCanvas/Execution/ExecutionState.h Include/ScriptCanvas/Execution/ExecutionStateDeclarations.h - Include/ScriptCanvas/Execution/NativeHostDeclarations.h - Include/ScriptCanvas/Execution/NativeHostDefinitions.h Include/ScriptCanvas/Execution/RuntimeComponent.h Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.h Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedCloningAPI.h @@ -126,8 +124,6 @@ set(FILES Include/ScriptCanvas/Execution/ErrorBus.h Include/ScriptCanvas/Execution/ExecutionContext.h Include/ScriptCanvas/Execution/ExecutionBus.h - Include/ScriptCanvas/Execution/NativeHostDeclarations.h - Include/ScriptCanvas/Execution/NativeHostDefinitions.h Include/ScriptCanvas/Execution/RuntimeComponent.h Include/ScriptCanvas/Internal/Nodeables/BaseTimer.h Include/ScriptCanvas/Internal/Nodeables/BaseTimer.ScriptCanvasNodeable.xml From 0e2af596b4015c8d79fed425660f5543baae2a68 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:45:49 -0800 Subject: [PATCH 305/620] Removes duplicated lines in cmake files in Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 65aaeb1b33..1301883453 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -87,13 +87,10 @@ set(FILES Include/ScriptCanvas/Grammar/Primitives.cpp Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp Include/ScriptCanvas/Grammar/PrimitivesExecution.cpp - Include/ScriptCanvas/Execution/ExecutionContext.cpp - Include/ScriptCanvas/Execution/RuntimeComponent.cpp Include/ScriptCanvas/Internal/Nodeables/BaseTimer.cpp Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.cpp Include/ScriptCanvas/Internal/Nodes/StringFormatted.cpp - Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp Include/ScriptCanvas/Libraries/Libraries.cpp Include/ScriptCanvas/Libraries/Core/AzEventHandler.cpp Include/ScriptCanvas/Libraries/Core/BinaryOperator.cpp @@ -200,6 +197,5 @@ set(FILES Include/ScriptCanvas/Utils/NodeUtils.cpp Include/ScriptCanvas/Utils/VersionConverters.cpp Include/ScriptCanvas/Utils/VersioningUtils.cpp - Include/ScriptCanvas/Utils/VersioningUtils.cpp Include/ScriptCanvas/Utils/BehaviorContextUtils.cpp -) \ No newline at end of file +) From 48a5280b6d646d096a01a783f385fefd59a475aa Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:56:29 -0800 Subject: [PATCH 306/620] Removes NodeableOutNative.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Core/SubgraphInterfaceUtility.h | 20 ----- .../Interpreted/ExecutionInterpretedAPI.cpp | 1 - .../ExecutionInterpretedCloningAPI.cpp | 1 - .../ExecutionInterpretedEBusAPI.cpp | 1 - .../Interpreted/ExecutionInterpretedOut.cpp | 1 - .../Execution/NodeableOut/NodeableOutNative.h | 66 -------------- .../Code/scriptcanvasgem_headers.cmake | 1 - .../Tests/ScriptCanvas_RuntimeInterpreted.cpp | 1 - .../Code/Tests/ScriptCanvas_VM.cpp | 87 ------------------- 9 files changed, 179 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h index a43f4be6b6..91e229978a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h @@ -78,26 +78,6 @@ namespace ScriptCanvas return output; } - template - Out CreateOutHelper(const AZStd::string& name, const AZStd::vector& outputNames, AZStd::index_sequence) - { - Out out; - SetDisplayAndParsedName(out, name); - out.outputs.reserve(sizeof...(Is)); - - int dummy[]{ 0, (out.outputs.emplace_back(CreateOutput(outputNames[Is])), 0)... }; - static_cast(dummy); /* avoid warning for unused variable */ - - return out; - } - - template - Out CreateOut(const AZStd::string& name, const AZStd::vector& outputNames = {}) - { - return CreateOutHelper(name, outputNames, AZStd::make_index_sequence()); - } - - template Out CreateOutReturnHelper(const AZStd::string& name, const AZStd::string& returnName, const AZStd::vector& outputNames, AZStd::index_sequence) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp index eb856963f7..b98b962be9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedCloningAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedCloningAPI.cpp index 387b537148..90cb632961 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedCloningAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedCloningAPI.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedEBusAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedEBusAPI.cpp index d33f78c8b4..fd91221088 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedEBusAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedEBusAPI.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include "ExecutionInterpretedOut.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedOut.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedOut.cpp index 4820cf4741..99cb414597 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedOut.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedOut.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include "ExecutionInterpretedAPI.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h deleted file mode 100644 index ab6859db1e..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h +++ /dev/null @@ -1,66 +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 - * - */ - -#pragma once - -#include -#include -#include - -#include - -namespace ScriptCanvas -{ - namespace Execution - { - template - FunctorOut CreateOutWithArgs(Callable&& callable, Allocator& allocator, AZStd::Internal::pack_traits_arg_sequence, std::index_sequence, ReturnTypeIsNotVoid) - { - auto nodeCallWrapper = [callable = AZStd::forward(callable)](AZ::BehaviorValueParameter* result, AZ::BehaviorValueParameter* arguments, int numArguments) mutable - { - [[maybe_unused]] constexpr size_t numFunctorArguments = sizeof...(Args); - (void)numArguments; - AZ_Assert(numArguments == numFunctorArguments, "number of arguments doesn't match number of parameters"); - AZ_Assert(result, "no null result allowed"); - result->StoreResult(AZStd::invoke(callable, *arguments[IndexSequence].GetAsUnsafe()...)); - }; - - static_assert(!AZStd::is_same_v || sizeof(nodeCallWrapper) <= MaxNodeableOutStackSize, "Lambda is too large to fit within NodebleOut functor"); - return FunctorOut(AZStd::move(nodeCallWrapper), allocator); - } - - template - FunctorOut CreateOutWithArgs(Callable&& callable, Allocator& allocator, AZStd::Internal::pack_traits_arg_sequence, std::index_sequence, ReturnTypeIsVoid) - { - auto nodeCallWrapper = [callable = AZStd::forward(callable)](AZ::BehaviorValueParameter*, AZ::BehaviorValueParameter* arguments, int numArguments) mutable - { - [[maybe_unused]] constexpr size_t numFunctorArguments = sizeof...(Args); - (void)numArguments; - AZ_Assert(numArguments == numFunctorArguments, "number of arguments doesn't match number of parameters"); - AZStd::invoke(callable, *arguments[IndexSequence].GetAsUnsafe()...); - }; - - static_assert(!AZStd::is_same_v || sizeof(nodeCallWrapper) <= MaxNodeableOutStackSize, "Lambda is too large to fit within NodebleOut functor"); - return FunctorOut(AZStd::move(nodeCallWrapper), allocator); - } - - template - FunctorOut CreateOut(Callable&& callable, Allocator& allocator) - { - using CallableTraits = AZStd::function_traits>; - return CreateOutWithArgs - ( AZStd::forward(callable) - , allocator - , typename CallableTraits::arg_types{} - , typename CallableTraits::template expand_args{} - , typename AZStd::is_void::type{}); - } - - } - -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index c5e0d75b39..cf6bbbd31c 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -111,7 +111,6 @@ set(FILES Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPure.h Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedSingleton.h Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedUtility.h - Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h Include/ScriptCanvas/Grammar/AbstractCodeModel.h Include/ScriptCanvas/Grammar/DebugMap.h Include/ScriptCanvas/Grammar/ExecutionTraversalListeners.h diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp index 3d88f014ff..a4a5a78b7e 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp index 2c455d80f5..29e72cbd2b 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -25,92 +24,6 @@ using namespace ScriptCanvasTests; using namespace TestNodes; using namespace ScriptCanvas::Execution; -// TEST_F(ScriptCanvasTestFixture, NativeNodeableStack) -// { -// TestNodeableObject nodeable; -// nodeable.Initialize(); -// -// bool wasTrueCalled = false; -// bool wasFalseCalled = false; -// -// nodeable.SetExecutionOut -// ( AZ_CRC("BranchTrue", 0xd49f121c) -// , CreateOut -// ([&wasTrueCalled](ExecutionState&, Data::BooleanType condition, const Data::StringType& message) -// { -// EXPECT_TRUE(condition); -// EXPECT_EQ(message, AZStd::string("called the true version!")); -// wasTrueCalled = true; -// } -// , StackAllocatorType{})); -// -// nodeable.SetExecutionOut -// ( AZ_CRC("BranchFalse", 0xaceca8bc) -// , CreateOut -// ([&wasFalseCalled](ExecutionState&, Data::BooleanType condition, const Data::StringType& message, const Data::Vector3Type& vector) -// { -// EXPECT_FALSE(condition); -// EXPECT_EQ(message, AZStd::string("called the false version!")); -// EXPECT_EQ(vector, AZ::Vector3(1, 2, 3)); -// wasFalseCalled = true; -// } -// , StackAllocatorType{})); -// -// nodeable.Branch(true); -// nodeable.Branch(false); -// -// EXPECT_TRUE(wasTrueCalled); -// EXPECT_TRUE(wasFalseCalled); -// } - -// -// TEST_F(ScriptCanvasTestFixture, NativeNodeableHeap) -// { -// TestNodeableObject nodeable; -// nodeable.Initialize(); -// -// AZStd::string routedArg("XYZ"); -// AZStd::array bigArray; -// std::fill(bigArray.begin(), bigArray.end(), 0); -// -// bigArray[0] = 7; -// bigArray[2047] = 7; -// -// EXPECT_EQ(bigArray[0], 7); -// EXPECT_EQ(bigArray[2047], 7); -// -// bool isHeapCalled = false; -// -// nodeable.SetExecutionOut -// ( AZ_CRC("BranchTrue", 0xd49f121c) -// , CreateOut -// ([routedArg, &isHeapCalled, bigArray](ExecutionState&, Data::BooleanType condition, const Data::StringType& message) mutable -// { -// EXPECT_EQ(message, AZStd::string("called the true version!")); -// routedArg = message; -// isHeapCalled = true; -// EXPECT_EQ(bigArray[0], 7); -// EXPECT_EQ(bigArray[2047], 7); -// bigArray[0] = 9; -// bigArray[2047] = 9; -// EXPECT_EQ(bigArray[0], 9); -// EXPECT_EQ(bigArray[2047], 9); -// } -// , HeapAllocatorType{})); -// -// -// bigArray[0] = 8; -// bigArray[2047] = 8; -// EXPECT_EQ(bigArray[0], 8); -// EXPECT_EQ(bigArray[2047], 8); -// -// nodeable.Branch(true); -// EXPECT_TRUE(isHeapCalled); -// -// // just making sure no crash occurs on unconnected outs -// nodeable.Branch(false); -// } - class Grandparent { public: From 8f4e547b9e2b9e055a65970d777446951661b330 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:59:32 -0800 Subject: [PATCH 307/620] Removes ExecutionIterator.h and Parser.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Grammar/ExecutionIterator.h | 86 --------------- .../Include/ScriptCanvas/Grammar/Parser.h | 104 ------------------ 2 files changed, 190 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ExecutionIterator.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Parser.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ExecutionIterator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ExecutionIterator.h deleted file mode 100644 index 03c6842b7c..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ExecutionIterator.h +++ /dev/null @@ -1,86 +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 - * - */ - -#pragma once - -#include -#include -#include -#include - -#include "ExecutionVisitor.h" - -namespace ScriptCanvas -{ - class Graph; - class Node; - - namespace Grammar - { - /** - This is the effective lexer of the system. It properly identifies which canvas node is the next 'token' - */ - class ExecutionIterator - { - friend class ExecutionVisitor; - - public: - ExecutionIterator(); - ExecutionIterator(const Graph& graph); - ExecutionIterator(const Node& block); - - bool Begin(); - bool Begin(const Graph& graph); - bool Begin(const Node& block); - AZ_INLINE const Node* GetCurrentToken() const { return *m_current; } - const Node* operator->() const; - explicit operator bool() const; - bool operator!() const; - ExecutionIterator& operator++(); - void PrettyPrint() const; - - protected: - static const Node* FindNextStatement(const Node& current); - - void PushFunctionCall(); - void PushExpression(); - void PushStatement(); - void BuildNextStatement(); - - bool BuildQueue(const Graph& graph); - bool BuildQueue(const Node& node); - bool BuildQueue(); - - private: - // track whether we're in a expression stack - bool m_pushingExpressions = false; - // current canvas node of any type - const Node* m_currentSourceNode = nullptr; - // current executable statement that isn't just an expression - const Node* m_currentSourceStatementNode = nullptr; - // first statement in the block entry - const Node* m_currentSourceStatementRoot = nullptr; - // canvas source - const Graph* m_source = nullptr; - - NodeIdList m_sourceNodes; - // "parent-less" executable statements, or parented only to a start node - NodePtrConstList m_currentSourceInitialStatements; - // detect infinite loops - AZStd::set m_iteratedStatements; - - ExecutionVisitor m_visitor; - // final queue of iterated nodes - AZStd::vector m_queue; - // current position in the final queue - NodePtrConstList::iterator m_current = nullptr; - }; - - } // namespace Parser - -} // namepsace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Parser.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Parser.h deleted file mode 100644 index f6a02e24c8..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Parser.h +++ /dev/null @@ -1,104 +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 - * - */ - -#pragma once - -#include -#include -#include -#include -#include - -#include "ExecutionIterator.h" -#include "ParseError.h" -#include "ParserVisitor.h" - -namespace ScriptCanvas -{ - class Graph; - class Node; - - namespace AST - { - class Block; - } - - namespace Grammar - { - NodePtrConstList FindInitialStatements(const NodeIdList& nodes); - NodePtrConstList FindInitialStatements(const Node& node); - const Node* FindNextStatement(const Node& node); - - class Parser - { - friend class ParserVisitor; - - public: - Parser(const Graph& graph); - - AZ_CLASS_ALLOCATOR(Parser, AZ::SystemAllocator, 0); - - AST::SmartPtrConst Parse(); - void ConsumeToken(); - const Node* GetToken() const; - const Graph& GetSource() const; - const NodeIdList& GetSourceNodeIDs() const; - AST::NodePtr GetTree() const; - bool IsValid() const; - void SetRoot(AST::SmartPtr&& root); - void AddChild(AST::NodePtr&& child); - - Grammar::eRule GetExpectedRule() const; - - protected: - void AddError(ParseError&& error); - void AddStatement(AST::SmartPtrConst&& statement); - void FindInitialStatements(); - void FindNextSourceNode(); - void InitializeGraphBlock(); - - AST::SmartPtrConst CreateBinaryOperator(const Node& node, Grammar::eRule operatorType, AST::SmartPtrConst&& lhs, AST::SmartPtrConst&& rhs); - AST::SmartPtrConst ParseBinaryOperation(const Node& node, Grammar::eRule operatorType); - AST::SmartPtrConst ParseExpression(const Node& node); - AST::SmartPtrConst ParseExpressionList(const Node& node); - AST::NodePtrConst ParseFunctionCall(const Node& node, const char* functionName); - AST::SmartPtrConst ParseFunctionCallAsStatement(const Node& node, const char* functionName); - AST::SmartPtrConst ParseNumeral(const Node& node); - - private: - class ExpressionScoper - { - public: - AZ_INLINE ExpressionScoper(Parser& parser) - : m_parser(parser) - { - ++m_parser.m_expressionDepth; - } - - AZ_INLINE ~ExpressionScoper() - { - --m_parser.m_expressionDepth; - } - - private: - Parser& m_parser; - }; - - friend class ExpressionScoper; - - int m_expressionDepth = 0; - Grammar::ExecutionIterator m_executionIterator; - AST::SmartPtr m_currentBlock; - AST::SmartPtr m_root; - AZStd::set m_consumedSourceNodes; - AZStd::vector m_errors; - ParserVisitor m_visitor; - }; - } // namespace Grammar - -} // namespace ScriptCanvas} From ff0a5b6c0dae3cd912881805fc5bd1bdab975ebb Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:27:54 -0800 Subject: [PATCH 308/620] Removes ComparisonFunctions.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Comparison/ComparisonFunctions.h | 387 ------------------ .../Libraries/Comparison/EqualTo.h | 2 - .../Libraries/Comparison/Greater.h | 1 - .../Libraries/Comparison/GreaterEqual.h | 2 - .../ScriptCanvas/Libraries/Comparison/Less.h | 1 - .../Libraries/Comparison/LessEqual.h | 1 - .../Libraries/Comparison/NotEqualTo.h | 1 - .../Code/scriptcanvasgem_headers.cmake | 1 - 8 files changed, 396 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/ComparisonFunctions.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/ComparisonFunctions.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/ComparisonFunctions.h deleted file mode 100644 index bd50d6c481..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/ComparisonFunctions.h +++ /dev/null @@ -1,387 +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 - * - */ - -#pragma once - -#if defined(EXPRESSION_TEMPLATES_ENABLED) - -#include -#include - -#include -#include -#include -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Comparison - { - enum class OperatorType : AZ::u32 - { - Equal, - NotEqual, - Less, - Greater, - LessEqual, - GreaterEqual - }; - - template - struct CompareAction - { - // Compares two primitive types each other - //! \return true if a comparison occurred between both types and stores the result of the comparison in the @result parameter - inline static bool CompareNumber(bool& result, OperatorType operatorType, NumberType1 leftNumber, NumberType2 rightNumber) - { - switch (operatorType) - { - case OperatorType::Equal: - result = leftNumber == rightNumber; - return true; - case OperatorType::NotEqual: - result = leftNumber != rightNumber; - return true; - case OperatorType::Less: - result = leftNumber < rightNumber; - return true; - case OperatorType::Greater: - result = leftNumber > rightNumber; - return true; - case OperatorType::LessEqual: - result = leftNumber <= rightNumber; - return true; - case OperatorType::GreaterEqual: - result = leftNumber >= rightNumber; - return true; - default: - return false; - } - } - }; - - //! Attempts to cast the second object parameter to a primitive type and compare it against the supplied primitive parameter - //! \return true if a comparison occurred between both types and stores the result of the comparison in the @result parameter - template::value>> - inline bool CompareNumberToBehaviorParameter(bool& result, OperatorType operatorType, NumberType leftNumber, AZ::BehaviorValueParameter& rhs) - { - if(CanCastToValue(rhs)) - { - NumberType convertedParam{}; - return CastToValue(convertedParam, rhs) && CompareAction::CompareNumber(result, operatorType, leftNumber, convertedParam); - } - return false; - } - - //! Attempts to cast the supplied object parameters to a primitive type and compare them - //! \return true if a comparison occurred between both types and stores the result of the comparison in the @result parameter - inline bool ComparePrimitive(bool& result, OperatorType operatorType, const Datum& lhs, const Datum& rhs) - { - auto leftParam = lhs.Get(); - auto rightParam = rhs.Get(); - if (CanCastToValue(leftParam)) - { - bool convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - double convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result,operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - float convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::u64 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::s64 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - unsigned long convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - long convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::u32 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::s32 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::u16 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::s16 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::u8 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::s8 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - char convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - - return false; - } - - /** - For the record, this is amazing. But, we can't go dumpster diving through behavior context for the right method to call. If there is a proper evaluation to make, we make the ability for people to - expose to behavior context the correct operations they want used in ScriptCanvas. No matter which route we chose, we should do it at edit time, rather than compile time. - */ - - //! Returns a multimap of methods which match the operatorType prioritized by the by least number of type conversions needed for both parameters to invoke the method - inline AZStd::multimap FindOperatorMethod(AZ::Script::Attributes::OperatorType operatorLookupType, AZ::BehaviorValueParameter& leftParameter, AZ::BehaviorValueParameter& rightParameter) - { - AZStd::multimap methodMap; - AZ::BehaviorContext* behaviorContext{}; - AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext); - if (!behaviorContext) - { - return methodMap; - } - - auto behaviorClassIt = behaviorContext->m_typeToClassMap.find(leftParameter.m_typeId); - if (behaviorClassIt != behaviorContext->m_typeToClassMap.end()) - { - AZ::BehaviorClass* behaviorClass = behaviorClassIt->second; - for (auto& methodPair : behaviorClass->m_methods) - { - AZ::BehaviorMethod* method = methodPair.second; - if (auto* operatorAttr = FindAttribute(AZ::Script::Attributes::Operator, method->m_attributes)) - { - // read the operator type - AZ::AttributeReader operatorAttrReader(nullptr, operatorAttr); - AZ::Script::Attributes::OperatorType operatorType; - operatorAttrReader.Read(operatorType); - - if (operatorType == operatorLookupType - && method->HasResult() && method->GetResult()->m_typeId == azrtti_typeid() && method->GetNumArguments() == 2) - { - if (behaviorClass->m_typeId == method->GetArgument(0)->m_typeId && rightParameter.m_typeId == method->GetArgument(1)->m_typeId) - { - methodMap.emplace(0, method); - } - else if (behaviorClass->m_typeId == method->GetArgument(0)->m_typeId && rightParameter.m_azRtti && rightParameter.m_azRtti->IsTypeOf(method->GetArgument(1)->m_typeId)) - { - methodMap.emplace(1, method); - } - else if (behaviorClass->m_azRtti && behaviorClass->m_azRtti->IsTypeOf(method->GetArgument(0)->m_typeId) && rightParameter.m_typeId == method->GetArgument(1)->m_typeId) - { - methodMap.emplace(1, method); - } - else if (behaviorClass->m_azRtti && behaviorClass->m_azRtti->IsTypeOf(method->GetArgument(0)->m_typeId) && rightParameter.m_azRtti && rightParameter.m_azRtti->IsTypeOf(method->GetArgument(1)->m_typeId)) - { - methodMap.emplace(2, method); - } - } - } - } - } - - return methodMap; - } - - inline bool InvokeMethod(AZ::BehaviorMethod* method, AZ::BehaviorValueParameter& resultParam, AZStd::array, 2> parameters) - { - AZStd::array argAddresses; - AZStd::array methodArgs; - for (size_t i = 0; i < methodArgs.size(); ++i) - { - methodArgs[i].Set(*method->GetArgument(i)); - argAddresses[i] = parameters[i].get().GetValueAddress(); - if (methodArgs[i].m_traits & AZ::BehaviorParameter::TR_POINTER) - { - methodArgs[i].m_value = &argAddresses[i]; - } - else - { - methodArgs[i].m_value = argAddresses[i]; - } - } - - return method->Call(methodArgs.data(), static_cast(methodArgs.size()), &resultParam); - } - - //! Compares two object types to each other - //! \return true if a comparison occurred between both types and stores the result of the comparison in the @result parameter - inline bool CompareObjects(bool& result, OperatorType operatorType, const Datum& lhs, const Datum& rhs) - { - auto leftParameter = lhs.Get(); - auto rightParameter = rhs.Get(); - AZ::BehaviorValueParameter resultParameter(&result); - AZStd::multimap methodMap{}; - switch (operatorType) - { - case OperatorType::Equal: - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::Equal, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(leftParameter), AZStd::reference_wrapper(rightParameter)} })) - { - return true; - } - } - else - { - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::Equal, rightParameter, leftParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(rightParameter), AZStd::reference_wrapper(leftParameter) } })) - { - return true; - } - } - } - break; - case OperatorType::NotEqual: - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::Equal, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(leftParameter), AZStd::reference_wrapper(rightParameter) } })) - { - result = !result; - return true; - } - } - else - { - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::Equal, rightParameter, leftParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(rightParameter), AZStd::reference_wrapper(leftParameter) } })) - { - result = !result; - return true; - } - } - } - break; - - case OperatorType::Less: - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::LessThan, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(leftParameter), AZStd::reference_wrapper(rightParameter) } })) - { - return true; - } - } - break; - case OperatorType::Greater: - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::LessThan, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(rightParameter), AZStd::reference_wrapper(leftParameter) } })) - { - return true; - } - } - break; - case OperatorType::LessEqual: - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::LessEqualThan, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(leftParameter), AZStd::reference_wrapper(rightParameter) } })) - { - return true; - } - } - else - { - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::LessThan, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(rightParameter), AZStd::reference_wrapper(leftParameter) } })) - { - result = !result; - return true; - } - } - } - break; - case OperatorType::GreaterEqual: - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::LessEqualThan, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(rightParameter), AZStd::reference_wrapper(leftParameter) } })) - { - return true; - } - } - else - { - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::LessThan, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(leftParameter), AZStd::reference_wrapper(rightParameter) } })) - { - result = !result; - return true; - } - } - } - break; - default: - break; - } - return false; - } - - template - struct ComparisonOperator - { - bool operator()(const Datum& lhs, const Datum& rhs) const - { - - // If both types sides are primitive types then perform a special case primitive value compare - bool result{}; - if (ComparePrimitive(result, operatorType, lhs, rhs) || CompareObjects(result, operatorType, lhs, rhs)) - { - return result; - } - - return false; - } - - }; - } - } -} - -#endif // EXPRESSION_TEMPLATES_ENABLED diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/EqualTo.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/EqualTo.h index b2ef525880..9223248c77 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/EqualTo.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/EqualTo.h @@ -8,10 +8,8 @@ #pragma once -#include "ComparisonFunctions.h" #include - namespace ScriptCanvas { namespace Nodes diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Greater.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Greater.h index da3765c7fc..8465d79be1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Greater.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Greater.h @@ -8,7 +8,6 @@ #pragma once -#include "ComparisonFunctions.h" #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/GreaterEqual.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/GreaterEqual.h index 70d9b073d7..2ee7afe3b4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/GreaterEqual.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/GreaterEqual.h @@ -8,8 +8,6 @@ #pragma once - -#include "ComparisonFunctions.h" #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Less.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Less.h index f96dd12d0d..b4fd2810d8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Less.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Less.h @@ -8,7 +8,6 @@ #pragma once -#include "ComparisonFunctions.h" #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/LessEqual.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/LessEqual.h index a0459e6fe0..7f0fe9b9ce 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/LessEqual.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/LessEqual.h @@ -8,7 +8,6 @@ #pragma once -#include "ComparisonFunctions.h" #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h index be47c49e6d..fa2525b94f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h @@ -8,7 +8,6 @@ #pragma once -#include "ComparisonFunctions.h" #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index cf6bbbd31c..2bfa9c74e3 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -230,7 +230,6 @@ set(FILES Include/ScriptCanvas/Libraries/Math/Vector3Nodes.h Include/ScriptCanvas/Libraries/Math/Vector4Nodes.h Include/ScriptCanvas/Libraries/Comparison/Comparison.h - Include/ScriptCanvas/Libraries/Comparison/ComparisonFunctions.h Include/ScriptCanvas/Libraries/Comparison/EqualTo.h Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h Include/ScriptCanvas/Libraries/Comparison/Less.h From 7cefe2b6c272dcd880077f353c9dd4bd4d6af7c6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:31:26 -0800 Subject: [PATCH 309/620] Removes FunctionBus.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Libraries/Core/FunctionBus.h | 51 ------------------- .../Libraries/Core/FunctionDefinitionNode.cpp | 1 - .../ScriptCanvas/Libraries/Core/Nodeling.cpp | 1 - .../Code/scriptcanvasgem_headers.cmake | 1 - 4 files changed, 54 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionBus.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionBus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionBus.h deleted file mode 100644 index 5e89cf4d15..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionBus.h +++ /dev/null @@ -1,51 +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 - * - */ - -#pragma once - -#include -#include - -#include - -namespace ScriptCanvas -{ - class FunctionRequests : public AZ::EBusTraits - { - public: - using BusIdType = AZ::EntityId; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - - virtual void OnSignalOut(ID, SlotId) = 0; - }; - - using FunctionRequestBus = AZ::EBus; - - class FunctionNodeNotifications : public AZ::EBusTraits - { - public: - using BusIdType = GraphScopedNodeId; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - - virtual void OnNameChanged() = 0; - }; - - using FunctionNodeNotificationBus = AZ::EBus; - - class FunctionNodeRequests : public AZ::EBusTraits - { - public: - using BusIdType = GraphScopedNodeId; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - - virtual AZStd::string GetName() const = 0; - }; - - using FunctionNodeRequestBus = AZ::EBus; -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.cpp index 542fc2f0c1..35e17f15ed 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.cpp @@ -11,7 +11,6 @@ #include #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Nodeling.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Nodeling.cpp index 56d346b67e..64eef40a0f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Nodeling.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Nodeling.cpp @@ -14,7 +14,6 @@ #include #include -#include #include diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 2bfa9c74e3..68fb0e2e67 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -146,7 +146,6 @@ set(FILES Include/ScriptCanvas/Libraries/Core/EventHandlerTranslationUtility.h Include/ScriptCanvas/Libraries/Core/ForEach.h Include/ScriptCanvas/Libraries/Core/ForEach.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/Core/FunctionBus.h Include/ScriptCanvas/Libraries/Core/FunctionCallNode.h Include/ScriptCanvas/Libraries/Core/FunctionCallNode.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/Core/FunctionCallNodeIsOutOfDate.h From b292f62a446defe5993693c764c83089aa76b719 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:42:12 -0800 Subject: [PATCH 310/620] Removes MethodUtility.cpp/h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Core/NodeableNode.cpp | 1 - .../Core/NodeableNodeOverloaded.cpp | 1 - .../Core/SubgraphInterfaceUtility.cpp | 1 - .../Internal/Nodes/BaseTimerNode.cpp | 2 - .../Libraries/Core/ExtractProperty.cpp | 1 - .../ScriptCanvas/Libraries/Core/ForEach.cpp | 2 - .../Libraries/Core/FunctionCallNode.cpp | 1 - .../Libraries/Core/GetVariable.cpp | 1 - .../ScriptCanvas/Libraries/Core/Method.cpp | 1 - .../Libraries/Core/MethodOverloaded.cpp | 1 - .../Libraries/Core/MethodUtility.cpp | 87 ------------------- .../Libraries/Core/MethodUtility.h | 28 ------ .../ScriptCanvas/Libraries/Core/Repeater.cpp | 1 - .../Libraries/Core/SendScriptEvent.cpp | 1 - .../Libraries/Core/SetVariable.cpp | 3 +- .../Operators/Containers/OperatorAt.cpp | 1 - .../Operators/Containers/OperatorBack.cpp | 1 - .../Operators/Containers/OperatorClear.cpp | 1 - .../Operators/Containers/OperatorEmpty.cpp | 1 - .../Operators/Containers/OperatorErase.cpp | 1 - .../Operators/Containers/OperatorFront.cpp | 1 - .../Operators/Containers/OperatorInsert.cpp | 1 - .../Operators/Containers/OperatorPushBack.cpp | 1 - .../Operators/Containers/OperatorSize.cpp | 1 - .../Libraries/Operators/Math/OperatorAdd.cpp | 1 - .../Operators/Math/OperatorArithmetic.cpp | 1 - .../Libraries/Operators/Math/OperatorDiv.cpp | 1 - .../Operators/Math/OperatorDivideByNumber.cpp | 1 - .../Operators/Math/OperatorLength.cpp | 1 - .../Libraries/Operators/Math/OperatorMul.cpp | 1 - .../Libraries/Operators/Math/OperatorSub.cpp | 1 - .../Libraries/Operators/Operator.cpp | 2 - .../Code/scriptcanvasgem_common_files.cmake | 1 - .../Code/scriptcanvasgem_headers.cmake | 1 - 34 files changed, 2 insertions(+), 150 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNode.cpp index 28b7b05cda..323448f57c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNode.cpp @@ -14,7 +14,6 @@ #include #include #include -#include namespace NodeableNodeCpp { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp index 58af3a75de..1c77836fff 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp @@ -14,7 +14,6 @@ #include #include #include -#include namespace NodeableNodeOverloadedCpp { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.cpp index 74a41eb2c6..a9f80b784b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.cpp @@ -9,7 +9,6 @@ #include "SubgraphInterfaceUtility.h" #include -#include namespace SubgraphInterfaceUtilityCpp { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp index 912251ce45..4d72bac561 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp @@ -7,8 +7,6 @@ */ #include -#include - namespace ScriptCanvas { namespace Nodes diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp index 71e2d338d6..47519773ab 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp @@ -7,7 +7,6 @@ */ #include -#include namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp index 97e41d6a53..43af6fa508 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp @@ -9,8 +9,6 @@ #include #include -#include - namespace ScriptCanvas { namespace Nodes diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp index 551b9b4002..94a04f4f59 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp index c907c47c78..f88fb03726 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp @@ -8,7 +8,6 @@ #include "GetVariable.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp index ccdf15a111..e00c99b93e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp index f49fcb3318..96c2fbf3e7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp deleted file mode 100644 index 0ddd161847..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp +++ /dev/null @@ -1,87 +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 - * - */ - -#include -#include -#include - -namespace ScriptCanvas -{ - AZStd::unordered_map GetTupleGetMethodsFromResult(const AZ::BehaviorMethod& method) - { - if (method.HasResult()) - { - if (const AZ::BehaviorParameter* result = method.GetResult()) - { - return GetTupleGetMethods(result->m_typeId); - } - } - - return {}; - } - - AZStd::unordered_map GetTupleGetMethods(const AZ::TypeId& typeId) - { - AZStd::unordered_map tupleGetMethodMap; - - AZ::BehaviorContext* behaviorContext{}; - AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext); - auto bcClassIterator = behaviorContext->m_typeToClassMap.find(typeId); - const AZ::BehaviorClass* behaviorClass = bcClassIterator != behaviorContext->m_typeToClassMap.end() ? bcClassIterator->second : nullptr; - - if (behaviorClass) - { - for (auto& methodPair : behaviorClass->m_methods) - { - const AZ::BehaviorMethod* behaviorMethod = methodPair.second; - if (AZ::Attribute* attribute = FindAttribute(AZ::ScriptCanvasAttributes::TupleGetFunctionIndex, behaviorMethod->m_attributes)) - { - AZ::AttributeReader tupleGetFuncAttrReader(nullptr, attribute); - int tupleGetFuncIndex = -1; - if (tupleGetFuncAttrReader.Read(tupleGetFuncIndex)) - { - [[maybe_unused]] auto insertIter = tupleGetMethodMap.emplace(tupleGetFuncIndex, behaviorMethod); - AZ_Error("Script Canvas", insertIter.second, "Multiple methods with the same TupleGetFunctionIndex attribute" - "has been registered for the class name: %s with typeid: %s", - behaviorClass->m_name.data(), behaviorClass->m_typeId.ToString().data()) - } - } - } - } - - return tupleGetMethodMap; - } - - AZ::Outcome GetTupleGetMethod(const AZ::TypeId& typeId, size_t index) - { - const AZ::BehaviorContext* behaviorContext{}; - AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext); - auto bcClassIterator = behaviorContext->m_typeToClassMap.find(typeId); - const AZ::BehaviorClass* behaviorClass = bcClassIterator != behaviorContext->m_typeToClassMap.end() ? bcClassIterator->second : nullptr; - - if (behaviorClass) - { - for (auto methodPair : behaviorClass->m_methods) - { - const AZ::BehaviorMethod* behaviorMethod = methodPair.second; - if (AZ::Attribute* attribute = FindAttribute(AZ::ScriptCanvasAttributes::TupleGetFunctionIndex, behaviorMethod->m_attributes)) - { - AZ::AttributeReader tupleGetFuncAttrReader(nullptr, attribute); - int tupleGetFuncIndex = -1; - if (tupleGetFuncAttrReader.Read(tupleGetFuncIndex) && index == tupleGetFuncIndex) - { - return AZ::Success(behaviorMethod); - } - } - } - } - - return AZ::Failure(); - } - -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h deleted file mode 100644 index 33175b4363..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h +++ /dev/null @@ -1,28 +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 - * - */ - -#pragma once - -#include -#include -#include -#include - -namespace ScriptCanvas::Grammar -{ - struct FunctionPrototype; -} - -namespace ScriptCanvas -{ - AZStd::unordered_map GetTupleGetMethodsFromResult(const AZ::BehaviorMethod& method); - - AZStd::unordered_map GetTupleGetMethods(const AZ::TypeId& typeId); - - AZ::Outcome GetTupleGetMethod(const AZ::TypeId& typeID, size_t index); -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp index 5fa71e96c6..6a253dbe0b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp @@ -9,7 +9,6 @@ #include #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp index 26a9b4fc96..e99bb721d9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp @@ -11,7 +11,6 @@ #include #include -#include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp index 8c53b0d1b4..1e16de7762 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp @@ -8,8 +8,9 @@ #include "SetVariable.h" +#include + #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.cpp index e44fd0b1f1..614c2eb116 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.cpp @@ -9,7 +9,6 @@ #include "OperatorAt.h" #include -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.cpp index 66d33d4c8f..82fe82a960 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.cpp @@ -9,7 +9,6 @@ #include "OperatorBack.h" #include -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.cpp index c75b046aa3..5140845ec6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.cpp @@ -9,7 +9,6 @@ #include "OperatorClear.h" #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.cpp index 679fbec076..1be67c7773 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.cpp @@ -7,7 +7,6 @@ */ #include "OperatorEmpty.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.cpp index ebb7a8233a..941dcea024 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.cpp @@ -9,7 +9,6 @@ #include "OperatorErase.h" #include -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.cpp index d83711adbe..6f010721d3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.cpp @@ -9,7 +9,6 @@ #include "OperatorFront.h" #include -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.cpp index 7374b3442f..889c2d4b98 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.cpp @@ -7,7 +7,6 @@ */ #include "OperatorInsert.h" -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.cpp index 5793d06aec..d5cbf7b36e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.cpp @@ -7,7 +7,6 @@ */ #include "OperatorPushBack.h" -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.cpp index 072d3b87ed..e7313c6f39 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.cpp @@ -7,7 +7,6 @@ */ #include "OperatorSize.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorAdd.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorAdd.cpp index 15727ac5ba..f50c3f3565 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorAdd.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorAdd.cpp @@ -7,7 +7,6 @@ */ #include "OperatorAdd.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp index eb3e352211..5fd6bb1edb 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp @@ -7,7 +7,6 @@ */ #include "OperatorArithmetic.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.cpp index 6890cb66ed..046b1d7ed6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.cpp @@ -7,7 +7,6 @@ */ #include "OperatorDiv.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.cpp index db7ff3722b..665b6e5e0f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.cpp @@ -7,7 +7,6 @@ */ #include "OperatorDivideByNumber.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.cpp index 83720f47c1..648cfa72a2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.cpp @@ -7,7 +7,6 @@ */ #include "OperatorLength.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp index 06ccb617ff..2488644871 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp @@ -7,7 +7,6 @@ */ #include "OperatorMul.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.cpp index 21b38fc553..cec4c64216 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.cpp @@ -7,7 +7,6 @@ */ #include "OperatorSub.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp index 3d31096f12..cd82263b28 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp @@ -14,8 +14,6 @@ #include #include -#include - #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 1301883453..6df2f80339 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -105,7 +105,6 @@ set(FILES Include/ScriptCanvas/Libraries/Core/GetVariable.cpp Include/ScriptCanvas/Libraries/Core/Method.cpp Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp - Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp Include/ScriptCanvas/Libraries/Core/Nodeling.cpp Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp Include/ScriptCanvas/Libraries/Core/Repeater.cpp diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 68fb0e2e67..a22fb370c0 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -155,7 +155,6 @@ set(FILES Include/ScriptCanvas/Libraries/Core/GetVariable.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/Core/Method.h Include/ScriptCanvas/Libraries/Core/MethodOverloaded.h - Include/ScriptCanvas/Libraries/Core/MethodUtility.h Include/ScriptCanvas/Libraries/Core/Nodeling.h Include/ScriptCanvas/Libraries/Core/Nodeling.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h From 0344e8bf1d197e528b92afe4ffdc27cbe4128940 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:50:26 -0800 Subject: [PATCH 311/620] Removes FindTaggedEntities.cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Libraries/Entity/FindTaggedEntities.cpp | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/FindTaggedEntities.cpp diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/FindTaggedEntities.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/FindTaggedEntities.cpp deleted file mode 100644 index ab5d0f775d..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/FindTaggedEntities.cpp +++ /dev/null @@ -1,27 +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 - * - */ - -#include - -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Entity - { - void FindTaggedEntities::OnInputSignal(const SlotId&) - { - AZ::Crc32 tagEntity = WhenEntityActiveProperty::GetCrc32(this); - } - } - } -} - -#include From f4a3867b7dc863359f26e2e1f93970a18f7110bc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:51:57 -0800 Subject: [PATCH 312/620] Removes BinaryOperation.h/cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Libraries/Math/BinaryOperation.cpp | 137 ------------------ .../Libraries/Math/BinaryOperation.h | 46 ------ 2 files changed, 183 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.cpp deleted file mode 100644 index 68621799f1..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.cpp +++ /dev/null @@ -1,137 +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 - * - */ - - -#include "BinaryOperation.h" - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - void Sum::Reflect(AZ::ReflectContext* reflection) - { - AZ::SerializeContext* serializeContext = azrtti_cast(reflection); - if (serializeContext) - { - serializeContext->Class() - ->Version(2) - ->Field("A", &Sum::m_a) - ->Field("B", &Sum::m_b) - ; - - AZ::EditContext* editContext = serializeContext->GetEditContext(); - if (editContext) - { - editContext->Class("Sum", "Performs the sum between two numbers.") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Editor/Icons/ScriptCanvas/Sum.png") - ; - } - - } - - AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection); - if (behaviorContext) - { - behaviorContext->Class("Sum") - ->Method("In", &Sum::OnInputSignal) - ->Attribute(ScriptCanvas::Attributes::Input, true) - ->Method("Out", &Sum::SignalOutput) - ->Attribute(ScriptCanvas::Attributes::Output, true) - ->Property("A", BehaviorValueProperty(&Sum::m_a)) - ->Property("B", BehaviorValueProperty(&Sum::m_b)) - ->Property("This", BehaviorValueProperty(&Sum::m_sum)) - ; - } - } - - Sum::Sum() - : Number() - {} - - Sum::~Sum() - {} - - void Sum::OnEntry() - { - m_status = ExecutionStatus::Immediate; - m_executionMode = ExecutionStatus::Immediate; - } - - void Sum::OnInputSignal(const SlotID& slot) - { - //static const SlotID& inSlot = SlotID("In"); - - //if (slot == inSlot) - //{ - // Types::Value* result = nullptr; - - // if (auto value = azdynamic_cast(Evaluate(SlotID("This")))) - // { - // m_value = value->Get(); - // } - //} - } - - void Sum::OnExecute(double deltaTime) - { - if (m_status != ExecutionStatus::NotStarted) - { - EvaluateSlot(SlotID("GetThis")); - SignalOutput(SlotID("Out")); - } - } - - AZ::BehaviorValueParameter Sum::EvaluateSlot(const ScriptCanvas::SlotID& slotId) - { - ScriptCanvas::Slot* slot = GetSlot(slotId); - if (slot) - { - if (slot->GetType() == ScriptCanvas::SlotType::Setter) - { - if (!slot->GetConnectionList().empty()) - { - auto connection = slot->GetConnectionList()[0]; - - // Evaluate the node connected to this slot, we'll set our value according to it. - AZ::BehaviorValueParameter parameter; - ScriptCanvas::NodeServiceRequestBus::EventResult(parameter, connection.GetNodeId(), &NodeServiceRequests::EvaluateSlot, connection.GetSlotId()); - return slot->GetProperty() ? ScriptCanvas::SafeSet(parameter, slot->GetProperty()->m_setter, this) : parameter; - } - } - else if (slot->GetType() == ScriptCanvas::SlotType::Getter) - { - static const ScriptCanvas::SlotID aSlot("SetA"); - static const ScriptCanvas::SlotID bSlot("SetB"); - - // Evaluating each slot will invoke its setter which, if there is a connection it will get evaluate and - // return the connected value, otherwise we'll use the default value of the property. - EvaluateSlot(aSlot); - EvaluateSlot(bSlot); - - // Both m_a and m_b have been resolved so we'll do the sum and return it. - m_sum = m_a.Get() + m_b.Get(); - - return AZ::BehaviorValueParameter(&m_sum); - } - } - - // There was no connection to invoke a setter - return AZ::BehaviorValueParameter(); - } - - Types::Value* Sum::Evaluate(const SlotID& slot) - { - AZ_Assert(false, "Deprecated"); - return nullptr; - } - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.h deleted file mode 100644 index 48e63f93d4..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.h +++ /dev/null @@ -1,46 +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 - * - */ - -#pragma once - -#include - -namespace ScriptCanvas -{ - class NodeVisitor; - - namespace Nodes - { - class BinaryOperation - : public Number - { - public: - - AZ_COMPONENT(BinaryOperation, "{04798FF9-50EE-487E-9433-B2C4F0FE4D37}", Node); - - static void Reflect(AZ::ReflectContext* reflection); - - BinaryOperation(); - ~BinaryOperation() override; - - void OnInputSignal(const SlotID& slot) override; - Types::Value* Evaluate(const SlotID& slot) override; - - AZ::BehaviorValueParameter EvaluateSlot(const ScriptCanvas::SlotID&) override; - - void Visit(NodeVisitor& visitor) const override { visitor.Visit(*this); } - - protected: - - Types::ValueFloat m_a; - Types::ValueFloat m_b; - Types::ValueFloat m_sum; - - }; - } -} From 0b8859b24607175bedb17ead726a976f96e6bdd2 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 14:02:22 -0800 Subject: [PATCH 313/620] Removes Format.cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Include/ScriptCanvas/Libraries/String/Format.cpp | 9 --------- .../ScriptCanvas/Code/scriptcanvasgem_common_files.cmake | 1 - 2 files changed, 10 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp deleted file mode 100644 index f541bbacbe..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp +++ /dev/null @@ -1,9 +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 - * - */ - -#include "Format.h" diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 6df2f80339..b3e1e05cc5 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -144,7 +144,6 @@ set(FILES Include/ScriptCanvas/Libraries/Spawning/Spawning.cpp Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.cpp Include/ScriptCanvas/Libraries/String/Contains.cpp - Include/ScriptCanvas/Libraries/String/Format.cpp Include/ScriptCanvas/Libraries/String/Replace.cpp Include/ScriptCanvas/Libraries/String/String.cpp Include/ScriptCanvas/Libraries/String/StringMethods.cpp From d9dbd439d417835edfc72177bae24f64fe3baa90 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 14:52:25 -0800 Subject: [PATCH 314/620] Removes CountdownNodeable.cpp/h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Libraries/Time/CountdownNodeable.cpp | 90 ------------------- .../Libraries/Time/CountdownNodeable.h | 75 ---------------- 2 files changed, 165 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.cpp deleted file mode 100644 index 24544abac7..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.cpp +++ /dev/null @@ -1,90 +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 - * - */ - -#include "CountdownNodeable.h" -#include -#include - -namespace ScriptCanvas -{ - namespace Nodeables - { - namespace Time - { - CountdownNodeable::~CountdownNodeable() - { - AZ::TickBus::Handler::BusDisconnect(); - } - - void CountdownNodeable::InitiateCountdown(bool reset, float countdownSeconds, bool looping, float holdTime) - { - if (reset || !AZ::TickBus::Handler::BusIsConnected()) - { - // If we're resetting, we need to disconnect. - AZ::TickBus::Handler::BusDisconnect(); - - m_countdownSeconds = countdownSeconds; - m_looping = looping; - m_holdTime = holdTime; - - m_currentTime = m_countdownSeconds; - - AZ::TickBus::Handler::BusConnect(); - } - } - - void CountdownNodeable::OnDeactivate() - { - AZ::TickBus::Handler::BusDisconnect(); - } - - void CountdownNodeable::OnTick(float deltaTime, AZ::ScriptTimePoint time) - { - if (m_currentTime <= 0.f) - { - if (m_holding) - { - m_holding = false; - m_currentTime = m_countdownSeconds; - m_elapsedTime = 0.f; - return; - } - - if (!m_looping) - { - AZ::TickBus::Handler::BusDisconnect(); - } - else - { - m_holding = m_holdTime > 0.f; - m_currentTime = m_holding ? m_holdTime : m_countdownSeconds; - } - - ExecutionOut(AZ_CRC("Done", 0x102de0ab), m_elapsedTime); - } - else - { - m_currentTime -= static_cast(deltaTime); - m_elapsedTime = m_holding ? 0.f : m_countdownSeconds - m_currentTime; - } - } - - void CountdownNodeable::Reset(float countdownSeconds, Data::BooleanType looping, float holdTime) - { - InitiateCountdown(true, countdownSeconds, looping, holdTime); - } - - void CountdownNodeable::Start(float countdownSeconds, Data::BooleanType looping, float holdTime) - { - InitiateCountdown(false, countdownSeconds, looping, holdTime); - } - } - } -} - -#include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.h deleted file mode 100644 index 98e9356b18..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.h +++ /dev/null @@ -1,75 +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 - * - */ - -#pragma once - -#include - -#include -#include -#include - -#include - -namespace ScriptCanvas -{ - namespace Nodeables - { - namespace Time - { - class CountdownNodeable - : public ScriptCanvas::Nodeable - , public AZ::TickBus::Handler - { - NodeDefinition(CountdownNodeable, "Delay", "Counts down time from a specified value.", - NodeTags::Category("Timing"), - NodeTags::Version(0) - ); - - public: - virtual ~CountdownNodeable(); - - InputMethod("Start", "When signaled, execution is delayed at this node according to the specified properties.", - SlotTags::Contracts({ DisallowReentrantExecutionContract })) - void Start(float countdownSeconds, Data::BooleanType looping, float holdTime); - - DataInput(float, "Start: Time", 0.0f, "", SlotTags::DisplayGroup("Start")); - DataInput(Data::BooleanType, "Start: Loop", false, "", SlotTags::DisplayGroup("Start")); - DataInput(float, "Start: Hold", 0.0f, "", SlotTags::DisplayGroup("Start")); - - InputMethod("Reset", "When signaled, execution is delayed at this node according to the specified properties.", - SlotTags::Contracts({ DisallowReentrantExecutionContract })) - void Reset(float countdownSeconds, Data::BooleanType looping, float holdTime); - - DataInput(float, "Reset: Time", 0.0f, "", SlotTags::DisplayGroup("Reset")); - DataInput(Data::BooleanType, "Reset: Loop", false, "", SlotTags::DisplayGroup("Reset")); - DataInput(float, "Reset: Hold", 0.0f, "", SlotTags::DisplayGroup("Reset")); - - ExecutionLatentOutput("Done", "Signaled when the delay reaches zero."); - DataOutput(float, "Elapsed", 0.0f, "The amount of time that has elapsed since the delay began.", - SlotTags::DisplayGroup("Done")); - - protected: - void OnDeactivate() override; - - // TickBus - void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - - private: - void InitiateCountdown(bool reset, float countdownSeconds, bool looping, float holdTime); - - float m_countdownSeconds = 0.0f; - bool m_looping = false; - float m_holdTime = 0.0f; - float m_elapsedTime = 0.0f; - bool m_holding = false; - float m_currentTime = 0.0f; - }; - } - } -} From e0a12e740c622ef97028709ed56f161c062399ae Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 14:55:39 -0800 Subject: [PATCH 315/620] Removes AddFailure.cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Libraries/UnitTesting/AddFailure.cpp | 12 ------------ .../Code/scriptcanvasgem_common_files.cmake | 1 - 2 files changed, 13 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp deleted file mode 100644 index d8a61ba076..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp +++ /dev/null @@ -1,12 +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 - * - */ - -#include "AddFailure.h" - -#include "UnitTestBus.h" - diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index b3e1e05cc5..9569422e0f 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -148,7 +148,6 @@ set(FILES Include/ScriptCanvas/Libraries/String/String.cpp Include/ScriptCanvas/Libraries/String/StringMethods.cpp Include/ScriptCanvas/Libraries/String/Utilities.cpp - Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp Include/ScriptCanvas/Libraries/UnitTesting/ExpectFalse.cpp Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp From a2479259c99490820dd88795aa9507c4f342777b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 14:56:21 -0800 Subject: [PATCH 316/620] Removes UnitTestBus.cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Libraries/UnitTesting/UnitTestBus.cpp | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBus.cpp diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBus.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBus.cpp deleted file mode 100644 index addbb96494..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBus.cpp +++ /dev/null @@ -1,23 +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 - * - */ - -#include "UnitTestBus.h" - -#include -#include -#include - -namespace ScriptCanvas -{ - namespace UnitTesting - { - - - } // namespace UnitTest - -} // namespace ScriptCanvas From 14952b6c34b2e638e23de5082e11f61a42ccabc0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:02:02 -0800 Subject: [PATCH 317/620] Removes UnitTestBusSenderMacros.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Libraries/UnitTesting/ExpectEqual.cpp | 1 - .../UnitTesting/ExpectGreaterThan.cpp | 1 - .../UnitTesting/ExpectGreaterThanEqual.cpp | 1 - .../Libraries/UnitTesting/ExpectLessThan.cpp | 1 - .../UnitTesting/ExpectLessThanEqual.cpp | 1 - .../Libraries/UnitTesting/ExpectNotEqual.cpp | 1 - .../Libraries/UnitTesting/UnitTestBusSender.h | 1 - .../UnitTesting/UnitTestBusSenderMacros.h | 75 ------------------- .../Code/scriptcanvasgem_headers.cmake | 1 - 9 files changed, 83 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSenderMacros.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp index fa6b5e35b0..96717274f5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp @@ -9,7 +9,6 @@ #include "ExpectEqual.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp index deb92f0bf9..dc1d9cd5c7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp @@ -9,7 +9,6 @@ #include "ExpectGreaterThan.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp index ad14591a07..a4a8677bcd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp @@ -9,7 +9,6 @@ #include "ExpectGreaterThanEqual.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.cpp index 1e7047d6e0..48a7621eb6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.cpp @@ -9,7 +9,6 @@ #include "ExpectLessThan.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.cpp index b69f3235e5..a04a9ae211 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.cpp @@ -9,7 +9,6 @@ #include "ExpectLessThanEqual.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.cpp index acf5e0e3cc..95ab9059c8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.cpp @@ -9,7 +9,6 @@ #include "ExpectNotEqual.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h index 00f3453394..59dd432961 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h @@ -11,7 +11,6 @@ #include "UnitTesting.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace AZ { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSenderMacros.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSenderMacros.h deleted file mode 100644 index 5ff6e2216e..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSenderMacros.h +++ /dev/null @@ -1,75 +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 - * - */ - -#pragma once - -#define SCRIPT_CANVAS_UNIT_TEST_EQUALITY_TYPES(OVERLOAD, NAME, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, AABB, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Boolean, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, CRC, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Color, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, EntityID, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Matrix3x3, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Matrix4x4, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Number, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, OBB, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Plane, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Quaternion, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, String, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Transform, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Vector2, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Vector3, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Vector4, PARAM0, PARAM1, PARAM2) - -#define SCRIPT_CANVAS_UNIT_TEST_COMPARE_TYPES(OVERLOAD, NAME, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Number, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, String, PARAM0, PARAM1, PARAM2) - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_DECLARATION(NAME, TYPE, PARAM0, PARAM1, PARAM2)\ - static void NAME(const AZ::EntityId& graphUniqueId, const Data::TYPE##Type candidate, const Data::TYPE##Type reference, const Report& report); - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_IMPLEMENTATION(NAME, TYPE, PARAM0, PARAM1, PARAM2)\ - void EventSender::NAME(const AZ::EntityId& graphUniqueId, const Data::TYPE##Type candidate, const Data::TYPE##Type reference, const Report& report)\ - {\ - void(BusTraits::* f)(const Data::##TYPE##Type, const Data::##TYPE##Type, const Report&) = &BusTraits::##NAME;\ - Bus::Event(graphUniqueId, f, candidate, reference, report);\ - } - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_REFLECTION(NAME, TYPE, LOOK_UP, OPERATOR, PARAM2)\ - builder->Method(LOOK_UP, static_cast(&EventSender::##NAME), { { {"", "", behaviorContext->MakeDefaultValue(UniqueId)}, {"Candidate", "left of " OPERATOR}, {"Reference", "right of " OPERATOR}, {"Report", "additional notes for the test report"} } }) ;\ - builder->Attribute(AZ::ScriptCanvasAttributes::HiddenParameterIndex, uniqueIdIndex); - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_EQUALITY_OVERLOAD_DECLARATIONS(NAME)\ - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_TYPES(SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_DECLARATION, NAME, unused, unused, unused) - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_EQUALITY_OVERLOAD_IMPLEMENTATIONS(NAME)\ - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_TYPES(SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_IMPLEMENTATION, NAME, unused, unused, unused) - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_EQUALITY_OVERLOAD_REFLECTIONS(NAME, LOOK_UP, OPERATOR)\ - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_TYPES(SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_REFLECTION, NAME, LOOK_UP, OPERATOR, unused) - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_COMPARE_OVERLOAD_DECLARATIONS(NAME)\ - SCRIPT_CANVAS_UNIT_TEST_COMPARE_TYPES(SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_DECLARATION, NAME, unused, unused, unused) - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_COMPARE_OVERLOAD_IMPLEMENTATIONS(NAME)\ - SCRIPT_CANVAS_UNIT_TEST_COMPARE_TYPES(SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_IMPLEMENTATION, NAME, unused, unused, unused) - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_COMPARE_OVERLOAD_REFLECTIONS(NAME, LOOK_UP, OPERATOR)\ - SCRIPT_CANVAS_UNIT_TEST_COMPARE_TYPES(SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_REFLECTION, NAME, LOOK_UP, OPERATOR, unused) - -#define SCRIPT_CANVAS_UNIT_TEST_LEGACY_NODE_IMPLEMENTATION(NAME, TYPE, PARAM0, PARAM1, PARAM2)\ - case Data::eType::##TYPE##:\ - {\ - void(ScriptCanvas::UnitTesting::BusTraits::* f)(const Data::##TYPE##Type, const Data::##TYPE##Type, const ScriptCanvas::UnitTesting::Report&) = &ScriptCanvas::UnitTesting::BusTraits::##NAME##;\ - ScriptCanvas::UnitTesting::Bus::Event(GetOwningScriptCanvasId(), f, *lhs->GetAs(), *rhs->GetAs(), *report);\ - }\ - break; - -#define SCRIPT_CANVAS_UNIT_TEST_LEGACY_NODE_EQUALITY_IMPLEMENTATIONS(NAME) case Data::eType::Number: break; default: break; - -#define SCRIPT_CANVAS_UNIT_TEST_LEGACY_NODE_COMPARE_IMPLEMENTATIONS(NAME) case Data::eType::Number: break; default: break; diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index a22fb370c0..9ccd352929 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -300,7 +300,6 @@ set(FILES Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.h Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/AuxiliaryGenerics.h Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h - Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSenderMacros.h Include/ScriptCanvas/Libraries/Operators/Operators.h Include/ScriptCanvas/Libraries/Operators/Operator.h Include/ScriptCanvas/Libraries/Operators/Operator.ScriptCanvasGrammar.xml From faa44260c6c8a2f4d9e559363168e7d89c099e15 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:09:10 -0800 Subject: [PATCH 318/620] Removes AuxiliaryGenerics.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UnitTesting/Auxiliary/AuxiliaryGenerics.h | 40 ------------------- .../Code/scriptcanvasgem_headers.cmake | 1 - 2 files changed, 41 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/AuxiliaryGenerics.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/AuxiliaryGenerics.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/AuxiliaryGenerics.h deleted file mode 100644 index cdbed97807..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/AuxiliaryGenerics.h +++ /dev/null @@ -1,40 +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 - * - */ - -#pragma once - -#include - -namespace ScriptCanvas -{ - namespace UnitTesting - { - namespace Auxiliary - { - AZ_INLINE AZStd::vector FillWithOrdinals(Data::NumberType count) - { - AZStd::vector ordinals; - ordinals.reserve(aznumeric_caster(count)); - - for (float ordinal = 1.f; ordinal <= count; ++ordinal) - { - ordinals.push_back(ordinal); - } - - return ordinals; - } - SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FillWithOrdinals, "UnitTesting/Auxiliary", "{D135E6C2-DDAE-494F-B13B-F214D3E0BC20}", "", "Count"); - - using Registrar = RegistrarGeneric - < FillWithOrdinalsNode - > ; - - - } - } -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 9ccd352929..1c32c743d6 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -298,7 +298,6 @@ set(FILES Include/ScriptCanvas/Libraries/UnitTesting/UnitTesting.h Include/ScriptCanvas/Libraries/UnitTesting/UnitTestingLibrary.h Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.h - Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/AuxiliaryGenerics.h Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h Include/ScriptCanvas/Libraries/Operators/Operators.h Include/ScriptCanvas/Libraries/Operators/Operator.h From b571e0c03168e193d66bd165164626d67f4659af Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:11:22 -0800 Subject: [PATCH 319/620] Removes AbstractModelTranslator.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Translation/AbstractModelTranslator.h | 34 ------------------- .../Code/scriptcanvasgem_headers.cmake | 1 - 2 files changed, 35 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/AbstractModelTranslator.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/AbstractModelTranslator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/AbstractModelTranslator.h deleted file mode 100644 index dc7c3852d3..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/AbstractModelTranslator.h +++ /dev/null @@ -1,34 +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 - * - */ - -#pragma once - -#include - -namespace ScriptCanvas -{ - class Graph; - - namespace Grammar - { - class AbstractCodeModel; - } - - namespace Translation - { - // move the shared functionality here\ - - // avoid virtual calls with a virtual function call - // that defines characters for single line comment - // block comment open/close, etc - // function delcarations, etc - // scope resolution - - } - -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 1c32c743d6..72c49cb272 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -54,7 +54,6 @@ set(FILES Include/ScriptCanvas/Core/SlotNames.h Include/ScriptCanvas/Core/SubgraphInterface.h Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h - Include/ScriptCanvas/Translation/AbstractModelTranslator.h Include/ScriptCanvas/Translation/Configuration.h Include/ScriptCanvas/Translation/GraphToCPlusPlus.h Include/ScriptCanvas/Translation/GraphToLua.h From d4f45e9ac59c3c0a3d3249b3037fba49c4d4b6b6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:19:58 -0800 Subject: [PATCH 320/620] Removes GraphToCPlusPlus from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Translation/GraphToCPlusPlus.cpp | 201 ------------------ .../Translation/GraphToCPlusPlus.h | 60 ------ .../ScriptCanvas/Translation/Translation.cpp | 36 ---- .../Code/scriptcanvasgem_common_files.cmake | 1 - .../Code/scriptcanvasgem_headers.cmake | 1 - 5 files changed, 299 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.cpp deleted file mode 100644 index c6c927ebe8..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.cpp +++ /dev/null @@ -1,201 +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 - * - */ - -#include "GraphToCPlusPlus.h" - -#include -#include - -namespace ScriptCanvas -{ - namespace Translation - { - Configuration CreateCPlusPluseConfig() - { - Configuration configuration; - configuration.m_blockCommentClose = "*/"; - configuration.m_blockCommentOpen = "/*"; - configuration.m_namespaceClose = "}"; - configuration.m_namespaceOpen = "{"; - configuration.m_namespaceOpenPrefix = "namespace"; - configuration.m_scopeClose = "}"; - configuration.m_scopeOpen = "{"; - configuration.m_singleLineComment = "//"; - return configuration; - } - - GraphToCPlusPlus::GraphToCPlusPlus(const Grammar::AbstractCodeModel& model) - : GraphToX(CreateCPlusPluseConfig(), model) - { - WriteHeaderDotH(); - WriteHeaderDotCPP(); - - TranslateDependenciesDotH(); - TranslateDependenciesDotCPP(); - - TranslateNamespaceOpen(); - { - TranslateClassOpen(); - { - TranslateVariables(); - TranslateHandlers(); - TranslateConstruction(); - TranslateDestruction(); - TranslateStartNode(); - } - TranslateClassClose(); - } - TranslateNamespaceClose(); - } - - AZ::Outcome> GraphToCPlusPlus::Translate(const Grammar::AbstractCodeModel& model, AZStd::string& dotH, AZStd::string& dotCPP) - { - GraphToCPlusPlus translation(model); - - if (translation.IsSuccessfull()) - { - dotH = AZStd::move(translation.m_dotH.MoveOutput()); - dotCPP = AZStd::move(translation.m_dotCPP.MoveOutput()); - return AZ::Success(); - } - else - { - return AZ::Failure(AZStd::make_pair(AZStd::string(".h errors"), AZStd::string(".cpp errors"))); - } - } - - void GraphToCPlusPlus::TranslateClassClose() - { - m_dotH.Outdent(); - m_dotH.WriteIndent(); - m_dotH.Write("};"); - m_dotH.WriteSpace(); - SingleLineComment(m_dotH); - m_dotH.WriteSpace(); - m_dotH.WriteLine("class %s", GetGraphName().data()); - } - - void GraphToCPlusPlus::TranslateClassOpen() - { - m_dotH.WriteIndent(); - m_dotH.WriteLine("class %s", GetGraphName().data()); - m_dotH.WriteIndent(); - m_dotH.WriteLine("{"); - m_dotH.Indent(); - } - - void GraphToCPlusPlus::TranslateConstruction() - { - - } - - void GraphToCPlusPlus::TranslateDependencies() - { - TranslateDependenciesDotH(); - TranslateDependenciesDotCPP(); - } - - void GraphToCPlusPlus::TranslateDependenciesDotH() - { - - } - - void GraphToCPlusPlus::TranslateDependenciesDotCPP() - { - - } - - void GraphToCPlusPlus::TranslateDestruction() - { - - } - - void GraphToCPlusPlus::TranslateHandlers() - { - - } - - void GraphToCPlusPlus::TranslateNamespaceOpen() - { - OpenNamespace(m_dotH, "ScriptCanvas"); - OpenNamespace(m_dotH, GetAutoNativeNamespace()); - OpenNamespace(m_dotCPP, "ScriptCanvas"); - OpenNamespace(m_dotCPP, GetAutoNativeNamespace()); - } - - void GraphToCPlusPlus::TranslateNamespaceClose() - { - CloseNamespace(m_dotH, "ScriptCanvas"); - CloseNamespace(m_dotH, GetAutoNativeNamespace()); - CloseNamespace(m_dotCPP, "ScriptCanvas"); - CloseNamespace(m_dotCPP, GetAutoNativeNamespace()); - } - - void GraphToCPlusPlus::TranslateStartNode() - { - // write a start function - const Node* startNode = nullptr; - - if (startNode) - { - { // .h - m_dotH.WriteIndent(); - m_dotH.WriteLine("public: static void %s(const RuntimeContext& context);", Grammar::k_OnGraphStartFunctionName); - } - - { // .cpp - m_dotCPP.WriteIndent(); - m_dotCPP.WriteLine("void %s::%s(const RuntimeContext& context)", GetGraphName().data(), Grammar::k_OnGraphStartFunctionName); - OpenScope(m_dotCPP); - { - m_dotCPP.WriteIndent(); - m_dotCPP.WriteLine("AZ_TracePrintf(\"ScriptCanvas\", \"This call wasn't generated from parsing a print node!\");"); - m_dotCPP.WriteLine("LogNotificationBus::Event(context.GetGraphId(), &LogNotifications::LogMessage, \"This call wasn't generated from parsing a print node!\");"); - // get the related function call and call it - // with possible appropriate variables - } - CloseScope(m_dotCPP); - } - } - } - - void GraphToCPlusPlus::TranslateVariables() - { - - } - - void GraphToCPlusPlus::WriteHeader() - { - WriteHeaderDotH(); - WriteHeaderDotCPP(); - } - - void GraphToCPlusPlus::WriteHeaderDotCPP() - { - WriteCopyright(m_dotCPP); - m_dotCPP.WriteNewLine(); - WriteDoNotModify(m_dotCPP); - m_dotCPP.WriteNewLine(); - m_dotCPP.WriteLine("#include \"%s.h\"", GetGraphName().data()); - m_dotCPP.WriteNewLine(); - } - - void GraphToCPlusPlus::WriteHeaderDotH() - { - WriteCopyright(m_dotH); - m_dotH.WriteNewLine(); - m_dotH.WriteLine("#pragma once"); - m_dotH.WriteNewLine(); - WriteDoNotModify(m_dotH); - m_dotH.WriteNewLine(); - m_dotH.WriteLine("#include "); - m_dotH.WriteNewLine(); - } - - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.h deleted file mode 100644 index f1007f6956..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.h +++ /dev/null @@ -1,60 +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 - * - */ - -#pragma once - -#include - -#include "TranslationUtilities.h" -#include "GraphToX.h" - -namespace ScriptCanvas -{ - class Graph; - - namespace Grammar - { - class AbstractCodeModel; - } - - namespace Translation - { - class GraphToCPlusPlus - : public GraphToX - { - public: - static AZ::Outcome> Translate(const Grammar::AbstractCodeModel& model, AZStd::string& dotH, AZStd::string& dotCPP); - - AZ_INLINE bool IsSuccessfull() const { return false; } - private: - // cpp only - Writer m_dotH; - Writer m_dotCPP; - - GraphToCPlusPlus(const Grammar::AbstractCodeModel& model); - - void TranslateClassClose(); - void TranslateClassOpen(); - void TranslateConstruction(); - void TranslateDependencies(); - void TranslateDependenciesDotH(); - void TranslateDependenciesDotCPP(); - void TranslateDestruction(); - void TranslateFunctions(); - void TranslateHandlers(); - void TranslateNamespaceOpen(); - void TranslateNamespaceClose(); - void TranslateStartNode(); - void TranslateVariables(); - void WriteHeader(); // Write, not translate, because this should be less dependent on the contents of the graph - void WriteHeaderDotH(); // Write, not translate, because this should be less dependent on the contents of the graph - void WriteHeaderDotCPP(); // Write, not translate, because this should be less dependent on the contents of the graph - }; - } - -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp index 3299bb97b4..db7ea22112 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -27,41 +26,6 @@ namespace TranslationCPP using namespace ScriptCanvas; using namespace ScriptCanvas::Translation; - /* - AZ::Outcome, AZStd::pair> ToCPlusPlus(const Grammar::AbstractCodeModel& model, bool rawSave = false) - { - AZStd::string dotH, dotCPP; - auto outcome = GraphToCPlusPlus::Translate(model, dotH, dotCPP); - if (outcome.IsSuccess()) - { -#if defined(SCRIPT_CANVAS_PRINT_FILES_CONSOLE) - AZ_TracePrintf("ScriptCanvas", "\n\n *** .h file ***\n\n"); - AZ_TracePrintf("ScriptCanvas", dotH.data()); - AZ_TracePrintf("ScriptCanvas", "\n\n *** .cpp file *\n\n"); - AZ_TracePrintf("ScriptCanvas", dotCPP.data()); - AZ_TracePrintf("ScriptCanvas", "\n\n"); -#endif - if (rawSave) - { - auto saveOutcome = SaveDotH(model.GetSource(), dotH); - if (saveOutcome.IsSuccess()) - { - saveOutcome = SaveDotCPP(model.GetSource(), dotCPP); - } - if (!saveOutcome.IsSuccess()) - { - AZ_TracePrintf("Save failed %s", saveOutcome.GetError().data()); - } - } - return AZ::Success(AZStd::make_pair(AZStd::move(dotH), AZStd::move(dotCPP))); - } - else - { - return AZ::Failure(outcome.TakeError()); - } - } - */ - AZ::Outcome ToLua(const Grammar::AbstractCodeModel& model, bool rawSave = false) { auto outcome = GraphToLua::Translate(model); diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 9569422e0f..b765a92f45 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -39,7 +39,6 @@ set(FILES Include/ScriptCanvas/Core/SlotMetadata.cpp Include/ScriptCanvas/Core/SubgraphInterface.cpp Include/ScriptCanvas/Core/SubgraphInterfaceUtility.cpp - Include/ScriptCanvas/Translation/GraphToCPlusPlus.cpp Include/ScriptCanvas/Translation/GraphToLua.cpp Include/ScriptCanvas/Translation/GraphToLuaUtility.cpp Include/ScriptCanvas/Translation/GraphToX.cpp diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 72c49cb272..0eec37350e 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -55,7 +55,6 @@ set(FILES Include/ScriptCanvas/Core/SubgraphInterface.h Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h Include/ScriptCanvas/Translation/Configuration.h - Include/ScriptCanvas/Translation/GraphToCPlusPlus.h Include/ScriptCanvas/Translation/GraphToLua.h Include/ScriptCanvas/Translation/GraphToLuaUtility.h Include/ScriptCanvas/Translation/GraphToX.h From 4d01cdc59170b5946cd986c34055936b00485161 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:27:18 -0800 Subject: [PATCH 321/620] Removes FullyConnectedNodePaletteCreation.h from Gems/ScriptCanvasDeveloper Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../FullyConnectedNodePaletteCreation.h | 19 ------------------- .../ScriptCanvasDeveloperEditorComponent.cpp | 1 - 2 files changed, 20 deletions(-) delete mode 100644 Gems/ScriptCanvasDeveloper/Code/Editor/Include/ScriptCanvasDeveloperEditor/AutomationActions/FullyConnectedNodePaletteCreation.h diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Include/ScriptCanvasDeveloperEditor/AutomationActions/FullyConnectedNodePaletteCreation.h b/Gems/ScriptCanvasDeveloper/Code/Editor/Include/ScriptCanvasDeveloperEditor/AutomationActions/FullyConnectedNodePaletteCreation.h deleted file mode 100644 index 42c90bff73..0000000000 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Include/ScriptCanvasDeveloperEditor/AutomationActions/FullyConnectedNodePaletteCreation.h +++ /dev/null @@ -1,19 +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 - * - */ -#pragma once - -class QAction; -class QMenu; - -namespace ScriptCanvasDeveloperEditor -{ - namespace NodePaletteFullCreation - { - QAction* FullyConnectedNodePaletteCreation(QMenu* mainWindow); - }; -} diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/ScriptCanvasDeveloperEditorComponent.cpp b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/ScriptCanvasDeveloperEditorComponent.cpp index 9193556624..e4fabcc136 100644 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/ScriptCanvasDeveloperEditorComponent.cpp +++ b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/ScriptCanvasDeveloperEditorComponent.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include From 991ef84f08212bf84961001336b4cbfb7d60bac3 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:32:18 -0800 Subject: [PATCH 322/620] Removes XMLDoc from Gems/ScriptCanvasDeveloper Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/Source/XMLDoc.cpp | 411 ------------------ .../Code/Editor/Source/XMLDoc.h | 50 --- ...riptcanvasdeveloper_gem_editor_files.cmake | 2 - 3 files changed, 463 deletions(-) delete mode 100644 Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.cpp delete mode 100644 Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.h diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.cpp b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.cpp deleted file mode 100644 index a246bb946e..0000000000 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.cpp +++ /dev/null @@ -1,411 +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 - * - */ - - -#include "XMLDoc.h" -#include -#include -#include -#include -#include -#include - -namespace ScriptCanvasDeveloperEditor -{ - namespace Internal - { - xml_node<> *FindDocumentTypeNode(const xml_document<> & doc, const AZStd::string & nodeName) - { - // this will only work if the xml document was parsed with the flag "parse_doctype_node" - - for(xml_node<> *docTypeNode=doc.first_node(); docTypeNode!=nullptr; docTypeNode=docTypeNode->next_sibling()) - { - if (docTypeNode->type() == node_type::node_doctype) - { - if ( nodeName == docTypeNode->value() ) - { - return docTypeNode; - } - } - } - - return nullptr; - } - - bool GetAttribute(xml_node<> *tsNode, AZStd::string_view attribName, float & value) - { - if( tsNode != nullptr) - { - for (xml_attribute<> *attrib = tsNode->first_attribute(); attrib != nullptr; attrib = attrib->next_attribute()) - { - if ( attribName == attrib->name() ) - { - value = AzFramework::StringFunc::ToFloat( attrib->value() ); - return true; - } - } - } - - return false; - } - - bool GetAttribute(xml_node<> *tsNode, AZStd::string_view attribName, AZStd::string & value) - { - if( tsNode != nullptr) - { - for (xml_attribute<> *attrib = tsNode->first_attribute(); attrib != nullptr; attrib = attrib->next_attribute()) - { - if (attribName == attrib->name()) - { - value = attrib->value(); - return true; - } - } - } - - return false; - } - - xml_node<> *FindContextNode(const xml_document<> & doc, const AZStd::string & contextName) - { - xml_node<> *tsNode = doc.first_node("TS"); - - if (tsNode != nullptr) - { - for(xml_node<> *contextNode=tsNode->first_node("context"); contextNode!=nullptr; contextNode=contextNode->next_sibling("context") ) - { - xml_node<> *contextNameNode = contextNode->first_node("name"); - - if (contextNameNode != nullptr) - { - if( contextName == contextNameNode->value() ) - { - return contextNode; - } - } - } - } - - return nullptr; - } - } - - XMLDocPtr XMLDoc::Alloc(const AZStd::string& contextName) - { - XMLDocPtr xmlDoc( AZStd::make_shared() ); - - xmlDoc->CreateTSDoc(contextName); - - return xmlDoc; - } - - XMLDocPtr XMLDoc::LoadFromDisk(const AZStd::string& fileName) - { - XMLDocPtr xmlDoc(AZStd::make_shared()); - - if ( !xmlDoc->LoadTSDoc(fileName) ) - { - xmlDoc = nullptr; - } - - return xmlDoc; - } - - XMLDoc::XMLDoc() - : m_tsNode(nullptr) - , m_context(nullptr) - , m_readBuffer(0) - { - } - - void XMLDoc::CreateTSDoc(const AZStd::string& contextName) - { - xml_node<>* decl = m_doc.allocate_node(node_declaration); - decl->append_attribute(m_doc.allocate_attribute("version", "1.0")); - decl->append_attribute(m_doc.allocate_attribute("encoding", "utf-8")); - m_doc.append_node(decl); - - xml_node<>* commentNode = m_doc.allocate_node(node_comment, "", AllocString(AZStd::string::format("Generated for %s", contextName.c_str()))); - m_doc.append_node(commentNode); - - xml_node<>* docType = m_doc.allocate_node(node_doctype, "", "TS"); - m_doc.append_node(docType); - - m_tsNode = m_doc.allocate_node(node_element, "TS"); - m_doc.append_node(m_tsNode); - m_tsNode->append_attribute(m_doc.allocate_attribute("version", "2.1")); - m_tsNode->append_attribute(m_doc.allocate_attribute("language", "en_US")); - } - - bool XMLDoc::LoadTSDoc(const AZStd::string& fileName) - { - bool success = false; - - char tsFilePath[AZ::IO::MaxPathLength] = { "" }; - - if (AZ::IO::FileIOBase::GetInstance()->ResolvePath(fileName.c_str(), tsFilePath, AZ::IO::MaxPathLength)) - { - AZ::IO::FileIOStream xmlFile; - - if( AZ::IO::FileIOBase::GetInstance()->Exists(tsFilePath) ) - { - if ( xmlFile.Open(tsFilePath, AZ::IO::OpenMode::ModeRead|AZ::IO::OpenMode::ModeText) ) - { - AZ::IO::SizeType bytesToRead = xmlFile.GetLength(); - - if( bytesToRead > 0 ) - { - m_readBuffer.resize(bytesToRead, '\0'); - if( xmlFile.Read(bytesToRead, m_readBuffer.data() ) == bytesToRead ) - { - m_doc.parse( m_readBuffer.data() ); - - success = IsValidTSDoc(); - - if (success) - { - AZ_TracePrintf("ScriptCanvas", "Loaded \"%s\"", tsFilePath); - } - } - else - { - AZ_Error("ScriptCanvas", false, "XMLDoc::LoadTSDoc-Error reading Qt .ts file! filename=\"%s\".", tsFilePath); - } - } - else - { - AZ_Error("ScriptCanvas", false, "XMLDoc::LoadTSDoc-Zero byte Qt .ts file! filename=\"%s\".", tsFilePath); - } - } - else - { - AZ_Error("ScriptCanvas", false, "XMLDoc::LoadTSDoc-Can't open file Qt .ts file! filename=\"%s\".", tsFilePath); - } - } - } - else - { - AZ_Error("ScriptCanvas", false, "XMLDoc::LoadTSDoc-Invalid filename specified! filename=\"%s\".", tsFilePath); - } - - return success; - } - - bool XMLDoc::WriteToDisk(const AZStd::string & fileName) - { - bool success = false; - - char tsFilePath[AZ::IO::MaxPathLength] = { "" }; - if (AZ::IO::FileIOBase::GetInstance()->ResolvePath(fileName.c_str(), tsFilePath, AZ::IO::MaxPathLength)) - { - AZStd::string writeFolder(tsFilePath); - AzFramework::StringFunc::Path::StripFullName(writeFolder); - - if (!AZ::IO::FileIOBase::GetInstance()->IsDirectory(writeFolder.c_str())) - { - AZ::IO::FileIOBase::GetInstance()->CreatePath(writeFolder.c_str()); - } - - AZ::IO::FileIOStream xmlFile; - - if (xmlFile.Open(tsFilePath, AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText)) - { - AZStd::string xmlData(ToString()); - AZ::IO::SizeType bytesWritten = xmlFile.Write(xmlData.size(), xmlData.data()); - - if (bytesWritten != xmlData.size()) - { - AZ_Error("ScriptCanvas", false, "Write error writing out %s, bytes actually written: %llu expected bytes to write: %llu!", tsFilePath, bytesWritten, xmlData.size()); - } - else - { - AZ_TracePrintf("ScriptCanvas", "Successfully wrote out ScriptCanvas localization file \"%s\".", tsFilePath); - success = true; - } - - xmlFile.Close(); - } - else - { - AZ_Error("ScriptCanvas", false, "Could not open file \"%s\"!", tsFilePath); - } - } - else - { - AZ_Error("ScriptCanvas", false, "Invalid filename specified XMLDoc::WriteToDisk! filename=\"%s\".", tsFilePath); - } - - return success; - } - - - bool XMLDoc::StartContext(const AZStd::string& contextName) - { - bool isNew = false; - - if( !contextName.empty() ) - { - // check to see if we have a context of this name already, if so find that node and use it, otherwise - // create a new one. - - xml_node<> *existingContextNode = Internal::FindContextNode(m_doc, contextName); - - if (existingContextNode == nullptr) - { - m_context = m_doc.allocate_node(node_element, "context"); - m_tsNode->append_node(m_context); - - xml_node<>* contextNameNode = m_doc.allocate_node(node_element, "name", AllocString(contextName)); - m_context->append_node(contextNameNode); - - isNew = true; - } - else - { - m_context = existingContextNode; - } - } - else - { - m_context = nullptr; - } - - return isNew; - } - - void XMLDoc::AddToContext(const AZStd::string& id, const AZStd::string& translation/*=""*/, const AZStd::string& comment /*=""*/, const AZStd::string& source/*=""*/) - { - if (m_context == nullptr) - { - return; - } - - xml_node<>* messageNode = m_doc.allocate_node(node_element, "message"); - - messageNode->append_attribute(m_doc.allocate_attribute("id", AllocString(id))); - - xml_node<>* sourceNode = m_doc.allocate_node(node_element, "source", AllocString(source.empty() ? id.c_str() : source.c_str())); - messageNode->append_node(sourceNode); - - xml_node<>* translationNode = m_doc.allocate_node(node_element, "translation", AllocString(translation)); - messageNode->append_node(translationNode); - - xml_node<>* commentNode = m_doc.allocate_node(node_element, "comment", AllocString(comment)); - messageNode->append_node(commentNode); - - m_context->append_node(messageNode); - } - - bool XMLDoc::MethodFamilyExists(const AZStd::string& baseId) const - { - if (m_tsNode != nullptr) - { - AZStd::string nameID(baseId + "_NAME"); - - for (xml_node<> *contextNode=m_tsNode->first_node("context"); contextNode!=nullptr; contextNode=contextNode->next_sibling("context")) - { - for (xml_node<> *messageNode = contextNode->first_node("message"); messageNode != nullptr; messageNode = messageNode->next_sibling("message")) - { - AZStd::string id; - - if ( Internal::GetAttribute(messageNode, "id", id) ) - { - if (id == nameID) - { - return true; - } - } - } - } - } - - return false; - } - - AZStd::string XMLDoc::ToString() const - { - AZStd::string buffer; - - print( AZStd::back_inserter(buffer), m_doc, 0); - - return buffer; - } - - const char *XMLDoc::AllocString(const AZStd::string& str) - { - return m_doc.allocate_string( str.c_str(), str.size() + 1 ); - } - - bool XMLDoc::IsValidTSDoc() - { - bool isTSDoc = false; - // - // Basic format of a .ts file, we are checking to make sure the document type is ts, and the version is 2.1 or greater - // and there is a non-null language attribute. and at least 1 context section - // - // - // - // - // - // ... - // - // - // - - // this node should be the doc type - - xml_node<> *docTypeNode = Internal::FindDocumentTypeNode(m_doc, "TS"); - - if (docTypeNode !=nullptr) - { - xml_node<> *tsNode = m_doc.first_node("TS"); - - if( tsNode != nullptr) - { - float attribVersion = 0.0f; - if( Internal::GetAttribute(tsNode, "version", attribVersion) && (attribVersion >= 2.1f) ) - { - AZStd::string attribLanguage; - if( Internal::GetAttribute(tsNode, "language", attribLanguage) && !attribLanguage.empty() ) - { - xml_node<> *contextNode = tsNode->first_node("context"); - if(contextNode != nullptr) - { - m_tsNode = tsNode; - - AZ_TracePrintf("ScriptCanvas", "TS: Version=%2.1f, Language=\"%s\"", attribVersion, attribLanguage.c_str()); - isTSDoc = true; - } - else - { - AZ_Warning("ScriptCanvas", false, "TS document contains no \"context\" nodes!"); - } - } - else - { - AZ_Warning("ScriptCanvas", false, "TS document has a bad or missing \"language\" attribute!"); - } - } - else - { - AZ_Warning("ScriptCanvas", false, "TS document has a bad or missing \"version\" attribute!"); - } - } - else - { - AZ_Error("ScriptCanvas", false, "TS document contains no \"TS\" node!"); - } - } - else - { - AZ_Error("ScriptCanvas", false, "XML doc is not a valid TS document!"); - } - - return isTSDoc; - } -} diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.h b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.h deleted file mode 100644 index be98e1bab0..0000000000 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.h +++ /dev/null @@ -1,50 +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 - * - */ - -#pragma once - -#include -#include -#include -#include - -using namespace AZ::rapidxml; - -namespace ScriptCanvasDeveloperEditor -{ - class XMLDoc; - using XMLDocPtr = AZStd::shared_ptr; - - class XMLDoc - { - public: - static XMLDocPtr Alloc(const AZStd::string& contextName); - static XMLDocPtr LoadFromDisk(const AZStd::string& fileName); - - XMLDoc(); - virtual ~XMLDoc() {} - - bool WriteToDisk(const AZStd::string & filename); - bool StartContext(const AZStd::string& contextName); - void AddToContext(const AZStd::string& id, const AZStd::string& translation = "", const AZStd::string& comment = "", const AZStd::string& source = ""); - bool MethodFamilyExists(const AZStd::string& familyName) const; - AZStd::string ToString() const; - - private: - void CreateTSDoc(const AZStd::string& contextName); - bool LoadTSDoc(const AZStd::string& contextName); - bool IsValidTSDoc(); - const char *AllocString(const AZStd::string& str); - - private: - xml_document<> m_doc; - xml_node<> * m_tsNode; - xml_node<> * m_context; - AZStd::vector m_readBuffer; - }; -} diff --git a/Gems/ScriptCanvasDeveloper/Code/scriptcanvasdeveloper_gem_editor_files.cmake b/Gems/ScriptCanvasDeveloper/Code/scriptcanvasdeveloper_gem_editor_files.cmake index 1d34b5484a..c73b9919cd 100644 --- a/Gems/ScriptCanvasDeveloper/Code/scriptcanvasdeveloper_gem_editor_files.cmake +++ b/Gems/ScriptCanvasDeveloper/Code/scriptcanvasdeveloper_gem_editor_files.cmake @@ -53,8 +53,6 @@ set(FILES Editor/Source/NodeListDumpAction.cpp Editor/Source/TSGenerateAction.cpp Editor/Source/WrapperMock.cpp - Editor/Source/XMLDoc.cpp - Editor/Source/XMLDoc.h # AutomationActions Editor/Source/AutomationActions/DynamicSlotFullCreation.cpp From af2745afb8d96ac50667c8f92134530faf094e9a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:34:10 -0800 Subject: [PATCH 323/620] Removes FullyConnectedNodePaletteCreation.cpp from Gems/ScriptCanvasDeveloper Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../FullyConnectedNodePaletteCreation.cpp | 242 ------------------ 1 file changed, 242 deletions(-) delete mode 100644 Gems/ScriptCanvasDeveloper/Code/Editor/Source/AutomationActions/FullyConnectedNodePaletteCreation.cpp diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/AutomationActions/FullyConnectedNodePaletteCreation.cpp b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/AutomationActions/FullyConnectedNodePaletteCreation.cpp deleted file mode 100644 index 95075c8ea1..0000000000 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/AutomationActions/FullyConnectedNodePaletteCreation.cpp +++ /dev/null @@ -1,242 +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 - * - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -namespace ScriptCanvasDeveloperEditor -{ - namespace NodePaletteFullCreation - { - class CreateFullyConnectedNodePaletteInterface - : public ProcessNodePaletteInterface - { - public: - - CreateFullyConnectedNodePaletteInterface(DeveloperUtils::ConnectionStyle connectionStyle, bool skipHandlers = false) - { - m_chainConfig.m_connectionStyle = connectionStyle; - m_chainConfig.m_skipHandlers = skipHandlers; - } - - void SetupInterface(const AZ::EntityId& activeGraphCanvasGraphId, const ScriptCanvas::ScriptCanvasId& scriptCanvasId) - { - m_graphCanvasGraphId = activeGraphCanvasGraphId; - m_scriptCanvasId = scriptCanvasId; - - GraphCanvas::SceneRequestBus::EventResult(m_viewId, activeGraphCanvasGraphId, &GraphCanvas::SceneRequests::GetViewId); - GraphCanvas::SceneRequestBus::EventResult(m_gridId, activeGraphCanvasGraphId, &GraphCanvas::SceneRequests::GetGrid); - - GraphCanvas::GridRequestBus::EventResult(m_minorPitch, m_gridId, &GraphCanvas::GridRequests::GetMinorPitch); - - QGraphicsScene* graphicsScene = nullptr; - GraphCanvas::SceneRequestBus::EventResult(graphicsScene, activeGraphCanvasGraphId, &GraphCanvas::SceneRequests::AsQGraphicsScene); - - if (graphicsScene) - { - QRectF sceneArea = graphicsScene->sceneRect(); - sceneArea.adjust(m_minorPitch.GetX(), m_minorPitch.GetY(), -m_minorPitch.GetX(), -m_minorPitch.GetY()); - GraphCanvas::ViewRequestBus::Event(m_viewId, &GraphCanvas::ViewRequests::CenterOnArea, sceneArea); - QApplication::processEvents(); - } - - GraphCanvas::ViewRequestBus::EventResult(m_nodeCreationPos, m_viewId, &GraphCanvas::ViewRequests::GetViewSceneCenter); - - GraphCanvas::GraphCanvasGraphicsView* graphicsView = nullptr; - GraphCanvas::ViewRequestBus::EventResult(graphicsView, m_viewId, &GraphCanvas::ViewRequests::AsGraphicsView); - - m_viewportRectangle = graphicsView->mapToScene(graphicsView->viewport()->geometry()).boundingRect(); - - // Temporary work around until the extra automation tools can be merged over that have better ways of doing this. - const GraphCanvas::GraphCanvasTreeItem* treeItem = nullptr; - ScriptCanvasEditor::AutomationRequestBus::BroadcastResult(treeItem, &ScriptCanvasEditor::AutomationRequests::GetNodePaletteRoot); - - const GraphCanvas::NodePaletteTreeItem* onGraphStartItem = nullptr; - - if (treeItem) - { - AZStd::unordered_set< const GraphCanvas::GraphCanvasTreeItem* > unexploredSet = { treeItem }; - - while (!unexploredSet.empty()) - { - const GraphCanvas::GraphCanvasTreeItem* treeItem = (*unexploredSet.begin()); - unexploredSet.erase(unexploredSet.begin()); - - const GraphCanvas::NodePaletteTreeItem* nodePaletteTreeItem = azrtti_cast(treeItem); - - if (nodePaletteTreeItem && nodePaletteTreeItem->GetName().compare("On Graph Start") == 0) - { - onGraphStartItem = nodePaletteTreeItem; - break; - } - - for (int i = 0; i < treeItem->GetChildCount(); ++i) - { - const GraphCanvas::GraphCanvasTreeItem* childItem = treeItem->FindChildByRow(i); - - if (childItem) - { - unexploredSet.insert(childItem); - } - } - } - } - - if (onGraphStartItem) - { - ProcessItem(onGraphStartItem); - } - } - - int m_counter = 60; - - bool ShouldProcessItem(const GraphCanvas::NodePaletteTreeItem* nodePaletteTreeItem) const - { - return m_counter > 0; - } - - void ProcessItem(const GraphCanvas::NodePaletteTreeItem* nodePaletteTreeItem) - { - GraphCanvas::GraphCanvasMimeEvent* mimeEvent = nodePaletteTreeItem->CreateMimeEvent(); - - if (ScriptCanvasEditor::MultiCreateNodeMimeEvent* multiCreateMimeEvent = azrtti_cast(mimeEvent)) - { - --m_counter; - AZStd::vector< GraphCanvas::GraphCanvasMimeEvent* > mimeEvents = multiCreateMimeEvent->CreateMimeEvents(); - - for (GraphCanvas::GraphCanvasMimeEvent* currentEvent : mimeEvents) - { - ScriptCanvasEditor::NodeIdPair createdPair = DeveloperUtils::HandleMimeEvent(currentEvent, m_graphCanvasGraphId, m_viewportRectangle, m_widthOffset, m_heightOffset, m_maxRowHeight, m_minorPitch); - delete currentEvent; - - if (DeveloperUtils::CreateConnectedChain(createdPair, m_chainConfig)) - { - m_createdNodes.emplace_back(createdPair); - } - else - { - m_nodesToDelete.insert(GraphCanvas::GraphUtils::FindOutermostNode(createdPair.m_graphCanvasId)); - } - } - } - else if (mimeEvent) - { - --m_counter; - ScriptCanvasEditor::NodeIdPair createdPair = DeveloperUtils::HandleMimeEvent(mimeEvent, m_graphCanvasGraphId, m_viewportRectangle, m_widthOffset, m_heightOffset, m_maxRowHeight, m_minorPitch); - - if (DeveloperUtils::CreateConnectedChain(createdPair, m_chainConfig)) - { - m_createdNodes.emplace_back(createdPair); - } - else - { - m_nodesToDelete.insert(GraphCanvas::GraphUtils::FindOutermostNode(createdPair.m_graphCanvasId)); - } - } - - delete mimeEvent; - } - - private: - - void OnProcessingComplete() override - { - GraphCanvas::SceneRequestBus::Event(m_graphCanvasGraphId, &GraphCanvas::SceneRequests::Delete, m_nodesToDelete); - } - - DeveloperUtils::CreateConnectedChainConfig m_chainConfig; - - AZStd::vector m_createdNodes; - AZStd::unordered_set m_nodesToDelete; - - AZ::EntityId m_graphCanvasGraphId; - ScriptCanvas::ScriptCanvasId m_scriptCanvasId; - - AZ::Vector2 m_nodeCreationPos = AZ::Vector2::CreateZero(); - - AZ::EntityId m_viewId; - AZ::EntityId m_gridId; - - AZ::Vector2 m_minorPitch = AZ::Vector2::CreateZero(); - - QRectF m_viewportRectangle; - - int m_widthOffset = 0; - int m_heightOffset = 0; - - int m_maxRowHeight = 0; - }; - - void CreateSingleExecutionConnectedNodePaletteAction() - { - ScriptCanvasEditor::AutomationRequestBus::Broadcast(&ScriptCanvasEditor::AutomationRequests::SignalAutomationBegin); - - CreateFullyConnectedNodePaletteInterface nodePaletteInterface(DeveloperUtils::ConnectionStyle::SingleExecutionConnection); - DeveloperUtils::ProcessNodePalette(nodePaletteInterface); - - ScriptCanvasEditor::AutomationRequestBus::Broadcast(&ScriptCanvasEditor::AutomationRequests::SignalAutomationEnd); - } - - void CreateSingleExecutionConnectedNodePaletteExcludeHandlersAction() - { - ScriptCanvasEditor::AutomationRequestBus::Broadcast(&ScriptCanvasEditor::AutomationRequests::SignalAutomationBegin); - - CreateFullyConnectedNodePaletteInterface nodePaletteInterface(DeveloperUtils::ConnectionStyle::SingleExecutionConnection, true); - DeveloperUtils::ProcessNodePalette(nodePaletteInterface); - - ScriptCanvasEditor::AutomationRequestBus::Broadcast(&ScriptCanvasEditor::AutomationRequests::SignalAutomationEnd); - } - - QAction* FullyConnectedNodePaletteCreation(QMenu* mainMenu) - { - QAction* createNodePaletteAction = nullptr; - - if (mainMenu) - { - { - createNodePaletteAction = mainMenu->addAction(QAction::tr("Create Execution Connected Node Palette")); - createNodePaletteAction->setAutoRepeat(false); - createNodePaletteAction->setToolTip("Tries to create every node in the node palette and will attempt to create an execution path through them."); - - QObject::connect(createNodePaletteAction, &QAction::triggered, &CreateSingleExecutionConnectedNodePaletteAction); - } - - { - createNodePaletteAction = mainMenu->addAction(QAction::tr("Create Execution Connected Node Palette sans Handlers")); - createNodePaletteAction->setAutoRepeat(false); - createNodePaletteAction->setToolTip("Tries to create every node in the node palette(except EBus Handlers) and attempt to create an execution path through them.."); - - QObject::connect(createNodePaletteAction, &QAction::triggered, &CreateSingleExecutionConnectedNodePaletteExcludeHandlersAction); - } - - - } - - return createNodePaletteAction; - } - } -} From 5b2ea01a8382f094aea681b2ebde34a04e68a58b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:35:02 -0800 Subject: [PATCH 324/620] Removes ScriptCanvas_Regressions.cpp from Gems/ScriptCanvasTesting Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Tests/ScriptCanvas_Regressions.cpp | 13 ------------- .../scriptcanvastestingeditor_tests_files.cmake | 1 - 2 files changed, 14 deletions(-) delete mode 100644 Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Regressions.cpp diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Regressions.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Regressions.cpp deleted file mode 100644 index 72ec6067b1..0000000000 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Regressions.cpp +++ /dev/null @@ -1,13 +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 - * - */ - - -#include - -using namespace ScriptCanvasTests; - diff --git a/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake b/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake index 87d65aa7b4..e2e86ca551 100644 --- a/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake +++ b/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake @@ -23,7 +23,6 @@ set(FILES Tests/ScriptCanvas_Math.cpp Tests/ScriptCanvas_MethodOverload.cpp Tests/ScriptCanvas_NodeGenerics.cpp - Tests/ScriptCanvas_Regressions.cpp Tests/ScriptCanvas_RuntimeInterpreted.cpp Tests/ScriptCanvas_Slots.cpp Tests/ScriptCanvas_StringNodes.cpp From 91e404567df1407d4e603270596f1f3205c59fe7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:36:35 -0800 Subject: [PATCH 325/620] Removes UnitTestingReporter from Gems/ScriptCanvasTesting Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Source/Framework/UnitTestingReporter.cpp | 253 ------------------ .../Source/Framework/UnitTestingReporter.h | 105 -------- 2 files changed, 358 deletions(-) delete mode 100644 Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.cpp delete mode 100644 Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.h diff --git a/Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.cpp b/Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.cpp deleted file mode 100644 index 7041b2de32..0000000000 --- a/Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.cpp +++ /dev/null @@ -1,253 +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 - * - */ - - -#include "UnitTestingReporter.h" - -#include -#include - -#define SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_EQ(LHS, RHS)\ - EXPECT_EQ(LHS, RHS) << report.data(); - -#define SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_NE(LHS, RHS)\ - EXPECT_NE(LHS, RHS) << report.data(); - -#define SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_GT(LHS, RHS)\ - EXPECT_GT(LHS, RHS) << report.data(); - -#define SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_GE(LHS, RHS)\ - EXPECT_GE(LHS, RHS) << report.data(); - -#define SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_LT(LHS, RHS)\ - EXPECT_LT(LHS, RHS) << report.data(); - -#define SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_LE(LHS, RHS)\ - EXPECT_LE(LHS, RHS) << report.data(); - -namespace ScriptCanvas -{ - namespace UnitTesting - { - Reporter::Reporter() - : m_graphId{} - , m_entityId{} - {} - - Reporter::Reporter(const RuntimeComponent& graph) - { - SetGraph(graph); - } - - Reporter::~Reporter() - { - Reset(); - } - - void Reporter::Checkpoint(const Report& report) - { - if (m_isReportFinished) - return; - - m_checkpoints.push_back(report); - } - - const AZStd::vector& Reporter::GetCheckpoints() const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_checkpoints; - } - - const AZStd::vector& Reporter::GetFailure() const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_failures; - } - - const AZ::EntityId& Reporter::GetGraphId() const - { - return m_graphId; - } - - const AZStd::vector& Reporter::GetSuccess() const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_successes; - } - - bool Reporter::IsActivated() const - { - return m_graphIsActivated; - } - - bool Reporter::IsComplete() const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_graphIsComplete; - } - - bool Reporter::IsDeactivated() const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_graphIsDeactivated; - } - - bool Reporter::IsErrorFree() const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_graphIsErrorFree; - } - - bool Reporter::IsReportFinished() const - { - return m_isReportFinished; - } - - void Reporter::FinishReport() - { - AZ_Assert(!m_isReportFinished, "the report is already finished"); - m_isReportFinished = true; - } - - void Reporter::FinishReport(const RuntimeComponent& graph) - { - AZ_Assert(!m_isReportFinished, "the report is already finished"); - Bus::Handler::BusDisconnect(m_graphId); - AZ::EntityBus::Handler::BusDisconnect(m_entityId); - m_graphIsErrorFree = !graph.IsInErrorState(); - m_isReportFinished = true; - } - - bool Reporter::operator==(const Reporter& other) const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_graphIsActivated == other.m_graphIsActivated - && m_graphIsDeactivated == other.m_graphIsDeactivated - && m_graphIsComplete == other.m_graphIsComplete - && m_graphIsErrorFree == other.m_graphIsErrorFree - && m_isReportFinished == other.m_isReportFinished - && m_failures == other.m_failures - && m_successes == other.m_successes; - } - - void Reporter::OnEntityActivated(const AZ::EntityId& entity) - { - AZ_Assert(m_entityId == entity, "this reporter is listening to the wrong entity"); - if (m_isReportFinished) - return; - - m_graphIsActivated = true; - } - - void Reporter::OnEntityDeactivated(const AZ::EntityId& entity) - { - AZ_Assert(m_entityId == entity, "this reporter is listening to the wrong entity"); - if (m_isReportFinished) - return; - - m_graphIsDeactivated = true; - } - - void Reporter::Reset() - { - if (m_graphId.IsValid()) - { - Bus::Handler::BusDisconnect(); - } - - if (m_entityId.IsValid()) - { - AZ::EntityBus::Handler::BusDisconnect(); - } - - m_graphIsActivated = false; - m_graphIsComplete = false; - m_graphIsErrorFree = false; - m_isReportFinished = false; - m_graphId = AZ::EntityId{}; - m_failures.clear(); - m_failures.clear(); - } - - void Reporter::SetGraph(const RuntimeComponent& graph) - { - Reset(); - m_graphId = graph.GetUniqueId(); - m_entityId = graph.GetEntityId(); - Bus::Handler::BusConnect(m_graphId); - AZ::EntityBus::Handler::BusConnect(m_entityId); - } - - // Handler - void Reporter::MarkComplete(const Report& report) - { - if (m_isReportFinished) - return; - - if (m_graphIsComplete) - { - AddFailure(AZStd::string::format("MarkComplete was called twice. %s", report.data())); - } - else - { - m_graphIsComplete = true; - } - } - - void Reporter::AddFailure(const Report& report) - { - if (m_isReportFinished) - return; - - m_failures.push_back(report); - Checkpoint(AZStd::string::format("AddFailure: %s", report.data())); - } - - void Reporter::AddSuccess(const Report& report) - { - if (m_isReportFinished) - return; - - m_successes.push_back(report); - Checkpoint(AZStd::string::format("AddSuccess: %s", report.data())); - } - - void Reporter::ExpectFalse(const bool value, const Report& report) - { - EXPECT_FALSE(value) << report.data(); - Checkpoint(AZStd::string::format("ExpectFalse: %s", report.data())); - } - - void Reporter::ExpectTrue(const bool value, const Report& report) - { - EXPECT_TRUE(value) << report.data(); - Checkpoint(AZStd::string::format("ExpectTrue: %s", report.data())); - } - - void Reporter::ExpectEqualNumber(const Data::NumberType lhs, const Data::NumberType rhs, const Report& report) - { - EXPECT_NEAR(lhs, rhs, 0.001) << report.data(); - Checkpoint(AZStd::string::format("ExpectEqualNumber: %s", report.data())); - } - - void Reporter::ExpectNotEqualNumber(const Data::NumberType lhs, const Data::NumberType rhs, const Report& report) - { - EXPECT_NE(lhs, rhs) << report.data(); - Checkpoint(AZStd::string::format("ExpectNotEqualNumber: %s", report.data())); - } - - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_OVERLOAD_IMPLEMENTATIONS(Reporter, ExpectEqual, SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_EQ) - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_OVERLOAD_IMPLEMENTATIONS(Reporter, ExpectNotEqual, SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_NE) - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_IMPLEMENTATIONS(Reporter, ExpectGreaterThan, SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_GT) - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_IMPLEMENTATIONS(Reporter, ExpectGreaterThanEqual, SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_GE) - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_IMPLEMENTATIONS(Reporter, ExpectLessThan, SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_LT) - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_IMPLEMENTATIONS(Reporter, ExpectLessThanEqual, SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_LE) - - } // namespace UnitTesting - -} // namespace ScriptCanvas diff --git a/Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.h b/Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.h deleted file mode 100644 index 27c91d9ccc..0000000000 --- a/Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.h +++ /dev/null @@ -1,105 +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 - * - */ - -#pragma once - -#include -#include -#include -#include -#include - -namespace ScriptCanvas -{ - class RuntimeComponent; - - namespace UnitTesting - { - class Reporter - : public Bus::Handler - , public AZ::EntityBus::Handler - { - public: - Reporter(); - Reporter(const RuntimeComponent& graph); - ~Reporter(); - - void FinishReport(); - - void FinishReport(const RuntimeComponent& graph); - - const AZStd::vector& GetCheckpoints() const; - - const AZStd::vector& GetFailure() const; - - const AZ::EntityId& GetGraphId() const; - - const AZStd::vector& GetSuccess() const; - - bool IsActivated() const; - - bool IsComplete() const; - - bool IsDeactivated() const; - - bool IsErrorFree() const; - - bool IsReportFinished() const; - - bool operator==(const Reporter& other) const; - - void Reset(); - - void SetGraph(const RuntimeComponent& graph); - - // Bus::Handler - - void AddFailure(const Report& report) override; - - void AddSuccess(const Report& report) override; - - void Checkpoint(const Report& report) override; - - void ExpectFalse(const bool value, const Report& report) override; - - void ExpectTrue(const bool value, const Report& report) override; - - void MarkComplete(const Report& report) override; - - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_OVERLOAD_OVERRIDES(ExpectEqual); - - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_OVERLOAD_OVERRIDES(ExpectNotEqual); - - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_OVERRIDES(ExpectGreaterThan); - - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_OVERRIDES(ExpectGreaterThanEqual); - - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_OVERRIDES(ExpectLessThan); - - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_OVERRIDES(ExpectLessThanEqual); - - protected: - void OnEntityActivated(const AZ::EntityId&) override; - void OnEntityDeactivated(const AZ::EntityId&) override; - - private: - bool m_graphIsActivated = false; - bool m_graphIsDeactivated = false; - bool m_graphIsComplete = false; - bool m_graphIsErrorFree = false; - bool m_isReportFinished = false; - AZ::EntityId m_graphId; - AZ::EntityId m_entityId; - AZStd::vector m_checkpoints; - AZStd::vector m_failures; - AZStd::vector m_successes; - }; // class Reporter/ - - } // namespace UnitTesting - -} // namespace ScriptCanvas From eb5218e1a3bc96589034c248e912ac39cd68d2d6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:40:54 -0800 Subject: [PATCH 326/620] Removes ScriptCanvas_BehaviorContext from Gems/ScriptCanvasTesting Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/ScriptCanvas_BehaviorContext.cpp | 29 ------------------- ...criptcanvastestingeditor_tests_files.cmake | 1 - 2 files changed, 30 deletions(-) delete mode 100644 Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp deleted file mode 100644 index 5222be6e31..0000000000 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp +++ /dev/null @@ -1,29 +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 - * - */ - - - -#include -#include -#include - -#include -#include -#include - -using namespace ScriptCanvasTests; -using namespace ScriptCanvasEditor; -using namespace TestNodes; - -void ReflectSignCorrectly() -{ - AZ::BehaviorContext* behaviorContext(nullptr); - AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext); - AZ_Assert(behaviorContext, "A behavior context is required!"); - behaviorContext->Method("Sign", AZ::GetSign); -} diff --git a/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake b/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake index e2e86ca551..98bf13c404 100644 --- a/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake +++ b/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake @@ -16,7 +16,6 @@ set(FILES Source/Framework/ScriptCanvasTestApplication.h Source/Framework/EntityRefTests.h Tests/ScriptCanvasTestingTest.cpp - Tests/ScriptCanvas_BehaviorContext.cpp Tests/ScriptCanvas_ContainerSupport.cpp Tests/ScriptCanvas_Core.cpp Tests/ScriptCanvas_EventHandlers.cpp From 250500e93782798473e193e0ad2f3dda832b7b70 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:48:54 -0800 Subject: [PATCH 327/620] Removes BuilderSystemComponent.h from Gems/ScriptEvents Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Builder/BuilderSystemComponent.h | 40 ------------------- .../scriptevents_editor_builder_files.cmake | 1 - 2 files changed, 41 deletions(-) delete mode 100644 Gems/ScriptEvents/Code/Builder/BuilderSystemComponent.h diff --git a/Gems/ScriptEvents/Code/Builder/BuilderSystemComponent.h b/Gems/ScriptEvents/Code/Builder/BuilderSystemComponent.h deleted file mode 100644 index 485698e99a..0000000000 --- a/Gems/ScriptEvents/Code/Builder/BuilderSystemComponent.h +++ /dev/null @@ -1,40 +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 - * - */ - -#pragma once - -#include -#include - -namespace ScriptEventsBuilder -{ - class BuilderSystemComponent - : public AZ::Component - { - public: - AZ_COMPONENT(BuilderSystemComponent, "{6CE4EF5D-5A18-4E25-A676-501644676B58}"); - - BuilderSystemComponent(); - ~BuilderSystemComponent() override; - - static void Reflect(AZ::ReflectContext* context); - - static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent); - - //////////////////////////////////////////////////////////////////////// - // AZ::Component... - void Init() override; - void Activate() override; - void Deactivate() override; - //////////////////////////////////////////////////////////////////////// - - private: - BuilderSystemComponent(const BuilderSystemComponent&) = delete; - - }; -} diff --git a/Gems/ScriptEvents/Code/scriptevents_editor_builder_files.cmake b/Gems/ScriptEvents/Code/scriptevents_editor_builder_files.cmake index 5cce31dcd9..ece30fbd07 100644 --- a/Gems/ScriptEvents/Code/scriptevents_editor_builder_files.cmake +++ b/Gems/ScriptEvents/Code/scriptevents_editor_builder_files.cmake @@ -11,5 +11,4 @@ set(FILES Builder/ScriptEventsBuilderComponent.h Builder/ScriptEventsBuilderWorker.cpp Builder/ScriptEventsBuilderWorker.h - Builder/BuilderSystemComponent.h ) From 1251d66114c3bc20dc7afcb07c13825e8d282069 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:51:25 -0800 Subject: [PATCH 328/620] Removes ScriptEventsLegacyDefinitions from Gems/ScriptEvents Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptEventsLegacyDefinitions.h | 122 ------------------ 1 file changed, 122 deletions(-) delete mode 100644 Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventsLegacyDefinitions.h diff --git a/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventsLegacyDefinitions.h b/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventsLegacyDefinitions.h deleted file mode 100644 index b61d07295d..0000000000 --- a/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventsLegacyDefinitions.h +++ /dev/null @@ -1,122 +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 - * - */ - -#pragma once - -#include -#include -#include -#include - - - - -namespace ScriptEventsLegacy -{ - /** - * This class represents an EBus event parameter. - * void Foo(parameterType parameterName) - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * parameter - */ - struct ParameterDefinition - { - AZ_TYPE_INFO(ParameterDefinition, "{6586FFB5-0FF6-424F-A542-C797E2FF3458}"); - AZ_CLASS_ALLOCATOR(ParameterDefinition, AZ::SystemAllocator, 0); - - ParameterDefinition() = default; - ParameterDefinition(const AZStd::string& name, const AZStd::string& tooltip, const AZ::Uuid& type) - : m_name(name) - , m_tooltip(tooltip) - , m_type(type) - {} - - AZStd::string m_name; - AZStd::string m_tooltip; - AZ::Uuid m_type = AZ::BehaviorContext::GetVoidTypeId(); - }; - - /** - * This class represents an EBus event. - * void Foo (parameterType parameterName, parameterType2 parameterName2) - * ^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * m_returnType, m_name, m_parameters - */ - struct EventDefinition - { - AZ_TYPE_INFO(EventDefinition, "{211BB356-FA42-400F-B3DD-9326C6A686B6}"); - AZ_CLASS_ALLOCATOR(EventDefinition, AZ::SystemAllocator, 0); - - EventDefinition() = default; - EventDefinition(const AZStd::string& eventName, const AZStd::string& tooltip, const AZ::Uuid& returnValue, const AZStd::vector& parameters) - : m_name(eventName) - , m_tooltip(tooltip) - , m_returnType(returnValue) - , m_parameters(parameters) - {} - - AZStd::string m_name; - AZStd::string m_tooltip; - AZ::Uuid m_returnType = AZ::BehaviorContext::GetVoidTypeId(); - AZStd::vector m_parameters; - }; - - /** - * This class represents EBus type traits. - * At the moment only bus id type is supported. - */ - struct TypeTraitsDefinition - { - AZ_TYPE_INFO(TypeTraitsDefinition, "{EC374DE0-8003-4572-BC26-C4A8DBE50AB6}"); - AZ_CLASS_ALLOCATOR(TypeTraitsDefinition, AZ::SystemAllocator, 0); - - TypeTraitsDefinition() = default; - TypeTraitsDefinition(const AZ::Uuid& busIdType) - : m_busIdType(busIdType) {} - - AZ::Uuid m_busIdType = AZ::BehaviorContext::GetVoidTypeId(); - }; - - /** - * This class represents an EBus. - * An EBus has a name, traits, and a collection of events - * Configurable EBuses are added to the Behavior Context as both Request and Notification buses - */ - struct Definition - { - AZ_TYPE_INFO(Definition, "{4663215E-8137-4A16-979D-26B48401F40D}"); - AZ_CLASS_ALLOCATOR(Definition, AZ::SystemAllocator, 0); - - Definition() = default; - Definition(const AZStd::string& name, const AZStd::string& tooltip, const TypeTraitsDefinition& traits, const AZStd::vector& events) - : m_name(name) - , m_tooltip(tooltip) - , m_traits(traits) - , m_events(events) - {} - - EventDefinition FindEvent(const char* name) const - { - for (const EventDefinition& eventDefinition : m_events) - { - if (eventDefinition.m_name.compare(name) == 0) - { - return eventDefinition; - } - } - - return EventDefinition(); - } - - AZStd::string m_name; - AZStd::string m_tooltip; - AZStd::string m_category = "Custom Events"; - TypeTraitsDefinition m_traits; - AZStd::vector m_events; - }; -} From 57499860e0244c9e49e55d086ce94de5e4fedf58 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:51:58 -0800 Subject: [PATCH 329/620] Removes Input.h/cpp from Gems/StartingPoint Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/StartingPointInput/Code/Source/Input.cpp | 490 ------------------ Gems/StartingPointInput/Code/Source/Input.h | 125 ----- 2 files changed, 615 deletions(-) delete mode 100644 Gems/StartingPointInput/Code/Source/Input.cpp delete mode 100644 Gems/StartingPointInput/Code/Source/Input.h diff --git a/Gems/StartingPointInput/Code/Source/Input.cpp b/Gems/StartingPointInput/Code/Source/Input.cpp deleted file mode 100644 index 934ebe4d35..0000000000 --- a/Gems/StartingPointInput/Code/Source/Input.cpp +++ /dev/null @@ -1,490 +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 - * - */ - -#include "Input.h" -#include "LyToAzInputNameConversions.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -// CryCommon includes -#include -#include - - -namespace Input -{ - static const int s_inputVersion = 2; - - bool ConvertInputVersion1To2(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) - { - const int deviceTypeElementIndex = classElement.FindElement(AZ_CRC("Input Device Type")); - if (deviceTypeElementIndex == -1) - { - AZ_Error("Input", false, "Could not find 'Input Device Type' element"); - return false; - } - - AZ::SerializeContext::DataElementNode& deviceTypeElementNode = classElement.GetSubElement(deviceTypeElementIndex); - AZStd::string deviceTypeElementValue; - if (!deviceTypeElementNode.GetData(deviceTypeElementValue)) - { - AZ_Error("Input", false, "Could not get 'Input Device Type' element as a string"); - return false; - } - - const AZStd::string convertedDeviceType = ConvertInputDeviceName(deviceTypeElementValue); - if (!deviceTypeElementNode.SetData(context, convertedDeviceType)) - { - AZ_Error("Input", false, "Could not set 'Input Device Type' element as a string"); - return false; - } - - const int eventNameElementIndex = classElement.FindElement(AZ_CRC("Input Name")); - if (eventNameElementIndex == -1) - { - AZ_Error("Input", false, "Could not find 'Input Name' element"); - return false; - } - - AZ::SerializeContext::DataElementNode& eventNameElementNode = classElement.GetSubElement(eventNameElementIndex); - AZStd::string eventNameElementValue; - if (!eventNameElementNode.GetData(eventNameElementValue)) - { - AZ_Error("Input", false, "Could not get 'Input Name' element as a string"); - return false; - } - - const AZStd::string convertedElementName = ConvertInputEventName(eventNameElementValue); - if (!eventNameElementNode.SetData(context, convertedElementName)) - { - AZ_Error("Input", false, "Could not set 'Input Name' element as a string"); - return false; - } - - return true; - } - - bool ConvertInputVersion(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) - { - int currentUpgradedVersion = classElement.GetVersion(); - while (currentUpgradedVersion < s_inputVersion) - { - switch (currentUpgradedVersion) - { - case 1: - { - if (ConvertInputVersion1To2(context, classElement)) - { - currentUpgradedVersion = 2; - } - else - { - AZ_Warning("Input", false, "Failed to convert Input from version 1 to 2, its data will be lost on save"); - return false; - } - } - break; - case 0: - default: - { - AZ_Warning("Input", false, "Unable to convert Input: unsupported version %i, its data will be lost on save", currentUpgradedVersion); - return false; - } - } - } - return true; - } - - void Input::Reflect(AZ::ReflectContext* reflection) - { - AZ::SerializeContext* serializeContext = azrtti_cast(reflection); - if (serializeContext) - { - serializeContext->Class() - ->Version(s_inputVersion, &ConvertInputVersion) - ->Field("Input Device Type", &Input::m_inputDeviceType) - ->Field("Input Name", &Input::m_inputName) - ->Field("Event Value Multiplier", &Input::m_eventValueMultiplier) - ->Field("Dead Zone", &Input::m_deadZone); - - AZ::EditContext* editContext = serializeContext->GetEditContext(); - if (editContext) - { - editContext->Class("Input", "Hold an input to generate an event") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::NameLabelOverride, &Input::GetEditorText) - ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::AttributesAndValues) - ->DataElement(AZ::Edit::UIHandlers::ComboBox, &Input::m_inputDeviceType, "Input Device Type", "The type of input device, ex keyboard") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, &Input::OnDeviceSelected) - ->Attribute(AZ::Edit::Attributes::StringList, &Input::GetInputDeviceTypes) - ->DataElement(AZ::Edit::UIHandlers::ComboBox, &Input::m_inputName, "Input Name", "The name of the input you want to hold ex. space") - ->Attribute(AZ::Edit::Attributes::StringList, &Input::GetInputNamesBySelectedDevice) - ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::AttributesAndValues) - ->DataElement(0, &Input::m_eventValueMultiplier, "Event value multiplier", "When the event fires, the value will be scaled by this multiplier") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::AttributesAndValues) - ->DataElement(0, &Input::m_deadZone, "Dead zone", "An event will only be sent out if the value is above this threshold") - ->Attribute(AZ::Edit::Attributes::Min, 0.0f); - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection)) - { - behaviorContext->EBus("InputEventNotificationBus") - ->Event("OnPressed", &AZ::InputEventNotificationBus::Events::OnPressed) - ->Event("OnHeld", &AZ::InputEventNotificationBus::Events::OnHeld) - ->Event("OnReleased", &AZ::InputEventNotificationBus::Events::OnReleased); - } - } - } - - Input::Input() - { - if (m_inputDeviceType.empty()) - { - auto&& deviceTypes = GetInputDeviceTypes(); - if (!deviceTypes.empty()) - { - m_inputDeviceType = deviceTypes[0]; - OnDeviceSelected(); - } - } - } - - bool Input::OnInputChannelEventFiltered(const AzFramework::InputChannel& inputChannel) - { - const LocalUserId localUserIdOfEvent = static_cast(inputChannel.GetInputDevice().GetAssignedLocalUserId()); - const float value = CalculateEventValue(inputChannel); - const bool isPressed = fabs(value) > m_deadZone; - if (!m_wasPressed && isPressed) - { - SendEventsInternal(value, localUserIdOfEvent, m_outgoingBusId, &AZ::InputEventNotificationBus::Events::OnPressed); - } - else if (m_wasPressed && isPressed) - { - SendEventsInternal(value, localUserIdOfEvent, m_outgoingBusId, &AZ::InputEventNotificationBus::Events::OnHeld); - } - else if (m_wasPressed && !isPressed) - { - SendEventsInternal(value, localUserIdOfEvent, m_outgoingBusId, &AZ::InputEventNotificationBus::Events::OnReleased); - } - m_wasPressed = isPressed; - - // Return false so we don't consume the event. This should perhaps be a configurable option? - return false; - } - - float Input::CalculateEventValue(const AzFramework::InputChannel& inputChannel) const - { - return inputChannel.GetValue(); - } - - void Input::SendEventsInternal(float value, const AzFramework::LocalUserId& localUserIdOfEvent, const AZ::InputEventNotificationId busId, InputEventType eventType) - { - value *= m_eventValueMultiplier; - - AZ::InputEventNotificationId localUserBusId = AZ::InputEventNotificationId(localUserIdOfEvent, busId.m_actionNameCrc); - AZ::InputEventNotificationBus::Event(localUserBusId, eventType, value); - - AZ::InputEventNotificationId wildCardBusId = AZ::InputEventNotificationId(AzFramework::LocalUserIdAny, busId.m_actionNameCrc); - AZ::InputEventNotificationBus::Event(wildCardBusId, eventType, value); - } - - void Input::Activate(const AZ::InputEventNotificationId& eventNotificationId) - { - const AzFramework::InputDevice* inputDevice = AzFramework::InputDeviceRequests::FindInputDevice(AzFramework::InputDeviceId(m_inputDeviceType.c_str())); - if (!inputDevice || !inputDevice->IsSupported()) - { - // The input device that this input binding would be listening for input from - // is not supported on the current platform, so don't bother even activating. - // Please note distinction between InputDevice::IsSupported and IsConnected. - return; - } - - const AZ::Crc32 channelNameFilter(m_inputName.c_str()); - const AZ::Crc32 deviceNameFilter(m_inputDeviceType.c_str()); - const AzFramework::LocalUserId localUserIdFilter(eventNotificationId.m_localUserId); - AZStd::shared_ptr filter = AZStd::make_shared(channelNameFilter, deviceNameFilter, localUserIdFilter); - InputChannelEventListener::SetFilter(filter); - InputChannelEventListener::Connect(); - m_wasPressed = false; - - m_outgoingBusId = eventNotificationId; - AZ::GlobalInputRecordRequestBus::Handler::BusConnect(); - AZ::EditableInputRecord editableRecord; - editableRecord.m_localUserId = eventNotificationId.m_localUserId; - editableRecord.m_deviceName = m_inputDeviceType; - editableRecord.m_eventGroup = eventNotificationId.m_actionNameCrc; - editableRecord.m_inputName = m_inputName; - AZ::InputRecordRequestBus::Handler::BusConnect(editableRecord); - } - - void Input::Deactivate(const AZ::InputEventNotificationId& eventNotificationId) - { - if (m_wasPressed) - { - AZ::InputEventNotificationBus::Event(m_outgoingBusId, &AZ::InputEventNotifications::OnReleased, 0.0f); - } - InputChannelEventListener::Disconnect(); - AZ::GlobalInputRecordRequestBus::Handler::BusDisconnect(); - AZ::InputRecordRequestBus::Handler::BusDisconnect(); - } - - AZStd::string Input::GetEditorText() const - { - return m_inputName.empty() ? "" : - m_inputName + (m_outputAxis == OutputAxis::X ? " (x-axis)" : " (y-axis)"); - } - - const AZStd::vector ThumbstickInput::GetInputDeviceTypes() const - { - // Gamepads are currently the only device type that support thumbstick input. - // We could (should) be more robust here by iterating over all input devices, - // looking for any with associated input channels of type InputChannelAxis2D. - AZStd::vector retval; - retval.push_back(AzFramework::InputDeviceGamepad::Name); - return retval; - } - - const AZStd::vector ThumbstickInput::GetInputNamesBySelectedDevice() const - { - // Gamepads are currently the only device type that support thumbstick input. - // We could (should) be more robust here by iterating over all input devices, - // looking for any with associated input channels of type InputChannelAxis2D. - AZStd::vector retval; - retval.push_back(AzFramework::InputDeviceGamepad::ThumbStickAxis2D::L.GetName()); - retval.push_back(AzFramework::InputDeviceGamepad::ThumbStickAxis2D::R.GetName()); - return retval; - } - - bool ThumbstickInput::OnInputChannelEventFiltered(const AzFramework::InputChannel& inputChannel) - { - // Because we are sending all thumbstick events regardless of if they are inside the dead-zone - // (see InputChannelAxis2D::ProcessRawInputEvent) - // ThumbstickInput components can effectively cancel themselves out if they happen to be setup - // to receive input from a local user id that is signed into multiple controllers at the same - // time. If the controller not being used is updated last, the (~0, ~0) events it sends every - // frame cause the base Input::OnInputChannelEventFiltered function to determine that we need - // to send an InputEventNotificationBus::Events::OnReleased event because m_wasPressed is set - // to true by the other controller that is actually in use (and that is being updated first). - // - // To combat this, anytime we enter the m_wasPressed == true state we'll store a reference to - // the input device id that sent the event (see below). Each time we receive an event we will - // then check whether it's originating from the same input device id, and if not we will just - // ignore it. Please note that while taking the address of the device id is a little sketchy, - // we can do this because it's lifecycle is guaranteed to be longer than that of this object - // UNLESS we ever start calling InputSystemComponent::RecreateEnabledInputDevices somewhere. - // - // Now in this case, the old InputDevice that owns the InputChannelId will be destroyed, but - // not before the InputChannels it owns are destroyed first meaning InputChannel::ResetState - // will be called, the internal state of the input channels will be reset, and an event will - // be broadcast that will ultimately result in m_wasPressed being set to false and therefore - // m_wasLastPressedByInputDeviceId being set to nullptr below instead of becoming a dangling - // pointer. I definitely don't like this much, as it is risky behavior entirely dependent on - // the internal workings of the AzFramework input system, but it's the fastest way to perform - // this additional check. The alternative is to store the last pressed InputDeviceId by value, - // but this would involve a (slightly) more expensive check (see InputDeviceId::operator==), - // along with a string copy each time we set/reset the value (see InputDeviceId::operator=). - // - // At some point it may be worth looking at doing this check (or a safer version of it) in - // the base Input::OnInputChannelEventFiltered function, because the 'one user logged into - // multiple controllers' situation could conceivably cause strange behaviour for all types - // of input bindings (albeit only if the user were to actively use both controllers at the - // same time, in which case who can even really say what the correct behaviour should be?). - // But that would be a far riskier change, and because it's only a problem for thumb-stick - // input we're sending even when the controller is completely idle this fix will do for now. - const InputDeviceId* inputDeviceId = &(inputChannel.GetInputDevice().GetInputDeviceId()); - if (m_wasLastPressedByInputDeviceId && m_wasLastPressedByInputDeviceId != inputDeviceId) - { - return false; - } - - const bool shouldBeConsumed = Input::OnInputChannelEventFiltered(inputChannel); - m_wasLastPressedByInputDeviceId = m_wasPressed ? inputDeviceId : nullptr; - return shouldBeConsumed; - } - - float ThumbstickInput::CalculateEventValue(const AzFramework::InputChannel& inputChannel) const - { - const AzFramework::InputChannelAxis2D::AxisData2D* axisData2D = inputChannel.GetCustomData(); - if (axisData2D == nullptr) - { - AZ_Warning("ThumbstickInput", false, "InputChannel with id '%s' has no axis data 2D", inputChannel.GetInputChannelId().GetName()); - return 0.0f; - } - - const AZ::Vector2 outputValues = ApplyDeadZonesAndSensitivity(axisData2D->m_preDeadZoneValues, - m_innerDeadZoneRadius, - m_outerDeadZoneRadius, - m_axisDeadZoneValue, - m_sensitivityExponent); - - // Ideally we would return both values here and allow each to be mapped to a different output - // event, but that would require a greater re-factor of both the InputManagementFramework Gem - // and the StartingPointInput Gem, and there is nothing preventing anyone from setting up one - // ThumbstickInput component for each axis so it would only be a simplification/optimization. - const float axisValueToReturn = (m_outputAxis == OutputAxis::X) ? outputValues.GetX() : outputValues.GetY(); - return axisValueToReturn; - } - - AZ::Vector2 ThumbstickInput::ApplyDeadZonesAndSensitivity(const AZ::Vector2& inputValues, float innerDeadZone, float outerDeadZone, float axisDeadZone, float sensitivityExponent) - { - static const AZ::Vector2 zeroVector = AZ::Vector2::CreateZero(); - const AZ::Vector2 rawAbsValues(fabsf(inputValues.GetX()), fabsf(inputValues.GetY())); - const float rawLength = rawAbsValues.GetLength(); - if (rawLength == 0.0f) - { - return zeroVector; - } - - // Apply the circular dead zones - const AZ::Vector2 normalizedValues = rawAbsValues / rawLength; - const float postCircularDeadZoneLength = AZ::GetClamp((rawLength - innerDeadZone) / (outerDeadZone - innerDeadZone), 0.0f, 1.0f); - AZ::Vector2 absValues = normalizedValues * postCircularDeadZoneLength; - - // Apply the per-axis dead zone - const AZ::Vector2 absAxisValues = zeroVector.GetMax(rawAbsValues - AZ::Vector2(axisDeadZone, axisDeadZone)) / (outerDeadZone - axisDeadZone); - - // Merge the circular and per-axis dead zones. The resulting values are the smallest ones (dead zone takes priority). And restore the components sign. - const AZ::Vector2 signValues(AZ::GetSign(inputValues.GetX()), AZ::GetSign(inputValues.GetY())); - AZ::Vector2 values = absValues.GetMin(absAxisValues) * signValues; - - // Rescale the vector using the post circular dead zone length, which is the real stick vector length, - // to avoid any jump in values when the stick is fully pushed along an axis and slowly getting out of the axis dead zone - // Additionally, apply the sensitivity curve to the final stick vector length - const float postAxisDeadZoneLength = values.GetLength(); - if (postAxisDeadZoneLength > 0.0f) - { - values /= postAxisDeadZoneLength; - - const float postSensitivityLength = powf(postCircularDeadZoneLength, sensitivityExponent); - values *= postSensitivityLength; - } - - return values; - } -} // namespace Input diff --git a/Gems/StartingPointInput/Code/Source/Input.h b/Gems/StartingPointInput/Code/Source/Input.h deleted file mode 100644 index f6734a4f71..0000000000 --- a/Gems/StartingPointInput/Code/Source/Input.h +++ /dev/null @@ -1,125 +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 - * - */ -#pragma once -#include -#include -#include -#include -#include -#include -#include - -namespace AZ -{ - class ReflectContext; -} - -namespace Input -{ - ////////////////////////////////////////////////////////////////////////// - /// Input handles raw input from any source and outputs Pressed, Held, and Released input events - class Input - : public InputSubComponent - , protected AzFramework::InputChannelEventListener - , protected AZ::GlobalInputRecordRequestBus::Handler - , protected AZ::InputRecordRequestBus::Handler - { - public: - Input(); - ~Input() override = default; - AZ_RTTI(Input, "{546C9EBC-90EF-4F03-891A-0736BE2A487E}", InputSubComponent); - static void Reflect(AZ::ReflectContext* reflection); - - ////////////////////////////////////////////////////////////////////////// - // InputSubComponent - void Activate(const AZ::InputEventNotificationId& eventNotificationId) override; - void Deactivate(const AZ::InputEventNotificationId& eventNotificationId) override; - - protected: - AZStd::string GetEditorText() const; - virtual const AZStd::vector GetInputDeviceTypes() const; - virtual const AZStd::vector GetInputNamesBySelectedDevice() const; - - AZ::Crc32 OnDeviceSelected(); - - ////////////////////////////////////////////////////////////////////////// - // AZ::GlobalInputRecordRequests::Handler - void GatherEditableInputRecords(AZ::EditableInputRecords& outResults) override; - - ////////////////////////////////////////////////////////////////////////// - // AZ::EditableInputRecord::Handler - void SetInputRecord(const AZ::EditableInputRecord& newInputRecord) override; - - ////////////////////////////////////////////////////////////////////////// - // AzFramework::InputChannelEventListener - bool OnInputChannelEventFiltered(const AzFramework::InputChannel& inputChannel) override; - - using InputEventType = void(AZ::InputEventNotificationBus::Events::*)(float); - virtual float CalculateEventValue(const AzFramework::InputChannel& inputChannel) const; - void SendEventsInternal(float value, const AzFramework::LocalUserId& localUserIdOfEvent, const AZ::InputEventNotificationId busId, InputEventType eventType); - - ////////////////////////////////////////////////////////////////////////// - // Non Reflected Data - AZ::InputEventNotificationId m_outgoingBusId; - bool m_wasPressed = false; - - ////////////////////////////////////////////////////////////////////////// - // Reflected Data - float m_eventValueMultiplier = 1.f; - AZStd::string m_inputName = ""; - AZStd::string m_inputDeviceType = ""; - float m_deadZone = 0.0f; - }; - - ////////////////////////////////////////////////////////////////////////// - /// ThumbstickInput handles raw input from thumbstick sources, applies any - /// custom dead-zone or sensitivity curve calculations, and then outputs - /// Pressed, Held, and Released input events for the specified axis - class ThumbstickInput - : public Input - { - public: - ThumbstickInput(); - ~ThumbstickInput() override = default; - AZ_RTTI(ThumbstickInput, "{4881FA7C-0667-476C-8C77-4DBB6C69F646}", Input); - static void Reflect(AZ::ReflectContext* reflection); - - protected: - ////////////////////////////////////////////////////////////////////////// - // InputSubComponent - AZStd::string GetEditorText() const; - const AZStd::vector GetInputDeviceTypes() const override; - const AZStd::vector GetInputNamesBySelectedDevice() const override; - bool OnInputChannelEventFiltered(const AzFramework::InputChannel& inputChannel) override; - float CalculateEventValue(const AzFramework::InputChannel& inputChannel) const override; - - static AZ::Vector2 ApplyDeadZonesAndSensitivity(const AZ::Vector2& inputValues, - float innerDeadZone, - float outerDeadZone, - float axisDeadZone, - float sensitivityExponent); - - enum class OutputAxis - { - X, - Y - }; - - ////////////////////////////////////////////////////////////////////////// - // Non Reflected Data - const AzFramework::InputDeviceId* m_wasLastPressedByInputDeviceId = nullptr; - - ////////////////////////////////////////////////////////////////////////// - // Reflected Data - float m_innerDeadZoneRadius = 0.0f; - float m_outerDeadZoneRadius = 1.0f; - float m_axisDeadZoneValue = 0.0f; - float m_sensitivityExponent = 1.0f; - OutputAxis m_outputAxis = OutputAxis::X; - }; -} // namespace Input From 03f734c8b3b96b6fcffd51227353088e37acac2a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:52:40 -0800 Subject: [PATCH 330/620] Removes LyToAzInputNameConversions.h from Gems/StartingPointMovement Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Source/LyToAzInputNameConversions.h | 231 ------------------ 1 file changed, 231 deletions(-) delete mode 100644 Gems/StartingPointInput/Code/Source/LyToAzInputNameConversions.h diff --git a/Gems/StartingPointInput/Code/Source/LyToAzInputNameConversions.h b/Gems/StartingPointInput/Code/Source/LyToAzInputNameConversions.h deleted file mode 100644 index cc94ce1dd5..0000000000 --- a/Gems/StartingPointInput/Code/Source/LyToAzInputNameConversions.h +++ /dev/null @@ -1,231 +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 - * - */ -#pragma once - -#include -#include -#include -#include - -namespace Input -{ - using namespace AzFramework; - - ////////////////////////////////////////////////////////////////////////// - inline AZStd::string ConvertInputDeviceName(AZStd::string inputDeviceName) - { - // Using std::unordered_map instead of AZStd to avoid allocator issues - static const std::unordered_map map = - { - { "mouse", InputDeviceMouse::Id.GetName() }, - { "keyboard", InputDeviceKeyboard::Id.GetName() }, - { "gamepad", InputDeviceGamepad::Name }, - { "game console controller", InputDeviceGamepad::Name }, - { "other game console controller", InputDeviceGamepad::Name }, - { "Oculus Touch Controller", "oculus_controllers" }, - { "OpenVR Controller", "openvr_controllers" } - }; - - const auto& it = map.find(inputDeviceName.c_str()); - return it != map.end() ? it->second.c_str() : inputDeviceName.c_str(); - } - - ////////////////////////////////////////////////////////////////////////// - inline AZStd::string ConvertInputEventName(AZStd::string inputEventName) - { - // Using std::unordered_map instead of AZStd to avoid allocator issues - static const std::unordered_map map = - { - { "mouse1", InputDeviceMouse::Button::Left.GetName() }, - { "mouse2", InputDeviceMouse::Button::Right.GetName() }, - { "mouse3", InputDeviceMouse::Button::Middle.GetName() }, - { "mouse4", InputDeviceMouse::Button::Other1.GetName() }, - { "mouse5", InputDeviceMouse::Button::Other2.GetName() }, - { "maxis_x", InputDeviceMouse::Movement::X.GetName() }, - { "maxis_y", InputDeviceMouse::Movement::Y.GetName() }, - { "maxis_z", InputDeviceMouse::Movement::Z.GetName() }, - { "mwheel_up", InputDeviceMouse::Movement::Z.GetName() }, - { "mwheel_down", InputDeviceMouse::Movement::Z.GetName() }, - { "mouse_pos", InputDeviceMouse::SystemCursorPosition.GetName() }, - - { "escape", InputDeviceKeyboard::Key::Escape.GetName() }, - { "1", InputDeviceKeyboard::Key::Alphanumeric1.GetName() }, - { "2", InputDeviceKeyboard::Key::Alphanumeric2.GetName() }, - { "3", InputDeviceKeyboard::Key::Alphanumeric3.GetName() }, - { "4", InputDeviceKeyboard::Key::Alphanumeric4.GetName() }, - { "5", InputDeviceKeyboard::Key::Alphanumeric5.GetName() }, - { "6", InputDeviceKeyboard::Key::Alphanumeric6.GetName() }, - { "7", InputDeviceKeyboard::Key::Alphanumeric7.GetName() }, - { "8", InputDeviceKeyboard::Key::Alphanumeric8.GetName() }, - { "9", InputDeviceKeyboard::Key::Alphanumeric9.GetName() }, - { "0", InputDeviceKeyboard::Key::Alphanumeric0.GetName() }, - { "minus", InputDeviceKeyboard::Key::PunctuationHyphen.GetName() }, - { "equals", InputDeviceKeyboard::Key::PunctuationEquals.GetName() }, - { "backspace", InputDeviceKeyboard::Key::EditBackspace.GetName() }, - { "tab", InputDeviceKeyboard::Key::EditTab.GetName() }, - { "q", InputDeviceKeyboard::Key::AlphanumericQ.GetName() }, - { "w", InputDeviceKeyboard::Key::AlphanumericW.GetName() }, - { "e", InputDeviceKeyboard::Key::AlphanumericE.GetName() }, - { "r", InputDeviceKeyboard::Key::AlphanumericR.GetName() }, - { "t", InputDeviceKeyboard::Key::AlphanumericT.GetName() }, - { "y", InputDeviceKeyboard::Key::AlphanumericY.GetName() }, - { "u", InputDeviceKeyboard::Key::AlphanumericU.GetName() }, - { "i", InputDeviceKeyboard::Key::AlphanumericI.GetName() }, - { "o", InputDeviceKeyboard::Key::AlphanumericO.GetName() }, - { "p", InputDeviceKeyboard::Key::AlphanumericP.GetName() }, - { "lbracket", InputDeviceKeyboard::Key::PunctuationBracketL.GetName() }, - { "rbracket", InputDeviceKeyboard::Key::PunctuationBracketR.GetName() }, - { "enter", InputDeviceKeyboard::Key::EditEnter.GetName() }, - { "lctrl", InputDeviceKeyboard::Key::ModifierCtrlL.GetName() }, - { "a", InputDeviceKeyboard::Key::AlphanumericA.GetName() }, - { "s", InputDeviceKeyboard::Key::AlphanumericS.GetName() }, - { "d", InputDeviceKeyboard::Key::AlphanumericD.GetName() }, - { "f", InputDeviceKeyboard::Key::AlphanumericF.GetName() }, - { "g", InputDeviceKeyboard::Key::AlphanumericG.GetName() }, - { "h", InputDeviceKeyboard::Key::AlphanumericH.GetName() }, - { "j", InputDeviceKeyboard::Key::AlphanumericJ.GetName() }, - { "k", InputDeviceKeyboard::Key::AlphanumericK.GetName() }, - { "l", InputDeviceKeyboard::Key::AlphanumericL.GetName() }, - { "semicolon", InputDeviceKeyboard::Key::PunctuationSemicolon.GetName() }, - { "apostrophe", InputDeviceKeyboard::Key::PunctuationApostrophe.GetName() }, - { "tilde", InputDeviceKeyboard::Key::PunctuationTilde.GetName() }, - { "lshift", InputDeviceKeyboard::Key::ModifierShiftL.GetName() }, - { "backslash", InputDeviceKeyboard::Key::PunctuationBackslash.GetName() }, - { "z", InputDeviceKeyboard::Key::AlphanumericZ.GetName() }, - { "x", InputDeviceKeyboard::Key::AlphanumericX.GetName() }, - { "c", InputDeviceKeyboard::Key::AlphanumericC.GetName() }, - { "v", InputDeviceKeyboard::Key::AlphanumericV.GetName() }, - { "b", InputDeviceKeyboard::Key::AlphanumericB.GetName() }, - { "n", InputDeviceKeyboard::Key::AlphanumericN.GetName() }, - { "m", InputDeviceKeyboard::Key::AlphanumericM.GetName() }, - { "comma", InputDeviceKeyboard::Key::PunctuationComma.GetName() }, - { "period", InputDeviceKeyboard::Key::PunctuationPeriod.GetName() }, - { "slash", InputDeviceKeyboard::Key::PunctuationSlash.GetName() }, - { "rshift", InputDeviceKeyboard::Key::ModifierShiftR.GetName() }, - { "np_multiply", InputDeviceKeyboard::Key::NumPadMultiply.GetName() }, - { "lalt", InputDeviceKeyboard::Key::ModifierAltL.GetName() }, - { "space", InputDeviceKeyboard::Key::EditSpace.GetName() }, - { "capslock", InputDeviceKeyboard::Key::EditCapsLock.GetName() }, - { "f1", InputDeviceKeyboard::Key::Function01.GetName() }, - { "f2", InputDeviceKeyboard::Key::Function02.GetName() }, - { "f3", InputDeviceKeyboard::Key::Function03.GetName() }, - { "f4", InputDeviceKeyboard::Key::Function04.GetName() }, - { "f5", InputDeviceKeyboard::Key::Function05.GetName() }, - { "f6", InputDeviceKeyboard::Key::Function06.GetName() }, - { "f7", InputDeviceKeyboard::Key::Function07.GetName() }, - { "f8", InputDeviceKeyboard::Key::Function08.GetName() }, - { "f9", InputDeviceKeyboard::Key::Function09.GetName() }, - { "f10", InputDeviceKeyboard::Key::Function10.GetName() }, - { "numlock", InputDeviceKeyboard::Key::NumLock.GetName() }, - { "scrolllock", InputDeviceKeyboard::Key::WindowsSystemScrollLock.GetName() }, - { "np_7", InputDeviceKeyboard::Key::NumPad7.GetName() }, - { "np_8", InputDeviceKeyboard::Key::NumPad8.GetName() }, - { "np_9", InputDeviceKeyboard::Key::NumPad9.GetName() }, - { "np_subtract", InputDeviceKeyboard::Key::NumPadSubtract.GetName() }, - { "np_4", InputDeviceKeyboard::Key::NumPad4.GetName() }, - { "np_5", InputDeviceKeyboard::Key::NumPad5.GetName() }, - { "np_6", InputDeviceKeyboard::Key::NumPad6.GetName() }, - { "np_add", InputDeviceKeyboard::Key::NumPadAdd.GetName() }, - { "np_1", InputDeviceKeyboard::Key::NumPad1.GetName() }, - { "np_2", InputDeviceKeyboard::Key::NumPad2.GetName() }, - { "np_3", InputDeviceKeyboard::Key::NumPad3.GetName() }, - { "np_0", InputDeviceKeyboard::Key::NumPad0.GetName() }, - { "np_period", InputDeviceKeyboard::Key::NumPadDecimal.GetName() }, - { "f11", InputDeviceKeyboard::Key::Function11.GetName() }, - { "f12", InputDeviceKeyboard::Key::Function12.GetName() }, - { "f13", InputDeviceKeyboard::Key::Function13.GetName() }, - { "f14", InputDeviceKeyboard::Key::Function14.GetName() }, - { "f15", InputDeviceKeyboard::Key::Function15.GetName() }, - { "np_enter", InputDeviceKeyboard::Key::NumPadEnter.GetName() }, - { "rctrl", InputDeviceKeyboard::Key::ModifierCtrlR.GetName() }, - { "np_divide", InputDeviceKeyboard::Key::NumPadDivide.GetName() }, - { "print", InputDeviceKeyboard::Key::WindowsSystemPrint.GetName() }, - { "ralt", InputDeviceKeyboard::Key::ModifierAltR.GetName() }, - { "pause", InputDeviceKeyboard::Key::WindowsSystemPause.GetName() }, - { "home", InputDeviceKeyboard::Key::NavigationHome.GetName() }, - { "up", InputDeviceKeyboard::Key::NavigationArrowUp.GetName() }, - { "pgup", InputDeviceKeyboard::Key::NavigationPageUp.GetName() }, - { "left", InputDeviceKeyboard::Key::NavigationArrowLeft.GetName() }, - { "right", InputDeviceKeyboard::Key::NavigationArrowRight.GetName() }, - { "end", InputDeviceKeyboard::Key::NavigationEnd.GetName() }, - { "down", InputDeviceKeyboard::Key::NavigationArrowDown.GetName() }, - { "pgdn", InputDeviceKeyboard::Key::NavigationPageDown.GetName() }, - { "insert", InputDeviceKeyboard::Key::NavigationInsert.GetName() }, - { "delete", InputDeviceKeyboard::Key::NavigationDelete.GetName() }, - { "oem_102", InputDeviceKeyboard::Key::SupplementaryISO.GetName() }, - - { "gamepad_a", InputDeviceGamepad::Button::A.GetName() }, - { "gamepad_b", InputDeviceGamepad::Button::B.GetName() }, - { "gamepad_x", InputDeviceGamepad::Button::X.GetName() }, - { "gamepad_y", InputDeviceGamepad::Button::Y.GetName() }, - { "gamepad_l1", InputDeviceGamepad::Button::L1.GetName() }, - { "gamepad_r1", InputDeviceGamepad::Button::R1.GetName() }, - { "gamepad_l2", InputDeviceGamepad::Trigger::L2.GetName() }, - { "gamepad_r2", InputDeviceGamepad::Trigger::R2.GetName() }, - { "gamepad_l3", InputDeviceGamepad::Button::L3.GetName() }, - { "gamepad_r3", InputDeviceGamepad::Button::R3.GetName() }, - { "gamepad_up", InputDeviceGamepad::Button::DU.GetName() }, - { "gamepad_down", InputDeviceGamepad::Button::DD.GetName() }, - { "gamepad_left", InputDeviceGamepad::Button::DL.GetName() }, - { "gamepad_right", InputDeviceGamepad::Button::DR.GetName() }, - { "gamepad_start", InputDeviceGamepad::Button::Start.GetName() }, - { "gamepad_select", InputDeviceGamepad::Button::Select.GetName() }, - { "gamepad_sticklx", InputDeviceGamepad::ThumbStickAxis1D::LX.GetName() }, - { "gamepad_stickly", InputDeviceGamepad::ThumbStickAxis1D::LY.GetName() }, - { "gamepad_stickrx", InputDeviceGamepad::ThumbStickAxis1D::RX.GetName() }, - { "gamepad_stickry", InputDeviceGamepad::ThumbStickAxis1D::RY.GetName() }, - - // Additional platform device configurations may be added here - - { "OculusTouch_A", "oculus_button_a" }, - { "OculusTouch_B", "oculus_button_b" }, - { "OculusTouch_X", "oculus_button_x" }, - { "OculusTouch_Y", "oculus_button_y" }, - { "OculusTouch_LeftThumbstickButton", "oculus_button_l3" }, - { "OculusTouch_RightThumbstickButton", "oculus_button_r3" }, - { "OculusTouch_LeftTrigger", "oculus_trigger_l1" }, - { "OculusTouch_RightTrigger", "oculus_trigger_r1" }, - { "OculusTouch_LeftHandTrigger", "oculus_trigger_l2" }, - { "OculusTouch_RightHandTrigger", "oculus_trigger_r2" }, - { "OculusTouch_LeftThumbstickX", "oculus_thumbstick_l_x" }, - { "OculusTouch_LeftThumbstickY", "oculus_thumbstick_l_y" }, - { "OculusTouch_RightThumbstickX", "oculus_thumbstick_r_x" }, - { "OculusTouch_RightThumbstickY", "oculus_thumbstick_r_y" }, - - { "OpenVR_A_0", "openvr_button_a_l" }, - { "OpenVR_A_1", "openvr_button_a_r" }, - { "OpenVR_DPadUp_0", "openvr_button_d_up_l" }, - { "OpenVR_DPadDown_0", "openvr_button_d_down_l" }, - { "OpenVR_DPadLeft_0", "openvr_button_d_left_l" }, - { "OpenVR_DPadRight_0", "openvr_button_d_right_l" }, - { "OpenVR_DPadUp_1", "openvr_button_d_up_r" }, - { "OpenVR_DPadDown_1", "openvr_button_d_down_r" }, - { "OpenVR_DPadLeft_1", "openvr_button_d_left_r" }, - { "OpenVR_DPadRight_1", "openvr_button_d_right_r" }, - { "OpenVR_Grip_0", "openvr_button_grip_l" }, - { "OpenVR_Grip_1", "openvr_button_grip_r" }, - { "OpenVR_Application_0", "openvr_button_start_l" }, - { "OpenVR_Application_1", "openvr_button_start_r" }, - { "OpenVR_System_0", "openvr_button_select_l" }, - { "OpenVR_System_1", "openvr_button_select_r" }, - { "OpenVR_TriggerButton_0", "openvr_button_trigger_l" }, - { "OpenVR_TriggerButton_1", "openvr_button_trigger_r" }, - { "OpenVR_TouchpadButton_0", "openvr_button_touchpad_l" }, - { "OpenVR_TouchpadButton_1", "openvr_button_touchpad_r" }, - { "OpenVR_Trigger_0", "openvr_trigger_l1" }, - { "OpenVR_Trigger_1", "openvr_trigger_r1" }, - { "OpenVR_TouchpadX_0", "openvr_touchpad_l_x" }, - { "OpenVR_TouchpadY_0", "openvr_touchpad_l_y" }, - { "OpenVR_TouchpadX_1", "openvr_touchpad_r_x" }, - { "OpenVR_TouchpadY_1", "openvr_touchpad_r_y" } - }; - - const auto& it = map.find(inputEventName.c_str()); - return it != map.end() ? it->second.c_str() : inputEventName.c_str(); - } -} // namespace Input From b442cb9b3a6e5442c7707f4d69b9013ba744e61f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:56:14 -0800 Subject: [PATCH 331/620] Removes unused files from Gems/StartingPointMovement Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../StartingPointMovement/Code/CMakeLists.txt | 2 -- .../StartingPointMovementConstants.h | 21 -------------- .../StartingPointMovementUtilities.h | 29 ------------------- .../startingpointmovement_shared_files.cmake | 2 -- 4 files changed, 54 deletions(-) delete mode 100644 Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementConstants.h delete mode 100644 Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementUtilities.h diff --git a/Gems/StartingPointMovement/Code/CMakeLists.txt b/Gems/StartingPointMovement/Code/CMakeLists.txt index 1225c922de..cef65f0574 100644 --- a/Gems/StartingPointMovement/Code/CMakeLists.txt +++ b/Gems/StartingPointMovement/Code/CMakeLists.txt @@ -14,8 +14,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE AZ::AzCore diff --git a/Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementConstants.h b/Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementConstants.h deleted file mode 100644 index 9cc3c48c79..0000000000 --- a/Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementConstants.h +++ /dev/null @@ -1,21 +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 - * - */ -#pragma once - -namespace Movement -{ - ////////////////////////////////////////////////////////////////////////// - /// These are intended to be used as an index and needs to be implicitly - /// convertible to int. See StartingPointMovementUtilities.h for examples - enum AxisOfRotation - { - X_Axis = 0, - Y_Axis = 1, - Z_Axis = 2 - }; -} //namespace Movement diff --git a/Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementUtilities.h b/Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementUtilities.h deleted file mode 100644 index a7799a4caf..0000000000 --- a/Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementUtilities.h +++ /dev/null @@ -1,29 +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 - * - */ -#pragma once -#include -#include "StartingPointMovement/StartingPointMovementConstants.h" -#include -#include - -namespace Movement -{ - ////////////////////////////////////////////////////////////////////////// - /// This will calculate an AZ::Transform based on an axis of rotation and an angle - ////////////////////////////////////////////////////////////////////////// - static AZ::Transform CreateRotationFromAxis(AxisOfRotation rotationType, float radians) - { - static const AZ::Transform(*s_createRotation[3]) (const float) = - { - &AZ::Transform::CreateRotationX, - &AZ::Transform::CreateRotationY, - &AZ::Transform::CreateRotationZ - }; - return s_createRotation[rotationType](radians); - } -} //namespace Movement diff --git a/Gems/StartingPointMovement/Code/startingpointmovement_shared_files.cmake b/Gems/StartingPointMovement/Code/startingpointmovement_shared_files.cmake index 9d15aad6ff..e807bfe31f 100644 --- a/Gems/StartingPointMovement/Code/startingpointmovement_shared_files.cmake +++ b/Gems/StartingPointMovement/Code/startingpointmovement_shared_files.cmake @@ -8,6 +8,4 @@ set(FILES Source/StartingPointMovementGem.cpp - Include/StartingPointMovement/StartingPointMovementConstants.h - Include/StartingPointMovement/StartingPointMovementUtilities.h ) From 064a7f0b9ba3ff4d1acd766941be618d700d870c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:57:43 -0800 Subject: [PATCH 332/620] Removes FuelInterface from Gems/Twitch Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/Twitch/Code/Source/FuelInterface.h | 18 ------------------ Gems/Twitch/Code/Source/IFuelInterface.h | 21 --------------------- 2 files changed, 39 deletions(-) delete mode 100644 Gems/Twitch/Code/Source/FuelInterface.h delete mode 100644 Gems/Twitch/Code/Source/IFuelInterface.h diff --git a/Gems/Twitch/Code/Source/FuelInterface.h b/Gems/Twitch/Code/Source/FuelInterface.h deleted file mode 100644 index 560161083f..0000000000 --- a/Gems/Twitch/Code/Source/FuelInterface.h +++ /dev/null @@ -1,18 +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 - * - */ - -#pragma once - -namespace Twitch -{ - class AZ_DEPRECATED(, "The FuelInterface has been deprecated. HTTPRequest functionality has been moved to TwitchREST. Auth has been mvoed to TwitchSystemComponent. All remaining has been deprecated.") - FuelInterface - { - - }; -} diff --git a/Gems/Twitch/Code/Source/IFuelInterface.h b/Gems/Twitch/Code/Source/IFuelInterface.h deleted file mode 100644 index bc2e4a7c5a..0000000000 --- a/Gems/Twitch/Code/Source/IFuelInterface.h +++ /dev/null @@ -1,21 +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 - * - */ - -#pragma once - -#include -#include - -namespace Twitch -{ - class AZ_DEPRECATED(,"The IFuelInterface has been deprecated. HTTPRequest functionality has been moved to TwitchREST. Auth has been mvoed to TwitchSystemComponent. All remaining has been deprecated.") - IFuelInterface - { - - }; -} From ff6f6689a16e15eae9e8ea8b343fd0ed44c7927a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:00:35 -0800 Subject: [PATCH 333/620] Removes DependencyRequestBus from Gems/Vegetation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Vegetation/Ebuses/DependencyRequestBus.h | 32 ------------------- Gems/Vegetation/Code/Tests/VegetationMocks.h | 1 - Gems/Vegetation/Code/vegetation_files.cmake | 1 - 3 files changed, 34 deletions(-) delete mode 100644 Gems/Vegetation/Code/Include/Vegetation/Ebuses/DependencyRequestBus.h diff --git a/Gems/Vegetation/Code/Include/Vegetation/Ebuses/DependencyRequestBus.h b/Gems/Vegetation/Code/Include/Vegetation/Ebuses/DependencyRequestBus.h deleted file mode 100644 index e143d3d8cf..0000000000 --- a/Gems/Vegetation/Code/Include/Vegetation/Ebuses/DependencyRequestBus.h +++ /dev/null @@ -1,32 +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 - * - */ - -#pragma once - -#include -#include -#include -#include - -namespace Vegetation -{ - /** - * the EBus is used to query entity and asset dependencies - */ - class DependencyRequests : public AZ::ComponentBus - { - public: - //! allows multiple threads to call - using MutexType = AZStd::recursive_mutex; - - virtual void GetEntityDependencies(AZStd::vector& dependencies) const = 0; - virtual void GetAssetDependencies(AZStd::vector& dependencies) const = 0; - }; - - typedef AZ::EBus DependencyRequestBus; -} diff --git a/Gems/Vegetation/Code/Tests/VegetationMocks.h b/Gems/Vegetation/Code/Tests/VegetationMocks.h index 3361afa177..a3bd80392d 100644 --- a/Gems/Vegetation/Code/Tests/VegetationMocks.h +++ b/Gems/Vegetation/Code/Tests/VegetationMocks.h @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/Vegetation/Code/vegetation_files.cmake b/Gems/Vegetation/Code/vegetation_files.cmake index b4d4e3a356..b839222b19 100644 --- a/Gems/Vegetation/Code/vegetation_files.cmake +++ b/Gems/Vegetation/Code/vegetation_files.cmake @@ -24,7 +24,6 @@ set(FILES Include/Vegetation/Ebuses/DebugNotificationBus.h Include/Vegetation/Ebuses/DebugRequestsBus.h Include/Vegetation/Ebuses/DebugSystemDataBus.h - Include/Vegetation/Ebuses/DependencyRequestBus.h Include/Vegetation/Ebuses/DescriptorNotificationBus.h Include/Vegetation/Ebuses/DescriptorProviderRequestBus.h Include/Vegetation/Ebuses/DescriptorSelectorRequestBus.h From 223baa7e458b3f6db1fb5cf8e2d77235c68a3944 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:04:46 -0800 Subject: [PATCH 334/620] Removes ProducerConsumerQueue.h and ConcurrentQueue.h from Gems/Vegetation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Source/Util/ConcurrentQueue.h | 80 ------------ .../Code/Source/Util/ProducerConsumerQueue.h | 119 ------------------ Gems/Vegetation/Code/vegetation_files.cmake | 2 - 3 files changed, 201 deletions(-) delete mode 100644 Gems/Vegetation/Code/Source/Util/ConcurrentQueue.h delete mode 100644 Gems/Vegetation/Code/Source/Util/ProducerConsumerQueue.h diff --git a/Gems/Vegetation/Code/Source/Util/ConcurrentQueue.h b/Gems/Vegetation/Code/Source/Util/ConcurrentQueue.h deleted file mode 100644 index 38a816808d..0000000000 --- a/Gems/Vegetation/Code/Source/Util/ConcurrentQueue.h +++ /dev/null @@ -1,80 +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 - * - */ -#pragma once - -#include -#include -#include - -namespace Vegetation -{ - /** - * Manages a light weight producer consumer storage container - */ - template > - class ConcurrentQueue final - { - public: - AZ_INLINE QueueType& ClaimQueue() - { - int lastQueue = Flip(); - return m_queueData[lastQueue]; - } - - AZ_INLINE QueueType& ClaimQueueNoSort() - { - int lastQueue = FlipNoSort(); - return m_queueData[lastQueue]; - } - - AZ_INLINE bool IsCurrentEmpty() const - { - return m_queueData[m_currentQueueIndex].empty(); - } - - AZ_INLINE void EmplaceBack(TItem item) - { - m_queueData[m_currentQueueIndex].emplace_back(AZStd::move(item)); - } - - AZ_INLINE void CopyBack(TItem item) - { - m_queueData[m_currentQueueIndex].push_back(item); - } - - AZ_INLINE void Insert(TItem item) - { - m_queueData[m_currentQueueIndex].insert(item); - } - - protected: - AZ_INLINE int Flip() - { - // get rid of possible duplicates - int processIndex = FlipNoSort(); - m_queueData[processIndex].sort(); - m_queueData[processIndex].unique(); - return processIndex; - } - - AZ_INLINE int FlipNoSort() - { - int processIndex = m_currentQueueIndex; - { - AZStd::lock_guard lock(m_queueMutex); - m_currentQueueIndex = 1 - m_currentQueueIndex; - } - return processIndex; - } - - private: - QueueType m_queueData[2]; - AZStd::atomic_int m_currentQueueIndex{0}; - AZStd::recursive_mutex m_queueMutex; - }; -} diff --git a/Gems/Vegetation/Code/Source/Util/ProducerConsumerQueue.h b/Gems/Vegetation/Code/Source/Util/ProducerConsumerQueue.h deleted file mode 100644 index 55e6385b93..0000000000 --- a/Gems/Vegetation/Code/Source/Util/ProducerConsumerQueue.h +++ /dev/null @@ -1,119 +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 - * - */ -#pragma once - -#include -#include -#include -#include -#include "ConcurrentQueue.h" - -namespace Vegetation -{ - /** - * A simple producer-consumer class to handle dual-threaded working queues - */ - template , typename ConsumerQueueType = AZStd::list> - class ProducerConsumerQueue final - { - public: - AZ_INLINE void EmplaceBack(TItem item) - { - m_producerQueue.EmplaceBack(AZStd::move(item)); - } - - AZ_INLINE void CopyBack(TItem item) - { - m_producerQueue.CopyBack(item); - } - - AZ_INLINE bool IsEmpty() const - { - if (m_producerQueue.IsCurrentEmpty()) - { - AZStd::lock_guard lock(m_consumerQueueMutex); - return m_consumerQueue.empty(); - } - return false; - } - - using ItemFunc = AZStd::function; - using ContinueFunc = AZStd::function; - - // on ItemFunc return TRUE, remove from consumer queue - AZ_INLINE void Consume(ItemFunc consumeItemFunc, ContinueFunc continueFunc) - { - if (CanConsume()) - { - PrepareConsumer(); - } - - // attempt to consume the items - AZStd::lock_guard lock(m_consumerQueueMutex); - auto itItem = m_consumerQueue.begin(); - while (itItem != m_consumerQueue.end()) - { - if (consumeItemFunc(*itItem)) - { - itItem = m_consumerQueue.erase(itItem); - } - else - { - ++itItem; - } - if (!continueFunc()) - { - break; - } - } - } - - // on ItemFunc return TRUE, stop processing - AZ_INLINE void Process(ItemFunc processItemFunc) - { - if (CanConsume()) - { - PrepareConsumer(); - } - - // process the locked queue - AZStd::lock_guard lock(m_consumerQueueMutex); - auto itItem = m_consumerQueue.begin(); - while (itItem != m_consumerQueue.end()) - { - if (processItemFunc(*itItem)) - { - break; - } - ++itItem; - } - } - - protected: - AZ_INLINE bool CanConsume() const - { - return !m_producerQueue.IsCurrentEmpty(); - } - - AZ_INLINE void PrepareConsumer() - { - AZStd::lock_guard lock(m_consumerQueueMutex); - auto& itemList = m_producerQueue.ClaimQueueNoSort(); - while (!itemList.empty()) - { - m_consumerQueue.emplace_back(AZStd::move(itemList.back())); - itemList.pop_back(); - } - } - - private: - ProducerQueueType m_producerQueue; - ConsumerQueueType m_consumerQueue; - mutable AZStd::recursive_mutex m_consumerQueueMutex; - }; -} diff --git a/Gems/Vegetation/Code/vegetation_files.cmake b/Gems/Vegetation/Code/vegetation_files.cmake index b839222b19..b4e90cab97 100644 --- a/Gems/Vegetation/Code/vegetation_files.cmake +++ b/Gems/Vegetation/Code/vegetation_files.cmake @@ -87,8 +87,6 @@ set(FILES Source/Components/SurfaceMaskFilterComponent.h Source/Components/SurfaceSlopeFilterComponent.cpp Source/Components/SurfaceSlopeFilterComponent.h - Source/Util/ConcurrentQueue.h - Source/Util/ProducerConsumerQueue.h Source/Debugger/AreaDebugComponent.cpp Source/Debugger/AreaDebugComponent.h Source/Debugger/DebugComponent.cpp From c1d2da990a6d355df30471a957623e600d5b1e67 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:11:39 -0800 Subject: [PATCH 335/620] Removes WhiteBoxAllocator and EditorWhiteBoxBus from Gems/WhiteBox Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Include/WhiteBox/EditorWhiteBoxBus.h | 28 --------------- .../Code/Source/WhiteBoxAllocator.cpp | 13 ------- Gems/WhiteBox/Code/Source/WhiteBoxAllocator.h | 34 ------------------- Gems/WhiteBox/Code/Source/WhiteBoxModule.cpp | 4 --- .../whitebox_editor_supported_files.cmake | 1 - .../Code/whitebox_supported_files.cmake | 2 -- 6 files changed, 82 deletions(-) delete mode 100644 Gems/WhiteBox/Code/Include/WhiteBox/EditorWhiteBoxBus.h delete mode 100644 Gems/WhiteBox/Code/Source/WhiteBoxAllocator.cpp delete mode 100644 Gems/WhiteBox/Code/Source/WhiteBoxAllocator.h diff --git a/Gems/WhiteBox/Code/Include/WhiteBox/EditorWhiteBoxBus.h b/Gems/WhiteBox/Code/Include/WhiteBox/EditorWhiteBoxBus.h deleted file mode 100644 index 841d86003e..0000000000 --- a/Gems/WhiteBox/Code/Include/WhiteBox/EditorWhiteBoxBus.h +++ /dev/null @@ -1,28 +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 - * - */ - -#pragma once - -#include - -namespace WhiteBox -{ - //! EditorWhiteBox system level requests. - class EditorWhiteBoxRequests : public AZ::EBusTraits - { - public: - // EBusTraits overrides ... - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - - protected: - ~EditorWhiteBoxRequests() = default; - }; - - using EditorWhiteBoxRequestBus = AZ::EBus; -} // namespace WhiteBox diff --git a/Gems/WhiteBox/Code/Source/WhiteBoxAllocator.cpp b/Gems/WhiteBox/Code/Source/WhiteBoxAllocator.cpp deleted file mode 100644 index a0c873d14a..0000000000 --- a/Gems/WhiteBox/Code/Source/WhiteBoxAllocator.cpp +++ /dev/null @@ -1,13 +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 - * - */ - -#include "WhiteBoxAllocator.h" - -namespace WhiteBox -{ -} // namespace WhiteBox diff --git a/Gems/WhiteBox/Code/Source/WhiteBoxAllocator.h b/Gems/WhiteBox/Code/Source/WhiteBoxAllocator.h deleted file mode 100644 index a66c6d021b..0000000000 --- a/Gems/WhiteBox/Code/Source/WhiteBoxAllocator.h +++ /dev/null @@ -1,34 +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 - * - */ - -#pragma once - -#include -#include - -namespace WhiteBox -{ - //! White Box Gem allocator for all default allocations. - class WhiteBoxAllocator : public AZ::SimpleSchemaAllocator> - { - public: - AZ_TYPE_INFO(WhiteBoxAllocator, "{BFEB8C64-FDB7-4A19-B9B4-DDF57A434F14}"); - - using Schema = AZ::ChildAllocatorSchema; - using Base = AZ::SimpleSchemaAllocator; - using Descriptor = Base::Descriptor; - - WhiteBoxAllocator() - : Base("White Box Allocator", "Child Allocator used to track White Box allocations") - { - } - }; - - //! Alias for using WhiteBoxAllocator with std container types. - using WhiteBoxAZStdAlloc = AZ::AZStdAlloc; -} // namespace WhiteBox diff --git a/Gems/WhiteBox/Code/Source/WhiteBoxModule.cpp b/Gems/WhiteBox/Code/Source/WhiteBoxModule.cpp index b0723667e9..27def67f1a 100644 --- a/Gems/WhiteBox/Code/Source/WhiteBoxModule.cpp +++ b/Gems/WhiteBox/Code/Source/WhiteBoxModule.cpp @@ -7,7 +7,6 @@ */ #include "Components/WhiteBoxColliderComponent.h" -#include "WhiteBoxAllocator.h" #include "WhiteBoxComponent.h" #include "WhiteBoxModule.h" #include "WhiteBoxSystemComponent.h" @@ -19,8 +18,6 @@ namespace WhiteBox WhiteBoxModule::WhiteBoxModule() : CryHooksModule() { - AZ::AllocatorInstance::Create(); - // push results of [MyComponent]::CreateDescriptor() into m_descriptors here m_descriptors.insert( m_descriptors.end(), @@ -33,7 +30,6 @@ namespace WhiteBox WhiteBoxModule::~WhiteBoxModule() { - AZ::AllocatorInstance::Destroy(); } AZ::ComponentTypeList WhiteBoxModule::GetRequiredSystemComponents() const diff --git a/Gems/WhiteBox/Code/whitebox_editor_supported_files.cmake b/Gems/WhiteBox/Code/whitebox_editor_supported_files.cmake index ac4746b5a7..71dc8b9289 100644 --- a/Gems/WhiteBox/Code/whitebox_editor_supported_files.cmake +++ b/Gems/WhiteBox/Code/whitebox_editor_supported_files.cmake @@ -7,7 +7,6 @@ # set(FILES - Include/WhiteBox/EditorWhiteBoxBus.h Include/WhiteBox/EditorWhiteBoxComponentBus.h Include/WhiteBox/WhiteBoxToolApi.h Include/WhiteBox/EditorWhiteBoxColliderBus.h diff --git a/Gems/WhiteBox/Code/whitebox_supported_files.cmake b/Gems/WhiteBox/Code/whitebox_supported_files.cmake index 87eb594eb5..faf054c9d6 100644 --- a/Gems/WhiteBox/Code/whitebox_supported_files.cmake +++ b/Gems/WhiteBox/Code/whitebox_supported_files.cmake @@ -8,8 +8,6 @@ set(FILES Include/WhiteBox/WhiteBoxBus.h - Source/WhiteBoxAllocator.cpp - Source/WhiteBoxAllocator.h Source/WhiteBoxComponent.cpp Source/WhiteBoxComponent.h Source/WhiteBoxSystemComponent.cpp From ef9e95c1db715a612ef7cb6870014d4be4e65727 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:12:17 -0800 Subject: [PATCH 336/620] More improvements to the unused_compilation script Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 4515a663af..1bd69d496f 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -20,11 +20,15 @@ EXCLUSIONS = ( 'REGISTER_QT_CLASS_DESC(', 'TEST(', 'TEST_F(', + 'TEST_P(', 'INSTANTIATE_TEST_CASE_P(', 'INSTANTIATE_TYPED_TEST_CASE_P(', 'AZ_UNIT_TEST_HOOK(', 'IMPLEMENT_TEST_EXECUTABLE_MAIN(', + 'BENCHMARK_REGISTER_F(', 'DllMain(', + 'wWinMain(', + 'AZ_DLL_EXPORT', 'CreatePluginInstance(' ) PATH_EXCLUSIONS = ( @@ -37,7 +41,9 @@ PATH_EXCLUSIONS = ( 'python\\*', 'build\\*', 'install\\*', - 'Code\\Framework\\AzCore\\AzCore\\Android\\*' + 'Code\\Framework\\AzCore\\AzCore\\Android\\*', + 'Gems\\ImGui\\External\\ImGui\\*', + '*_Traits_*.h', ) @@ -104,7 +110,7 @@ def cleanup_unused_compilation(path): with open(file, 'w') as source_file: source_file.write('') # d. build - ret = ci_build.build('build_config.json', 'Windows', 'profile_vs2019') + ret = ci_build.build('build_config.json', 'Windows', 'profile') # e.1 if build succeeds, leave the file empty (leave backup) # e.2 if build fails, restore backup if ret != 0: From 4800aebe6583b3c5493cb22bdad734e4a80a6fdf Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 20 Jan 2022 15:46:15 -0800 Subject: [PATCH 337/620] Removes file that was removed but got missing after rebase Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake | 1 - Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake | 1 - 2 files changed, 2 deletions(-) diff --git a/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake b/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake index 72a26c2884..222eebc6e9 100644 --- a/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake +++ b/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake @@ -9,7 +9,6 @@ set(FILES LmbrCentralEditorTest.cpp LmbrCentralReflectionTest.h - LmbrCentralReflectionTest.cpp EditorBoxShapeComponentTests.cpp EditorSphereShapeComponentTests.cpp EditorCapsuleShapeComponentTests.cpp diff --git a/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake b/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake index 1555ff53d8..485fd77b61 100644 --- a/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake +++ b/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake @@ -18,7 +18,6 @@ set(FILES QuadShapeTest.cpp TubeShapeTest.cpp LmbrCentralReflectionTest.h - LmbrCentralReflectionTest.cpp LmbrCentralTest.cpp ShapeGeometryUtilTest.cpp SpawnerComponentTest.cpp From 44c6ca294d4f106b9cb9bde3885f593f56ff3065 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 20 Jan 2022 16:05:55 -0800 Subject: [PATCH 338/620] Fixes for rebasing Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/ErrorReport.h | 3 --- Code/Editor/IEditorImpl.cpp | 1 + Code/Legacy/CrySystem/System.cpp | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Code/Editor/ErrorReport.h b/Code/Editor/ErrorReport.h index 2ede92a8fe..a80bb36404 100644 --- a/Code/Editor/ErrorReport.h +++ b/Code/Editor/ErrorReport.h @@ -17,9 +17,6 @@ // forward declarations. class CParticleItem; -#include "BaseLibraryItem.h" -#include - #include "Objects/BaseObject.h" #include "Include/EditorCoreAPI.h" #include "Include/IErrorReport.h" diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index fc18e1f4c3..ec688b27c7 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -12,6 +12,7 @@ #include "EditorDefs.h" #include "IEditorImpl.h" +#include // Qt #include diff --git a/Code/Legacy/CrySystem/System.cpp b/Code/Legacy/CrySystem/System.cpp index a5cee3a6b6..0b82eded4e 100644 --- a/Code/Legacy/CrySystem/System.cpp +++ b/Code/Legacy/CrySystem/System.cpp @@ -461,6 +461,9 @@ bool CSystem::IsQuitting() const bool wasExitMainLoopRequested = false; AzFramework::ApplicationRequests::Bus::BroadcastResult(wasExitMainLoopRequested, &AzFramework::ApplicationRequests::WasExitMainLoopRequested); return wasExitMainLoopRequested; +} + +////////////////////////////////////////////////////////////////////////// ISystem* CSystem::GetCrySystem() { return this; From b9ba9f5ca83f31687f6b3c94e092e8c49759fb8d Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 20 Jan 2022 16:11:31 -0800 Subject: [PATCH 339/620] Got RPI unit tests building and passing again. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../RPI.Edit/Material/MaterialPropertyId.cpp | 4 +++- .../RPI.Edit/Material/MaterialSourceData.cpp | 6 +++--- .../Material/MaterialTypeSourceData.cpp | 17 +++++++++++------ .../Tests/Material/MaterialSourceDataTests.cpp | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp index 4880de33fe..d123fe33b7 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp @@ -99,7 +99,9 @@ namespace AZ } } - AzFramework::StringFunc::Join(m_fullName, names.begin(), names.end(), "."); + AZStd::string fullName; // m_fullName is a Name, not a string, so we have to join into a local variable temporarily. + AzFramework::StringFunc::Join(fullName, names.begin(), names.end(), "."); + m_fullName = fullName; } MaterialPropertyId::operator const Name&() const diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp index b921b186c0..2fa4ff648e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp @@ -340,16 +340,16 @@ namespace AZ if (result == MaterialUtils::GetImageAssetResult::Missing) { materialAssetCreator.ReportWarning( - "Material property '%s': Could not find the image '%s'", propertyId.GetFullName().GetCStr(), + "Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), property.second.m_value.GetValue().data()); } imageAsset.SetAutoLoadBehavior(Data::AssetLoadBehavior::PreLoad); - materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAsset); + materialAssetCreator.SetPropertyValue(propertyId, imageAsset); } else { - materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), property.second.m_value); + materialAssetCreator.SetPropertyValue(propertyId, property.second.m_value); } } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index ddc2bc842b..3a5992f8dd 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -140,7 +140,7 @@ namespace AZ { if (action.m_operation == "rename") { - if (action.m_renameFrom == propertyId.GetFullName().GetStringView()) + if (action.m_renameFrom == propertyId.GetStringView()) { propertyId = MaterialPropertyId::Parse(action.m_renameTo); renamed = true; @@ -177,14 +177,19 @@ namespace AZ // Do the search again with the new names - groupIter = m_propertyLayout.m_properties.find(propertyId.GetGroupName().GetStringView()); - if (groupIter != m_propertyLayout.m_properties.end()) + AZStd::vector tokens; + AZ::StringFunc::Tokenize(propertyId.GetStringView(), tokens, ".", true, true); + if (tokens.size() == 2) { - for (const PropertyDefinition& property : groupIter->second) + groupIter = m_propertyLayout.m_properties.find(tokens[0]); + if (groupIter != m_propertyLayout.m_properties.end()) { - if (property.m_name == propertyId.GetPropertyName().GetStringView()) + for (const PropertyDefinition& property : groupIter->second) { - return &property; + if (property.m_name == tokens[1]) + { + return &property; + } } } } diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp index 5e09fe6612..94518c6aef 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp @@ -905,7 +905,7 @@ namespace UnitTest JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); auto materialAssetResult = material.CreateMaterialAsset(Uuid::CreateRandom(), "test.material", AZ::RPI::MaterialAssetProcessingMode::PreBake); EXPECT_TRUE(materialAssetResult); - MaterialPropertyIndex propertyIndex = materialAssetResult.GetValue()->GetMaterialPropertiesLayout()->FindPropertyIndex(MaterialPropertyId{groupName, propertyName}.GetFullName()); + MaterialPropertyIndex propertyIndex = materialAssetResult.GetValue()->GetMaterialPropertiesLayout()->FindPropertyIndex(MaterialPropertyId{groupName, propertyName}); CheckSimilar(expectedFinalValue, materialAssetResult.GetValue()->GetPropertyValues()[propertyIndex.GetIndex()].GetValue()); } From b98b240a4001a7928d89facc9303aa9e20453568 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 20 Jan 2022 18:16:51 -0800 Subject: [PATCH 340/620] Entity Reference P1 initial tests Signed-off-by: Scott Murray --- .../Atom/atom_utils/atom_constants.py | 2 + ...omEditorComponents_EntityReferenceAdded.py | 101 ++++++++++++++++-- 2 files changed, 92 insertions(+), 11 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py index e6d6ac7fb1..c3404c1e94 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py @@ -195,11 +195,13 @@ class AtomComponentProperties: def entity_reference(property: str = 'name') -> str: """ Entity Reference component properties. + - 'EntityIdReferences' component container of entityId references. Initially empty. :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ properties = { 'name': 'Entity Reference', + 'EntityIdReferences': 'Controller|Configuration|EntityIdReferences', } return properties[property] diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py index dddcca64fa..9dc4869f66 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py @@ -9,37 +9,55 @@ SPDX-License-Identifier: Apache-2.0 OR MIT class Tests: creation_undo = ( "UNDO Entity creation success", - "UNDO Entity creation failed") + "P0: UNDO Entity creation failed") creation_redo = ( "REDO Entity creation success", - "REDO Entity creation failed") + "P0: REDO Entity creation failed") entity_reference_creation = ( "Entity Reference Entity successfully created", - "Entity Reference Entity failed to be created") + "P0: Entity Reference Entity failed to be created") entity_reference_component = ( "Entity has an Entity Reference component", - "Entity failed to find Entity Reference component") + "P0: Entity failed to find Entity Reference component") enter_game_mode = ( "Entered game mode", - "Failed to enter game mode") + "P0: Failed to enter game mode") exit_game_mode = ( "Exited game mode", - "Couldn't exit game mode") + "P0: Couldn't exit game mode") is_visible = ( "Entity is visible", - "Entity was not visible") + "P0: Entity was not visible") is_hidden = ( "Entity is hidden", - "Entity was not hidden") + "P0: Entity was not hidden") entity_deleted = ( "Entity deleted", - "Entity was not deleted") + "P0: Entity was not deleted") deletion_undo = ( "UNDO deletion success", - "UNDO deletion failed") + "P0: UNDO deletion failed") deletion_redo = ( "REDO deletion success", - "REDO deletion failed") + "P0: REDO deletion failed") + entity_id_references_is_container = ( + "EntityIdReferences is a container property", + "P1: EntityIdReferences is NOT a container property") + container_append = ( + "EntityIdReferences append succeeded", + "P1: EntityIdReferences append did not succeed") + container_add = ( + "EntityIdReferences add succeeded", + "P1: EntityIdReferences add did not succeed") + container_update = ( + "EntityIdReferences update succeeded", + "P1: EntityIdReferences update did not succeed") + container_remove = ( + "EntityIdReferences remove succeeded", + "P1: EntityIdReferences remove did not succeed") + container_reset = ( + "EntityIdReferences reset succeeded", + "P1: EntityIdReferences reset did not succeed") def AtomEditorComponents_EntityReference_AddedToEntity(): @@ -119,6 +137,67 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): general.idle_wait_frames(1) Report.result(Tests.creation_redo, entity_reference_entity.exists()) + # Entities for EntityIdReferences tests + test_1 = EditorEntity.create_editor_entity('test_1') + test_2 = EditorEntity.create_editor_entity('test_2') + test_3 = EditorEntity.create_editor_entity('test_3') + + # is container property + Report.result( + Tests.entity_id_references_is_container, + entity_reference_component.is_property_container( + AtomComponentProperties.entity_reference('EntityIdReferences'))) + + # Append entity reference to container + entity_reference_component.append_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), + test_1.id) + Report.result( + Tests.container_append, + entity_reference_component.get_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), 0) == test_1.id) + + # Add entity reference to container + entity_reference_component.add_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), + 1, test_1.id) + Report.result( + Tests.container_add, + entity_reference_component.get_container_count( + AtomComponentProperties.entity_reference('EntityIdReferences')) == 2 + ) + + # Update entity reference + entity_reference_component.update_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), + 1, test_2.id) + Report.result( + Tests.container_update, + entity_reference_component.get_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), 1) == test_2.id) + + # Remove entity reference + entity_reference_component.append_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), + test_3.id) + count_before = entity_reference_component.get_container_count( + AtomComponentProperties.entity_reference('EntityIdReferences')) + entity_reference_component.remove_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), + 1) + count_after = entity_reference_component.get_container_count( + AtomComponentProperties.entity_reference('EntityIdReferences')) + remove_count = (count_before == 3) and (count_after == 2) + Report.result( + Tests.container_remove, + ((count_before == 3) and (count_after == 2) and + (entity_reference_component.get_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), 1) == test_3.id)) + ) + + # Reset + entity_reference_component.reset_container(AtomComponentProperties.entity_reference('EntityIdReferences')) + Report.result( + Tests.container_reset, + entity_reference_component.get_container_count( + AtomComponentProperties.entity_reference('EntityIdReferences')) == 0 + ) + # 5. Enter/Exit game mode. TestHelper.enter_game_mode(Tests.enter_game_mode) general.idle_wait_frames(1) From 93358dcbeb5148ea76bbb8fc10f0e325dcfe3a83 Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Date: Fri, 21 Jan 2022 09:19:53 +0000 Subject: [PATCH 341/620] Cherry-pick of PR-6700 - Updates to ViewportTitleDlg to better expose grid snapping visualization (#6997) * cherry-pick of PR 6700 Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * revert title dialog look to old style Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- Code/Editor/ViewportTitleDlg.cpp | 65 ++++++++++++++++++++------------ Code/Editor/ViewportTitleDlg.h | 3 +- 2 files changed, 42 insertions(+), 26 deletions(-) diff --git a/Code/Editor/ViewportTitleDlg.cpp b/Code/Editor/ViewportTitleDlg.cpp index 75d16e9a40..12f47f70eb 100644 --- a/Code/Editor/ViewportTitleDlg.cpp +++ b/Code/Editor/ViewportTitleDlg.cpp @@ -229,25 +229,35 @@ void CViewportTitleDlg::SetupHelpersButton() void CViewportTitleDlg::SetupOverflowMenu() { - // Setup the overflow menu - QMenu* overFlowMenu = new QMenu(this); + // setup the overflow menu + auto overflowMenu = new QMenu(this); - m_audioMuteAction = new QAction("Mute Audio", overFlowMenu); + m_audioMuteAction = new QAction("Mute Audio", overflowMenu); connect(m_audioMuteAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedMuteAudio); - overFlowMenu->addAction(m_audioMuteAction); + overflowMenu->addAction(m_audioMuteAction); - m_enableVRAction = new QAction("Enable VR Preview", overFlowMenu); + m_enableVRAction = new QAction("Enable VR Preview", overflowMenu); connect(m_enableVRAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedEnableVR); - overFlowMenu->addAction(m_enableVRAction); + overflowMenu->addAction(m_enableVRAction); - overFlowMenu->addSeparator(); + overflowMenu->addSeparator(); - m_enableGridSnappingAction = new QAction("Enable Grid Snapping", overFlowMenu); + m_enableGridSnappingAction = new QAction("Enable Grid Snapping", overflowMenu); connect(m_enableGridSnappingAction, &QAction::triggered, this, &CViewportTitleDlg::OnGridSnappingToggled); m_enableGridSnappingAction->setCheckable(true); - overFlowMenu->addAction(m_enableGridSnappingAction); + overflowMenu->addAction(m_enableGridSnappingAction); - m_gridSizeActionWidget = new QWidgetAction(overFlowMenu); + m_enableGridVisualizationAction = new QAction("Show Grid", overflowMenu); + connect( + m_enableGridVisualizationAction, &QAction::triggered, + [] + { + SandboxEditor::SetShowingGrid(!SandboxEditor::ShowingGrid()); + }); + m_enableGridVisualizationAction->setCheckable(true); + overflowMenu->addAction(m_enableGridVisualizationAction); + + m_gridSizeActionWidget = new QWidgetAction(overflowMenu); m_gridSpinBox = new AzQtComponents::DoubleSpinBox(); m_gridSpinBox->setValue(SandboxEditor::GridSnappingSize()); m_gridSpinBox->setMinimum(1e-2f); @@ -257,31 +267,31 @@ void CViewportTitleDlg::SetupOverflowMenu() m_gridSpinBox, QOverload::of(&AzQtComponents::DoubleSpinBox::valueChanged), this, &CViewportTitleDlg::OnGridSpinBoxChanged); m_gridSizeActionWidget->setDefaultWidget(m_gridSpinBox); - overFlowMenu->addAction(m_gridSizeActionWidget); + overflowMenu->addAction(m_gridSizeActionWidget); - overFlowMenu->addSeparator(); + overflowMenu->addSeparator(); - m_enableAngleSnappingAction = new QAction("Enable Angle Snapping", overFlowMenu); + m_enableAngleSnappingAction = new QAction("Enable Angle Snapping", overflowMenu); connect(m_enableAngleSnappingAction, &QAction::triggered, this, &CViewportTitleDlg::OnAngleSnappingToggled); m_enableAngleSnappingAction->setCheckable(true); - overFlowMenu->addAction(m_enableAngleSnappingAction); + overflowMenu->addAction(m_enableAngleSnappingAction); - m_angleSizeActionWidget = new QWidgetAction(overFlowMenu); + m_angleSizeActionWidget = new QWidgetAction(overflowMenu); m_angleSpinBox = new AzQtComponents::DoubleSpinBox(); m_angleSpinBox->setValue(SandboxEditor::AngleSnappingSize()); m_angleSpinBox->setMinimum(1e-2f); - m_angleSpinBox->setToolTip(tr("Angle Snapping")); + m_angleSpinBox->setToolTip(tr("Angle size")); QObject::connect( m_angleSpinBox, QOverload::of(&AzQtComponents::DoubleSpinBox::valueChanged), this, &CViewportTitleDlg::OnAngleSpinBoxChanged); m_angleSizeActionWidget->setDefaultWidget(m_angleSpinBox); - overFlowMenu->addAction(m_angleSizeActionWidget); + overflowMenu->addAction(m_angleSizeActionWidget); - m_ui->m_overflowBtn->setMenu(overFlowMenu); + m_ui->m_overflowBtn->setMenu(overflowMenu); m_ui->m_overflowBtn->setPopupMode(QToolButton::InstantPopup); - connect(overFlowMenu, &QMenu::aboutToShow, this, &CViewportTitleDlg::UpdateOverFlowMenuState); + connect(overflowMenu, &QMenu::aboutToShow, this, &CViewportTitleDlg::UpdateOverFlowMenuState); UpdateMuteActionText(); } @@ -1004,31 +1014,36 @@ void CViewportTitleDlg::OnAngleSnappingToggled() MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapAngle)->trigger(); } -void CViewportTitleDlg::OnGridSpinBoxChanged(double value) +void CViewportTitleDlg::OnGridSpinBoxChanged(const double value) { - SandboxEditor::SetGridSnappingSize(static_cast(value)); + SandboxEditor::SetGridSnappingSize(aznumeric_cast(value)); } -void CViewportTitleDlg::OnAngleSpinBoxChanged(double value) +void CViewportTitleDlg::OnAngleSpinBoxChanged(const double value) { - SandboxEditor::SetAngleSnappingSize(static_cast(value)); + SandboxEditor::SetAngleSnappingSize(aznumeric_cast(value)); } void CViewportTitleDlg::UpdateOverFlowMenuState() { - bool gridSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapToGrid)->isChecked(); + const bool gridSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapToGrid)->isChecked(); { QSignalBlocker signalBlocker(m_enableGridSnappingAction); m_enableGridSnappingAction->setChecked(gridSnappingActive); } m_gridSizeActionWidget->setEnabled(gridSnappingActive); - bool angleSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapAngle)->isChecked(); + const bool angleSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapAngle)->isChecked(); { QSignalBlocker signalBlocker(m_enableAngleSnappingAction); m_enableAngleSnappingAction->setChecked(angleSnappingActive); } m_angleSizeActionWidget->setEnabled(angleSnappingActive); + + { + QSignalBlocker signalBlocker(m_enableGridVisualizationAction); + m_enableGridVisualizationAction->setChecked(SandboxEditor::ShowingGrid()); + } } namespace diff --git a/Code/Editor/ViewportTitleDlg.h b/Code/Editor/ViewportTitleDlg.h index 6996fe7750..f95828b428 100644 --- a/Code/Editor/ViewportTitleDlg.h +++ b/Code/Editor/ViewportTitleDlg.h @@ -171,6 +171,7 @@ protected: QAction* m_enableVRAction = nullptr; QAction* m_enableGridSnappingAction = nullptr; QAction* m_enableAngleSnappingAction = nullptr; + QAction* m_enableGridVisualizationAction = nullptr; QComboBox* m_cameraSpeed = nullptr; AzQtComponents::DoubleSpinBox* m_gridSpinBox = nullptr; AzQtComponents::DoubleSpinBox* m_angleSpinBox = nullptr; @@ -184,7 +185,7 @@ protected: namespace AzToolsFramework { - //! A component to reflect scriptable commands for the Editor + //! A component to reflect scriptable commands for the Editor. class ViewportTitleDlgPythonFuncsHandler : public AZ::Component { From 56c6f81627fcc957f30a46f5e818cad7558c79c8 Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Fri, 21 Jan 2022 13:21:57 +0000 Subject: [PATCH 342/620] PR addressing. Removed RTTI from HeightMaterialPoint since it's just a struct of data with no intention being a part of class hierarchy Signed-off-by: Sergey Pereslavtsev --- .../Physics/HeightfieldProviderBus.h | 5 +- Gems/PhysX/Code/Source/Utils.cpp | 85 ++++++++++--------- ...ditorHeightfieldColliderComponentTests.cpp | 13 +-- 3 files changed, 53 insertions(+), 50 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Physics/HeightfieldProviderBus.h b/Code/Framework/AzFramework/AzFramework/Physics/HeightfieldProviderBus.h index da361f0a2b..585fb59ad6 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/HeightfieldProviderBus.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/HeightfieldProviderBus.h @@ -35,16 +35,15 @@ namespace Physics { } - virtual ~HeightMaterialPoint() = default; + ~HeightMaterialPoint() = default; static void Reflect(AZ::ReflectContext* context); - AZ_RTTI(HeightMaterialPoint, "{DF167ED4-24E6-4F7B-8AB7-42622F7DBAD3}"); + AZ_TYPE_INFO(HeightMaterialPoint, "{DF167ED4-24E6-4F7B-8AB7-42622F7DBAD3}"); float m_height{ 0.0f }; //!< Holds the height of this point in the heightfield relative to the heightfield entity location. QuadMeshType m_quadMeshType{ QuadMeshType::SubdivideUpperLeftToBottomRight }; //!< By default, create two triangles like this |\|, where this point is in the upper left corner. uint8_t m_materialIndex{ 0 }; //!< The surface material index for the upper left corner of this quad. uint16_t m_padding{ 0 }; //!< available for future use. - }; //! An interface to provide heightfield values. diff --git a/Gems/PhysX/Code/Source/Utils.cpp b/Gems/PhysX/Code/Source/Utils.cpp index a988f6791c..950404820d 100644 --- a/Gems/PhysX/Code/Source/Utils.cpp +++ b/Gems/PhysX/Code/Source/Utils.cpp @@ -71,7 +71,6 @@ namespace PhysX const int32_t row, const int32_t col, const int32_t numRows, const int32_t numCols) { - uint8_t materialIndex0 = 0; uint8_t materialIndex1 = 0; @@ -81,49 +80,51 @@ namespace PhysX // In PhysX, the material indices refer to the quad down and to the right of the sample. // If we're in the last row or last column, there aren't any quads down or to the right, // so just clear these out. - - if (!lastRowIndex && !lastColumnIndex) + if (lastRowIndex || lastColumnIndex) { - auto GetIndex = [numCols](int32_t row, int32_t col) - { - return (row * numCols) + col; - }; - - // Our source data is providing one material index per vertex, but PhysX wants one material index - // per triangle. The heuristic that we'll go with for selecting the material index is to choose - // the material for the vertex that's not on the diagonal of each triangle. - // Ex: A *---* B - // | / | For this, we'll use A for index0 and D for index1. - // C *---* D - // - // Ex: A *---* B - // | \ | For this, we'll use C for index0 and B for index1. - // C *---* D - // - // This is a pretty arbitrary choice, so the heuristic might need to be revisited over time if this - // causes incorrect or unpredictable physics material mappings. - - const Physics::HeightMaterialPoint& currentSample = samples[GetIndex(row, col)]; - - switch (currentSample.m_quadMeshType) - { - case Physics::QuadMeshType::SubdivideUpperLeftToBottomRight: - materialIndex0 = samples[GetIndex(row + 1, col)].m_materialIndex; - materialIndex1 = samples[GetIndex(row, col + 1)].m_materialIndex; - break; - case Physics::QuadMeshType::SubdivideBottomLeftToUpperRight: - materialIndex0 = currentSample.m_materialIndex; - materialIndex1 = samples[GetIndex(row + 1, col + 1)].m_materialIndex; - break; - case Physics::QuadMeshType::Hole: - materialIndex0 = physx::PxHeightFieldMaterial::eHOLE; - materialIndex1 = physx::PxHeightFieldMaterial::eHOLE; - break; - default: - AZ_Assert(false, "Unhandled case in GetPhysXMaterialIndicesFromHeightfieldSamples"); - break; - } + return { materialIndex0, materialIndex1 }; } + + auto GetIndex = [numCols](int32_t row, int32_t col) + { + return (row * numCols) + col; + }; + + // Our source data is providing one material index per vertex, but PhysX wants one material index + // per triangle. The heuristic that we'll go with for selecting the material index is to choose + // the material for the vertex that's not on the diagonal of each triangle. + // Ex: A *---* B + // | / | For this, we'll use A for index0 and D for index1. + // C *---* D + // + // Ex: A *---* B + // | \ | For this, we'll use C for index0 and B for index1. + // C *---* D + // + // This is a pretty arbitrary choice, so the heuristic might need to be revisited over time if this + // causes incorrect or unpredictable physics material mappings. + + const Physics::HeightMaterialPoint& currentSample = samples[GetIndex(row, col)]; + + switch (currentSample.m_quadMeshType) + { + case Physics::QuadMeshType::SubdivideUpperLeftToBottomRight: + materialIndex0 = samples[GetIndex(row + 1, col)].m_materialIndex; + materialIndex1 = samples[GetIndex(row, col + 1)].m_materialIndex; + break; + case Physics::QuadMeshType::SubdivideBottomLeftToUpperRight: + materialIndex0 = currentSample.m_materialIndex; + materialIndex1 = samples[GetIndex(row + 1, col + 1)].m_materialIndex; + break; + case Physics::QuadMeshType::Hole: + materialIndex0 = physx::PxHeightFieldMaterial::eHOLE; + materialIndex1 = physx::PxHeightFieldMaterial::eHOLE; + break; + default: + AZ_Assert(false, "Unhandled case in GetPhysXMaterialIndicesFromHeightfieldSamples"); + break; + } + return { materialIndex0, materialIndex1 }; } diff --git a/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp b/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp index 9bdc63e60d..9a216b7d80 100644 --- a/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp +++ b/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp @@ -139,9 +139,9 @@ namespace PhysXEditorTests // Create an asset out of our Script Event Physics::MaterialLibraryAsset* matLibAsset = aznew Physics::MaterialLibraryAsset; { - AZStd::vector matIds = GetMaterialList(); + const AZStd::vector matIds = GetMaterialList(); - for (Physics::MaterialId matId : matIds) + for (const Physics::MaterialId& matId : matIds) { Physics::MaterialFromAssetConfiguration matConfig; matConfig.m_id = matId; @@ -336,7 +336,7 @@ namespace PhysXEditorTests // PhysX Heightfield cooking doesn't map 1-1 sample material indices to triangle material indices // Hence hardcoding the expected material indices in the test - const int physicsMaterialsValidationDataIndex[] = {0, 2, 1, 1}; + const AZStd::array physicsMaterialsValidationDataIndex = {0, 2, 1, 1}; for (int sampleRow = 0; sampleRow < numRows; ++sampleRow) { @@ -364,8 +364,11 @@ namespace PhysXEditorTests Physics::Material* mat2 = GetMaterialFromRaycast(rayX + secondRayOffset, rayY + secondRayOffset); EXPECT_NE(mat2, nullptr); - AZStd::string expectedMaterialName = physicsSurfaceTypes[physicsMaterialsValidationDataIndex[sampleRow * 2 + sampleColumn]]; - EXPECT_EQ(mat1->GetSurfaceTypeName(), expectedMaterialName); + if (mat1) + { + AZStd::string expectedMaterialName = physicsSurfaceTypes[physicsMaterialsValidationDataIndex[sampleRow * 2 + sampleColumn]]; + EXPECT_EQ(mat1->GetSurfaceTypeName(), expectedMaterialName); + } } } } From 9328f053bd40c2012bf7c06f94d479c3813c05af Mon Sep 17 00:00:00 2001 From: Nicholas Lawson <70027408+lawsonamzn@users.noreply.github.com> Date: Fri, 21 Jan 2022 08:00:45 -0800 Subject: [PATCH 343/620] Updates EXPAT to use the latest packages (#7053) * Update EXPAT to be latest package version Signed-off-by: lawsonamzn <70027408+lawsonamzn@users.noreply.github.com> --- Code/Legacy/CrySystem/XML/xml.cpp | 1 - cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake | 2 +- cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake | 2 +- cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake | 2 +- cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake | 2 +- cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Code/Legacy/CrySystem/XML/xml.cpp b/Code/Legacy/CrySystem/XML/xml.cpp index 95755d78fe..fb0714500c 100644 --- a/Code/Legacy/CrySystem/XML/xml.cpp +++ b/Code/Legacy/CrySystem/XML/xml.cpp @@ -11,7 +11,6 @@ #include -#define XML_STATIC // Alternative to defining this here would be setting it project-wide #include #include "xml.h" #include diff --git a/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake b/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake index c6a262926c..d231954c49 100644 --- a/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake +++ b/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake @@ -11,7 +11,7 @@ ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) -ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418) +ly_associate_package(PACKAGE_NAME expat-2.4.2-rev1-android TARGETS expat PACKAGE_HASH 8c626bd58c2f9bb82cb654c2483be60e67f3a601547dee43686638a5e662bf3e) ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) diff --git a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake index 8db3099a5c..ee91415a6d 100644 --- a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake +++ b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake @@ -13,7 +13,7 @@ ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev3-multiplatform TARGETS pybind11 PACKAGE_HASH dccb5546607b8b31cd207033aaf24ab044ce6e188a9f12411236a010f9e0c4ff) ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) -ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418) +ly_associate_package(PACKAGE_NAME expat-2.4.2-rev1-linux TARGETS expat PACKAGE_HASH 07621d684fd909e2768e696a2652cfb1e975093f738193cfdcb60a016a9a9d4e) ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) diff --git a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake index 95f7c89930..1bcad01c1d 100644 --- a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake +++ b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake @@ -13,7 +13,7 @@ ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev3-multiplatform TARGETS pybind11 PACKAGE_HASH dccb5546607b8b31cd207033aaf24ab044ce6e188a9f12411236a010f9e0c4ff) ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) -ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418) +ly_associate_package(PACKAGE_NAME expat-2.4.2-rev1-mac TARGETS expat PACKAGE_HASH 231ec2cb8ef9ddeef891e5bd7215ad91864e3410a22fad5ab8355e7bf53621fe) ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) diff --git a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake index 1f7cb8d28f..c872708a3a 100644 --- a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake +++ b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake @@ -13,7 +13,7 @@ ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev3-multiplatform TARGETS pybind11 PACKAGE_HASH dccb5546607b8b31cd207033aaf24ab044ce6e188a9f12411236a010f9e0c4ff) ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) -ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418) +ly_associate_package(PACKAGE_NAME expat-2.4.2-rev1-windows TARGETS expat PACKAGE_HASH 123d81dcd0e30306fdb0d062348b992e68358cc31f0a15a98c4c04fc68dc437e) ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) diff --git a/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake b/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake index 4b99efc9d0..3f1bb204f7 100644 --- a/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake +++ b/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake @@ -11,7 +11,7 @@ ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) -ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418) +ly_associate_package(PACKAGE_NAME expat-2.4.2-rev1-ios TARGETS expat PACKAGE_HASH 2e4f1ecaa9d7e9eb2f6f3b4a32d1b1a12605accf0ab3975175553b90917eb2d5) ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) From 145e3646a49fab1e3594d95c157e2f7ced824e24 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Fri, 21 Jan 2022 10:34:00 -0600 Subject: [PATCH 344/620] Asset catalog lock inversion fix. (#7045) * Fix lock inversion. This method was calling AssetCatalog->AssetManager at the same time that loading threads are calling AssetManager->AssetCatalog, causing a deadlock due to lock inversion. The fix is to make this method call AssetManager *outside* of the AssetCatalog call. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixing the root cause in EnumerateAssets. Also added a unit test that failed with the previous EnumerateAssets logic, and succeeds with the new logic. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Make sure not to hold the secondary mutex lock either. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Remove unused alias. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../AzFramework/Asset/AssetCatalog.cpp | 29 ++++- .../AzFramework/Tests/AssetCatalog.cpp | 105 ++++++++++++++++++ 2 files changed, 132 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Asset/AssetCatalog.cpp b/Code/Framework/AzFramework/AzFramework/Asset/AssetCatalog.cpp index 0c6b195434..a0f6b0608c 100644 --- a/Code/Framework/AzFramework/AzFramework/Asset/AssetCatalog.cpp +++ b/Code/Framework/AzFramework/AzFramework/Asset/AssetCatalog.cpp @@ -489,6 +489,21 @@ namespace AzFramework //========================================================================= void AssetCatalog::EnumerateAssets(BeginAssetEnumerationCB beginCB, AssetEnumerationCB enumerateCB, EndAssetEnumerationCB endCB) { + using AssetCatalogRequestBusContext = typename AZ::Data::AssetCatalogRequestBus::Context; + + // Setting trackCallstack to true causes the context mutex to attempt to re-lock. + // That is being avoided here as the code only wants to unlock the Context mutex if it is in a dispatch. + constexpr bool trackCallstack = false; + AssetCatalogRequestBusContext* assetCatalogContext = AZ::Data::AssetCatalogRequestBus::GetContext(trackCallstack); + + bool hasAssetCatalogMutex = false; + if (assetCatalogContext != nullptr && AZ::Data::AssetCatalogRequestBus::IsInDispatchThisThread(assetCatalogContext)) + { + hasAssetCatalogMutex = true; + // Unlock the dispatch mutex for the AssetCatalogRequestBus + assetCatalogContext->m_contextMutex.unlock(); + } + if (beginCB) { beginCB(); @@ -496,9 +511,13 @@ namespace AzFramework if (enumerateCB) { - AZStd::lock_guard lock(m_registryMutex); + // Make sure we don't hold on to any locks during the enumerateCB, so copy the registry info to a local variable + // and unlock the registryMutex before calling the callback. + m_registryMutex.lock(); + auto assetIdToInfoCopy = m_registry->m_assetIdToInfo; + m_registryMutex.unlock(); - for (auto& it : m_registry->m_assetIdToInfo) + for (auto& it : assetIdToInfoCopy) { enumerateCB(it.first, it.second); } @@ -508,6 +527,12 @@ namespace AzFramework { endCB(); } + + if (hasAssetCatalogMutex) + { + // Relock the mutex if it was unlocked earlier + assetCatalogContext->m_contextMutex.lock(); + } } //========================================================================= diff --git a/Code/Framework/AzFramework/Tests/AssetCatalog.cpp b/Code/Framework/AzFramework/Tests/AssetCatalog.cpp index 8a24d164cd..e731b633f0 100644 --- a/Code/Framework/AzFramework/Tests/AssetCatalog.cpp +++ b/Code/Framework/AzFramework/Tests/AssetCatalog.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -931,6 +933,109 @@ namespace UnitTest EXPECT_FALSE(m_assetCatalog->DoesAssetIdMatchWildcardPattern(m_firstAssetId, "")); } + TEST_F(AssetCatalogAPITest, EnumerateAssetsListsCorrectAssets) + { + AZStd::vector foundAssets; + + AZ::Data::AssetCatalogRequestBus::Broadcast( + &AZ::Data::AssetCatalogRequestBus::Events::EnumerateAssets, nullptr, + [&foundAssets](const AZ::Data::AssetId assetId, [[maybe_unused]] const AZ::Data::AssetInfo& assetInfo) + { + foundAssets.emplace_back(assetId); + }, + nullptr); + + ASSERT_EQ(foundAssets.size(), 2); + EXPECT_EQ(foundAssets[0], m_firstAssetId); + EXPECT_EQ(foundAssets[1], m_secondAssetId); + } + + TEST_F(AssetCatalogAPITest, EnumerateAssetsDoesNotBlockMutex) + { + // This test simulates a previously-occurring deadlock bug caused by having the main thread call AssetCatalog::EnumerateAssets + // with a callback that calls the AssetManager, and a loading thread running underneath the AssetManager that calls the + // AssetCatalog. + // To reproduce this state, we will do the following: + // Main Thread Job Thread + // wait on mainToJobSync + // call EnumerateAssets + // unblock mainToJobSync + // wait on jobToMainSync call AssetCatalog::X + // unblock jobToMainSync + // + // These steps should ensure that we create a theoretical "lock inversion", if EnumerateAssets locked an AssetCatalog mutex. + // Even though we're using binary semaphores instead of mutexes, we're creating the same blocking situation. + // EnumerateAssets itself should no longer lock the AssetCatalog mutex, so this test should succeed since there won't be any + // actual lock inversion. + + // Set up job manager with one thread that we can use to set up the concurrent mutex access. + AZ::AllocatorInstance::Create(); + AZ::JobManagerDesc desc; + AZ::JobManagerThreadDesc threadDesc; + desc.m_workerThreads.push_back(threadDesc); + auto jobManager = aznew AZ::JobManager(desc); + auto jobContext = aznew AZ::JobContext(*jobManager); + AZ::JobContext::SetGlobalContext(jobContext); + + AZStd::binary_semaphore mainToJobSync; + AZStd::binary_semaphore jobToMainSync; + + // Create a job whose sole purpose is to wait for EnumerateAssets to get called, call AssetCatalog, then tell EnumerateAssets + // to finish. If EnumerateAssets has a mutex held, this will deadlock. + auto job = AZ::CreateJobFunction( + [&mainToJobSync, &jobToMainSync]() mutable + { + // wait for the main thread to be inside the EnumerateAssets callback. + mainToJobSync.acquire(); + + // call AssetCatalog::X. This will deadlock if EnumerateAssets is holding an AssetCatalog mutex. + [[maybe_unused]] AZStd::string assetPath; + AZ::Data::AssetCatalogRequestBus::BroadcastResult( + assetPath, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetPathById, AZ::Data::AssetId()); + + // signal the main thread to continue + jobToMainSync.release(); + }, + true); + job->Start(); + + bool testCompletedSuccessfully = false; + + // Call EnumerateAssets with a callback that also tries to lock the mutex. + AZ::Data::AssetCatalogRequestBus::Broadcast( + &AZ::Data::AssetCatalogRequestBus::Events::EnumerateAssets, nullptr, + [this, &mainToJobSync, &jobToMainSync, &testCompletedSuccessfully] + (const AZ::Data::AssetId assetId, [[maybe_unused]] const AZ::Data::AssetInfo& assetInfo) + { + // Only run this logic on the first assetId. + if (assetId == m_firstAssetId) + { + // Tell the job it can continue + mainToJobSync.release(); + + // Wait for the job to finish calling AssetCatalog::X. This will deadlock if EnumerateAssets is holding an + // AssetCatalog mutex. + if (jobToMainSync.try_acquire_for(AZStd::chrono::seconds(5))) + { + // Only mark the test as completed successfully if we ran this logic and didn't deadlock. + testCompletedSuccessfully = true; + } + + } + }, + nullptr); + + EXPECT_TRUE(testCompletedSuccessfully); + + // Clean up the job manager + AZ::JobContext::SetGlobalContext(nullptr); + delete jobContext; + delete jobManager; + AZ::AllocatorInstance::Destroy(); + } + + + class AssetType1 : public AssetData { From 526ee7644a86ad6c2c2c4cfbc3d00ef3e0b02946 Mon Sep 17 00:00:00 2001 From: Scott Romero <24445312+AMZN-ScottR@users.noreply.github.com> Date: Fri, 21 Jan 2022 09:04:33 -0800 Subject: [PATCH 345/620] [development] fixed configure error with monolithic builds (#7057) The AWSNativeSDKTestLibs target is now only defined when tests are enabled Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com --- Code/Tools/AWSNativeSDKInit/CMakeLists.txt | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Code/Tools/AWSNativeSDKInit/CMakeLists.txt b/Code/Tools/AWSNativeSDKInit/CMakeLists.txt index de3e0008c2..7f04262781 100644 --- a/Code/Tools/AWSNativeSDKInit/CMakeLists.txt +++ b/Code/Tools/AWSNativeSDKInit/CMakeLists.txt @@ -25,28 +25,28 @@ ly_add_target( AZ::AzCore ) -ly_add_target( - NAME AWSNativeSDKTestLibs STATIC - NAMESPACE AZ - FILES_CMAKE - aws_native_sdk_test_files.cmake - INCLUDE_DIRECTORIES - PUBLIC - include - tests/libs - PRIVATE - source - BUILD_DEPENDENCIES - PRIVATE - 3rdParty::AWSNativeSDK::Core - AZ::AzCore - AZ::AzTest -) - ################################################################################ # Tests ################################################################################ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) + ly_add_target( + NAME AWSNativeSDKTestLibs STATIC + NAMESPACE AZ + FILES_CMAKE + aws_native_sdk_test_files.cmake + INCLUDE_DIRECTORIES + PUBLIC + include + tests/libs + PRIVATE + source + BUILD_DEPENDENCIES + PRIVATE + 3rdParty::AWSNativeSDK::Core + AZ::AzCore + AZ::AzTest + ) + ly_add_target( NAME AWSNativeSDKInit.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE AZ From 09dd3a87299c20b7c27da52f8f866f7ea9b7098f Mon Sep 17 00:00:00 2001 From: Scott Romero <24445312+AMZN-ScottR@users.noreply.github.com> Date: Fri, 21 Jan 2022 09:06:14 -0800 Subject: [PATCH 346/620] [development] patch fix for launcher exit crash (#7050) The launcher will crash on exit due to an access violation when clearing the BudgetTracker after CrySystem is unloaded. This is from a recent change to how the budget pointers are tracked making the BudgetTracker responsible for clearing them so the system can be re-entrant. Unfortunately, an assumption was made that all modules that use Budgets are managed by the ComponentApplication so they can be cleared prior to being unloaded. This is a patch to manually reset the BudgetTracker prior to unloading CrySystem until the legacy system can be removed (or converted to an AZ-like module). Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com --- Code/LauncherUnified/Launcher.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Code/LauncherUnified/Launcher.cpp b/Code/LauncherUnified/Launcher.cpp index 9dfd6213c4..7b681c5208 100644 --- a/Code/LauncherUnified/Launcher.cpp +++ b/Code/LauncherUnified/Launcher.cpp @@ -10,14 +10,17 @@ #include #include +#include +#include #include +#include #include #include #include -#include #include #include #include + #include #include #include @@ -571,6 +574,17 @@ namespace O3DELauncher } #if !defined(AZ_MONOLITHIC_BUILD) + + #if !defined(_RELEASE) + // until CrySystem can be removed (or made to be managed by the component application), + // we need to manually clear the BudgetTracker before CrySystem is unloaded so the Budget + // pointer(s) it has references to are cleared properly + if (auto budgetTracker = AZ::Interface::Get(); budgetTracker) + { + budgetTracker->Reset(); + } + #endif // !defined(_RELEASE) + delete systemInitParams.pSystem; crySystemLibrary.reset(nullptr); #endif // !defined(AZ_MONOLITHIC_BUILD) From 807464c58d29fa3c6afde1a12551b0f4ed2b7750 Mon Sep 17 00:00:00 2001 From: Scott Romero <24445312+AMZN-ScottR@users.noreply.github.com> Date: Fri, 21 Jan 2022 09:08:24 -0800 Subject: [PATCH 347/620] [development] updated Android build node configuration (#7007) Added the NDK to the install list Removed Android Java APIs prior to 28 from package list as they are unnecessary Updated LY_NDK_DIR to point to the SDK manager version Updated some inconsistencies in how the min Android native API is handled Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com --- cmake/Platform/Android/Toolchain_android.cmake | 10 +++++++++- .../Tools/Platform/Android/generate_android_project.py | 2 +- scripts/build/Platform/Android/build_config.json | 10 +++++----- scripts/build/Platform/Android/pipeline.json | 4 ++-- .../build_node/Platform/Windows/install_android.ps1 | 6 +++--- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/cmake/Platform/Android/Toolchain_android.cmake b/cmake/Platform/Android/Toolchain_android.cmake index 974eb33681..23b51a4c70 100644 --- a/cmake/Platform/Android/Toolchain_android.cmake +++ b/cmake/Platform/Android/Toolchain_android.cmake @@ -36,9 +36,17 @@ endif() if(NOT ANDROID_ABI MATCHES "^arm64-") message(FATAL_ERROR "Only the 64-bit ANDROID_ABI's are supported. arm64-v8a can be used if not set") endif() + +set(MIN_NATIVE_API_LEVEL 24) + if(NOT ANDROID_NATIVE_API_LEVEL) - set(ANDROID_NATIVE_API_LEVEL 24) + set(ANDROID_NATIVE_API_LEVEL ${MIN_NATIVE_API_LEVEL}) endif() + +if(${ANDROID_NATIVE_API_LEVEL} VERSION_LESS ${MIN_NATIVE_API_LEVEL}) + message(FATAL_ERROR "Unsupported Android native API version ${ANDROID_NATIVE_API_LEVEL}. Must be ${MIN_NATIVE_API_LEVEL} or above") +endif() + set(ANDROID_PLATFORM android-${ANDROID_NATIVE_API_LEVEL}) # Make a backup of the CMAKE_FIND_ROOT_PATH since it will be altered by the NDK toolchain file and needs to be restored after the input diff --git a/cmake/Tools/Platform/Android/generate_android_project.py b/cmake/Tools/Platform/Android/generate_android_project.py index 5e414e7738..a12006bd53 100755 --- a/cmake/Tools/Platform/Android/generate_android_project.py +++ b/cmake/Tools/Platform/Android/generate_android_project.py @@ -181,7 +181,7 @@ def main(args): default=-1) parser.add_argument(ANDROID_NATIVE_API_LEVEL, - help=f'The android native API level to use for the APK. If not set, this will default to the android SDK platform. (Minimum {MIN_ANDROID_SDK_PLATFORM})', + help=f'The android native API level to use for the APK. If not set, this will default to the android SDK platform. (Minimum {MIN_NATIVE_API_LEVEL})', type=int, default=-1) diff --git a/scripts/build/Platform/Android/build_config.json b/scripts/build/Platform/Android/build_config.json index c505d8e940..da538b22ec 100644 --- a/scripts/build/Platform/Android/build_config.json +++ b/scripts/build/Platform/Android/build_config.json @@ -35,7 +35,7 @@ "PARAMETERS": { "CONFIGURATION":"debug", "OUTPUT_DIRECTORY":"build\\android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=24 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -50,7 +50,7 @@ "PARAMETERS": { "CONFIGURATION":"profile", "OUTPUT_DIRECTORY":"build\\android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=24 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -66,7 +66,7 @@ "PARAMETERS": { "CONFIGURATION":"profile", "OUTPUT_DIRECTORY":"build\\android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\" -DLY_UNITY_BUILD=FALSE", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=24 -DLY_NDK_DIR=\"!LY_NDK_DIR!\" -DLY_UNITY_BUILD=FALSE", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -102,7 +102,7 @@ "PARAMETERS": { "CONFIGURATION":"release", "OUTPUT_DIRECTORY":"build\\android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=24 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -118,7 +118,7 @@ "PARAMETERS": { "CONFIGURATION":"release", "OUTPUT_DIRECTORY":"build\\mono_android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\" -DLY_MONOLITHIC_GAME=TRUE", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=24 -DLY_NDK_DIR=\"!LY_NDK_DIR!\" -DLY_MONOLITHIC_GAME=TRUE", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" diff --git a/scripts/build/Platform/Android/pipeline.json b/scripts/build/Platform/Android/pipeline.json index f0292f4501..2e426c7891 100644 --- a/scripts/build/Platform/Android/pipeline.json +++ b/scripts/build/Platform/Android/pipeline.json @@ -1,9 +1,9 @@ { "ENV": { "GRADLE_HOME": "C:/Gradle/gradle-7.0", - "NODE_LABEL": "windows-b3c8994f1", + "NODE_LABEL": "windows-a4a28adb2", "LY_3RDPARTY_PATH": "D:/workspace/3rdParty", - "LY_NDK_DIR": "C:/ly/3rdParty/android-ndk/r21d", + "LY_NDK_DIR": "C:/Android/android-sdk/ndk/21.4.7075529", "TIMEOUT": 30, "WORKSPACE": "D:/workspace", "MOUNT_VOLUME": true diff --git a/scripts/build/build_node/Platform/Windows/install_android.ps1 b/scripts/build/build_node/Platform/Windows/install_android.ps1 index 0a725af573..497ec508cc 100644 --- a/scripts/build/build_node/Platform/Windows/install_android.ps1 +++ b/scripts/build/build_node/Platform/Windows/install_android.ps1 @@ -10,16 +10,16 @@ choco install -y android-sdk $Env:ANDROID_HOME = "C:\Android\android-sdk" setx ANDROID_HOME "C:\Android\android-sdk" -$apis_packages = '"add-ons;addon-google_apis-google-19" "add-ons;addon-google_apis-google-21" "add-ons;addon-google_apis-google-22" "add-ons;addon-google_apis-google-23" "add-ons;addon-google_apis-google-24"' -$android_packages = '"platforms;android-19" "platforms;android-21" "platforms;android-22" "platforms;android-23" "platforms;android-24" "platforms;android-25" "platforms;android-26" "platforms;android-27" "platforms;android-28" "platforms;android-29" "platforms;android-30"' +$android_packages = '"platforms;android-28" "platforms;android-29" "platforms;android-30"' $googleplay_packages = '"extras;google;market_apk_expansion" "extras;google;market_licensing"' $build_tools = '"build-tools;30.0.2" "tools"' +$ndk = '"ndk;21.4.7075529"' $sdkmanager = "C:\Android\android-sdk\tools\bin\sdkmanager.bat" -Start-Process -FilePath $sdkmanager -ArgumentList $apis_packages -NoNewWindow -Wait Start-Process -FilePath $sdkmanager -ArgumentList $android_packages -NoNewWindow -Wait Start-Process -FilePath $sdkmanager -ArgumentList $googleplay_packages -NoNewWindow -Wait Start-Process -FilePath $sdkmanager -ArgumentList $build_tools -NoNewWindow -Wait +Start-Process -FilePath $sdkmanager -ArgumentList $ndk -NoNewWindow -Wait Write-Host "Installing Gradle and Ninja" Import-Module C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1 #Grade needs a custom installer due to being hardcoded to C:\Programdata in Chocolatey From edbebb5f477f14dfc86535800201c50ca7781400 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Fri, 21 Jan 2022 09:19:54 -0800 Subject: [PATCH 348/620] Minor class definition updates for AWSGem (#7056) * Move the queued-events constructors for AWSApiClientJob and ServiceRequestJob from public to protected, and add short description for them Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- .../Code/Include/Framework/AWSApiRequestJob.h | 37 ++++++++---------- .../Include/Framework/ServiceRequestJob.h | 38 ++++++++----------- 2 files changed, 30 insertions(+), 45 deletions(-) diff --git a/Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h b/Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h index 33c7e1ad29..816e9bc4b4 100644 --- a/Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h +++ b/Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h @@ -188,28 +188,6 @@ namespace AWSCore { } - AwsApiRequestJob(bool queueOnSuccess, - OnSuccessFunction onSuccess, - bool queueOnFailure, - OnFailureFunction onFailure, - bool queueDelete, - IConfig* config = GetDefaultConfig() - ) : AwsApiClientJobType(false, config) - , m_queueOnSuccess{ queueOnSuccess } - , m_onSuccess{ onSuccess } - , m_queueOnFailure{ queueOnFailure } - , m_onFailure{ onFailure } - , m_queueDelete{ queueDelete } - { - } - - AwsApiRequestJob(OnSuccessFunction onSuccess, - OnFailureFunction onFailure, - IConfig* config = GetDefaultConfig() - ) : AwsApiRequestJob(true, onSuccess, true, onFailure, true, config) - { - } - RequestType request; ResultType result; ErrorType error; @@ -232,6 +210,21 @@ namespace AWSCore } protected: + + /// Constructor for creating AwsApiRequestJob Jobs that can handle queued responses + /// for OnSuccess, OnFailure, and DoCleanup + AwsApiRequestJob(OnSuccessFunction onSuccess, + OnFailureFunction onFailure, + IConfig* config = GetDefaultConfig() + ) : AwsApiClientJobType(false, config) + , m_queueOnSuccess{ true } + , m_onSuccess{ onSuccess } + , m_queueOnFailure{ true } + , m_onFailure{ onFailure } + , m_queueDelete{ true } + { + } + bool m_wasSuccess{ false }; // Flag and optional function call to queue for onSuccess events diff --git a/Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h b/Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h index 6d00122d99..d3eac4983a 100644 --- a/Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h +++ b/Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h @@ -178,29 +178,6 @@ namespace AWSCore } } - ServiceRequestJob(bool queueOnSuccess, - OnSuccessFunction onSuccess, - bool queueOnFailure, - OnFailureFunction onFailure, - bool queueDelete, - IConfig* config = GetDefaultConfig() - ) : ServiceClientJobType{ false, config } - , m_requestUrl{ config->GetRequestUrl() } - , m_queueOnSuccess{ queueOnSuccess } - , m_onSuccess{ onSuccess } - , m_queueOnFailure{ queueOnFailure } - , m_onFailure{ onFailure } - , m_queueDelete{ queueDelete } - { - } - - ServiceRequestJob(OnSuccessFunction onSuccess, - OnFailureFunction onFailure, - IConfig* config = GetDefaultConfig() - ) : ServiceRequestJob(true, onSuccess, true, onFailure, true, config) - { - } - bool HasCredentials(IConfig* config) { if (config == nullptr) @@ -241,6 +218,21 @@ namespace AWSCore /// for replacing these parts of the url. const Aws::String& m_requestUrl; + /// Constructor for creating ServiceRequestJob Jobs that can handle queued responses + /// for OnSuccess, OnFailure, and DoCleanup + ServiceRequestJob(OnSuccessFunction onSuccess, + OnFailureFunction onFailure, + IConfig* config = GetDefaultConfig() + ) : ServiceClientJobType{ false, config } + , m_requestUrl{ config->GetRequestUrl() } + , m_queueOnSuccess{ true } + , m_onSuccess{ onSuccess } + , m_queueOnFailure{ true } + , m_onFailure{ onFailure } + , m_queueDelete{ true } + { + } + // Flag and optional function call to queue for onSuccess events bool m_queueOnSuccess{ false }; OnSuccessFunction m_onSuccess{}; From 1d3b675f889a742ea577aa73edbdc694975a5d56 Mon Sep 17 00:00:00 2001 From: lsemp3d <58790905+lsemp3d@users.noreply.github.com> Date: Fri, 21 Jan 2022 09:35:42 -0800 Subject: [PATCH 349/620] Regenerated the Input handler .names file Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com> --- .../Nodes/Input_InputHandler.names | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/Nodes/Input_InputHandler.names b/Gems/ScriptCanvas/Assets/TranslationAssets/Nodes/Input_InputHandler.names index 8ce3fd36df..120c8f8ef3 100644 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/Nodes/Input_InputHandler.names +++ b/Gems/ScriptCanvas/Assets/TranslationAssets/Nodes/Input_InputHandler.names @@ -1,7 +1,7 @@ { "entries": [ { - "base": "{0B0AC61B-4BBA-42BF-BDCD-DAF2D3CA41A8}", + "base": "{0A2EB488-5A6A-E166-BB62-23FF81499E33}", "context": "ScriptCanvas::Node", "variant": "", "details": { @@ -10,6 +10,13 @@ "tooltip": "Handle processed input events found in input binding assets" }, "slots": [ + { + "base": "Input_Connect Event_0", + "details": { + "name": "Connect Event", + "tooltip": "Connect to input event name as defined in an input binding asset." + } + }, { "base": "DataInput_Event Name_0", "details": { @@ -17,27 +24,34 @@ } }, { - "base": "DataOutput_Value_0", + "base": "Output_On Connect Event_0", "details": { - "name": "Value" + "name": "On Connect Event", + "tooltip": "Connect to input event name as defined in an input binding asset." } }, { - "base": "Output_Pressed_0", + "base": "Output_Pressed_1", "details": { "name": "Pressed", "tooltip": "Signaled when the input event begins." } }, { - "base": "Output_Held_1", + "base": "DataOutput_value_0", + "details": { + "name": "value" + } + }, + { + "base": "Output_Held_2", "details": { "name": "Held", "tooltip": "Signaled while the input event is active." } }, { - "base": "Output_Released_2", + "base": "Output_Released_3", "details": { "name": "Released", "tooltip": "Signaled when the input event ends." From be2241bda956d286fbf0161600d84422635f1a15 Mon Sep 17 00:00:00 2001 From: lsemp3d <58790905+lsemp3d@users.noreply.github.com> Date: Fri, 21 Jan 2022 09:41:37 -0800 Subject: [PATCH 350/620] Navigate to file after generating translation (only 1) Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com> --- .../ScriptCanvasNodePaletteDockWidget.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp index 60d903d748..4b622bc025 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp @@ -894,6 +894,26 @@ namespace ScriptCanvasEditor GraphCanvas::NodePaletteTreeItem* nodePaletteItem = static_cast(sourceIndex.internalPointer()); nodePaletteItem->GenerateTranslationData(); } + + if (indexList.size() == 1) + { + AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); + QModelIndex sourceIndex = filterModel->mapToSource(indexList[0]); + if (sourceIndex.isValid()) + { + GraphCanvas::NodePaletteTreeItem* nodePaletteItem = static_cast(sourceIndex.internalPointer()); + + AZ::IO::Path gemPath = GetGemPath("ScriptCanvas.Editor"); + gemPath = gemPath / AZ::IO::Path("TranslationAssets"); + gemPath = gemPath / nodePaletteItem->GetTranslationDataPath(); + gemPath.ReplaceExtension(".names"); + + if (fileIO->Exists(gemPath.c_str())) + { + AzQtComponents::ShowFileOnDesktop(gemPath.c_str()); + } + } + } } void NodePaletteDockWidget::OpenTranslationData() From f684fe14ff81d329e1ae90e434710a0418a5d8f7 Mon Sep 17 00:00:00 2001 From: lsemp3d <58790905+lsemp3d@users.noreply.github.com> Date: Fri, 21 Jan 2022 09:45:27 -0800 Subject: [PATCH 351/620] Categorized Material Data under Rendering Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com> --- .../Assets/TranslationAssets/Classes/MaterialData.names | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/MaterialData.names b/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/MaterialData.names index 9f6af426d0..72e48aa400 100644 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/MaterialData.names +++ b/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/MaterialData.names @@ -5,7 +5,8 @@ "context": "BehaviorClass", "variant": "", "details": { - "name": "Material Data" + "name": "Material Data", + "category": "Rendering" }, "methods": [ { From 238962be739fe2dda678b92342d528e390675e7b Mon Sep 17 00:00:00 2001 From: Mikhail Naumov <82239319+AMZN-mnaumov@users.noreply.github.com> Date: Fri, 21 Jan 2022 12:02:40 -0600 Subject: [PATCH 352/620] fixing crash when opening different level during simulation mode (#6762) Signed-off-by: Mikhail Naumov --- Code/Editor/CryEdit.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index 3beaf4d438..8789b31fdc 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -3363,6 +3363,10 @@ CCryEditDoc* CCryEditApp::OpenDocumentFile(const char* filename, bool addToMostR return GetIEditor()->GetDocument(); } + bool usePrefabSystemForLevels = false; + AzFramework::ApplicationRequests::Bus::BroadcastResult( + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + // If we are loading and we're in simulate mode, then switch it off before we do anything else if (GetIEditor()->GetGameEngine() && GetIEditor()->GetGameEngine()->GetSimulationMode()) { @@ -3370,6 +3374,15 @@ CCryEditDoc* CCryEditApp::OpenDocumentFile(const char* filename, bool addToMostR bool bIsDocModified = GetIEditor()->GetDocument()->IsModified(); OnSwitchPhysics(); GetIEditor()->GetDocument()->SetModifiedFlag(bIsDocModified); + + if (usePrefabSystemForLevels) + { + auto* rootSpawnableInterface = AzFramework::RootSpawnableInterface::Get(); + if (rootSpawnableInterface) + { + rootSpawnableInterface->ProcessSpawnableQueue(); + } + } } // We're about to start loading a level, so start recording errors to display at the end. From d5f7bc7c9beeaeceac4c01ed2e9c86c943978162 Mon Sep 17 00:00:00 2001 From: lsemp3d <58790905+lsemp3d@users.noreply.github.com> Date: Fri, 21 Jan 2022 10:03:02 -0800 Subject: [PATCH 353/620] Consolidated navigation to file code Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com> --- .../ScriptCanvasNodePaletteDockWidget.cpp | 43 ++++++++----------- .../ScriptCanvasNodePaletteDockWidget.h | 1 + 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp index 4b622bc025..9387b58c71 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp @@ -881,6 +881,23 @@ namespace ScriptCanvasEditor return ""; } + void NodePaletteDockWidget::NavigateToTranslationFile(GraphCanvas::NodePaletteTreeItem* nodePaletteItem) + { + if (nodePaletteItem) + { + AZ::IO::Path gemPath = GetGemPath("ScriptCanvas.Editor"); + gemPath = gemPath / AZ::IO::Path("TranslationAssets"); + gemPath = gemPath / nodePaletteItem->GetTranslationDataPath(); + gemPath.ReplaceExtension(".names"); + + AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); + if (fileIO && fileIO->Exists(gemPath.c_str())) + { + AzQtComponents::ShowFileOnDesktop(gemPath.c_str()); + } + } + } + void NodePaletteDockWidget::GenerateTranslation() { QModelIndexList indexList = GetTreeView()->selectionModel()->selectedRows(); @@ -897,21 +914,11 @@ namespace ScriptCanvasEditor if (indexList.size() == 1) { - AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); QModelIndex sourceIndex = filterModel->mapToSource(indexList[0]); if (sourceIndex.isValid()) { GraphCanvas::NodePaletteTreeItem* nodePaletteItem = static_cast(sourceIndex.internalPointer()); - - AZ::IO::Path gemPath = GetGemPath("ScriptCanvas.Editor"); - gemPath = gemPath / AZ::IO::Path("TranslationAssets"); - gemPath = gemPath / nodePaletteItem->GetTranslationDataPath(); - gemPath.ReplaceExtension(".names"); - - if (fileIO->Exists(gemPath.c_str())) - { - AzQtComponents::ShowFileOnDesktop(gemPath.c_str()); - } + NavigateToTranslationFile(nodePaletteItem); } } } @@ -929,19 +936,7 @@ namespace ScriptCanvasEditor QModelIndex sourceIndex = filterModel->mapToSource(index); GraphCanvas::NodePaletteTreeItem* nodePaletteItem = static_cast(sourceIndex.internalPointer()); - if (nodePaletteItem) - { - AZ::IO::Path gemPath = GetGemPath("ScriptCanvas.Editor"); - gemPath = gemPath / AZ::IO::Path("TranslationAssets"); - gemPath = gemPath / nodePaletteItem->GetTranslationDataPath(); - gemPath.ReplaceExtension(".names"); - - AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); - if (fileIO->Exists(gemPath.c_str())) - { - AzQtComponents::ShowFileOnDesktop(gemPath.c_str()); - } - } + NavigateToTranslationFile(nodePaletteItem); } } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.h index 9f5fa0511f..3ee26e3f71 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.h @@ -209,6 +209,7 @@ namespace ScriptCanvasEditor void HandleTreeItemDoubleClicked(GraphCanvas::GraphCanvasTreeItem* treeItem); void OpenTranslationData(); void GenerateTranslation(); + void NavigateToTranslationFile(GraphCanvas::NodePaletteTreeItem*); void ConfigureHelper(); void ParseCycleTargets(GraphCanvas::GraphCanvasTreeItem* treeItem); From d918991e273c982ac9d3bb0405453b1471d64d3a Mon Sep 17 00:00:00 2001 From: Mikhail Naumov <82239319+AMZN-mnaumov@users.noreply.github.com> Date: Fri, 21 Jan 2022 12:04:47 -0600 Subject: [PATCH 354/620] Allowing instantiating of prefab without selecting an entity in outliner (#6763) * Allowing instantiating of prefab without selecting an entity in outliner Signed-off-by: Mikhail Naumov * PR feedback Signed-off-by: Mikhail Naumov --- .../AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp index bc65b9088b..d61efe0b6d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp @@ -341,7 +341,8 @@ namespace AzToolsFramework } // Instantiate Prefab - if (selectedEntities.size() == 1 && !readOnlyEntityInSelection && !onlySelectedEntityIsClosedPrefabContainer) + if (selectedEntities.size() == 0 || + selectedEntities.size() == 1 && !readOnlyEntityInSelection && !onlySelectedEntityIsClosedPrefabContainer) { QAction* instantiateAction = menu->addAction(QObject::tr("Instantiate Prefab...")); instantiateAction->setToolTip(QObject::tr("Instantiates a prefab file in the scene.")); From 05bf066c5afadbfc44d5dfac10bd191e127799d4 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 21 Jan 2022 10:28:22 -0800 Subject: [PATCH 355/620] Removed commented out py code Signed-off-by: Gene Walters --- .../tests/Multiplayer_SimpleNetworkLevelEntity.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py index aadf12d7e3..4548dff0b8 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py @@ -61,12 +61,9 @@ def Multiplayer_SimpleNetworkLevelEntity(): ATTEMPTING_INVALID_NETSPAWN_WAIT_TIME_SECONDS = 1.0 # The editor will try to net-spawn its networked level entity before it's even a client. Make sure this doesn't happen. helper.fail_if_log_line_found('NetworkEntityManager', "RequestNetSpawnableInstantiation: Requested spawnable Root.network.spawnable doesn't exist in the NetworkSpawnableLibrary. Please make sure it is a network spawnable", section_tracer.errors, ATTEMPTING_INVALID_NETSPAWN_WAIT_TIME_SECONDS) - # 5) Ensure the script graph attached to the level entity is running on both client and server + # 5) Ensure the script graph attached to the level entity is running on the server SCRIPTGRAPH_ENABLED_WAIT_TIME_SECONDS = 0.25 - # Check Server helper.succeed_if_log_line_found('EditorServer', "Script: SimpleNetworkLevelEntity: On Graph Start", section_tracer.prints, SCRIPTGRAPH_ENABLED_WAIT_TIME_SECONDS) - # Check Editor/Client (Uncomment once script asset preload is working properly LYN-9136) - # helper.succeed_if_log_line_found('Script', "SimpleNetworkLevelEntity: On Graph Start", section_tracer.prints, SCRIPTGRAPH_ENABLED_WAIT_TIME_SECONDS) # Client # Exit game mode From f93a22cdcc0853df6ebfc77b9c912d438be799b3 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Fri, 21 Jan 2022 11:11:39 -0800 Subject: [PATCH 356/620] EntityReference P1 case udpates Signed-off-by: Scott Murray --- ...omEditorComponents_EntityReferenceAdded.py | 71 +++++++++++++------ 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py index 9dc4869f66..464f2a1892 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py @@ -58,6 +58,9 @@ class Tests: container_reset = ( "EntityIdReferences reset succeeded", "P1: EntityIdReferences reset did not succeed") + entity_reference_component_removed = ( + "Entity Reference component removed from entity", + "P1: Entity Reference component NOT removed from entity") def AtomEditorComponents_EntityReference_AddedToEntity(): @@ -78,13 +81,21 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): 2) Add Entity Reference component to Entity Reference entity. 3) UNDO the entity creation and component addition. 4) REDO the entity creation and component addition. - 5) Enter/Exit game mode. - 6) Test IsHidden. - 7) Test IsVisible. - 8) Delete Entity Reference entity. - 9) UNDO deletion. - 10) REDO deletion. - 11) Look for errors. + 5) 'EntityIdReferences' is a container property + 6) Append item to 'EntityIdReferences' + 7) Add item to 'EntityIdReferences' + 8) Update item in 'EntityIdReferences' + 9) Remove item from 'EntityIdReferences' + 10) Rest the container property then put one entity reference back for further tests + 11) Remove component + 12) Undo component remove + 13) Enter/Exit game mode. + 14) Test IsHidden. + 15) Test IsVisible. + 16) Delete Entity Reference entity. + 17) UNDO deletion. + 18) REDO deletion. + 19) Look for errors. :return: None """ @@ -142,13 +153,13 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): test_2 = EditorEntity.create_editor_entity('test_2') test_3 = EditorEntity.create_editor_entity('test_3') - # is container property + # 5. 'EntityIdReferences' is a container property Report.result( Tests.entity_id_references_is_container, entity_reference_component.is_property_container( AtomComponentProperties.entity_reference('EntityIdReferences'))) - # Append entity reference to container + # 6. Append item to 'EntityIdReferences' entity_reference_component.append_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), test_1.id) Report.result( @@ -156,7 +167,7 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): entity_reference_component.get_container_item( AtomComponentProperties.entity_reference('EntityIdReferences'), 0) == test_1.id) - # Add entity reference to container + # 7. Add item to 'EntityIdReferences' entity_reference_component.add_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), 1, test_1.id) Report.result( @@ -165,7 +176,7 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): AtomComponentProperties.entity_reference('EntityIdReferences')) == 2 ) - # Update entity reference + # 8. Update item in 'EntityIdReferences' entity_reference_component.update_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), 1, test_2.id) Report.result( @@ -173,7 +184,7 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): entity_reference_component.get_container_item( AtomComponentProperties.entity_reference('EntityIdReferences'), 1) == test_2.id) - # Remove entity reference + # 9. Remove item from 'EntityIdReferences' entity_reference_component.append_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), test_3.id) count_before = entity_reference_component.get_container_count( @@ -190,41 +201,57 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): AtomComponentProperties.entity_reference('EntityIdReferences'), 1) == test_3.id)) ) - # Reset + # 10. Rest the container property then put one entity reference back for further tests entity_reference_component.reset_container(AtomComponentProperties.entity_reference('EntityIdReferences')) + general.idle_wait_frames(1) Report.result( Tests.container_reset, entity_reference_component.get_container_count( - AtomComponentProperties.entity_reference('EntityIdReferences')) == 0 - ) + AtomComponentProperties.entity_reference('EntityIdReferences')) == 0) + entity_reference_component.append_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), + test_1.id) - # 5. Enter/Exit game mode. + # 11. Remove component + entity_reference_entity.remove_component(AtomComponentProperties.entity_reference()) + general.idle_wait_frames(1) + Report.result(Tests.entity_reference_component_removed, not entity_reference_entity.has_component( + AtomComponentProperties.entity_reference())) + + # 12. Undo component remove + general.undo() + general.idle_wait_frames(1) + Report.result(Tests.entity_reference_component, entity_reference_entity.has_component( + AtomComponentProperties.entity_reference())) + + # 13. Enter/Exit game mode. TestHelper.enter_game_mode(Tests.enter_game_mode) general.idle_wait_frames(1) TestHelper.exit_game_mode(Tests.exit_game_mode) - # 6. Test IsHidden. + # 14. Test IsHidden. entity_reference_entity.set_visibility_state(False) Report.result(Tests.is_hidden, entity_reference_entity.is_hidden() is True) - # 7. Test IsVisible. + # 15. Test IsVisible. entity_reference_entity.set_visibility_state(True) general.idle_wait_frames(1) Report.result(Tests.is_visible, entity_reference_entity.is_visible() is True) - # 8. Delete Entity Reference entity. + # 16. Delete Entity Reference entity. entity_reference_entity.delete() Report.result(Tests.entity_deleted, not entity_reference_entity.exists()) - # 9. UNDO deletion. + # 17. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, entity_reference_entity.exists()) - # 10. REDO deletion. + # 18. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not entity_reference_entity.exists()) - # 11. Look for errors and asserts. + # 19. Look for errors and asserts. TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0) for error_info in error_tracer.errors: Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}") From 42b7f21689e99298df71c1591162509be73994ca Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 21 Jan 2022 11:55:02 -0800 Subject: [PATCH 357/620] Fixed a place where GetFullName was still being used. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Code/Source/Material/EditorMaterialComponentUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp index f46876fdfb..d4dd4f3a0e 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp @@ -134,7 +134,7 @@ namespace AZ propertyValue = AZ::RPI::MaterialPropertyValue::FromAny(propertyOverrideItr->second); } - if (!AtomToolsFramework::ConvertToExportFormat(path, propertyId.GetFullName(), propertyDefinition, propertyValue)) + if (!AtomToolsFramework::ConvertToExportFormat(path, propertyId, propertyDefinition, propertyValue)) { AZ_Error("AZ::Render::EditorMaterialComponentUtil", false, "Failed to export: %s", path.c_str()); result = false; From 2c33240b72f22494c4361157b7ac6a1c39aeb323 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Fri, 21 Jan 2022 13:55:19 -0600 Subject: [PATCH 358/620] Converting Dynamic Vegetation and Gradient Signal tests to utilize prefab system (#7034) * Adding on-disk prefabs for automated tests Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> * Resolving import conflict with cherrypick Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> * Updating DynVeg tests to use open_base_level function Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> * Converting initial set of DynVeg tests to utilize prefab system Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> * Finalizing DynVeg test conversion to use prefab system Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> * Removing old test runners Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> * Removing optimized suffix from optimized test runners Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> * Removing unoptimized test runner Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> * Removing optimized suffix from optimized test runner Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> * Adding wait_for_condition on level save for E2E tests Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- AutomatedTesting/Assets/Prefabs/Bush.prefab | 129 + .../Assets/Prefabs/BushFlowerBlender.prefab | 2249 +++++++++++++++++ .../Assets/Prefabs/PurpleFlower.prefab | 129 + .../flower_pink.vegdescriptorlist | 6 +- .../hydra_editor_utils.py | 2 +- .../PythonTests/largeworlds/CMakeLists.txt | 6 +- ...rides_InstancesPlantAtSpecifiedAltitude.py | 10 +- .../AltitudeFilter_FilterStageToggle.py | 9 +- ...ample_InstancesPlantAtSpecifiedAltitude.py | 7 +- ...binedDescriptorsExpressInConfiguredArea.py | 44 +- ...tSelector_InstancesExpressBasedOnWeight.py | 12 +- ...errides_InstancesPlantAtSpecifiedRadius.py | 11 +- ...nFilter_InstancesPlantAtSpecifiedRadius.py | 11 +- .../DynVegUtils_TempPrefabCreationWorks.py | 10 +- ...nstanceSpawner_DynamicSliceSpawnerWorks.py | 3 +- .../EmptyInstanceSpawner_EmptySpawnerWorks.py | 3 +- ...anceSpawnerPriority_LayerAndSubPriority.py | 10 +- .../EditorScripts/LayerBlender_E2E_Editor.py | 31 +- ...locker_InstancesBlockedInConfiguredArea.py | 11 +- .../LayerSpawner_FilterStageToggle.py | 9 +- .../LayerSpawner_InheritBehaviorFlag.py | 25 +- ...wner_InstancesPlantInAllSupportedShapes.py | 12 +- ...tancesRefreshUsingCorrectViewportCamera.py | 15 +- .../MeshBlocker_InstancesBlockedByMesh.py | 12 +- ...cker_InstancesBlockedByMeshHeightTuning.py | 12 +- ...faceTagEmitter_DependentOnMeshComponent.py | 3 +- ...mitter_SurfaceTagsAddRemoveSuccessfully.py | 3 +- ...ysXColliderSurfaceTagEmitter_E2E_Editor.py | 9 +- ...PositionModifier_AutoSnapToSurfaceWorks.py | 10 +- ...rrides_InstancesPlantAtSpecifiedOffsets.py | 9 +- ... => PrefabInstanceSpawner_Embedded_E2E.py} | 16 +- ... => PrefabInstanceSpawner_External_E2E.py} | 7 +- ...ierOverrides_InstancesRotateWithinRange.py | 9 +- ...tionModifier_InstancesRotateWithinRange.py | 9 +- ...odifierOverrides_InstancesProperlyScale.py | 9 +- .../ScaleModifier_InstancesProperlyScale.py | 10 +- ...apeIntersectionFilter_FilterStageToggle.py | 9 +- ...ionFilter_InstancesPlantInAssignedShape.py | 10 +- ...ifierOverrides_InstanceSurfaceAlignment.py | 9 +- ...gnmentModifier_InstanceSurfaceAlignment.py | 9 +- ...AndOverrides_InstancesPlantOnValidSlope.py | 9 +- ...PrefabCreationAndVisibilityToggleWorks.py} | 79 +- .../SurfaceDataRefreshes_RemainsStable.py | 5 +- ...tipleDescriptorOverridesPlantAsExpected.py | 10 +- ...rfaceMaskFilter_BasicSurfaceTagCreation.py | 6 +- .../SurfaceMaskFilter_ExclusionList.py | 12 +- .../SurfaceMaskFilter_InclusionList.py | 12 +- .../SystemSettings_SectorPointDensity.py | 9 +- .../SystemSettings_SectorSize.py | 9 +- ...getationInstances_DespawnWhenOutOfRange.py | 10 +- .../largeworlds/dyn_veg/TestSuite_Main.py | 166 +- .../dyn_veg/TestSuite_Main_Optimized.py | 192 -- .../largeworlds/dyn_veg/TestSuite_Periodic.py | 270 +- .../dyn_veg/TestSuite_Periodic_Optimized.py | 23 - .../GradientGenerators_Incompatibilities.py | 3 +- .../GradientModifiers_Incompatibilities.py | 3 +- ...ClearingPinnedEntitySetsPreviewToOrigin.py | 3 +- ...eviewSettings_DefaultPinnedEntityIsSelf.py | 3 +- ...GradientReferencesAddRemoveSuccessfully.py | 3 +- ...SurfaceTagEmitter_ComponentDependencies.py | 3 +- ...mitter_SurfaceTagsAddRemoveSuccessfully.py | 3 +- ...ponentIncompatibleWithExpectedGradients.py | 3 +- ...sform_ComponentIncompatibleWithSpawners.py | 3 +- ..._FrequencyZoomCanBeSetBeyondSliderRange.py | 3 +- .../GradientTransform_RequiresShape.py | 3 +- ...ient_ProcessedImageAssignedSuccessfully.py | 3 +- .../ImageGradient_RequiresShape.py | 3 +- .../gradient_signal/TestSuite_Periodic.py | 64 +- .../TestSuite_Periodic_Optimized.py | 57 - .../editor_dynveg_test_helper.py | 45 +- .../instance_counter.scriptcanvas | 39 +- 71 files changed, 3049 insertions(+), 916 deletions(-) create mode 100644 AutomatedTesting/Assets/Prefabs/Bush.prefab create mode 100644 AutomatedTesting/Assets/Prefabs/BushFlowerBlender.prefab create mode 100644 AutomatedTesting/Assets/Prefabs/PurpleFlower.prefab rename AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/{DynamicSliceInstanceSpawner_Embedded_E2E.py => PrefabInstanceSpawner_Embedded_E2E.py} (87%) rename AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/{DynamicSliceInstanceSpawner_External_E2E.py => PrefabInstanceSpawner_External_E2E.py} (96%) rename AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/{SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py => SpawnerPrefabs_PrefabCreationAndVisibilityToggleWorks.py} (52%) delete mode 100644 AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py delete mode 100644 AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic_Optimized.py delete mode 100644 AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py diff --git a/AutomatedTesting/Assets/Prefabs/Bush.prefab b/AutomatedTesting/Assets/Prefabs/Bush.prefab new file mode 100644 index 0000000000..ef497bdcd0 --- /dev/null +++ b/AutomatedTesting/Assets/Prefabs/Bush.prefab @@ -0,0 +1,129 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "Bush", + "Components": { + "Component_[1140272189295067758]": { + "$type": "EditorInspectorComponent", + "Id": 1140272189295067758 + }, + "Component_[13437832196484687256]": { + "$type": "EditorOnlyEntityComponent", + "Id": 13437832196484687256 + }, + "Component_[1553903646452669645]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1553903646452669645 + }, + "Component_[15914009348632444632]": { + "$type": "EditorEntitySortComponent", + "Id": 15914009348632444632, + "Child Entity Order": [ + "Entity_[7511491868318]" + ] + }, + "Component_[18046340308818780248]": { + "$type": "EditorPrefabComponent", + "Id": 18046340308818780248 + }, + "Component_[1948833233489872938]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 1948833233489872938, + "Parent Entity": "" + }, + "Component_[2903632350157981339]": { + "$type": "SelectionComponent", + "Id": 2903632350157981339 + }, + "Component_[48827510535192710]": { + "$type": "EditorPendingCompositionComponent", + "Id": 48827510535192710 + }, + "Component_[5609536793322429681]": { + "$type": "EditorLockComponent", + "Id": 5609536793322429681 + }, + "Component_[5859168386298620990]": { + "$type": "EditorEntityIconComponent", + "Id": 5859168386298620990 + }, + "Component_[6604616929271524505]": { + "$type": "EditorVisibilityComponent", + "Id": 6604616929271524505 + } + } + }, + "Entities": { + "Entity_[7511491868318]": { + "Id": "Entity_[7511491868318]", + "Name": "Bush", + "Components": { + "Component_[10227459330338484901]": { + "$type": "EditorInspectorComponent", + "Id": 10227459330338484901, + "ComponentOrderEntryArray": [ + { + "ComponentId": 4998941225335869157 + }, + { + "ComponentId": 9922994635792843826, + "SortIndex": 1 + } + ] + }, + "Component_[10972351222359420947]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10972351222359420947 + }, + "Component_[12101122374155214392]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12101122374155214392 + }, + "Component_[1535264614652988260]": { + "$type": "SelectionComponent", + "Id": 1535264614652988260 + }, + "Component_[16367811417907891218]": { + "$type": "EditorVisibilityComponent", + "Id": 16367811417907891218 + }, + "Component_[17044216787716682880]": { + "$type": "EditorEntitySortComponent", + "Id": 17044216787716682880 + }, + "Component_[2129822594969629430]": { + "$type": "EditorEntityIconComponent", + "Id": 2129822594969629430 + }, + "Component_[2838015156782745450]": { + "$type": "EditorLockComponent", + "Id": 2838015156782745450 + }, + "Component_[4998941225335869157]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4998941225335869157, + "Parent Entity": "ContainerEntity" + }, + "Component_[8773358049076362578]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8773358049076362578 + }, + "Component_[9922994635792843826]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 9922994635792843826, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{1201406D-FB20-5B5F-B9B5-6A6E8DE00A14}", + "subId": 276506120 + }, + "assetHint": "assets/objects/foliage/bush_privet_01.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Assets/Prefabs/BushFlowerBlender.prefab b/AutomatedTesting/Assets/Prefabs/BushFlowerBlender.prefab new file mode 100644 index 0000000000..b938701b6a --- /dev/null +++ b/AutomatedTesting/Assets/Prefabs/BushFlowerBlender.prefab @@ -0,0 +1,2249 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "BushFlowerBlender", + "Components": { + "Component_[10351434005293588180]": { + "$type": "EditorLockComponent", + "Id": 10351434005293588180 + }, + "Component_[10967554916960846519]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10967554916960846519 + }, + "Component_[14400678265986305456]": { + "$type": "EditorEntityIconComponent", + "Id": 14400678265986305456 + }, + "Component_[15365520792759708998]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15365520792759708998 + }, + "Component_[16281192066639198814]": { + "$type": "EditorEntitySortComponent", + "Id": 16281192066639198814, + "Child Entity Order": [ + "Entity_[263598916892318]" + ] + }, + "Component_[16356049875968660722]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16356049875968660722, + "Parent Entity": "" + }, + "Component_[16391695178646515457]": { + "$type": "SelectionComponent", + "Id": 16391695178646515457 + }, + "Component_[16407238476365087382]": { + "$type": "EditorVisibilityComponent", + "Id": 16407238476365087382 + }, + "Component_[3542701736829700396]": { + "$type": "EditorPendingCompositionComponent", + "Id": 3542701736829700396 + }, + "Component_[5160094530340900971]": { + "$type": "EditorInspectorComponent", + "Id": 5160094530340900971 + }, + "Component_[6432428663776737136]": { + "$type": "EditorPrefabComponent", + "Id": 6432428663776737136 + } + } + }, + "Entities": { + "Entity_[263573147088542]": { + "Id": "Entity_[263573147088542]", + "Name": "BushSpawner", + "Components": { + "Component_[11886309121583108836]": { + "$type": "EditorPositionModifierComponent", + "Id": 11886309121583108836, + "Configuration": { + "GradientX": { + "GradientId": "Entity_[263590326957726]" + }, + "GradientY": { + "GradientId": "Entity_[263590326957726]" + }, + "GradientZ": { + "GradientId": "" + } + } + }, + "Component_[1240444912193942742]": { + "$type": "{DD96FD51-A86B-48BC-A6AB-89183B538269} EditorSpawnerComponent", + "Id": 1240444912193942742, + "PreviewEntity": "Entity_[263573147088542]" + }, + "Component_[12813702285187817973]": { + "$type": "EditorInspectorComponent", + "Id": 12813702285187817973, + "ComponentOrderEntryArray": [ + { + "ComponentId": 18133156195370267728 + }, + { + "ComponentId": 13450250419263773680, + "SortIndex": 1 + }, + { + "ComponentId": 8841963751527151666, + "SortIndex": 2 + }, + { + "ComponentId": 1240444912193942742, + "SortIndex": 3 + }, + { + "ComponentId": 17991239182321715249, + "SortIndex": 4 + }, + { + "ComponentId": 14175761523159824993, + "SortIndex": 5 + }, + { + "ComponentId": 2884829698060689565, + "SortIndex": 6 + }, + { + "ComponentId": 11886309121583108836, + "SortIndex": 7 + } + ] + }, + "Component_[13179606361687972691]": { + "$type": "EditorEntityIconComponent", + "Id": 13179606361687972691 + }, + "Component_[13450250419263773680]": { + "$type": "EditorReferenceShapeComponent", + "Id": 13450250419263773680, + "Configuration": { + "ShapeEntityId": "Entity_[263607506826910]" + } + }, + "Component_[13688014277574607552]": { + "$type": "EditorOnlyEntityComponent", + "Id": 13688014277574607552 + }, + "Component_[14175761523159824993]": { + "$type": "EditorDistributionFilterComponent", + "Id": 14175761523159824993, + "Configuration": { + "ThresholdMin": 0.289000004529953, + "ThresholdMax": 0.5690000057220459, + "Gradient": { + "GradientId": "Entity_[263603211859614]" + } + } + }, + "Component_[14232774271081092639]": { + "$type": "EditorLockComponent", + "Id": 14232774271081092639 + }, + "Component_[14811533745267383811]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14811533745267383811 + }, + "Component_[17540078415915694273]": { + "$type": "EditorVisibilityComponent", + "Id": 17540078415915694273 + }, + "Component_[17991239182321715249]": { + "$type": "EditorRotationModifierComponent", + "Id": 17991239182321715249, + "Configuration": { + "GradientX": { + "GradientId": "" + }, + "GradientY": { + "GradientId": "" + }, + "GradientZ": { + "GradientId": "Entity_[263590326957726]" + } + } + }, + "Component_[18133156195370267728]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18133156195370267728, + "Parent Entity": "Entity_[263607506826910]" + }, + "Component_[2884829698060689565]": { + "$type": "EditorScaleModifierComponent", + "Id": 2884829698060689565, + "Configuration": { + "RangeMin": 0.75, + "RangeMax": 1.25, + "Gradient": { + "GradientId": "Entity_[263590326957726]" + } + } + }, + "Component_[50628676751372416]": { + "$type": "EditorEntitySortComponent", + "Id": 50628676751372416, + "Child Entity Order": [ + "Entity_[263603211859614]", + "Entity_[263590326957726]" + ] + }, + "Component_[5689270312836823309]": { + "$type": "SelectionComponent", + "Id": 5689270312836823309 + }, + "Component_[7105803915999711758]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7105803915999711758 + }, + "Component_[8841963751527151666]": { + "$type": "EditorDescriptorListComponent", + "Id": 8841963751527151666, + "Configuration": { + "Descriptors": [ + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{EE51E73C-D753-54AC-A1C0-4F29844FB6C3}", + "subId": 2740536329 + }, + "assetHint": "assets/prefabs/bush.spawnable" + } + } + } + ] + } + } + } + }, + "Entity_[263577442055838]": { + "Id": "Entity_[263577442055838]", + "Name": "RandomNoise", + "Components": { + "Component_[13412023990029767074]": { + "$type": "EditorRandomGradientComponent", + "Id": 13412023990029767074, + "PreviewEntity": "Entity_[263577442055838]" + }, + "Component_[14048059127502350032]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 14048059127502350032, + "Parent Entity": "Entity_[263581737023134]" + }, + "Component_[15585968636846328006]": { + "$type": "EditorEntitySortComponent", + "Id": 15585968636846328006 + }, + "Component_[17356242264256499333]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17356242264256499333 + }, + "Component_[2157320692130316849]": { + "$type": "EditorLockComponent", + "Id": 2157320692130316849 + }, + "Component_[2167582872687341084]": { + "$type": "EditorReferenceShapeComponent", + "Id": 2167582872687341084, + "Configuration": { + "ShapeEntityId": "Entity_[263607506826910]" + } + }, + "Component_[2794166072748175035]": { + "$type": "SelectionComponent", + "Id": 2794166072748175035 + }, + "Component_[4784966656524567789]": { + "$type": "EditorVisibilityComponent", + "Id": 4784966656524567789 + }, + "Component_[6185400249317227261]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 6185400249317227261 + }, + "Component_[639949486729001685]": { + "$type": "EditorGradientTransformComponent", + "Id": 639949486729001685, + "Configuration": { + "ShapeReference": "", + "Bounds": [ + 50.0, + 50.0, + 1.0 + ] + } + }, + "Component_[7347819195697153472]": { + "$type": "EditorEntityIconComponent", + "Id": 7347819195697153472 + }, + "Component_[9225409585951117678]": { + "$type": "EditorInspectorComponent", + "Id": 9225409585951117678, + "ComponentOrderEntryArray": [ + { + "ComponentId": 14048059127502350032 + }, + { + "ComponentId": 2167582872687341084, + "SortIndex": 1 + }, + { + "ComponentId": 639949486729001685, + "SortIndex": 2 + }, + { + "ComponentId": 13412023990029767074, + "SortIndex": 3 + } + ] + }, + "Component_[9667056664436803603]": { + "$type": "EditorPendingCompositionComponent", + "Id": 9667056664436803603 + } + } + }, + "Entity_[263581737023134]": { + "Id": "Entity_[263581737023134]", + "Name": "FlowerSpawner", + "Components": { + "Component_[10064436441176637741]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10064436441176637741 + }, + "Component_[10418076448308581948]": { + "$type": "EditorRotationModifierComponent", + "Id": 10418076448308581948, + "Configuration": { + "GradientX": { + "GradientId": "" + }, + "GradientY": { + "GradientId": "" + }, + "GradientZ": { + "GradientId": "Entity_[263577442055838]" + } + } + }, + "Component_[12484622175138429315]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12484622175138429315 + }, + "Component_[12590590072231203407]": { + "$type": "EditorLockComponent", + "Id": 12590590072231203407 + }, + "Component_[13079591667184987458]": { + "$type": "EditorScaleModifierComponent", + "Id": 13079591667184987458, + "Configuration": { + "RangeMin": 0.75, + "RangeMax": 1.25, + "Gradient": { + "GradientId": "Entity_[263577442055838]" + } + } + }, + "Component_[13174773394274524631]": { + "$type": "EditorInspectorComponent", + "Id": 13174773394274524631, + "ComponentOrderEntryArray": [ + { + "ComponentId": 1915862229814997128 + }, + { + "ComponentId": 582800388831726963, + "SortIndex": 1 + }, + { + "ComponentId": 18006385801184712266, + "SortIndex": 2 + }, + { + "ComponentId": 6902499453501456890, + "SortIndex": 3 + }, + { + "ComponentId": 10418076448308581948, + "SortIndex": 4 + }, + { + "ComponentId": 13983302912005698250, + "SortIndex": 5 + }, + { + "ComponentId": 13079591667184987458, + "SortIndex": 6 + }, + { + "ComponentId": 7912787520673119502, + "SortIndex": 7 + } + ] + }, + "Component_[13200009872392504010]": { + "$type": "EditorEntitySortComponent", + "Id": 13200009872392504010, + "Child Entity Order": [ + "Entity_[263594621925022]", + "Entity_[263577442055838]" + ] + }, + "Component_[13983302912005698250]": { + "$type": "EditorDistributionFilterComponent", + "Id": 13983302912005698250, + "Configuration": { + "ThresholdMin": 0.2879999876022339, + "ThresholdMax": 0.5680000185966492, + "Gradient": { + "GradientId": "Entity_[263586031990430]" + } + } + }, + "Component_[14726174657215669218]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14726174657215669218 + }, + "Component_[18006385801184712266]": { + "$type": "EditorDescriptorListComponent", + "Id": 18006385801184712266, + "Configuration": { + "Descriptors": [ + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{80C0CF4E-9A5E-544B-B89E-BC980175A259}", + "subId": 3875079122 + }, + "assetHint": "assets/prefabs/pinkflower.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{20DD1202-A434-5482-9FB9-AED4C78F6CBF}", + "subId": 2669863854 + }, + "assetHint": "assets/prefabs/purpleflower.spawnable" + } + } + }, + { + "SpawnerType": "{23C40FD4-A55F-4BD3-BE5B-DC5423F217C2}", + "InstanceSpawner": { + "$type": "EmptyInstanceSpawner" + } + } + ] + } + }, + "Component_[1915862229814997128]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 1915862229814997128, + "Parent Entity": "Entity_[263607506826910]" + }, + "Component_[2123416208548010747]": { + "$type": "SelectionComponent", + "Id": 2123416208548010747 + }, + "Component_[4172073657954183661]": { + "$type": "EditorVisibilityComponent", + "Id": 4172073657954183661 + }, + "Component_[4297556504463195307]": { + "$type": "EditorEntityIconComponent", + "Id": 4297556504463195307 + }, + "Component_[582800388831726963]": { + "$type": "EditorReferenceShapeComponent", + "Id": 582800388831726963, + "Configuration": { + "ShapeEntityId": "Entity_[263607506826910]" + } + }, + "Component_[6902499453501456890]": { + "$type": "{DD96FD51-A86B-48BC-A6AB-89183B538269} EditorSpawnerComponent", + "Id": 6902499453501456890, + "PreviewEntity": "Entity_[263581737023134]" + }, + "Component_[7912787520673119502]": { + "$type": "EditorPositionModifierComponent", + "Id": 7912787520673119502, + "Configuration": { + "GradientX": { + "GradientId": "Entity_[263577442055838]" + }, + "GradientY": { + "GradientId": "Entity_[263577442055838]" + }, + "GradientZ": { + "GradientId": "" + } + } + } + } + }, + "Entity_[263586031990430]": { + "Id": "Entity_[263586031990430]", + "Name": "Invert", + "Components": { + "Component_[11123278080744920525]": { + "$type": "EditorEntitySortComponent", + "Id": 11123278080744920525 + }, + "Component_[1199715693160400161]": { + "$type": "EditorInspectorComponent", + "Id": 1199715693160400161, + "ComponentOrderEntryArray": [ + { + "ComponentId": 7438979211266329827 + }, + { + "ComponentId": 6027557066164356793, + "SortIndex": 1 + }, + { + "ComponentId": 8903771095804438921, + "SortIndex": 2 + } + ] + }, + "Component_[12162816428693886169]": { + "$type": "EditorEntityIconComponent", + "Id": 12162816428693886169 + }, + "Component_[14493180089799969074]": { + "$type": "EditorVisibilityComponent", + "Id": 14493180089799969074 + }, + "Component_[16206759293595766479]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16206759293595766479 + }, + "Component_[17566144032052847628]": { + "$type": "SelectionComponent", + "Id": 17566144032052847628 + }, + "Component_[17784057508127919200]": { + "$type": "EditorLockComponent", + "Id": 17784057508127919200 + }, + "Component_[18377773171420051348]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18377773171420051348 + }, + "Component_[6027557066164356793]": { + "$type": "EditorReferenceShapeComponent", + "Id": 6027557066164356793, + "Configuration": { + "ShapeEntityId": "Entity_[263607506826910]" + } + }, + "Component_[7438979211266329827]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7438979211266329827, + "Parent Entity": "Entity_[263594621925022]" + }, + "Component_[8421650081106982664]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8421650081106982664 + }, + "Component_[8903771095804438921]": { + "$type": "EditorInvertGradientComponent", + "Id": 8903771095804438921, + "Configuration": { + "Gradient": { + "GradientId": "Entity_[263594621925022]" + } + }, + "PreviewEntity": "Entity_[263586031990430]" + } + } + }, + "Entity_[263590326957726]": { + "Id": "Entity_[263590326957726]", + "Name": "RandomNoise", + "Components": { + "Component_[10420548607186596407]": { + "$type": "SelectionComponent", + "Id": 10420548607186596407 + }, + "Component_[11351507264577024072]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11351507264577024072, + "Parent Entity": "Entity_[263573147088542]" + }, + "Component_[11576941520191560445]": { + "$type": "EditorEntityIconComponent", + "Id": 11576941520191560445 + }, + "Component_[11787535428542045683]": { + "$type": "EditorPendingCompositionComponent", + "Id": 11787535428542045683 + }, + "Component_[11946132649485953311]": { + "$type": "EditorEntitySortComponent", + "Id": 11946132649485953311 + }, + "Component_[11970417753234451570]": { + "$type": "EditorOnlyEntityComponent", + "Id": 11970417753234451570 + }, + "Component_[13743879269876214143]": { + "$type": "EditorVisibilityComponent", + "Id": 13743879269876214143 + }, + "Component_[15614946697365576378]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15614946697365576378 + }, + "Component_[17045174842161759045]": { + "$type": "EditorLockComponent", + "Id": 17045174842161759045 + }, + "Component_[3107716031616536910]": { + "$type": "EditorInspectorComponent", + "Id": 3107716031616536910, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11351507264577024072 + }, + { + "ComponentId": 6316453818295975755, + "SortIndex": 1 + }, + { + "ComponentId": 4846745402056100407, + "SortIndex": 2 + }, + { + "ComponentId": 8967153379180885152, + "SortIndex": 3 + } + ] + }, + "Component_[4846745402056100407]": { + "$type": "EditorGradientTransformComponent", + "Id": 4846745402056100407, + "Configuration": { + "ShapeReference": "", + "Bounds": [ + 50.0, + 50.0, + 1.0 + ] + } + }, + "Component_[6316453818295975755]": { + "$type": "EditorReferenceShapeComponent", + "Id": 6316453818295975755, + "Configuration": { + "ShapeEntityId": "Entity_[263573147088542]" + } + }, + "Component_[8967153379180885152]": { + "$type": "EditorRandomGradientComponent", + "Id": 8967153379180885152, + "PreviewEntity": "Entity_[263590326957726]" + } + } + }, + "Entity_[263594621925022]": { + "Id": "Entity_[263594621925022]", + "Name": "PerlinNoise", + "Components": { + "Component_[15798567753940523121]": { + "$type": "EditorPerlinGradientComponent", + "Id": 15798567753940523121, + "Configuration": { + "randomSeed": 33, + "frequency": 0.25 + }, + "PreviewEntity": "Entity_[263594621925022]" + }, + "Component_[16035848776632936419]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16035848776632936419 + }, + "Component_[16434108759160050253]": { + "$type": "EditorVisibilityComponent", + "Id": 16434108759160050253 + }, + "Component_[16805003046507210760]": { + "$type": "EditorReferenceShapeComponent", + "Id": 16805003046507210760, + "Configuration": { + "ShapeEntityId": "Entity_[263607506826910]" + } + }, + "Component_[17679463569742913027]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17679463569742913027 + }, + "Component_[18285870860955961523]": { + "$type": "SelectionComponent", + "Id": 18285870860955961523 + }, + "Component_[2330427084045350198]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 2330427084045350198 + }, + "Component_[5921906930080711994]": { + "$type": "EditorEntitySortComponent", + "Id": 5921906930080711994, + "Child Entity Order": [ + "Entity_[263586031990430]" + ] + }, + "Component_[764117453152842781]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 764117453152842781, + "Parent Entity": "Entity_[263581737023134]" + }, + "Component_[7701931249281891300]": { + "$type": "EditorEntityIconComponent", + "Id": 7701931249281891300 + }, + "Component_[7967070680905543315]": { + "$type": "EditorInspectorComponent", + "Id": 7967070680905543315, + "ComponentOrderEntryArray": [ + { + "ComponentId": 764117453152842781 + }, + { + "ComponentId": 16805003046507210760, + "SortIndex": 1 + }, + { + "ComponentId": 8029154041194694200, + "SortIndex": 2 + }, + { + "ComponentId": 15798567753940523121, + "SortIndex": 3 + } + ] + }, + "Component_[8029154041194694200]": { + "$type": "EditorGradientTransformComponent", + "Id": 8029154041194694200, + "Configuration": { + "ShapeReference": "", + "Bounds": [ + 50.0, + 50.0, + 1.0 + ] + } + }, + "Component_[8660028910391135744]": { + "$type": "EditorLockComponent", + "Id": 8660028910391135744 + } + } + }, + "Entity_[263598916892318]": { + "Id": "Entity_[263598916892318]", + "Name": "LandscapeCanvas", + "Components": { + "Component_[12967746135199800648]": { + "$type": "EditorVisibilityComponent", + "Id": 12967746135199800648 + }, + "Component_[13081062505162225823]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13081062505162225823 + }, + "Component_[16021195931295059075]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16021195931295059075 + }, + "Component_[16134261272053586014]": { + "$type": "EditorEntityIconComponent", + "Id": 16134261272053586014 + }, + "Component_[17500735767968801510]": { + "$type": "EditorLandscapeCanvasComponent", + "Id": 17500735767968801510, + "Graph": { + "m_nodes": [ + { + "Key": 1, + "Value": { + "$type": "CylinderShapeNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "BushFlowerBlender" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263607506826910]", + "m_componentId": 6683290476113150719 + } + }, + { + "Key": 2, + "Value": { + "$type": "RandomNoiseGradientNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "RandomNoise" + } + } + } + ], + "m_inputDataSlots": [ + { + "Key": { + "m_name": "PreviewBounds" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263590326957726]", + "m_componentId": 8967153379180885152 + } + }, + { + "Key": 3, + "Value": { + "$type": "SpawnerAreaNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "BushSpawner" + } + } + } + ], + "m_inputDataSlots": [ + { + "Key": { + "m_name": "PlacementBounds" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263573147088542]", + "m_componentId": 1240444912193942742 + } + }, + { + "Key": 4, + "Value": { + "$type": "PerlinNoiseGradientNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "PerlinNoise" + } + } + } + ], + "m_inputDataSlots": [ + { + "Key": { + "m_name": "PreviewBounds" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263603211859614]", + "m_componentId": 10160640699095155981 + } + }, + { + "Key": 5, + "Value": { + "$type": "RandomNoiseGradientNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "RandomNoise" + } + } + } + ], + "m_inputDataSlots": [ + { + "Key": { + "m_name": "PreviewBounds" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263577442055838]", + "m_componentId": 13412023990029767074 + } + }, + { + "Key": 6, + "Value": { + "$type": "SpawnerAreaNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "FlowerSpawner" + } + } + } + ], + "m_inputDataSlots": [ + { + "Key": { + "m_name": "PlacementBounds" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263581737023134]", + "m_componentId": 6902499453501456890 + } + }, + { + "Key": 7, + "Value": { + "$type": "AreaBlenderNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "BushFlowerBlender" + } + } + } + ], + "m_extendableSlots": { + "InboundArea": [ + { + "m_value": { + "$type": "EntityId", + "Value": "" + } + }, + { + "m_value": { + "$type": "EntityId", + "Value": "" + }, + "m_subId": 1 + } + ] + }, + "m_vegetationEntityId": "Entity_[263607506826910]", + "m_componentId": 7229206794941734410 + } + }, + { + "Key": 8, + "Value": { + "$type": "PerlinNoiseGradientNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "PerlinNoise" + } + } + } + ], + "m_inputDataSlots": [ + { + "Key": { + "m_name": "PreviewBounds" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263594621925022]", + "m_componentId": 15798567753940523121 + } + }, + { + "Key": 9, + "Value": { + "$type": "InvertGradientModifierNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "Invert" + } + } + } + ], + "m_inputDataSlots": [ + { + "Key": { + "m_name": "InboundGradient" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + }, + { + "Key": { + "m_name": "PreviewBounds" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263586031990430]", + "m_componentId": 8903771095804438921 + } + }, + { + "Key": 10, + "Value": { + "$type": "RotationModifierNode", + "m_inputDataSlots": [ + { + "Key": { + "m_name": "InboundGradientX" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + }, + { + "Key": { + "m_name": "InboundGradientY" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + }, + { + "Key": { + "m_name": "InboundGradientZ" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263573147088542]", + "m_componentId": 17991239182321715249 + } + }, + { + "Key": 11, + "Value": { + "$type": "DistributionFilterNode", + "m_inputDataSlots": [ + { + "Key": { + "m_name": "InboundGradient" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263573147088542]", + "m_componentId": 14175761523159824993 + } + }, + { + "Key": 12, + "Value": { + "$type": "ScaleModifierNode", + "m_inputDataSlots": [ + { + "Key": { + "m_name": "InboundGradient" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263573147088542]", + "m_componentId": 2884829698060689565 + } + }, + { + "Key": 13, + "Value": { + "$type": "PositionModifierNode", + "m_inputDataSlots": [ + { + "Key": { + "m_name": "InboundGradientX" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + }, + { + "Key": { + "m_name": "InboundGradientY" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + }, + { + "Key": { + "m_name": "InboundGradientZ" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263573147088542]", + "m_componentId": 11886309121583108836 + } + }, + { + "Key": 14, + "Value": { + "$type": "RotationModifierNode", + "m_inputDataSlots": [ + { + "Key": { + "m_name": "InboundGradientX" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + }, + { + "Key": { + "m_name": "InboundGradientY" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + }, + { + "Key": { + "m_name": "InboundGradientZ" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263581737023134]", + "m_componentId": 10418076448308581948 + } + }, + { + "Key": 15, + "Value": { + "$type": "DistributionFilterNode", + "m_inputDataSlots": [ + { + "Key": { + "m_name": "InboundGradient" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263581737023134]", + "m_componentId": 13983302912005698250 + } + }, + { + "Key": 16, + "Value": { + "$type": "ScaleModifierNode", + "m_inputDataSlots": [ + { + "Key": { + "m_name": "InboundGradient" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263581737023134]", + "m_componentId": 13079591667184987458 + } + }, + { + "Key": 17, + "Value": { + "$type": "PositionModifierNode", + "m_inputDataSlots": [ + { + "Key": { + "m_name": "InboundGradientX" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + }, + { + "Key": { + "m_name": "InboundGradientY" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + }, + { + "Key": { + "m_name": "InboundGradientZ" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[263581737023134]", + "m_componentId": 7912787520673119502 + } + } + ], + "m_connections": [ + { + "m_sourceEndpoint": [ + 8, + { + "m_name": "OutboundGradient" + } + ], + "m_targetEndpoint": [ + 9, + { + "m_name": "InboundGradient" + } + ] + }, + { + "m_sourceEndpoint": [ + 3, + { + "m_name": "OutboundArea" + } + ], + "m_targetEndpoint": [ + 7, + { + "m_name": "InboundArea" + } + ] + }, + { + "m_sourceEndpoint": [ + 6, + { + "m_name": "OutboundArea" + } + ], + "m_targetEndpoint": [ + 7, + { + "m_name": "InboundArea", + "m_subId": 1 + } + ] + }, + { + "m_sourceEndpoint": [ + 1, + { + "m_name": "Bounds" + } + ], + "m_targetEndpoint": [ + 3, + { + "m_name": "PlacementBounds" + } + ] + }, + { + "m_sourceEndpoint": [ + 1, + { + "m_name": "Bounds" + } + ], + "m_targetEndpoint": [ + 6, + { + "m_name": "PlacementBounds" + } + ] + }, + { + "m_sourceEndpoint": [ + 2, + { + "m_name": "OutboundGradient" + } + ], + "m_targetEndpoint": [ + 10, + { + "m_name": "InboundGradientZ" + } + ] + }, + { + "m_sourceEndpoint": [ + 4, + { + "m_name": "OutboundGradient" + } + ], + "m_targetEndpoint": [ + 11, + { + "m_name": "InboundGradient" + } + ] + }, + { + "m_sourceEndpoint": [ + 2, + { + "m_name": "OutboundGradient" + } + ], + "m_targetEndpoint": [ + 12, + { + "m_name": "InboundGradient" + } + ] + }, + { + "m_sourceEndpoint": [ + 2, + { + "m_name": "OutboundGradient" + } + ], + "m_targetEndpoint": [ + 13, + { + "m_name": "InboundGradientX" + } + ] + }, + { + "m_sourceEndpoint": [ + 2, + { + "m_name": "OutboundGradient" + } + ], + "m_targetEndpoint": [ + 13, + { + "m_name": "InboundGradientY" + } + ] + }, + { + "m_sourceEndpoint": [ + 5, + { + "m_name": "OutboundGradient" + } + ], + "m_targetEndpoint": [ + 14, + { + "m_name": "InboundGradientZ" + } + ] + }, + { + "m_sourceEndpoint": [ + 9, + { + "m_name": "OutboundGradient" + } + ], + "m_targetEndpoint": [ + 15, + { + "m_name": "InboundGradient" + } + ] + }, + { + "m_sourceEndpoint": [ + 5, + { + "m_name": "OutboundGradient" + } + ], + "m_targetEndpoint": [ + 16, + { + "m_name": "InboundGradient" + } + ] + }, + { + "m_sourceEndpoint": [ + 5, + { + "m_name": "OutboundGradient" + } + ], + "m_targetEndpoint": [ + 17, + { + "m_name": "InboundGradientX" + } + ] + }, + { + "m_sourceEndpoint": [ + 5, + { + "m_name": "OutboundGradient" + } + ], + "m_targetEndpoint": [ + 17, + { + "m_name": "InboundGradientY" + } + ] + } + ], + "m_uiMetadata": { + "m_sceneMetadata": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 0.3771495156249999, + "AnchorX": -498.4760437011719, + "AnchorY": 808.6978149414063 + } + } + } + }, + "m_nodeMetadata": [ + { + "Key": 2, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "GradientNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 100.0, + 580.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{2D583FA2-5659-491F-8914-6302420E3F0B}" + } + } + } + }, + { + "Key": 3, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "VegetationAreaNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 480.0, + 600.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{A26480C4-A80B-4B36-ADE1-918E4541EA2B}" + } + } + } + }, + { + "Key": 5, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "GradientNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 100.0, + 1540.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{6CE9EA8B-85E7-4E17-B1D6-CA97D9D65276}" + } + } + } + }, + { + "Key": 6, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "VegetationAreaNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 480.0, + 1560.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{8FABE49F-1D73-46FE-8616-A982EEE46DDD}" + } + } + } + }, + { + "Key": 7, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "VegetationAreaNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 840.0, + 1580.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{C5EEBC1D-B91B-4852-A41D-425C6FED3FB9}" + } + } + } + }, + { + "Key": 9, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "GradientModifierNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 480.0, + 2060.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{5EB76670-0CBE-4F2A-9AE7-F65709D0BE92}" + } + } + } + }, + { + "Key": 10, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "VegetationAreaNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 147.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{5CB69A73-F7BA-4F76-AB86-F343052C3D7D}" + } + } + } + }, + { + "Key": 11, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "VegetationAreaNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 367.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{235DEBEC-E3F8-43C1-BA7E-41475B834D70}" + } + } + } + }, + { + "Key": 12, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "VegetationAreaNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 288.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{9E56E7B6-2ECE-42F9-9A23-FF7D192209D2}" + } + } + } + }, + { + "Key": 13, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "VegetationAreaNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 6.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{61759FE6-E6F7-4F4B-819B-FBFE125D7389}" + } + } + } + }, + { + "Key": 14, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "VegetationAreaNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 147.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{0AC1C6C8-7CC1-4068-A87D-F4B92AE8FCAF}" + } + } + } + }, + { + "Key": 15, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "VegetationAreaNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 367.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{5D698B90-830F-46FE-ADD8-6164EA098C3E}" + } + } + } + }, + { + "Key": 16, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "VegetationAreaNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 288.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{9DE6DE4A-2E6F-44BA-B292-3CD2215C1D5B}" + } + } + } + }, + { + "Key": 17, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "VegetationAreaNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 6.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{57FA822D-629F-4949-A8D7-D675544EBC0A}" + } + } + } + } + ] + }, + "m_nodeWrappings": [ + { + "Key": 10, + "Value": [ + 3, + 1 + ] + }, + { + "Key": 11, + "Value": [ + 3, + 6 + ] + }, + { + "Key": 12, + "Value": [ + 3, + 2 + ] + }, + { + "Key": 13, + "Value": [ + 3, + {} + ] + }, + { + "Key": 14, + "Value": [ + 6, + 1 + ] + }, + { + "Key": 15, + "Value": [ + 6, + 6 + ] + }, + { + "Key": 16, + "Value": [ + 6, + 2 + ] + }, + { + "Key": 17, + "Value": [ + 6, + {} + ] + } + ] + } + }, + "Component_[17574651838531525263]": { + "$type": "EditorEntitySortComponent", + "Id": 17574651838531525263, + "Child Entity Order": [ + "Entity_[263607506826910]" + ] + }, + "Component_[3086205760978540160]": { + "$type": "EditorLockComponent", + "Id": 3086205760978540160 + }, + "Component_[3102230753208284750]": { + "$type": "EditorInspectorComponent", + "Id": 3102230753208284750, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5796173638130327223 + }, + { + "ComponentId": 17500735767968801510, + "SortIndex": 1 + } + ] + }, + "Component_[4695341524212000585]": { + "$type": "EditorOnlyEntityComponent", + "Id": 4695341524212000585 + }, + "Component_[5796173638130327223]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5796173638130327223, + "Parent Entity": "ContainerEntity" + }, + "Component_[8278362871021770878]": { + "$type": "SelectionComponent", + "Id": 8278362871021770878 + } + } + }, + "Entity_[263603211859614]": { + "Id": "Entity_[263603211859614]", + "Name": "PerlinNoise", + "Components": { + "Component_[10006546776757889020]": { + "$type": "EditorVisibilityComponent", + "Id": 10006546776757889020 + }, + "Component_[10160640699095155981]": { + "$type": "EditorPerlinGradientComponent", + "Id": 10160640699095155981, + "Configuration": { + "randomSeed": 33, + "frequency": 0.25 + }, + "PreviewEntity": "Entity_[263603211859614]" + }, + "Component_[11506183926478566822]": { + "$type": "EditorEntitySortComponent", + "Id": 11506183926478566822 + }, + "Component_[13160180411150366392]": { + "$type": "EditorLockComponent", + "Id": 13160180411150366392 + }, + "Component_[15083697380300161163]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15083697380300161163 + }, + "Component_[15404456223257061245]": { + "$type": "EditorInspectorComponent", + "Id": 15404456223257061245, + "ComponentOrderEntryArray": [ + { + "ComponentId": 6484803030406851652 + }, + { + "ComponentId": 4912800286535654244, + "SortIndex": 1 + }, + { + "ComponentId": 2395166459126906105, + "SortIndex": 2 + }, + { + "ComponentId": 10160640699095155981, + "SortIndex": 3 + } + ] + }, + "Component_[2395166459126906105]": { + "$type": "EditorGradientTransformComponent", + "Id": 2395166459126906105, + "Configuration": { + "ShapeReference": "", + "Bounds": [ + 50.0, + 50.0, + 1.0 + ] + } + }, + "Component_[4417011400526470160]": { + "$type": "EditorEntityIconComponent", + "Id": 4417011400526470160 + }, + "Component_[4601061670472962302]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4601061670472962302 + }, + "Component_[4912800286535654244]": { + "$type": "EditorReferenceShapeComponent", + "Id": 4912800286535654244, + "Configuration": { + "ShapeEntityId": "Entity_[263607506826910]" + } + }, + "Component_[6233982345083723563]": { + "$type": "SelectionComponent", + "Id": 6233982345083723563 + }, + "Component_[6484803030406851652]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6484803030406851652, + "Parent Entity": "Entity_[263573147088542]" + }, + "Component_[6813813525871080299]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6813813525871080299 + } + } + }, + "Entity_[263607506826910]": { + "Id": "Entity_[263607506826910]", + "Name": "BushFlowerBlender", + "Components": { + "Component_[13725600808872754587]": { + "$type": "EditorEntityIconComponent", + "Id": 13725600808872754587 + }, + "Component_[15959807606564505710]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15959807606564505710, + "Parent Entity": "Entity_[263598916892318]" + }, + "Component_[1596826146661515925]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1596826146661515925 + }, + "Component_[4525591661239956058]": { + "$type": "EditorVisibilityComponent", + "Id": 4525591661239956058 + }, + "Component_[6683290476113150719]": { + "$type": "EditorCylinderShapeComponent", + "Id": 6683290476113150719, + "CylinderShape": { + "Configuration": { + "Radius": 25.0 + } + } + }, + "Component_[6879394931668195375]": { + "$type": "EditorEntitySortComponent", + "Id": 6879394931668195375, + "Child Entity Order": [ + "Entity_[263573147088542]", + "Entity_[263581737023134]" + ] + }, + "Component_[7229206794941734410]": { + "$type": "EditorAreaBlenderComponent", + "Id": 7229206794941734410, + "Configuration": { + "Operations": [ + "Entity_[263573147088542]", + "Entity_[263581737023134]" + ] + }, + "PreviewEntity": "Entity_[263607506826910]" + }, + "Component_[8772711204845372843]": { + "$type": "EditorLockComponent", + "Id": 8772711204845372843 + }, + "Component_[8959345022109725835]": { + "$type": "SelectionComponent", + "Id": 8959345022109725835 + }, + "Component_[9094488642973843583]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 9094488642973843583 + }, + "Component_[9112960617967513749]": { + "$type": "EditorInspectorComponent", + "Id": 9112960617967513749, + "ComponentOrderEntryArray": [ + { + "ComponentId": 15959807606564505710 + }, + { + "ComponentId": 7229206794941734410, + "SortIndex": 1 + }, + { + "ComponentId": 6683290476113150719, + "SortIndex": 2 + } + ] + }, + "Component_[9541665258597207652]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9541665258597207652 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Assets/Prefabs/PurpleFlower.prefab b/AutomatedTesting/Assets/Prefabs/PurpleFlower.prefab new file mode 100644 index 0000000000..a8716ec099 --- /dev/null +++ b/AutomatedTesting/Assets/Prefabs/PurpleFlower.prefab @@ -0,0 +1,129 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "PurpleFlower", + "Components": { + "Component_[10519928302743666073]": { + "$type": "EditorPrefabComponent", + "Id": 10519928302743666073 + }, + "Component_[13894087802180240181]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 13894087802180240181, + "Parent Entity": "" + }, + "Component_[15788541052719571801]": { + "$type": "EditorEntityIconComponent", + "Id": 15788541052719571801 + }, + "Component_[15842981265136092481]": { + "$type": "SelectionComponent", + "Id": 15842981265136092481 + }, + "Component_[16360384897559021149]": { + "$type": "EditorInspectorComponent", + "Id": 16360384897559021149 + }, + "Component_[16713545675046303279]": { + "$type": "EditorVisibilityComponent", + "Id": 16713545675046303279 + }, + "Component_[1806734194268113785]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1806734194268113785 + }, + "Component_[5392020700593853313]": { + "$type": "EditorEntitySortComponent", + "Id": 5392020700593853313, + "Child Entity Order": [ + "Entity_[14335611090324]" + ] + }, + "Component_[5995854518752659458]": { + "$type": "EditorLockComponent", + "Id": 5995854518752659458 + }, + "Component_[6963022284400845376]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 6963022284400845376 + }, + "Component_[8055275578170091546]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8055275578170091546 + } + } + }, + "Entities": { + "Entity_[14335611090324]": { + "Id": "Entity_[14335611090324]", + "Name": "PurpleFlower", + "Components": { + "Component_[10887353073528055802]": { + "$type": "EditorPendingCompositionComponent", + "Id": 10887353073528055802 + }, + "Component_[12641127425852859189]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12641127425852859189, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{D493A670-6D82-5AE9-A2C8-A2EB02684F71}", + "subId": 284799939 + }, + "assetHint": "assets/objects/foliage/grass_flower_purple.azmodel" + } + } + } + }, + "Component_[14406733303466080015]": { + "$type": "EditorInspectorComponent", + "Id": 14406733303466080015, + "ComponentOrderEntryArray": [ + { + "ComponentId": 9231452352781000222 + }, + { + "ComponentId": 12641127425852859189, + "SortIndex": 1 + } + ] + }, + "Component_[1452384341905923012]": { + "$type": "EditorLockComponent", + "Id": 1452384341905923012 + }, + "Component_[2215454016415585892]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 2215454016415585892 + }, + "Component_[4104108067383423623]": { + "$type": "EditorVisibilityComponent", + "Id": 4104108067383423623 + }, + "Component_[4197335450471807917]": { + "$type": "SelectionComponent", + "Id": 4197335450471807917 + }, + "Component_[6877680739064997650]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6877680739064997650 + }, + "Component_[7372550507186490390]": { + "$type": "EditorEntityIconComponent", + "Id": 7372550507186490390 + }, + "Component_[7673532337364366244]": { + "$type": "EditorEntitySortComponent", + "Id": 7673532337364366244 + }, + "Component_[9231452352781000222]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 9231452352781000222, + "Parent Entity": "ContainerEntity" + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Assets/VegDescriptorLists/flower_pink.vegdescriptorlist b/AutomatedTesting/Assets/VegDescriptorLists/flower_pink.vegdescriptorlist index 372cafbdce..9120d992c7 100644 --- a/AutomatedTesting/Assets/VegDescriptorLists/flower_pink.vegdescriptorlist +++ b/AutomatedTesting/Assets/VegDescriptorLists/flower_pink.vegdescriptorlist @@ -2,11 +2,11 @@ - + - + - + diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py index 36fc6003f7..ac74c611a2 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py @@ -5,9 +5,9 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ +import collections.abc from typing import List from math import isclose -import collections.abc import azlmbr.bus as bus import azlmbr.editor as editor diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt index ba607ede32..2e3e72883c 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt @@ -14,7 +14,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ NAME AutomatedTesting::DynamicVegetationTests_Main_Optimized TEST_SERIAL TEST_SUITE main - PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg/TestSuite_Main_Optimized.py + PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg/TestSuite_Main.py RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -27,7 +27,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ NAME AutomatedTesting::DynamicVegetationTests_Periodic_Optimized TEST_SERIAL TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg/TestSuite_Periodic_Optimized.py + PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg/TestSuite_Periodic.py RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -58,7 +58,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ NAME AutomatedTesting::GradientSignalTests_Periodic_Optimized TEST_SERIAL TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/TestSuite_Periodic_Optimized.py + PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/TestSuite_Periodic.py RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude.py index 66aa6d27ad..aa5e5e4f9c 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude.py @@ -51,22 +51,18 @@ def AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude(): import os - import azlmbr.asset as asset import azlmbr.editor as editor import azlmbr.legacy.general as general import azlmbr.bus as bus import azlmbr.math as math - import azlmbr.prefab as prefab import editor_python_test_tools.hydra_editor_utils as hydra - from editor_python_test_tools.prefab_utils import Prefab from largeworlds.large_worlds_utils import editor_dynveg_test_helper as dynveg from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("", "Base") + hydra.open_base_level() # Set view of planting area for visual debugging general.set_current_view_position(512.0, 500.0, 38.0) @@ -76,9 +72,9 @@ def AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude(): center_point = math.Vector3(512.0, 512.0, 32.0) flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") - flower_prefab = dynveg.create_temp_mesh_prefab(flower_asset_path, "PinkFlower")[0] + flower_prefab = dynveg.create_temp_mesh_prefab(flower_asset_path, "AltFilter_PinkFlower")[0] - spawner_entity = dynveg.create_prefab_vegetation_area("Instance Spawner", center_point, 32.0, 32.0, 32.0, flower_prefab) + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", center_point, 32.0, 32.0, 32.0, flower_prefab) # Add a Vegetation Altitude Filter spawner_entity.add_component("Vegetation Altitude Filter") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_FilterStageToggle.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_FilterStageToggle.py index 06f6c2a7b4..be2c5e4d8c 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_FilterStageToggle.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_FilterStageToggle.py @@ -32,9 +32,7 @@ def AltitudeFilter_FilterStageToggle(): import os import azlmbr.legacy.general as general - import azlmbr.bus as bus import azlmbr.math as math - import azlmbr.prefab as prefab import editor_python_test_tools.hydra_editor_utils as hydra from largeworlds.large_worlds_utils import editor_dynveg_test_helper as dynveg @@ -45,17 +43,16 @@ def AltitudeFilter_FilterStageToggle(): POSTPROCESS_INSTANCE_COUNT = 34 # Open an existing simple level - helper.init_idle() - helper.open_level("", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # Create basic vegetation entity position = math.Vector3(512.0, 512.0, 32.0) flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") - flower_prefab = dynveg.create_temp_mesh_prefab(flower_asset_path, "PinkFlower")[0] + flower_prefab = dynveg.create_temp_mesh_prefab(flower_asset_path, "AltFilter_PinkFlower2")[0] - vegetation = dynveg.create_prefab_vegetation_area("vegetation", position, 16.0, 16.0, 16.0, flower_prefab) + vegetation = dynveg.create_temp_prefab_vegetation_area("vegetation", position, 16.0, 16.0, 16.0, flower_prefab) # Add a Vegetation Altitude Filter to the vegetation area entity vegetation.add_component("Vegetation Altitude Filter") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude.py index 544a58e242..1e9762d7d8 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude.py @@ -56,8 +56,7 @@ def AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("", "Base") + hydra.open_base_level() # Set view of planting area for visual debugging general.set_current_view_position(512.0, 500.0, 38.0) @@ -67,9 +66,9 @@ def AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude(): center_point = math.Vector3(512.0, 512.0, 32.0) flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") - flower_prefab = dynveg.create_temp_mesh_prefab(flower_asset_path, "PinkFlower")[0] + flower_prefab = dynveg.create_temp_mesh_prefab(flower_asset_path, "AltFilter_PinkFlower3")[0] - spawner_entity = dynveg.create_prefab_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 16.0, flower_prefab) + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 16.0, flower_prefab) # Add a Vegetation Altitude Filter spawner_entity.add_component("Vegetation Altitude Filter") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea.py index a856256929..7242b0b629 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea.py @@ -56,19 +56,21 @@ def AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea(): """ import os + from pathlib import Path import azlmbr.bus as bus import azlmbr.editor as editor import azlmbr.legacy.general as general import azlmbr.math as math import azlmbr.vegetation as vegetation + import azlmbr.prefab as prefab import editor_python_test_tools.hydra_editor_utils as hydra from largeworlds.large_worlds_utils import editor_dynveg_test_helper as dynveg from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper - def create_asset_list_entity(name, center, dynamic_slice_asset_path): + def create_asset_list_entity(name, center, target_prefab): asset_list_entity = hydra.Entity(name) asset_list_entity.create_entity( center, @@ -77,18 +79,34 @@ def AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea(): if asset_list_entity.id.IsValid(): print(f"'{asset_list_entity.name}' created") - # Set the Asset List to a Dynamic Slice spawner with a specific slice asset selected - dynamic_slice_spawner = vegetation.DynamicSliceInstanceSpawner() - dynamic_slice_spawner.SetSliceAssetPath(dynamic_slice_asset_path) + if target_prefab: + # Get the in-memory spawnable asset id if exists + spawnable_name = Path(target_prefab.file_path).stem + spawnable_asset_id = prefab.PrefabPublicRequestBus(bus.Broadcast, 'GetInMemorySpawnableAssetId', + spawnable_name) + + # Create the in-memory spawnable asset from given prefab if the spawnable does not exist + if not spawnable_asset_id.is_valid(): + create_spawnable_result = prefab.PrefabPublicRequestBus(bus.Broadcast, 'CreateInMemorySpawnableAsset', + target_prefab.file_path, + spawnable_name) + assert create_spawnable_result.IsSuccess(), \ + f"Prefab operation 'CreateInMemorySpawnableAssets' failed. Error: {create_spawnable_result.GetError()}" + spawnable_asset_id = create_spawnable_result.GetValue() + else: + spawnable_asset_id = None + + # Set the vegetation area to a prefab instance spawner with a specific prefab asset selected descriptor = hydra.get_component_property_value(asset_list_entity.components[0], - "Configuration|Embedded Assets|[0]") - descriptor.spawner = dynamic_slice_spawner + 'Configuration|Embedded Assets|[0]') + prefab_spawner = vegetation.PrefabInstanceSpawner() + prefab_spawner.SetPrefabAssetId(spawnable_asset_id) + descriptor.spawner = prefab_spawner asset_list_entity.get_set_test(0, "Configuration|Embedded Assets|[0]", descriptor) return asset_list_entity # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Set view of planting area for visual debugging general.set_current_view_position(512.0, 500.0, 38.0) @@ -96,11 +114,13 @@ def AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea(): # 2) Create 3 entities with Vegetation Asset List components set to spawn different descriptors center_point = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - asset_path2 = os.path.join("Slices", "PurpleFlower.dynamicslice") - asset_list_entity = create_asset_list_entity("Asset List 1", center_point, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "AssetList_PinkFlower")[0] + purple_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + purple_flower_prefab = dynveg.create_temp_mesh_prefab(purple_flower_asset_path, "AssetList_PurpleFlower")[0] + asset_list_entity = create_asset_list_entity("Asset List 1", center_point, pink_flower_prefab) asset_list_entity2 = create_asset_list_entity("Asset List 2", center_point, None) - asset_list_entity3 = create_asset_list_entity("Asset List 3", center_point, asset_path2) + asset_list_entity3 = create_asset_list_entity("Asset List 3", center_point, purple_flower_prefab) # 3) Create a planting surface and add a Vegetation System Settings level component with instances set to spawn # on center instead of corner diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetWeightSelector_InstancesExpressBasedOnWeight.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetWeightSelector_InstancesExpressBasedOnWeight.py index b8b50f8110..8ea0b6b23d 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetWeightSelector_InstancesExpressBasedOnWeight.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetWeightSelector_InstancesExpressBasedOnWeight.py @@ -56,8 +56,7 @@ def AssetWeightSelector_InstancesExpressBasedOnWeight(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Set view of planting area for visual debugging general.set_current_view_position(512.0, 500.0, 38.0) @@ -66,14 +65,15 @@ def AssetWeightSelector_InstancesExpressBasedOnWeight(): # 2) Create a new instance spawner entity with multiple Dynamic Slice Instance Spawner descriptors, one set to a # valid slice entity, and one set to None spawner_center_point = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", spawner_center_point, 16.0, 16.0, 16.0, - asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "AssetWeight_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", spawner_center_point, 16.0, 16.0, 16.0, + pink_flower_prefab) desc_asset = hydra.get_component_property_value(spawner_entity.components[2], "Configuration|Embedded Assets")[0] desc_list = [desc_asset, desc_asset] spawner_entity.get_set_test(2, "Configuration|Embedded Assets", desc_list) - spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[1]|Instance|Slice Asset", None) + spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[1]|Instance|Prefab Asset", None) # Add an Asset Weight Selector component to the spawner entity spawner_entity.add_component("Vegetation Asset Weight Selector") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius.py index ed5501d719..be0fe8dba7 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius.py @@ -64,16 +64,15 @@ def DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius(): instance_query_point_c = math.Vector3(515.0, 512.5, 32.0) # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") - + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # 2) Create a new entity with required vegetation area components spawner_center_point = math.Vector3(520.0, 520.0, 32.0) - asset_path = os.path.join("Slices", "1m_cube.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", spawner_center_point, 16.0, 16.0, 16.0, - asset_path) + cube_asset_path = os.path.join("testdata", "multi-mat_fbx", "multi-mat_1m_cube.azmodel") + cube_prefab = dynveg.create_temp_mesh_prefab(cube_asset_path, "DistanceBetween_1m_cube2")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", spawner_center_point, 16.0, 16.0, 16.0, + cube_prefab) # 3) Create a surface to plant on surface_center_point = math.Vector3(512.0, 512.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius.py index c24ec3c314..b2244fdfa7 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius.py @@ -62,16 +62,15 @@ def DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius(): instance_query_point_c = math.Vector3(515.0, 512.5, 32.0) # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") - + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # 2) Create a new entity with required vegetation area components spawner_center_point = math.Vector3(520.0, 520.0, 32.0) - asset_path = os.path.join("Slices", "1m_cube.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", spawner_center_point, 16.0, 16.0, 16.0, - asset_path) + cube_asset_path = os.path.join("testdata", "multi-mat_fbx", "multi-mat_1m_cube.azmodel") + cube_prefab = dynveg.create_temp_mesh_prefab(cube_asset_path, "DistanceBetween_1m_cube")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", spawner_center_point, + 16.0, 16.0, 16.0, cube_prefab) # 3) Create a surface to plant on surface_center_point = math.Vector3(512.0, 512.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynVegUtils_TempPrefabCreationWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynVegUtils_TempPrefabCreationWorks.py index d016473d5e..c1ca3cbfc6 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynVegUtils_TempPrefabCreationWorks.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynVegUtils_TempPrefabCreationWorks.py @@ -39,11 +39,11 @@ def DynVegUtils_TempPrefabCreationWorks(): with Tracer() as error_tracer: # Create dictionary for prefab filenames and paths to create using helper function mesh_prefabs = { - "PinkFlower": os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel"), - "PurpleFlower": os.path.join("assets", "objects", "foliage", "grass_flower_purple.azmodel"), - "1m_Cube": os.path.join("objects", "_primitives", "_box_1x1.azmodel"), - "CedarTree": os.path.join("assets", "objects", "foliage", "cedar.azmodel"), - "Bush": os.path.join("assets", "objects", "foliage", "bush_privet_01.azmodel"), + "UtilsTest_PinkFlower": os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel"), + "UtilsTest_PurpleFlower": os.path.join("assets", "objects", "foliage", "grass_flower_purple.azmodel"), + "UtilsTest_1m_Cube": os.path.join("objects", "_primitives", "_box_1x1.azmodel"), + "UtilsTest_CedarTree": os.path.join("assets", "objects", "foliage", "cedar.azmodel"), + "UtilsTest_Bush": os.path.join("assets", "objects", "foliage", "bush_privet_01.azmodel"), } # 1) Open an existing simple level diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks.py index fcbf85c59d..c8581ad275 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks.py @@ -71,8 +71,7 @@ def DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # Grab the UUID that we need for creating an Dynamic Slice Instance Spawner diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/EmptyInstanceSpawner_EmptySpawnerWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/EmptyInstanceSpawner_EmptySpawnerWorks.py index d0a51809b4..91315a6971 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/EmptyInstanceSpawner_EmptySpawnerWorks.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/EmptyInstanceSpawner_EmptySpawnerWorks.py @@ -57,8 +57,7 @@ def EmptyInstanceSpawner_EmptySpawnerWorks(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # Grab the UUID that we need for creating an Empty Spawner diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/InstanceSpawnerPriority_LayerAndSubPriority.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/InstanceSpawnerPriority_LayerAndSubPriority.py index 471c8862fd..f83807a62b 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/InstanceSpawnerPriority_LayerAndSubPriority.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/InstanceSpawnerPriority_LayerAndSubPriority.py @@ -60,8 +60,7 @@ def InstanceSpawnerPriority_LayerAndSubPriority(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Set view of planting area for visual debugging general.set_current_view_position(512.0, 500.0, 38.0) @@ -69,9 +68,10 @@ def InstanceSpawnerPriority_LayerAndSubPriority(): # 2) Create overlapping areas: 1 instance spawner area, and 1 blocker area spawner_center_point = math.Vector3(508.0, 508.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", spawner_center_point, 16.0, 16.0, 1.0, - asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "Priority_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", spawner_center_point, 16.0, 16.0, 1.0, + pink_flower_prefab) blocker_center_point = math.Vector3(516.0, 516.0, 32.0) blocker_entity = dynveg.create_blocker_area("Instance Blocker", blocker_center_point, 16.0, 16.0, 1.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py index 6b5a80ee8e..79f2e4169b 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py @@ -85,18 +85,14 @@ def LayerBlender_E2E_Editor(): # 2) Create 2 vegetation areas with different meshes purple_position = math.Vector3(504.0, 512.0, 32.0) - purple_asset_path = os.path.join("Slices", "PurpleFlower.dynamicslice") - spawner_entity_1 = dynveg.create_dynamic_slice_vegetation_area("Purple Spawner", - purple_position, - 16.0, 16.0, 1.0, - purple_asset_path) + purple_flower_prefab_path = os.path.join("assets", "prefabs", "PurpleFlower.spawnable") + spawner_entity_1 = dynveg.create_prefab_vegetation_area("Purple Spawner", purple_position, 16.0, 16.0, 1.0, + purple_flower_prefab_path) pink_position = math.Vector3(520.0, 512.0, 32.0) - pink_asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity_2 = dynveg.create_dynamic_slice_vegetation_area("Pink Spawner", - pink_position, - 16.0, 16.0, 1.0, - pink_asset_path) + pink_flower_prefab_path = os.path.join("assets", "prefabs", "PinkFlower.spawnable") + spawner_entity_2 = dynveg.create_prefab_vegetation_area("Pink Spawner", pink_position, 16.0, 16.0, 1.0, + pink_flower_prefab_path) base_position = math.Vector3(512.0, 512.0, 32.0) dynveg.create_surface_entity("Surface Entity", @@ -135,11 +131,11 @@ def LayerBlender_E2E_Editor(): pink_count = 0 purple_count = 0 for instance in instances: - purple_asset_path = purple_asset_path.replace("\\", "/").lower() - pink_asset_path = pink_asset_path.replace("\\", "/").lower() - if instance.descriptor.spawner.GetSliceAssetPath() == pink_asset_path: + purple_flower_prefab_path = purple_flower_prefab_path.replace("\\", "/").lower() + pink_flower_prefab_path = pink_flower_prefab_path.replace("\\", "/").lower() + if instance.descriptor.spawner.GetPrefabAssetPath() == pink_flower_prefab_path: pink_count += 1 - elif instance.descriptor.spawner.GetSliceAssetPath() == purple_asset_path: + elif instance.descriptor.spawner.GetPrefabAssetPath() == purple_flower_prefab_path: purple_count += 1 Report.result(Tests.instances_blended, pink_count == purple_count and (pink_count + purple_count == num_expected)) @@ -152,11 +148,10 @@ def LayerBlender_E2E_Editor(): components.TransformBus(bus.Event, "MoveEntity", search_entity_ids[0], cam_position) azlmbr.components.TransformBus(bus.Event, "SetLocalRotation", search_entity_ids[0], cam_rot_degrees_vector) - # 6) Save and export to engine + # 6) Save the created level general.save_level() - general.export_to_engine() - pak_path = os.path.join(paths.products, "levels", lvl_name, "level.pak") - success = helper.wait_for_condition(lambda: os.path.exists(pak_path), 10.0) + level_prefab_path = os.path.join(paths.products, "levels", lvl_name, f"{lvl_name}.spawnable") + success = helper.wait_for_condition(lambda: os.path.exists(level_prefab_path), 5.0) Report.result(Tests.saved_and_exported, success) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlocker_InstancesBlockedInConfiguredArea.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlocker_InstancesBlockedInConfiguredArea.py index b89edcdeb7..5c3083ee3d 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlocker_InstancesBlockedInConfiguredArea.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlocker_InstancesBlockedInConfiguredArea.py @@ -17,7 +17,6 @@ class Tests: ) - def LayerBlocker_InstancesBlockedInConfiguredArea(): """ Summary: @@ -58,8 +57,7 @@ def LayerBlocker_InstancesBlockedInConfiguredArea(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Set view of planting area for visual debugging general.set_current_view_position(512.0, 500.0, 38.0) @@ -67,9 +65,10 @@ def LayerBlocker_InstancesBlockedInConfiguredArea(): # 2) Create a new instance spawner entity spawner_center_point = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", spawner_center_point, 16.0, 16.0, 16.0, - asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "Blocker_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", spawner_center_point, + 16.0, 16.0, 16.0, pink_flower_prefab) # 3) Create surface for planting on dynveg.create_surface_entity("Surface Entity", spawner_center_point, 32.0, 32.0, 1.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_FilterStageToggle.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_FilterStageToggle.py index 6796f56b11..a277f14a41 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_FilterStageToggle.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_FilterStageToggle.py @@ -42,16 +42,17 @@ def LayerSpawner_FilterStageToggle(): POSTPROCESS_INSTANCE_COUNT = 19 # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(500.49, 498.69, 46.66) general.set_current_view_rotation(-42.05, 0.00, -36.33) # Create a vegetation area with all needed components position = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - vegetation_entity = dynveg.create_dynamic_slice_vegetation_area("vegetation", position, 16.0, 16.0, 16.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "SpawnerFilter_PinkFlower")[0] + vegetation_entity = dynveg.create_temp_prefab_vegetation_area("vegetation", position, 16.0, 16.0, 16.0, + pink_flower_prefab) vegetation_entity.add_component("Vegetation Altitude Filter") vegetation_entity.add_component("Vegetation Position Modifier") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InheritBehaviorFlag.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InheritBehaviorFlag.py index 1153ae2657..dc06c298d1 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InheritBehaviorFlag.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InheritBehaviorFlag.py @@ -42,19 +42,16 @@ def LayerSpawner_InheritBehaviorFlag(): SURFACE_TAG = "test_tag" - def set_dynamic_slice_asset(entity_obj, component_index, dynamic_slice_asset_path): - dynamic_slice_spawner = vegetation.DynamicSliceInstanceSpawner() - dynamic_slice_spawner.SetSliceAssetPath(dynamic_slice_asset_path) - descriptor = hydra.get_component_property_value( - entity_obj.components[component_index], "Configuration|Embedded Assets|[0]" - ) - descriptor.spawner = dynamic_slice_spawner + def set_prefab_asset(entity_obj, component_index, spawnable_prefab): + descriptor = hydra.get_component_property_value(entity_obj.components[component_index], + "Configuration|Embedded Assets|[0]") + prefab_spawner = vegetation.PrefabInstanceSpawner() + prefab_spawner.SetPrefabAssetId(spawnable_prefab) + descriptor.spawner = prefab_spawner entity_obj.get_set_test(2, "Configuration|Embedded Assets|[0]", descriptor) # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") - + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # Create Emitter entity and add the required components @@ -80,7 +77,9 @@ def LayerSpawner_InheritBehaviorFlag(): veg_1.create_entity( position, ["Vegetation Layer Spawner", "Shape Reference", "Vegetation Asset List"] ) - set_dynamic_slice_asset(veg_1, 2, os.path.join("Slices", "PinkFlower.dynamicslice")) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "SpawnerInheritBehavior_PinkFlower")[0] + set_prefab_asset(veg_1, 2, pink_flower_prefab) veg_1.get_set_test(1, "Configuration|Shape Entity Id", blender_entity.id) # Create second vegetation area and assign a valid asset @@ -88,7 +87,9 @@ def LayerSpawner_InheritBehaviorFlag(): veg_2.create_entity( position, ["Vegetation Layer Spawner", "Shape Reference", "Vegetation Asset List"] ) - set_dynamic_slice_asset(veg_2, 2, os.path.join("Slices", "PurpleFlower.dynamicslice")) + purple_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + purple_flower_prefab = dynveg.create_temp_mesh_prefab(purple_flower_asset_path, "temp_PurpleFlower")[0] + set_prefab_asset(veg_2, 2, purple_flower_prefab) veg_2.get_set_test(1, "Configuration|Shape Entity Id", blender_entity.id) # Assign the vegetation areas to the Blender entity diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesPlantInAllSupportedShapes.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesPlantInAllSupportedShapes.py index beec54b4eb..662ac63714 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesPlantInAllSupportedShapes.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesPlantInAllSupportedShapes.py @@ -56,16 +56,14 @@ def LayerSpawner_InstancesPlantInAllSupportedShapes(): Report.result(success, result) # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create basic vegetation area entity and set the properties entity_position = math.Vector3(125.0, 136.0, 32.0) - asset_path = os.path.join("Slices", "PurpleFlower.dynamicslice") - vegetation = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", - entity_position, - 10.0, 10.0, 10.0, - asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "SpawnerShapePlant_PinkFlower")[0] + vegetation = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", entity_position, 10.0, 10.0, 10.0, + pink_flower_prefab) vegetation.remove_component("Box Shape") vegetation.add_component("Shape Reference") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesRefreshUsingCorrectViewportCamera.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesRefreshUsingCorrectViewportCamera.py index fe8863c625..deb0376c9b 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesRefreshUsingCorrectViewportCamera.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesRefreshUsingCorrectViewportCamera.py @@ -43,13 +43,13 @@ def LayerSpawner_InstancesRefreshUsingCorrectViewportCamera(): import azlmbr.legacy.general as general import azlmbr.math as math + import editor_python_test_tools.hydra_editor_utils as hydra from largeworlds.large_worlds_utils import editor_dynveg_test_helper as dynveg from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Set up a test environment to validate that switching viewports correctly changes which camera # the vegetation system uses. @@ -100,11 +100,12 @@ def LayerSpawner_InstancesRefreshUsingCorrectViewportCamera(): surface_height) # Create the two vegetation areas - test_slice_asset_path = os.path.join("Slices", "PurpleFlower.dynamicslice") - first_veg_entity = dynveg.create_dynamic_slice_vegetation_area("Veg Area 1", first_entity_center_point, box_size, box_size, - box_size, test_slice_asset_path) - second_veg_entity = dynveg.create_dynamic_slice_vegetation_area("Veg Area 2", second_entity_center_point, box_size, box_size, - box_size, test_slice_asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "SpawnerViewportRefresh_PinkFlower")[0] + first_veg_entity = dynveg.create_temp_prefab_vegetation_area("Veg Area 1", first_entity_center_point, box_size, box_size, + box_size, pink_flower_prefab) + second_veg_entity = dynveg.create_temp_prefab_vegetation_area("Veg Area 2", second_entity_center_point, box_size, box_size, + box_size, pink_flower_prefab) # When the first viewport is active, the first area should be full of instances, and the second should be empty general.set_active_viewport(0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMesh.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMesh.py index 9777a52c82..7c365d0ee5 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMesh.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMesh.py @@ -50,19 +50,17 @@ def MeshBlocker_InstancesBlockedByMesh(): from editor_python_test_tools.utils import TestHelper as helper # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(500.49, 498.69, 46.66) general.set_current_view_rotation(-42.05, 0.00, -36.33) # Create entity with components "Vegetation Layer Spawner", "Vegetation Asset List", "Box Shape" entity_position = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PurpleFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", - entity_position, - 10.0, 10.0, 10.0, - asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "MeshBlocker_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", entity_position, 10.0, 10.0, 10.0, + pink_flower_prefab) # Create surface entity to plant on dynveg.create_surface_entity("Surface Entity", entity_position, 10.0, 10.0, 1.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMeshHeightTuning.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMeshHeightTuning.py index 3c47edeb91..a54a8653f0 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMeshHeightTuning.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMeshHeightTuning.py @@ -53,19 +53,17 @@ def MeshBlocker_InstancesBlockedByMeshHeightTuning(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(500.49, 498.69, 46.66) general.set_current_view_rotation(-42.05, 0.00, -36.33) # 2) Create entity with components "Vegetation Layer Spawner", "Vegetation Asset List", "Box Shape" entity_position = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PurpleFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", - entity_position, - 10.0, 10.0, 10.0, - asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "MeshBlocker_PinkFlower2")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", entity_position, 10.0, 10.0, 10.0, + pink_flower_prefab) # 3) Create surface entity to plant on dynveg.create_surface_entity("Surface Entity", entity_position, 10.0, 10.0, 1.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_DependentOnMeshComponent.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_DependentOnMeshComponent.py index cee8ebe5b6..9af17b0cd5 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_DependentOnMeshComponent.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_DependentOnMeshComponent.py @@ -58,8 +58,7 @@ def MeshSurfaceTagEmitter_DependentOnMeshComponent(): return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", EntityComponentIdPair) # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create a new entity with component "Mesh Surface Tag Emitter" entity_position = math.Vector3(125.0, 136.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py index d7abc66106..cd9963e844 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py @@ -47,8 +47,7 @@ def MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create a new entity with components "Mesh Surface Tag Emitter", "Mesh" entity_position = math.Vector3(125.0, 136.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PhysXColliderSurfaceTagEmitter_E2E_Editor.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PhysXColliderSurfaceTagEmitter_E2E_Editor.py index 6232cd374d..cdb2fac80b 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PhysXColliderSurfaceTagEmitter_E2E_Editor.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PhysXColliderSurfaceTagEmitter_E2E_Editor.py @@ -55,8 +55,7 @@ def PhysXColliderSurfaceTagEmitter_E2E_Editor(): return behavior_context_test_success # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Verify all of the BehaviorContext API: behavior_context = ( @@ -90,8 +89,10 @@ def PhysXColliderSurfaceTagEmitter_E2E_Editor(): dynveg.create_surface_entity("Baseline Surface", entity_center_point, 32.0, 32.0, 1.0) # Create a new entity with required vegetation area components - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Veg Area", entity_center_point, 32.0, 32.0, 32.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "PhysXCollider_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", entity_center_point, test_box_size, + test_box_size, test_box_size, pink_flower_prefab) # Add a Vegetation Surface Mask Filter component to the spawner entity and set it to include the "test" tag spawner_entity.add_component("Vegetation Surface Mask Filter") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_AutoSnapToSurfaceWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_AutoSnapToSurfaceWorks.py index be7e8ad754..85a1cddb95 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_AutoSnapToSurfaceWorks.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_AutoSnapToSurfaceWorks.py @@ -64,8 +64,7 @@ def PositionModifier_AutoSnapToSurfaceWorks(): 'Configuration|Position Z|Range Min', 'Configuration|Position Z|Range Max'] # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Set view of planting area for visual debugging general.set_current_view_position(512.0, 500.0, 38.0) @@ -73,9 +72,10 @@ def PositionModifier_AutoSnapToSurfaceWorks(): # 2) Create a new entity with required vegetation area components and a Position Modifier spawner_center_point = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", spawner_center_point, 16.0, 16.0, 16.0, - asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "PosMod_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", spawner_center_point, 16.0, 16.0, + 16.0, pink_flower_prefab) # Add a Vegetation Position Modifier and set offset values to 0 spawner_entity.add_component("Vegetation Position Modifier") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets.py index 07d4fbd067..6be3dc31f7 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets.py @@ -102,16 +102,17 @@ def PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets(): return offset_success and offset_success2 # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Set view of planting area for visual debugging general.set_current_view_position(16.0, -5.0, 32.0) # 2) Create a new entity with required vegetation area components spawner_center_point = math.Vector3(16.0, 16.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", spawner_center_point, 1.0, 1.0, 1.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "PosMod_PinkFlower2")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", spawner_center_point, 1.0, 1.0, + 1.0, pink_flower_prefab) # Add a Vegetation Position Modifier and set offset values to 0 spawner_entity.add_component("Vegetation Position Modifier") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PrefabInstanceSpawner_Embedded_E2E.py similarity index 87% rename from AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py rename to AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PrefabInstanceSpawner_Embedded_E2E.py index b4650c782e..8ce865b5d2 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PrefabInstanceSpawner_Embedded_E2E.py @@ -63,12 +63,14 @@ def DynamicSliceInstanceSpawner_Embedded_E2E(): import azlmbr.entity as entity import azlmbr.math as math import azlmbr.paths as paths + import azlmbr.vegetation as vegetation import editor_python_test_tools.hydra_editor_utils as hydra from largeworlds.large_worlds_utils import editor_dynveg_test_helper as dynveg from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper + # 1) Create a new, temporary level lvl_name = "tmp_level" helper.init_idle() @@ -79,13 +81,14 @@ def DynamicSliceInstanceSpawner_Embedded_E2E(): # 2) Create a new entity with required vegetation area components and Script Canvas component for launcher test center_point = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 1.0, asset_path) + pink_flower_prefab_path = os.path.join("assets", "prefabs", "PinkFlower.spawnable") + spawner_entity = dynveg.create_prefab_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 1.0, + pink_flower_prefab_path) spawner_entity.add_component("Script Canvas") instance_counter_path = os.path.join("scriptcanvas", "instance_counter.scriptcanvas") instance_counter_script = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", instance_counter_path, math.Uuid(), False) - spawner_entity.get_set_test(3, "Script Canvas Asset|Script Canvas Asset", instance_counter_script) + spawner_entity.get_set_test(3, "Properties", instance_counter_script) Report.result(Tests.spawner_entity_created, spawner_entity.id.IsValid() and hydra.has_components(spawner_entity.id, ["Script Canvas"])) @@ -106,11 +109,10 @@ def DynamicSliceInstanceSpawner_Embedded_E2E(): search_entity_ids = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) components.TransformBus(bus.Event, "MoveEntity", search_entity_ids[0], cam_position) - # 6) Save and export to engine + # 6) Save the created level general.save_level() - general.export_to_engine() - pak_path = os.path.join(paths.products, "levels", lvl_name, "level.pak") - success = helper.wait_for_condition(lambda: os.path.exists(pak_path), 10.0) + level_prefab_path = os.path.join(paths.products, "levels", lvl_name, f"{lvl_name}.spawnable") + success = helper.wait_for_condition(lambda: os.path.exists(level_prefab_path), 5.0) Report.result(Tests.saved_and_exported, success) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PrefabInstanceSpawner_External_E2E.py similarity index 96% rename from AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py rename to AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PrefabInstanceSpawner_External_E2E.py index a5e7e90ce2..a3e60f6337 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PrefabInstanceSpawner_External_E2E.py @@ -128,11 +128,10 @@ def DynamicSliceInstanceSpawner_External_E2E(): search_entity_ids = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) components.TransformBus(bus.Event, "MoveEntity", search_entity_ids[0], cam_position) - # 6) Save and export to engine + # 6) Save the created level general.save_level() - general.export_to_engine() - pak_path = os.path.join(paths.products, "levels", lvl_name, "level.pak") - success = helper.wait_for_condition(lambda: os.path.exists(pak_path), 10.0) + level_prefab_path = os.path.join(paths.products, "levels", lvl_name, f"{lvl_name}.spawnable") + success = helper.wait_for_condition(lambda: os.path.exists(level_prefab_path), 5.0) Report.result(Tests.saved_and_exported, success) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/RotationModifierOverrides_InstancesRotateWithinRange.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/RotationModifierOverrides_InstancesRotateWithinRange.py index c1ea8e03d1..877a38c231 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/RotationModifierOverrides_InstancesRotateWithinRange.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/RotationModifierOverrides_InstancesRotateWithinRange.py @@ -81,14 +81,15 @@ def RotationModifierOverrides_InstancesRotateWithinRange(): return result # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # 2) Create vegetation entity and add components entity_position = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PurpleFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Spawner Entity", entity_position, 16.0, 16.0, 16.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "RotMod_PinkFlower2")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", entity_position, 16.0, 16.0, 16.0, + pink_flower_prefab) spawner_entity.add_component("Vegetation Rotation Modifier") # Our default vegetation settings places 20 instances per 16 meters, so we expect 20 * 20 total instances. num_expected = 20 * 20 diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/RotationModifier_InstancesRotateWithinRange.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/RotationModifier_InstancesRotateWithinRange.py index 518c11a0cf..b0999f3195 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/RotationModifier_InstancesRotateWithinRange.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/RotationModifier_InstancesRotateWithinRange.py @@ -120,13 +120,14 @@ def RotationModifier_InstancesRotateWithinRange(): # Main Script # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # 2) Set up vegetation entities - asset_path = os.path.join("Slices", "PurpleFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Spawner Entity", LEVEL_CENTER, 2.0, 2.0, 2.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "RotMod_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", LEVEL_CENTER, 2.0, 2.0, 2.0, + pink_flower_prefab) additional_components = [ "Vegetation Rotation Modifier" diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ScaleModifierOverrides_InstancesProperlyScale.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ScaleModifierOverrides_InstancesProperlyScale.py index b2ce6d8afa..42b042e26e 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ScaleModifierOverrides_InstancesProperlyScale.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ScaleModifierOverrides_InstancesProperlyScale.py @@ -91,16 +91,17 @@ def ScaleModifierOverrides_InstancesProperlyScale(): return False # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(500.49, 498.69, 46.66) general.set_current_view_rotation(-42.05, 0.00, -36.33) # 2) Create a new entity with components "Vegetation Layer Spawner", "Vegetation Asset List", "Box Shape" entity_position = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PurpleFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Spawner Entity", entity_position, 16.0, 16.0, 10.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "ScaleMod_PinkFlower2")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", entity_position, 16.0, 16.0, 16.0, + pink_flower_prefab) # Create a surface to plant on and add a Vegetation Debugger Level component to allow refreshes dynveg.create_surface_entity("Surface Entity", entity_position, 20.0, 20.0, 1.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ScaleModifier_InstancesProperlyScale.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ScaleModifier_InstancesProperlyScale.py index fd0df1c83d..8008224e3e 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ScaleModifier_InstancesProperlyScale.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ScaleModifier_InstancesProperlyScale.py @@ -84,8 +84,7 @@ def ScaleModifier_InstancesProperlyScale(): return False # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(500.49, 498.69, 46.66) general.set_current_view_rotation(-42.05, 0.00, -36.33) @@ -93,9 +92,10 @@ def ScaleModifier_InstancesProperlyScale(): # 2) Create a new entity with components Vegetation Layer Spawner, Vegetation Asset List, Box Shape and # Vegetation Scale Modifier entity_position = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PurpleFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Spawner Entity", entity_position, 16.0, 16.0, 16.0, - asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "ScaleMod_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", entity_position, 16.0, 16.0, 16.0, + pink_flower_prefab) spawner_entity.add_component("Vegetation Scale Modifier") # Create a surface to plant on and add a Vegetation Debugger Level component to allow refreshes diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_FilterStageToggle.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_FilterStageToggle.py index b5c00a53b7..5436855433 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_FilterStageToggle.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_FilterStageToggle.py @@ -49,15 +49,16 @@ def ShapeIntersectionFilter_FilterStageToggle(): from editor_python_test_tools.utils import TestHelper as helper # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # Create basic vegetation entity position = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - vegetation = dynveg.create_dynamic_slice_vegetation_area("vegetation", position, 16.0, 16.0, 16.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "ShapeIntersection_PinkFlower")[0] + vegetation = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", position, 16.0, 16.0, 16.0, + pink_flower_prefab) # Create Surface for instances to plant on dynveg.create_surface_entity("Surface_Entity_Parent", position, 16.0, 16.0, 1.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_InstancesPlantInAssignedShape.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_InstancesPlantInAssignedShape.py index 6678a620af..e9e4c722f1 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_InstancesPlantInAssignedShape.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_InstancesPlantInAssignedShape.py @@ -60,8 +60,7 @@ def ShapeIntersectionFilter_InstancesPlantInAssignedShape(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Set view of planting area for visual debugging general.set_current_view_position(512.0, 500.0, 38.0) @@ -69,9 +68,10 @@ def ShapeIntersectionFilter_InstancesPlantInAssignedShape(): # 2) Create a new entity with required vegetation area components and Vegetation Shape Intersection Filter center_point = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 1.0, - asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "ShapeIntersection_PinkFlower2")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 1.0, + pink_flower_prefab) spawner_entity.add_component("Vegetation Shape Intersection Filter") # Create a planting surface diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment.py index c9233d15ea..07dbb3f977 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment.py @@ -58,15 +58,16 @@ def SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment(): return False # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # Create a spawner entity setup with all needed components center_point = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 32.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "SlopeAlign_PinkFlower2")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 32.0, + pink_flower_prefab) # Create a sloped mesh surface for the instances to plant on center_point = math.Vector3(502.0, 512.0, 24.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeAlignmentModifier_InstanceSurfaceAlignment.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeAlignmentModifier_InstanceSurfaceAlignment.py index d92babffa4..088728480b 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeAlignmentModifier_InstanceSurfaceAlignment.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeAlignmentModifier_InstanceSurfaceAlignment.py @@ -59,15 +59,16 @@ def SlopeAlignmentModifier_InstanceSurfaceAlignment(): return False # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # Create a spawner entity setup with all needed components center_point = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 32.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "SlopeAlign_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 32.0, + pink_flower_prefab) # Create a sloped mesh surface for the instances to plant on center_point = math.Vector3(502.0, 512.0, 24.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope.py index 0f95853156..cc04dc4cb1 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope.py @@ -63,16 +63,17 @@ def SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlopes(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Set view of planting area for visual debugging general.set_current_view_position(512.0, 475.0, 38.0) # 2) Create a new entity with required vegetation area components center_point = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", center_point, 32.0, 32.0, 32.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "Slope_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", center_point, 32.0, 32.0, 32.0, + pink_flower_prefab) # Add a Vegetation Slope Filter spawner_entity.add_component("Vegetation Slope Filter") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerPrefabs_PrefabCreationAndVisibilityToggleWorks.py similarity index 52% rename from AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py rename to AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerPrefabs_PrefabCreationAndVisibilityToggleWorks.py index fc55080cec..182bd5510a 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerPrefabs_PrefabCreationAndVisibilityToggleWorks.py @@ -7,21 +7,21 @@ SPDX-License-Identifier: Apache-2.0 OR MIT class Tests: - spawner_slice_created = ( - "Spawner slice created successfully", - "Failed to create Spawner slice" + spawner_prefab_created = ( + "Spawner prefab created successfully", + "Failed to create Spawner prefab" ) instance_count_unhidden = ( "Initial instance counts are as expected", "Found an unexpected number of initial instances" ) instance_count_hidden = ( - "Instance counts upon hiding the Spawner slice are as expected", - "Unexpectedly found instances with the Spawner slice hidden" + "Instance counts upon hiding the Spawner prefab are as expected", + "Unexpectedly found instances with the Spawner prefab hidden" ) - blender_slice_created = ( - "Blender slice created successfully", - "Failed to create Blender slice" + blender_prefab_created = ( + "Blender prefab created successfully", + "Failed to create Blender prefab" ) @@ -43,81 +43,76 @@ def SpawnerSlices_SliceCreationAndVisibilityToggleWorks(): import azlmbr.math as math import azlmbr.legacy.general as general - import azlmbr.slice as slice import azlmbr.bus as bus import azlmbr.editor as editor - import azlmbr.asset as asset import editor_python_test_tools.hydra_editor_utils as hydra from largeworlds.large_worlds_utils import editor_dynveg_test_helper as dynveg + from editor_python_test_tools.editor_entity_utils import EditorEntity from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper - - def path_is_valid_asset(asset_path): - asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", asset_path, math.Uuid(), False) - return asset_id.invoke("IsValid") + from editor_python_test_tools.prefab_utils import Prefab # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) - # 2) C2627900 Verifies if a slice containing the Vegetation Layer Spawner component can be created. + # 2) Verifies if a prefab containing the Vegetation Layer Spawner component can be created. # 2.1) Create basic vegetation entity position = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - veg_1 = dynveg.create_dynamic_slice_vegetation_area("vegetation_1", position, 16.0, 16.0, 16.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "SpawnerPrefab_PinkFlower")[0] + veg_1 = dynveg.create_temp_prefab_vegetation_area("vegetation_1", position, 16.0, 16.0, 16.0, + pink_flower_prefab) - # 2.2) Create slice from the entity - slice_path = os.path.join("slices", "TestSlice_1.slice") - slice.SliceRequestBus(bus.Broadcast, "CreateNewSlice", veg_1.id, slice_path) + # 2.2) Create prefab from the entity + spawner_prefab_filename = "TestPrefab_1" + spawner_prefab, spawner_prefab_instance = Prefab.create_prefab([veg_1], spawner_prefab_filename) - # 2.3) Verify if the slice has been created successfully - spawner_slice_success = helper.wait_for_condition(lambda: path_is_valid_asset(slice_path), 10.0) - Report.result(Tests.spawner_slice_created, spawner_slice_success) + # Verify if prefab is created + Report.result(Tests.spawner_prefab_created, spawner_prefab.is_prefab_loaded(spawner_prefab_filename)) - # 3) C2627904: Hiding a slice containing the component clears any visuals from the Viewport + # 3) Hiding a prefab containing the component clears any visuals from the Viewport # 3.1) Create Surface for instances to plant on dynveg.create_surface_entity("Surface_Entity", position, 16.0, 16.0, 1.0) - # 3.2) Initially verify instance count before hiding slice + # 3.2) Initially verify instance count before hiding prefab initial_count_success = helper.wait_for_condition(lambda: dynveg.validate_instance_count(position, 16.0, 400), 5.0) Report.result(Tests.instance_count_unhidden, initial_count_success) - # 3.3) Hide the slice and verify instance count - editor.EditorEntityAPIBus(bus.Event, "SetVisibilityState", veg_1.id, False) + # 3.3) Hide the prefab and verify instance count + editor.EditorEntityAPIBus(bus.Event, "SetVisibilityState", spawner_prefab_instance.container_entity.id, False) hidden_instance_count = helper.wait_for_condition(lambda: dynveg.validate_instance_count(position, 16.0, 0), 5.0) Report.result(Tests.instance_count_hidden, hidden_instance_count) # 3.4) Unhide the slice - editor.EditorEntityAPIBus(bus.Event, "SetVisibilityState", veg_1.id, True) + editor.EditorEntityAPIBus(bus.Event, "SetVisibilityState", spawner_prefab_instance.container_entity.id, True) - # 4) C2627905 A slice containing the Vegetation Layer Blender component can be created. + # 4) A slice containing the Vegetation Layer Blender component can be created. # 4.1) Create another vegetation entity to add to blender component - veg_2 = dynveg.create_dynamic_slice_vegetation_area("vegetation_2", position, 1.0, 1.0, 1.0, "") + veg_2 = dynveg.create_empty_vegetation_area("vegetation_2", position, 1.0, 1.0, 1.0) # 4.2) Create entity with Vegetation Layer Blender components_to_add = ["Box Shape", "Vegetation Layer Blender"] - blender_entity = hydra.Entity("blender_entity") - blender_entity.create_entity(position, components_to_add) + blender_entity = EditorEntity.create_editor_entity("blender_entity") + blender_entity.add_components(components_to_add) # 4.3) Pin both the vegetation areas to the blender entity - pte = hydra.get_property_tree(blender_entity.components[1]) + pte = blender_entity.components[1].get_property_tree() path = "Configuration|Vegetation Areas" pte.update_container_item(path, 0, veg_1.id) pte.add_container_item(path, 1, veg_2.id) # 4.4) Drag the simple vegetation areas under the Vegetation Layer Blender entity to create an entity hierarchy. veg_1.set_test_parent_entity(blender_entity) - veg_2.set_test_parent_entity(blender_entity) + veg_2.set_parent_entity(blender_entity.id) - # 4.5) Create slice from blender entity - slice_path = os.path.join("slices", "TestSlice_2.slice") - slice.SliceRequestBus(bus.Broadcast, "CreateNewSlice", blender_entity.id, slice_path) + # 4.5) Create prefab from blender entity + blender_prefab_filename = "TestPrefab_2" + blender_prefab, blender_prefab_instance = Prefab.create_prefab([veg_2], blender_prefab_filename) - # 4.6) Verify if the slice has been created successfully - blender_slice_success = helper.wait_for_condition(lambda: path_is_valid_asset(slice_path), 5.0) - Report.result(Tests.blender_slice_created, blender_slice_success) + # 4.6) Verify if the prefab has been created successfully + Report.result(Tests.blender_prefab_created, blender_prefab.is_prefab_loaded(blender_prefab_filename)) if __name__ == "__main__": diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceDataRefreshes_RemainsStable.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceDataRefreshes_RemainsStable.py index 1ad4f305c3..3612e03bcc 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceDataRefreshes_RemainsStable.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceDataRefreshes_RemainsStable.py @@ -34,13 +34,12 @@ def SurfaceDataRefreshes_RemainsStable(): import azlmbr.legacy.general as general import azlmbr.math as math + import editor_python_test_tools.hydra_editor_utils as hydra from largeworlds.large_worlds_utils import editor_dynveg_test_helper as dynveg from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() world_center = math.Vector3(512.0, 512.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected.py index 3e76a03c53..b98b0f0546 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected.py @@ -67,8 +67,7 @@ def SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected(): surface_data.SurfaceTag("test_tag3")] # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Set view of planting area for visual debugging general.set_current_view_position(512.0, 500.0, 38.0) @@ -76,9 +75,10 @@ def SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected(): # 2) Create a new instance spawner entity with multiple Dynamic Slice Instance Spawner descriptors spawner_center_point = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", spawner_center_point, 16.0, 16.0, 16.0, - asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "SurfaceMaskOverrides_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", spawner_center_point, 16.0, 16.0, + 16.0, pink_flower_prefab) asset_list_component = spawner_entity.components[2] desc_asset = hydra.get_component_property_value(asset_list_component, "Configuration|Embedded Assets")[0] diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_BasicSurfaceTagCreation.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_BasicSurfaceTagCreation.py index fee62c04d1..fe17b03c6f 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_BasicSurfaceTagCreation.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_BasicSurfaceTagCreation.py @@ -39,12 +39,12 @@ def SurfaceMaskFilter_BasicSurfaceTagCreation(): """ import azlmbr.surface_data as surface_data + + import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() tag1 = surface_data.SurfaceTag() tag2 = surface_data.SurfaceTag() diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_ExclusionList.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_ExclusionList.py index 3f298e793e..f5174af3bb 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_ExclusionList.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_ExclusionList.py @@ -91,18 +91,16 @@ def SurfaceMaskFilter_ExclusionList(): Report.info(f"Failed to add Generated surface tag of {surface_tag}") # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # 2) Create entity with components "Vegetation Layer Spawner", "Vegetation Asset List", "Box Shape" entity_position = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PurpleFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", - entity_position, - 10.0, 10.0, 10.0, - asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "SurfaceMaskTagExclusion_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", entity_position, 10.0, 10.0, 10.0, + pink_flower_prefab) # 3) Add a Vegetation Surface Mask Filter component to the entity. spawner_entity.add_component("Vegetation Surface Mask Filter") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_InclusionList.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_InclusionList.py index 39b72ff4a9..34d22d3d9b 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_InclusionList.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_InclusionList.py @@ -92,18 +92,16 @@ def SurfaceMaskFilter_InclusionList(): Report.info(f"Failed to add Generated surface tag of {surface_tag}") # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # 2) Create entity with components "Vegetation Layer Spawner", "Vegetation Asset List", "Box Shape" entity_position = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PurpleFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Instance Spawner", - entity_position, - 10.0, 10.0, 10.0, - asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "SurfaceMaskTagInclusion_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", entity_position, 10.0, 10.0, 10.0, + pink_flower_prefab) # 3) Add a Vegetation Surface Mask Filter component to the entity. spawner_entity.add_component("Vegetation Surface Mask Filter") diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SystemSettings_SectorPointDensity.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SystemSettings_SectorPointDensity.py index 167fb8901c..7516bfb31d 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SystemSettings_SectorPointDensity.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SystemSettings_SectorPointDensity.py @@ -47,15 +47,16 @@ def SystemSettings_SectorPointDensity(): INSTANCE_COUNT_AFTER_DENSITY_CHANGE = 100 # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # Create basic vegetation entity position = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - dynveg.create_dynamic_slice_vegetation_area("vegetation", position, 16.0, 16.0, 1.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "SectorPoint_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", position, 16.0, 16.0, 1.0, + pink_flower_prefab) dynveg.create_surface_entity("Surface_Entity", position, 16.0, 16.0, 1.0) # Count the number of vegetation instances in the vegetation area diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SystemSettings_SectorSize.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SystemSettings_SectorSize.py index 7bb78ac3e0..ef7959a3e7 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SystemSettings_SectorSize.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SystemSettings_SectorSize.py @@ -43,15 +43,16 @@ def SystemSettings_SectorSize(): VEGETATION_INSTANCE_COUNT = 400 # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() general.set_current_view_position(512.0, 480.0, 38.0) # Create basic vegetation entity position = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PinkFlower.dynamicslice") - vegetation = dynveg.create_dynamic_slice_vegetation_area("vegetation", position, 16.0, 16.0, 1.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "SectorSize_PinkFlower")[0] + vegetation = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", position, 16.0, 16.0, 1.0, + pink_flower_prefab) dynveg.create_surface_entity("Surface_Entity", position, 16.0, 16.0, 1.0) # Add the Vegetation Debugger component to the Level Inspector diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/VegetationInstances_DespawnWhenOutOfRange.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/VegetationInstances_DespawnWhenOutOfRange.py index 8a6c4d9a17..b6069d1ef5 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/VegetationInstances_DespawnWhenOutOfRange.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/VegetationInstances_DespawnWhenOutOfRange.py @@ -43,18 +43,20 @@ def VegetationInstances_DespawnWhenOutOfRange(): import azlmbr.legacy.general as general import azlmbr.math as math + import editor_python_test_tools.hydra_editor_utils as hydra from largeworlds.large_worlds_utils import editor_dynveg_test_helper as dynveg from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Create vegetation layer spawner world_center = math.Vector3(512.0, 512.0, 32.0) - asset_path = os.path.join("Slices", "PurpleFlower.dynamicslice") - spawner_entity = dynveg.create_dynamic_slice_vegetation_area("Spawner Instance", world_center, 16.0, 16.0, 16.0, asset_path) + pink_flower_asset_path = os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel") + pink_flower_prefab = dynveg.create_temp_mesh_prefab(pink_flower_asset_path, "RangeDespawn_PinkFlower")[0] + spawner_entity = dynveg.create_temp_prefab_vegetation_area("Instance Spawner", world_center, 16.0, 16.0, 16.0, + pink_flower_prefab) # Create a surface to spawn on dynveg.create_surface_entity("Spawner Entity", world_center, 16.0, 16.0, 1.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main.py index 06c9c5f615..d508e390cb 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main.py @@ -7,21 +7,171 @@ SPDX-License-Identifier: Apache-2.0 OR MIT import os import pytest -import sys -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../automatedtesting_shared') -from base import TestAutomationBase +import ly_test_tools.environment.file_system as file_system +from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite @pytest.mark.SUITE_main @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(TestAutomationBase): +class TestAutomation(EditorTestSuite): - def test_DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(self, request, workspace, editor, launcher_platform): + # Helpers for test asset cleanup + def cleanup_test_level(self, workspace): + file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], + True, True) + + class test_AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude(EditorSharedTest): + from .EditorScripts import AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude as test_module + + class test_AltitudeFilter_FilterStageToggle(EditorSharedTest): + from .EditorScripts import AltitudeFilter_FilterStageToggle as test_module + + class test_AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude(EditorSharedTest): + from .EditorScripts import AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude as test_module + + class test_AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea(EditorSharedTest): + from .EditorScripts import AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea as test_module + + class test_AssetWeightSelector_InstancesExpressBasedOnWeight(EditorSharedTest): + from .EditorScripts import AssetWeightSelector_InstancesExpressBasedOnWeight as test_module + + @pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/4155") + class test_DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius(EditorSharedTest): + from .EditorScripts import DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius as test_module + + @pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/4155") + class test_DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius(EditorSharedTest): + from .EditorScripts import DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius as test_module + + class test_DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(EditorSharedTest): from .EditorScripts import DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - def test_EmptyInstanceSpawner_EmptySpawnerWorks(self, request, workspace, editor, launcher_platform): + class test_EmptyInstanceSpawner_EmptySpawnerWorks(EditorSharedTest): from .EditorScripts import EmptyInstanceSpawner_EmptySpawnerWorks as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) + + class test_InstanceSpawnerPriority_LayerAndSubPriority_HigherValuesPlantOverLower(EditorSharedTest): + from .EditorScripts import InstanceSpawnerPriority_LayerAndSubPriority as test_module + + class test_LayerBlender_E2E_Editor(EditorSingleTest): + from .EditorScripts import LayerBlender_E2E_Editor as test_module + + # Custom setup/teardown to remove test level created during test + def setup(self, request, workspace, editor, editor_test_results, launcher_platform): + TestAutomation.cleanup_test_level(self, workspace) + + def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): + TestAutomation.cleanup_test_level(self, workspace) + + class test_LayerBlocker_InstancesBlockedInConfiguredArea(EditorSharedTest): + from .EditorScripts import LayerBlocker_InstancesBlockedInConfiguredArea as test_module + + class test_LayerSpawner_FilterStageToggle(EditorSharedTest): + from .EditorScripts import LayerSpawner_FilterStageToggle as test_module + + class test_LayerSpawner_InheritBehaviorFlag(EditorSharedTest): + from .EditorScripts import LayerSpawner_InheritBehaviorFlag as test_module + + class test_LayerSpawner_InstancesPlantInAllSupportedShapes(EditorSharedTest): + from .EditorScripts import LayerSpawner_InstancesPlantInAllSupportedShapes as test_module + + @pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/6549") + class test_LayerSpawner_InstancesRefreshUsingCorrectViewportCamera(EditorSharedTest): + from .EditorScripts import LayerSpawner_InstancesRefreshUsingCorrectViewportCamera as test_module + + class test_MeshBlocker_InstancesBlockedByMesh(EditorSharedTest): + from .EditorScripts import MeshBlocker_InstancesBlockedByMesh as test_module + + class test_MeshBlocker_InstancesBlockedByMeshHeightTuning(EditorSharedTest): + from .EditorScripts import MeshBlocker_InstancesBlockedByMeshHeightTuning as test_module + + class test_MeshSurfaceTagEmitter_DependentOnMeshComponent(EditorSharedTest): + from .EditorScripts import MeshSurfaceTagEmitter_DependentOnMeshComponent as test_module + + class test_MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(EditorSharedTest): + from .EditorScripts import MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully as test_module + + class test_PhysXColliderSurfaceTagEmitter_E2E_Editor(EditorSharedTest): + from .EditorScripts import PhysXColliderSurfaceTagEmitter_E2E_Editor as test_module + + class test_PositionModifier_AutoSnapToSurfaceWorks(EditorSharedTest): + from .EditorScripts import PositionModifier_AutoSnapToSurfaceWorks as test_module + + class test_PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets(EditorSharedTest): + from .EditorScripts import \ + PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets as test_module + + class test_PrefabInstanceSpawner_Embedded_E2E_Editor(EditorSingleTest): + from .EditorScripts import PrefabInstanceSpawner_Embedded_E2E as test_module + + # Custom setup/teardown to remove test level created during test + def setup(self, request, workspace, editor, editor_test_results, launcher_platform): + TestAutomation.cleanup_test_level(self, workspace) + + def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): + TestAutomation.cleanup_test_level(self, workspace) + + class test_PrefabInstanceSpawner_External_E2E_Editor(EditorSingleTest): + from .EditorScripts import PrefabInstanceSpawner_External_E2E as test_module + + # Custom setup/teardown to remove test level created during test + def setup(self, request, workspace, editor, editor_test_results, launcher_platform): + TestAutomation.cleanup_test_level(self, workspace) + + def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): + TestAutomation.cleanup_test_level(self, workspace) + + class test_RotationModifier_InstancesRotateWithinRange(EditorSharedTest): + from .EditorScripts import RotationModifier_InstancesRotateWithinRange as test_module + + class test_RotationModifierOverrides_InstancesRotateWithinRange(EditorSharedTest): + from .EditorScripts import RotationModifierOverrides_InstancesRotateWithinRange as test_module + + class test_ScaleModifier_InstancesProperlyScale(EditorSharedTest): + from .EditorScripts import ScaleModifier_InstancesProperlyScale as test_module + + class test_ScaleModifierOverrides_InstancesProperlyScale(EditorSharedTest): + from .EditorScripts import ScaleModifierOverrides_InstancesProperlyScale as test_module + + class test_ShapeIntersectionFilter_FilterStageToggle(EditorSharedTest): + from .EditorScripts import ShapeIntersectionFilter_FilterStageToggle as test_module + + class test_ShapeIntersectionFilter_InstancesPlantInAssignedShape(EditorSharedTest): + from .EditorScripts import ShapeIntersectionFilter_InstancesPlantInAssignedShape as test_module + + class test_SlopeAlignmentModifier_InstanceSurfaceAlignment(EditorSharedTest): + from .EditorScripts import SlopeAlignmentModifier_InstanceSurfaceAlignment as test_module + + class test_SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment(EditorSharedTest): + from .EditorScripts import SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment as test_module + + class test_SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlopes(EditorSharedTest): + from .EditorScripts import SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope as test_module + + class test_SpawnerPrefabs_PrefabCreationAndVisibilityToggleWorks(EditorSharedTest): + from .EditorScripts import SpawnerPrefabs_PrefabCreationAndVisibilityToggleWorks as test_module + + class test_SurfaceDataRefreshes_RemainsStable(EditorSharedTest): + from .EditorScripts import SurfaceDataRefreshes_RemainsStable as test_module + + class test_SurfaceMaskFilter_BasicSurfaceTagCreation(EditorSharedTest): + from .EditorScripts import SurfaceMaskFilter_BasicSurfaceTagCreation as test_module + + class test_SurfaceMaskFilter_ExclusiveSurfaceTags_Function(EditorSharedTest): + from .EditorScripts import SurfaceMaskFilter_ExclusionList as test_module + + class test_SurfaceMaskFilter_InclusiveSurfaceTags_Function(EditorSharedTest): + from .EditorScripts import SurfaceMaskFilter_InclusionList as test_module + + class test_SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected(EditorSharedTest): + from .EditorScripts import SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected as test_module + + class test_SystemSettings_SectorPointDensity(EditorSharedTest): + from .EditorScripts import SystemSettings_SectorPointDensity as test_module + + class test_SystemSettings_SectorSize(EditorSharedTest): + from .EditorScripts import SystemSettings_SectorSize as test_module + + class test_VegetationInstances_DespawnWhenOutOfRange(EditorSharedTest): + from .EditorScripts import VegetationInstances_DespawnWhenOutOfRange as test_module diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py deleted file mode 100644 index 5b1e504442..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py +++ /dev/null @@ -1,192 +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 -""" - -import os -import pytest - -import ly_test_tools.environment.file_system as file_system -from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite - - -@pytest.mark.SUITE_main -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(EditorTestSuite): - class test_AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude(EditorParallelTest): - from .EditorScripts import AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude as test_module - - class test_AltitudeFilter_FilterStageToggle(EditorParallelTest): - from .EditorScripts import AltitudeFilter_FilterStageToggle as test_module - - class test_AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude(EditorParallelTest): - from .EditorScripts import AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude as test_module - - -@pytest.mark.SUITE_main -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation_PrefabNotEnabled(EditorTestSuite): - - enable_prefab_system = False - - # Helpers for test asset cleanup - def cleanup_test_level(self, workspace): - file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], - True, True) - - def cleanup_test_slices(self, workspace): - file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "slices", - "TestSlice_1.slice")], True, True) - file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "slices", - "TestSlice_2.slice")], True, True) - - class test_DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(EditorParallelTest): - from .EditorScripts import DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks as test_module - - class test_EmptyInstanceSpawner_EmptySpawnerWorks(EditorParallelTest): - from .EditorScripts import EmptyInstanceSpawner_EmptySpawnerWorks as test_module - - class test_SpawnerSlices_SliceCreationAndVisibilityToggleWorks(EditorSingleTest): - # Custom teardown to remove slice asset created during test - def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): - TestAutomation_PrefabNotEnabled.cleanup_test_slices(self, workspace) - from .EditorScripts import SpawnerSlices_SliceCreationAndVisibilityToggleWorks as test_module - - class test_AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea(EditorParallelTest): - from .EditorScripts import AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea as test_module - - class test_AssetWeightSelector_InstancesExpressBasedOnWeight(EditorParallelTest): - from .EditorScripts import AssetWeightSelector_InstancesExpressBasedOnWeight as test_module - - @pytest.mark.skip(reason="https://github.com/o3de/o3de/issues/4155") - class test_DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius(EditorParallelTest): - from .EditorScripts import DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius as test_module - - @pytest.mark.skip(reason="https://github.com/o3de/o3de/issues/4155") - class test_DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius(EditorParallelTest): - from .EditorScripts import DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius as test_module - - class test_SurfaceDataRefreshes_RemainsStable(EditorParallelTest): - from .EditorScripts import SurfaceDataRefreshes_RemainsStable as test_module - - class test_VegetationInstances_DespawnWhenOutOfRange(EditorParallelTest): - from .EditorScripts import VegetationInstances_DespawnWhenOutOfRange as test_module - - class test_InstanceSpawnerPriority_LayerAndSubPriority_HigherValuesPlantOverLower(EditorParallelTest): - from .EditorScripts import InstanceSpawnerPriority_LayerAndSubPriority as test_module - - class test_LayerBlocker_InstancesBlockedInConfiguredArea(EditorParallelTest): - from .EditorScripts import LayerBlocker_InstancesBlockedInConfiguredArea as test_module - - class test_LayerSpawner_InheritBehaviorFlag(EditorParallelTest): - from .EditorScripts import LayerSpawner_InheritBehaviorFlag as test_module - - class test_LayerSpawner_InstancesPlantInAllSupportedShapes(EditorParallelTest): - from .EditorScripts import LayerSpawner_InstancesPlantInAllSupportedShapes as test_module - - class test_LayerSpawner_FilterStageToggle(EditorParallelTest): - from .EditorScripts import LayerSpawner_FilterStageToggle as test_module - - @pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2038") - class test_LayerSpawner_InstancesRefreshUsingCorrectViewportCamera(EditorParallelTest): - from .EditorScripts import LayerSpawner_InstancesRefreshUsingCorrectViewportCamera as test_module - - class test_MeshBlocker_InstancesBlockedByMesh(EditorParallelTest): - from .EditorScripts import MeshBlocker_InstancesBlockedByMesh as test_module - - class test_MeshBlocker_InstancesBlockedByMeshHeightTuning(EditorParallelTest): - from .EditorScripts import MeshBlocker_InstancesBlockedByMeshHeightTuning as test_module - - class test_MeshSurfaceTagEmitter_DependentOnMeshComponent(EditorParallelTest): - from .EditorScripts import MeshSurfaceTagEmitter_DependentOnMeshComponent as test_module - - class test_MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(EditorParallelTest): - from .EditorScripts import MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully as test_module - - class test_PhysXColliderSurfaceTagEmitter_E2E_Editor(EditorParallelTest): - from .EditorScripts import PhysXColliderSurfaceTagEmitter_E2E_Editor as test_module - - class test_PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets(EditorParallelTest): - from .EditorScripts import PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets as test_module - - class test_PositionModifier_AutoSnapToSurfaceWorks(EditorParallelTest): - from .EditorScripts import PositionModifier_AutoSnapToSurfaceWorks as test_module - - class test_RotationModifier_InstancesRotateWithinRange(EditorParallelTest): - from .EditorScripts import RotationModifier_InstancesRotateWithinRange as test_module - - class test_RotationModifierOverrides_InstancesRotateWithinRange(EditorParallelTest): - from .EditorScripts import RotationModifierOverrides_InstancesRotateWithinRange as test_module - - class test_ScaleModifier_InstancesProperlyScale(EditorParallelTest): - from .EditorScripts import ScaleModifier_InstancesProperlyScale as test_module - - class test_ScaleModifierOverrides_InstancesProperlyScale(EditorParallelTest): - from .EditorScripts import ScaleModifierOverrides_InstancesProperlyScale as test_module - - class test_ShapeIntersectionFilter_InstancesPlantInAssignedShape(EditorParallelTest): - from .EditorScripts import ShapeIntersectionFilter_InstancesPlantInAssignedShape as test_module - - class test_ShapeIntersectionFilter_FilterStageToggle(EditorParallelTest): - from .EditorScripts import ShapeIntersectionFilter_FilterStageToggle as test_module - - class test_SlopeAlignmentModifier_InstanceSurfaceAlignment(EditorParallelTest): - from .EditorScripts import SlopeAlignmentModifier_InstanceSurfaceAlignment as test_module - - class test_SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment(EditorParallelTest): - from .EditorScripts import SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment as test_module - - class test_SurfaceMaskFilter_BasicSurfaceTagCreation(EditorParallelTest): - from .EditorScripts import SurfaceMaskFilter_BasicSurfaceTagCreation as test_module - - class test_SurfaceMaskFilter_ExclusiveSurfaceTags_Function(EditorParallelTest): - from .EditorScripts import SurfaceMaskFilter_ExclusionList as test_module - - class test_SurfaceMaskFilter_InclusiveSurfaceTags_Function(EditorParallelTest): - from .EditorScripts import SurfaceMaskFilter_InclusionList as test_module - - class test_SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected(EditorParallelTest): - from .EditorScripts import SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected as test_module - - class test_SystemSettings_SectorPointDensity(EditorParallelTest): - from .EditorScripts import SystemSettings_SectorPointDensity as test_module - - class test_SystemSettings_SectorSize(EditorParallelTest): - from .EditorScripts import SystemSettings_SectorSize as test_module - - class test_SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlopes(EditorParallelTest): - from .EditorScripts import SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope as test_module - - class test_DynamicSliceInstanceSpawner_Embedded_E2E_Editor(EditorSingleTest): - from .EditorScripts import DynamicSliceInstanceSpawner_Embedded_E2E as test_module - - # Custom setup/teardown to remove test level created during test - def setup(self, request, workspace, editor, editor_test_results, launcher_platform): - TestAutomation_PrefabNotEnabled.cleanup_test_level(self, workspace) - - def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): - TestAutomation_PrefabNotEnabled.cleanup_test_level(self, workspace) - - class test_DynamicSliceInstanceSpawner_External_E2E_Editor(EditorSingleTest): - from .EditorScripts import DynamicSliceInstanceSpawner_External_E2E as test_module - - # Custom setup/teardown to remove test level created during test - def setup(self, request, workspace, editor, editor_test_results, launcher_platform): - TestAutomation_PrefabNotEnabled.cleanup_test_level(self, workspace) - - def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): - TestAutomation_PrefabNotEnabled.cleanup_test_level(self, workspace) - - class test_LayerBlender_E2E_Editor(EditorSingleTest): - from .EditorScripts import LayerBlender_E2E_Editor as test_module - - # Custom setup/teardown to remove test level created during test - def setup(self, request, workspace, editor, editor_test_results, launcher_platform): - TestAutomation_PrefabNotEnabled.cleanup_test_level(self, workspace) - - def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): - TestAutomation_PrefabNotEnabled.cleanup_test_level(self, workspace) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic.py index 64f6cfdf30..bf7e76f973 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic.py @@ -7,277 +7,17 @@ SPDX-License-Identifier: Apache-2.0 OR MIT import os import pytest -import sys -import ly_test_tools.environment.waiter as waiter import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra -from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole - -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../automatedtesting_shared') -from base import TestAutomationBase - - -@pytest.fixture -def remove_test_slice(request, workspace, project): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice_1.slice")], True, - True) - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice_2.slice")], True, - True) - - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice_1.slice")], True, - True) - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice_2.slice")], True, - True) - request.addfinalizer(teardown) - - -@pytest.fixture -def remote_console_instance(request): - console = RemoteConsole() - - def teardown(): - if console.connected: - console.stop() - - request.addfinalizer(teardown) - return console +from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite @pytest.mark.SUITE_periodic @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(TestAutomationBase): +class TestAutomation(EditorTestSuite): - def test_AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude as test_module - self._run_test(request, workspace, editor, test_module) + global_extra_cmdline_args = ["-BatchMode", "-autotest_mode"] - def test_AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude as test_module - self._run_test(request, workspace, editor, test_module) - - def test_AltitudeFilter_FilterStageToggle(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AltitudeFilter_FilterStageToggle as test_module - self._run_test(request, workspace, editor, test_module) - - def test_SpawnerSlices_SliceCreationAndVisibilityToggleWorks(self, request, workspace, editor, remove_test_slice, launcher_platform): - from .EditorScripts import SpawnerSlices_SliceCreationAndVisibilityToggleWorks as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_AssetWeightSelector_InstancesExpressBasedOnWeight(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AssetWeightSelector_InstancesExpressBasedOnWeight as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - @pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/4155") - def test_DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius(self, request, workspace, editor, launcher_platform): - from .EditorScripts import DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - @pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/4155") - def test_DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius(self, request, workspace, editor, launcher_platform): - from .EditorScripts import DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_SurfaceDataRefreshes_RemainsStable(self, request, workspace, editor, launcher_platform): - from .EditorScripts import SurfaceDataRefreshes_RemainsStable as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_VegetationInstances_DespawnWhenOutOfRange(self, request, workspace, editor, launcher_platform): - from .EditorScripts import VegetationInstances_DespawnWhenOutOfRange as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_InstanceSpawnerPriority_LayerAndSubPriority_HigherValuesPlantOverLower(self, request, workspace, editor, launcher_platform): - from .EditorScripts import InstanceSpawnerPriority_LayerAndSubPriority as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_LayerBlocker_InstancesBlockedInConfiguredArea(self, request, workspace, editor, launcher_platform): - from .EditorScripts import LayerBlocker_InstancesBlockedInConfiguredArea as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_LayerSpawner_InheritBehaviorFlag(self, request, workspace, editor, launcher_platform): - from .EditorScripts import LayerSpawner_InheritBehaviorFlag as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_LayerSpawner_InstancesPlantInAllSupportedShapes(self, request, workspace, editor, launcher_platform): - from .EditorScripts import LayerSpawner_InstancesPlantInAllSupportedShapes as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_LayerSpawner_FilterStageToggle(self, request, workspace, editor, launcher_platform): - from .EditorScripts import LayerSpawner_FilterStageToggle as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - @pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2038") - def test_LayerSpawner_InstancesRefreshUsingCorrectViewportCamera(self, request, workspace, editor, launcher_platform): - from .EditorScripts import LayerSpawner_InstancesRefreshUsingCorrectViewportCamera as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_MeshBlocker_InstancesBlockedByMesh(self, request, workspace, editor, launcher_platform): - from .EditorScripts import MeshBlocker_InstancesBlockedByMesh as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_MeshBlocker_InstancesBlockedByMeshHeightTuning(self, request, workspace, editor, launcher_platform): - from .EditorScripts import MeshBlocker_InstancesBlockedByMeshHeightTuning as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_MeshSurfaceTagEmitter_DependentOnMeshComponent(self, request, workspace, editor, launcher_platform): - from .EditorScripts import MeshSurfaceTagEmitter_DependentOnMeshComponent as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(self, request, workspace, editor, launcher_platform): - from .EditorScripts import MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_PhysXColliderSurfaceTagEmitter_E2E_Editor(self, request, workspace, editor, launcher_platform): - from .EditorScripts import PhysXColliderSurfaceTagEmitter_E2E_Editor as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets(self, request, workspace, editor, launcher_platform): - from .EditorScripts import PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_PositionModifier_AutoSnapToSurfaceWorks(self, request, workspace, editor, launcher_platform): - from .EditorScripts import PositionModifier_AutoSnapToSurfaceWorks as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_RotationModifier_InstancesRotateWithinRange(self, request, workspace, editor, launcher_platform): - from .EditorScripts import RotationModifier_InstancesRotateWithinRange as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_RotationModifierOverrides_InstancesRotateWithinRange(self, request, workspace, editor, launcher_platform): - from .EditorScripts import RotationModifierOverrides_InstancesRotateWithinRange as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_ScaleModifier_InstancesProperlyScale(self, request, workspace, editor, launcher_platform): - from .EditorScripts import ScaleModifier_InstancesProperlyScale as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_ScaleModifierOverrides_InstancesProperlyScale(self, request, workspace, editor, launcher_platform): - from .EditorScripts import ScaleModifierOverrides_InstancesProperlyScale as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_ShapeIntersectionFilter_InstancesPlantInAssignedShape(self, request, workspace, editor, launcher_platform): - from .EditorScripts import ShapeIntersectionFilter_InstancesPlantInAssignedShape as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_ShapeIntersectionFilter_FilterStageToggle(self, request, workspace, editor, launcher_platform): - from .EditorScripts import ShapeIntersectionFilter_FilterStageToggle as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_SlopeAlignmentModifier_InstanceSurfaceAlignment(self, request, workspace, editor, launcher_platform): - from .EditorScripts import SlopeAlignmentModifier_InstanceSurfaceAlignment as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment(self, request, workspace, editor, launcher_platform): - from .EditorScripts import SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_SurfaceMaskFilter_BasicSurfaceTagCreation(self, request, workspace, editor, launcher_platform): - from .EditorScripts import SurfaceMaskFilter_BasicSurfaceTagCreation as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_SurfaceMaskFilter_ExclusiveSurfaceTags_Function(self, request, workspace, editor, launcher_platform): - from .EditorScripts import SurfaceMaskFilter_ExclusionList as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_SurfaceMaskFilter_InclusiveSurfaceTags_Function(self, request, workspace, editor, launcher_platform): - from .EditorScripts import SurfaceMaskFilter_InclusionList as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected(self, request, workspace, editor, launcher_platform): - from .EditorScripts import SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_SystemSettings_SectorPointDensity(self, request, workspace, editor, launcher_platform): - from .EditorScripts import SystemSettings_SectorPointDensity as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_SystemSettings_SectorSize(self, request, workspace, editor, launcher_platform): - from .EditorScripts import SystemSettings_SectorSize as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlopes(self, request, workspace, editor, launcher_platform): - from .EditorScripts import SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - -@pytest.mark.SUITE_periodic -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("level", ["tmp_level"]) -class TestAutomationE2E(TestAutomationBase): - - # The following tests must run in order, please do not move tests out of order - - @pytest.mark.parametrize("launcher_platform", ['windows_editor']) - def test_DynamicSliceInstanceSpawner_Embedded_E2E_Editor(self, request, workspace, project, level, editor, launcher_platform): - # Ensure our test level does not already exist - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - from .EditorScripts import DynamicSliceInstanceSpawner_Embedded_E2E as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - @pytest.mark.parametrize("launcher_platform", ['windows']) - def test_DynamicSliceInstanceSpawner_Embedded_E2E_Launcher(self, workspace, launcher, level, - remote_console_instance, project, launcher_platform): - - expected_lines = [ - "Instances found in area = 400" - ] - - hydra.launch_and_validate_results_launcher(launcher, level, remote_console_instance, expected_lines, launch_ap=False) - - # Cleanup our temp level - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.parametrize("launcher_platform", ['windows_editor']) - def test_DynamicSliceInstanceSpawner_External_E2E_Editor(self, request, workspace, project, level, editor, launcher_platform): - # Ensure our test level does not already exist - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - from .EditorScripts import DynamicSliceInstanceSpawner_External_E2E as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - @pytest.mark.parametrize("launcher_platform", ['windows']) - def test_DynamicSliceInstanceSpawner_External_E2E_Launcher(self, workspace, launcher, level, - remote_console_instance, project, launcher_platform): - - expected_lines = [ - "Instances found in area = 400" - ] - - hydra.launch_and_validate_results_launcher(launcher, level, remote_console_instance, expected_lines, launch_ap=False) - - # Cleanup our temp level - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.parametrize("launcher_platform", ['windows_editor']) - def test_LayerBlender_E2E_Editor(self, request, workspace, project, level, editor, launcher_platform): - # Ensure our test level does not already exist - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - from .EditorScripts import LayerBlender_E2E_Editor as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - @pytest.mark.parametrize("launcher_platform", ['windows']) - @pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/4170") - def test_LayerBlender_E2E_Launcher(self, workspace, launcher, level, - remote_console_instance, project, launcher_platform): - - launcher.args.extend(["-rhi=Null"]) - launcher.start(launch_ap=False) - assert launcher.is_alive(), "Launcher failed to start" - - # Wait for test script to quit the launcher. If wait_for returns exc, test was not successful - waiter.wait_for(lambda: not launcher.is_alive(), timeout=300) - - # Verify launcher quit successfully and did not crash - ret_code = launcher.get_returncode() - assert ret_code == 0, "Test failed. See Game.log for details" - - # Cleanup our temp level - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) + class test_DynVegUtils_TempPrefabCreationWorks(EditorSharedTest): + from .EditorScripts import DynVegUtils_TempPrefabCreationWorks as test_module diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic_Optimized.py deleted file mode 100644 index f87d6567ef..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic_Optimized.py +++ /dev/null @@ -1,23 +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 -""" - -import os -import pytest - -import ly_test_tools.environment.file_system as file_system -from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite - - -@pytest.mark.SUITE_main -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(EditorTestSuite): - - global_extra_cmdline_args = ["-BatchMode", "-autotest_mode"] - - class test_DynVegUtils_TempPrefabCreationWorks(EditorSharedTest): - from .EditorScripts import DynVegUtils_TempPrefabCreationWorks as test_module diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientGenerators_Incompatibilities.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientGenerators_Incompatibilities.py index 09cd760647..6979ff1dee 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientGenerators_Incompatibilities.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientGenerators_Incompatibilities.py @@ -65,8 +65,7 @@ def GradientGenerators_Incompatibilities(): } # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # For every gradient generator component, verify that they are incompatible # which each vegetation area component diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientModifiers_Incompatibilities.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientModifiers_Incompatibilities.py index a4d9181744..962a0004f9 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientModifiers_Incompatibilities.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientModifiers_Incompatibilities.py @@ -74,8 +74,7 @@ def GradientModifiers_Incompatibilities(): } # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # For every gradient modifier component, verify that they are incompatible # which each vegetation area and gradient generator/modifier component diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py index 3749f93bf5..87f9e1a9b1 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py @@ -86,8 +86,7 @@ def GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(): return entity # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create entity with Random Noise gradient and verify gradient position after clearing pinned entity clear_entityid_check_position( diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_DefaultPinnedEntityIsSelf.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_DefaultPinnedEntityIsSelf.py index 3756452710..cd3fd7e1ee 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_DefaultPinnedEntityIsSelf.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_DefaultPinnedEntityIsSelf.py @@ -90,8 +90,7 @@ def GradientPreviewSettings_DefaultPinnedEntityIsSelf(): ] # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() for param in param_list: execute_test(param.required_components[param.accessed_component], diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSampling_GradientReferencesAddRemoveSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSampling_GradientReferencesAddRemoveSuccessfully.py index 8e85345a6f..f2980d9634 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSampling_GradientReferencesAddRemoveSuccessfully.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSampling_GradientReferencesAddRemoveSuccessfully.py @@ -61,8 +61,7 @@ def GradientSampling_GradientReferencesAddRemoveSuccessfully(): Report.result(gradient_cleared_from_modifier, entity.Equal(EntityId.EntityId())) # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create a new entity with components "Random Noise Gradient", "Gradient Transform Modifier" and "Box Shape" entity_position = math.Vector3(125.0, 136.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_ComponentDependencies.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_ComponentDependencies.py index f653515a39..0cc325efd1 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_ComponentDependencies.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_ComponentDependencies.py @@ -42,8 +42,7 @@ def GradientSurfaceTagEmitter_ComponentDependencies(): return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", EntityComponentIdPair) # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Create an entity with Gradient Surface Tag Emitter component position = math.Vector3(512.0, 512.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py index 90840a135d..cf48096a31 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py @@ -36,8 +36,7 @@ def GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create an entity with Gradient Surface Tag Emitter and Reference Gradient components. entity_position = math.Vector3(125.0, 136.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithExpectedGradients.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithExpectedGradients.py index 5e6df4d52f..27ef248d6c 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithExpectedGradients.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithExpectedGradients.py @@ -46,8 +46,7 @@ def GradientTransform_ComponentIncompatibleWithExpectedGradients(): return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", EntityComponentIdPair) # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create a new entity with components Gradient Transform Modifier and Box Shape entity_position = math.Vector3(125.0, 136.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithSpawners.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithSpawners.py index fd65996fdd..9c23cdea75 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithSpawners.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithSpawners.py @@ -44,8 +44,7 @@ def GradientTransform_ComponentIncompatibleWithSpawners(): return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", EntityComponentIdPair) # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create a new entity with components Gradient Transform Modifier and Box Shape entity_position = math.Vector3(125.0, 136.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py index 530503db86..6d6911ff3a 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py @@ -54,8 +54,7 @@ def GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create entity entity_position = math.Vector3(125.0, 136.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_RequiresShape.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_RequiresShape.py index 09cce359d5..ec142f92d2 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_RequiresShape.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_RequiresShape.py @@ -47,8 +47,7 @@ def GradientTransform_RequiresShape(): from editor_python_test_tools.utils import TestHelper as helper # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Create a new Entity in the level entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_ProcessedImageAssignedSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_ProcessedImageAssignedSuccessfully.py index 42458665e1..afe0893da9 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_ProcessedImageAssignedSuccessfully.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_ProcessedImageAssignedSuccessfully.py @@ -56,8 +56,7 @@ def ImageGradient_ProcessedImageAssignedSuccessfully(): from editor_python_test_tools.utils import TestHelper as helper # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create an entity with Image Gradient and Gradient Transform Modifier components components_to_add = ["Image Gradient", "Gradient Transform Modifier", "Box Shape"] diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_RequiresShape.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_RequiresShape.py index 3b832d160a..85582d198a 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_RequiresShape.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_RequiresShape.py @@ -47,8 +47,7 @@ def ImageGradient_RequiresShape(): from editor_python_test_tools.utils import TestHelper as helper # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Create a new Entity in the level entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py index 3ad27eb973..d4199c31f6 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py @@ -5,67 +5,51 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import os import pytest -import sys -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../automatedtesting_shared') -from base import TestAutomationBase +from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite @pytest.mark.SUITE_periodic @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(TestAutomationBase): +class TestAutomation(EditorTestSuite): - def test_GradientGenerators_Incompatibilities(self, request, workspace, editor, launcher_platform): + class test_GradientGenerators_Incompatibilities(EditorSharedTest): from .EditorScripts import GradientGenerators_Incompatibilities as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - def test_GradientModifiers_Incompatibilities(self, request, workspace, editor, launcher_platform): + class test_GradientModifiers_Incompatibilities(EditorSharedTest): from .EditorScripts import GradientModifiers_Incompatibilities as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - def test_GradientPreviewSettings_DefaultPinnedEntityIsSelf(self, request, workspace, editor, launcher_platform): - from .EditorScripts import GradientPreviewSettings_DefaultPinnedEntityIsSelf as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(self, request, workspace, editor, launcher_platform): + class test_GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(EditorSharedTest): from .EditorScripts import GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - def test_GradientSampling_GradientReferencesAddRemoveSuccessfully(self, request, workspace, editor, launcher_platform): + class test_GradientPreviewSettings_DefaultPinnedEntityIsSelf(EditorSharedTest): + from .EditorScripts import GradientPreviewSettings_DefaultPinnedEntityIsSelf as test_module + + class test_GradientSampling_GradientReferencesAddRemoveSuccessfully(EditorSharedTest): from .EditorScripts import GradientSampling_GradientReferencesAddRemoveSuccessfully as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - def test_GradientSurfaceTagEmitter_ComponentDependencies(self, request, workspace, editor, launcher_platform): + class test_GradientSurfaceTagEmitter_ComponentDependencies(EditorSharedTest): from .EditorScripts import GradientSurfaceTagEmitter_ComponentDependencies as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - def test_GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(self, request, workspace, editor, launcher_platform): + class test_GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(EditorSharedTest): from .EditorScripts import GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - def test_GradientTransform_RequiresShape(self, request, workspace, editor, launcher_platform): - from .EditorScripts import GradientTransform_RequiresShape as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(self, request, workspace, editor, launcher_platform): - from .EditorScripts import GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_GradientTransform_ComponentIncompatibleWithSpawners(self, request, workspace, editor, launcher_platform): - from .EditorScripts import GradientTransform_ComponentIncompatibleWithSpawners as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - - def test_GradientTransform_ComponentIncompatibleWithExpectedGradients(self, request, workspace, editor, launcher_platform): + class test_GradientTransform_ComponentIncompatibleWithExpectedGradients(EditorSharedTest): from .EditorScripts import GradientTransform_ComponentIncompatibleWithExpectedGradients as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) - def test_ImageGradient_RequiresShape(self, request, workspace, editor, launcher_platform): - from .EditorScripts import ImageGradient_RequiresShape as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) + class test_GradientTransform_ComponentIncompatibleWithSpawners(EditorSharedTest): + from .EditorScripts import GradientTransform_ComponentIncompatibleWithSpawners as test_module - def test_ImageGradient_ProcessedImageAssignedSuccessfully(self, request, workspace, editor, launcher_platform): + class test_GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(EditorSharedTest): + from .EditorScripts import GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange as test_module + + class test_GradientTransform_RequiresShape(EditorSharedTest): + from .EditorScripts import GradientTransform_RequiresShape as test_module + + class test_ImageGradient_ProcessedImageAssignedSuccessfully(EditorSharedTest): from .EditorScripts import ImageGradient_ProcessedImageAssignedSuccessfully as test_module - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) + + class test_ImageGradient_RequiresShape(EditorSharedTest): + from .EditorScripts import ImageGradient_RequiresShape as test_module diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py deleted file mode 100644 index 6ac0658b4d..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py +++ /dev/null @@ -1,57 +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 -""" - -import pytest - -from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite - - -@pytest.mark.SUITE_periodic -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(EditorTestSuite): - - enable_prefab_system = False - - class test_GradientGenerators_Incompatibilities(EditorSharedTest): - from .EditorScripts import GradientGenerators_Incompatibilities as test_module - - class test_GradientModifiers_Incompatibilities(EditorSharedTest): - from .EditorScripts import GradientModifiers_Incompatibilities as test_module - - class test_GradientPreviewSettings_DefaultPinnedEntityIsSelf(EditorSharedTest): - from .EditorScripts import GradientPreviewSettings_DefaultPinnedEntityIsSelf as test_module - - class test_GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(EditorSharedTest): - from .EditorScripts import GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin as test_module - - class test_GradientSampling_GradientReferencesAddRemoveSuccessfully(EditorSharedTest): - from .EditorScripts import GradientSampling_GradientReferencesAddRemoveSuccessfully as test_module - - class test_GradientSurfaceTagEmitter_ComponentDependencies(EditorSharedTest): - from .EditorScripts import GradientSurfaceTagEmitter_ComponentDependencies as test_module - - class test_GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(EditorSharedTest): - from .EditorScripts import GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully as test_module - - class test_GradientTransform_RequiresShape(EditorSharedTest): - from .EditorScripts import GradientTransform_RequiresShape as test_module - - class test_GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(EditorSharedTest): - from .EditorScripts import GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange as test_module - - class test_GradientTransform_ComponentIncompatibleWithSpawners(EditorSharedTest): - from .EditorScripts import GradientTransform_ComponentIncompatibleWithSpawners as test_module - - class test_GradientTransform_ComponentIncompatibleWithExpectedGradients(EditorSharedTest): - from .EditorScripts import GradientTransform_ComponentIncompatibleWithExpectedGradients as test_module - - class test_ImageGradient_RequiresShape(EditorSharedTest): - from .EditorScripts import ImageGradient_RequiresShape as test_module - - class test_ImageGradient_ProcessedImageAssignedSuccessfully(EditorSharedTest): - from .EditorScripts import ImageGradient_ProcessedImageAssignedSuccessfully as test_module diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py b/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py index 37afeff8c0..fd6a907b2e 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py @@ -114,7 +114,8 @@ def create_dynamic_slice_vegetation_area(name, center_point, box_size_x, box_siz return spawner_entity -def create_prefab_vegetation_area(name, center_point, box_size_x, box_size_y, box_size_z, target_prefab): +def create_temp_prefab_vegetation_area(name, center_point, box_size_x, box_size_y, box_size_z, target_prefab): + """Creates a vegetation area using in-memory prefabs. Use when test is solely contained to Editor""" # Create a vegetation area entity to use as our test vegetation spawner spawner_entity = hydra.Entity(name) spawner_entity.create_entity( @@ -148,6 +149,31 @@ def create_prefab_vegetation_area(name, center_point, box_size_x, box_size_y, bo return spawner_entity +def create_prefab_vegetation_area(name, center_point, box_size_x, box_size_y, box_size_z, prefab_path): + """Creates a vegetation area using on-disk spawnable prefabs. Use when test requires saving/loading in Launcher""" + # Create a vegetation area entity to use as our test vegetation spawner + prefab_asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", prefab_path, math.Uuid(), + False) + spawner_entity = hydra.Entity(name) + spawner_entity.create_entity( + center_point, + ["Vegetation Layer Spawner", "Box Shape", "Vegetation Asset List"] + ) + if spawner_entity.id.IsValid(): + print(f"'{spawner_entity.name}' created") + spawner_entity.get_set_test(1, "Box Shape|Box Configuration|Dimensions", math.Vector3(box_size_x, box_size_y, + box_size_z)) + + # Set the vegetation area to a prefab instance spawner with a specific prefab asset selected + descriptor = hydra.get_component_property_value(spawner_entity.components[2], + 'Configuration|Embedded Assets|[0]') + prefab_spawner = vegetation.PrefabInstanceSpawner() + prefab_spawner.SetPrefabAssetId(prefab_asset_id) + descriptor.spawner = prefab_spawner + spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[0]", descriptor) + return spawner_entity + + def create_blocker_area(name, center_point, box_size_x, box_size_y, box_size_z): # Create a Vegetation Layer Blocker area blocker_entity = hydra.Entity(name) @@ -162,6 +188,23 @@ def create_blocker_area(name, center_point, box_size_x, box_size_y, box_size_z): return blocker_entity +def create_empty_vegetation_area(name, center_point, box_size_x, box_size_y, box_size_z): + # Create a vegetation area entity to use as our test vegetation spawner + spawner_entity = EditorEntity.create_editor_entity_at(center_point, name=name) + spawner_entity.add_components(["Vegetation Layer Spawner", "Box Shape", "Vegetation Asset List"]) + if spawner_entity.id.IsValid(): + print(f"'{spawner_entity.get_name()}' created") + spawner_entity.components[1].set_component_property_value("Box Shape|Box Configuration|Dimensions", + math.Vector3(box_size_x, box_size_y, box_size_z)) + + # Set the vegetation area to an empty spawner + empty_spawner = vegetation.EmptyInstanceSpawner() + descriptor = spawner_entity.components[2].get_component_property_value("Configuration|Embedded Assets|[0]") + descriptor.spawner = empty_spawner + spawner_entity.components[2].set_component_property_value("Configuration|Embedded Assets|[0]", descriptor) + return spawner_entity + + def validate_instance_count(center, radius, num_expected): # Verify that we have the correct number of instances in the given area. This creates a bounding box based on a # sphere radius diff --git a/AutomatedTesting/ScriptCanvas/instance_counter.scriptcanvas b/AutomatedTesting/ScriptCanvas/instance_counter.scriptcanvas index 0e5524273c..4ef5f0a8d5 100644 --- a/AutomatedTesting/ScriptCanvas/instance_counter.scriptcanvas +++ b/AutomatedTesting/ScriptCanvas/instance_counter.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 3744110453276 + "id": 337666590525276931 }, "Name": "instance_counter", "Components": { @@ -87,7 +87,6 @@ ], "Datums": [ { - "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 3 }, @@ -228,7 +227,6 @@ ], "Datums": [ { - "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 1 }, @@ -237,7 +235,7 @@ "value": { "id": 2901262558 }, - "label": "Source" + "label": "EntityID: 0" } ], "methodType": 0, @@ -340,7 +338,6 @@ ], "Datums": [ { - "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 3 }, @@ -587,26 +584,10 @@ "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", "versionData": { "_grammarVersion": 1, - "_runtimeVersion": 1 + "_runtimeVersion": 1, + "_fileVersion": 1 }, "GraphCanvasData": [ - { - "Key": { - "id": 3744110453276 - }, - "Value": { - "ComponentData": { - "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { - "$type": "SceneComponentSaveData", - "ViewParams": { - "Scale": 0.9218543514249998, - "AnchorX": 50.98419189453125, - "AnchorY": -272.27728271484375 - } - } - } - } - }, { "Key": { "id": 3748405420572 @@ -757,6 +738,18 @@ } } } + }, + { + "Key": { + "id": 337666590525276931 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData" + } + } + } } ], "StatisticsHelper": { From 3e5c1cee1eca80e6678e4e097bd22cf9ca28d035 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 21 Jan 2022 11:56:32 -0800 Subject: [PATCH 359/620] Fixed a place where GetFullName was still being used. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../MaterialEditor/Code/Source/Document/MaterialDocument.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index 8f25e41827..2a0d91d0ad 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -595,7 +595,7 @@ namespace MaterialEditor MaterialPropertyValue propertyValue = AtomToolsFramework::ConvertToRuntimeType(it->second.GetValue()); if (propertyValue.IsValid()) { - if (!AtomToolsFramework::ConvertToExportFormat(exportPath, propertyId.GetFullName(), propertyDefinition, propertyValue)) + if (!AtomToolsFramework::ConvertToExportFormat(exportPath, propertyId, propertyDefinition, propertyValue)) { AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.GetCStr(), m_absolutePath.c_str()); result = false; From b21878d04e78e02f430c660b4cc9c9c5bda361a8 Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Fri, 21 Jan 2022 19:57:28 +0000 Subject: [PATCH 360/620] Removed unused variable Signed-off-by: Sergey Pereslavtsev --- .../PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp b/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp index 9a216b7d80..5f830acc8a 100644 --- a/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp +++ b/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp @@ -343,7 +343,6 @@ namespace PhysXEditorTests for (int sampleColumn = 0; sampleColumn < numColumns; ++sampleColumn) { physx::PxHeightFieldSample samplePhysX = heightfield->getSample(sampleRow, sampleColumn); - Physics::HeightMaterialPoint samplePhysics = samples[sampleRow * numColumns + sampleColumn]; auto [materialIndex0, materialIndex1] = PhysX::Utils::GetPhysXMaterialIndicesFromHeightfieldSamples(samples, sampleRow, sampleColumn, numRows, numColumns); EXPECT_EQ(samplePhysX.materialIndex0, materialIndex0); From a8d97cf8aa39f515c2f801e7959fdf163edcb866 Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Fri, 21 Jan 2022 12:02:20 -0800 Subject: [PATCH 361/620] Fix hi-res display issues in UI Editor (#6912) * Fix dpi scaling issues in UI Editor Signed-off-by: abrmich * Remove older method for getting dpi scaling factor Signed-off-by: abrmich * Remove direct call to devicePixelRatioF() Signed-off-by: abrmich * Use existing convenience function Signed-off-by: abrmich * Fix one more text size Signed-off-by: abrmich * Fix compile warning Signed-off-by: abrmich * Remove unnecessary typecast Signed-off-by: abrmich --- Gems/LyShine/Code/Editor/GuideHelpers.cpp | 5 +- Gems/LyShine/Code/Editor/QtHelpers.cpp | 14 ---- Gems/LyShine/Code/Editor/QtHelpers.h | 5 -- Gems/LyShine/Code/Editor/RulerWidget.cpp | 17 ++++- Gems/LyShine/Code/Editor/ViewportHelpers.cpp | 6 +- Gems/LyShine/Code/Editor/ViewportIcon.cpp | 2 +- .../Code/Editor/ViewportInteraction.cpp | 39 +++++----- .../LyShine/Code/Editor/ViewportInteraction.h | 2 +- Gems/LyShine/Code/Editor/ViewportWidget.cpp | 71 ++++++++++++------- Gems/LyShine/Code/Editor/ViewportWidget.h | 13 ++-- 10 files changed, 97 insertions(+), 77 deletions(-) diff --git a/Gems/LyShine/Code/Editor/GuideHelpers.cpp b/Gems/LyShine/Code/Editor/GuideHelpers.cpp index b6d7acc57a..0713782063 100644 --- a/Gems/LyShine/Code/Editor/GuideHelpers.cpp +++ b/Gems/LyShine/Code/Editor/GuideHelpers.cpp @@ -134,7 +134,7 @@ namespace GuideHelpers AZ::Matrix4x4 transform; EBUS_EVENT_ID_RESULT(transform, canvasEntityId, UiCanvasBus, GetCanvasToViewportMatrix); - AZ::Vector2 viewportSize(aznumeric_cast(viewport->size().width()), aznumeric_cast(viewport->size().height())); + AZ::Vector2 viewportSize = viewport->GetRenderViewportSize(); AZ::Color guideColor; EBUS_EVENT_ID_RESULT(guideColor, canvasEntityId, UiEditorCanvasBus, GetGuideColor); @@ -167,8 +167,7 @@ namespace GuideHelpers void DrawGhostGuideLine(Draw2dHelper& draw2d, AZ::EntityId canvasEntityId, bool guideIsVertical, ViewportWidget* viewport, const AZ::Vector2& canvasPoint) { AZ::Vector2 viewportPoint = CanvasHelpers::GetViewportPoint(canvasEntityId, canvasPoint); - - AZ::Vector2 viewportSize(aznumeric_cast(viewport->size().width()), aznumeric_cast(viewport->size().height())); + AZ::Vector2 viewportSize = viewport->GetRenderViewportSize(); // the line is drawn as the inverse of the background color AZ::Color guideColor(1.0f, 1.0f, 1.0f, 1.0f); diff --git a/Gems/LyShine/Code/Editor/QtHelpers.cpp b/Gems/LyShine/Code/Editor/QtHelpers.cpp index d9147463ed..3b38894016 100644 --- a/Gems/LyShine/Code/Editor/QtHelpers.cpp +++ b/Gems/LyShine/Code/Editor/QtHelpers.cpp @@ -29,18 +29,4 @@ namespace QtHelpers bool inWidget = (localPos.x() >= 0 && localPos.x() < size.width() && localPos.y() >= 0 && localPos.y() < size.height()); return inWidget; } - - float GetHighDpiScaleFactor(const QWidget& widget) - { - return static_cast(QHighDpiScaling::factor(widget.windowHandle()->screen())); - } - - QSize GetDpiScaledViewportSize(const QWidget& widget) - { - float dpiScale = GetHighDpiScaleFactor(widget); - float width = ceilf(widget.size().width() * dpiScale); - float height = ceilf(widget.size().height() * dpiScale); - return QSize(static_cast(width), static_cast(height)); - } - } // namespace QtHelpers diff --git a/Gems/LyShine/Code/Editor/QtHelpers.h b/Gems/LyShine/Code/Editor/QtHelpers.h index 4a9e7091ff..1b5f561871 100644 --- a/Gems/LyShine/Code/Editor/QtHelpers.h +++ b/Gems/LyShine/Code/Editor/QtHelpers.h @@ -16,9 +16,4 @@ namespace QtHelpers AZ::Vector2 MapGlobalPosToLocalVector2(const QWidget* widget, const QPoint& pos); bool IsGlobalPosInWidget(const QWidget* widget, const QPoint& pos); - - float GetHighDpiScaleFactor(const QWidget& widget); - - QSize GetDpiScaledViewportSize(const QWidget& widget); - } // namespace QtHelpers diff --git a/Gems/LyShine/Code/Editor/RulerWidget.cpp b/Gems/LyShine/Code/Editor/RulerWidget.cpp index 0a9209ba38..c82a64ac14 100644 --- a/Gems/LyShine/Code/Editor/RulerWidget.cpp +++ b/Gems/LyShine/Code/Editor/RulerWidget.cpp @@ -61,6 +61,14 @@ void RulerWidget::paintEvent([[maybe_unused]] QPaintEvent* event) float scale = translationAndScale.scale; float translation = (m_orientation == Orientation::Horizontal) ? translationAndScale.translation.GetX() : translationAndScale.translation.GetY(); + // Convert back to qt widget coords for painting + float dpiScaleFactor = m_editorWindow->GetViewport()->WidgetToViewportFactor(); + if (dpiScaleFactor != 0.0f) + { + scale /= dpiScaleFactor; + translation /= dpiScaleFactor; + } + // If the viewport is really small then scale can be zero (or very close) which would cause a divide by zero in later math so we just don't paint anything const float epsilon = 0.00001f; if (scale < epsilon) @@ -87,7 +95,9 @@ void RulerWidget::paintEvent([[maybe_unused]] QPaintEvent* event) void RulerWidget::mousePressEvent(QMouseEvent* ev) { // start a drag interaction to create a guide - AZ::Vector2 viewportMousePos = QtHelpers::MapGlobalPosToLocalVector2(m_editorWindow->GetViewport(), ev->globalPos()); + AZ::Vector2 localMousePos = QtHelpers::MapGlobalPosToLocalVector2(m_editorWindow->GetViewport(), ev->globalPos()); + float dpiScaleFactor = m_editorWindow->GetViewport()->WidgetToViewportFactor(); + AZ::Vector2 viewportMousePos = localMousePos * dpiScaleFactor; bool isVertical = m_orientation == Orientation::Vertical; m_dragInteraction = new ViewportAddGuideInteraction(m_editorWindow, m_editorWindow->GetCanvas(), isVertical, viewportMousePos); } @@ -98,7 +108,10 @@ void RulerWidget::mouseMoveEvent(QMouseEvent* ev) // We only get the events if the mouse is pressed down. So we only get here when adding a ruler. if (m_dragInteraction) { - AZ::Vector2 viewportMousePos = QtHelpers::MapGlobalPosToLocalVector2(m_editorWindow->GetViewport(), ev->globalPos()); + AZ::Vector2 localMousePos = QtHelpers::MapGlobalPosToLocalVector2(m_editorWindow->GetViewport(), ev->globalPos()); + float dpiScaleFactor = m_editorWindow->GetViewport()->WidgetToViewportFactor(); + AZ::Vector2 viewportMousePos = localMousePos * dpiScaleFactor; + m_dragInteraction->Update(viewportMousePos); } diff --git a/Gems/LyShine/Code/Editor/ViewportHelpers.cpp b/Gems/LyShine/Code/Editor/ViewportHelpers.cpp index 7d81a12477..ee89b213ef 100644 --- a/Gems/LyShine/Code/Editor/ViewportHelpers.cpp +++ b/Gems/LyShine/Code/Editor/ViewportHelpers.cpp @@ -336,7 +336,7 @@ namespace ViewportHelpers draw2d.SetTextAlignment(IDraw2d::HAlign::Center, IDraw2d::VAlign::Bottom); draw2d.SetTextRotation(0.0f); - draw2d.DrawText(rotationString.toUtf8().data(), rotationStringPos, GetDpiScaledSize(16.0f), 1.0f); + draw2d.DrawText(rotationString.toUtf8().data(), rotationStringPos, 8.0f, 1.0f); } } @@ -347,9 +347,11 @@ namespace ViewportHelpers const AZ::Vector2 textLabelOffset(10.0f, -10.0f); QPoint viewportCursorPos = viewport->mapFromGlobal(QCursor::pos()); AZ::Vector2 textPos = AZ::Vector2(aznumeric_cast(viewportCursorPos.x()), aznumeric_cast(viewportCursorPos.y())) + textLabelOffset; + float dpiScale = viewport->WidgetToViewportFactor(); + textPos *= dpiScale; draw2d.SetTextAlignment(IDraw2d::HAlign::Left, IDraw2d::VAlign::Bottom); draw2d.SetTextRotation(0.0f); - draw2d.DrawText(textLabel.c_str(), textPos, GetDpiScaledSize(16.0f), 1.0f); + draw2d.DrawText(textLabel.c_str(), textPos, 8.0f, 1.0f); } } // namespace ViewportHelpers diff --git a/Gems/LyShine/Code/Editor/ViewportIcon.cpp b/Gems/LyShine/Code/Editor/ViewportIcon.cpp index 33f2f40ffe..bdbad6afb2 100644 --- a/Gems/LyShine/Code/Editor/ViewportIcon.cpp +++ b/Gems/LyShine/Code/Editor/ViewportIcon.cpp @@ -296,7 +296,7 @@ void ViewportIcon::DrawDistanceLine(Draw2dHelper& draw2d, AZ::Vector2 start, AZ: draw2d.SetTextAlignment(IDraw2d::HAlign::Center, IDraw2d::VAlign::Bottom); draw2d.SetTextRotation(rotation); - draw2d.DrawText(textBuf, textPos, 16.0f * ViewportIcon::GetDpiScaleFactor(), 1.0f); + draw2d.DrawText(textBuf, textPos, 8.0f, 1.0f); } void ViewportIcon::DrawAnchorLinesSplit(Draw2dHelper& draw2d, AZ::Vector2 anchorPos1, AZ::Vector2 anchorPos2, diff --git a/Gems/LyShine/Code/Editor/ViewportInteraction.cpp b/Gems/LyShine/Code/Editor/ViewportInteraction.cpp index a39a7b9cac..7bd55be4bc 100644 --- a/Gems/LyShine/Code/Editor/ViewportInteraction.cpp +++ b/Gems/LyShine/Code/Editor/ViewportInteraction.cpp @@ -674,13 +674,13 @@ void ViewportInteraction::MouseReleaseEvent(QMouseEvent* ev, { // test to see if the mouse position is inside the viewport on each axis const QPoint& pos = ev->pos(); - const QSize& size = m_editorWindow->GetViewport()->size(); + const AZ::Vector2 size = m_editorWindow->GetViewport()->GetRenderViewportSize(); ViewportDragInteraction::EndState inWidget; - if (pos.x() >= 0 && pos.x() < size.width()) - inWidget = pos.y() >= 0 && pos.y() < size.height() ? ViewportDragInteraction::EndState::Inside : ViewportDragInteraction::EndState::OutsideY; + if (pos.x() >= 0 && pos.x() < size.GetX()) + inWidget = pos.y() >= 0 && pos.y() < size.GetY() ? ViewportDragInteraction::EndState::Inside : ViewportDragInteraction::EndState::OutsideY; else - inWidget = pos.y() >= 0 && pos.y() < size.height() ? ViewportDragInteraction::EndState::OutsideX : ViewportDragInteraction::EndState::OutsideXY; + inWidget = pos.y() >= 0 && pos.y() < size.GetY() ? ViewportDragInteraction::EndState::OutsideX : ViewportDragInteraction::EndState::OutsideXY; // Some interactions end differently depending on whether the mouse was released inside or outside the viewport m_dragInteraction->EndInteraction(inWidget); @@ -709,12 +709,12 @@ void ViewportInteraction::MouseReleaseEvent(QMouseEvent* ev, UpdateCursor(); } -void ViewportInteraction::MouseWheelEvent(QWheelEvent* ev) +bool ViewportInteraction::MouseWheelEvent(QWheelEvent* ev) { if (m_leftButtonIsActive || m_middleButtonIsActive) { // Ignore event. - return; + return false; } const QPoint numDegrees(ev->angleDelta()); @@ -735,6 +735,8 @@ void ViewportInteraction::MouseWheelEvent(QWheelEvent* ev) SetCanvasToViewportScale(QuantizeZoomScale(newScale), &pivotPoint); } + + return true; } bool ViewportInteraction::KeyPressEvent(QKeyEvent* ev) @@ -921,27 +923,27 @@ void ViewportInteraction::GetScaleToFitTransformProps(const AZ::Vector2* newCanv EBUS_EVENT_ID_RESULT(canvasSize, m_editorWindow->GetCanvas(), UiCanvasBus, GetCanvasSize); } - QSize viewportSize = QtHelpers::GetDpiScaledViewportSize(*m_editorWindow->GetViewport()); - const int viewportWidth = viewportSize.width(); - const int viewportHeight = viewportSize.height(); + AZ::Vector2 viewportSize = m_editorWindow->GetViewport()->GetRenderViewportSize(); + const float viewportWidth = viewportSize.GetX(); + const float viewportHeight = viewportSize.GetY(); // We pad the edges of the viewport to allow the user to easily see the borders of // the canvas edges, which is especially helpful if there are anchors sitting on // the edges of the canvas. static const int canvasBorderPaddingInPixels = 32; AZ::Vector2 viewportPaddedSize( - aznumeric_cast(viewportWidth - canvasBorderPaddingInPixels), - aznumeric_cast(viewportHeight - canvasBorderPaddingInPixels)); + viewportWidth - canvasBorderPaddingInPixels, + viewportHeight - canvasBorderPaddingInPixels); // Guard against very small viewports if (viewportPaddedSize.GetX() <= 0.0f) { - viewportPaddedSize.SetX(aznumeric_cast(viewportWidth)); + viewportPaddedSize.SetX(viewportWidth); } if (viewportPaddedSize.GetY() <= 0.0f) { - viewportPaddedSize.SetY(aznumeric_cast(viewportHeight)); + viewportPaddedSize.SetY(viewportHeight); } // Use a "scale to fit" approach @@ -949,8 +951,8 @@ void ViewportInteraction::GetScaleToFitTransformProps(const AZ::Vector2* newCanv viewportPaddedSize.GetX() / canvasSize.GetX(), viewportPaddedSize.GetY() / canvasSize.GetY()); - const int scaledCanvasWidth = static_cast(canvasSize.GetX() * canvasToViewportScale); - const int scaledCanvasHeight = static_cast(canvasSize.GetY() * canvasToViewportScale); + const float scaledCanvasWidth = canvasSize.GetX() * canvasToViewportScale; + const float scaledCanvasHeight = canvasSize.GetY() * canvasToViewportScale; // Centers the canvas within the viewport propsOut.translation = AZ::Vector3( @@ -1008,9 +1010,12 @@ void ViewportInteraction::SetCanvasToViewportScale(float newScale, Vec2i* option } else { + AZ::Vector2 viewportSize = m_editorWindow->GetViewport()->GetRenderViewportSize(); + const float viewportWidth = viewportSize.GetX(); + const float viewportHeight = viewportSize.GetY(); pivotPoint = Vec2i( - static_cast(m_editorWindow->GetViewport()->size().width() * 0.5f), - static_cast(m_editorWindow->GetViewport()->size().height() * 0.5f)); + static_cast(viewportWidth * 0.5f), + static_cast(viewportHeight * 0.5f)); } // Get the distance between our pivot point and the upper-left corner of the diff --git a/Gems/LyShine/Code/Editor/ViewportInteraction.h b/Gems/LyShine/Code/Editor/ViewportInteraction.h index a104d87634..b6417977ab 100644 --- a/Gems/LyShine/Code/Editor/ViewportInteraction.h +++ b/Gems/LyShine/Code/Editor/ViewportInteraction.h @@ -77,7 +77,7 @@ public: // member functions const QTreeWidgetItemRawPtrQList& selectedItems); void MouseReleaseEvent(QMouseEvent* ev, const QTreeWidgetItemRawPtrQList& selectedItems); - void MouseWheelEvent(QWheelEvent* ev); + bool MouseWheelEvent(QWheelEvent* ev); bool KeyPressEvent(QKeyEvent* ev); bool KeyReleaseEvent(QKeyEvent* ev); diff --git a/Gems/LyShine/Code/Editor/ViewportWidget.cpp b/Gems/LyShine/Code/Editor/ViewportWidget.cpp index b481e9cbf1..eb5625ac31 100644 --- a/Gems/LyShine/Code/Editor/ViewportWidget.cpp +++ b/Gems/LyShine/Code/Editor/ViewportWidget.cpp @@ -351,6 +351,17 @@ void ViewportWidget::SetRedrawEnabled(bool enabled) m_canvasRenderIsEnabled = enabled; } +AZ::Vector2 ViewportWidget::GetRenderViewportSize() const +{ + AZ::Vector2 widgetSize(aznumeric_cast(size().width()), aznumeric_cast(size().height())); + return widgetSize * WidgetToViewportFactor(); +} + +float ViewportWidget::WidgetToViewportFactor() const +{ + return GetViewportContext()->GetDpiScalingFactor(); +} + void ViewportWidget::PickItem(AZ::EntityId entityId) { AzToolsFramework::EditorPickModeRequestBus::Broadcast( @@ -496,7 +507,7 @@ void ViewportWidget::OnRenderTick() return; } - const float dpiScale = QtHelpers::GetHighDpiScaleFactor(*this); + const float dpiScale = WidgetToViewportFactor(); ViewportIcon::SetDpiScaleFactor(dpiScale); UiEditorMode editorMode = m_editorWindow->GetEditorMode(); @@ -510,6 +521,12 @@ void ViewportWidget::OnRenderTick() } } +//////////////////////////////////////////////////////////////////////////////////////////////////// +void ViewportWidget::OnViewportDpiScalingChanged(float dpiScale) +{ + ViewportIcon::SetDpiScaleFactor(dpiScale); +} + void ViewportWidget::RefreshTick() { #ifdef LYSHINE_EDITOR_TODO // still need this? @@ -640,27 +657,34 @@ void ViewportWidget::mouseReleaseEvent(QMouseEvent* ev) void ViewportWidget::wheelEvent(QWheelEvent* ev) { + bool handled = false; UiEditorMode editorMode = m_editorWindow->GetEditorMode(); - QWheelEvent scaledEvent( - WidgetToViewport(ev->position()), - ev->globalPosition(), - ev->pixelDelta(), - ev->angleDelta(), - ev->buttons(), - ev->modifiers(), - ev->phase(), - ev->inverted() - ); - if (editorMode == UiEditorMode::Edit) { + QWheelEvent scaledEvent( + WidgetToViewport(ev->position()), + ev->globalPosition(), + ev->pixelDelta(), + ev->angleDelta(), + ev->buttons(), + ev->modifiers(), + ev->phase(), + ev->inverted() + ); + // in Edit mode just send input to ViewportInteraction - m_viewportInteraction->MouseWheelEvent(&scaledEvent); + handled = m_viewportInteraction->MouseWheelEvent(&scaledEvent); } - RenderViewportWidget::wheelEvent(ev); - - Refresh(); + if (handled) + { + ev->accept(); + Refresh(); + } + else + { + RenderViewportWidget::wheelEvent(ev); + } } bool ViewportWidget::eventFilter([[maybe_unused]] QObject* watched, QEvent* event) @@ -975,8 +999,7 @@ void ViewportWidget::RenderEditMode() EBUS_EVENT_ID(canvasEntityId, UiCanvasBus, SetTargetCanvasSize, false, canvasSize); // Render this canvas - QSize scaledViewportSize = QtHelpers::GetDpiScaledViewportSize(*this); - AZ::Vector2 viewportSize(static_cast(scaledViewportSize.width()), static_cast(scaledViewportSize.height())); + AZ::Vector2 viewportSize = GetRenderViewportSize(); EBUS_EVENT_ID(canvasEntityId, UiEditorCanvasBus, RenderCanvasInEditorViewport, false, viewportSize); m_draw2d->SetSortKey(topLayerKey); @@ -1085,15 +1108,12 @@ void ViewportWidget::UpdatePreviewMode(float deltaTime) if (canvasEntityId.IsValid()) { - QSize scaledViewportSize = QtHelpers::GetDpiScaledViewportSize(*this); - AZ::Vector2 viewportSize(static_cast(scaledViewportSize.width()), static_cast(scaledViewportSize.height())); - // Get the canvas size AZ::Vector2 canvasSize = m_editorWindow->GetPreviewCanvasSize(); if (canvasSize.GetX() == 0.0f && canvasSize.GetY() == 0.0f) { // special value of (0,0) means use the viewport size - canvasSize = viewportSize; + canvasSize = GetRenderViewportSize();; } // Set the target size of the canvas @@ -1127,8 +1147,7 @@ void ViewportWidget::RenderPreviewMode() if (canvasEntityId.IsValid()) { - QSize scaledViewportSize = QtHelpers::GetDpiScaledViewportSize(*this); - AZ::Vector2 viewportSize(static_cast(scaledViewportSize.width()), static_cast(scaledViewportSize.height())); + AZ::Vector2 viewportSize = GetRenderViewportSize(); // Get the canvas size AZ::Vector2 canvasSize = m_editorWindow->GetPreviewCanvasSize(); @@ -1208,13 +1227,13 @@ void ViewportWidget::RenderPreviewMode() void ViewportWidget::RenderViewportBackground() { - QSize viewportSize = QtHelpers::GetDpiScaledViewportSize(*this); + AZ::Vector2 viewportSize = GetRenderViewportSize(); AZ::Color backgroundColor = ViewportHelpers::backgroundColorDark; const AZ::Data::Instance& image = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::White); Draw2dHelper draw2d(m_draw2d.get()); draw2d.SetImageColor(backgroundColor.GetAsVector3()); - draw2d.DrawImage(image, AZ::Vector2(0.0f, 0.0f), AZ::Vector2(static_cast(viewportSize.width()), static_cast(viewportSize.height()))); + draw2d.DrawImage(image, AZ::Vector2(0.0f, 0.0f), viewportSize); } void ViewportWidget::SetupShortcuts() diff --git a/Gems/LyShine/Code/Editor/ViewportWidget.h b/Gems/LyShine/Code/Editor/ViewportWidget.h index 722335aa93..c285e0d969 100644 --- a/Gems/LyShine/Code/Editor/ViewportWidget.h +++ b/Gems/LyShine/Code/Editor/ViewportWidget.h @@ -72,6 +72,12 @@ public: // member functions //! Used by ViewportInteraction for drawing ViewportHighlight* GetViewportHighlight() { return m_viewportHighlight.get(); } + //! Get the size of the RPI render viewport + AZ::Vector2 GetRenderViewportSize() const; + + //! Get the widget to viewport scale factor + float WidgetToViewportFactor() const; + bool IsInObjectPickMode() { return m_inObjectPickMode; } void PickItem(AZ::EntityId entityId); @@ -156,6 +162,7 @@ private: // member functions // AZ::RPI::ViewportContextNotificationBus::Handler overrides... void OnRenderTick() override; + void OnViewportDpiScalingChanged(float dpiScale) override; //! Update UI canvases when in edit mode void UpdateEditMode(float deltaTime); @@ -187,12 +194,6 @@ private: // data bool AcceptsMimeData(const QMimeData* mimeData); - double WidgetToViewportFactor() const - { - // Needed for high DPI mode on windows - return devicePixelRatioF(); - } - QPointF WidgetToViewport(const QPointF &point) const; EditorWindow* m_editorWindow; From 7fc4e4bd105ab53ec2ea990fa055b581da97d666 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 21 Jan 2022 14:29:37 -0600 Subject: [PATCH 362/620] Refactored the styling of TableView header sections Signed-off-by: Chris Galvan --- .../AzQtComponents/Components/Style.cpp | 12 ------------ .../Components/Widgets/TableView.cpp | 18 ------------------ .../Components/Widgets/TableView.h | 2 -- .../Components/Widgets/TableView.qss | 2 +- .../AzQtComponents/Gallery/TableViewPage.cpp | 3 +++ 5 files changed, 4 insertions(+), 33 deletions(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Style.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Style.cpp index ef29c05e61..849785ff01 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Style.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Style.cpp @@ -411,18 +411,6 @@ namespace AzQtComponents } break; - case CE_HeaderSection: - { - if (qobject_cast(widget)) - { - if (TableView::drawHeaderSection(this, option, painter, widget, m_data->tableViewConfig)) - { - return; - } - } - } - break; - case CE_ComboBoxLabel: { if (qobject_cast(widget)) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TableView.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TableView.cpp index f5cb90ae1a..b4b49bdcec 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TableView.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TableView.cpp @@ -38,7 +38,6 @@ namespace AzQtComponents ConfigHelpers::read(settings, QStringLiteral("FocusBorderWidth"), config.focusBorderWidth); ConfigHelpers::read(settings, QStringLiteral("FocusBorderColor"), config.focusBorderColor); ConfigHelpers::read(settings, QStringLiteral("FocusFillColor"), config.focusFillColor); - ConfigHelpers::read(settings, QStringLiteral("HeaderFillColor"), config.headerFillColor); settings.endGroup(); return config; @@ -52,7 +51,6 @@ namespace AzQtComponents config.focusBorderWidth = 1; config.focusBorderColor = QStringLiteral("#94D2FF"); config.focusFillColor = QStringLiteral("#10ffffff"); - config.headerFillColor = QStringLiteral("#2d2d2d"); return config; } @@ -177,22 +175,6 @@ namespace AzQtComponents return true; } - bool TableView::drawHeaderSection(const Style* style, const QStyleOption* option, QPainter* painter, const QWidget* widget, const Config& config) - { - Q_UNUSED(widget); - Q_UNUSED(style); - - const auto headerViewOption = qstyleoption_cast(option); - if (!headerViewOption) - { - return false; - } - - painter->fillRect(headerViewOption->rect, config.headerFillColor); - - return true; - } - bool TableView::drawFrameFocusRect(const Style* style, const QStyleOption* option, QPainter* painter, const Config& config) { Q_UNUSED(style); diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TableView.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TableView.h index 99fb77c3d8..6187f44dd5 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TableView.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TableView.h @@ -62,7 +62,6 @@ namespace AzQtComponents qreal focusBorderWidth; QColor focusBorderColor; QColor focusFillColor; - QColor headerFillColor; }; /*! @@ -93,7 +92,6 @@ namespace AzQtComponents private: static bool drawHeader(const Style* style, const QStyleOption* option, QPainter* painter, const QWidget* widget, const Config& config); - static bool drawHeaderSection(const Style* style, const QStyleOption* option, QPainter* painter, const QWidget* widget, const Config& config); static bool drawFrameFocusRect(const Style* style, const QStyleOption* option, QPainter* painter, const Config& config); static QRect itemViewItemRect(const Style* style, QStyle::SubElement element, const QStyleOptionViewItem* option, const QWidget* widget, const Config& config); static QSize sizeFromContents(const Style* style, QStyle::ContentsType type, const QStyleOption* option, const QSize& contentsSize, const QWidget* widget, const Config& config); diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TableView.qss b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TableView.qss index 47281eda7e..531a3378fa 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TableView.qss +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TableView.qss @@ -66,7 +66,7 @@ QTreeView QHeaderView::section { height: 24px; - background: #444444; + background: #2d2d2d; border: none; font-size: 12px; diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TableViewPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TableViewPage.cpp index 788ba62366..24e65ac540 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TableViewPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TableViewPage.cpp @@ -134,6 +134,9 @@ TableViewPage::TableViewPage(QWidget* parent) auto logItemDelegate = new AzToolsFramework::Logging::LogTableItemDelegate(ui->logTableView); ui->logTableView->setItemDelegate(logItemDelegate); + // Example of changing the header section background color + ui->logTableView->setStyleSheet("QHeaderView::section { background: transparent; }"); + ui->qTableView->setModel(logModel); ui->qTableView->setAlternatingRowColors(true); ui->qTableView->setShowGrid(false); From 86a0be256135d047fe82f4041283e77a13c73dba Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Fri, 21 Jan 2022 12:35:29 -0800 Subject: [PATCH 363/620] Prevent read-only entities from being duplicated via prefab workflows (#7076) * Refactor the sanitation of the selection for prefab operations to prevent read-only entities from being deleted or duplicated. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Fix comment. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- .../Prefab/PrefabPublicHandler.cpp | 45 ++++++++----------- .../Prefab/PrefabPublicHandler.h | 5 ++- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp index bde5de2f64..0c1fb9bed2 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp @@ -1063,7 +1063,7 @@ namespace AzToolsFramework return AZ::Failure(AZStd::string("No entities to duplicate.")); } - const EntityIdList entityIdsNoFocusContainer = GenerateEntityIdListWithoutFocusedInstanceContainer(entityIds); + const EntityIdList entityIdsNoFocusContainer = SanitizeEntityIdList(entityIds); if (entityIdsNoFocusContainer.empty()) { return AZ::Failure(AZStd::string("No entities to duplicate because only instance selected is the container entity of the focused instance.")); @@ -1202,7 +1202,7 @@ namespace AzToolsFramework PrefabOperationResult PrefabPublicHandler::DeleteFromInstance(const EntityIdList& entityIds, bool deleteDescendants) { // Remove the container entity of the focused prefab from the list, if it is included. - const EntityIdList entityIdsNoFocusContainer = GenerateEntityIdListWithoutFocusedInstanceContainer(entityIds); + const EntityIdList entityIdsNoFocusContainer = SanitizeEntityIdList(entityIds); if (entityIdsNoFocusContainer.empty()) { @@ -1236,27 +1236,6 @@ namespace AzToolsFramework return AZ::Failure(AZStd::string("Cannot delete entities belonging to an instance that is not being edited.")); } - // None of the specified entities can be marked as read only, otherwise this operation is invalid. - if (auto readOnlyEntityPublicInterface = AZ::Interface::Get()) - { - AZ::EntityId readOnlyEntityId; - for (const auto& entityId : entityIdsNoFocusContainer) - { - if (readOnlyEntityPublicInterface->IsReadOnly(entityId)) - { - readOnlyEntityId = entityId; - break; - } - } - - if (readOnlyEntityId.IsValid()) - { - return AZ::Failure(AZStd::string::format( - "Cannot delete entities because entity (id '%llu') is marked as read only.", - static_cast(readOnlyEntityId))); - } - } - // Retrieve entityList from entityIds EntityList inputEntityList = EntityIdListToEntityList(entityIdsNoFocusContainer); @@ -1680,10 +1659,24 @@ namespace AzToolsFramework return AZ::Success(); } - EntityIdList PrefabPublicHandler::GenerateEntityIdListWithoutFocusedInstanceContainer( - const EntityIdList& entityIds) const + EntityIdList PrefabPublicHandler::SanitizeEntityIdList(const EntityIdList& entityIds) const { - EntityIdList outEntityIds(entityIds); + EntityIdList outEntityIds; + + if (auto readOnlyEntityPublicInterface = AZ::Interface::Get()) + { + std::copy_if( + entityIds.begin(), entityIds.end(), AZStd::back_inserter(outEntityIds), + [readOnlyEntityPublicInterface](const AZ::EntityId& entityId) + { + return !readOnlyEntityPublicInterface->IsReadOnly(entityId); + } + ); + } + else + { + outEntityIds = entityIds; + } AzFramework::EntityContextId editorEntityContextId = AzToolsFramework::GetEntityContextId(); AZ::EntityId focusedInstanceContainerEntityId = m_prefabFocusPublicInterface->GetFocusedPrefabContainerEntityId(editorEntityContextId); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.h index 41c9b4a292..a1a7ac9844 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.h @@ -75,7 +75,10 @@ namespace AzToolsFramework Instance& commonRootEntityOwningInstance, EntityList& outEntities, AZStd::vector& outInstances) const; - EntityIdList GenerateEntityIdListWithoutFocusedInstanceContainer(const EntityIdList& entityIds) const; + + //! Sanitizes an EntityIdList to remove entities that should not be affected by prefab operations. + //! It will identify and exclude the container entity of the root prefab instance, and all read-only entities. + EntityIdList SanitizeEntityIdList(const EntityIdList& entityIds) const; InstanceOptionalReference GetOwnerInstanceByEntityId(AZ::EntityId entityId) const; bool EntitiesBelongToSameInstance(const EntityIdList& entityIds) const; From 1909e5fa540e11d9fa010dc0b578e45f095dbd15 Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Fri, 21 Jan 2022 13:09:09 -0800 Subject: [PATCH 364/620] Handle case where engine.json missing or corrupt (#7049) Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- Code/Tools/ProjectManager/Source/Application.cpp | 9 ++++----- Code/Tools/ProjectManager/Source/PythonBindings.cpp | 3 +++ scripts/o3de/o3de/manifest.py | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/Application.cpp b/Code/Tools/ProjectManager/Source/Application.cpp index 08a812999f..7ccd855b7e 100644 --- a/Code/Tools/ProjectManager/Source/Application.cpp +++ b/Code/Tools/ProjectManager/Source/Application.cpp @@ -196,9 +196,7 @@ namespace O3DE::ProjectManager return true; } - bool forceRegistration = false; - - // check if an engine with this name is already registered + // check if an engine with this name is already registered and has a valid engine.json auto existingEngineResult = m_pythonBindings->GetEngineInfo(engineInfo.m_name); if (existingEngineResult) { @@ -230,10 +228,11 @@ namespace O3DE::ProjectManager // user elected not to change the name or force registration return false; } - - forceRegistration = true; } + // always force register in case there is an engine registered in o3de_manifest.json, but + // the engine.json is missing or corrupt in which case GetEngineInfo() fails + constexpr bool forceRegistration = true; auto registerOutcome = m_pythonBindings->SetEngineInfo(engineInfo, forceRegistration); if (!registerOutcome) { diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index 00ece7396d..13fa73625c 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -459,6 +459,9 @@ namespace O3DE::ProjectManager if (!pybind11::isinstance(enginePathResult)) { engineInfo = EngineInfoFromPath(enginePathResult); + + // it is possible an engine is registered in o3de_manifest.json but the engine.json is + // missing or corrupt in which case we do not consider it a registered engine } }); diff --git a/scripts/o3de/o3de/manifest.py b/scripts/o3de/o3de/manifest.py index c06a4d12fc..51b6eaf226 100644 --- a/scripts/o3de/o3de/manifest.py +++ b/scripts/o3de/o3de/manifest.py @@ -608,7 +608,7 @@ def get_registered(engine_name: str = None, except json.JSONDecodeError as e: logger.warning(f'{engine_json} failed to load: {str(e)}') else: - this_engines_name = engine_json_data['engine_name'] + this_engines_name = engine_json_data.get('engine_name','') if this_engines_name == engine_name: return engine_path engines_path = json_data.get('engines_path', {}) From 1e591ab01974bec6fb997ac4f3e310c191499e12 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 21 Jan 2022 15:32:30 -0600 Subject: [PATCH 365/620] Removed const_cast now that we've switched from array_view to span Signed-off-by: Chris Galvan --- .../Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index e2268dbdd8..76260f506e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -385,7 +385,7 @@ namespace AZ { size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); - auto& outValue = const_cast(outValues[outValuesIndex++]); + auto& outValue = outValues[outValuesIndex++]; outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); } } @@ -412,7 +412,7 @@ namespace AZ { size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); - auto& outValue = const_cast(outValues[outValuesIndex++]); + auto& outValue = outValues[outValuesIndex++]; outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); } } @@ -439,7 +439,7 @@ namespace AZ { size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); - auto& outValue = const_cast(outValues[outValuesIndex++]); + auto& outValue = outValues[outValuesIndex++]; outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); } } From c13622c5afcf74426c9ca6d05cb866893cd436b9 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 21 Jan 2022 16:07:27 -0600 Subject: [PATCH 366/620] Handled special case logic for SNORM minimum value conversion Signed-off-by: Chris Galvan --- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 76260f506e..1ed900b2b8 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -146,8 +146,12 @@ namespace AZ case AZ::RHI::Format::R8_SNORM: { // Scale the value from AZ::s8 min/max to -1 to 1 + // We need to treat -128 and -127 the same, so that we get a symmetric + // range of -127 to 127 with complementary scaled values of -1 to 1 auto actualMem = reinterpret_cast(mem); - return ScaleValue(actualMem[index], std::numeric_limits::min(), std::numeric_limits::max(), -1, 1); + AZ::s8 signedMax = std::numeric_limits::max(); + AZ::s8 signedMin = aznumeric_cast(-signedMax); + return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1, 1); } case AZ::RHI::Format::D16_UNORM: case AZ::RHI::Format::R16_UNORM: @@ -157,8 +161,12 @@ namespace AZ case AZ::RHI::Format::R16_SNORM: { // Scale the value from AZ::s16 min/max to -1 to 1 + // We need to treat -32768 and -32767 the same, so that we get a symmetric + // range of -32767 to 32767 with complementary scaled values of -1 to 1 auto actualMem = reinterpret_cast(mem); - return ScaleValue(actualMem[index], std::numeric_limits::min(), std::numeric_limits::max(), -1, 1); + AZ::s16 signedMax = std::numeric_limits::max(); + AZ::s16 signedMin = aznumeric_cast(-signedMax); + return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1, 1); } case AZ::RHI::Format::R16_FLOAT: { From ea3cf928b03bf499bcb9543cfebc54060ac31194 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 21 Jan 2022 14:40:12 -0800 Subject: [PATCH 367/620] Small change looking for logs so py code doesnt need to wait as long Signed-off-by: Gene Walters --- .../Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py index 4548dff0b8..0d1067269c 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py @@ -58,7 +58,7 @@ def Multiplayer_SimpleNetworkLevelEntity(): Report.critical_result(TestSuccessFailTuples.find_network_player, player_id.IsValid()) # 4) Check the editor logs for network spawnable errors - ATTEMPTING_INVALID_NETSPAWN_WAIT_TIME_SECONDS = 1.0 # The editor will try to net-spawn its networked level entity before it's even a client. Make sure this doesn't happen. + ATTEMPTING_INVALID_NETSPAWN_WAIT_TIME_SECONDS = 0.0 # The editor will try to net-spawn its networked level entity before it's even a client. Make sure this didn't happen. helper.fail_if_log_line_found('NetworkEntityManager', "RequestNetSpawnableInstantiation: Requested spawnable Root.network.spawnable doesn't exist in the NetworkSpawnableLibrary. Please make sure it is a network spawnable", section_tracer.errors, ATTEMPTING_INVALID_NETSPAWN_WAIT_TIME_SECONDS) # 5) Ensure the script graph attached to the level entity is running on the server From 529c342ecac86479b08ce6b14cbb10ff46d2ba43 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Fri, 21 Jan 2022 14:53:11 -0800 Subject: [PATCH 368/620] fixing remove_components Signed-off-by: Scott Murray --- .../editor_python_test_tools/editor_entity_utils.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index c3398406ab..f19bf540a9 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -473,12 +473,11 @@ class EditorEntity: :param component_names: List of component names to remove :return: None """ - type_ids = EditorComponent.get_type_ids(component_names, EditorEntityType.GAME) - for type_id in type_ids: - remove_outcome = editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", self.id, [type_id]) - assert ( - remove_outcome.IsSuccess() - ), f"Failure: could not remove component from '{self.get_name()}'" + component_ids = [component.id for component in self.get_components_of_type(component_names)] + remove_success = editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", component_ids) + assert ( + remove_success + ), f"Failure: could not remove component from '{self.get_name()}'" def get_components_of_type(self, component_names: list) -> List[EditorComponent]: """ From 44cbc7659fd172d7e4f98ad9c8dda54f35ccc761 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Fri, 21 Jan 2022 15:00:36 -0800 Subject: [PATCH 369/620] removing unused line Signed-off-by: Scott Murray --- .../tests/hydra_AtomEditorComponents_EntityReferenceAdded.py | 1 - 1 file changed, 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py index 464f2a1892..7f15702199 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py @@ -193,7 +193,6 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): 1) count_after = entity_reference_component.get_container_count( AtomComponentProperties.entity_reference('EntityIdReferences')) - remove_count = (count_before == 3) and (count_after == 2) Report.result( Tests.container_remove, ((count_before == 3) and (count_after == 2) and From 7fa6a82f550a4ca687b1a7742948859ad472af4f Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Fri, 21 Jan 2022 15:03:57 -0800 Subject: [PATCH 370/620] Make ILyShine an AZ::Interface (#6923) * Move ILyShine instance out of legacy code Signed-off-by: abrmich * Remove last remaining reference of gEnv->pLyShine Signed-off-by: abrmich * Make m_lyShine a unique pointer Signed-off-by: abrmich --- Code/Legacy/CryCommon/ISystem.h | 1 - .../Editor/CommandCanvasPropertiesChange.cpp | 2 +- Gems/LyShine/Code/Editor/EditorWindow.cpp | 10 ++++---- .../Editor/LyShineEditorSystemComponent.cpp | 4 +-- .../Code/Editor/SpriteBorderEditor.cpp | 3 ++- Gems/LyShine/Code/Editor/ViewportWidget.cpp | 10 ++++---- Gems/LyShine/Code/Include/LyShine/IDraw2d.h | 8 +++--- Gems/LyShine/Code/Include/LyShine/ILyShine.h | 5 +++- Gems/LyShine/Code/Source/LyShine.cpp | 14 +++++------ Gems/LyShine/Code/Source/LyShine.h | 2 +- Gems/LyShine/Code/Source/LyShineDebug.cpp | 8 +++--- .../LyShine/Code/Source/LyShineLoadScreen.cpp | 25 ++++++++++--------- .../Code/Source/LyShineSystemComponent.cpp | 20 ++++++++------- .../Code/Source/LyShineSystemComponent.h | 2 +- .../Code/Source/Script/UiCanvasLuaBus.cpp | 4 +-- .../LyShine/Code/Source/UiCanvasComponent.cpp | 8 +++--- Gems/LyShine/Code/Source/UiImageComponent.cpp | 12 ++++----- .../Code/Source/UiImageSequenceComponent.cpp | 4 +-- .../Code/Source/UiInteractableState.cpp | 8 +++--- .../Source/UiParticleEmitterComponent.cpp | 6 ++--- .../World/UiCanvasAssetRefComponent.cpp | 9 ++++--- .../Code/Tests/UiTooltipComponentTest.cpp | 5 ---- .../Code/Source/LyShineExamplesCppExample.cpp | 4 +-- .../Code/Source/UiCustomImageComponent.cpp | 6 ++--- .../Code/Source/LyShineMessagePopup.cpp | 12 ++++----- 25 files changed, 97 insertions(+), 95 deletions(-) diff --git a/Code/Legacy/CryCommon/ISystem.h b/Code/Legacy/CryCommon/ISystem.h index 6fdc8b52fe..14b78fd155 100644 --- a/Code/Legacy/CryCommon/ISystem.h +++ b/Code/Legacy/CryCommon/ISystem.h @@ -614,7 +614,6 @@ struct SSystemGlobalEnvironment ISystem* pSystem = nullptr; ILog* pLog; IMovieSystem* pMovieSystem; - ILyShine* pLyShine; SharedEnvironmentInstance* pSharedEnvironment; #if defined(AZ_RESTRICTED_PLATFORM) diff --git a/Gems/LyShine/Code/Editor/CommandCanvasPropertiesChange.cpp b/Gems/LyShine/Code/Editor/CommandCanvasPropertiesChange.cpp index 30a716b142..e90252e54a 100644 --- a/Gems/LyShine/Code/Editor/CommandCanvasPropertiesChange.cpp +++ b/Gems/LyShine/Code/Editor/CommandCanvasPropertiesChange.cpp @@ -64,7 +64,7 @@ void CommandCanvasPropertiesChange::Recreate(bool isUndo) // Create a new canvas from the XML and release the old canvas, use the new entity context for // the new canvas const AZStd::string& xml = isUndo ? m_undoXml : m_redoXml; - gEnv->pLyShine->ReloadCanvasFromXml(xml, newEntityContext); + AZ::Interface::Get()->ReloadCanvasFromXml(xml, newEntityContext); // Tell the editor window to use the new entity context m_editorWindow->ReplaceEntityContext(newEntityContext); diff --git a/Gems/LyShine/Code/Editor/EditorWindow.cpp b/Gems/LyShine/Code/Editor/EditorWindow.cpp index 7b60474ed5..8f1d574ae5 100644 --- a/Gems/LyShine/Code/Editor/EditorWindow.cpp +++ b/Gems/LyShine/Code/Editor/EditorWindow.cpp @@ -315,7 +315,7 @@ EditorWindow::~EditorWindow() // unload the preview mode canvas if it exists (e.g. if we close the editor window while in preview mode) if (m_previewModeCanvasEntityId.IsValid()) { - gEnv->pLyShine->ReleaseCanvas(m_previewModeCanvasEntityId, false); + AZ::Interface::Get()->ReleaseCanvas(m_previewModeCanvasEntityId, false); } delete m_sliceLibraryTree; @@ -564,7 +564,7 @@ bool EditorWindow::OnPreWarning(const char* /*window*/, const char* /*fileName*/ void EditorWindow::DestroyCanvas(const UiCanvasMetadata& canvasMetadata) { - gEnv->pLyShine->ReleaseCanvas(canvasMetadata.m_canvasEntityId, true); + AZ::Interface::Get()->ReleaseCanvas(canvasMetadata.m_canvasEntityId, true); } bool EditorWindow::IsCanvasTabMetadataValidForTabIndex(int index) @@ -950,14 +950,14 @@ bool EditorWindow::LoadCanvas(const QString& canvasFilename, bool autoLoad, bool bool errorsOnLoad = false; if (canvasFilename.isEmpty()) { - canvasEntityId = gEnv->pLyShine->CreateCanvasInEditor(entityContext); + canvasEntityId = AZ::Interface::Get()->CreateCanvasInEditor(entityContext); } else { // Collect errors and warnings during the canvas load AZ::Debug::TraceMessageBus::Handler::BusConnect(); - canvasEntityId = gEnv->pLyShine->LoadCanvasInEditor(assetIdPathname.c_str(), sourceAssetPathName.c_str(), entityContext); + canvasEntityId = AZ::Interface::Get()->LoadCanvasInEditor(assetIdPathname.c_str(), sourceAssetPathName.c_str(), entityContext); // Stop receiving error and warning events AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); @@ -1603,7 +1603,7 @@ void EditorWindow::ToggleEditorMode() EBUS_EVENT_RESULT(entity, AZ::ComponentApplicationBus, FindEntity, m_previewModeCanvasEntityId); if (entity) { - gEnv->pLyShine->ReleaseCanvas(m_previewModeCanvasEntityId, false); + AZ::Interface::Get()->ReleaseCanvas(m_previewModeCanvasEntityId, false); } m_previewModeCanvasEntityId.SetInvalid(); } diff --git a/Gems/LyShine/Code/Editor/LyShineEditorSystemComponent.cpp b/Gems/LyShine/Code/Editor/LyShineEditorSystemComponent.cpp index 229101d4c0..3ec6980cfb 100644 --- a/Gems/LyShine/Code/Editor/LyShineEditorSystemComponent.cpp +++ b/Gems/LyShine/Code/Editor/LyShineEditorSystemComponent.cpp @@ -211,9 +211,9 @@ namespace LyShineEditor void LyShineEditorSystemComponent::OnStopPlayInEditor() { // reset UI system - if (gEnv->pLyShine) + if (AZ::Interface::Get()) { - gEnv->pLyShine->Reset(); + AZ::Interface::Get()->Reset(); } } } diff --git a/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp b/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp index 93d77bd174..b9ca4cd32c 100644 --- a/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp +++ b/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp @@ -7,6 +7,7 @@ */ #include "SpriteBorderEditorCommon.h" +#include #include #include #include @@ -35,7 +36,7 @@ SpriteBorderEditor::SpriteBorderEditor(const char* path, QWidget* parent) setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint); // Make sure the sprite can load and be displayed before continuing - m_sprite = gEnv->pLyShine->LoadSprite(m_spritePath.toLatin1().constData()); + m_sprite = AZ::Interface::Get()->LoadSprite(m_spritePath.toLatin1().constData()); QString fullPath = Path::GamePathToFullPath(m_sprite->GetTexturePathname().c_str()); const bool imageWontLoad = !m_sprite || QPixmap(fullPath).isNull(); if (imageWontLoad) diff --git a/Gems/LyShine/Code/Editor/ViewportWidget.cpp b/Gems/LyShine/Code/Editor/ViewportWidget.cpp index eb5625ac31..32231058bf 100644 --- a/Gems/LyShine/Code/Editor/ViewportWidget.cpp +++ b/Gems/LyShine/Code/Editor/ViewportWidget.cpp @@ -181,7 +181,7 @@ namespace EBUS_EVENT_ID_RESULT(handled, canvasEntityId, UiCanvasBus, HandleInputEvent, inputSnapshot, viewportPos, activeModifierKeys); // Execute events that have been queued during the input event handler - gEnv->pLyShine->ExecuteQueuedEvents(); + AZ::Interface::Get()->ExecuteQueuedEvents(); return handled; } @@ -192,7 +192,7 @@ namespace EBUS_EVENT_ID_RESULT(handled, canvasEntityId, UiCanvasBus, HandleTextEvent, textUTF8); // Execute events that have been queued during the input event handler - gEnv->pLyShine->ExecuteQueuedEvents(); + AZ::Interface::Get()->ExecuteQueuedEvents(); return handled; } @@ -265,7 +265,7 @@ ViewportWidget::~ViewportWidget() // Notify LyShine that this is no longer a valid UiRenderer. // Only one viewport/renderer is currently supported in the UI Editor - CLyShine* lyShine = static_cast(gEnv->pLyShine); + CLyShine* lyShine = static_cast(AZ::Interface::Get()); lyShine->SetUiRendererForEditor(nullptr); } @@ -276,7 +276,7 @@ void ViewportWidget::InitUiRenderer() // Notify LyShine that this is the UiRenderer to be used for rendering // UI canvases that are loaded in the UI Editor. // Only one viewport/renderer is currently supported in the UI Editor - CLyShine* lyShine = static_cast(gEnv->pLyShine); + CLyShine* lyShine = static_cast(AZ::Interface::Get()); lyShine->SetUiRendererForEditor(m_uiRenderer); m_draw2d = AZStd::make_shared(GetViewportContext()); @@ -1123,7 +1123,7 @@ void ViewportWidget::UpdatePreviewMode(float deltaTime) EBUS_EVENT_ID(canvasEntityId, UiEditorCanvasBus, UpdateCanvasInEditorViewport, deltaTime, true); // Execute events that have been queued during the canvas update - gEnv->pLyShine->ExecuteQueuedEvents(); + AZ::Interface::Get()->ExecuteQueuedEvents(); } } diff --git a/Gems/LyShine/Code/Include/LyShine/IDraw2d.h b/Gems/LyShine/Code/Include/LyShine/IDraw2d.h index 77dc5ac601..e880ca54a7 100644 --- a/Gems/LyShine/Code/Include/LyShine/IDraw2d.h +++ b/Gems/LyShine/Code/Include/LyShine/IDraw2d.h @@ -473,9 +473,9 @@ public: // static member functions //! Helper to get the default IDraw2d interface static IDraw2d* GetDefaultDraw2d() { - if (gEnv && gEnv->pLyShine) // [LYSHINE_ATOM_TODO][GHI #3569] Remove LyShine global interface pointer from legacy global environment + if (AZ::Interface::Get()) { - IDraw2d* draw2d = gEnv->pLyShine->GetDraw2d(); + IDraw2d* draw2d = AZ::Interface::Get()->GetDraw2d(); return reinterpret_cast(draw2d); } @@ -485,9 +485,9 @@ public: // static member functions //! Helper to load a texture static AZ::Data::Instance LoadTexture(const AZStd::string& pathName) { - if (gEnv && gEnv->pLyShine) // [LYSHINE_ATOM_TODO][GHI #3569] Remove LyShine global interface pointer from legacy global environment + if (AZ::Interface::Get()) { - return gEnv->pLyShine->LoadTexture(pathName); + return AZ::Interface::Get()->LoadTexture(pathName); } return nullptr; diff --git a/Gems/LyShine/Code/Include/LyShine/ILyShine.h b/Gems/LyShine/Code/Include/LyShine/ILyShine.h index 71ca6ec074..d05e105c87 100644 --- a/Gems/LyShine/Code/Include/LyShine/ILyShine.h +++ b/Gems/LyShine/Code/Include/LyShine/ILyShine.h @@ -38,7 +38,10 @@ namespace AZ::RPI class ILyShine { public: - virtual ~ILyShine(){} + AZ_RTTI(ILyShine, "{652ED9D7-0782-44E8-BCE7-65DD38C90907}"); + + ILyShine() = default; + virtual ~ILyShine() = default; //! Delete this object virtual void Release() = 0; diff --git a/Gems/LyShine/Code/Source/LyShine.cpp b/Gems/LyShine/Code/Source/LyShine.cpp index b362ed2106..df26a905ad 100644 --- a/Gems/LyShine/Code/Source/LyShine.cpp +++ b/Gems/LyShine/Code/Source/LyShine.cpp @@ -124,7 +124,7 @@ AllocateConstIntCVar(CLyShine, CV_ui_RunUnitTestsOnStartup); #endif //////////////////////////////////////////////////////////////////////////////////////////////////// -CLyShine::CLyShine([[maybe_unused]] ISystem* system) +CLyShine::CLyShine() : AzFramework::InputChannelEventListener(AzFramework::InputChannelEventListener::GetPriorityUI()) , AzFramework::InputTextEventListener(AzFramework::InputTextEventListener::GetPriorityUI()) , m_draw2d(new CDraw2d) @@ -386,8 +386,8 @@ void CLyShine::Update(float deltaTimeInSeconds) } // Tell the UI system the size of the viewport we are rendering to - this drives the - // canvas size for full screen UI canvases. It needs to be set before either pLyShine->Update or - // pLyShine->Render are called. It must match the viewport size that the input system is using. + // canvas size for full screen UI canvases. It needs to be set before either lyShine->Update or + // lyShine->Render are called. It must match the viewport size that the input system is using. SetViewportSize(m_uiRenderer->GetViewportSize()); // Guard against nested updates. This can occur if a canvas update below triggers the load screen component's @@ -708,10 +708,10 @@ void CLyShine::RenderUiCursor() //////////////////////////////////////////////////////////////////////////////////////////////////// void CLyShine::DebugReportDrawCalls(IConsoleCmdArgs* cmdArgs) { - if (gEnv->pLyShine) + if (AZ::Interface::Get()) { // We want to use an internal-only non-static function so downcast to CLyShine - CLyShine* pLyShine = static_cast(gEnv->pLyShine); + CLyShine* lyShine = static_cast(AZ::Interface::Get()); // There is an optional parameter which is a name to include in the output filename AZStd::string name; @@ -721,7 +721,7 @@ void CLyShine::DebugReportDrawCalls(IConsoleCmdArgs* cmdArgs) } // Use the canvas manager to access all the loaded canvases - pLyShine->m_uiCanvasManager->DebugReportDrawCalls(name); + lyShine->m_uiCanvasManager->DebugReportDrawCalls(name); } } #endif @@ -742,7 +742,7 @@ void CLyShine::RunUnitTests(IConsoleCmdArgs* cmdArgs) return; } - CLyShine* lyShine = static_cast(gEnv->pLyShine); + CLyShine* lyShine = static_cast(AZ::Interface::Get()); AZ_Assert(lyShine, "Attempting to run unit-tests prior to LyShine initialization!"); TextMarkup::UnitTest(cmdArgs); diff --git a/Gems/LyShine/Code/Source/LyShine.h b/Gems/LyShine/Code/Source/LyShine.h index eab52258c1..2fd0f80210 100644 --- a/Gems/LyShine/Code/Source/LyShine.h +++ b/Gems/LyShine/Code/Source/LyShine.h @@ -48,7 +48,7 @@ class CLyShine public: //! Create the LyShine object, the given system pointer is stored internally - CLyShine(ISystem* system); + CLyShine(); // ILyShine diff --git a/Gems/LyShine/Code/Source/LyShineDebug.cpp b/Gems/LyShine/Code/Source/LyShineDebug.cpp index 7e99652f45..3502699525 100644 --- a/Gems/LyShine/Code/Source/LyShineDebug.cpp +++ b/Gems/LyShine/Code/Source/LyShineDebug.cpp @@ -997,7 +997,7 @@ static AZ::Entity* CreateButton(const char* name, bool atRoot, AZ::EntityId pare EBUS_EVENT_ID(buttonId, UiInteractableStatesBus, SetStateAlpha, UiInteractableStatesInterface::StatePressed, buttonId, pressedColor.GetA()); AZStd::string pathname = "Textures/Basic/Button_Sliced_Normal.sprite"; - ISprite* sprite = gEnv->pLyShine->LoadSprite(pathname); + ISprite* sprite = AZ::Interface::Get()->LoadSprite(pathname); EBUS_EVENT_ID(buttonId, UiImageBus, SetSprite, sprite); EBUS_EVENT_ID(buttonId, UiImageBus, SetImageType, UiImageInterface::ImageType::Sliced); @@ -1096,7 +1096,7 @@ static AZ::Entity* CreateTextInput(const char* name, bool atRoot, AZ::EntityId p EBUS_EVENT_ID(textInputId, UiInteractableStatesBus, SetStateAlpha, UiInteractableStatesInterface::StatePressed, textInputId, pressedColor.GetA()); AZStd::string pathname = "Textures/Basic/Button_Sliced_Normal.sprite"; - ISprite* sprite = gEnv->pLyShine->LoadSprite(pathname); + ISprite* sprite = AZ::Interface::Get()->LoadSprite(pathname); EBUS_EVENT_ID(textInputId, UiImageBus, SetSprite, sprite); EBUS_EVENT_ID(textInputId, UiImageBus, SetImageType, UiImageInterface::ImageType::Sliced); @@ -1192,7 +1192,7 @@ static void DestroyTestCanvas() delete g_testActionListener2; g_testActionListener2 = nullptr; - gEnv->pLyShine->ReleaseCanvas(g_testCanvasId, false); + AZ::Interface::Get()->ReleaseCanvas(g_testCanvasId, false); g_testCanvasId.SetInvalid(); } } @@ -1216,7 +1216,7 @@ static void TestCanvasCreate ([[maybe_unused]] IConsoleCmdArgs* Cmd) DestroyTestCanvas(); // test creation of canvas and some simple elements - AZ::EntityId canvasEntityId = gEnv->pLyShine->CreateCanvas(); + AZ::EntityId canvasEntityId = AZ::Interface::Get()->CreateCanvas(); UiCanvasInterface* canvas = UiCanvasBus::FindFirstHandler(canvasEntityId); if (!canvas) { diff --git a/Gems/LyShine/Code/Source/LyShineLoadScreen.cpp b/Gems/LyShine/Code/Source/LyShineLoadScreen.cpp index c59cb5cb34..e0916d43b2 100644 --- a/Gems/LyShine/Code/Source/LyShineLoadScreen.cpp +++ b/Gems/LyShine/Code/Source/LyShineLoadScreen.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -63,7 +64,7 @@ namespace LyShine AZ_ErrorOnce(nullptr, false, "NotifyGameLoadStart needs to be removed/ported to use Atom"); return false; #if 0 - if (!gEnv || gEnv->pRenderer || !gEnv->pLyShine) + if (!gEnv || gEnv->pRenderer || !AZ::Interface::Get()) { return false; } @@ -103,7 +104,7 @@ namespace LyShine return false; //TODO: gEnv->pRenderer is always null, fix the logic below #if 0 - if (!gEnv || gEnv->pRenderer || !gEnv->pLyShine) + if (!gEnv || gEnv->pRenderer || !AZ::Interface::Get()) { return false; } @@ -140,22 +141,22 @@ namespace LyShine void LyShineLoadScreenComponent::UpdateAndRender([[maybe_unused]] float deltaTimeInSeconds) { AZ_Assert(m_isPlaying, "LyShineLoadScreenComponent should not be connected to LoadScreenUpdateNotificationBus while not playing"); - AZ_ErrorOnce(nullptr, m_isPlaying && gEnv && gEnv->pLyShine, "UpdateAndRender needs to be removed/ported to use Atom"); + AZ_ErrorOnce(nullptr, m_isPlaying && AZ::Interface::Get(), "UpdateAndRender needs to be removed/ported to use Atom"); //TODO: gEnv->pRenderer is always null, fix the logic below #if 0 - if (m_isPlaying && gEnv && gEnv->pLyShine && gEnv->pRenderer) + if (m_isPlaying && gEnv && AZ::Interface::Get() && gEnv->pRenderer) { AZ_Assert(GetCurrentThreadId() == gEnv->mMainThreadId, "UpdateAndRender should only be called from the main thread"); // update the animation system - gEnv->pLyShine->Update(deltaTimeInSeconds); + AZ::Interface::Get()->Update(deltaTimeInSeconds); // Render. gEnv->pRenderer->SetViewport(0, 0, gEnv->pRenderer->GetOverlayWidth(), gEnv->pRenderer->GetOverlayHeight()); gEnv->pRenderer->BeginFrame(); - gEnv->pLyShine->Render(); + AZ::Interface::Get()->Render(); gEnv->pRenderer->EndFrame(); } #endif @@ -177,7 +178,7 @@ namespace LyShine m_isPlaying = false; - if (gEnv && gEnv->pLyShine) + if (AZ::Interface::Get()) { AZ::Entity* canvasEntity = nullptr; @@ -187,8 +188,8 @@ namespace LyShine EBUS_EVENT_RESULT(canvasEntity, AZ::ComponentApplicationBus, FindEntity, m_gameCanvasEntityId); if (canvasEntity) { - gEnv->pLyShine->ReleaseCanvas(m_gameCanvasEntityId, false); - gEnv->pLyShine->OnLoadScreenUnloaded(); + AZ::Interface::Get()->ReleaseCanvas(m_gameCanvasEntityId, false); + AZ::Interface::Get()->OnLoadScreenUnloaded(); } } @@ -198,8 +199,8 @@ namespace LyShine EBUS_EVENT_RESULT(canvasEntity, AZ::ComponentApplicationBus, FindEntity, m_levelCanvasEntityId); if (canvasEntity) { - gEnv->pLyShine->ReleaseCanvas(m_levelCanvasEntityId, false); - gEnv->pLyShine->OnLoadScreenUnloaded(); + AZ::Interface::Get()->ReleaseCanvas(m_levelCanvasEntityId, false); + AZ::Interface::Get()->OnLoadScreenUnloaded(); } } } @@ -234,7 +235,7 @@ namespace LyShine return AZ::EntityId(); } - AZ::EntityId canvasId = gEnv->pLyShine->LoadCanvas(path); + AZ::EntityId canvasId = AZ::Interface::Get()->LoadCanvas(path); AZ_Warning("LoadScreenComponent", canvasId.IsValid(), "Can't load canvas: %s", path.c_str()); if (!canvasId.IsValid()) { diff --git a/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp b/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp index 787797e462..7253935c2d 100644 --- a/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp +++ b/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp @@ -384,16 +384,16 @@ namespace LyShine // When module is linked statically, we'll share the application's gEnv pointer. gEnv = system.GetGlobalEnvironment(); #endif - m_pLyShine = new CLyShine(gEnv->pSystem); - gEnv->pLyShine = m_pLyShine; + m_lyShine = AZStd::make_unique(); + AZ::Interface::Register(m_lyShine.get()); system.GetILevelSystem()->AddListener(this); BroadcastCursorImagePathname(); - if (gEnv->pLyShine) + if (AZ::Interface::Get()) { - gEnv->pLyShine->PostInit(); + AZ::Interface::Get()->PostInit(); } } @@ -402,18 +402,20 @@ namespace LyShine { system.GetILevelSystem()->RemoveListener(this); - gEnv->pLyShine = nullptr; - delete m_pLyShine; - m_pLyShine = nullptr; + if (m_lyShine) + { + AZ::Interface::Unregister(m_lyShine.get()); + m_lyShine.reset(); + } } //////////////////////////////////////////////////////////////////////// void LyShineSystemComponent::OnUnloadComplete([[maybe_unused]] const char* levelName) { // Perform level unload procedures for the LyShine UI system - if (gEnv && gEnv->pLyShine) + if (AZ::Interface::Get()) { - gEnv->pLyShine->OnLevelUnload(); + AZ::Interface::Get()->OnLevelUnload(); } } diff --git a/Gems/LyShine/Code/Source/LyShineSystemComponent.h b/Gems/LyShine/Code/Source/LyShineSystemComponent.h index d2cdcf6761..001ddd6fab 100644 --- a/Gems/LyShine/Code/Source/LyShineSystemComponent.h +++ b/Gems/LyShine/Code/Source/LyShineSystemComponent.h @@ -107,7 +107,7 @@ namespace LyShine protected: // data - CLyShine* m_pLyShine = nullptr; + AZStd::unique_ptr m_lyShine; AzFramework::SimpleAssetReference m_cursorImagePathname; diff --git a/Gems/LyShine/Code/Source/Script/UiCanvasLuaBus.cpp b/Gems/LyShine/Code/Source/Script/UiCanvasLuaBus.cpp index 4b0ff56241..679f13b333 100644 --- a/Gems/LyShine/Code/Source/Script/UiCanvasLuaBus.cpp +++ b/Gems/LyShine/Code/Source/Script/UiCanvasLuaBus.cpp @@ -114,7 +114,7 @@ AZ::EntityId UiCanvasLuaProxy::LoadCanvas(const char* canvasFilename) CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, "UiCanvasLuaProxy:LoadCanvas is deprecated. Please use UiCanvasManagerBus:LoadCanvas instead\n"); - return gEnv->pLyShine->LoadCanvas(canvasFilename); + return AZ::Interface::Get()->LoadCanvas(canvasFilename); } void UiCanvasLuaProxy::UnloadCanvas(AZ::EntityId canvasEntityId) @@ -130,7 +130,7 @@ void UiCanvasLuaProxy::UnloadCanvas(AZ::EntityId canvasEntityId) UiCanvasComponent* canvasComponent = canvasEntity->FindComponent(); if (canvasComponent) { - gEnv->pLyShine->ReleaseCanvas(canvasEntityId, false); + AZ::Interface::Get()->ReleaseCanvas(canvasEntityId, false); } else { diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp index ea6e3681a3..0a7161ecb3 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp @@ -254,9 +254,9 @@ namespace UiRenderer* GetUiRendererForGame() { - if (gEnv && gEnv->pLyShine) + if (AZ::Interface::Get()) { - CLyShine* lyShine = static_cast(gEnv->pLyShine); + CLyShine* lyShine = static_cast(AZ::Interface::Get()); return lyShine->GetUiRenderer(); } return nullptr; @@ -264,9 +264,9 @@ namespace UiRenderer* GetUiRendererForEditor() { - if (gEnv && gEnv->pLyShine) + if (AZ::Interface::Get()) { - CLyShine* lyShine = static_cast(gEnv->pLyShine); + CLyShine* lyShine = static_cast(AZ::Interface::Get()); return lyShine->GetUiRendererForEditor(); } return nullptr; diff --git a/Gems/LyShine/Code/Source/UiImageComponent.cpp b/Gems/LyShine/Code/Source/UiImageComponent.cpp index a8b4210d6b..d412695ac3 100644 --- a/Gems/LyShine/Code/Source/UiImageComponent.cpp +++ b/Gems/LyShine/Code/Source/UiImageComponent.cpp @@ -588,7 +588,7 @@ void UiImageComponent::SetSpritePathname(AZStd::string spritePath) //////////////////////////////////////////////////////////////////////////////////////////////////// bool UiImageComponent::SetSpritePathnameIfExists(AZStd::string spritePath) { - if (gEnv->pLyShine->DoesSpriteTextureAssetExist(spritePath)) + if (AZ::Interface::Get()->DoesSpriteTextureAssetExist(spritePath)) { SetSpritePathname(spritePath); return true; @@ -1179,7 +1179,7 @@ void UiImageComponent::Init() // If this is called from RC.exe for example these pointers will not be set. In that case // we only need to be able to load, init and save the component. It will never be // activated. - if (!(gEnv && gEnv->pLyShine)) + if (!AZ::Interface::Get()) { return; } @@ -1192,14 +1192,14 @@ void UiImageComponent::Init() { if (!m_spritePathname.GetAssetPath().empty()) { - m_sprite = gEnv->pLyShine->LoadSprite(m_spritePathname.GetAssetPath().c_str()); + m_sprite = AZ::Interface::Get()->LoadSprite(m_spritePathname.GetAssetPath().c_str()); } } else if (m_spriteType == UiImageInterface::SpriteType::RenderTarget) { if (!m_renderTargetName.empty()) { - m_sprite = gEnv->pLyShine->CreateSprite(m_renderTargetName.c_str()); + m_sprite = AZ::Interface::Get()->CreateSprite(m_renderTargetName.c_str()); } } else @@ -2527,7 +2527,7 @@ void UiImageComponent::OnSpritePathnameChange() if (!m_spritePathname.GetAssetPath().empty()) { // Load the new texture. - newSprite = gEnv->pLyShine->LoadSprite(m_spritePathname.GetAssetPath().c_str()); + newSprite = AZ::Interface::Get()->LoadSprite(m_spritePathname.GetAssetPath().c_str()); } // if listening for notifications from a current sprite then disconnect @@ -2557,7 +2557,7 @@ void UiImageComponent::OnSpriteRenderTargetNameChange() if (!m_renderTargetName.empty()) { - newSprite = gEnv->pLyShine->CreateSprite(m_renderTargetName.c_str()); + newSprite = AZ::Interface::Get()->CreateSprite(m_renderTargetName.c_str()); } SAFE_RELEASE(m_sprite); diff --git a/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp b/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp index 3559dc6306..3981777f2d 100644 --- a/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp +++ b/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp @@ -52,7 +52,7 @@ namespace spriteList.reserve(imageList.size()); for (auto& textureAssetRef : imageList) { - ISprite* sprite = gEnv->pLyShine->LoadSprite(textureAssetRef.GetAssetPath().c_str()); + ISprite* sprite = AZ::Interface::Get()->LoadSprite(textureAssetRef.GetAssetPath().c_str()); if (sprite) { spriteList.push_back(sprite); @@ -383,7 +383,7 @@ void UiImageSequenceComponent::Init() // If this is called from RC.exe for example these pointers will not be set. In that case // we only need to be able to load, init and save the component. It will never be // activated. - if (!(gEnv && gEnv->pLyShine)) + if (!AZ::Interface::Get()) { return; } diff --git a/Gems/LyShine/Code/Source/UiInteractableState.cpp b/Gems/LyShine/Code/Source/UiInteractableState.cpp index d2c09201c6..18bacb3a9f 100644 --- a/Gems/LyShine/Code/Source/UiInteractableState.cpp +++ b/Gems/LyShine/Code/Source/UiInteractableState.cpp @@ -274,7 +274,7 @@ UiInteractableStateSprite::UiInteractableStateSprite(AZ::EntityId target, const if (!m_spritePathname.GetAssetPath().empty()) { - m_sprite = gEnv->pLyShine->LoadSprite(m_spritePathname.GetAssetPath().c_str()); + m_sprite = AZ::Interface::Get()->LoadSprite(m_spritePathname.GetAssetPath().c_str()); } } @@ -297,7 +297,7 @@ void UiInteractableStateSprite::Init(AZ::EntityId interactableEntityId) // If this is called from RC.exe for example these pointers will not be set. In that case // we only need to be able to load, init and save the component. It will never be // activated. - if (!(gEnv && gEnv->pLyShine)) + if (!AZ::Interface::Get()) { return; } @@ -306,7 +306,7 @@ void UiInteractableStateSprite::Init(AZ::EntityId interactableEntityId) // are not loaded then load them if (!m_sprite && !m_spritePathname.GetAssetPath().empty()) { - m_sprite = gEnv->pLyShine->LoadSprite(m_spritePathname.GetAssetPath().c_str()); + m_sprite = AZ::Interface::Get()->LoadSprite(m_spritePathname.GetAssetPath().c_str()); } if (!m_sprite) @@ -366,7 +366,7 @@ void UiInteractableStateSprite::OnSpritePathnameChange() if (!m_spritePathname.GetAssetPath().empty()) { // Load the new texture. - newSprite = gEnv->pLyShine->LoadSprite(m_spritePathname.GetAssetPath().c_str()); + newSprite = AZ::Interface::Get()->LoadSprite(m_spritePathname.GetAssetPath().c_str()); } SAFE_RELEASE(m_sprite); diff --git a/Gems/LyShine/Code/Source/UiParticleEmitterComponent.cpp b/Gems/LyShine/Code/Source/UiParticleEmitterComponent.cpp index b999480940..b9f986c14a 100644 --- a/Gems/LyShine/Code/Source/UiParticleEmitterComponent.cpp +++ b/Gems/LyShine/Code/Source/UiParticleEmitterComponent.cpp @@ -1429,14 +1429,14 @@ void UiParticleEmitterComponent::Init() // If this is called from RC.exe for example these pointers will not be set. In that case // we only need to be able to load, init and save the component. It will never be // activated. - if (!(gEnv && gEnv->pLyShine)) + if (!AZ::Interface::Get()) { return; } if (!m_sprite && !m_spritePathname.GetAssetPath().empty()) { - m_sprite = gEnv->pLyShine->LoadSprite(m_spritePathname.GetAssetPath().c_str()); + m_sprite = AZ::Interface::Get()->LoadSprite(m_spritePathname.GetAssetPath().c_str()); } m_currentAspectRatio = m_particleSize.GetX() / m_particleSize.GetY(); @@ -1927,7 +1927,7 @@ void UiParticleEmitterComponent::OnSpritePathnameChange() if (!m_spritePathname.GetAssetPath().empty()) { // Load the new texture. - newSprite = gEnv->pLyShine->LoadSprite(m_spritePathname.GetAssetPath().c_str()); + newSprite = AZ::Interface::Get()->LoadSprite(m_spritePathname.GetAssetPath().c_str()); } SAFE_RELEASE(m_sprite); diff --git a/Gems/LyShine/Code/Source/World/UiCanvasAssetRefComponent.cpp b/Gems/LyShine/Code/Source/World/UiCanvasAssetRefComponent.cpp index 933cca424a..e186e1158d 100644 --- a/Gems/LyShine/Code/Source/World/UiCanvasAssetRefComponent.cpp +++ b/Gems/LyShine/Code/Source/World/UiCanvasAssetRefComponent.cpp @@ -8,6 +8,7 @@ #include "UiCanvasAssetRefComponent.h" #include #include +#include #include #include #include @@ -106,11 +107,11 @@ AZ::EntityId UiCanvasAssetRefComponent::LoadCanvas() // Check if we already have a referenced UI canvas, if so release it if (m_canvasEntityId.IsValid()) { - gEnv->pLyShine->ReleaseCanvasDeferred(m_canvasEntityId); + AZ::Interface::Get()->ReleaseCanvasDeferred(m_canvasEntityId); m_canvasEntityId.SetInvalid(); } - m_canvasEntityId = gEnv->pLyShine->LoadCanvas(canvasPath.c_str()); + m_canvasEntityId = AZ::Interface::Get()->LoadCanvas(canvasPath.c_str()); EBUS_EVENT_ID(GetEntityId(), UiCanvasAssetRefNotificationBus, OnCanvasLoadedIntoEntity, m_canvasEntityId); EBUS_EVENT_ID(GetEntityId(), UiCanvasRefNotificationBus, OnCanvasRefChanged, GetEntityId(), m_canvasEntityId); @@ -124,7 +125,7 @@ void UiCanvasAssetRefComponent::UnloadCanvas() { if (m_canvasEntityId.IsValid()) { - gEnv->pLyShine->ReleaseCanvasDeferred(m_canvasEntityId); + AZ::Interface::Get()->ReleaseCanvasDeferred(m_canvasEntityId); m_canvasEntityId.SetInvalid(); EBUS_EVENT_ID(GetEntityId(), UiCanvasRefNotificationBus, OnCanvasRefChanged, GetEntityId(), m_canvasEntityId); @@ -243,7 +244,7 @@ void UiCanvasAssetRefComponent::Deactivate() { if (m_canvasEntityId.IsValid()) { - gEnv->pLyShine->ReleaseCanvasDeferred(m_canvasEntityId); + AZ::Interface::Get()->ReleaseCanvasDeferred(m_canvasEntityId); m_canvasEntityId.SetInvalid(); } diff --git a/Gems/LyShine/Code/Tests/UiTooltipComponentTest.cpp b/Gems/LyShine/Code/Tests/UiTooltipComponentTest.cpp index 8a3d9f2af6..652cec3c0f 100644 --- a/Gems/LyShine/Code/Tests/UiTooltipComponentTest.cpp +++ b/Gems/LyShine/Code/Tests/UiTooltipComponentTest.cpp @@ -144,7 +144,6 @@ namespace UnitTest SSystemGlobalEnvironment env; SSystemGlobalEnvironment* prevEnv = gEnv; gEnv = &env; - gEnv->pLyShine = nullptr; auto [uiCanvasComponent, uiTooltipDisplayComponent, uiTooltipComponent] = CreateUiCanvasWithTooltip(); uiTooltipDisplayComponent->SetTriggerMode(UiTooltipDisplayInterface::TriggerMode::OnHover); @@ -170,7 +169,6 @@ namespace UnitTest SSystemGlobalEnvironment env; SSystemGlobalEnvironment* prevEnv = gEnv; gEnv = &env; - gEnv->pLyShine = nullptr; auto [uiCanvasComponent, uiTooltipDisplayComponent, uiTooltipComponent] = CreateUiCanvasWithTooltip(); uiTooltipDisplayComponent->SetTriggerMode(UiTooltipDisplayInterface::TriggerMode::OnHover); @@ -194,7 +192,6 @@ namespace UnitTest SSystemGlobalEnvironment env; SSystemGlobalEnvironment* prevEnv = gEnv; gEnv = &env; - gEnv->pLyShine = nullptr; auto [uiCanvasComponent, uiTooltipDisplayComponent, uiTooltipComponent] = CreateUiCanvasWithTooltip(); uiTooltipDisplayComponent->SetTriggerMode(UiTooltipDisplayInterface::TriggerMode::OnPress); @@ -218,7 +215,6 @@ namespace UnitTest SSystemGlobalEnvironment env; SSystemGlobalEnvironment* prevEnv = gEnv; gEnv = &env; - gEnv->pLyShine = nullptr; auto [uiCanvasComponent, uiTooltipDisplayComponent, uiTooltipComponent] = CreateUiCanvasWithTooltip(); uiTooltipDisplayComponent->SetTriggerMode(UiTooltipDisplayInterface::TriggerMode::OnPress); @@ -242,7 +238,6 @@ namespace UnitTest SSystemGlobalEnvironment env; SSystemGlobalEnvironment* prevEnv = gEnv; gEnv = &env; - gEnv->pLyShine = nullptr; auto [uiCanvasComponent, uiTooltipDisplayComponent, uiTooltipComponent] = CreateUiCanvasWithTooltip(); uiTooltipDisplayComponent->SetTriggerMode(UiTooltipDisplayInterface::TriggerMode::OnClick); diff --git a/Gems/LyShineExamples/Code/Source/LyShineExamplesCppExample.cpp b/Gems/LyShineExamples/Code/Source/LyShineExamplesCppExample.cpp index f2da79fa99..7619764fbc 100644 --- a/Gems/LyShineExamples/Code/Source/LyShineExamplesCppExample.cpp +++ b/Gems/LyShineExamples/Code/Source/LyShineExamplesCppExample.cpp @@ -47,7 +47,7 @@ namespace LyShineExamples // Remove the existing example canvas if it exists DestroyCanvas(); - AZ::EntityId canvasEntityId = gEnv->pLyShine->CreateCanvas(); + AZ::EntityId canvasEntityId = AZ::Interface::Get()->CreateCanvas(); if (!canvasEntityId.IsValid()) { return; @@ -90,7 +90,7 @@ namespace LyShineExamples m_healthBar.SetInvalid(); - gEnv->pLyShine->ReleaseCanvas(m_canvasId, false); + AZ::Interface::Get()->ReleaseCanvas(m_canvasId, false); m_canvasId.SetInvalid(); } } diff --git a/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp b/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp index e8b0e4370a..c228176b4f 100644 --- a/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp +++ b/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp @@ -284,7 +284,7 @@ namespace LyShineExamples // If this is called from RC.exe for example these pointers will not be set. In that case // we only need to be able to load, init and save the component. It will never be // activated. - if (!(gEnv && gEnv->pLyShine)) + if (!AZ::Interface::Get()) { return; } @@ -294,7 +294,7 @@ namespace LyShineExamples { if (!m_spritePathname.GetAssetPath().empty()) { - m_sprite = gEnv->pLyShine->LoadSprite(m_spritePathname.GetAssetPath().c_str()); + m_sprite = AZ::Interface::Get()->LoadSprite(m_spritePathname.GetAssetPath().c_str()); } } @@ -399,7 +399,7 @@ namespace LyShineExamples if (!m_spritePathname.GetAssetPath().empty()) { // Load the new texture. - newSprite = gEnv->pLyShine->LoadSprite(m_spritePathname.GetAssetPath().c_str()); + newSprite = AZ::Interface::Get()->LoadSprite(m_spritePathname.GetAssetPath().c_str()); } SAFE_RELEASE(m_sprite); diff --git a/Gems/MessagePopup/Code/Source/LyShineMessagePopup.cpp b/Gems/MessagePopup/Code/Source/LyShineMessagePopup.cpp index 40fed3448b..de54bef4eb 100644 --- a/Gems/MessagePopup/Code/Source/LyShineMessagePopup.cpp +++ b/Gems/MessagePopup/Code/Source/LyShineMessagePopup.cpp @@ -127,21 +127,21 @@ namespace MessagePopup switch (_buttons) { case EPopupButtons::EPopupButtons_NoButtons: - canvasEntityId = gEnv->pLyShine->LoadCanvas("@products@/ui/canvases/defaultmessagepopup.uicanvas"); + canvasEntityId = AZ::Interface::Get()->LoadCanvas("@products@/ui/canvases/defaultmessagepopup.uicanvas"); break; case EPopupButtons::EPopupButtons_Confirm: - canvasEntityId = gEnv->pLyShine->LoadCanvas("@products@/ui/canvases/defaultmessagepopup_confirm.uicanvas"); + canvasEntityId = AZ::Interface::Get()->LoadCanvas("@products@/ui/canvases/defaultmessagepopup_confirm.uicanvas"); isNavigationSupported = true; break; case EPopupButtons::EPopupButtons_YesNo: - canvasEntityId = gEnv->pLyShine->LoadCanvas("@products@/ui/canvases/defaultmessagepopup_yesno.uicanvas"); + canvasEntityId = AZ::Interface::Get()->LoadCanvas("@products@/ui/canvases/defaultmessagepopup_yesno.uicanvas"); isNavigationSupported = true; break; } } else if (_kind == EPopupKind_Toaster) { - canvasEntityId = gEnv->pLyShine->LoadCanvas("@products@/ui/canvases/toaster.uicanvas"); + canvasEntityId = AZ::Interface::Get()->LoadCanvas("@products@/ui/canvases/toaster.uicanvas"); } if (canvasEntityId.IsValid()) @@ -183,7 +183,7 @@ namespace MessagePopup { // get the canvas ID in the clientdata LyShine::CanvasId canvasId = *((LyShine::CanvasId*)&_popupInfo.m_clientData); - AZ::EntityId canvasEntityId = gEnv->pLyShine->FindCanvasById(canvasId); + AZ::EntityId canvasEntityId = AZ::Interface::Get()->FindCanvasById(canvasId); if (canvasEntityId.IsValid()) { // Hide the cursor if it was shown in LyShineMessagePopup::OnShowPopup @@ -197,7 +197,7 @@ namespace MessagePopup // Disable the popup EBUS_EVENT_ID(canvasEntityId, UiCanvasBus, SetEnabled, false); - gEnv->pLyShine->ReleaseCanvas(canvasEntityId, false); + AZ::Interface::Get()->ReleaseCanvas(canvasEntityId, false); UiCanvasNotificationBus::MultiHandler::BusDisconnect(canvasEntityId); m_activePopupIdsByCanvasId.erase(canvasEntityId); From a145d3c82fa3c5a71dc0545708518d7bd7769d53 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 21 Jan 2022 15:07:27 -0800 Subject: [PATCH 371/620] Issues/install missing assets (#7081) * Fixes for missing assets in the install folder Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * delayed expansion to try to fix project_engineinstall_profile Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Improvements to build scripts to solve the project build from the install folder Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- CMakeLists.txt | 4 ++++ cmake/Platform/Common/Install_common.cmake | 8 +++++--- .../build/Platform/Windows/build_windows.cmd | 11 ++++++----- .../build/Platform/Windows/env_windows.cmd | 19 ++++++++++++------- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c81581fe0f..efcc866195 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,6 +93,10 @@ endfunction() # Add the projects first so the Launcher can find them include(cmake/Projects.cmake) +if(LY_EXTERNAL_SUBDIRS) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${LY_EXTERNAL_SUBDIRS}) +endif() + if(NOT INSTALLED_ENGINE) # Add external subdirectories listed in the engine.json. LY_EXTERNAL_SUBDIRS is a cache variable so the user can add extra # external subdirectories. This should go before adding the rest of the targets so the targets are availbe to the launcher. diff --git a/cmake/Platform/Common/Install_common.cmake b/cmake/Platform/Common/Install_common.cmake index 46130f1345..e42664c107 100644 --- a/cmake/Platform/Common/Install_common.cmake +++ b/cmake/Platform/Common/Install_common.cmake @@ -445,9 +445,10 @@ function(ly_setup_cmake_install) ) endforeach() - # Transform the LY_EXTERNAL_SUBDIRS list into a json array + # Transform the LY_EXTERNAL_SUBDIRS global property list into a json array set(indent " ") - foreach(external_subdir ${LY_EXTERNAL_SUBDIRS}) + get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + foreach(external_subdir ${external_subdirs}) cmake_path(RELATIVE_PATH external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE engine_rel_external_subdir) list(APPEND relative_external_subdirs "\"${engine_rel_external_subdir}\"") endforeach() @@ -639,7 +640,8 @@ function(ly_setup_assets) # the install layout from the root directory. Such as /Cache. # This is also done to avoid globbing thousands of files in subdirectories that shouldn't # be processed. - foreach(gem_candidate_dir IN LISTS LY_EXTERNAL_SUBDIRS LY_PROJECTS) + get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + foreach(gem_candidate_dir IN LISTS external_subdirs LY_PROJECTS) file(REAL_PATH ${gem_candidate_dir} gem_candidate_dir BASE_DIRECTORY ${LY_ROOT_FOLDER}) # Don't recurse immediately in order to exclude transient source artifacts file(GLOB diff --git a/scripts/build/Platform/Windows/build_windows.cmd b/scripts/build/Platform/Windows/build_windows.cmd index 798550370f..c77c262692 100644 --- a/scripts/build/Platform/Windows/build_windows.cmd +++ b/scripts/build/Platform/Windows/build_windows.cmd @@ -9,6 +9,7 @@ REM SETLOCAL EnableDelayedExpansion CALL "%~dp0env_windows.cmd" +IF NOT %ERRORLEVEL%==0 EXIT /b 1 IF NOT EXIST "%OUTPUT_DIRECTORY%" ( MKDIR %OUTPUT_DIRECTORY%. @@ -21,7 +22,7 @@ ECHO [ci_build] cmake --version cmake --version IF ERRORLEVEL 1 ( ECHO [ci_build] CMAKE not found! - exit /b 1 + EXIT /b 1 ) REM Compute half the amount of processors so some jobs can run @@ -47,14 +48,14 @@ IF NOT EXIST CMakeCache.txt ( ) ) IF DEFINED RUN_CONFIGURE ( - ECHO [ci_build] %CONFIGURE_CMD% - %CONFIGURE_CMD% + call ECHO [ci_build] %CONFIGURE_CMD% + call %CONFIGURE_CMD% IF NOT !ERRORLEVEL!==0 GOTO :error ECHO !CONFIGURE_CMD!> %LAST_CONFIGURE_CMD_FILE% ) -ECHO [ci_build] cmake --build . --target %CMAKE_TARGET% --config %CONFIGURATION% %CMAKE_BUILD_ARGS% -- %CMAKE_NATIVE_BUILD_ARGS% -cmake --build . --target %CMAKE_TARGET% --config %CONFIGURATION% %CMAKE_BUILD_ARGS% -- %CMAKE_NATIVE_BUILD_ARGS% +call ECHO [ci_build] cmake --build . --target %CMAKE_TARGET% --config %CONFIGURATION% %CMAKE_BUILD_ARGS% -- %CMAKE_NATIVE_BUILD_ARGS% +call cmake --build . --target %CMAKE_TARGET% --config %CONFIGURATION% %CMAKE_BUILD_ARGS% -- %CMAKE_NATIVE_BUILD_ARGS% IF NOT %ERRORLEVEL%==0 GOTO :error POPD diff --git a/scripts/build/Platform/Windows/env_windows.cmd b/scripts/build/Platform/Windows/env_windows.cmd index 78b5ca6c1a..c6f46ef575 100644 --- a/scripts/build/Platform/Windows/env_windows.cmd +++ b/scripts/build/Platform/Windows/env_windows.cmd @@ -13,17 +13,21 @@ SETLOCAL EnableExtensions EnableDelayedExpansion where /Q cmake IF NOT %ERRORLEVEL%==0 ( ECHO [ci_build] CMake not found - GOTO :error -) - -IF NOT "%COMMAND_CWD%"=="" ( - ECHO [ci_build] Changing CWD to %COMMAND_CWD% - CD %COMMAND_CWD% + GOTO :errorlocal ) REM Ending the local environment to be able to propagate the TMP/TEMP variables to the calling script ENDLOCAL +IF NOT "%COMMAND_CWD%"=="" ( + call ECHO [ci_build] Changing CWD to %COMMAND_CWD% + call CD %COMMAND_CWD% + IF ERRORLEVEL 1 ( + ECHO [ci_build] Failed to change directory to %COMMAND_CWD% + GOTO :error + ) +) + REM Jenkins does not defined TMP IF "%TMP%"=="" ( IF "%WORKSPACE%"=="" ( @@ -41,6 +45,7 @@ IF "%TMP%"=="" ( EXIT /b 0 -:error +:errorlocal ENDLOCAL +:error EXIT /b 1 \ No newline at end of file From 29b3cf4fee581110e1cc9453fd28f0bec9a9f908 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 21 Jan 2022 15:29:42 -0800 Subject: [PATCH 372/620] Fixes to the unused script Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../cleanup/{unusued_compilation.py => unused_compilation.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename scripts/cleanup/{unusued_compilation.py => unused_compilation.py} (99%) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unused_compilation.py similarity index 99% rename from scripts/cleanup/unusued_compilation.py rename to scripts/cleanup/unused_compilation.py index 1bd69d496f..8aeadff309 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unused_compilation.py @@ -52,7 +52,7 @@ def create_filelist(path): for input_file in path: if os.path.isdir(input_file): for dp, dn, filenames in os.walk(input_file): - if 'build\\windows_vs2019' in dp: + if 'build\\windows' in dp: continue for f in filenames: extension = os.path.splitext(f)[1] From 6c31f45b9ea8a59e02e810bd120ccfad7a4dba2c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 21 Jan 2022 15:30:36 -0800 Subject: [PATCH 373/620] Fixes the validation script Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h | 0 .../Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp diff --git a/Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h b/Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp deleted file mode 100644 index e69de29bb2..0000000000 From 109cab9b8aa34588ceb19afb322f681c94c2ed25 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 21 Jan 2022 15:30:56 -0800 Subject: [PATCH 374/620] Fixes Linux generation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzToolsFramework/aztoolsframework_linux_files.cmake | 1 - .../AzToolsFramework/aztoolsframework_mac_files.cmake | 1 - 2 files changed, 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake index afd487daf7..af4bfcb8f4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake @@ -29,5 +29,4 @@ set(FILES UI/UICore/SaveChangesDialog.hxx UI/UICore/SaveChangesDialog.cpp UI/UICore/SaveChangesDialog.ui - ToolsFileUtils/ToolsFileUtils_generic.cpp ) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake index afd487daf7..af4bfcb8f4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake @@ -29,5 +29,4 @@ set(FILES UI/UICore/SaveChangesDialog.hxx UI/UICore/SaveChangesDialog.cpp UI/UICore/SaveChangesDialog.ui - ToolsFileUtils/ToolsFileUtils_generic.cpp ) From fd4014b2789689ef516c7af7ab01e0c56409e89b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 21 Jan 2022 15:31:17 -0800 Subject: [PATCH 375/620] PR comments Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/CryEditDoc.cpp | 4 ++-- Code/Editor/Util/MemoryBlock.cpp | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp index bcd3efd770..c7d719184d 100644 --- a/Code/Editor/CryEditDoc.cpp +++ b/Code/Editor/CryEditDoc.cpp @@ -2129,12 +2129,12 @@ void CCryEditDoc::ReleaseXmlArchiveArray(TDocMultiArchive& arrXmlAr) ////////////////////////////////////////////////////////////////////////// // AzToolsFramework::EditorEntityContextNotificationBus interface implementation -void CCryEditDoc::OnSliceInstantiated([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] AZ::SliceComponent::SliceInstanceAddress& sliceAddress, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& /*ticket*/) +void CCryEditDoc::OnSliceInstantiated([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] AZ::SliceComponent::SliceInstanceAddress& sliceAddress, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& ticket) { GetIEditor()->ResumeUndo(); } -void CCryEditDoc::OnSliceInstantiationFailed([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& /*ticket*/) +void CCryEditDoc::OnSliceInstantiationFailed([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& ticket) { GetIEditor()->ResumeUndo(); } diff --git a/Code/Editor/Util/MemoryBlock.cpp b/Code/Editor/Util/MemoryBlock.cpp index 6b57557f6f..eb4b53420b 100644 --- a/Code/Editor/Util/MemoryBlock.cpp +++ b/Code/Editor/Util/MemoryBlock.cpp @@ -169,12 +169,10 @@ void CMemoryBlock::Uncompress(CMemoryBlock& toBlock) const assert(this != &toBlock); toBlock.Allocate(m_uncompressedSize); toBlock.m_uncompressedSize = 0; -#if !defined(NDEBUG) unsigned long destSize = m_uncompressedSize; - int result = uncompress((unsigned char*)toBlock.GetBuffer(), &destSize, (unsigned char*)GetBuffer(), GetSize()); + [[maybe_unused]] int result = uncompress((unsigned char*)toBlock.GetBuffer(), &destSize, (unsigned char*)GetBuffer(), GetSize()); assert(result == Z_OK); assert(destSize == static_cast(m_uncompressedSize)); -#endif } ////////////////////////////////////////////////////////////////////////// From 6481b147fc8136a889fefc4c60838c2f6a6d42f5 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Fri, 21 Jan 2022 16:03:39 -0800 Subject: [PATCH 376/620] style and other fixes Signed-off-by: Scott Murray --- ...omEditorComponents_EntityReferenceAdded.py | 38 +++++++++---------- .../editor_entity_utils.py | 2 +- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py index 7f15702199..66efab9e01 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py @@ -86,9 +86,9 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): 7) Add item to 'EntityIdReferences' 8) Update item in 'EntityIdReferences' 9) Remove item from 'EntityIdReferences' - 10) Rest the container property then put one entity reference back for further tests + 10) Reset the container property then put one entity reference back for further tests 11) Remove component - 12) Undo component remove + 12) UNDO component remove 13) Enter/Exit game mode. 14) Test IsHidden. 15) Test IsVisible. @@ -160,55 +160,53 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): AtomComponentProperties.entity_reference('EntityIdReferences'))) # 6. Append item to 'EntityIdReferences' - entity_reference_component.append_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), - test_1.id) + entity_reference_component.append_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), test_1.id) Report.result( Tests.container_append, entity_reference_component.get_container_item( AtomComponentProperties.entity_reference('EntityIdReferences'), 0) == test_1.id) # 7. Add item to 'EntityIdReferences' - entity_reference_component.add_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), - 1, test_1.id) + entity_reference_component.add_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), 1, test_1.id) Report.result( Tests.container_add, entity_reference_component.get_container_count( - AtomComponentProperties.entity_reference('EntityIdReferences')) == 2 - ) + AtomComponentProperties.entity_reference('EntityIdReferences')) == 2) # 8. Update item in 'EntityIdReferences' - entity_reference_component.update_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), - 1, test_2.id) + entity_reference_component.update_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), 1, test_2.id) Report.result( Tests.container_update, entity_reference_component.get_container_item( AtomComponentProperties.entity_reference('EntityIdReferences'), 1) == test_2.id) # 9. Remove item from 'EntityIdReferences' - entity_reference_component.append_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), - test_3.id) + entity_reference_component.append_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), test_3.id) count_before = entity_reference_component.get_container_count( AtomComponentProperties.entity_reference('EntityIdReferences')) - entity_reference_component.remove_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), - 1) + entity_reference_component.remove_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), 1) count_after = entity_reference_component.get_container_count( AtomComponentProperties.entity_reference('EntityIdReferences')) Report.result( Tests.container_remove, ((count_before == 3) and (count_after == 2) and (entity_reference_component.get_container_item( - AtomComponentProperties.entity_reference('EntityIdReferences'), 1) == test_3.id)) - ) + AtomComponentProperties.entity_reference('EntityIdReferences'), 1) == test_3.id))) - # 10. Rest the container property then put one entity reference back for further tests + # 10. Reset the container property then put one entity reference back for further tests entity_reference_component.reset_container(AtomComponentProperties.entity_reference('EntityIdReferences')) general.idle_wait_frames(1) Report.result( Tests.container_reset, entity_reference_component.get_container_count( AtomComponentProperties.entity_reference('EntityIdReferences')) == 0) - entity_reference_component.append_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), - test_1.id) + entity_reference_component.append_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), test_1.id) # 11. Remove component entity_reference_entity.remove_component(AtomComponentProperties.entity_reference()) @@ -216,7 +214,7 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): Report.result(Tests.entity_reference_component_removed, not entity_reference_entity.has_component( AtomComponentProperties.entity_reference())) - # 12. Undo component remove + # 12. UNDO component remove general.undo() general.idle_wait_frames(1) Report.result(Tests.entity_reference_component, entity_reference_entity.has_component( diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index f19bf540a9..d8d4a77a65 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -477,7 +477,7 @@ class EditorEntity: remove_success = editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", component_ids) assert ( remove_success - ), f"Failure: could not remove component from '{self.get_name()}'" + ), f"Failure: could not remove component from entity '{self.get_name()}'" def get_components_of_type(self, component_names: list) -> List[EditorComponent]: """ From dbd6ddbc1c62db227344407a1e51421380adde1c Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Fri, 21 Jan 2022 18:05:19 -0600 Subject: [PATCH 377/620] Optimized Gradient Previewer (#7074) * Faster method with older one commented out for profiling. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Removed commented-out code Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback, fixed subtle bug in interlace math. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed unrelated bug in terrain cmake file. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fix linux compile error. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Editor/EditorGradientPreviewRenderer.h | 202 +++++++++++------- Gems/Terrain/Code/CMakeLists.txt | 1 - 2 files changed, 126 insertions(+), 77 deletions(-) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Editor/EditorGradientPreviewRenderer.h b/Gems/GradientSignal/Code/Include/GradientSignal/Editor/EditorGradientPreviewRenderer.h index 2790a668a3..db39431ba1 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Editor/EditorGradientPreviewRenderer.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Editor/EditorGradientPreviewRenderer.h @@ -25,7 +25,6 @@ #include #include - namespace GradientSignal { //! EditorGradientPreviewUpdateJob offloads the creation of a gradient preview image to another thread. @@ -223,7 +222,7 @@ namespace GradientSignal // If you ever want to make this use a smaller number of passes, set this value to any even number. // A value of 0 is the same as "non-interlaced", 6 would exactly use the Adam7 algorithm, etc. // It's currently clamping to 30 as a somewhat aribtrary choice. - const uint64_t maxFinalInterlacingPass = 30; + const int64_t maxFinalInterlacingPass = 30; m_finalInterlacingPass = AZ::GetMin(m_finalInterlacingPass, maxFinalInterlacingPass); // Finally, lock our mutex, modify our status variables, and start the Job. @@ -238,6 +237,8 @@ namespace GradientSignal //! Process runs exactly once for each time Start() is called on a Job, and processes on a Job worker thread. void Process() override { + AZ_PROFILE_FUNCTION(Entity); + // Guard against the case that we're trying to cancel even before we've started to run. if (!m_shouldCancel) { @@ -247,88 +248,136 @@ namespace GradientSignal // This is the "striding value". When walking directly through our preview image bits() buffer, there might be // extra pad bytes for each line due to alignment. We use this to make sure we start writing each line at the right byte offset. - const uint64_t imageBytesPerLine = m_previewImage->bytesPerLine(); + const int64_t imageBytesPerLine = m_previewImage->bytesPerLine(); - // The following are all used for calculating our interlaced pixel updates. + // Keep track of the total number of pixels that we intend to process. For easy interlacing calculations, we always use + // square power-of-two conceptual images, but we'll skip any pixels that fall outside of our actual image bounds. + const int64_t totalPixels = (m_imageBoundsPowerOfTwo * m_imageBoundsPowerOfTwo); - // The current interlace pass that we're on. - int64_t curPass = 0; - // The index of the first pixel for this pass. This is used to calculate the relative pixel index per pass. - uint64_t firstPixelPerPass = 0; - // Total number of pixels that we'll process per pass. After the first two passes, the amount doubles per pass till we reach 100%. - uint64_t totalPixelsPerPass = (m_imageBoundsPowerOfTwo * m_imageBoundsPowerOfTwo) / (1LL << (m_finalInterlacingPass - curPass)); - // The general interlace formulas need a multiplier and an offset for x and y to apply to each relative pixel index. - // The pixel multipliers start high and reduce on each pass to increase the pixel density per pass. - // The pixel offsets alternate between 0 and a reducing number because we start on aligned grids, then fill in the midpoints - // of the grids on every other pass. - uint64_t xPixelMult = 1LL << (m_finalInterlacingPass / 2); - uint64_t xPixelOffset = 0; - uint64_t yPixelMult = 1LL << (m_finalInterlacingPass / 2); - uint64_t yPixelOffset = 0; + // Preallocate buffers for our gradient lookup positions, our gradient output values, and the corresponding pixel buffer + // index to store the value into. These allow us to fetch gradient values in bulk, which is much faster than fetching them + // individually. The max size we'll need is for our last interacing pass which requests 50% of our total pixels (as + // described further below), so that's what we will preallocate. + AZStd::vector gradientLookupPositions(totalPixels / 2); + AZStd::vector gradientValues(totalPixels / 2); + AZStd::vector pixelBufferIndex(totalPixels / 2); - // The heart of the processing - loop through each pixel using interlaced indexing, get the gradient value, and write it into - // the pixel buffer. On each pixel, we also check to see if the main thread requested a cancel so that we can early-out. - // The loop itself runs through the full square power-of-two bounds that encapsulates our image so that we can perform our - // interlaced indexing easily, but we skip processing any pixel that falls outside the actual image bounds. - for (uint64_t curPixel = 0; (!m_shouldCancel) && (curPixel < (m_imageBoundsPowerOfTwo * m_imageBoundsPowerOfTwo)); curPixel++) + // The following loop uses a variant of the Adam7 interlacing algorithm that's been generalized to work for N passes, + // instead of exactly 7 passes. The first two passes fill in 1 pixel each, and then each subsequent pass doubles the + // number of pixels it fills in, until the last pass fills in 50%. + // Note that m_finalInteracingPass contains the value of the final pass to process, not the total number of passes. + // On each pass, we'll also early-out if the main thread requested a cancellation. + for (int64_t curPass = 0; (!m_shouldCancel) && (curPass <= m_finalInterlacingPass); curPass++) { - // Check to see if we've finished the pixels for this pass and need to move on to the next pass. - if (curPixel >= (firstPixelPerPass + totalPixelsPerPass)) + gradientLookupPositions.clear(); + pixelBufferIndex.clear(); + gradientValues.clear(); + + // The general interlace formulas need a multiplier and an offset for x and y to apply to each relative pixel index. + // + // The first 3 passes are a little different than the others because they establish the base pattern: + // 1 . . . 2 . . . + // . . . . . . . . + // . . . . . . . . + // . . . . . . . . + // 3 . . . 3 . . . + // . . . . . . . . + // . . . . . . . . + // . . . . . . . . + // + // Every 2 passes from then on do the same thing, with shrinking grids. One pass fills in the grid X midpoints on the + // lines that were already processed, and the second pass fills in all the equivalent points on the Y grid midpoints + // x . 4 . x . 4 . + // . . . . . . . . + // 5 . 5 . 5 . 5 . + // . . . . . . . . + // x . 4 . x . 4 . + // . . . . . . . . + // 5 . 5 . 5 . 5 . + // . . . . . . . . + // + // x 6 x 6 x 6 x 6 + // 7 7 7 7 7 7 7 7 + // x 6 x 6 x 6 x 6 + // 7 7 7 7 7 7 7 7 + // x 6 x 6 x 6 x 6 + // 7 7 7 7 7 7 7 7 + // x 6 x 6 x 6 x 6 + // 7 7 7 7 7 7 7 7 + // + // The total number of pixels processed per pass starts at 1 pixel each for the first two passes, then doubles per + // pass till we reach 50% in the last pass, since all the other passes before it will have covered the other 50%. + // Ex: 7 passes will do N/64, N/64, N/32, N/16, N/8, N/4, N/2 pixels per pass. + + + // For X, we want our starting pixel offset to alternate between 0 and a decreasing power of 2 on every pass, and + // our stride to decrease by a power of 2 every two passes, ending with an offset of 0 and a stride of 1 on the last + // pass. + const int64_t xOffsetShifter = AZ::GetMin(m_finalInterlacingPass - curPass, m_finalInterlacingPass - 1); + const int64_t xPixelOffset = (curPass % 2) * (1LL << (xOffsetShifter / 2)); + const int64_t xPixelStride = 1LL << ((xOffsetShifter + 1) / 2); + + // For Y, we want our starting pixel offset and our stride to behave the same as X, except that we hold our starting + // offset and stride for one additional pass which is what causes the first 3 passes to behave differently than the + // rest. The pass offset between X and Y is also what causes the pattern to keep filling in pixels and lines that + // haven't already been processed. + const int64_t laggingPass = AZ::GetMax(curPass - 1, 0); + const int64_t yOffsetShifter = AZ::GetMin(m_finalInterlacingPass - laggingPass, m_finalInterlacingPass - 1); + const int64_t yPixelOffset = (laggingPass % 2) * (1LL << (yOffsetShifter / 2)); + const int64_t yPixelStride = 1LL << ((yOffsetShifter + 1) / 2); + + // First, we loop and fill in all the gradientLookupPositions and pixelBufferIndex values for any pixels that don't + // get culled out. We're using a power of two for calculating our interlacing offsets and strides, but we don't need + // to actually process any of those pixels that fall outside our image bounds, so we end our loops at the bounds. + for (int64_t y = yPixelOffset; y < m_imageBoundsY; y += yPixelStride) { - curPass++; - - // Adjust our interlacing formula adjustments on each pass. These will cause us to process an increasing - // number of pixels at a higher density on each pass, interleaving in a way that ensures each pixel is only - // processed once at the end. - yPixelMult = xPixelMult; - yPixelOffset = xPixelOffset; - xPixelMult = 1LL << ((m_finalInterlacingPass - curPass + 1) / 2); - xPixelOffset = (curPass % 2) * (1LL << ((m_finalInterlacingPass - curPass) / 2)); - - firstPixelPerPass += totalPixelsPerPass; - totalPixelsPerPass = (m_imageBoundsPowerOfTwo * m_imageBoundsPowerOfTwo) / (1LL << (m_finalInterlacingPass - curPass + 1)); - } - - // Here's where interlacing happens. If this were non-interlaced, we'd simply have the following: - // x = curPixel % m_imageBoundsPowerOfTwo - // y = curPixel / m_imageBoundsPowerOfTwo - uint64_t adjustedPixel = curPixel - firstPixelPerPass; - uint64_t x = ((adjustedPixel * xPixelMult) + xPixelOffset) % m_imageBoundsPowerOfTwo; - uint64_t y = ((((adjustedPixel * xPixelMult) + xPixelOffset) / m_imageBoundsPowerOfTwo) * yPixelMult) + yPixelOffset; - - // Since we're using a power of two for calculating our interlacing, it's possible to get pixel offsets beyond the bounds - // of our actual image. We just skip those and continue on to the next pixel. - if ((x >= m_imageBoundsX) || (y >= m_imageBoundsY)) - { - continue; - } - - // Now that we've calculated the pixel position, update it with the gradient value. - { - // Invert world y to match axis. (We use "imageBoundsY- 1" to invert because our loop doesn't go all the way to imageBoundsY) - AZ::Vector3 uvw(static_cast(x), static_cast((m_imageBoundsY - 1) - y), 0.0f); - - GradientSampleParams sampleParams; - sampleParams.m_position = m_previewBoundsStart + (uvw * m_pixelToBoundsScale) + m_scaledTexelOffset; - - bool inBounds = true; - if (m_constrainToShape) + for (int64_t x = xPixelOffset; x < m_imageBoundsX; x += xPixelStride) { - LmbrCentral::ShapeComponentRequestsBus::EventResult(inBounds, m_previewEntityId, &LmbrCentral::ShapeComponentRequestsBus::Events::IsPointInside, sampleParams.m_position); - } + // Map the pixel coordinate back into world coordinates for the shape and gradient queries. Note that we + // invert world y to match the world axis. (We use "imageBoundsY- 1" to invert because our loop doesn't go all + // the way to imageBoundsY) + AZ::Vector3 uvw(static_cast(x), static_cast((m_imageBoundsY - 1) - y), 0.0f); + AZ::Vector3 position = m_previewBoundsStart + (uvw * m_pixelToBoundsScale) + m_scaledTexelOffset; - float sample = inBounds ? m_sampler.GetValue(sampleParams) : 0.0f; + // If our preview is only drawing what appears inside the given shape, check to see if the pixel should be + // drawn. + bool inBounds = true; + if (m_constrainToShape) + { + LmbrCentral::ShapeComponentRequestsBus::EventResult( + inBounds, m_previewEntityId, &LmbrCentral::ShapeComponentRequestsBus::Events::IsPointInside, position); + } + + // If we're drawing this pixel, push it into our buffer of lookup positions. + if (inBounds) + { + gradientLookupPositions.emplace_back(position); + pixelBufferIndex.emplace_back(((m_centeringOffsetY + y) * imageBytesPerLine) + (m_centeringOffsetX + x)); + } + } + } + + // Resize our output buffer to match our input buffer and query for all the gradient values at once. + gradientValues.resize(gradientLookupPositions.size()); + m_sampler.GetValues(gradientLookupPositions, gradientValues); + + // For each output value, run it through a filter if we were given one, then store it in the pixel buffer. + for (size_t index = 0; index < gradientLookupPositions.size(); index++) + { + float sample = gradientValues[index]; if (m_filterFunc) { + GradientSampleParams sampleParams; + sampleParams.m_position = gradientLookupPositions[index]; sample = m_filterFunc(sample, sampleParams); } - buffer[((m_centeringOffsetY + y) * imageBytesPerLine) + (m_centeringOffsetX + x)] = static_cast(sample * 255); - } + buffer[pixelBufferIndex[index]] = static_cast(sample * 255); - // Notify the main thread via atomic bool that the image has changed by at least one pixel. - m_refreshUI = true; + // Notify the main thread via atomic bool that the image has changed by at least one pixel. + m_refreshUI = true; + } } } @@ -356,15 +405,15 @@ namespace GradientSignal AZ::EntityId m_previewEntityId; // Values calculated during preview setup that we'll use during processing - uint64_t m_imageBoundsX = 0; - uint64_t m_imageBoundsY = 0; - uint64_t m_centeringOffsetX = 0; - uint64_t m_centeringOffsetY = 0; + int64_t m_imageBoundsX = 0; + int64_t m_imageBoundsY = 0; + int64_t m_centeringOffsetX = 0; + int64_t m_centeringOffsetY = 0; AZ::Vector3 m_previewBoundsStart; AZ::Vector3 m_pixelToBoundsScale; AZ::Vector3 m_scaledTexelOffset; - uint64_t m_imageBoundsPowerOfTwo = 1; - uint64_t m_finalInterlacingPass = 0; + int64_t m_imageBoundsPowerOfTwo = 1; + int64_t m_finalInterlacingPass = 0; // Communication / synchronization mechanisms between the different threads AZStd::mutex m_previewMutex; @@ -456,3 +505,4 @@ namespace GradientSignal EditorGradientPreviewUpdateJob* m_updateJob = nullptr; }; } //namespace GradientSignal + diff --git a/Gems/Terrain/Code/CMakeLists.txt b/Gems/Terrain/Code/CMakeLists.txt index 69a1bef3c0..44e33b7008 100644 --- a/Gems/Terrain/Code/CMakeLists.txt +++ b/Gems/Terrain/Code/CMakeLists.txt @@ -98,7 +98,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) NAME Terrain.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE Gem FILES_CMAKE - terrain_files.cmake terrain_tests_files.cmake INCLUDE_DIRECTORIES PRIVATE From dd7706f9feec5370a8d6b5e9b2565c13421016e9 Mon Sep 17 00:00:00 2001 From: chiyenteng <82238204+chiyenteng@users.noreply.github.com> Date: Fri, 21 Jan 2022 16:23:31 -0800 Subject: [PATCH 378/620] Fire OnEditorEntityCreated notification in SandboxIntegrationManager::CreateNewEntityAtPosition (#7079) * Ensure to fire OnEditorEntityCreated notification in SandboxIntegrationManager::CreateNewEntityAtPosition Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com> * Ensure to fire OnEditorEntityCreated notification in SandboxIntegrationManager::CreateNewEntityAtPosition Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com> * convert test AreaNodes_DependentComponentsAdded to use prefab system Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com> * Prevent SetupEditorEntity being called twice Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com> --- .../AreaNodes_DependentComponentsAdded.py | 2 +- .../TestSuite_Main_Optimized.py | 10 +++++--- .../Entity/EditorEntityContextBus.h | 5 +++- .../Entity/EditorEntityContextComponent.cpp | 23 +++++-------------- .../Entity/EditorEntityContextComponent.h | 5 +--- .../Prefab/PrefabPublicHandler.cpp | 1 + 6 files changed, 20 insertions(+), 26 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py index c69ce77041..8151299cea 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py @@ -69,7 +69,7 @@ def AreaNodes_DependentComponentsAdded(): # Open an existing simple level helper.init_idle() - helper.open_level("Physics", "Base") + helper.open_level("", "Base") # Open Landscape Canvas tool and verify general.open_pane('Landscape Canvas') diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py index 402df133cb..e501b3ad3b 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py @@ -12,6 +12,13 @@ import ly_test_tools.environment.file_system as file_system import ly_test_tools._internal.pytest_plugin as internal_plugin from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite +@pytest.mark.SUITE_periodic +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +class TestAutomationWithPrefabSystemEnabled(EditorTestSuite): + + class test_LandscapeCanvas_AreaNodes_DependentComponentsAdded(EditorSharedTest): + from .EditorScripts import AreaNodes_DependentComponentsAdded as test_module @pytest.mark.SUITE_periodic @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @@ -26,9 +33,6 @@ class TestAutomation(EditorTestSuite): class test_LandscapeCanvas_GradientMixer_NodeConstruction(EditorSharedTest): from .EditorScripts import GradientMixer_NodeConstruction as test_module - class test_LandscapeCanvas_AreaNodes_DependentComponentsAdded(EditorSharedTest): - from .EditorScripts import AreaNodes_DependentComponentsAdded as test_module - class test_LandscapeCanvas_AreaNodes_EntityCreatedOnNodeAdd(EditorSharedTest): from .EditorScripts import AreaNodes_EntityCreatedOnNodeAdd as test_module diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextBus.h index 1a5ba60bdf..29d9b742e2 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextBus.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextBus.h @@ -63,9 +63,12 @@ namespace AzToolsFramework /// Registers an existing set of entities with the editor context. virtual void AddEditorEntities(const EntityList& entities) = 0; - /// Registers an existing set of entities with the editor context. + /// Triggers registered callbacks for an existing set of entities with the editor context. virtual void HandleEntitiesAdded(const EntityList& entities) = 0; + /// Creates an editor ready entity, and sends out notification for the creation. + virtual void FinalizeEditorEntity(AZ::Entity* entity) = 0; + /// Destroys an entity in the editor context. /// \return whether or not the entity was destroyed. A false return value signifies the entity did not belong to the game context. virtual bool DestroyEditorEntity(AZ::EntityId entityId) = 0; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp index 470ca8b9ea..95b3f2bf93 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp @@ -227,14 +227,8 @@ namespace AzToolsFramework { AZ::Entity* entity = CreateEntity(name); AZ_Assert(entity != nullptr, "Entity with name %s couldn't be created.", name); - if (m_isLegacySliceService) - { - FinalizeEditorEntity(entity); - } - else - { - EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::OnEditorEntityCreated, entity->GetId()); - } + FinalizeEditorEntity(entity); + return entity->GetId(); } @@ -263,14 +257,7 @@ namespace AzToolsFramework entity = aznew AZ::Entity(entityId, name); AZ_Assert(entity != nullptr, "Entity with name %s couldn't be created.", name); AddEntity(entity); - if (m_isLegacySliceService) - { - FinalizeEditorEntity(entity); - } - else - { - EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::OnEditorEntityCreated, entity->GetId()); - } + FinalizeEditorEntity(entity); return entity->GetId(); } @@ -284,10 +271,12 @@ namespace AzToolsFramework { return; } - SetupEditorEntity(entity); // Store creation undo command. + if (m_isLegacySliceService) { + SetupEditorEntity(entity); + ScopedUndoBatch undoBatch("Create Entity"); EntityCreateCommand* command = aznew EntityCreateCommand(static_cast(entity->GetId())); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.h index 28cf67c0f2..4e04b81c67 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.h @@ -81,6 +81,7 @@ namespace AzToolsFramework void AddEditorEntity(AZ::Entity* entity) override; void AddEditorEntities(const EntityList& entities) override; void HandleEntitiesAdded(const EntityList& entities) override; + void FinalizeEditorEntity(AZ::Entity* entity) override; bool CloneEditorEntities(const EntityIdList& sourceEntities, EntityList& resultEntities, AZ::SliceComponent::EntityIdToEntityIdMap& sourceToCloneEntityIdMap) override; @@ -142,13 +143,9 @@ namespace AzToolsFramework } protected: - void OnContextEntitiesAdded(const EntityList& entities) override; void OnContextEntityRemoved(const AZ::EntityId& id) override; - // Helper function for creating editor ready entities. - void FinalizeEditorEntity(AZ::Entity* entity); - void SetupEditorEntity(AZ::Entity* entity); void SetupEditorEntities(const EntityList& entities); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp index 0c1fb9bed2..62003cd846 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp @@ -661,6 +661,7 @@ namespace AzToolsFramework entityOwningInstance.AddEntity(*entity, entityAlias); EditorEntityContextRequestBus::Broadcast(&EditorEntityContextRequestBus::Events::HandleEntitiesAdded, EntityList{entity}); + EditorEntityContextRequestBus::Broadcast(&EditorEntityContextRequestBus::Events::FinalizeEditorEntity, entity); AZ::Transform transform = AZ::Transform::CreateIdentity(); transform.SetTranslation(position); From 1f7040c6b825361e54e6d502d8452e82543d56b7 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 21 Jan 2022 18:28:13 -0600 Subject: [PATCH 379/620] Updating mock calls in unit_test_manifest.py to fix test (#7090) The manifest.py `get_all_templates` method was modified to add a call to `get_all_gems` and `get_gem_templates`. Those calls were not mocked, so they tried to load an o3de_manifest.json file that was on user's machine, which failed on the CI node. Also added a mock call for `load_o3de_manifest`, that validates that it is not called to catch this issue during Automated Review. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- scripts/o3de/tests/unit_test_manifest.py | 39 +++++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/scripts/o3de/tests/unit_test_manifest.py b/scripts/o3de/tests/unit_test_manifest.py index c7d7a7573b..c8eb916bf3 100644 --- a/scripts/o3de/tests/unit_test_manifest.py +++ b/scripts/o3de/tests/unit_test_manifest.py @@ -29,10 +29,17 @@ class TestGetTemplatesForCreation: def get_project_templates() -> list: return [] + @staticmethod + def get_gem_templates() -> list: + return [] + @staticmethod def get_engine_templates() -> list: return [pathlib.Path('D:/o3de/Templates/DefaultProject'), pathlib.Path('D:/o3de/Templates/DefaultGem')] + @staticmethod + def get_all_gems(project_path: pathlib.Path = None) -> list: + return [] @pytest.mark.parametrize("expected_template_paths", [ pytest.param([]) @@ -50,17 +57,25 @@ class TestGetTemplatesForCreation: as get_manifest_templates_patch, \ patch('o3de.manifest.get_project_templates', side_effect=self.get_project_templates)\ as get_project_templates_patch, \ + patch('o3de.manifest.get_gem_templates', side_effect=self.get_gem_templates) \ + as get_gem_templates_patch, \ patch('o3de.manifest.get_engine_templates', side_effect=self.get_engine_templates)\ as get_engine_templates_patch, \ + patch('o3de.manifest.get_all_gems', side_effect=self.get_all_gems) \ + as get_all_gems_patch, \ patch('o3de.validation.valid_o3de_template_json', return_value=True) \ as validate_template_json,\ patch('o3de.validation.valid_o3de_project_json', side_effect=validate_project_json) \ as validate_project_json,\ patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) \ - as validate_gem_json: + as validate_gem_json,\ + patch('o3de.manifest.load_o3de_manifest') as load_o3de_manifest_patch: templates = manifest.get_templates_for_generic_creation() assert templates == expected_template_paths + # make sure the o3de manifest isn't attempted to be loaded + load_o3de_manifest_patch.assert_not_called() + @pytest.mark.parametrize("expected_template_paths", [ pytest.param([pathlib.Path('D:/o3de/Templates/DefaultProject')]) @@ -78,17 +93,25 @@ class TestGetTemplatesForCreation: as get_manifest_templates_patch, \ patch('o3de.manifest.get_project_templates', side_effect=self.get_project_templates) \ as get_project_templates_patch, \ + patch('o3de.manifest.get_gem_templates', side_effect=self.get_gem_templates) \ + as get_gem_templates_patch, \ patch('o3de.manifest.get_engine_templates', side_effect=self.get_engine_templates) \ as get_engine_templates_patch, \ + patch('o3de.manifest.get_all_gems', side_effect=self.get_all_gems) \ + as get_all_gems_patch, \ patch('o3de.validation.valid_o3de_template_json', return_value=True) \ as validate_template_json, \ patch('o3de.validation.valid_o3de_project_json', side_effect=validate_project_json) \ as validate_project_json, \ patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) \ - as validate_gem_json: + as validate_gem_json,\ + patch('o3de.manifest.load_o3de_manifest') as load_o3de_manifest_patch: templates = manifest.get_templates_for_project_creation() assert templates == expected_template_paths + # make sure the o3de manifest isn't attempted to be loaded + load_o3de_manifest_patch.assert_not_called() + @pytest.mark.parametrize("expected_template_paths", [ pytest.param([pathlib.Path('D:/o3de/Templates/DefaultGem')]) @@ -106,13 +129,21 @@ class TestGetTemplatesForCreation: as get_manifest_templates_patch, \ patch('o3de.manifest.get_project_templates', side_effect=self.get_project_templates) \ as get_project_templates_patch, \ + patch('o3de.manifest.get_gem_templates', side_effect=self.get_gem_templates) \ + as get_gem_templates_patch, \ patch('o3de.manifest.get_engine_templates', side_effect=self.get_engine_templates) \ as get_engine_templates_patch, \ + patch('o3de.manifest.get_all_gems', side_effect=self.get_all_gems) \ + as get_all_gems_patch, \ patch('o3de.validation.valid_o3de_template_json', return_value=True) \ as validate_template_json, \ patch('o3de.validation.valid_o3de_project_json', side_effect=validate_project_json) \ as validate_project_json, \ patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) \ - as validate_gem_json: + as validate_gem_json, \ + patch('o3de.manifest.load_o3de_manifest') as load_o3de_manifest_patch: templates = manifest.get_templates_for_gem_creation() - assert templates == expected_template_paths \ No newline at end of file + assert templates == expected_template_paths + + # make sure the o3de manifest isn't attempted to be loaded + load_o3de_manifest_patch.assert_not_called() From 878ba24a3f617c1bed46dad8e0f7ee105f21af26 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 21 Jan 2022 18:28:26 -0600 Subject: [PATCH 380/620] Removed unused AWSNativeSDK dependency from Editor (#7091) * Removed unused AWSNativeSDK dependency from Editor Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Remove build dependencies on the aws-cpp-sdk library from the Editor Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Code/Editor/CMakeLists.txt | 3 --- Code/Editor/CryEdit.cpp | 10 ---------- Code/Editor/IEditorImpl.cpp | 10 ---------- Code/Editor/IEditorImpl.h | 1 - Code/Editor/MainWindow.cpp | 5 ----- 5 files changed, 29 deletions(-) diff --git a/Code/Editor/CMakeLists.txt b/Code/Editor/CMakeLists.txt index 9d74f8e3a2..3f340e37d8 100644 --- a/Code/Editor/CMakeLists.txt +++ b/Code/Editor/CMakeLists.txt @@ -104,13 +104,11 @@ ly_add_target( 3rdParty::Qt::Concurrent 3rdParty::TIFF 3rdParty::squish-ccr - 3rdParty::AWSNativeSDK::STS Legacy::CryCommon Legacy::EditorCommon AZ::AzCore AZ::AzToolsFramework Gem::LmbrCentral.Static - AZ::AWSNativeSDKInit AZ::AtomCore Gem::Atom_RPI.Edit Gem::Atom_RPI.Public @@ -119,7 +117,6 @@ ly_add_target( Gem::AtomViewportDisplayInfo ${additional_dependencies} PUBLIC - 3rdParty::AWSNativeSDK::Core 3rdParty::Qt::Network Legacy::EditorCore RUNTIME_DEPENDENCIES diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index 8789b31fdc..cb64d47a57 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -36,14 +36,6 @@ AZ_POP_DISABLE_WARNING #include #include -// Aws Native SDK -#include -#include -#include -#include -#include -#include - // AzCore #include #include @@ -144,9 +136,7 @@ AZ_POP_DISABLE_WARNING #include "Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h" -// AWSNativeSDK #include -#include #if defined(AZ_PLATFORM_WINDOWS) diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index 38006c6fca..a2712b653d 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -16,12 +16,6 @@ // Qt #include -// AWS Native SDK -AZ_PUSH_DISABLE_WARNING(4251 4355 4996, "-Wunknown-warning-option") -#include -#include -AZ_POP_DISABLE_WARNING - // AzCore #include #include @@ -78,9 +72,6 @@ AZ_POP_DISABLE_WARNING // EditorCommon #include -// AWSNativeSDK -#include - #include "Core/QtEditorApplication.h" // for Editor::EditorQtApplication static CCryEditDoc * theDocument; @@ -132,7 +123,6 @@ CEditorImpl::CEditorImpl() , m_pSettingsManager(nullptr) , m_pLevelIndependentFileMan(nullptr) , m_pExportManager(nullptr) - , m_awsResourceManager(nullptr) , m_bMatEditMode(false) , m_bShowStatusText(true) , m_bInitialized(false) diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h index 7867912941..354f631507 100644 --- a/Code/Editor/IEditorImpl.h +++ b/Code/Editor/IEditorImpl.h @@ -369,7 +369,6 @@ protected: QString m_selectFileBuffer; QString m_levelNameBuffer; - IAWSResourceManager* m_awsResourceManager; std::unique_ptr m_winWidgetManager; //! True if the editor is in material edit mode. Fast preview of materials. diff --git a/Code/Editor/MainWindow.cpp b/Code/Editor/MainWindow.cpp index bbebac96a3..63841299be 100644 --- a/Code/Editor/MainWindow.cpp +++ b/Code/Editor/MainWindow.cpp @@ -11,11 +11,6 @@ #include -// AWs Native SDK -AZ_PUSH_DISABLE_WARNING(4251 4355 4996, "-Wunknown-warning-option") -#include -AZ_POP_DISABLE_WARNING - // Qt #include #include From 4d62351628781092fedf1fb3e9f0a555e69fd863 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 21 Jan 2022 16:42:30 -0800 Subject: [PATCH 381/620] Fixes for Linux no unity builds Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/GuidUtil.cpp | 2 +- .../ToolsFileUtils/ToolsFileUtils_generic.cpp | 47 +++++++++++++++++++ .../UI/PropertyEditor/PropertyColorCtrl.cpp | 2 +- .../aztoolsframework_linux_files.cmake | 1 + .../aztoolsframework_mac_files.cmake | 1 + .../Source/RenderPlugin/CommandCallbacks.cpp | 1 + .../RenderPlugin/RenderUpdateCallback.cpp | 1 + .../Source/OpenGLRender/GLWidget.cpp | 4 +- .../Integration/FloatDataInterface.h | 4 ++ .../Libraries/Core/GetVariable.cpp | 1 + 10 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp diff --git a/Code/Editor/Util/GuidUtil.cpp b/Code/Editor/Util/GuidUtil.cpp index e8ea6fd3f8..dbd7d4c371 100644 --- a/Code/Editor/Util/GuidUtil.cpp +++ b/Code/Editor/Util/GuidUtil.cpp @@ -11,7 +11,7 @@ const char* GuidUtil::ToString(REFGUID guid) { static char guidString[64]; - sprintf_s(guidString, "{%.8" GUID_FORMAT_DATA1 "-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], + azsprintf(guidString, "{%.8" GUID_FORMAT_DATA1 "-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); return guidString; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp new file mode 100644 index 0000000000..8357a265ba --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp @@ -0,0 +1,47 @@ +/* + * 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 + * + */ + +#include "ToolsFileUtils.h" +#include +#include + +#include + +namespace AzToolsFramework +{ + namespace ToolsFileUtils + { + bool SetModificationTime(const char* const filename, AZ::u64 modificationTime) + { + struct stat statResult; + if (stat(filename, &statResult) != 0) + { + return false; + } + + struct utimbuf puttime; + puttime.modtime = modificationTime; + puttime.actime = static_cast(statResult.st_ctime); + + if (utime(filename, &puttime) == 0) + { + return true; + } + + return false; + } + + bool GetFreeDiskSpace(const QString& path, qint64& outFreeDiskSpace) + { + QStorageInfo storageInfo(path); + outFreeDiskSpace = storageInfo.bytesFree(); + + return outFreeDiskSpace >= 0; + } + } +} diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp index fd6580225f..fae24d9b3a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp @@ -18,7 +18,7 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") #include AZ_POP_DISABLE_WARNING #include -#include +#include namespace AzToolsFramework { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake index af4bfcb8f4..afd487daf7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake @@ -29,4 +29,5 @@ set(FILES UI/UICore/SaveChangesDialog.hxx UI/UICore/SaveChangesDialog.cpp UI/UICore/SaveChangesDialog.ui + ToolsFileUtils/ToolsFileUtils_generic.cpp ) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake index af4bfcb8f4..afd487daf7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake @@ -29,4 +29,5 @@ set(FILES UI/UICore/SaveChangesDialog.hxx UI/UICore/SaveChangesDialog.cpp UI/UICore/SaveChangesDialog.ui + ToolsFileUtils/ToolsFileUtils_generic.cpp ) diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp index a04e2a87c8..c53c382d34 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp @@ -10,6 +10,7 @@ #include "RenderPlugin.h" #include #include +#include namespace EMStudio diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp index 49bb5509b6..2024746971 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp @@ -13,6 +13,7 @@ #include #include "RenderWidget.h" #include "RenderViewWidget.h" +#include namespace EMStudio diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp index c6cab07a44..eefac45a3b 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp @@ -15,8 +15,10 @@ #include #include #include -#include "../../../../EMStudioSDK/Source/RenderPlugin/RenderViewWidget.h" +#include +#include +#include namespace EMStudio { diff --git a/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h b/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h index 66c0f57fe4..8aefe5baf0 100644 --- a/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h +++ b/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h @@ -8,6 +8,9 @@ #pragma once +// Graph Canvas +#include + // Graph Model #include @@ -36,3 +39,4 @@ namespace GraphModelIntegration AZStd::weak_ptr m_slot; }; } + diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp index f88fb03726..e77d1abeb6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace ScriptCanvas { From c4addbc0e0e693f63a8891625ea0d0b9719685fc Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 21 Jan 2022 22:08:31 -0800 Subject: [PATCH 382/620] Moved AutomatedTesting specific script translation assets from gems/canvas into AutomatedTesting Signed-off-by: Gene Walters --- ...orityToAutonomousNoParamsNotifyEvent.names | 0 .../AuthorityToAutonomousNotifyEvent.names | 0 ...ToAutonomous_PlayerNumberNotifyEvent.names | 56 ++++ ...AuthorityToClientNoParamsNotifyEvent.names | 0 ...tyToClientNoParams_PlayFxNotifyEvent.names | 50 ++++ .../AuthorityToClientNotifyEvent.names | 0 ...nomousToAuthorityNoParamsNotifyEvent.names | 0 .../AutonomousToAuthorityNotifyEvent.names | 0 .../ServerToAuthorityNoParamNotifyEvent.names | 0 .../ServerToAuthorityNotifyEvent.names | 0 ...verToAuthority_DealDamageNotifyEvent.names | 56 ++++ .../Classes/NetworkTestPlayerComponent.names | 242 +++++++++--------- ...tworkTestPlayerComponentNetworkInput.names | 0 13 files changed, 283 insertions(+), 121 deletions(-) rename {Gems/ScriptCanvas/Assets => AutomatedTesting/ScriptCanvas}/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names (100%) rename {Gems/ScriptCanvas/Assets => AutomatedTesting/ScriptCanvas}/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names (100%) create mode 100644 AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToAutonomous_PlayerNumberNotifyEvent.names rename {Gems/ScriptCanvas/Assets => AutomatedTesting/ScriptCanvas}/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names (100%) create mode 100644 AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToClientNoParams_PlayFxNotifyEvent.names rename {Gems/ScriptCanvas/Assets => AutomatedTesting/ScriptCanvas}/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names (100%) rename {Gems/ScriptCanvas/Assets => AutomatedTesting/ScriptCanvas}/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names (100%) rename {Gems/ScriptCanvas/Assets => AutomatedTesting/ScriptCanvas}/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names (100%) rename {Gems/ScriptCanvas/Assets => AutomatedTesting/ScriptCanvas}/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names (100%) rename {Gems/ScriptCanvas/Assets => AutomatedTesting/ScriptCanvas}/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names (100%) create mode 100644 AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/ServerToAuthority_DealDamageNotifyEvent.names rename {Gems/ScriptCanvas/Assets => AutomatedTesting/ScriptCanvas}/TranslationAssets/Classes/NetworkTestPlayerComponent.names (90%) rename {Gems/ScriptCanvas/Assets => AutomatedTesting/ScriptCanvas}/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names (100%) diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names similarity index 100% rename from Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names rename to AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names similarity index 100% rename from Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names rename to AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names diff --git a/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToAutonomous_PlayerNumberNotifyEvent.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToAutonomous_PlayerNumberNotifyEvent.names new file mode 100644 index 0000000000..7255c61d23 --- /dev/null +++ b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToAutonomous_PlayerNumberNotifyEvent.names @@ -0,0 +1,56 @@ +{ + "entries": [ + { + "base": "AuthorityToAutonomous_PlayerNumber Notify Event", + "context": "AZEventHandler", + "variant": "", + "details": { + "name": "Authority To Autonomous_ Player Number Notify Event" + }, + "slots": [ + { + "base": "player_number", + "details": { + "name": "player_number" + } + }, + { + "base": "AuthorityToAutonomous_PlayerNumber Notify Event", + "details": { + "name": "AuthorityToAutonomous_PlayerNumber Notify Event" + } + }, + { + "base": "Connect", + "details": { + "name": "Connect" + } + }, + { + "base": "Disconnect", + "details": { + "name": "Disconnect" + } + }, + { + "base": "On Connected", + "details": { + "name": "On Connected" + } + }, + { + "base": "On Disconnected", + "details": { + "name": "On Disconnected" + } + }, + { + "base": "OnEvent", + "details": { + "name": "OnEvent" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names similarity index 100% rename from Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names rename to AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names diff --git a/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToClientNoParams_PlayFxNotifyEvent.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToClientNoParams_PlayFxNotifyEvent.names new file mode 100644 index 0000000000..3e0207a705 --- /dev/null +++ b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToClientNoParams_PlayFxNotifyEvent.names @@ -0,0 +1,50 @@ +{ + "entries": [ + { + "base": "AuthorityToClientNoParams_PlayFx Notify Event", + "context": "AZEventHandler", + "variant": "", + "details": { + "name": "Authority To Client No Params_ Play Fx Notify Event" + }, + "slots": [ + { + "base": "AuthorityToClientNoParams_PlayFx Notify Event", + "details": { + "name": "AuthorityToClientNoParams_PlayFx Notify Event" + } + }, + { + "base": "Connect", + "details": { + "name": "Connect" + } + }, + { + "base": "Disconnect", + "details": { + "name": "Disconnect" + } + }, + { + "base": "On Connected", + "details": { + "name": "On Connected" + } + }, + { + "base": "On Disconnected", + "details": { + "name": "On Disconnected" + } + }, + { + "base": "OnEvent", + "details": { + "name": "OnEvent" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names similarity index 100% rename from Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names rename to AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names similarity index 100% rename from Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names rename to AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names similarity index 100% rename from Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names rename to AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names similarity index 100% rename from Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names rename to AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names similarity index 100% rename from Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names rename to AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names diff --git a/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/ServerToAuthority_DealDamageNotifyEvent.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/ServerToAuthority_DealDamageNotifyEvent.names new file mode 100644 index 0000000000..2505d9593a --- /dev/null +++ b/AutomatedTesting/ScriptCanvas/TranslationAssets/AZEvents/ServerToAuthority_DealDamageNotifyEvent.names @@ -0,0 +1,56 @@ +{ + "entries": [ + { + "base": "ServerToAuthority_DealDamage Notify Event", + "context": "AZEventHandler", + "variant": "", + "details": { + "name": "Server To Authority_ Deal Damage Notify Event" + }, + "slots": [ + { + "base": "damage", + "details": { + "name": "damage" + } + }, + { + "base": "ServerToAuthority_DealDamage Notify Event", + "details": { + "name": "ServerToAuthority_DealDamage Notify Event" + } + }, + { + "base": "Connect", + "details": { + "name": "Connect" + } + }, + { + "base": "Disconnect", + "details": { + "name": "Disconnect" + } + }, + { + "base": "On Connected", + "details": { + "name": "On Connected" + } + }, + { + "base": "On Disconnected", + "details": { + "name": "On Disconnected" + } + }, + { + "base": "OnEvent", + "details": { + "name": "OnEvent" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponent.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/Classes/NetworkTestPlayerComponent.names similarity index 90% rename from Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponent.names rename to AutomatedTesting/ScriptCanvas/TranslationAssets/Classes/NetworkTestPlayerComponent.names index 22636e0453..03e949f784 100644 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponent.names +++ b/AutomatedTesting/ScriptCanvas/TranslationAssets/Classes/NetworkTestPlayerComponent.names @@ -8,64 +8,6 @@ "name": "Network Test Player Component" }, "methods": [ - { - "base": "AutonomousToAuthority", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Autonomous To Authority" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Autonomous To Authority is invoked" - }, - "details": { - "name": "Autonomous To Authority" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "float" - } - } - ] - }, - { - "base": "ServerToAuthority", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Server To Authority" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Server To Authority is invoked" - }, - "details": { - "name": "Server To Authority" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "float" - } - } - ] - }, { "base": "AutonomousToAuthorityByEntityId", "context": "NetworkTestPlayerComponent", @@ -97,18 +39,72 @@ ] }, { - "base": "ServerToAuthorityByEntityId", + "base": "AuthorityToClientNoParams_PlayFxByEntityId", "context": "NetworkTestPlayerComponent", "entry": { "name": "In", - "tooltip": "When signaled, this will invoke Server To Authority By Entity Id" + "tooltip": "When signaled, this will invoke Authority To Client No Params_ Play Fx By Entity Id" }, "exit": { "name": "Out", - "tooltip": "Signaled after Server To Authority By Entity Id is invoked" + "tooltip": "Signaled after Authority To Client No Params_ Play Fx By Entity Id is invoked" }, "details": { - "name": "Server To Authority By Entity Id" + "name": "Authority To Client No Params_ Play Fx By Entity Id" + }, + "params": [ + { + "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", + "details": { + "name": "Source", + "tooltip": "The Source containing the NetworkTestPlayerComponentController" + } + } + ] + }, + { + "base": "AuthorityToAutonomous_PlayerNumberByEntityId", + "context": "NetworkTestPlayerComponent", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Authority To Autonomous_ Player Number By Entity Id" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Authority To Autonomous_ Player Number By Entity Id is invoked" + }, + "details": { + "name": "Authority To Autonomous_ Player Number By Entity Id" + }, + "params": [ + { + "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", + "details": { + "name": "Source", + "tooltip": "The Source containing the NetworkTestPlayerComponentController" + } + }, + { + "typeid": "{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}", + "details": { + "name": "player_number" + } + } + ] + }, + { + "base": "ServerToAuthority_DealDamageByEntityId", + "context": "NetworkTestPlayerComponent", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Server To Authority_ Deal Damage By Entity Id" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Server To Authority_ Deal Damage By Entity Id is invoked" + }, + "details": { + "name": "Server To Authority_ Deal Damage By Entity Id" }, "params": [ { @@ -121,47 +117,48 @@ { "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", "details": { - "name": "some Float" + "name": "damage" } } ] }, { - "base": "AutonomousToAuthorityNoParams", + "base": "AutonomousToAuthorityNoParamsByEntityId", "context": "NetworkTestPlayerComponent", "entry": { "name": "In", - "tooltip": "When signaled, this will invoke Autonomous To Authority No Params" + "tooltip": "When signaled, this will invoke Autonomous To Authority No Params By Entity Id" }, "exit": { "name": "Out", - "tooltip": "Signaled after Autonomous To Authority No Params is invoked" + "tooltip": "Signaled after Autonomous To Authority No Params By Entity Id is invoked" }, "details": { - "name": "Autonomous To Authority No Params" + "name": "Autonomous To Authority No Params By Entity Id" }, "params": [ { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", + "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", "details": { - "name": "Network Test Player Component" + "name": "Source", + "tooltip": "The Source containing the NetworkTestPlayerComponentController" } } ] }, { - "base": "AuthorityToAutonomous", + "base": "ServerToAuthority_DealDamage", "context": "NetworkTestPlayerComponent", "entry": { "name": "In", - "tooltip": "When signaled, this will invoke Authority To Autonomous" + "tooltip": "When signaled, this will invoke Server To Authority_ Deal Damage" }, "exit": { "name": "Out", - "tooltip": "Signaled after Authority To Autonomous is invoked" + "tooltip": "Signaled after Server To Authority_ Deal Damage is invoked" }, "details": { - "name": "Authority To Autonomous" + "name": "Server To Authority_ Deal Damage" }, "params": [ { @@ -179,18 +176,18 @@ ] }, { - "base": "AuthorityToClientNoParams", + "base": "AutonomousToAuthority", "context": "NetworkTestPlayerComponent", "entry": { "name": "In", - "tooltip": "When signaled, this will invoke Authority To Client No Params" + "tooltip": "When signaled, this will invoke Autonomous To Authority" }, "exit": { "name": "Out", - "tooltip": "Signaled after Authority To Client No Params is invoked" + "tooltip": "Signaled after Autonomous To Authority is invoked" }, "details": { - "name": "Authority To Client No Params" + "name": "Autonomous To Authority" }, "params": [ { @@ -198,6 +195,41 @@ "details": { "name": "Network Test Player Component" } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "float" + } + } + ] + }, + { + "base": "AuthorityToAutonomous_PlayerNumber", + "context": "NetworkTestPlayerComponent", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Authority To Autonomous_ Player Number" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Authority To Autonomous_ Player Number is invoked" + }, + "details": { + "name": "Authority To Autonomous_ Player Number" + }, + "params": [ + { + "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", + "details": { + "name": "Network Test Player Component" + } + }, + { + "typeid": "{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}", + "details": { + "name": "int" + } } ] }, @@ -308,79 +340,47 @@ ] }, { - "base": "AuthorityToClientNoParamsByEntityId", + "base": "AutonomousToAuthorityNoParams", "context": "NetworkTestPlayerComponent", "entry": { "name": "In", - "tooltip": "When signaled, this will invoke Authority To Client No Params By Entity Id" + "tooltip": "When signaled, this will invoke Autonomous To Authority No Params" }, "exit": { "name": "Out", - "tooltip": "Signaled after Authority To Client No Params By Entity Id is invoked" + "tooltip": "Signaled after Autonomous To Authority No Params is invoked" }, "details": { - "name": "Authority To Client No Params By Entity Id" + "name": "Autonomous To Authority No Params" }, "params": [ { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", + "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" + "name": "Network Test Player Component" } } ] }, { - "base": "AuthorityToAutonomousByEntityId", + "base": "AuthorityToClientNoParams_PlayFx", "context": "NetworkTestPlayerComponent", "entry": { "name": "In", - "tooltip": "When signaled, this will invoke Authority To Autonomous By Entity Id" + "tooltip": "When signaled, this will invoke Authority To Client No Params_ Play Fx" }, "exit": { "name": "Out", - "tooltip": "Signaled after Authority To Autonomous By Entity Id is invoked" + "tooltip": "Signaled after Authority To Client No Params_ Play Fx is invoked" }, "details": { - "name": "Authority To Autonomous By Entity Id" + "name": "Authority To Client No Params_ Play Fx" }, "params": [ { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", + "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "some Float" - } - } - ] - }, - { - "base": "AutonomousToAuthorityNoParamsByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Autonomous To Authority No Params By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Autonomous To Authority No Params By Entity Id is invoked" - }, - "details": { - "name": "Autonomous To Authority No Params By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" + "name": "Network Test Player Component" } } ] diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names b/AutomatedTesting/ScriptCanvas/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names similarity index 100% rename from Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names rename to AutomatedTesting/ScriptCanvas/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names From f20bf38f8886f9128e44c23f55f06ed70c501b04 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Sun, 23 Jan 2022 11:16:56 -0600 Subject: [PATCH 383/620] Atom Tools: Changed ME preset browser dialog into generic asset grid dialog in ATF Moving more potentially shared code out of the material editor into atom tools framework. This change consolidates the lighting preset browser, model preset browser, and the base dialogue that they shared into a single, grid based, asset selection dialog. AssetGridDialog should appear as a move and rename of PresetBrowserDialog but there are probably too many differences with new variable renames and SelectableAsset struct. Along the way I found examples showing that event bus broadcast accepted generic functions and lambdas. Used this to do a minor cleanup of the viewport settings inspector where the preset dialogs were initialized and other places that did several back to back bus calls. Signed-off-by: Guthrie Adams --- .../AssetGridDialog/AssetGridDialog.h | 69 +++++++ .../AssetGridDialog/AssetGridDialog.cpp | 179 ++++++++++++++++++ .../AssetGridDialog/AssetGridDialog.ui} | 6 +- .../Code/atomtoolsframework_files.cmake | 3 + .../LightingPresetBrowserDialog.cpp | 73 ------- .../LightingPresetBrowserDialog.h | 36 ---- .../ModelPresetBrowserDialog.cpp | 69 ------- .../ModelPresetBrowserDialog.h | 36 ---- .../PresetBrowserDialog.cpp | 133 ------------- .../PresetBrowserDialog.h | 46 ----- .../ViewportSettingsInspector.cpp | 146 ++++++++++---- .../Code/materialeditor_files.cmake | 7 - 12 files changed, 365 insertions(+), 438 deletions(-) create mode 100644 Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/AssetGridDialog/AssetGridDialog.h create mode 100644 Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetGridDialog/AssetGridDialog.cpp rename Gems/Atom/Tools/{MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.ui => AtomToolsFramework/Code/Source/AssetGridDialog/AssetGridDialog.ui} (86%) delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.cpp delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.cpp delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.cpp delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.h diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/AssetGridDialog/AssetGridDialog.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/AssetGridDialog/AssetGridDialog.h new file mode 100644 index 0000000000..afbe99a843 --- /dev/null +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/AssetGridDialog/AssetGridDialog.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#include +#endif + +#include +#include + +class QListWidgetItem; + +namespace Ui +{ + class AssetGridDialog; +} + +namespace AtomToolsFramework +{ + //! Widget for managing and selecting from a library of assets + class AssetGridDialog : public QDialog + { + Q_OBJECT + public: + struct SelectableAsset + { + AZ::Data::AssetId m_assetId; + QString m_title; + }; + + using SelectableAssetVector = AZStd::vector; + + AssetGridDialog( + const QString& title, + const SelectableAssetVector& selectableAssets, + const AZ::Data::AssetId& selectedAsset, + const QSize& tileSize, + QWidget* parent = nullptr); + + ~AssetGridDialog(); + + Q_SIGNALS: + void AssetSelected(const AZ::Data::AssetId& assetId); + + private: + AZ_DISABLE_COPY_MOVE(AssetGridDialog); + + QListWidgetItem* CreateListItem(const SelectableAsset& selectableAsset); + void SetupAssetList(); + void SetupSearchWidget(); + void SetupDialogButtons(); + void ApplySearchFilter(); + void ShowSearchMenu(const QPoint& pos); + void SelectCurrentAsset(); + void SelectInitialAsset(); + + QSize m_tileSize; + AZ::Data::AssetId m_initialSelectedAsset; + QScopedPointer m_ui; + }; +} // namespace AtomToolsFramework diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetGridDialog/AssetGridDialog.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetGridDialog/AssetGridDialog.cpp new file mode 100644 index 0000000000..ed19c4890d --- /dev/null +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetGridDialog/AssetGridDialog.cpp @@ -0,0 +1,179 @@ +/* + * 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 + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace AtomToolsFramework +{ + AssetGridDialog::AssetGridDialog( + const QString& title, + const SelectableAssetVector& selectableAssets, + const AZ::Data::AssetId& selectedAsset, + const QSize& tileSize, + QWidget* parent) + : QDialog(parent) + , m_tileSize(tileSize) + , m_initialSelectedAsset(selectedAsset) + , m_ui(new Ui::AssetGridDialog) + { + m_ui->setupUi(this); + + QSignalBlocker signalBlocker(this); + + setWindowTitle(title); + + SetupAssetList(); + SetupSearchWidget(); + SetupDialogButtons(); + setModal(true); + + QListWidgetItem* selectedItem = nullptr; + for (const auto& selectableAsset : selectableAssets) + { + QListWidgetItem* item = CreateListItem(selectableAsset); + if (!selectedItem || m_initialSelectedAsset == selectableAsset.m_assetId) + { + selectedItem = item; + } + } + + m_ui->m_assetList->sortItems(); + + if (selectedItem) + { + m_ui->m_assetList->setCurrentItem(selectedItem); + m_ui->m_assetList->scrollToItem(selectedItem); + } + } + + AssetGridDialog::~AssetGridDialog() + { + } + + QListWidgetItem* AssetGridDialog::CreateListItem(const SelectableAsset& selectableAsset) + { + const int itemBorder = aznumeric_cast( + AtomToolsFramework::GetSettingOrDefault("/O3DE/Atom/AtomToolsFramework/AssetGridDialog/ItemBorder", 4)); + const int itemSpacing = aznumeric_cast( + AtomToolsFramework::GetSettingOrDefault("/O3DE/Atom/AtomToolsFramework/AssetGridDialog/ItemSpacing", 10)); + const int headerHeight = aznumeric_cast( + AtomToolsFramework::GetSettingOrDefault("/O3DE/Atom/AtomToolsFramework/AssetGridDialog/HeaderHeight", 15)); + + const QSize gridSize = m_ui->m_assetList->gridSize(); + m_ui->m_assetList->setGridSize(QSize( + AZStd::max(gridSize.width(), m_tileSize.width() + itemSpacing), + AZStd::max(gridSize.height(), m_tileSize.height() + itemSpacing + headerHeight))); + + QListWidgetItem* item = new QListWidgetItem(m_ui->m_assetList); + item->setData(Qt::DisplayRole, selectableAsset.m_title); + item->setData(Qt::UserRole, QString(selectableAsset.m_assetId.ToString().c_str())); + item->setSizeHint(m_tileSize + QSize(itemBorder, itemBorder + headerHeight)); + m_ui->m_assetList->addItem(item); + + QWidget* itemWidget = new QWidget(m_ui->m_assetList); + itemWidget->setLayout(new QVBoxLayout(itemWidget)); + itemWidget->layout()->setSpacing(0); + itemWidget->layout()->setMargin(0); + + AzQtComponents::ElidingLabel* header = new AzQtComponents::ElidingLabel(itemWidget); + header->setText(selectableAsset.m_title); + header->setFixedSize(QSize(m_tileSize.width(), headerHeight)); + header->setMargin(0); + header->setStyleSheet("background-color: rgb(35, 35, 35)"); + AzQtComponents::Text::addPrimaryStyle(header); + AzQtComponents::Text::addLabelStyle(header); + itemWidget->layout()->addWidget(header); + + AzToolsFramework::Thumbnailer::ThumbnailWidget* thumbnail = new AzToolsFramework::Thumbnailer::ThumbnailWidget(itemWidget); + thumbnail->setFixedSize(m_tileSize); + thumbnail->SetThumbnailKey( + MAKE_TKEY(AzToolsFramework::AssetBrowser::ProductThumbnailKey, selectableAsset.m_assetId), + AzToolsFramework::Thumbnailer::ThumbnailContext::DefaultContext); + thumbnail->updateGeometry(); + itemWidget->layout()->addWidget(thumbnail); + + m_ui->m_assetList->setItemWidget(item, itemWidget); + + return item; + } + + void AssetGridDialog::SetupAssetList() + { + m_ui->m_assetList->setFlow(QListView::LeftToRight); + m_ui->m_assetList->setResizeMode(QListView::Adjust); + m_ui->m_assetList->setGridSize(QSize(0, 0)); + m_ui->m_assetList->setWrapping(true); + + QObject::connect(m_ui->m_assetList, &QListWidget::currentItemChanged, [this](){ SelectCurrentAsset(); }); + } + + void AssetGridDialog::SetupSearchWidget() + { + m_ui->m_searchWidget->setReadOnly(false); + m_ui->m_searchWidget->setContextMenuPolicy(Qt::CustomContextMenu); + AzQtComponents::LineEdit::applySearchStyle(m_ui->m_searchWidget); + connect(m_ui->m_searchWidget, &QLineEdit::textChanged, this, [this](){ ApplySearchFilter(); }); + connect(m_ui->m_searchWidget, &QWidget::customContextMenuRequested, this, [this](const QPoint& pos){ ShowSearchMenu(pos); }); + } + + void AssetGridDialog::SetupDialogButtons() + { + connect(m_ui->m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); + connect(m_ui->m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); + connect(this, &QDialog::rejected, this, [this](){ SelectInitialAsset(); }); + } + + void AssetGridDialog::ApplySearchFilter() + { + for (int index = 0; index < m_ui->m_assetList->count(); ++index) + { + QListWidgetItem* item = m_ui->m_assetList->item(index); + const QString& title = item->data(Qt::DisplayRole).toString(); + const QString filter = m_ui->m_searchWidget->text(); + item->setHidden(!filter.isEmpty() && !title.contains(filter, Qt::CaseInsensitive)); + } + } + + void AssetGridDialog::ShowSearchMenu(const QPoint& pos) + { + QScopedPointer menu(m_ui->m_searchWidget->createStandardContextMenu()); + menu->setStyleSheet("background-color: #333333"); + menu->exec(m_ui->m_searchWidget->mapToGlobal(pos)); + } + + void AssetGridDialog::SelectCurrentAsset() + { + auto item = m_ui->m_assetList->currentItem(); + if (item) + { + AZ::Data::AssetId assetId = AZ::Data::AssetId::CreateString(item->data(Qt::UserRole).toString().toUtf8().constData()); + emit AssetSelected(assetId); + } + } + + void AssetGridDialog::SelectInitialAsset() + { + emit AssetSelected(m_initialSelectedAsset); + } +} // namespace AtomToolsFramework + +#include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.ui b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetGridDialog/AssetGridDialog.ui similarity index 86% rename from Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.ui rename to Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetGridDialog/AssetGridDialog.ui index 172feb214c..e821a7443f 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.ui +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetGridDialog/AssetGridDialog.ui @@ -1,7 +1,7 @@ - PresetBrowserDialog - + AssetGridDialog + 0 @@ -26,7 +26,7 @@ - + diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake b/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake index 122e070096..db20452036 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake @@ -9,6 +9,7 @@ set(FILES Include/AtomToolsFramework/Application/AtomToolsApplication.h Include/AtomToolsFramework/AssetBrowser/AtomToolsAssetBrowser.h + Include/AtomToolsFramework/AssetGridDialog/AssetGridDialog.h Include/AtomToolsFramework/Communication/LocalServer.h Include/AtomToolsFramework/Communication/LocalSocket.h Include/AtomToolsFramework/Debug/TraceRecorder.h @@ -41,6 +42,8 @@ set(FILES Source/AssetBrowser/AtomToolsAssetBrowser.cpp Source/AssetBrowser/AtomToolsAssetBrowser.qrc Source/AssetBrowser/AtomToolsAssetBrowser.ui + Source/AssetGridDialog/AssetGridDialog.cpp + Source/AssetGridDialog/AssetGridDialog.ui Source/Communication/LocalServer.cpp Source/Communication/LocalSocket.cpp Source/Debug/TraceRecorder.cpp diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.cpp deleted file mode 100644 index cc7a851429..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.cpp +++ /dev/null @@ -1,73 +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 - * - */ - -#include -#include -#include -#include -#include -#include - -namespace MaterialEditor -{ - LightingPresetBrowserDialog::LightingPresetBrowserDialog(QWidget* parent) - : PresetBrowserDialog(parent) - { - QSignalBlocker signalBlocker(this); - - setWindowTitle("Lighting Preset Browser"); - - MaterialViewportRequestBus::BroadcastResult(m_initialPreset, &MaterialViewportRequestBus::Events::GetLightingPresetSelection); - - AZ::Render::LightingPresetPtrVector presets; - MaterialViewportRequestBus::BroadcastResult(presets, &MaterialViewportRequestBus::Events::GetLightingPresets); - AZStd::sort(presets.begin(), presets.end(), [](const auto& a, const auto& b) { return a->m_displayName < b->m_displayName; }); - - const int itemSize = aznumeric_cast( - AtomToolsFramework::GetSettingOrDefault("/O3DE/Atom/MaterialEditor/PresetBrowserDialog/LightingItemSize", 180)); - - QListWidgetItem* selectedItem = nullptr; - for (const auto& preset : presets) - { - AZStd::string path; - MaterialViewportRequestBus::BroadcastResult(path, &MaterialViewportRequestBus::Events::GetLightingPresetLastSavePath, preset); - QListWidgetItem* item = CreateListItem( - preset->m_displayName.c_str(), AZ::RPI::AssetUtils::MakeAssetId(path, 0).GetValue(), QSize(itemSize, itemSize)); - - m_listItemToPresetMap[item] = preset; - - if (m_initialPreset == preset) - { - selectedItem = item; - } - } - - if (selectedItem) - { - m_ui->m_presetList->setCurrentItem(selectedItem); - m_ui->m_presetList->scrollToItem(selectedItem); - } - } - - void LightingPresetBrowserDialog::SelectCurrentPreset() - { - auto presetItr = m_listItemToPresetMap.find(m_ui->m_presetList->currentItem()); - if (presetItr != m_listItemToPresetMap.end()) - { - MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SelectLightingPreset, presetItr->second); - } - } - - void LightingPresetBrowserDialog::SelectInitialPreset() - { - MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SelectLightingPreset, m_initialPreset); - } - -} // namespace MaterialEditor - -#include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h deleted file mode 100644 index 68b52b3a98..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h +++ /dev/null @@ -1,36 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#endif - -#include - -namespace MaterialEditor -{ - //! Widget for managing and selecting from a library of preset assets - class LightingPresetBrowserDialog : public PresetBrowserDialog - { - Q_OBJECT - public: - LightingPresetBrowserDialog(QWidget* parent = nullptr); - ~LightingPresetBrowserDialog() = default; - - private: - void SelectCurrentPreset() override; - void SelectInitialPreset() override; - - AZ::Render::LightingPresetPtr m_initialPreset; - AZStd::unordered_map m_listItemToPresetMap; - }; -} // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.cpp deleted file mode 100644 index e16b61d214..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.cpp +++ /dev/null @@ -1,69 +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 - * - */ - -#include -#include -#include -#include -#include - -namespace MaterialEditor -{ - ModelPresetBrowserDialog::ModelPresetBrowserDialog(QWidget* parent) - : PresetBrowserDialog(parent) - { - QSignalBlocker signalBlocker(this); - - setWindowTitle("Model Preset Browser"); - - MaterialViewportRequestBus::BroadcastResult(m_initialPreset, &MaterialViewportRequestBus::Events::GetModelPresetSelection); - - AZ::Render::ModelPresetPtrVector presets; - MaterialViewportRequestBus::BroadcastResult(presets, &MaterialViewportRequestBus::Events::GetModelPresets); - AZStd::sort(presets.begin(), presets.end(), [](const auto& a, const auto& b) { return a->m_displayName < b->m_displayName; }); - - const int itemSize = aznumeric_cast( - AtomToolsFramework::GetSettingOrDefault("/O3DE/Atom/MaterialEditor/PresetBrowserDialog/ModelItemSize", 90)); - - QListWidgetItem* selectedItem = nullptr; - for (const auto& preset : presets) - { - QListWidgetItem* item = CreateListItem(preset->m_displayName.c_str(), preset->m_modelAsset.GetId(), QSize(itemSize, itemSize)); - - m_listItemToPresetMap[item] = preset; - - if (m_initialPreset == preset) - { - selectedItem = item; - } - } - - if (selectedItem) - { - m_ui->m_presetList->setCurrentItem(selectedItem); - m_ui->m_presetList->scrollToItem(selectedItem); - } - } - - void ModelPresetBrowserDialog::SelectCurrentPreset() - { - auto presetItr = m_listItemToPresetMap.find(m_ui->m_presetList->currentItem()); - if (presetItr != m_listItemToPresetMap.end()) - { - MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SelectModelPreset, presetItr->second); - } - } - - void ModelPresetBrowserDialog::SelectInitialPreset() - { - MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SelectModelPreset, m_initialPreset); - } - -} // namespace MaterialEditor - -#include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h deleted file mode 100644 index a169d3053b..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h +++ /dev/null @@ -1,36 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#endif - -#include - -namespace MaterialEditor -{ - //! Widget for managing and selecting from a library of preset assets - class ModelPresetBrowserDialog : public PresetBrowserDialog - { - Q_OBJECT - public: - ModelPresetBrowserDialog(QWidget* parent = nullptr); - ~ModelPresetBrowserDialog() = default; - - private: - void SelectCurrentPreset() override; - void SelectInitialPreset() override; - - AZ::Render::ModelPresetPtr m_initialPreset; - AZStd::unordered_map m_listItemToPresetMap; - }; -} // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.cpp deleted file mode 100644 index f2bb84dff6..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.cpp +++ /dev/null @@ -1,133 +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 - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace MaterialEditor -{ - PresetBrowserDialog::PresetBrowserDialog(QWidget* parent) - : QDialog(parent) - , m_ui(new Ui::PresetBrowserDialog) - { - m_ui->setupUi(this); - - QSignalBlocker signalBlocker(this); - - SetupPresetList(); - SetupSearchWidget(); - SetupDialogButtons(); - setModal(true); - } - - void PresetBrowserDialog::SetupPresetList() - { - m_ui->m_presetList->setFlow(QListView::LeftToRight); - m_ui->m_presetList->setResizeMode(QListView::Adjust); - m_ui->m_presetList->setGridSize(QSize(0, 0)); - m_ui->m_presetList->setWrapping(true); - - QObject::connect(m_ui->m_presetList, &QListWidget::currentItemChanged, [this](){ SelectCurrentPreset(); }); - } - - QListWidgetItem* PresetBrowserDialog::CreateListItem(const QString& title, const AZ::Data::AssetId& assetId, const QSize& size) - { - const int itemBorder = aznumeric_cast( - AtomToolsFramework::GetSettingOrDefault("/O3DE/Atom/MaterialEditor/PresetBrowserDialog/ItemBorder", 4)); - const int itemSpacing = aznumeric_cast( - AtomToolsFramework::GetSettingOrDefault("/O3DE/Atom/MaterialEditor/PresetBrowserDialog/ItemSpacing", 10)); - const int headerHeight = aznumeric_cast( - AtomToolsFramework::GetSettingOrDefault("/O3DE/Atom/MaterialEditor/PresetBrowserDialog/HeaderHeight", 15)); - - const QSize gridSize = m_ui->m_presetList->gridSize(); - m_ui->m_presetList->setGridSize(QSize( - AZStd::max(gridSize.width(), size.width() + itemSpacing), - AZStd::max(gridSize.height(), size.height() + itemSpacing + headerHeight))); - - QListWidgetItem* item = new QListWidgetItem(m_ui->m_presetList); - item->setData(Qt::UserRole, title); - item->setSizeHint(size + QSize(itemBorder, itemBorder + headerHeight)); - m_ui->m_presetList->addItem(item); - - QWidget* itemWidget = new QWidget(m_ui->m_presetList); - itemWidget->setLayout(new QVBoxLayout(itemWidget)); - itemWidget->layout()->setSpacing(0); - itemWidget->layout()->setMargin(0); - - AzQtComponents::ElidingLabel* header = new AzQtComponents::ElidingLabel(itemWidget); - header->setText(title); - header->setFixedSize(QSize(size.width(), headerHeight)); - header->setMargin(0); - header->setStyleSheet("background-color: rgb(35, 35, 35)"); - AzQtComponents::Text::addPrimaryStyle(header); - AzQtComponents::Text::addLabelStyle(header); - itemWidget->layout()->addWidget(header); - - AzToolsFramework::Thumbnailer::ThumbnailWidget* thumbnail = new AzToolsFramework::Thumbnailer::ThumbnailWidget(itemWidget); - thumbnail->setFixedSize(size); - thumbnail->SetThumbnailKey( - MAKE_TKEY(AzToolsFramework::AssetBrowser::ProductThumbnailKey, assetId), - AzToolsFramework::Thumbnailer::ThumbnailContext::DefaultContext); - thumbnail->updateGeometry(); - itemWidget->layout()->addWidget(thumbnail); - - m_ui->m_presetList->setItemWidget(item, itemWidget); - - return item; - } - - void PresetBrowserDialog::SetupSearchWidget() - { - m_ui->m_searchWidget->setReadOnly(false); - m_ui->m_searchWidget->setContextMenuPolicy(Qt::CustomContextMenu); - AzQtComponents::LineEdit::applySearchStyle(m_ui->m_searchWidget); - connect(m_ui->m_searchWidget, &QLineEdit::textChanged, this, [this](){ ApplySearchFilter(); }); - connect(m_ui->m_searchWidget, &QWidget::customContextMenuRequested, this, [this](const QPoint& pos){ ShowSearchMenu(pos); }); - } - - void PresetBrowserDialog::SetupDialogButtons() - { - connect(m_ui->m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); - connect(m_ui->m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); - connect(this, &QDialog::rejected, this, [this](){ SelectInitialPreset(); }); - } - - void PresetBrowserDialog::ApplySearchFilter() - { - for (int index = 0; index < m_ui->m_presetList->count(); ++index) - { - QListWidgetItem* item = m_ui->m_presetList->item(index); - const QString& title = item->data(Qt::UserRole).toString(); - const QString filter = m_ui->m_searchWidget->text(); - item->setHidden(!filter.isEmpty() && !title.contains(filter, Qt::CaseInsensitive)); - } - } - - void PresetBrowserDialog::ShowSearchMenu(const QPoint& pos) - { - QScopedPointer menu(m_ui->m_searchWidget->createStandardContextMenu()); - menu->setStyleSheet("background-color: #333333"); - menu->exec(m_ui->m_searchWidget->mapToGlobal(pos)); - } -} // namespace MaterialEditor - -#include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.h deleted file mode 100644 index 20e049f6f8..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.h +++ /dev/null @@ -1,46 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#endif - -#include - -class QImage; -class QListWidgetItem; -class QString; - -namespace MaterialEditor -{ - //! Widget for managing and selecting from a library of preset assets - class PresetBrowserDialog : public QDialog - { - Q_OBJECT - public: - PresetBrowserDialog(QWidget* parent = nullptr); - ~PresetBrowserDialog() = default; - -protected: - void SetupPresetList(); - QListWidgetItem* CreateListItem(const QString& title, const AZ::Data::AssetId& assetId, const QSize& size); - - void SetupSearchWidget(); - void SetupDialogButtons(); - void ApplySearchFilter(); - void ShowSearchMenu(const QPoint& pos); - virtual void SelectCurrentPreset() = 0; - virtual void SelectInitialPreset() = 0; - - QScopedPointer m_ui; - }; -} // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp index 512059f1f6..dd01492031 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp @@ -6,13 +6,15 @@ * */ -#include +#include +#include +#include +#include #include #include #include +#include #include -#include -#include #include #include @@ -110,17 +112,53 @@ namespace MaterialEditor if (!savePath.empty()) { - AZ::Render::ModelPresetPtr preset; - MaterialViewportRequestBus::BroadcastResult( - preset, &MaterialViewportRequestBus::Events::AddModelPreset, AZ::Render::ModelPreset()); - MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SaveModelPreset, preset, savePath); - MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SelectModelPreset, preset); + MaterialViewportRequestBus::Broadcast( + [&savePath](MaterialViewportRequestBus::Events* viewportRequests) + { + AZ::Render::ModelPresetPtr preset = viewportRequests->AddModelPreset(AZ::Render::ModelPreset()); + viewportRequests->SaveModelPreset(preset, savePath); + viewportRequests->SelectModelPreset(preset); + }); } } void ViewportSettingsInspector::SelectModelPreset() { - ModelPresetBrowserDialog dialog(QApplication::activeWindow()); + AZ::Data::AssetId selectedAsset; + AtomToolsFramework::AssetGridDialog::SelectableAssetVector selectableAssets; + AZStd::unordered_map assetIdToPresetMap; + MaterialViewportRequestBus::Broadcast( + [&](MaterialViewportRequestBus::Events* viewportRequests) + { + const auto& selectedPreset = viewportRequests->GetModelPresetSelection(); + selectedAsset = selectedPreset->m_modelAsset.GetId(); + + const auto& presets = viewportRequests->GetModelPresets(); + selectableAssets.reserve(presets.size()); + for (const auto& preset : presets) + { + const auto& presetAssetId = preset->m_modelAsset.GetId(); + selectableAssets.push_back({ presetAssetId, preset->m_displayName.c_str() }); + assetIdToPresetMap[presetAssetId] = preset; + } + }); + + const int itemSize = aznumeric_cast( + AtomToolsFramework::GetSettingOrDefault("/O3DE/Atom/MaterialEditor/AssetGridDialog/ModelItemSize", 180)); + + AtomToolsFramework::AssetGridDialog dialog( + "Model Preset Browser", selectableAssets, selectedAsset, QSize(itemSize, itemSize), QApplication::activeWindow()); + + connect( + &dialog, &AtomToolsFramework::AssetGridDialog::AssetSelected, this, + [assetIdToPresetMap](const AZ::Data::AssetId& assetId) + { + const auto presetItr = assetIdToPresetMap.find(assetId); + if (presetItr != assetIdToPresetMap.end()) + { + MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SelectModelPreset, presetItr->second); + } + }); dialog.setFixedSize(800, 400); dialog.show(); @@ -198,17 +236,55 @@ namespace MaterialEditor if (!savePath.empty()) { - AZ::Render::LightingPresetPtr preset; - MaterialViewportRequestBus::BroadcastResult( - preset, &MaterialViewportRequestBus::Events::AddLightingPreset, AZ::Render::LightingPreset()); - MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SaveLightingPreset, preset, savePath); - MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SelectLightingPreset, preset); + MaterialViewportRequestBus::Broadcast( + [&savePath](MaterialViewportRequestBus::Events* viewportRequests) + { + AZ::Render::LightingPresetPtr preset = viewportRequests->AddLightingPreset(AZ::Render::LightingPreset()); + viewportRequests->SaveLightingPreset(preset, savePath); + viewportRequests->SelectLightingPreset(preset); + }); } } void ViewportSettingsInspector::SelectLightingPreset() { - LightingPresetBrowserDialog dialog(QApplication::activeWindow()); + AZ::Data::AssetId selectedAsset; + AtomToolsFramework::AssetGridDialog::SelectableAssetVector selectableAssets; + AZStd::unordered_map assetIdToPresetMap; + MaterialViewportRequestBus::Broadcast( + [&](MaterialViewportRequestBus::Events* viewportRequests) + { + const auto& selectedPreset = viewportRequests->GetLightingPresetSelection(); + const auto& selectedPresetPath = viewportRequests->GetLightingPresetLastSavePath(selectedPreset); + selectedAsset = AZ::RPI::AssetUtils::MakeAssetId(selectedPresetPath, 0).GetValue(); + + const auto& presets = viewportRequests->GetLightingPresets(); + selectableAssets.reserve(presets.size()); + for (const auto& preset : presets) + { + const auto& path = viewportRequests->GetLightingPresetLastSavePath(preset); + const auto& presetAssetId = AZ::RPI::AssetUtils::MakeAssetId(path, 0).GetValue(); + selectableAssets.push_back({ presetAssetId, preset->m_displayName.c_str() }); + assetIdToPresetMap[presetAssetId] = preset; + } + }); + + const int itemSize = aznumeric_cast( + AtomToolsFramework::GetSettingOrDefault("/O3DE/Atom/MaterialEditor/AssetGridDialog/LightingItemSize", 180)); + + AtomToolsFramework::AssetGridDialog dialog( + "Lighting Preset Browser", selectableAssets, selectedAsset, QSize(itemSize, itemSize), QApplication::activeWindow()); + + connect( + &dialog, &AtomToolsFramework::AssetGridDialog::AssetSelected, this, + [assetIdToPresetMap](const AZ::Data::AssetId& assetId) + { + const auto presetItr = assetIdToPresetMap.find(assetId); + if (presetItr != assetIdToPresetMap.end()) + { + MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SelectLightingPreset, presetItr->second); + } + }); dialog.setFixedSize(800, 400); dialog.show(); @@ -249,20 +325,18 @@ namespace MaterialEditor void ViewportSettingsInspector::Reset() { m_modelPreset.reset(); - MaterialViewportRequestBus::BroadcastResult(m_modelPreset, &MaterialViewportRequestBus::Events::GetModelPresetSelection); - m_lightingPreset.reset(); - MaterialViewportRequestBus::BroadcastResult(m_lightingPreset, &MaterialViewportRequestBus::Events::GetLightingPresetSelection); - - MaterialViewportRequestBus::BroadcastResult(m_viewportSettings->m_enableGrid, &MaterialViewportRequestBus::Events::GetGridEnabled); - MaterialViewportRequestBus::BroadcastResult( - m_viewportSettings->m_enableShadowCatcher, &MaterialViewportRequestBus::Events::GetShadowCatcherEnabled); - MaterialViewportRequestBus::BroadcastResult( - m_viewportSettings->m_enableAlternateSkybox, &MaterialViewportRequestBus::Events::GetAlternateSkyboxEnabled); - MaterialViewportRequestBus::BroadcastResult( - m_viewportSettings->m_fieldOfView, &MaterialViewportRequestBus::Handler::GetFieldOfView); - MaterialViewportRequestBus::BroadcastResult( - m_viewportSettings->m_displayMapperOperationType, &MaterialViewportRequestBus::Handler::GetDisplayMapperOperationType); + MaterialViewportRequestBus::Broadcast( + [this](MaterialViewportRequestBus::Events* viewportRequests) + { + m_modelPreset = viewportRequests->GetModelPresetSelection(); + m_lightingPreset = viewportRequests->GetLightingPresetSelection(); + m_viewportSettings->m_enableGrid = viewportRequests->GetGridEnabled(); + m_viewportSettings->m_enableShadowCatcher = viewportRequests->GetShadowCatcherEnabled(); + m_viewportSettings->m_enableAlternateSkybox = viewportRequests->GetAlternateSkyboxEnabled(); + m_viewportSettings->m_fieldOfView = viewportRequests->GetFieldOfView(); + m_viewportSettings->m_displayMapperOperationType = viewportRequests->GetDisplayMapperOperationType(); + }); AtomToolsFramework::InspectorRequestBus::Handler::BusDisconnect(); AtomToolsFramework::InspectorWidget::Reset(); @@ -335,14 +409,16 @@ namespace MaterialEditor { MaterialViewportNotificationBus::Broadcast(&MaterialViewportNotificationBus::Events::OnLightingPresetChanged, m_lightingPreset); MaterialViewportNotificationBus::Broadcast(&MaterialViewportNotificationBus::Events::OnModelPresetChanged, m_modelPreset); - MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SetGridEnabled, m_viewportSettings->m_enableGrid); + MaterialViewportRequestBus::Broadcast( - &MaterialViewportRequestBus::Events::SetShadowCatcherEnabled, m_viewportSettings->m_enableShadowCatcher); - MaterialViewportRequestBus::Broadcast( - &MaterialViewportRequestBus::Events::SetAlternateSkyboxEnabled, m_viewportSettings->m_enableAlternateSkybox); - MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Handler::SetFieldOfView, m_viewportSettings->m_fieldOfView); - MaterialViewportRequestBus::Broadcast( - &MaterialViewportRequestBus::Handler::SetDisplayMapperOperationType, m_viewportSettings->m_displayMapperOperationType); + [this](MaterialViewportRequestBus::Events* viewportRequests) + { + viewportRequests->SetGridEnabled(m_viewportSettings->m_enableGrid); + viewportRequests->SetShadowCatcherEnabled(m_viewportSettings->m_enableShadowCatcher); + viewportRequests->SetAlternateSkyboxEnabled(m_viewportSettings->m_enableAlternateSkybox); + viewportRequests->SetFieldOfView(m_viewportSettings->m_fieldOfView); + viewportRequests->SetDisplayMapperOperationType(m_viewportSettings->m_displayMapperOperationType); + }); } AZStd::string ViewportSettingsInspector::GetDefaultUniqueSaveFilePath(const AZStd::string& baseName) const diff --git a/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake b/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake index 9d1e2b22f8..a655fd8286 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake +++ b/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake @@ -69,13 +69,6 @@ set(FILES Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp Source/Window/CreateMaterialDialog/CreateMaterialDialog.h Source/Window/CreateMaterialDialog/CreateMaterialDialog.ui - Source/Window/PresetBrowserDialogs/PresetBrowserDialog.cpp - Source/Window/PresetBrowserDialogs/PresetBrowserDialog.h - Source/Window/PresetBrowserDialogs/PresetBrowserDialog.ui - Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.cpp - Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h - Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.cpp - Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h Source/Window/PerformanceMonitor/PerformanceMonitorWidget.cpp Source/Window/PerformanceMonitor/PerformanceMonitorWidget.h Source/Window/PerformanceMonitor/PerformanceMonitorWidget.ui From d6cf8e24f31d98c23712ded6603427d867089f13 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Sun, 23 Jan 2022 12:29:33 -0600 Subject: [PATCH 384/620] =?UTF-8?q?Atom=20Tools:=20Replaced=20custom=20hel?= =?UTF-8?q?p=20dialog=20with=20generic=20message=20box=20The=20help=20dial?= =?UTF-8?q?og=20just=20displayed=20some=20HTML=20text.=20The=20message=20b?= =?UTF-8?q?ox=20class=20provided=20by=20Qt=20can=20display=20the=20same=20?= =?UTF-8?q?information=20and=20styling=20without=20additional=20code.=20We?= =?UTF-8?q?=20don=E2=80=99t=20want=20to=20carry=20around=20the=20extra=20c?= =?UTF-8?q?lass=20to=20new=20applications=20based=20off=20of=20this=20one?= =?UTF-8?q?=20or=20port=20to=20ATF.=20A=20simple=20about=20box=20was=20als?= =?UTF-8?q?o=20added=20and=20can=20be=20fleshed=20out=20in=20the=20future.?= =?UTF-8?q?=20Both=20dialogs=20will=20eventually=20need=20to=20be=20update?= =?UTF-8?q?d=20with=20additional=20information.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guthrie Adams --- .../Source/Window/HelpDialog/HelpDialog.cpp | 23 ------ .../Source/Window/HelpDialog/HelpDialog.h | 38 ---------- .../Source/Window/HelpDialog/HelpDialog.ui | 71 ------------------- .../Source/Window/MaterialEditorWindow.cpp | 20 +++++- .../Code/Source/Window/MaterialEditorWindow.h | 1 + .../Code/materialeditor_files.cmake | 3 - 6 files changed, 18 insertions(+), 138 deletions(-) delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.cpp delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.h delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.ui diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.cpp deleted file mode 100644 index 3e8cf19539..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.cpp +++ /dev/null @@ -1,23 +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 - * - */ - -#include - -namespace MaterialEditor -{ - HelpDialog::HelpDialog(QWidget* parent) - : QDialog(parent) - , m_ui(new Ui::HelpDialogWidget) - { - m_ui->setupUi(this); - } - - HelpDialog::~HelpDialog() = default; -} // namespace MaterialEditor - -#include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.h deleted file mode 100644 index ec5b756df4..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.h +++ /dev/null @@ -1,38 +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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include - -AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT -#include -#include -AZ_POP_DISABLE_WARNING -#endif - -namespace Ui -{ - class HelpDialogWidget; -} - -namespace MaterialEditor -{ - //! Displays help for Material Editor - class HelpDialog - : public QDialog - { - Q_OBJECT - public: - HelpDialog(QWidget* parent = nullptr); - ~HelpDialog(); - - QScopedPointer m_ui; - }; -} // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.ui b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.ui deleted file mode 100644 index 2a2cb06bb2..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.ui +++ /dev/null @@ -1,71 +0,0 @@ - - - HelpDialogWidget - - - - 0 - 0 - 270 - 210 - - - - Material Editor Help - - - - - - <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Material Editor Controls</span></p><p><span style=" font-weight:600;">LMB</span> - pan camera</p><p><span style=" font-weight:600;">RMB</span> or <span style=" font-weight:600;">Alt+LMB</span> - orbit camera around target</p><p><span style=" font-weight:600;">MMB</span> or <span style=" font-weight:600;">Alt+MMB</span> - move camera on its xy plane</p><p><span style=" font-weight:600;">Alt+RMB</span> or <span style=" font-weight:600;">LMB+RMB</span> - dolly camera on its z axis</p><p><span style=" font-weight:600;">Ctrl+LMB</span> - rotate model</p><p><span style=" font-weight:600;">Shift+LMB</span> - rotate environment</p></body></html> - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close - - - - - - - - - buttonBox - accepted() - HelpDialogWidget - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - HelpDialogWidget - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp index e1f8e713d4..d538f62e15 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -30,6 +29,7 @@ AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnin #include #include #include +#include #include #include AZ_POP_DISABLE_WARNING @@ -178,8 +178,22 @@ namespace MaterialEditor void MaterialEditorWindow::OpenHelp() { - HelpDialog dialog(this); - dialog.exec(); + QMessageBox::information( + this, windowTitle(), + R"( +

Material Editor Controls

+

LMB - pan camera

+

RMB or Alt+LMB - orbit camera around target

+

MMB or Alt+MMB - move camera on its xy plane

+

Alt+RMB or LMB+RMB - dolly camera on its z axis

+

Ctrl+LMB - rotate model

+

Shift+LMB - rotate environment

+ )"); + } + + void MaterialEditorWindow::OpenAbout() + { + QMessageBox::about(this, windowTitle(), QApplication::applicationName()); } void MaterialEditorWindow::closeEvent(QCloseEvent* closeEvent) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h index 8ad294c529..8317382d6d 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h @@ -44,6 +44,7 @@ namespace MaterialEditor bool GetOpenDocumentParams(AZStd::string& openPath) override; void OpenSettings() override; void OpenHelp() override; + void OpenAbout() override; void closeEvent(QCloseEvent* closeEvent) override; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake b/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake index 9d1e2b22f8..262f27d854 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake +++ b/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake @@ -89,7 +89,4 @@ set(FILES Source/Window/MaterialInspector/MaterialInspector.cpp Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.h Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp - Source/Window/HelpDialog/HelpDialog.h - Source/Window/HelpDialog/HelpDialog.cpp - Source/Window/HelpDialog/HelpDialog.ui ) From 0a5f472f4331d5a310e55ac8b9d5dabdc491d079 Mon Sep 17 00:00:00 2001 From: Daniel Edwards Date: Sat, 22 Jan 2022 14:36:20 +0100 Subject: [PATCH 385/620] Clang 13: Fix build errors ... ... due to local variables only being written to (but never read). Signed-off-by: Daniel Edwards --- Code/Editor/EditorPreferencesPageAWS.cpp | 2 +- Code/Editor/Settings.cpp | 2 +- Code/Editor/ViewPane.cpp | 2 +- Code/Framework/AzCore/AzCore/Math/Matrix3x4.cpp | 6 +++--- Code/Framework/AzCore/AzCore/Math/Uuid.cpp | 2 +- Code/Framework/AzCore/AzCore/Name/NameDictionary.cpp | 2 +- Code/Framework/AzCore/Tests/Name/NameTests.cpp | 2 +- .../AzFramework/Asset/Benchmark/BenchmarkCommands.cpp | 2 +- Code/Framework/AzFramework/Tests/CameraState.cpp | 2 +- .../AzQtComponents/Components/StylesheetPreprocessor.cpp | 2 +- .../AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp | 2 +- .../AzToolsFramework/Prefab/PrefabSystemComponent.cpp | 4 ++-- .../AzToolsFramework/Slice/SliceTransaction.cpp | 2 +- .../UI/PropertyEditor/PropertyEnumComboBoxCtrl.cpp | 2 +- Code/Framework/AzToolsFramework/Tests/Slices.cpp | 2 +- Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp | 4 ++-- .../native/utilities/ApplicationManagerBase.cpp | 2 +- .../AssetProcessor/native/utilities/BuilderManager.inl | 2 +- Code/Tools/ProjectManager/Source/Settings.cpp | 2 +- Code/Tools/SceneAPI/SceneBuilder/Tests/TestsMain.cpp | 2 +- .../Source/Editor/Attribution/AWSCoreAttributionManager.cpp | 2 +- .../AssetValidation/Code/Source/AssetSystemTestCommands.cpp | 6 +++--- .../DiffuseProbeGridFeatureProcessor.cpp | 2 +- .../Code/Source/RayTracing/RayTracingFeatureProcessor.cpp | 2 +- .../ReflectionProbe/ReflectionProbeFeatureProcessor.cpp | 2 +- Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp | 2 +- Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingBlas.cpp | 2 +- .../RHI/Vulkan/Code/Source/RHI/RayTracingPipelineState.cpp | 2 +- .../RHI/Vulkan/Code/Source/RHI/RayTracingShaderTable.cpp | 2 +- Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.cpp | 4 ++-- Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp | 2 +- Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp | 2 +- Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp | 2 +- Gems/EMotionFX/Code/EMotionFX/Source/Recorder.cpp | 2 +- Gems/GraphModel/Code/Source/Model/Node.cpp | 2 +- Gems/GraphModel/Code/Source/Model/Slot.cpp | 2 +- .../LyShine/Code/Editor/PropertyHandlerEntityIdComboBox.cpp | 2 +- .../EntityReplication/EntityReplicationManager.cpp | 2 +- .../Components/ClothComponentMesh/ActorClothColliders.cpp | 4 ++-- .../Source/PhysXCharacters/Components/RagdollComponent.cpp | 2 +- .../NodePalette/ScriptEventsNodePaletteTreeItemTypes.cpp | 2 +- .../Code/Source/TerrainRenderer/TerrainMeshManager.cpp | 2 +- 42 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Code/Editor/EditorPreferencesPageAWS.cpp b/Code/Editor/EditorPreferencesPageAWS.cpp index 9279dce7bc..968969245d 100644 --- a/Code/Editor/EditorPreferencesPageAWS.cpp +++ b/Code/Editor/EditorPreferencesPageAWS.cpp @@ -101,7 +101,7 @@ void CEditorPreferencesPage_AWS::SaveSettingsRegistryFile() return; } - bool saved{}; + [[maybe_unused]] bool saved{}; constexpr auto configurationMode = AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY; if (AZ::IO::SystemFile outputFile; outputFile.Open(resolvedPath.data(), configurationMode)) diff --git a/Code/Editor/Settings.cpp b/Code/Editor/Settings.cpp index 8561e6dba3..9514957795 100644 --- a/Code/Editor/Settings.cpp +++ b/Code/Editor/Settings.cpp @@ -1128,7 +1128,7 @@ void SEditorSettings::SaveSettingsRegistryFile() return; } - bool saved{}; + [[maybe_unused]] bool saved{}; constexpr auto configurationMode = AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY; diff --git a/Code/Editor/ViewPane.cpp b/Code/Editor/ViewPane.cpp index e3494a4049..90b44d9c9d 100644 --- a/Code/Editor/ViewPane.cpp +++ b/Code/Editor/ViewPane.cpp @@ -745,7 +745,7 @@ namespace void PySetActiveViewport(unsigned int viewportIndex) { - bool success = false; + [[maybe_unused]] bool success = false; CLayoutWnd* layout = GetIEditor()->GetViewManager()->GetLayout(); if (layout) { diff --git a/Code/Framework/AzCore/AzCore/Math/Matrix3x4.cpp b/Code/Framework/AzCore/AzCore/Math/Matrix3x4.cpp index 78da9e76d2..23d0eea618 100644 --- a/Code/Framework/AzCore/AzCore/Math/Matrix3x4.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Matrix3x4.cpp @@ -25,7 +25,7 @@ namespace AZ void Matrix3x4SetRowGeneric(Matrix3x4* thisPtr, ScriptDataContext& dc) { - bool rowIsSet = false; + [[maybe_unused]] bool rowIsSet = false; if (dc.GetNumArguments() >= 5) { if (dc.IsNumber(0)) @@ -88,7 +88,7 @@ namespace AZ void Matrix3x4SetColumnGeneric(Matrix3x4* thisPtr, ScriptDataContext& dc) { - bool columnIsSet = false; + [[maybe_unused]] bool columnIsSet = false; if (dc.GetNumArguments() >= 4) { if (dc.IsNumber(0)) @@ -133,7 +133,7 @@ namespace AZ void Matrix3x4SetTranslationGeneric(Matrix3x4* thisPtr, ScriptDataContext& dc) { - bool translationIsSet = false; + [[maybe_unused]] bool translationIsSet = false; if (dc.GetNumArguments() == 3 && dc.IsNumber(0) && diff --git a/Code/Framework/AzCore/AzCore/Math/Uuid.cpp b/Code/Framework/AzCore/AzCore/Math/Uuid.cpp index 410d235a37..b27f1a0943 100644 --- a/Code/Framework/AzCore/AzCore/Math/Uuid.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Uuid.cpp @@ -77,7 +77,7 @@ namespace AZ // check open brace char c = *current++; - bool has_open_brace = false; + [[maybe_unused]] bool has_open_brace = false; if (c == '{') { c = *current++; diff --git a/Code/Framework/AzCore/AzCore/Name/NameDictionary.cpp b/Code/Framework/AzCore/AzCore/Name/NameDictionary.cpp index 1b39eb81bd..2bb4faf1d5 100644 --- a/Code/Framework/AzCore/AzCore/Name/NameDictionary.cpp +++ b/Code/Framework/AzCore/AzCore/Name/NameDictionary.cpp @@ -85,7 +85,7 @@ namespace AZ NameDictionary::~NameDictionary() { - bool leaksDetected = false; + [[maybe_unused]] bool leaksDetected = false; for (const auto& keyValue : m_dictionary) { diff --git a/Code/Framework/AzCore/Tests/Name/NameTests.cpp b/Code/Framework/AzCore/Tests/Name/NameTests.cpp index eb0a048e2f..9e94c4bfdf 100644 --- a/Code/Framework/AzCore/Tests/Name/NameTests.cpp +++ b/Code/Framework/AzCore/Tests/Name/NameTests.cpp @@ -642,7 +642,7 @@ namespace UnitTest char buffer[RandomStringBufferSize]; AZStd::sys_time_t newNameTime; - AZStd::sys_time_t existingNameTime; + [[maybe_unused]] AZStd::sys_time_t existingNameTime; AZStd::sys_time_t stringTime; { diff --git a/Code/Framework/AzFramework/AzFramework/Asset/Benchmark/BenchmarkCommands.cpp b/Code/Framework/AzFramework/AzFramework/Asset/Benchmark/BenchmarkCommands.cpp index 30c1aa39c0..2c2571ec76 100644 --- a/Code/Framework/AzFramework/AzFramework/Asset/Benchmark/BenchmarkCommands.cpp +++ b/Code/Framework/AzFramework/AzFramework/Asset/Benchmark/BenchmarkCommands.cpp @@ -195,7 +195,7 @@ namespace AzFramework::AssetBenchmark // Console command: Add the given list of assets to the list of assets to load with BenchmarkLoadAssetList void BenchmarkAddAssetsToList(const AZ::ConsoleCommandContainer& parameters) { - bool allAssetsAdded = true; + [[maybe_unused]] bool allAssetsAdded = true; for (auto& assetName : parameters) { diff --git a/Code/Framework/AzFramework/Tests/CameraState.cpp b/Code/Framework/AzFramework/Tests/CameraState.cpp index 1f35d5a06c..974b5dd742 100644 --- a/Code/Framework/AzFramework/Tests/CameraState.cpp +++ b/Code/Framework/AzFramework/Tests/CameraState.cpp @@ -81,7 +81,7 @@ namespace UnitTest TEST_P(Rotation, Permutation) { - int expectedErrors = -1; + [[maybe_unused]] int expectedErrors = -1; AZ_TEST_START_TRACE_SUPPRESSION; // Given an orientation derived from the look at points diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/StylesheetPreprocessor.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/StylesheetPreprocessor.cpp index c334bbb59a..2602ecf535 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/StylesheetPreprocessor.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/StylesheetPreprocessor.cpp @@ -134,7 +134,7 @@ namespace AzQtComponents QColor color; QString colorName(m_namedVariables.value(name)); - bool colorSet = false; + [[maybe_unused]] bool colorSet = false; if (QColor::isValidColor(colorName)) { color.setNamedColor(colorName); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp index 5711ca2608..4aab7288fa 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp @@ -177,7 +177,7 @@ namespace AzToolsFramework auto data = index.data(AssetBrowserModel::Roles::EntryRole); if (data.canConvert()) { - bool isEnabled = (option.state & QStyle::State_Enabled) != 0; + [[maybe_unused]] bool isEnabled = (option.state & QStyle::State_Enabled) != 0; QStyle* style = option.widget ? option.widget->style() : QApplication::style(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp index 98e0144f22..9648a9af09 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp @@ -506,7 +506,7 @@ namespace AzToolsFramework //Remove all Links owned by the Template from TemplateToLinkIdsMap. Template& templateToDelete = findTemplateResult->get(); const Template::Links& linkIdsToDelete = templateToDelete.GetLinks(); - bool result; + [[maybe_unused]] bool result; for (auto linkId : linkIdsToDelete) { result = RemoveLinkIdFromTemplateToLinkIdsMap(linkId); @@ -774,7 +774,7 @@ namespace AzToolsFramework } Link& link = findLinkResult->get(); - bool result; + [[maybe_unused]] bool result; result = RemoveLinkIdFromTemplateToLinkIdsMap(linkId, link); AZ_Assert(result, "Prefab - PrefabSystemComponent::RemoveLink - " diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceTransaction.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceTransaction.cpp index 9d2c58a717..91517bd784 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceTransaction.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceTransaction.cpp @@ -926,7 +926,7 @@ namespace AzToolsFramework const bool entityIsFromIgnoredSliceInstance = ignoreSliceInstance && ignoreSliceInstance->IsValid() && ignoreSliceInstance->GetReference()->GetSliceAsset().GetId() == instanceAddr.GetReference()->GetSliceAsset().GetId(); if (!entityIsFromIgnoredSliceInstance) { - bool foundTargetAncestor = false; + [[maybe_unused]] bool foundTargetAncestor = false; const AZ::SliceComponent::EntityList& entitiesInInstance = instanceAddr.GetInstance()->GetInstantiated()->m_entities; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEnumComboBoxCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEnumComboBoxCtrl.cpp index f49b555dfe..f37fd860ea 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEnumComboBoxCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEnumComboBoxCtrl.cpp @@ -45,7 +45,7 @@ namespace AzToolsFramework void PropertyEnumComboBoxCtrl::setValue(AZ::s64 value) { m_pComboBox->blockSignals(true); - bool indexWasFound = false; + [[maybe_unused]] bool indexWasFound = false; for (size_t enumValIndex = 0; enumValIndex < m_enumValues.size(); enumValIndex++) { if (m_enumValues[enumValIndex].first == value) diff --git a/Code/Framework/AzToolsFramework/Tests/Slices.cpp b/Code/Framework/AzToolsFramework/Tests/Slices.cpp index 9b546357cd..bf59e1f8bd 100644 --- a/Code/Framework/AzToolsFramework/Tests/Slices.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Slices.cpp @@ -430,7 +430,7 @@ namespace UnitTest size_t nextIndex = 1; size_t slices = 0; size_t liveAllocs = 0; - size_t totalAllocs = 0; + [[maybe_unused]] size_t totalAllocs = 0; auto cb = [&liveAllocs](void*, const AZ::Debug::AllocationInfo&, unsigned char) { diff --git a/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp b/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp index 2724bee1a7..9d88f26278 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp +++ b/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp @@ -1952,8 +1952,8 @@ CarrierThread::ProcessConnections() bool isHandshakeTimeOut = false; bool isConnectionTimeout = false; - bool isBadTrafficConditions = false; - bool isBadPackets = false; + [[maybe_unused]] bool isBadTrafficConditions = false; + [[maybe_unused]] bool isBadPackets = false; if (connection->m_isBadPackets) { isBadPackets = true; diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index 36450c4e65..634fdbd3bb 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -544,7 +544,7 @@ void ApplicationManagerBase::InitConnectionManager() EBUS_EVENT(AssetProcessor::ConnectionBus, SendPerPlatform, 0, message, QString::fromUtf8(message.m_platform.c_str())); }; - bool result = QObject::connect(GetAssetCatalog(), &AssetProcessor::AssetCatalog::SendAssetMessage, connectionAndChangeMessagesThreadContext, forwardMessageFunction, Qt::QueuedConnection); + [[maybe_unused]] bool result = QObject::connect(GetAssetCatalog(), &AssetProcessor::AssetCatalog::SendAssetMessage, connectionAndChangeMessagesThreadContext, forwardMessageFunction, Qt::QueuedConnection); AZ_Assert(result, "Failed to connect to AssetCatalog signal"); //Application manager related stuff diff --git a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.inl b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.inl index 039680dfae..4d1983691a 100644 --- a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.inl +++ b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.inl @@ -19,7 +19,7 @@ namespace AssetProcessor TNetResponse netResponse; netRequest.m_request = request; - AZ::u32 type; + [[maybe_unused]] AZ::u32 type; QByteArray data; AZStd::binary_semaphore wait; diff --git a/Code/Tools/ProjectManager/Source/Settings.cpp b/Code/Tools/ProjectManager/Source/Settings.cpp index 0a8b600dd9..78100848b5 100644 --- a/Code/Tools/ProjectManager/Source/Settings.cpp +++ b/Code/Tools/ProjectManager/Source/Settings.cpp @@ -41,7 +41,7 @@ namespace O3DE::ProjectManager o3deUserPath /= AZ::SettingsRegistryInterface::RegistryFolder; o3deUserPath /= "ProjectManager.setreg"; - bool saved = false; + [[maybe_unused]] bool saved = false; constexpr auto configurationMode = AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY; diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestsMain.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestsMain.cpp index 5c0d2503c0..2b7497951f 100644 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestsMain.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestsMain.cpp @@ -25,7 +25,7 @@ protected: sceneCoreModule = AZ::DynamicModuleHandle::Create("SceneCore"); AZ_Assert(sceneCoreModule, "SceneBuilder unit tests failed to create SceneCore module."); - bool loaded = sceneCoreModule->Load(false); + [[maybe_unused]] bool loaded = sceneCoreModule->Load(false); AZ_Assert(loaded, "SceneBuilder unit tests failed to load SceneCore module."); auto init = sceneCoreModule->GetFunction(AZ::InitializeDynamicModuleFunctionName); AZ_Assert(init, "SceneBuilder unit tests failed to find the initialization function the SceneCore module."); diff --git a/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp b/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp index 3b9352d250..c52d3be088 100644 --- a/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp +++ b/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp @@ -223,7 +223,7 @@ namespace AWSCore return; } - bool saved {}; + [[maybe_unused]] bool saved {}; constexpr auto configurationMode = AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY; if (AZ::IO::SystemFile outputFile; outputFile.Open(resolvedPathAWSPreference.c_str(), configurationMode)) diff --git a/Gems/AssetValidation/Code/Source/AssetSystemTestCommands.cpp b/Gems/AssetValidation/Code/Source/AssetSystemTestCommands.cpp index 18888c7166..2007ac01a9 100644 --- a/Gems/AssetValidation/Code/Source/AssetSystemTestCommands.cpp +++ b/Gems/AssetValidation/Code/Source/AssetSystemTestCommands.cpp @@ -120,9 +120,9 @@ namespace AssetValidation AZ::SimpleLcgRandom randomizer(seedValue); int lastTick = 0; AZStd::vector> heldAssets; - AZStd::size_t heldCount{ 0 }; - AZ::u64 changeCount{ 0 }; - AZ::u64 blockCount{ 0 }; + [[maybe_unused]] AZStd::size_t heldCount{ 0 }; + [[maybe_unused]] AZ::u64 changeCount{ 0 }; + [[maybe_unused]] AZ::u64 blockCount{ 0 }; AZ_TracePrintf("TestChangeAssets", "Beginning run with %zu assets\n", assetList.size()); while (!forceStop && runMs < runTime) { diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp index ea02a8e0a2..d690c57dea 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp @@ -537,7 +537,7 @@ namespace AZ request.m_buffer = m_boxIndexBuffer.get(); request.m_descriptor = AZ::RHI::BufferDescriptor{ AZ::RHI::BufferBindFlags::InputAssembly, m_boxIndices.size() * sizeof(uint16_t) }; request.m_initialData = m_boxIndices.data(); - AZ::RHI::ResultCode result = m_bufferPool->InitBuffer(request); + [[maybe_unused]] AZ::RHI::ResultCode result = m_bufferPool->InitBuffer(request); AZ_Error("DiffuseProbeGridFeatureProcessor", result == RHI::ResultCode::Success, "Failed to initialize box index buffer - error [%d]", result); // create index buffer view diff --git a/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp index 0a9782980f..f5c1be284e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp @@ -123,7 +123,7 @@ namespace AZ // create the BLAS buffers for each sub-mesh, or re-use existing BLAS objects if they were already created. // Note: all sub-meshes must either create new BLAS objects or re-use existing ones, otherwise it's an error (it's the same model in both cases) // Note: the buffer is just reserved here, the BLAS is built in the RayTracingAccelerationStructurePass - bool blasInstanceFound = false; + [[maybe_unused]] bool blasInstanceFound = false; for (uint32_t subMeshIndex = 0; subMeshIndex < mesh.m_subMeshes.size(); ++subMeshIndex) { SubMesh& subMesh = mesh.m_subMeshes[subMeshIndex]; diff --git a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp index 0f9356428a..3ff574d977 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp @@ -397,7 +397,7 @@ namespace AZ request.m_buffer = m_boxIndexBuffer.get(); request.m_descriptor = AZ::RHI::BufferDescriptor{ AZ::RHI::BufferBindFlags::InputAssembly, m_boxIndices.size() * sizeof(uint16_t) }; request.m_initialData = m_boxIndices.data(); - AZ::RHI::ResultCode result = m_bufferPool->InitBuffer(request); + [[maybe_unused]] AZ::RHI::ResultCode result = m_bufferPool->InitBuffer(request); AZ_Error("ReflectionProbeFeatureProcessor", result == RHI::ResultCode::Success, "Failed to initialize box index buffer - error [%d]", result); // create index buffer view diff --git a/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp b/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp index 79c05c37da..3279372052 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp @@ -364,7 +364,7 @@ namespace AZ AZ_Assert(success, "PipelineStateEntry already exists in the pending cache."); } - ResultCode resultCode = ResultCode::InvalidArgument; + [[maybe_unused]] ResultCode resultCode = ResultCode::InvalidArgument; // Increment the pending compile count on the global entry, which tracks how many pipeline states // are currently being compiled across all threads. diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingBlas.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingBlas.cpp index a322380fb1..e4a90d0739 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingBlas.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingBlas.cpp @@ -120,7 +120,7 @@ namespace AZ AZ::RHI::BufferInitRequest scratchBufferRequest; scratchBufferRequest.m_buffer = buffers.m_scratchBuffer.get(); scratchBufferRequest.m_descriptor = scratchBufferDescriptor; - RHI::ResultCode resultCode = bufferPools.GetScratchBufferPool()->InitBuffer(scratchBufferRequest); + [[maybe_unused]] RHI::ResultCode resultCode = bufferPools.GetScratchBufferPool()->InitBuffer(scratchBufferRequest); AZ_Assert(resultCode == RHI::ResultCode::Success, "failed to create BLAS scratch buffer"); BufferMemoryView* scratchMemoryView = static_cast(buffers.m_scratchBuffer.get())->GetBufferMemoryView(); diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingPipelineState.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingPipelineState.cpp index 65281d923f..bddfb0df5e 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingPipelineState.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingPipelineState.cpp @@ -170,7 +170,7 @@ namespace AZ createInfo.basePipelineHandle = nullptr; createInfo.basePipelineIndex = 0; - VkResult result = vkCreateRayTracingPipelinesKHR(device.GetNativeDevice(), nullptr, nullptr, 1, &createInfo, nullptr, &m_pipeline); + [[maybe_unused]] VkResult result = vkCreateRayTracingPipelinesKHR(device.GetNativeDevice(), nullptr, nullptr, 1, &createInfo, nullptr, &m_pipeline); AZ_Assert(result == VK_SUCCESS, "vkCreateRayTracingPipelinesKHR failed"); // retrieve the shader handles diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingShaderTable.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingShaderTable.cpp index d5ef121875..5e820a18ba 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingShaderTable.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingShaderTable.cpp @@ -43,7 +43,7 @@ namespace AZ AZ::RHI::BufferInitRequest shaderTableBufferRequest; shaderTableBufferRequest.m_buffer = shaderTableBuffer.get(); shaderTableBufferRequest.m_descriptor = shaderTableBufferDescriptor; - RHI::ResultCode resultCode = bufferPools.GetShaderTableBufferPool()->InitBuffer(shaderTableBufferRequest); + [[maybe_unused]] RHI::ResultCode resultCode = bufferPools.GetShaderTableBufferPool()->InitBuffer(shaderTableBufferRequest); AZ_Assert(resultCode == RHI::ResultCode::Success, "failed to create shader table buffer"); BufferMemoryView* shaderTableMemoryView = static_cast(shaderTableBuffer.get())->GetBufferMemoryView(); diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.cpp index 9ea9ceccce..08b933c96b 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.cpp @@ -66,7 +66,7 @@ namespace AZ AZ::RHI::BufferInitRequest tlasInstancesBufferRequest; tlasInstancesBufferRequest.m_buffer = buffers.m_tlasInstancesBuffer.get(); tlasInstancesBufferRequest.m_descriptor = tlasInstancesBufferDescriptor; - RHI::ResultCode resultCode = bufferPools.GetTlasInstancesBufferPool()->InitBuffer(tlasInstancesBufferRequest); + [[maybe_unused]] RHI::ResultCode resultCode = bufferPools.GetTlasInstancesBufferPool()->InitBuffer(tlasInstancesBufferRequest); AZ_Assert(resultCode == RHI::ResultCode::Success, "failed to create TLAS instances buffer"); BufferMemoryView* tlasInstancesMemoryView = static_cast(buffers.m_tlasInstancesBuffer.get())->GetBufferMemoryView(); @@ -160,7 +160,7 @@ namespace AZ AZ::RHI::BufferInitRequest scratchBufferRequest; scratchBufferRequest.m_buffer = buffers.m_scratchBuffer.get(); scratchBufferRequest.m_descriptor = scratchBufferDescriptor; - RHI::ResultCode resultCode = bufferPools.GetScratchBufferPool()->InitBuffer(scratchBufferRequest); + [[maybe_unused]] RHI::ResultCode resultCode = bufferPools.GetScratchBufferPool()->InitBuffer(scratchBufferRequest); AZ_Assert(resultCode == RHI::ResultCode::Success, "failed to create TLAS scratch buffer"); BufferMemoryView* scratchMemoryView = static_cast(buffers.m_scratchBuffer.get())->GetBufferMemoryView(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp index bd196a2e2b..41cfb5ff12 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp @@ -312,7 +312,7 @@ namespace AZ const View::UsageFlags viewFlags = worklistData->m_view->GetUsageFlags(); const RHI::DrawListMask drawListMask = worklistData->m_view->GetDrawListMask(); - uint32_t numDrawPackets = 0; + [[maybe_unused]] uint32_t numDrawPackets = 0; uint32_t numVisibleCullables = 0; AZ_Assert(worklist.size() > 0, "Received empty worklist in ProcessWorklist"); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp index 1b5110e327..83ac77a390 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp @@ -322,7 +322,7 @@ namespace AZ void Scene::RemoveRenderPipeline(const RenderPipelineId& pipelineId) { - bool removed = false; + [[maybe_unused]] bool removed = false; for (auto it = m_pipelines.begin(); it != m_pipelines.end(); ++it) { if (pipelineId == (*it)->GetId()) diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp index 9130636e2a..72d574508f 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp @@ -123,7 +123,7 @@ namespace EMotionFX TargetType* targetBuffer = static_cast(targetVertexAttributeLayer->GetData()); // Fill the vertex attribute layer by iterating through the Atom meshes and copying over the vertex data for each. - size_t addedElements = 0; + [[maybe_unused]] size_t addedElements = 0; for (const AZ::RPI::ModelLodAsset::Mesh& atomMesh : sourceModelLod->GetMeshes()) { const uint32_t atomMeshVertexCount = atomMesh.GetVertexCount(); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Recorder.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Recorder.cpp index 54fb130ad3..116026e8c1 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Recorder.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Recorder.cpp @@ -863,7 +863,7 @@ namespace EMotionFX } // process all objects for this frame - size_t totalBytesRead = 0; + [[maybe_unused]] size_t totalBytesRead = 0; const size_t numObjects = frameObjects.size(); for (size_t a = 0; a < numObjects; ++a) { diff --git a/Gems/GraphModel/Code/Source/Model/Node.cpp b/Gems/GraphModel/Code/Source/Model/Node.cpp index f51bd1f617..e55b7c05a4 100644 --- a/Gems/GraphModel/Code/Source/Model/Node.cpp +++ b/Gems/GraphModel/Code/Source/Model/Node.cpp @@ -68,7 +68,7 @@ namespace GraphModel CreateSlotData(m_inputEventSlots, m_inputEventSlotDefinitions); CreateSlotData(m_outputEventSlots, m_outputEventSlotDefinitions); - int numExtendableSlots = 0; + [[maybe_unused]] int numExtendableSlots = 0; for (auto it = m_extendableSlots.begin(); it != m_extendableSlots.end(); it++) { numExtendableSlots += aznumeric_cast(it->second.size()); diff --git a/Gems/GraphModel/Code/Source/Model/Slot.cpp b/Gems/GraphModel/Code/Source/Model/Slot.cpp index 08b52760cb..108067cc93 100644 --- a/Gems/GraphModel/Code/Source/Model/Slot.cpp +++ b/Gems/GraphModel/Code/Source/Model/Slot.cpp @@ -491,7 +491,7 @@ namespace GraphModel // multiple supported types, Slot::GetDataType() will call GetParentNode() // to try and resolve its type, which will be a nullptr at this point // because the parent won't be valid yet - bool valueTypeSupported = false; + [[maybe_unused]] bool valueTypeSupported = false; DataTypePtr valueDataType = GetGraphContext()->GetDataTypeForValue(m_value); for (DataTypePtr dataType : GetSupportedDataTypes()) { diff --git a/Gems/LyShine/Code/Editor/PropertyHandlerEntityIdComboBox.cpp b/Gems/LyShine/Code/Editor/PropertyHandlerEntityIdComboBox.cpp index 9bb98dd575..809803c3a7 100644 --- a/Gems/LyShine/Code/Editor/PropertyHandlerEntityIdComboBox.cpp +++ b/Gems/LyShine/Code/Editor/PropertyHandlerEntityIdComboBox.cpp @@ -156,7 +156,7 @@ PropertyEntityIdComboBoxCtrl::PropertyEntityIdComboBoxCtrl(QWidget* pParent) void PropertyEntityIdComboBoxCtrl::setValue(AZ::EntityId value) { m_pComboBox->blockSignals(true); - bool indexWasFound = false; + [[maybe_unused]] bool indexWasFound = false; for (size_t enumValIndex = 0; enumValIndex < m_enumValues.size(); enumValIndex++) { if (m_enumValues[enumValIndex].first == value) diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp index e095af4ae7..893799a296 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp @@ -1126,7 +1126,7 @@ namespace Multiplayer netBindComponent->NotifyServerMigration(GetRemoteHostId()); } - bool didSucceed = true; + [[maybe_unused]] bool didSucceed = true; EntityMigrationMessage message; message.m_netEntityId = replicator->GetEntityHandle().GetNetEntityId(); message.m_prefabEntityId = netBindComponent->GetPrefabEntityId(); diff --git a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.cpp b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.cpp index 1e57999b6e..cde8740694 100644 --- a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.cpp +++ b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.cpp @@ -72,8 +72,8 @@ namespace NvCloth // Maximum number of spheres and capsules is imposed by NvCloth library size_t sphereCount = 0; size_t capsuleCount = 0; - bool maxSphereCountReachedWarned = false; - bool maxCapsuleCountReachedWarned = false; + [[maybe_unused]] bool maxSphereCountReachedWarned = false; + [[maybe_unused]] bool maxCapsuleCountReachedWarned = false; AZStd::vector sphereColliders; AZStd::vector capsuleColliders; diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/Components/RagdollComponent.cpp b/Gems/PhysX/Code/Source/PhysXCharacters/Components/RagdollComponent.cpp index 7615a175d1..2c00fd188d 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/Components/RagdollComponent.cpp +++ b/Gems/PhysX/Code/Source/PhysXCharacters/Components/RagdollComponent.cpp @@ -422,7 +422,7 @@ namespace PhysX return d1.m_depth < d2.m_depth; }); - bool massesClamped = false; + [[maybe_unused]] bool massesClamped = false; for (const auto& nodeDepth : nodeDepths) { const size_t nodeIndex = nodeDepth.m_index; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/ScriptEventsNodePaletteTreeItemTypes.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/ScriptEventsNodePaletteTreeItemTypes.cpp index da0e9c6045..86fdc0342b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/ScriptEventsNodePaletteTreeItemTypes.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/ScriptEventsNodePaletteTreeItemTypes.cpp @@ -145,7 +145,7 @@ namespace ScriptCanvasEditor ScriptEvents::ScriptEventsAsset* data = asset.GetAs(); if (data) { - const ScriptEvents::ScriptEvent* previousDefinition = nullptr; + [[maybe_unused]] const ScriptEvents::ScriptEvent* previousDefinition = nullptr; ScriptEvents::ScriptEventsAsset* previousData = m_asset.GetAs(); if (previousData) { diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp index d689d2635c..4a0d260a74 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp @@ -291,7 +291,7 @@ namespace Terrain modelAssetCreator.Begin(AZ::Uuid::CreateRandom()); uint16_t gridSize = GridSize; - float gridSpacing = GridSpacing; + [[maybe_unused]] float gridSpacing = GridSpacing; for (uint32_t i = 0; i < AZ::RPI::ModelLodAsset::LodCountMax && gridSize > 0; ++i) { From aabde7916fde25177c737c199c9cb8ee94ae2753 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Sun, 23 Jan 2022 16:25:57 -0600 Subject: [PATCH 386/620] Atom Tools: Combined ME viewport widget and renderer classes Was looking into options for making any part of this more generic or reusable but 60% of the code is just setup and teardown of processors, handles, entities, and components for the material editor viewport content. The rest is about handling material editors specific setting changes. Most of the general-purpose code has already been moved into atom tools framework render viewport widget. The best reduction or generalization from this point would be using prefabs or some other mechanism to data drive setting up camera, viewport model, IBL, lighting, sky box. Also discussing options for replacing the material editor viewport camera controller and states with a generic one used in the main editor and animation editor. Signed-off-by: Guthrie Adams --- .../Viewport/MaterialViewportRenderer.cpp | 462 ------------------ .../Viewport/MaterialViewportRenderer.h | 114 ----- .../Viewport/MaterialViewportWidget.cpp | 458 ++++++++++++++++- .../Source/Viewport/MaterialViewportWidget.h | 97 +++- .../Code/materialeditor_files.cmake | 2 - 5 files changed, 536 insertions(+), 597 deletions(-) delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.h diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp deleted file mode 100644 index 478fb92c55..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp +++ /dev/null @@ -1,462 +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 - * - */ - -#undef RC_INVOKED - -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -namespace MaterialEditor -{ - static constexpr float DepthNear = 0.01f; - - MaterialViewportRenderer::MaterialViewportRenderer(AZStd::shared_ptr windowContext) - : m_windowContext(windowContext) - , m_viewportController(AZStd::make_shared()) - { - using namespace AZ; - using namespace Data; - - // Create and register a scene with all available feature processors - AZ::RPI::SceneDescriptor sceneDesc; - sceneDesc.m_nameId = AZ::Name("MaterialViewport"); - m_scene = AZ::RPI::Scene::CreateScene(sceneDesc); - m_scene->EnableAllFeatureProcessors(); - - // Bind m_defaultScene to the GameEntityContext's AzFramework::Scene - auto sceneSystem = AzFramework::SceneSystemInterface::Get(); - AZ_Assert(sceneSystem, "MaterialViewportRenderer was unable to get the scene system during construction."); - AZStd::shared_ptr mainScene = sceneSystem->GetScene(AzFramework::Scene::MainSceneName); - - // This should never happen unless scene creation has changed. - AZ_Assert(mainScene, "Main scenes missing during system component initialization"); - mainScene->SetSubsystem(m_scene); - - // Create a render pipeline from the specified asset for the window context and add the pipeline to the scene - AZ::Data::Asset pipelineAsset = AZ::RPI::AssetUtils::LoadAssetByProductPath(m_defaultPipelineAssetPath.c_str(), AZ::RPI::AssetUtils::TraceLevel::Error); - m_renderPipeline = AZ::RPI::RenderPipeline::CreateRenderPipelineForWindow(pipelineAsset, *m_windowContext.get()); - pipelineAsset.Release(); - m_scene->AddRenderPipeline(m_renderPipeline); - - // As part of our initialization we need to create the BRDF texture generation pipeline - AZ::RPI::RenderPipelineDescriptor pipelineDesc; - pipelineDesc.m_mainViewTagName = "MainCamera"; - pipelineDesc.m_name = "BRDFTexturePipeline"; - pipelineDesc.m_rootPassTemplate = "BRDFTexturePipeline"; - pipelineDesc.m_executeOnce = true; - - AZ::RPI::RenderPipelinePtr brdfTexturePipeline = AZ::RPI::RenderPipeline::CreateRenderPipeline(pipelineDesc); - m_scene->AddRenderPipeline(brdfTexturePipeline); - - // Currently the scene has to be activated after render pipeline was added so some feature processors (i.e. imgui) can be initialized properly - // with pipeline's pass information. - m_scene->Activate(); - - AZ::RPI::RPISystemInterface::Get()->RegisterScene(m_scene); - - AzFramework::EntityContextId entityContextId; - AzFramework::GameEntityContextRequestBus::BroadcastResult(entityContextId, &AzFramework::GameEntityContextRequestBus::Events::GetGameEntityContextId); - - // Configure camera - AzFramework::EntityContextRequestBus::EventResult(m_cameraEntity, entityContextId, &AzFramework::EntityContextRequestBus::Events::CreateEntity, "Cameraentity"); - AZ_Assert(m_cameraEntity != nullptr, "Failed to create camera entity."); - - //Add debug camera and controller components - AZ::Debug::CameraComponentConfig cameraConfig(m_windowContext); - cameraConfig.m_fovY = AZ::Constants::HalfPi; - cameraConfig.m_depthNear = DepthNear; - m_cameraComponent = m_cameraEntity->CreateComponent(azrtti_typeid()); - m_cameraComponent->SetConfiguration(cameraConfig); - m_cameraEntity->CreateComponent(azrtti_typeid()); - m_cameraEntity->Activate(); - - // Connect camera to pipeline's default view after camera entity activated - m_renderPipeline->SetDefaultViewFromEntity(m_cameraEntity->GetId()); - - // Configure tone mapper - AzFramework::EntityContextRequestBus::EventResult(m_postProcessEntity, entityContextId, &AzFramework::EntityContextRequestBus::Events::CreateEntity, "postProcessEntity"); - AZ_Assert(m_postProcessEntity != nullptr, "Failed to create post process entity."); - - m_postProcessEntity->CreateComponent(AZ::Render::PostFxLayerComponentTypeId); - m_postProcessEntity->CreateComponent(AZ::Render::ExposureControlComponentTypeId); - m_postProcessEntity->CreateComponent(azrtti_typeid()); - m_postProcessEntity->Activate(); - - // Init directional light processor - m_directionalLightFeatureProcessor = m_scene->GetFeatureProcessor(); - - // Init display mapper processor - m_displayMapperFeatureProcessor = m_scene->GetFeatureProcessor(); - - // Init Skybox - m_skyboxFeatureProcessor = m_scene->GetFeatureProcessor(); - m_skyboxFeatureProcessor->Enable(true); - m_skyboxFeatureProcessor->SetSkyboxMode(AZ::Render::SkyBoxMode::Cubemap); - - // Create IBL - AzFramework::EntityContextRequestBus::EventResult(m_iblEntity, entityContextId, &AzFramework::EntityContextRequestBus::Events::CreateEntity, "IblEntity"); - AZ_Assert(m_iblEntity != nullptr, "Failed to create ibl entity."); - - m_iblEntity->CreateComponent(Render::ImageBasedLightComponentTypeId); - m_iblEntity->CreateComponent(azrtti_typeid()); - m_iblEntity->Activate(); - - // Create model - AzFramework::EntityContextRequestBus::EventResult(m_modelEntity, entityContextId, &AzFramework::EntityContextRequestBus::Events::CreateEntity, "ViewportModel"); - AZ_Assert(m_modelEntity != nullptr, "Failed to create model entity."); - - m_modelEntity->CreateComponent(AZ::Render::MeshComponentTypeId); - m_modelEntity->CreateComponent(AZ::Render::MaterialComponentTypeId); - m_modelEntity->CreateComponent(azrtti_typeid()); - m_modelEntity->Activate(); - - // Create shadow catcher - AzFramework::EntityContextRequestBus::EventResult(m_shadowCatcherEntity, entityContextId, &AzFramework::EntityContextRequestBus::Events::CreateEntity, "ViewportShadowCatcher"); - AZ_Assert(m_shadowCatcherEntity != nullptr, "Failed to create shadow catcher entity."); - m_shadowCatcherEntity->CreateComponent(AZ::Render::MeshComponentTypeId); - m_shadowCatcherEntity->CreateComponent(AZ::Render::MaterialComponentTypeId); - m_shadowCatcherEntity->CreateComponent(azrtti_typeid()); - m_shadowCatcherEntity->CreateComponent(azrtti_typeid()); - m_shadowCatcherEntity->Activate(); - - AZ::NonUniformScaleRequestBus::Event(m_shadowCatcherEntity->GetId(), &AZ::NonUniformScaleRequests::SetScale, AZ::Vector3{ 100, 100, 1.0 }); - - AZ::Data::AssetId shadowCatcherModelAssetId = RPI::AssetUtils::GetAssetIdForProductPath("materialeditor/viewportmodels/plane_1x1.azmodel", RPI::AssetUtils::TraceLevel::Error); - AZ::Render::MeshComponentRequestBus::Event(m_shadowCatcherEntity->GetId(), - &AZ::Render::MeshComponentRequestBus::Events::SetModelAssetId, shadowCatcherModelAssetId); - - auto shadowCatcherMaterialAsset = AZ::RPI::AssetUtils::LoadAssetByProductPath("materials/special/shadowcatcher.azmaterial", RPI::AssetUtils::TraceLevel::Error); - if (shadowCatcherMaterialAsset) - { - m_shadowCatcherOpacityPropertyIndex = shadowCatcherMaterialAsset->GetMaterialTypeAsset()->GetMaterialPropertiesLayout()->FindPropertyIndex(AZ::Name{ "settings.opacity" }); - AZ_Error("MaterialViewportRenderer", m_shadowCatcherOpacityPropertyIndex.IsValid(), "Could not find opacity property"); - - m_shadowCatcherMaterial = AZ::RPI::Material::Create(shadowCatcherMaterialAsset); - AZ_Error("MaterialViewportRenderer", m_shadowCatcherMaterial != nullptr, "Could not create shadow catcher material."); - - AZ::Render::MaterialAssignmentMap shadowCatcherMaterials; - auto& shadowCatcherMaterialAssignment = shadowCatcherMaterials[AZ::Render::DefaultMaterialAssignmentId]; - shadowCatcherMaterialAssignment.m_materialInstance = m_shadowCatcherMaterial; - shadowCatcherMaterialAssignment.m_materialInstancePreCreated = true; - - AZ::Render::MaterialComponentRequestBus::Event(m_shadowCatcherEntity->GetId(), - &AZ::Render::MaterialComponentRequestBus::Events::SetMaterialOverrides, shadowCatcherMaterials); - } - - // Create grid - AzFramework::EntityContextRequestBus::EventResult(m_gridEntity, entityContextId, &AzFramework::EntityContextRequestBus::Events::CreateEntity, "ViewportGrid"); - AZ_Assert(m_gridEntity != nullptr, "Failed to create grid entity."); - - AZ::Render::GridComponentConfig gridConfig; - gridConfig.m_gridSize = 4.0f; - gridConfig.m_axisColor = AZ::Color(0.1f, 0.1f, 0.1f, 1.0f); - gridConfig.m_primaryColor = AZ::Color(0.1f, 0.1f, 0.1f, 1.0f); - gridConfig.m_secondaryColor = AZ::Color(0.1f, 0.1f, 0.1f, 1.0f); - auto gridComponent = m_gridEntity->CreateComponent(AZ::Render::GridComponentTypeId); - gridComponent->SetConfiguration(gridConfig); - - m_gridEntity->CreateComponent(azrtti_typeid()); - m_gridEntity->Activate(); - - OnDocumentOpened(AZ::Uuid::CreateNull()); - - // Attempt to apply the default lighting preset - AZ::Render::LightingPresetPtr lightingPreset; - MaterialViewportRequestBus::BroadcastResult(lightingPreset, &MaterialViewportRequestBus::Events::GetLightingPresetSelection); - OnLightingPresetSelected(lightingPreset); - - // Attempt to apply the default model preset - AZ::Render::ModelPresetPtr modelPreset; - MaterialViewportRequestBus::BroadcastResult(modelPreset, &MaterialViewportRequestBus::Events::GetModelPresetSelection); - OnModelPresetSelected(modelPreset); - - m_viewportController->Init(m_cameraEntity->GetId(), m_modelEntity->GetId(), m_iblEntity->GetId()); - - // Apply user settinngs restored since last run - AZStd::intrusive_ptr viewportSettings = - AZ::UserSettings::CreateFind(AZ::Crc32("MaterialViewportSettings"), AZ::UserSettings::CT_GLOBAL); - - OnGridEnabledChanged(viewportSettings->m_enableGrid); - OnShadowCatcherEnabledChanged(viewportSettings->m_enableShadowCatcher); - OnAlternateSkyboxEnabledChanged(viewportSettings->m_enableAlternateSkybox); - OnFieldOfViewChanged(viewportSettings->m_fieldOfView); - OnDisplayMapperOperationTypeChanged(viewportSettings->m_displayMapperOperationType); - - AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler::BusConnect(); - MaterialViewportNotificationBus::Handler::BusConnect(); - AZ::TickBus::Handler::BusConnect(); - AZ::TransformNotificationBus::MultiHandler::BusConnect(m_cameraEntity->GetId()); - } - - MaterialViewportRenderer::~MaterialViewportRenderer() - { - AZ::TransformNotificationBus::MultiHandler::BusDisconnect(); - AZ::TickBus::Handler::BusDisconnect(); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler::BusDisconnect(); - MaterialViewportNotificationBus::Handler::BusDisconnect(); - AZ::Data::AssetBus::Handler::BusDisconnect(); - - AzFramework::EntityContextId entityContextId; - AzFramework::GameEntityContextRequestBus::BroadcastResult(entityContextId, &AzFramework::GameEntityContextRequestBus::Events::GetGameEntityContextId); - - AzFramework::EntityContextRequestBus::Event(entityContextId, &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_iblEntity); - m_iblEntity = nullptr; - - AzFramework::EntityContextRequestBus::Event(entityContextId, &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_modelEntity); - m_modelEntity = nullptr; - - AzFramework::EntityContextRequestBus::Event(entityContextId, &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_shadowCatcherEntity); - m_shadowCatcherEntity = nullptr; - - AzFramework::EntityContextRequestBus::Event(entityContextId, &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_gridEntity); - m_gridEntity = nullptr; - - AzFramework::EntityContextRequestBus::Event(entityContextId, &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_cameraEntity); - m_cameraEntity = nullptr; - - AzFramework::EntityContextRequestBus::Event(entityContextId, &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_postProcessEntity); - m_postProcessEntity = nullptr; - - for (DirectionalLightHandle& handle : m_lightHandles) - { - m_directionalLightFeatureProcessor->ReleaseLight(handle); - } - m_lightHandles.clear(); - - auto sceneSystem = AzFramework::SceneSystemInterface::Get(); - AZ_Assert(sceneSystem, "MaterialViewportRenderer was unable to get the scene system during destruction."); - AZStd::shared_ptr mainScene = sceneSystem->GetScene(AzFramework::Scene::MainSceneName); - // This should never happen unless scene creation has changed. - AZ_Assert(mainScene, "Main scenes missing during system component destruction"); - mainScene->UnsetSubsystem(m_scene); - - m_swapChainPass = nullptr; - AZ::RPI::RPISystemInterface::Get()->UnregisterScene(m_scene); - m_scene = nullptr; - } - - AZStd::shared_ptr MaterialViewportRenderer::GetController() - { - return m_viewportController; - } - - void MaterialViewportRenderer::OnDocumentOpened(const AZ::Uuid& documentId) - { - AZ::Data::Instance materialInstance; - MaterialDocumentRequestBus::EventResult(materialInstance, documentId, &MaterialDocumentRequestBus::Events::GetInstance); - - AZ::Render::MaterialAssignmentMap materials; - auto& materialAssignment = materials[AZ::Render::DefaultMaterialAssignmentId]; - materialAssignment.m_materialInstance = materialInstance; - materialAssignment.m_materialInstancePreCreated = true; - - AZ::Render::MaterialComponentRequestBus::Event(m_modelEntity->GetId(), - &AZ::Render::MaterialComponentRequestBus::Events::SetMaterialOverrides, materials); - } - - void MaterialViewportRenderer::OnLightingPresetSelected(AZ::Render::LightingPresetPtr preset) - { - if (!preset) - { - return; - } - - AZ::Render::ImageBasedLightFeatureProcessorInterface* iblFeatureProcessor = m_scene->GetFeatureProcessor(); - AZ::Render::PostProcessFeatureProcessorInterface* postProcessFeatureProcessor = m_scene->GetFeatureProcessor(); - - AZ::Render::ExposureControlSettingsInterface* exposureControlSettingInterface = postProcessFeatureProcessor->GetOrCreateSettingsInterface(m_postProcessEntity->GetId())->GetOrCreateExposureControlSettingsInterface(); - - Camera::Configuration cameraConfig; - Camera::CameraRequestBus::EventResult(cameraConfig, m_cameraEntity->GetId(), &Camera::CameraRequestBus::Events::GetCameraConfiguration); - - bool enableAlternateSkybox = false; - MaterialViewportRequestBus::BroadcastResult(enableAlternateSkybox, &MaterialViewportRequestBus::Events::GetAlternateSkyboxEnabled); - - preset->ApplyLightingPreset( - iblFeatureProcessor, - m_skyboxFeatureProcessor, - exposureControlSettingInterface, - m_directionalLightFeatureProcessor, - cameraConfig, - m_lightHandles, - m_shadowCatcherMaterial, - m_shadowCatcherOpacityPropertyIndex, - enableAlternateSkybox); - } - - void MaterialViewportRenderer::OnLightingPresetChanged(AZ::Render::LightingPresetPtr preset) - { - AZ::Render::LightingPresetPtr selectedPreset; - MaterialViewportRequestBus::BroadcastResult(selectedPreset, &MaterialViewportRequestBus::Events::GetLightingPresetSelection); - if (selectedPreset == preset) - { - OnLightingPresetSelected(preset); - } - } - - void MaterialViewportRenderer::OnModelPresetSelected(AZ::Render::ModelPresetPtr preset) - { - if (!preset) - { - return; - } - - if (!preset->m_modelAsset.GetId().IsValid()) - { - AZ_Warning("MaterialViewportRenderer", false, "Attempting to set invalid model for preset: '%s'\n.", preset->m_displayName.c_str()); - return; - } - - if (preset->m_modelAsset.GetId() == m_modelAssetId) - { - return; - } - - AZ::Render::MeshComponentRequestBus::Event(m_modelEntity->GetId(), - &AZ::Render::MeshComponentRequestBus::Events::SetModelAsset, preset->m_modelAsset); - - m_modelAssetId = preset->m_modelAsset.GetId(); - - AZ::Data::AssetBus::Handler::BusDisconnect(); - AZ::Data::AssetBus::Handler::BusConnect(m_modelAssetId); - } - - void MaterialViewportRenderer::OnModelPresetChanged(AZ::Render::ModelPresetPtr preset) - { - AZ::Render::ModelPresetPtr selectedPreset; - MaterialViewportRequestBus::BroadcastResult(selectedPreset, &MaterialViewportRequestBus::Events::GetModelPresetSelection); - if (selectedPreset == preset) - { - OnModelPresetSelected(preset); - } - } - - void MaterialViewportRenderer::OnShadowCatcherEnabledChanged(bool enable) - { - AZ::Render::MeshComponentRequestBus::Event(m_shadowCatcherEntity->GetId(), &AZ::Render::MeshComponentRequestBus::Events::SetVisibility, enable); - } - - void MaterialViewportRenderer::OnGridEnabledChanged(bool enable) - { - if (m_gridEntity) - { - if (enable && m_gridEntity->GetState() == AZ::Entity::State::Init) - { - m_gridEntity->Activate(); - } - else if (!enable && m_gridEntity->GetState() == AZ::Entity::State::Active) - { - m_gridEntity->Deactivate(); - } - } - } - - void MaterialViewportRenderer::OnAlternateSkyboxEnabledChanged(bool enable) - { - AZ_UNUSED(enable); - AZ::Render::LightingPresetPtr selectedPreset; - MaterialViewportRequestBus::BroadcastResult(selectedPreset, &MaterialViewportRequestBus::Events::GetLightingPresetSelection); - OnLightingPresetSelected(selectedPreset); - } - - void MaterialViewportRenderer::OnFieldOfViewChanged(float fieldOfView) - { - MaterialEditorViewportInputControllerRequestBus::Broadcast(&MaterialEditorViewportInputControllerRequestBus::Handler::SetFieldOfView, fieldOfView); - } - - void MaterialViewportRenderer::OnDisplayMapperOperationTypeChanged(AZ::Render::DisplayMapperOperationType operationType) - { - AZ::Render::DisplayMapperConfigurationDescriptor desc; - desc.m_operationType = operationType; - m_displayMapperFeatureProcessor->RegisterDisplayMapperConfiguration(desc); - } - - void MaterialViewportRenderer::OnAssetReady(AZ::Data::Asset asset) - { - if (m_modelAssetId == asset.GetId()) - { - MaterialEditorViewportInputControllerRequestBus::Broadcast(&MaterialEditorViewportInputControllerRequestBus::Handler::Reset); - AZ::Data::AssetBus::Handler::BusDisconnect(asset.GetId()); - } - } - - void MaterialViewportRenderer::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) - { - m_renderPipeline->AddToRenderTickOnce(); - - PerformanceMonitorRequestBus::Broadcast(&PerformanceMonitorRequestBus::Handler::GatherMetrics); - - if (m_shadowCatcherMaterial) - { - // Compile the m_shadowCatcherMaterial in OnTick because changes can only be compiled once per frame. - // This is ignored when a compile isn't needed. - m_shadowCatcherMaterial->Compile(); - } - } - - void MaterialViewportRenderer::OnTransformChanged(const AZ::Transform&, const AZ::Transform&) - { - const AZ::EntityId* currentBusId = AZ::TransformNotificationBus::GetCurrentBusId(); - if (m_cameraEntity && currentBusId && *currentBusId == m_cameraEntity->GetId() && m_directionalLightFeatureProcessor) - { - auto transform = AZ::Transform::CreateIdentity(); - AZ::TransformBus::EventResult( - transform, - m_cameraEntity->GetId(), - &AZ::TransformBus::Events::GetWorldTM); - for (const DirectionalLightHandle& id : m_lightHandles) - { - m_directionalLightFeatureProcessor->SetCameraTransform( - id, transform); - } - } - } -} diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.h deleted file mode 100644 index 35b7965a2e..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.h +++ /dev/null @@ -1,114 +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 - * - */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace AZ -{ - namespace Render - { - class DisplayMapperFeatureProcessorInterface; - } - - class Entity; - class Component; - - namespace RPI - { - class SwapChainPass; - class WindowContext; - } -} - -namespace MaterialEditor -{ - //! Provides backend logic for MaterialViewport - //! Sets up a scene, camera, loads the model, and applies texture - class MaterialViewportRenderer - : public AZ::Data::AssetBus::Handler - , public AZ::TickBus::Handler - , public AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler - , public MaterialViewportNotificationBus::Handler - , public AZ::TransformNotificationBus::MultiHandler - { - public: - AZ_CLASS_ALLOCATOR(MaterialViewportRenderer, AZ::SystemAllocator, 0); - - MaterialViewportRenderer(AZStd::shared_ptr windowContext); - ~MaterialViewportRenderer(); - - AZStd::shared_ptr GetController(); - - private: - - // AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler interface overrides... - void OnDocumentOpened(const AZ::Uuid& documentId) override; - - // MaterialViewportNotificationBus::Handler interface overrides... - void OnLightingPresetSelected(AZ::Render::LightingPresetPtr preset) override; - void OnLightingPresetChanged(AZ::Render::LightingPresetPtr preset) override; - void OnModelPresetSelected(AZ::Render::ModelPresetPtr preset) override; - void OnModelPresetChanged(AZ::Render::ModelPresetPtr preset) override; - void OnShadowCatcherEnabledChanged(bool enable) override; - void OnGridEnabledChanged(bool enable) override; - void OnAlternateSkyboxEnabledChanged(bool enable) override; - void OnFieldOfViewChanged(float fieldOfView) override; - void OnDisplayMapperOperationTypeChanged(AZ::Render::DisplayMapperOperationType operationType) override; - - // AZ::Data::AssetBus::Handler interface overrides... - void OnAssetReady(AZ::Data::Asset asset) override; - - // AZ::TickBus::Handler interface overrides... - void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - - // AZ::TransformNotificationBus::MultiHandler overrides... - void OnTransformChanged(const AZ::Transform&, const AZ::Transform&) override; - - using DirectionalLightHandle = AZ::Render::DirectionalLightFeatureProcessorInterface::LightHandle; - - AZ::Data::Instance m_swapChainPass; - AZStd::string m_defaultPipelineAssetPath = "passes/MainRenderPipeline.azasset"; - AZStd::shared_ptr m_windowContext; - AZ::RPI::RenderPipelinePtr m_renderPipeline; - AZ::RPI::ScenePtr m_scene; - AZ::Render::DirectionalLightFeatureProcessorInterface* m_directionalLightFeatureProcessor = nullptr; - AZ::Render::DisplayMapperFeatureProcessorInterface* m_displayMapperFeatureProcessor = nullptr; - - AZ::Entity* m_cameraEntity = nullptr; - AZ::Component* m_cameraComponent = nullptr; - bool m_cameraNeedsFullReset = true; - - AZ::Entity* m_postProcessEntity = nullptr; - - AZ::Entity* m_modelEntity = nullptr; - AZ::Data::AssetId m_modelAssetId; - - AZ::Entity* m_gridEntity = nullptr; - - AZ::Entity* m_shadowCatcherEntity = nullptr; - AZ::Data::Instance m_shadowCatcherMaterial; - AZ::RPI::MaterialPropertyIndex m_shadowCatcherOpacityPropertyIndex; - - AZStd::vector m_lightHandles; - - AZ::Entity* m_iblEntity = nullptr; - AZ::Render::SkyBoxFeatureProcessorInterface* m_skyboxFeatureProcessor = nullptr; - - AZStd::shared_ptr m_viewportController; - }; -} // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportWidget.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportWidget.cpp index 0322fa194e..dd157c59ac 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportWidget.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportWidget.cpp @@ -6,29 +6,65 @@ * */ +#undef RC_INVOKED + +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include #include +#include +#include #include #include #include - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT #include -#include "Viewport/ui_MaterialViewportWidget.h" AZ_POP_DISABLE_WARNING -#include - namespace MaterialEditor { + static constexpr float DepthNear = 0.01f; MaterialViewportWidget::MaterialViewportWidget(QWidget* parent) : AtomToolsFramework::RenderViewportWidget(parent) , m_ui(new Ui::MaterialViewportWidget) + , m_viewportController(AZStd::make_shared()) { m_ui->setupUi(this); @@ -38,7 +74,415 @@ namespace MaterialEditor const AZ::Name defaultContextName = viewportContextManager->GetDefaultViewportContextName(); viewportContextManager->RenameViewportContext(GetViewportContext(), defaultContextName); - m_renderer = AZStd::make_unique(GetViewportContext()->GetWindowContext()); - GetControllerList()->Add(m_renderer->GetController()); + // Create and register a scene with all available feature processors + AZ::RPI::SceneDescriptor sceneDesc; + sceneDesc.m_nameId = AZ::Name("MaterialViewport"); + m_scene = AZ::RPI::Scene::CreateScene(sceneDesc); + m_scene->EnableAllFeatureProcessors(); + + // Bind m_defaultScene to the GameEntityContext's AzFramework::Scene + auto sceneSystem = AzFramework::SceneSystemInterface::Get(); + AZ_Assert(sceneSystem, "MaterialViewportWidget was unable to get the scene system during construction."); + AZStd::shared_ptr mainScene = sceneSystem->GetScene(AzFramework::Scene::MainSceneName); + + // This should never happen unless scene creation has changed. + AZ_Assert(mainScene, "Main scenes missing during system component initialization"); + mainScene->SetSubsystem(m_scene); + + // Create a render pipeline from the specified asset for the window context and add the pipeline to the scene + AZ::Data::Asset pipelineAsset = AZ::RPI::AssetUtils::LoadAssetByProductPath( + m_defaultPipelineAssetPath.c_str(), AZ::RPI::AssetUtils::TraceLevel::Error); + m_renderPipeline = AZ::RPI::RenderPipeline::CreateRenderPipelineForWindow(pipelineAsset, *GetViewportContext()->GetWindowContext().get()); + pipelineAsset.Release(); + m_scene->AddRenderPipeline(m_renderPipeline); + + // As part of our initialization we need to create the BRDF texture generation pipeline + AZ::RPI::RenderPipelineDescriptor pipelineDesc; + pipelineDesc.m_mainViewTagName = "MainCamera"; + pipelineDesc.m_name = "BRDFTexturePipeline"; + pipelineDesc.m_rootPassTemplate = "BRDFTexturePipeline"; + pipelineDesc.m_executeOnce = true; + + AZ::RPI::RenderPipelinePtr brdfTexturePipeline = AZ::RPI::RenderPipeline::CreateRenderPipeline(pipelineDesc); + m_scene->AddRenderPipeline(brdfTexturePipeline); + + // Currently the scene has to be activated after render pipeline was added so some feature processors (i.e. imgui) can be + // initialized properly with pipeline's pass information. + m_scene->Activate(); + + AZ::RPI::RPISystemInterface::Get()->RegisterScene(m_scene); + + AzFramework::EntityContextId entityContextId; + AzFramework::GameEntityContextRequestBus::BroadcastResult( + entityContextId, &AzFramework::GameEntityContextRequestBus::Events::GetGameEntityContextId); + + // Configure camera + AzFramework::EntityContextRequestBus::EventResult( + m_cameraEntity, entityContextId, &AzFramework::EntityContextRequestBus::Events::CreateEntity, "Cameraentity"); + AZ_Assert(m_cameraEntity != nullptr, "Failed to create camera entity."); + + // Add debug camera and controller components + AZ::Debug::CameraComponentConfig cameraConfig(GetViewportContext()->GetWindowContext()); + cameraConfig.m_fovY = AZ::Constants::HalfPi; + cameraConfig.m_depthNear = DepthNear; + m_cameraComponent = m_cameraEntity->CreateComponent(azrtti_typeid()); + m_cameraComponent->SetConfiguration(cameraConfig); + m_cameraEntity->CreateComponent(azrtti_typeid()); + m_cameraEntity->Activate(); + + // Connect camera to pipeline's default view after camera entity activated + m_renderPipeline->SetDefaultViewFromEntity(m_cameraEntity->GetId()); + + // Configure tone mapper + AzFramework::EntityContextRequestBus::EventResult( + m_postProcessEntity, entityContextId, &AzFramework::EntityContextRequestBus::Events::CreateEntity, "postProcessEntity"); + AZ_Assert(m_postProcessEntity != nullptr, "Failed to create post process entity."); + + m_postProcessEntity->CreateComponent(AZ::Render::PostFxLayerComponentTypeId); + m_postProcessEntity->CreateComponent(AZ::Render::ExposureControlComponentTypeId); + m_postProcessEntity->CreateComponent(azrtti_typeid()); + m_postProcessEntity->Activate(); + + // Init directional light processor + m_directionalLightFeatureProcessor = m_scene->GetFeatureProcessor(); + + // Init display mapper processor + m_displayMapperFeatureProcessor = m_scene->GetFeatureProcessor(); + + // Init Skybox + m_skyboxFeatureProcessor = m_scene->GetFeatureProcessor(); + m_skyboxFeatureProcessor->Enable(true); + m_skyboxFeatureProcessor->SetSkyboxMode(AZ::Render::SkyBoxMode::Cubemap); + + // Create IBL + AzFramework::EntityContextRequestBus::EventResult( + m_iblEntity, entityContextId, &AzFramework::EntityContextRequestBus::Events::CreateEntity, "IblEntity"); + AZ_Assert(m_iblEntity != nullptr, "Failed to create ibl entity."); + + m_iblEntity->CreateComponent(AZ::Render::ImageBasedLightComponentTypeId); + m_iblEntity->CreateComponent(azrtti_typeid()); + m_iblEntity->Activate(); + + // Create model + AzFramework::EntityContextRequestBus::EventResult( + m_modelEntity, entityContextId, &AzFramework::EntityContextRequestBus::Events::CreateEntity, "ViewportModel"); + AZ_Assert(m_modelEntity != nullptr, "Failed to create model entity."); + + m_modelEntity->CreateComponent(AZ::Render::MeshComponentTypeId); + m_modelEntity->CreateComponent(AZ::Render::MaterialComponentTypeId); + m_modelEntity->CreateComponent(azrtti_typeid()); + m_modelEntity->Activate(); + + // Create shadow catcher + AzFramework::EntityContextRequestBus::EventResult( + m_shadowCatcherEntity, entityContextId, &AzFramework::EntityContextRequestBus::Events::CreateEntity, "ViewportShadowCatcher"); + AZ_Assert(m_shadowCatcherEntity != nullptr, "Failed to create shadow catcher entity."); + m_shadowCatcherEntity->CreateComponent(AZ::Render::MeshComponentTypeId); + m_shadowCatcherEntity->CreateComponent(AZ::Render::MaterialComponentTypeId); + m_shadowCatcherEntity->CreateComponent(azrtti_typeid()); + m_shadowCatcherEntity->CreateComponent(azrtti_typeid()); + m_shadowCatcherEntity->Activate(); + + AZ::NonUniformScaleRequestBus::Event( + m_shadowCatcherEntity->GetId(), &AZ::NonUniformScaleRequests::SetScale, AZ::Vector3{ 100, 100, 1.0 }); + + AZ::Data::AssetId shadowCatcherModelAssetId = AZ::RPI::AssetUtils::GetAssetIdForProductPath( + "materialeditor/viewportmodels/plane_1x1.azmodel", AZ::RPI::AssetUtils::TraceLevel::Error); + AZ::Render::MeshComponentRequestBus::Event( + m_shadowCatcherEntity->GetId(), &AZ::Render::MeshComponentRequestBus::Events::SetModelAssetId, shadowCatcherModelAssetId); + + auto shadowCatcherMaterialAsset = AZ::RPI::AssetUtils::LoadAssetByProductPath( + "materials/special/shadowcatcher.azmaterial", AZ::RPI::AssetUtils::TraceLevel::Error); + if (shadowCatcherMaterialAsset) + { + m_shadowCatcherOpacityPropertyIndex = + shadowCatcherMaterialAsset->GetMaterialTypeAsset()->GetMaterialPropertiesLayout()->FindPropertyIndex( + AZ::Name{ "settings.opacity" }); + AZ_Error("MaterialViewportWidget", m_shadowCatcherOpacityPropertyIndex.IsValid(), "Could not find opacity property"); + + m_shadowCatcherMaterial = AZ::RPI::Material::Create(shadowCatcherMaterialAsset); + AZ_Error("MaterialViewportWidget", m_shadowCatcherMaterial != nullptr, "Could not create shadow catcher material."); + + AZ::Render::MaterialAssignmentMap shadowCatcherMaterials; + auto& shadowCatcherMaterialAssignment = shadowCatcherMaterials[AZ::Render::DefaultMaterialAssignmentId]; + shadowCatcherMaterialAssignment.m_materialInstance = m_shadowCatcherMaterial; + shadowCatcherMaterialAssignment.m_materialInstancePreCreated = true; + + AZ::Render::MaterialComponentRequestBus::Event( + m_shadowCatcherEntity->GetId(), &AZ::Render::MaterialComponentRequestBus::Events::SetMaterialOverrides, + shadowCatcherMaterials); + } + + // Create grid + AzFramework::EntityContextRequestBus::EventResult( + m_gridEntity, entityContextId, &AzFramework::EntityContextRequestBus::Events::CreateEntity, "ViewportGrid"); + AZ_Assert(m_gridEntity != nullptr, "Failed to create grid entity."); + + AZ::Render::GridComponentConfig gridConfig; + gridConfig.m_gridSize = 4.0f; + gridConfig.m_axisColor = AZ::Color(0.1f, 0.1f, 0.1f, 1.0f); + gridConfig.m_primaryColor = AZ::Color(0.1f, 0.1f, 0.1f, 1.0f); + gridConfig.m_secondaryColor = AZ::Color(0.1f, 0.1f, 0.1f, 1.0f); + auto gridComponent = m_gridEntity->CreateComponent(AZ::Render::GridComponentTypeId); + gridComponent->SetConfiguration(gridConfig); + + m_gridEntity->CreateComponent(azrtti_typeid()); + m_gridEntity->Activate(); + + OnDocumentOpened(AZ::Uuid::CreateNull()); + + // Attempt to apply the default lighting preset + AZ::Render::LightingPresetPtr lightingPreset; + MaterialViewportRequestBus::BroadcastResult(lightingPreset, &MaterialViewportRequestBus::Events::GetLightingPresetSelection); + OnLightingPresetSelected(lightingPreset); + + // Attempt to apply the default model preset + AZ::Render::ModelPresetPtr modelPreset; + MaterialViewportRequestBus::BroadcastResult(modelPreset, &MaterialViewportRequestBus::Events::GetModelPresetSelection); + OnModelPresetSelected(modelPreset); + + m_viewportController->Init(m_cameraEntity->GetId(), m_modelEntity->GetId(), m_iblEntity->GetId()); + + // Apply user settinngs restored since last run + AZStd::intrusive_ptr viewportSettings = + AZ::UserSettings::CreateFind(AZ::Crc32("MaterialViewportSettings"), AZ::UserSettings::CT_GLOBAL); + + OnGridEnabledChanged(viewportSettings->m_enableGrid); + OnShadowCatcherEnabledChanged(viewportSettings->m_enableShadowCatcher); + OnAlternateSkyboxEnabledChanged(viewportSettings->m_enableAlternateSkybox); + OnFieldOfViewChanged(viewportSettings->m_fieldOfView); + OnDisplayMapperOperationTypeChanged(viewportSettings->m_displayMapperOperationType); + + AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler::BusConnect(); + MaterialViewportNotificationBus::Handler::BusConnect(); + AZ::TickBus::Handler::BusConnect(); + AZ::TransformNotificationBus::MultiHandler::BusConnect(m_cameraEntity->GetId()); + + GetControllerList()->Add(m_viewportController); + } + + MaterialViewportWidget::~MaterialViewportWidget() + { + AZ::TransformNotificationBus::MultiHandler::BusDisconnect(); + AZ::TickBus::Handler::BusDisconnect(); + AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler::BusDisconnect(); + MaterialViewportNotificationBus::Handler::BusDisconnect(); + AZ::Data::AssetBus::Handler::BusDisconnect(); + + AzFramework::EntityContextId entityContextId; + AzFramework::GameEntityContextRequestBus::BroadcastResult( + entityContextId, &AzFramework::GameEntityContextRequestBus::Events::GetGameEntityContextId); + + AzFramework::EntityContextRequestBus::Event( + entityContextId, &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_iblEntity); + m_iblEntity = nullptr; + + AzFramework::EntityContextRequestBus::Event( + entityContextId, &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_modelEntity); + m_modelEntity = nullptr; + + AzFramework::EntityContextRequestBus::Event( + entityContextId, &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_shadowCatcherEntity); + m_shadowCatcherEntity = nullptr; + + AzFramework::EntityContextRequestBus::Event( + entityContextId, &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_gridEntity); + m_gridEntity = nullptr; + + AzFramework::EntityContextRequestBus::Event( + entityContextId, &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_cameraEntity); + m_cameraEntity = nullptr; + + AzFramework::EntityContextRequestBus::Event( + entityContextId, &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_postProcessEntity); + m_postProcessEntity = nullptr; + + for (DirectionalLightHandle& handle : m_lightHandles) + { + m_directionalLightFeatureProcessor->ReleaseLight(handle); + } + m_lightHandles.clear(); + + auto sceneSystem = AzFramework::SceneSystemInterface::Get(); + AZ_Assert(sceneSystem, "MaterialViewportWidget was unable to get the scene system during destruction."); + AZStd::shared_ptr mainScene = sceneSystem->GetScene(AzFramework::Scene::MainSceneName); + // This should never happen unless scene creation has changed. + AZ_Assert(mainScene, "Main scenes missing during system component destruction"); + mainScene->UnsetSubsystem(m_scene); + + m_swapChainPass = nullptr; + AZ::RPI::RPISystemInterface::Get()->UnregisterScene(m_scene); + m_scene = nullptr; + } + + void MaterialViewportWidget::OnDocumentOpened(const AZ::Uuid& documentId) + { + AZ::Data::Instance materialInstance; + MaterialDocumentRequestBus::EventResult(materialInstance, documentId, &MaterialDocumentRequestBus::Events::GetInstance); + + AZ::Render::MaterialAssignmentMap materials; + auto& materialAssignment = materials[AZ::Render::DefaultMaterialAssignmentId]; + materialAssignment.m_materialInstance = materialInstance; + materialAssignment.m_materialInstancePreCreated = true; + + AZ::Render::MaterialComponentRequestBus::Event( + m_modelEntity->GetId(), &AZ::Render::MaterialComponentRequestBus::Events::SetMaterialOverrides, materials); + } + + void MaterialViewportWidget::OnLightingPresetSelected(AZ::Render::LightingPresetPtr preset) + { + if (!preset) + { + return; + } + + AZ::Render::ImageBasedLightFeatureProcessorInterface* iblFeatureProcessor = + m_scene->GetFeatureProcessor(); + AZ::Render::PostProcessFeatureProcessorInterface* postProcessFeatureProcessor = + m_scene->GetFeatureProcessor(); + + AZ::Render::ExposureControlSettingsInterface* exposureControlSettingInterface = + postProcessFeatureProcessor->GetOrCreateSettingsInterface(m_postProcessEntity->GetId()) + ->GetOrCreateExposureControlSettingsInterface(); + + Camera::Configuration cameraConfig; + Camera::CameraRequestBus::EventResult( + cameraConfig, m_cameraEntity->GetId(), &Camera::CameraRequestBus::Events::GetCameraConfiguration); + + bool enableAlternateSkybox = false; + MaterialViewportRequestBus::BroadcastResult(enableAlternateSkybox, &MaterialViewportRequestBus::Events::GetAlternateSkyboxEnabled); + + preset->ApplyLightingPreset( + iblFeatureProcessor, m_skyboxFeatureProcessor, exposureControlSettingInterface, m_directionalLightFeatureProcessor, + cameraConfig, m_lightHandles, m_shadowCatcherMaterial, m_shadowCatcherOpacityPropertyIndex, enableAlternateSkybox); + } + + void MaterialViewportWidget::OnLightingPresetChanged(AZ::Render::LightingPresetPtr preset) + { + AZ::Render::LightingPresetPtr selectedPreset; + MaterialViewportRequestBus::BroadcastResult(selectedPreset, &MaterialViewportRequestBus::Events::GetLightingPresetSelection); + if (selectedPreset == preset) + { + OnLightingPresetSelected(preset); + } + } + + void MaterialViewportWidget::OnModelPresetSelected(AZ::Render::ModelPresetPtr preset) + { + if (!preset) + { + return; + } + + if (!preset->m_modelAsset.GetId().IsValid()) + { + AZ_Warning( + "MaterialViewportWidget", false, "Attempting to set invalid model for preset: '%s'\n.", preset->m_displayName.c_str()); + return; + } + + if (preset->m_modelAsset.GetId() == m_modelAssetId) + { + return; + } + + AZ::Render::MeshComponentRequestBus::Event( + m_modelEntity->GetId(), &AZ::Render::MeshComponentRequestBus::Events::SetModelAsset, preset->m_modelAsset); + + m_modelAssetId = preset->m_modelAsset.GetId(); + + AZ::Data::AssetBus::Handler::BusDisconnect(); + AZ::Data::AssetBus::Handler::BusConnect(m_modelAssetId); + } + + void MaterialViewportWidget::OnModelPresetChanged(AZ::Render::ModelPresetPtr preset) + { + AZ::Render::ModelPresetPtr selectedPreset; + MaterialViewportRequestBus::BroadcastResult(selectedPreset, &MaterialViewportRequestBus::Events::GetModelPresetSelection); + if (selectedPreset == preset) + { + OnModelPresetSelected(preset); + } + } + + void MaterialViewportWidget::OnShadowCatcherEnabledChanged(bool enable) + { + AZ::Render::MeshComponentRequestBus::Event( + m_shadowCatcherEntity->GetId(), &AZ::Render::MeshComponentRequestBus::Events::SetVisibility, enable); + } + + void MaterialViewportWidget::OnGridEnabledChanged(bool enable) + { + if (m_gridEntity) + { + if (enable && m_gridEntity->GetState() == AZ::Entity::State::Init) + { + m_gridEntity->Activate(); + } + else if (!enable && m_gridEntity->GetState() == AZ::Entity::State::Active) + { + m_gridEntity->Deactivate(); + } + } + } + + void MaterialViewportWidget::OnAlternateSkyboxEnabledChanged(bool enable) + { + AZ_UNUSED(enable); + AZ::Render::LightingPresetPtr selectedPreset; + MaterialViewportRequestBus::BroadcastResult(selectedPreset, &MaterialViewportRequestBus::Events::GetLightingPresetSelection); + OnLightingPresetSelected(selectedPreset); + } + + void MaterialViewportWidget::OnFieldOfViewChanged(float fieldOfView) + { + MaterialEditorViewportInputControllerRequestBus::Broadcast( + &MaterialEditorViewportInputControllerRequestBus::Handler::SetFieldOfView, fieldOfView); + } + + void MaterialViewportWidget::OnDisplayMapperOperationTypeChanged(AZ::Render::DisplayMapperOperationType operationType) + { + AZ::Render::DisplayMapperConfigurationDescriptor desc; + desc.m_operationType = operationType; + m_displayMapperFeatureProcessor->RegisterDisplayMapperConfiguration(desc); + } + + void MaterialViewportWidget::OnAssetReady(AZ::Data::Asset asset) + { + if (m_modelAssetId == asset.GetId()) + { + MaterialEditorViewportInputControllerRequestBus::Broadcast(&MaterialEditorViewportInputControllerRequestBus::Handler::Reset); + AZ::Data::AssetBus::Handler::BusDisconnect(asset.GetId()); + } + } + + void MaterialViewportWidget::OnTick(float deltaTime, AZ::ScriptTimePoint time) + { + AtomToolsFramework::RenderViewportWidget::OnTick(deltaTime, time); + + m_renderPipeline->AddToRenderTickOnce(); + + PerformanceMonitorRequestBus::Broadcast(&PerformanceMonitorRequestBus::Handler::GatherMetrics); + + if (m_shadowCatcherMaterial) + { + // Compile the m_shadowCatcherMaterial in OnTick because changes can only be compiled once per frame. + // This is ignored when a compile isn't needed. + m_shadowCatcherMaterial->Compile(); + } + } + + void MaterialViewportWidget::OnTransformChanged(const AZ::Transform&, const AZ::Transform&) + { + const AZ::EntityId* currentBusId = AZ::TransformNotificationBus::GetCurrentBusId(); + if (m_cameraEntity && currentBusId && *currentBusId == m_cameraEntity->GetId() && m_directionalLightFeatureProcessor) + { + auto transform = AZ::Transform::CreateIdentity(); + AZ::TransformBus::EventResult(transform, m_cameraEntity->GetId(), &AZ::TransformBus::Events::GetWorldTM); + for (const DirectionalLightHandle& id : m_lightHandles) + { + m_directionalLightFeatureProcessor->SetCameraTransform(id, transform); + } + } } } // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportWidget.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportWidget.h index 2a71dcc1df..8a660c6603 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportWidget.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportWidget.h @@ -5,42 +5,115 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ + #pragma once #if !defined(Q_MOC_RUN) +#include +#include +#include +#include +#include +#include +#include #include +#include +#include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT #include AZ_POP_DISABLE_WARNING #endif -#include +namespace AZ +{ + namespace Render + { + class DisplayMapperFeatureProcessorInterface; + } + + class Entity; + class Component; + + namespace RPI + { + class SwapChainPass; + class WindowContext; + } // namespace RPI +} // namespace AZ namespace Ui { class MaterialViewportWidget; } -namespace AZ -{ - namespace RPI - { - class WindowContext; - } -} - namespace MaterialEditor { - class MaterialViewportRenderer; - class MaterialViewportWidget : public AtomToolsFramework::RenderViewportWidget + , public AZ::Data::AssetBus::Handler + , public AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler + , public MaterialViewportNotificationBus::Handler + , public AZ::TransformNotificationBus::MultiHandler { public: MaterialViewportWidget(QWidget* parent = nullptr); + ~MaterialViewportWidget(); + + private: + // AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler interface overrides... + void OnDocumentOpened(const AZ::Uuid& documentId) override; + + // MaterialViewportNotificationBus::Handler interface overrides... + void OnLightingPresetSelected(AZ::Render::LightingPresetPtr preset) override; + void OnLightingPresetChanged(AZ::Render::LightingPresetPtr preset) override; + void OnModelPresetSelected(AZ::Render::ModelPresetPtr preset) override; + void OnModelPresetChanged(AZ::Render::ModelPresetPtr preset) override; + void OnShadowCatcherEnabledChanged(bool enable) override; + void OnGridEnabledChanged(bool enable) override; + void OnAlternateSkyboxEnabledChanged(bool enable) override; + void OnFieldOfViewChanged(float fieldOfView) override; + void OnDisplayMapperOperationTypeChanged(AZ::Render::DisplayMapperOperationType operationType) override; + + // AZ::Data::AssetBus::Handler interface overrides... + void OnAssetReady(AZ::Data::Asset asset) override; + + // AZ::TickBus::Handler interface overrides... + void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; + + // AZ::TransformNotificationBus::MultiHandler overrides... + void OnTransformChanged(const AZ::Transform&, const AZ::Transform&) override; + + using DirectionalLightHandle = AZ::Render::DirectionalLightFeatureProcessorInterface::LightHandle; + + AZ::Data::Instance m_swapChainPass; + AZStd::string m_defaultPipelineAssetPath = "passes/MainRenderPipeline.azasset"; + AZ::RPI::RenderPipelinePtr m_renderPipeline; + AZ::RPI::ScenePtr m_scene; + AZ::Render::DirectionalLightFeatureProcessorInterface* m_directionalLightFeatureProcessor = {}; + AZ::Render::DisplayMapperFeatureProcessorInterface* m_displayMapperFeatureProcessor = {}; + + AZ::Entity* m_cameraEntity = {}; + AZ::Component* m_cameraComponent = {}; + + AZ::Entity* m_postProcessEntity = {}; + + AZ::Entity* m_modelEntity = {}; + AZ::Data::AssetId m_modelAssetId; + + AZ::Entity* m_gridEntity = {}; + + AZ::Entity* m_shadowCatcherEntity = {}; + AZ::Data::Instance m_shadowCatcherMaterial; + AZ::RPI::MaterialPropertyIndex m_shadowCatcherOpacityPropertyIndex; + + AZStd::vector m_lightHandles; + + AZ::Entity* m_iblEntity = {}; + AZ::Render::SkyBoxFeatureProcessorInterface* m_skyboxFeatureProcessor = {}; + + AZStd::shared_ptr m_viewportController; QScopedPointer m_ui; - AZStd::unique_ptr m_renderer; }; } // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake b/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake index 9d1e2b22f8..f7a15d2bcc 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake +++ b/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake @@ -49,8 +49,6 @@ set(FILES Source/Viewport/MaterialViewportWidget.cpp Source/Viewport/MaterialViewportWidget.h Source/Viewport/MaterialViewportWidget.ui - Source/Viewport/MaterialViewportRenderer.cpp - Source/Viewport/MaterialViewportRenderer.h Source/Viewport/PerformanceMonitorComponent.cpp Source/Viewport/PerformanceMonitorComponent.h From 1643c68fa7f133ff68eb7405e43e5a22f2901de5 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Sun, 23 Jan 2022 18:26:31 -0800 Subject: [PATCH 387/620] chore: fix compiling errors Signed-off-by: Michael Pollind --- .../Input/QtEventToAzInputMapperTests.cpp | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index 31193f6f05..78a08af6cb 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -562,7 +562,7 @@ namespace UnitTest AZ::Vector2 accumulatedPosition(0.0f,0.0f); for(const auto& pos: m_azCursorPositions) { - accumulatedPosition += (pos.m_normalizedPositionDelta * AZ::Vector2(WidgetSize.width(), WidgetSize.height())); + accumulatedPosition += (pos.m_normalizedPositionDelta * AZ::Vector2((float)WidgetSize.width(), (float)WidgetSize.height())); } // validate @@ -584,106 +584,106 @@ namespace UnitTest // verify CursorModeWrappedX wrapping MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedX, 40, - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height() / 2), QPoint(40, 0), - QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height() / 2), "CursorModeWrappedX_Test_Right" }, MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedX, 40, - QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height() / 2), QPoint(-40, 0), - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2), "CursorModeWrappedX_Test_Left" }, MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedX, 40, - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, 20), QPoint(0, -40), - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, -20.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, -20), "CursorModeWrappedX_Test_Top" }, MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedX, 40, - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), QPoint(0, 40), - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() + 20), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, QtEventToAzInputMapperFixture::WidgetSize.height() + 20), "CursorModeWrappedX_Test_Bottom" }, // verify CursorModeWrappedY wrapping MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedY, 40, - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2), QPoint(40, 0), - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() + 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() + 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2), "CursorModeWrappedY_Test_Right" }, MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedY, 40, - QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height() / 2), QPoint(-40, 0), - QPoint(-20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(-20, QtEventToAzInputMapperFixture::WidgetSize.height() / 2), "CursorModeWrappedY_Test_Left" }, MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedY, 40, - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, 20), QPoint(0, -40), - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), "CursorModeWrappedY_Test_Top" }, MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedY, 40, - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), QPoint(0, 40), - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, 20), "CursorModeWrappedY_Test_Bottom" }, // verify CursorModeWrapped wrapping MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrapped, 40, - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2), QPoint(40, 0), - QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2), "CursorModeWrapped_Test_Right" }, MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrapped, 40, - QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height() / 2), QPoint(-40, 0), - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2), "CursorModeWrapped_Test_Left" }, MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrapped, 40, - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, 20), QPoint(0, -40), - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), "CursorModeWrapped_Test_Top" }, MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrapped, 40, - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), QPoint(0, 40), - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, 20), "CursorModeWrapped_Test_Bottom" }, // verify CursorModeCaptured MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeCaptured, 40, - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() / 2.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, QtEventToAzInputMapperFixture::WidgetSize.height() / 2), QPoint(0, 40), - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() / 2.0f), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, QtEventToAzInputMapperFixture::WidgetSize.height() / 2), "CursorModeCaptured" }, // verify CursorModeNone MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeNone, 40, - QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() / 2.0f), - QPoint(40.0f, 0), - QPoint((QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f) + 40.0f, (QtEventToAzInputMapperFixture::WidgetSize.height() / 2.0f)), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2, QtEventToAzInputMapperFixture::WidgetSize.height() / 2), + QPoint(40, 0), + QPoint((QtEventToAzInputMapperFixture::WidgetSize.width() / 2) + 40, (QtEventToAzInputMapperFixture::WidgetSize.height() / 2)), "CursorModeNone" } ), From 3113b8be03c02b12d9b94b1ae5d4d5eae471a948 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Sun, 23 Jan 2022 23:17:25 -0800 Subject: [PATCH 388/620] Fix for 'Cannot Find PThread' when using GCC (#7097) * Fix for 'Cannot Find PThread' when using GCC Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> * Fix error when COMPILATION_C and COMPILATION_CXX handling in ly_append_configurations_options Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> * Add missing 'PARENT_SCOPE' when appending to the CMAKE_C_FLAGS and CMAKE_CXX_FLAGS Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> * Fix appending of CMAKE_C_FLAGS and CMAKE_CXX_FLAGS Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> * Workaround for C/C++ compilation flag settings for gcc. COMPILATION_C/COMPILATION_CXX is wiping out COMPILATION, so define each one separately with no sharing Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> * Remove unnecessary gcc ignore warnings for C files Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- cmake/Configurations.cmake | 13 +++++----- .../Common/GCC/Configurations_gcc.cmake | 24 +++++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/cmake/Configurations.cmake b/cmake/Configurations.cmake index 63af3d8810..20d94024bb 100644 --- a/cmake/Configurations.cmake +++ b/cmake/Configurations.cmake @@ -42,6 +42,8 @@ include(cmake/ConfigurationTypes.cmake) # \arg:LINK_SHARED # \arg:LINK_SHARED_${CONFIGURATION} # +# Note: COMPILATION_C/COMPILATION_CXX are mutually exclusive with COMPILATION. You can only specify COMPILATION for C/C++ flags or +# a combination of COMPILATION_C/COMPILATION_CXX for the separate c/c++ flags separately. function(ly_append_configurations_options) set(options) @@ -80,15 +82,14 @@ function(ly_append_configurations_options) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILATION_STR}" PARENT_SCOPE) endif() if(ly_append_configurations_options_COMPILATION_C) - string(REPLACE ";" " " COMPILATION_STR "${ly_append_configurations_options_COMPILATION}") - string(APPEND CMAKE_C_FLAGS " " ${COMPILATION_STR}) - set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} PARENT_SCOPE) + string(REPLACE ";" " " COMPILATION_STR "${ly_append_configurations_options_COMPILATION_C}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILATION_STR}" PARENT_SCOPE) endif() if(ly_append_configurations_options_COMPILATION_CXX) - string(REPLACE ";" " " COMPILATION_STR "${ly_append_configurations_options_COMPILATION}") - string(APPEND CMAKE_CXX_FLAGS " " ${COMPILATION_STR}) - set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE) + string(REPLACE ";" " " COMPILATION_STR "${ly_append_configurations_options_COMPILATION_CXX}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILATION_STR}" PARENT_SCOPE) endif() + if(ly_append_configurations_options_LINK) string(REPLACE ";" " " LINK_STR "${ly_append_configurations_options_LINK}") set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} ${LINK_STR}" PARENT_SCOPE) diff --git a/cmake/Platform/Common/GCC/Configurations_gcc.cmake b/cmake/Platform/Common/GCC/Configurations_gcc.cmake index 17c2474fb8..3db96306ee 100644 --- a/cmake/Platform/Common/GCC/Configurations_gcc.cmake +++ b/cmake/Platform/Common/GCC/Configurations_gcc.cmake @@ -20,7 +20,17 @@ endif() ly_append_configurations_options( - COMPILATION + + COMPILATION_C + -fno-exceptions + -fvisibility=hidden + -Wall + -Werror + + ${LY_GCC_GCOV_FLAGS} + ${LY_GCC_GPROF_FLAGS} + + COMPILATION_CXX -fno-exceptions -fvisibility=hidden -Wall @@ -40,10 +50,8 @@ ly_append_configurations_options( -Wno-unused-value -Wno-unused-variable -Wno-format-truncation - -Wno-reorder -Wno-uninitialized -Wno-array-bounds - -Wno-class-memaccess -Wno-nonnull-compare -Wno-strict-aliasing -Wno-unused-result @@ -58,18 +66,14 @@ ly_append_configurations_options( -Wno-enum-compare -Wno-int-in-bool-context -Wno-sequence-point - -Wno-delete-non-virtual-dtor -Wno-comment - -Wno-reorder -Wno-restrict -Wno-format-overflow - - COMPILATION_C - -Wno-absolute-value - - COMPILATION_CXX -fvisibility-inlines-hidden -Wno-invalid-offsetof + -Wno-class-memaccess + -Wno-delete-non-virtual-dtor + -Wno-reorder COMPILATION_DEBUG -O0 # No optimization From 59409822446d896aed127c587eda277c1d47cde1 Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Date: Mon, 24 Jan 2022 10:41:32 +0000 Subject: [PATCH 389/620] Ensure render geometry is refreshed when the mesh component controller is moved (#6452) * ensure render geometry is refreshed when the mesh component controller is moved Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * cache bus pointer and send update notification when mesh changes Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * add integration test to detect MeshComponentController notification to IntersectionNotificationBus Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * remove optimize off Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * update build visibility for AtomLyIntegration editor static lib Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * move runtime dependencies to gem module Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- .../AzFramework/Render/Intersector.h | 26 ++-- .../CommonFeatures/Code/CMakeLists.txt | 50 +++++++- .../Source/Mesh/MeshComponentController.cpp | 36 ++++-- .../Source/Mesh/MeshComponentController.h | 3 +- .../CommonFeatures/Code/Tests/Main.cpp | 39 ++++++ .../Tests/MeshComponentControllerTests.cpp | 116 ++++++++++++++++++ ...egration_commonfeatures_editor_files.cmake | 1 - ...ion_commonfeatures_editor_test_files.cmake | 11 ++ 8 files changed, 253 insertions(+), 29 deletions(-) create mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Tests/Main.cpp create mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Tests/MeshComponentControllerTests.cpp create mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_editor_test_files.cmake diff --git a/Code/Framework/AzFramework/AzFramework/Render/Intersector.h b/Code/Framework/AzFramework/AzFramework/Render/Intersector.h index acd6553c32..ba11996a65 100644 --- a/Code/Framework/AzFramework/AzFramework/Render/Intersector.h +++ b/Code/Framework/AzFramework/AzFramework/Render/Intersector.h @@ -5,25 +5,23 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ + #pragma once #include #include #include - #include +#include #include #include -#include - namespace AzFramework { - namespace RenderGeometry { - //! Implementation of IntersectorBus interface, this class contains a cached AABB list - //! of the connected entities to the intersection bus and calculates performant ray intersections against them + //! Implementation of IntersectorBus interface, this class contains a cached AABB list of the connected + //! entities to the intersection bus and calculates efficient ray intersections against them. class Intersector final : public IntersectorBus::Handler , protected IntersectionNotificationBus::Handler @@ -34,32 +32,32 @@ namespace AzFramework Intersector(AzFramework::EntityContextId contextId); ~Intersector(); - // IntersectorBus + // IntersectorBus overrides ... RayResult RayIntersect(const RayRequest& ray) override; - // IntersectionNotifications + // IntersectionNotificationBus overrides ... void OnEntityConnected(AZ::EntityId entityId) override; void OnEntityDisconnected(AZ::EntityId entityId) override; void OnGeometryChanged(AZ::EntityId entityId) override; private: - struct EntityData { EntityData(AZ::EntityId id, AZ::Aabb aabb) : m_id(id) , m_aabb(aabb) - , m_ref(1) {} + , m_ref(1) + { + } AZ::EntityId m_id; AZ::Aabb m_aabb; int m_ref; }; - + class EntityDataList { public: - int AddRef(AZ::EntityId entityId); int RemoveRef(AZ::EntityId entityId); void Update(const EntityData& newData); @@ -88,5 +86,5 @@ namespace AzFramework AZStd::vector> m_candidatesSortedByDist; AzFramework::EntityContextId m_contextId; }; - } -} + } // namespace RenderGeometry +} // namespace AzFramework diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/CMakeLists.txt b/Gems/AtomLyIntegration/CommonFeatures/Code/CMakeLists.txt index 3234db2292..7c31751421 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/CMakeLists.txt @@ -77,8 +77,7 @@ ly_create_alias(NAME AtomLyIntegration_CommonFeatures.Servers NAMESPACE Gem if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( - NAME AtomLyIntegration_CommonFeatures.Editor GEM_MODULE - + NAME AtomLyIntegration_CommonFeatures.Editor.Static STATIC NAMESPACE Gem AUTOUIC AUTOMOC @@ -98,7 +97,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PRIVATE ATOMLYINTEGRATION_FEATURE_COMMON_EDITOR BUILD_DEPENDENCIES - PRIVATE + PUBLIC Gem::AtomLyIntegration_CommonFeatures.Static Gem::Atom_RPI.Edit Gem::AtomToolsFramework.Static @@ -108,6 +107,24 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Legacy::Editor.Headers Legacy::EditorCommon Legacy::CryCommon + ) + + ly_add_target( + NAME AtomLyIntegration_CommonFeatures.Editor GEM_MODULE + NAMESPACE Gem + FILES_CMAKE + atomlyintegration_commonfeatures_shared_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Source + PUBLIC + Include + COMPILE_DEFINITIONS + PRIVATE + ATOMLYINTEGRATION_FEATURE_COMMON_EDITOR + BUILD_DEPENDENCIES + PRIVATE + Gem::AtomLyIntegration_CommonFeatures.Editor.Static RUNTIME_DEPENDENCIES Gem::Atom_RPI.Editor Gem::Atom_Feature_Common.Editor @@ -128,6 +145,33 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Gem::AtomLyIntegration_CommonFeatures.Editor Gem::GradientSignal.Tools ) + + ################################################################################ + # Tests + ################################################################################ + if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) + ly_add_target( + NAME AtomLyIntegration_CommonFeatures.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE Gem + FILES_CMAKE + atomlyintegration_commonfeatures_editor_test_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Tests + Source + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTest + AZ::AzTestShared + AZ::AzToolsFramework + AZ::AzToolsFrameworkTestCommon + Gem::AtomLyIntegration_CommonFeatures.Static + Gem::AtomLyIntegration_CommonFeatures.Editor.Static + ) + ly_add_googletest( + NAME Gem::AtomLyIntegration_CommonFeatures.Editor.Tests + ) + endif() endif() # AtomLyIntegration_CommonFeatures gem targets are required as part of the Editor and AssetProcessor diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp index a68ad24adf..e26d328e17 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp @@ -82,7 +82,6 @@ namespace AZ ->Field("MinimumScreenCoverage", &MeshComponentConfig::m_minimumScreenCoverage) ->Field("QualityDecayRate", &MeshComponentConfig::m_qualityDecayRate); } - } bool MeshComponentConfig::IsAssetSet() @@ -225,33 +224,42 @@ namespace AZ { } + static AzFramework::EntityContextId FindOwningContextId(const AZ::EntityId entityId) + { + AzFramework::EntityContextId contextId = AzFramework::EntityContextId::CreateNull(); + AzFramework::EntityIdContextQueryBus::EventResult( + contextId, entityId, &AzFramework::EntityIdContextQueries::GetOwningContextId); + return contextId; + } + void MeshComponentController::Activate(const AZ::EntityComponentIdPair& entityComponentIdPair) { const AZ::EntityId entityId = entityComponentIdPair.GetEntityId(); m_entityComponentIdPair = entityComponentIdPair; m_transformInterface = TransformBus::FindFirstHandler(entityId); - AZ_Warning("MeshComponentController", m_transformInterface, "Unable to attach to a TransformBus handler. This mesh will always be rendered at the origin."); + AZ_Warning( + "MeshComponentController", m_transformInterface, + "Unable to attach to a TransformBus handler. This mesh will always be rendered at the origin."); m_meshFeatureProcessor = RPI::Scene::GetFeatureProcessorForEntity(entityId); AZ_Error("MeshComponentController", m_meshFeatureProcessor, "Unable to find a MeshFeatureProcessorInterface on the entityId."); m_cachedNonUniformScale = AZ::Vector3::CreateOne(); AZ::NonUniformScaleRequestBus::EventResult(m_cachedNonUniformScale, entityId, &AZ::NonUniformScaleRequests::GetScale); - AZ::NonUniformScaleRequestBus::Event(entityId, &AZ::NonUniformScaleRequests::RegisterScaleChangedEvent, - m_nonUniformScaleChangedHandler); + AZ::NonUniformScaleRequestBus::Event( + entityId, &AZ::NonUniformScaleRequests::RegisterScaleChangedEvent, m_nonUniformScaleChangedHandler); + const auto entityContextId = FindOwningContextId(entityId); MeshComponentRequestBus::Handler::BusConnect(entityId); TransformNotificationBus::Handler::BusConnect(entityId); MaterialReceiverRequestBus::Handler::BusConnect(entityId); MaterialComponentNotificationBus::Handler::BusConnect(entityId); AzFramework::BoundsRequestBus::Handler::BusConnect(entityId); - AzFramework::EntityContextId contextId; - AzFramework::EntityIdContextQueryBus::EventResult( - contextId, entityId, &AzFramework::EntityIdContextQueries::GetOwningContextId); - AzFramework::RenderGeometry::IntersectionRequestBus::Handler::BusConnect({entityId, contextId}); + AzFramework::RenderGeometry::IntersectionRequestBus::Handler::BusConnect({ entityId, entityContextId }); + AzFramework::RenderGeometry::IntersectionNotificationBus::Bind(m_intersectionNotificationBus, entityContextId); - //Buses must be connected before RegisterModel in case requests are made as a result of HandleModelChange + // Buses must be connected before RegisterModel in case requests are made as a result of HandleModelChange RegisterModel(); } @@ -291,6 +299,11 @@ namespace AZ { m_meshFeatureProcessor->SetTransform(m_meshHandle, world, m_cachedNonUniformScale); } + + // ensure the render geometry is kept in sync with any changes to the entity the mesh is on + AzFramework::RenderGeometry::IntersectionNotificationBus::Event( + m_intersectionNotificationBus, &AzFramework::RenderGeometry::IntersectionNotificationBus::Events::OnGeometryChanged, + m_entityComponentIdPair.GetEntityId()); } void MeshComponentController::HandleNonUniformScaleChange(const AZ::Vector3& nonUniformScale) @@ -301,7 +314,7 @@ namespace AZ m_meshFeatureProcessor->SetTransform(m_meshHandle, m_transformInterface->GetWorldTM(), m_cachedNonUniformScale); } } - + RPI::ModelMaterialSlotMap MeshComponentController::GetModelMaterialSlots() const { Data::Asset modelAsset = GetModelAsset(); @@ -369,6 +382,9 @@ namespace AZ MeshComponentNotificationBus::Event(entityId, &MeshComponentNotificationBus::Events::OnModelReady, m_configuration.m_modelAsset, model); MaterialReceiverNotificationBus::Event(entityId, &MaterialReceiverNotificationBus::Events::OnMaterialAssignmentsChanged); AZ::Interface::Get()->RefreshEntityLocalBoundsUnion(entityId); + AzFramework::RenderGeometry::IntersectionNotificationBus::Event( + m_intersectionNotificationBus, &AzFramework::RenderGeometry::IntersectionNotificationBus::Events::OnGeometryChanged, + m_entityComponentIdPair.GetEntityId()); } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h index 76cf6a1b39..cecd744b80 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h @@ -162,6 +162,8 @@ namespace AZ bool m_isVisible = true; MeshComponentConfig m_configuration; AZ::Vector3 m_cachedNonUniformScale = AZ::Vector3::CreateOne(); + //! Cached bus to use to notify RenderGeometry::Intersector the entity/component has changed. + AzFramework::RenderGeometry::IntersectionNotificationBus::BusPtr m_intersectionNotificationBus; MeshFeatureProcessorInterface::ModelChangedEvent::Handler m_changeEventHandler { @@ -173,6 +175,5 @@ namespace AZ [&](const AZ::Vector3& nonUniformScale) { HandleNonUniformScaleChange(nonUniformScale); } }; }; - } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Tests/Main.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Tests/Main.cpp new file mode 100644 index 0000000000..2d75cf96f5 --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Tests/Main.cpp @@ -0,0 +1,39 @@ +/* + * 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 + * + */ + +#include +#include + +#include + +class AtomLyIntegrationHook : public AZ::Test::ITestEnvironment +{ +public: + void SetupEnvironment() override + { + AZ::AllocatorInstance::Create(); + } + + void TeardownEnvironment() override + { + AZ::AllocatorInstance::Destroy(); + } +}; + +// required to support running integration tests with Qt +AZTEST_EXPORT int AZ_UNIT_TEST_HOOK_NAME(int argc, char** argv) +{ + ::testing::InitGoogleMock(&argc, argv); + QApplication app(argc, argv); + AZ::Test::printUnusedParametersWarning(argc, argv); + AZ::Test::addTestEnvironments({ DEFAULT_UNIT_TEST_ENV, new AtomLyIntegrationHook }); + int result = RUN_ALL_TESTS(); + return result; +} + +IMPLEMENT_TEST_EXECUTABLE_MAIN(); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Tests/MeshComponentControllerTests.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Tests/MeshComponentControllerTests.cpp new file mode 100644 index 0000000000..bc1bf3a247 --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Tests/MeshComponentControllerTests.cpp @@ -0,0 +1,116 @@ +/* + * 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 + * + */ + +#include +#include +#include + +#include +#include + +namespace UnitTest +{ + static AzFramework::EntityContextId FindOwningContextId(const AZ::EntityId entityId) + { + AzFramework::EntityContextId contextId = AzFramework::EntityContextId::CreateNull(); + AzFramework::EntityIdContextQueryBus::EventResult(contextId, entityId, &AzFramework::EntityIdContextQueries::GetOwningContextId); + return contextId; + } + + class IntersectionNotificationDetector : public AzFramework::RenderGeometry::IntersectionNotificationBus::Handler + { + public: + void Connect(const AzFramework::EntityContextId& entityContextId); + void Disconnect(); + + // IntersectionNotificationBus overrides ... + void OnEntityConnected(AZ::EntityId entityId) override; + void OnEntityDisconnected(AZ::EntityId entityId) override; + void OnGeometryChanged(AZ::EntityId entityId) override; + + AZ::EntityId m_lastEntityIdChanged; + }; + + void IntersectionNotificationDetector::Connect(const AzFramework::EntityContextId& entityContextId) + { + AzFramework::RenderGeometry::IntersectionNotificationBus::Handler::BusConnect(entityContextId); + } + + void IntersectionNotificationDetector::Disconnect() + { + AzFramework::RenderGeometry::IntersectionNotificationBus::Handler::BusDisconnect(); + } + + void IntersectionNotificationDetector::OnEntityConnected([[maybe_unused]] AZ::EntityId entityId) + { + } + + void IntersectionNotificationDetector::OnEntityDisconnected([[maybe_unused]] AZ::EntityId entityId) + { + } + + void IntersectionNotificationDetector::OnGeometryChanged(AZ::EntityId entityId) + { + m_lastEntityIdChanged = entityId; + } + + class MeshComponentControllerFixture : public ToolsApplicationFixture + { + public: + void SetUpEditorFixtureImpl() override + { + m_meshComponentDescriptor = AZStd::unique_ptr(AZ::Render::MeshComponent::CreateDescriptor()); + m_meshComponentDescriptor->Reflect(GetApplication()->GetSerializeContext()); + + m_editorMeshComponentDescriptor = + AZStd::unique_ptr(AZ::Render::EditorMeshComponent::CreateDescriptor()); + m_editorMeshComponentDescriptor->Reflect(GetApplication()->GetSerializeContext()); + + m_entityId1 = CreateDefaultEditorEntity("Entity1"); + m_entityIds.push_back(m_entityId1); + + m_intersectionNotificationDetector.Connect(FindOwningContextId(m_entityId1)); + } + + void TearDownEditorFixtureImpl() override + { + bool entityDestroyed = false; + AzToolsFramework::EditorEntityContextRequestBus::BroadcastResult( + entityDestroyed, &AzToolsFramework::EditorEntityContextRequestBus::Events::DestroyEditorEntity, m_entityId1); + + m_intersectionNotificationDetector.Disconnect(); + + m_meshComponentDescriptor.reset(); + m_editorMeshComponentDescriptor.reset(); + } + + AZ::EntityId m_entityId1; + AzToolsFramework::EntityIdList m_entityIds; + AZStd::unique_ptr m_meshComponentDescriptor; + AZStd::unique_ptr m_editorMeshComponentDescriptor; + IntersectionNotificationDetector m_intersectionNotificationDetector; + }; + + TEST_F(MeshComponentControllerFixture, IntersectionNotificationBusIsNotifiedWhenMeshComponentControllerTransformIsModified) + { + auto* entity1 = AzToolsFramework::GetEntityById(m_entityId1); + entity1->Deactivate(); + entity1->CreateComponent(); + // note: RPI::Scene::GetFeatureProcessorForEntity(...) returns nullptr + // and so m_meshFeatureProcessor is null + AZ_TEST_START_TRACE_SUPPRESSION; + entity1->Activate(); + AZ_TEST_STOP_TRACE_SUPPRESSION(1); + + AZ::TransformBus::Event( + m_entityId1, &AZ::TransformBus::Events::SetWorldTM, AZ::Transform::CreateTranslation(AZ::Vector3(1.0f, 2.0f, 3.0f))); + + using ::testing::Eq; + EXPECT_THAT(m_entityId1, Eq(m_intersectionNotificationDetector.m_lastEntityIdChanged)); + } +} // namespace UnitTest diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_editor_files.cmake b/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_editor_files.cmake index 0dea725d70..018795dcf2 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_editor_files.cmake +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_editor_files.cmake @@ -10,7 +10,6 @@ set(FILES Include/AtomLyIntegration/CommonFeatures/Material/EditorMaterialSystemComponentNotificationBus.h Include/AtomLyIntegration/CommonFeatures/Material/EditorMaterialSystemComponentRequestBus.h Include/AtomLyIntegration/CommonFeatures/ReflectionProbe/EditorReflectionProbeBus.h - Source/Module.cpp Source/Animation/EditorAttachmentComponent.h Source/Animation/EditorAttachmentComponent.cpp Source/EditorCommonFeaturesSystemComponent.h diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_editor_test_files.cmake b/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_editor_test_files.cmake new file mode 100644 index 0000000000..5a58124e0a --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_editor_test_files.cmake @@ -0,0 +1,11 @@ +# +# 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 +# +# + +set(FILES + Tests/Main.cpp + Tests/MeshComponentControllerTests.cpp) From d412f3cc502d598464422444ea991cd0cfb0ab84 Mon Sep 17 00:00:00 2001 From: greerdv Date: Mon, 24 Jan 2022 12:38:15 +0000 Subject: [PATCH 390/620] update with feedback from PR Signed-off-by: greerdv --- .../Source/EditorShapeColliderComponent.cpp | 17 ++++++++--------- .../Code/Source/EditorShapeColliderComponent.h | 4 ++-- .../Code/Tests/ShapeColliderComponentTests.cpp | 16 +++++++++------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp index bdf70fc227..d99a76f306 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp @@ -55,7 +55,7 @@ namespace PhysX m_colliderConfig.SetPropertyVisibility(Physics::ColliderConfiguration::Offset, false); } - AZ::Crc32 EditorShapeColliderComponent::SubdivisionCountVisibility() + AZ::Crc32 EditorShapeColliderComponent::SubdivisionCountVisibility() const { if (m_shapeType == ShapeType::Cylinder) { @@ -65,7 +65,7 @@ namespace PhysX return AZ::Edit::PropertyVisibility::Hide; } - AZ::Crc32 EditorShapeColliderComponent::SingleSidedVisibility() + AZ::Crc32 EditorShapeColliderComponent::SingleSidedVisibility() const { if ((m_shapeType == ShapeType::QuadSingleSided || m_shapeType == ShapeType::QuadDoubleSided) && GetEntity()->FindComponent() == nullptr) @@ -124,16 +124,16 @@ namespace PhysX void EditorShapeColliderComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) { - provided.push_back(AZ_CRC("PhysicsWorldBodyService", 0x944da0cc)); - provided.push_back(AZ_CRC("PhysXColliderService", 0x4ff43f7c)); - provided.push_back(AZ_CRC("PhysXTriggerService", 0x3a117d7b)); - provided.push_back(AZ_CRC("PhysXShapeColliderService", 0x98a7e779)); + provided.push_back(AZ_CRC_CE("PhysicsWorldBodyService")); + provided.push_back(AZ_CRC_CE("PhysXColliderService")); + provided.push_back(AZ_CRC_CE("PhysXTriggerService")); + provided.push_back(AZ_CRC_CE("PhysXShapeColliderService")); } void EditorShapeColliderComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) { - required.push_back(AZ_CRC("TransformService", 0x8ee22c50)); - required.push_back(AZ_CRC("ShapeService", 0xe86aa5fe)); + required.push_back(AZ_CRC_CE("TransformService")); + required.push_back(AZ_CRC_CE("ShapeService")); } void EditorShapeColliderComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) @@ -422,7 +422,6 @@ namespace PhysX SetShapeConfig(ShapeType::QuadSingleSided, shapeConfig); } - else { // it's not possible to create a perfectly 2d convex in PhysX, so the best we can do is a very thin box diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h index 0f5350b781..09d5f803fc 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h @@ -105,9 +105,9 @@ namespace PhysX void RefreshUiProperties(); AZ::u32 OnSubdivisionCountChange(); - AZ::Crc32 SubdivisionCountVisibility(); + AZ::Crc32 SubdivisionCountVisibility() const; void OnSingleSidedChange(); - AZ::Crc32 SingleSidedVisibility(); + AZ::Crc32 SingleSidedVisibility() const; // AZ::Component void Activate() override; diff --git a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp index c164e5de63..c9dcbe64d1 100644 --- a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp +++ b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp @@ -470,7 +470,7 @@ namespace PhysXEditorTests void SetTrigger(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent, bool isTrigger) { - SetBoolValueOnComponent(editorShapeColliderComponent, AZ_CRC("Trigger", 0x1a6b0f5d), isTrigger); + SetBoolValueOnComponent(editorShapeColliderComponent, AZ_CRC_CE("Trigger"), isTrigger); } bool GetBoolValueFromComponent(AZ::Component* component, AZ::Crc32 name) @@ -489,17 +489,17 @@ namespace PhysXEditorTests bool IsTrigger(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent) { - return GetBoolValueFromComponent(editorShapeColliderComponent, AZ_CRC("Trigger")); + return GetBoolValueFromComponent(editorShapeColliderComponent, AZ_CRC_CE("Trigger")); } void SetSingleSided(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent, bool singleSided) { - SetBoolValueOnComponent(editorShapeColliderComponent, AZ_CRC("SingleSided"), singleSided); + SetBoolValueOnComponent(editorShapeColliderComponent, AZ_CRC_CE("SingleSided"), singleSided); } bool IsSingleSided(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent) { - return GetBoolValueFromComponent(editorShapeColliderComponent, AZ_CRC("SingleSided")); + return GetBoolValueFromComponent(editorShapeColliderComponent, AZ_CRC_CE("SingleSided")); } EntityPtr CreateRigidBox(const AZ::Vector3& boxDimensions, const AZ::Vector3& position) @@ -636,7 +636,6 @@ namespace PhysXEditorTests EXPECT_NEAR(aabb.GetMin().GetY(), -0.6f, 1e-3f); EXPECT_NEAR(aabb.GetMax().GetX(), 2.7f, 1e-3f); EXPECT_NEAR(aabb.GetMax().GetY(), 0.6f, 1e-3f); - EXPECT_TRUE(true); } TEST_P(PhysXEditorParamBoolFixture, EditorShapeColliderComponent_TriggerSettingIsRememberedWhenSwitchingToQuadAndBack) @@ -731,9 +730,12 @@ namespace PhysXEditorTests EntityPtr gameQuadEntity = CreateActiveGameEntityFromEditorEntity(editorQuadEntity.get()); EntityPtr gameBoxEntity = CreateActiveGameEntityFromEditorEntity(editorBoxEntity.get()); - // give the box enough upward velocity to rise above the level of the quad and simulate + // give the box enough upward velocity to rise above the level of the quad + // simulate for enough time that the box would have reached the top of its trajectory and fallen back past the starting point if + // it hadn't collided with the top of the quad + const int numTimesteps = 100; Physics::RigidBodyRequestBus::Event(gameBoxEntity->GetId(), &Physics::RigidBodyRequests::SetLinearVelocity, AZ::Vector3::CreateAxisZ(6.0f)); - PhysX::TestUtils::UpdateScene(m_defaultScene, AzPhysics::SystemConfiguration::DefaultFixedTimestep, 200); + PhysX::TestUtils::UpdateScene(m_defaultScene, AzPhysics::SystemConfiguration::DefaultFixedTimestep, numTimesteps); // the box should travel through the base of the quad because it has no collision from that direction // and land on the top surface of the quad, which does have collision From 7b649656bc870de433e0d6a8db6eb63b230a6cc5 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Mon, 24 Jan 2022 07:30:39 -0800 Subject: [PATCH 391/620] chore: use numeric cast for QtEventTOAzInputMapperTest Signed-off-by: Michael Pollind --- .../Tests/Input/QtEventToAzInputMapperTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index 78a08af6cb..8222a115f6 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -562,7 +562,7 @@ namespace UnitTest AZ::Vector2 accumulatedPosition(0.0f,0.0f); for(const auto& pos: m_azCursorPositions) { - accumulatedPosition += (pos.m_normalizedPositionDelta * AZ::Vector2((float)WidgetSize.width(), (float)WidgetSize.height())); + accumulatedPosition += (pos.m_normalizedPositionDelta * AZ::Vector2(aznumeric_cast(WidgetSize.width()), aznumeric_cast(WidgetSize.height()))); } // validate From 37c0b661f94ffbde91364ff8536dc916dcc48c6c Mon Sep 17 00:00:00 2001 From: moraaar Date: Mon, 24 Jan 2022 15:49:33 +0000 Subject: [PATCH 392/620] Added blast asset, whose fbx works with Atom, to help testing Blast Gem (#7110) Signed-off-by: moraaar --- .../Destruction/cinder_wall_complex.blast | Bin 0 -> 330848 bytes .../Assets/Destruction/cinder_wall_complex.fbx | 3 +++ 2 files changed, 3 insertions(+) create mode 100644 AutomatedTesting/Assets/Destruction/cinder_wall_complex.blast create mode 100644 AutomatedTesting/Assets/Destruction/cinder_wall_complex.fbx diff --git a/AutomatedTesting/Assets/Destruction/cinder_wall_complex.blast b/AutomatedTesting/Assets/Destruction/cinder_wall_complex.blast new file mode 100644 index 0000000000000000000000000000000000000000..fcf67594c77c4fb51cc722d3d982a5b806a55fb4 GIT binary patch literal 330848 zcmeFacT`kK6E_SP!HhX8X2k$zgt>|lj9>=WfEgp0F=NKnRm_+Wbydumk-2RSm{Hdi zb6zp6=<3QE-e1kseV*yw`TqLOdC&Kq^Kj13n(FH5+qXkib$9jHuFK$lgZoqtuTrLE zpJDyGjtCzzs*LZ@KBGog9zCo|nXxrI%KX3k>(H%9$1+VjwDT=f>%V_>Yxy>>WhvJs zi-Uv1n@kQ4?pXmB2ZwG292|C6#^(+Y@Smdt<(j4u@>gxXfhS^q;w z=H!sg!QbTIfZ`oC0&|$=cESh#!{hMh=rAY`{hQgLD7b-0q%4j=YJThY!wXp{r9}ej z-_Q6$CVZp$;ftmp_@jI!Y%-O_yAj_eOD1nhrq5;R1OFBMk9>wjPO^%I5Hugl{j*r* zB&%j4cUI&it7Rj1RLUn=T^soqXKS5Warq?kvXQ@Md3%K#u+>zyte9G9B zf5~p0{~KyGY()Cf+Is(OzxOP^eCdUkJ^4$PYp9<+`6HH(?lR1-{5H#Lp?>zhe~sn) zP(RY`YW>c${5$GrPkx-`fvBH7`4N_PNBh~6?`63+>Ss^BjpYvLU$Rze{Wh@t8|r6I zzKZ20)X$!LG0TUee)i<^SWf+GPd=UHW6^#vwg0N$1eWhb{p`uZSe_mAvnLW2KCEkr+xt}zmEFZll!r}0_tZ^-h}1TG5+ky8?w9s>Ss^x!SXV9 zT6^K+zuK<~%X31%*pruKc?|T6J$X@<7dYG4t~?*hyF$O%`@S>Fe?j|Us{gBgjx5*F ze)i;F@Y3Xylt=s7lfP&ACiJg8`Ae49L;Km2KVo@kkv3j%MgCR4+bl1G_OmCy#`1k= zKYQ}?EUy6lY)^iieq+mcTqok^6o6pkNVk@2e5oO+RvWckL7hxKYQ{fEI*I-%WbEA4Ow0o{cBI|!SZ>i zpFMdMmbXLw?8(cr+ynKqCojr!vcFi0{A+&XWBE(8pFO!V%j=_l_T-K%4@dvnlYfCy zrupxS`q`7eXL*1}!$!0QQ|;SJmiuLU;bl+$h~-|DF4_J5ZI&NM8){d6jpef{m9Z;7 z&vMd#`Rvs1ILn>TzxL!uSY90MXHUMDbHvJnNUA_ z^2IE#gZkN%&tv&u^shbnbmRM|pFQ~mmXAjLu;l$$|Aw*LjPYkrKA7dMsGmJ~AC|91 z``MFsXL&=^&z?MhSs@W zoaF;iKYQ{cEGPSGPrjGsv8Z1WJN4Vf@?xl;J^2Qfw?zHy$yc%bC)CfLd@;+(e%O=G zWBF>-kM^+C`7xd4@6f;Y30OXHQ;*C-)ZGMBVQ@ggMyj81;TJnGY@xxNyrHgGW`TGwTV3E^zZNLBh$5cyxLvGZ^D9@;m zTAooqsE_e|gU9ow`UTYdTa;K-Mvso4WNF{9ou5RT{+{}j>YFWm&+czTU9Sh`Np)vg z_@+zJ#i`4`nOphnvhb;={t;eTH=Ao@%(n2E4!sjy^Ow{g1P`+GcWklGqTQ(ydY!8U zEb<|f?usEdkD5R2JYbPG&-X?+XWe4{sYpqSe0`D6A|X$d`GMP5i@bhXoalk_?uN~< z$Zxfc7oAYvgv)!Z`FH;!hNHZP*OplL3C&_few6o1`hE+4t#!OGqddK;wfFZ7%!Z!wp5GdY_$iSh)O*BIsfgz`F;u51~P z_fcMZl(*@U$-+P2^18IIW#NtTc0Xur;f?an{A2z8Z(i<#>eu-9mzMe$c4{O7P~PyE z9G3jCr?ZGLs9&oF85ViBcNIlG)NlNbTo$>@cQ0`Q^((jdl|_DU>wG;3<;@EWw#a{~ zzfGt9xaAOT;qQIPFo&VMd69iB{G)u+^;{_Lk?Uv+-?HX5{SeCgQlp23@7yxCo)6@}`d%*Q;kg!N3p?;sae#UstvABYzzQ%a2_^pA3r}5kX z^{ePu#lq8gPDcH5&hoMFcQKwd)Nk?=tDMGjceGzi?hhKz)W4&-KZasFQ~la-f6#c& zj`~gE{xHUKW$uqV=nv}O-8?_Kqd#c;Rpj~c5dA^p?-kFFhv<*oC@+BLM+@`^_3sg$ zAJl%f-@{I99?MLI;7%w#6Xgqi0@q82Wjq10V$8#*^ z+X$4`mB%y9w;U*MFOO%MZ`2>Bc|705c&7QgmESi%kLL>fz8f%}>3v`G`*y*2ruPlx z_sxOvEKpt&zc2L%l^4z9c{TUPeICzYtX~%Lc=knqe9yAQ{F28D^#_&r50952C4aNL z@9(S+T&CX>fq36BtPid{J|Tvoeh*k5Y#(>sQojYP53)|ZC(fcgGwXvj+#mb-eZ9Fq zD)IX|qd%y;m;Ao>&>y5MGuMB+Bc?{Y&pl`gs@kFTL+ElxOsBN9cos&ne63;h>URHfjp6A<9=!27(Z+UpWt%N?Pg84Ru=i8MTNfvz&$L%-b#YxL}Hs(it zzik$MZ_JN;_m2qDSH}Dp_UxpkerLJ;vJUTMnIB#GeVf%CZqYAsJf461yMbjq8~S;! zTacwc_VD|fJcf%ic;8bzp0A>QH2#`$e+=jPjpX^(0QDn%>c{hq>PP)MiS>a|zY44m zZeV@{qrAC1o{jl&lgG0$KMehB%nw69)BMm;KSMuX_d<@fhe!`NTz8XE1&4GuM*tiigqj zsxtMfd)HEqFY`f6FKyaxNe^c}ifR3s|5(!Fm``MyePfa(J%#x+rY$$#x1>9vvykLa zjA`v>RzKg9d4Hy*|2|>KAHsYD)5D!zE%lFPKA!0TzdtPbPcWa#wEM{0mh^PyU2xb% z&wuiBK}$Jq%+nzorJtMm)sjDu`A{Q&{%)51k<7<1Z8znkC4U0*$xQ!Rn%|QDG4mNr zN4^QMq`PAML(i+qH0bUFOF6y<&$M@MYx{&VAH}rq{wkJo;+RilS|d|)OL_|PX-wz; zyw{TMgnbiB`!oHzyM!g(lX-upAAh&{=ON5T7&NDKTtzb<&oukGF_v;pFrUhF_uwzq z_GjJ&`?mD_URSODx*PL!2uA67a{F1z31mK$X_mFt{E^JZFugiroh5$)^T|wq1Y65_ z%zOsZ{Lc9-`CXwGEbY%U=c5{ybYJF!m^M9U?Z8U-D9ookivW# zQ}5%EmUeK$VUnf&nR;^ndNS|N^gZ`W2=ft4pY!`hGaqlrduW#WoM1kcX@4G9>CC&} zu!x>NF1y*1-;H@XM56TLJgx$n4`rG=)Y^}c%*QaD$nTZFd@|F-Bi4EPnE4E*PpVkk z*%gOEmiA}bc!70%`Z6EH)UkJKOFhGxk7Bywwsm~QF`vj(=kb}sd>Yf&TpuSK_E_4V zY4Oq4b)_fs{!F(S8MK^c#=!6U?VFy>!JoZqu1}!C?+P|3)tB_;h2Q z4v{GRpp%E?eFK>fWx6#c*^(Z~d<@g>Hw#d6&X`8q+R3@0@TLV`+b;#=P@n-k<5iQdYeh z!h8hN@+GYEE}HpxrW<%1o?t$eXCC&}Fo&Lho9CAs^K{5V={Y_xv$j9;p-ktj zwa)8E=3|)le{I$03Ct%mZO-%VG4mNrZ*VT`Y?Sc~yODyfr)WmkdlX-upxpw!o=&KOsBba*M4YagRH1qLHtA<$Z z`w8Y#nP!f^Y1RMCyWlW{p8u5J*Nu5PgrW2_9-o2ChceC1^D&b77^XS*SnXE=^T|x# zvVM5XdAf`o^SjS;F^HEH1u^x_NK9T7bWBfCp#CC&}u!5fd zlKmMs=IM}x(!Wl&zHcD&p-jKCKNHD(4AXUNM-rG%W}4E+s<$6ApTYFUg}avVwF5auJ8WP><9P^1x8?YWoVLpwip$D9>UbD16(~dmvXdOrC{!Ab9{0d<{f@uiPuW07unP%qs zb%Oa+rek^jrZew?LqU4Z4(@k1=DnD%=XMKZK9uRJAgjHOWIl#zN1k^H%qKJL#`f+p z^BGKYv7hN$lG~qY*)rVz%+q?7>S@@!aOR_!K3rq9M{&$2GVRFYJcao*rs-_&oJv{C zEygsJ+u4(Of2Q#~ze1RgV49unTC|am=|aQ*VLp}V7q)ll%)6AfKL4hn|C#qq^NCE0arr6Cr!oDD=a*AiZhxjd__?0U`!kK=@fpH=1k*oxd`2@L&(xR~ zCzwxVI)}$$I`b}W*5{Yuap=ap7t;t{?*uX*%CrFcU6IVkFzr*;YS$8&PiFeHt+S=w z9y6c8^ulWExOFYZ?a%ZiuU~wb4`OQgQQ^!-G2PDn8^?Si(_y^6NMSyWsWXosr}EtX zOg&3iwbav-d4Hxs?1zUiAHg*559|9zGat{ilwp6FPi0!Ls&(Hfoq3lE*5`k`Z{2rt zW8RDDt8c&iIN&dk`B0`Ef+t$iBbkq3`gdZSB|U-pWTu5q(oGQuhsVrkFm2BJQLYua z{h7|2ve;6NFY`f6GrL*eH=Ow>rn9~sw&agvK9OnVQk5;wO<_Kb>B$k_-Edwvi14F#`tI6i)kU& z!-33)GCjxZ{Yd6xm=-O75>m-!&3J$OHX?gu%c zKckqQGyEUs6PZqD{hY#l8q-|t&p1`(_Gh}6{S!~-{h9XS`4Yl>1k)JyH=>!3XBubt zKg_2x)uXL;EuDFnYS!oH=XJCj^IlBX^SlmZK9p%Go_CSV$1pu>*k9(8na*VW{FwO+ zraKJ%@6PSdwD5r{mhtJ!d=OI)*0fHWJ zb2U9_9skVxGj+`T){-8=d<0XM)>gd{&3ru5KSEYo$3OF_O#2%9&&<2jus*+!vH#4x z7t=BYt^3J=%!e{{dUDNDekAiTOb-pR?n@^ypUm_K?@K>sK7;AR`_}zK*P7h^Ople_ zW^I4wgP2y}ed%!KqnMsdvhGXAF`vjZp7*6wm``K6p7*7lYH|BBUCH~>p3M6*9sbn1 z?;65<1k+0Qt^3>2%*Qib!~4=Fm``Q8xP^6JI-PkJ59{*_kFf4byD{&@wDW?3mUaka zK9p%T7wf)dB=a#$v$GycU_P1YF5W+R%zOsZK-Ocfp4|RSjeR^{=7X5V@P2hT^HBz6 zJrl=#BGXp99!z0AjcHEyXPjzt`!hXz<4{wwQ=ZKGGu>h6ALb*NerG)s&3ru5A?)X$ zU_O_0P~%CtU@lXT`?>RX?0oC~-y@5MBZ{kK5o zLz$lD@es*;4Ab`PrzJ3-%=C@1|H*s?)BS8OTpMuvGkweZB)-fCF|AU-dhQd>d=%5B zyiXFxd?M59yibzCd>Yf5ypQ43klUZ>iJ{hg4^QU(nO-o~U(81^ZDOpyn2%>Vz}Wv} zK9y;XMC(3$I`b}G*5}V;zr~GtFQ$Weo(3`>%CxVs|Id63)79)hBru=Mv={H^KW09I z=>uMex;EnWXIhu{J$#uDVj6GQU*@BjK4v`-$9y7FCthczFrUV>Kl=kt-rW97HO}wJ zyg$?X#{L8I5lkJ8{RigbnZ9Db;so=lOx=cw*#3EWoqb+Nakah7QAIWhe}{Rndt+= z|71Rc=}a!)wF$RB)8WSc8}mU-js1ae=A)P%;CULyd?Hh0e>;WwG^R^=+&cMk`!ns# z_QI2Sf2LX3UW70o!E_Sai)iNKnfmZJJi&Y_)1z!J(wTRGwRduGa7bi(;l{idQ)7QA zkoi!io4CIsnU7(5jrCpv^T|xl^7whodv;?MpcGQB40~ z`x3`|qLI$$7b(oAF}=oi$Ei8DKhqPz4wxbEf0*}YI)e2;2=ft4Gm2aFKs595Os_>a zS;{%Vd@9qm#{L`gE-kFj9~)5LlHZMaFQzRMbZ83fKQJH4RCln>yGZ6^m}W#ywv>~= zd@|E=Y;BYGVNxpznD*B z`umnomiKaM#qG~@v@!mf_h*`Jv_JC^Op{A<`!gTUbOrlMCzwxV+TCb>=3V@(&%g7^ zdT!{(ycg3ltUm*p4`teb^>!rlF-*6x9!Ow5*`REfA2Xl9)L7TM`g8j;P38IG%X|=1 zZJG6b!@qBbe4Q>@V~2 zOlxvKo?t$eX<^o5>CC&du|9tg>oGUxy_jz0ehg$jl<6+x{FnI{rY~8KB`}}Nv@iGL zW9BoM=4U(T+Lqg&sc}y2%X|>ib=<$<%ttZZ#Cj}_`9!8SSdXPJpT;x~??*Ycm}rTHAwjd?Gok*p^J znGa<;pZhnG`52~kjrA|{$xIvZKHg*IGni&!JLTGe+n=f7Z~HPI#Iy+aV>t6sOndOY zYaH{5Or7}rB8B-hrrFs)aSGt}XBx%(w4TiSGp$|1x{pe>G80gY={#e;FpueFk$W|4 zVbQ}O%ttUi^f8A;??p2oZ=`da+X?1VnZD+8;dJIHUXh-^nAbZLuSh(_D-zAS%o-m> z@ruM#ydu#jysn{mMdB%5k!T$2J&IQ(p5hgW-sW>#idQ6_;uVSR=KTbUS0tX|6^RO- z7Zk5ZJjE*#&BS_-;uVRfctxT^cwSJvBJmWjNc1r4J&IQ(p5hgWwqiR)@ruM#ydu$G zds+7rC|;3xidQ6h{iSt3f#Ma3r+7u8ZFwG1ydv=wuSj$o_antC5>N4pL>Kb;IK?Xx zPw|RGXR_X-ctzqVUXkeAD%SG_idQ6_;uVS3=ko=MS0tX|6^W+u`2xi&5>N4pL|^o> zo-a_mBJmWjNVJ1-UXaDgQ@kRjPc_a9m=9t)htCBlUXk)qydu%s7p?pJ6t74;#VZnR z$Mc%v6^W;KMWVOa{!+Xm@x_=vWcy3;ij+?AibTg6`xVSnydtF+C98SBBd|m@k8;7#8bQ?QJwpd;uVRfctxW341L8s#Vb7Pw|RGTXH*4ydv?%n2zCgpm;?}r+7u8S=hc%ydv=wuSnF_I4@wH;uR^q zH_r=-S0tX|6^ZWU_M~`4;wfH{=pFV4C|;3xidQ6R=6ON!io{dABGKAL`!i4Rij;2n zbri2iJjE*#9mC^_;uVRfctxV^cwAAuBJow3e&h8o#Vb-e#VZmmZnQu16t76><+wd5 zUXgf;S0ozFc7fs*iKlo)qMNuKC|;5HVoaO!dr`b1rBl2jQO#JdF;DS|l)l7RuQ5;Y zij>~USg$cp@rsn5%Ki++D-uufibMN4pM1N&FPVtJw7h~Gh82`*uydue$bAM61BJmWjNOUFl z7sV?QPw|RGjq`VkS0tX|6^TCKaY*rs#8bQ?(Q@2h6t74;#VZo^XFU+eJjE+gx}o1F zUXgf;S0s9b$05Zl5>N4pM2&e(@ruM#ydu%f{9Y8VNPJbMFwd6z^;4GjGL0=)Ln~I+ zdf(Pa&+qe5^bM`8mkL^7@k@;K*X8qS3r6~DHLqFY0F3m)@6tuD@s7IJh0#*}33Kn7 z@|^V6GS|-{@JQU{us%0!z(-N%q>KJ(>=HSDL^bVF(rNRJao*VR`EUMze*Gf0w#}>O zzBN|LUvcAA)A5mmwaWMX%(nU0Zp;wFtLM~bes3k^zdkjq=KH*vCR!)zw)rEky%R-x zHqbNwW%UD$dY)_l*(Y{gHS_T2lco9>uJu7Ix>rbF-abw$zvbZ`=E}2Lh)FrhO8K*A zeWyWchQlf>Rq{{63qXsZq{Gc7zAsoS=vi}x#$yTlXo`(?jK`9F;qsP#?D zYRX&ls+50O`Pbs_Q|{&wYZglRqZ$q~W$*YwpVqp&R3FC{&&1i1tIUUXPLuNQS$xLy zs6;8#``AHJ`-~6!OL$GmXP(`2y_A3cK__!v#e)~`nSGxD5=i<-rAodK1$`^ z@A5#DNvf-lZPQB1-@LT5=JPz0R-$D!&9?q?w!RhzuJ1NaJ7kSlHp-uQGr*Lkz>lPx zBO|2tsj>dGNH3RSp4#_!?Ck$n&m@fQt-Y)GRL@+lq4Zu+#r_uKAL!%4__zW-a!zSJ+`pM2lVUCvtL-HrN`x&6`9_RmkIxlbEO`JD!)i6^gX>3_X! zDwY3cWT+N1HrAYV|9Po>O5J`UZY_Rhj)?9q<TjQU(p2sXw2(NCM?d0r}KmUtP6IC%V;?5yO+(v>DQ}#m z`d@XsBDB}edf|!IcnBl^sb#~ojc@Llla?Hm+W+d1%fik5sX1HC64Lu7eLL+lYrd{U{cmIgpfd@Fgk#v|TYi z=Pm^%_0*%Op2&a6F%clc|ue%5ESlz&$0Ly?e?(;QKviB$iE zBa3PC&W7pNGBuUzKc?z>vH3|oJ>j$L54bPrr#0vtZ^}1&wN#Evv!%kv?5+pbm-Tb= za*s?Co>kWFI+l>iFa7s=aiMLn`NgLgsho<}ub7(0zxU34Yp|5RQNQ&fY28_~d6ab@ z)_C98swK6**Z2wFy+KmDU0=0VJjQr%KC?wCe^Z6N+Mcwc`aaVG-FE)Ap0z^s>5^_< z@h(ux-!Ju}zV_`WeaF*AQhT1MeMtO?`TJR!zy9|Q`JBgmX{gMXottAtUd)$c%6t*q zV|=oI3QP)7`gg78Ug3lO4Oja2!LqNWN8VYrPTM`C_Sw5_tH`o!w>d^XB-LM=*umrj zeKkhWSE;#n3P;!P=KRS!r2NnFt@iGAt*J=3F58#w8)HS-+{SuUAK8Arguc2pKGytw zpRBLiE5I&fX9z;LR7*AHND z==G?ap1;~@sXm3X_SLc_9?;FRW&N4ceWvh%{tWFeKlfe5I@-!QHAU_KS$}?b8zm+| zfA&e0%RhtmaU4-c8?Z-ipV*@F#7wl$=1mKw`pl`h*L>@1lD_!KP^tcdy3G|^%j`3^ z@#`n$KmQ{{gd90wYO-^MZacpgo?a`0QU5qa|IdUzp9Xz?eYdR7wM&!4PRw5?W&Vl} z6HHAoer77;=SSyA5rFaIsf?fe%ZG`VukZNOjy@>WGyD4K;#sw)=B<ma>v^PeY+;?U7D$((dgfe=-;(U|7K3#AV#2nGtK{9D!-b;8S{Iz z&$W?q`*i!VSL8(dlu+8|#>h|+9}(-*V!u3YpKjhGu0lV|R{WVf@CU|WJZDnI^PIVx zL@37dZ!ctj;NbQop9>l3_Xd)If%PEq@xoaQHry;}r(=XNekKcU#WT6v%7%V6(z zEB3Au>|H(ByGDw=TR8TRZi2lFQtVxFi!55^w^_B7A7p=Z$?g|=$k3JM=6hF4?Rop^ z75(te_es&W220~@*yks@4tsY-v3EP64>O<-0~CGu^TbnnZ#(vD2mH@c@IQwr{%3Mb zS&RMpsMxO&uwP$cziKM>%lX?Mx-;xol48H6-<@e%ld{^U-Po~G{ijtfAwm)kng^Dx zAiZyg8YQ(NF@C~DvDYsL6cQUS-@l!f?R7o)=ZmX7)z1}_{qyOUoy7$B=ihr%B+GyO z@UIaa^rjQ@i*Z~0rTV0`%O#v(?+PmR?lRgl>+7QWRUg?O_It}OZ{lt_x6)%vC{q(uH4oCfd4Qs_?%S#qp+tVCdQf*6#swT ziWB-_%$N0wJskmiS{?fEoT3kZXuTuG+ zPL$V%e#@qP$R)4Gzda7ogS!;gbGyj?Nx+_d+PuO3raD_MOXcjn(O<81w7lMTt*oDW z6nSh)Kix~aQeIx?-g?wYcgR{q@4Vj{4`Jxlv*_P{(7$HIKEAvdrO!eCZdB~!66nus z(4R{b{h4ugj=moHvz1~W-)Dqq7qLEioh;k;UX$+W6JQ^U{E*j21u-ADVm|sP^Ks|$ zNIe_oqu;|*Qae<0?yD7t|KK@VEVr z|3S?8X!>PS4J|HFUcZzRj$$y@FPo38lIl}xkh@-cY;IA;Pqr61Gt%_SjvnTXS#L}E zckGDqDfBcjsgL3hcTI+VgFn2e#|bI_%Uwx69)B;^1C{m8fVBtp*I4fy_$cq^yj?m> zYxDk&`RWRJeHU}9gcynS-OwqreSC}gxMWPMIh!&cvra7_j$uCjtk|#K@W-^eHAPB$ zxjk3S{abH}_7sZ!S`GU?6!yKpV&9YE3yGJo@AWcQm)cp3-|~uo@}NRtQ4IFC zmSTUkZ_m9~Vt*!}n!G=AdiEo|EB0p+vA<}mKR;eQl=S9aZ|%!Sd4Fc-!aaIX?9T+1 zswn06E$u8)o@EkYEvrfMz4y&$`dRGH%Eu_ zr2O8ltG(T^9(kdxM~?5TBt~F8a{gK&DgV8MR(hq8&f>RxvcK(H;fWpsfBX2kf>QpO zbGqqSayAefrdJWR?J#0q8PQ<;HuJZ>`K0_?*ALg0oV{Y+{B5spo4?hzGkT_a?KG?fkg=Bj-1NLq#>|NS&d7b_< z?A;95y8t`(E(7~f124$?>NW3t)Vp9k8>y^kE5RN;f;}p^RNmM66XUdT)Cc<|0L}17TDj1iv9fp``Z)tcVg#u zQvP$$&mW+lD=7B2BkV7&U!K0|E#)s=Yl!yh${ABXvuyA7z~1@7-o3kI{hdHV|5w-_ ztndG$pSa*5uV+ic-UY+n9XurWZzhMnTK^-^=i6m{`z!Q$AoOkS=Y^&E6o)=v4}ES@ z^!Zlk^UToa^M7k4VFy|N)PO$k z4*j#Jqo0&N8SVK6?U|_9yEm|Rv|dg;TwTgvevP|cq;h8|~>Q zk_Y?i3%6dD=2rsz0Z;e?g$~q}%5M&T;BWW?>54ya6aIh`{DCRgt-m8_jEBl|KkDB$ z))3W>%Kk|i*t_nqcl%n%>%RNg&*}CoFsZL%zq-JFjf4H#y|krNpS?SieBv_}>z|eN z%T(B}oLIk{dnotUChSj6e|yK=aj9&-R>OXEf&Ci0xv^A!_Hpi}W?{LtBdz8A$?sp% z^iEkl%x7N)O8FmPzSqKhFR$1;N49t0lI8KA7vt?1##_C%@_6e5d)EQu&998CpJ#4O z^6||at*>k(uh()!<`xt1zI%7d`I~+}?Xwd5s|A())qAjag<$W#t&;mUU}Q1TDJ9HQ zHB(bztDid^Eiaa1eOIvON6DVv`MICwg7sbHx$=JI?6W1~jn0KE{q00K=>!nWOjh*#H0QApp=$}T4{yDO@k|2MwmEupn zj*l_t{}kwr@hm+z=0Yp+6UOs;#UJYn`!%ZSQ+;1y*?t{!^bw-Zuw>vFeIdq!hcX^MzMr61fc<@> z*xxJVf77d?eJ(5QvuXJ-EimnldGs%`K6&5jx_%4$V^6|lKi>)aKM&!5-cj~{LY|$~ z^I<-o93Z#<;!Idit{P?vDm_Hl&c~P{xkav+Jo?jn$ zuF$tr^E*iG`2h6~dU?m(ZlPTNhb|q&G1UL2Qvc$y?xxhfxwX@QvOX-nr?PO!?_oZ! z*srpVXUvX2yK2Xk_bt-hU*y629#`Hs4f-=QJl5>5=ua)7r8otDX|J+=cjNu8yUKbY zWL!-#4f?aKvi@4XJ;~hv`(o1w@6l2_R5{Q@1VVq_QPw-Xpby7g2{Uz7^x=w*6ZBQk zhr^c1{?fUh`-$A0V?>{XSUAU&(EvPWo_GJ=q?;eO|$|_d!K%?H23rH5+!hMebU< zYu^(3=T;V57`(=HbfcZ5Q z^J~?lVN&^pmw(k)d1n>lwtGnRzw>LH?uhf3XXD36`D;PHRfc|>tLV3Z_4n&Ppx-us zA0g%M^l^gez~FXTv$wK-yM*~`!u+k&W3ZI}VS|%;#Vbw4_O#4WeOfsC=&n1qnZuri zO8FfQ2J080f9}+h^-uV+fqGBqpLc1pKi|Z6zG<<411)VrIjNjlZ+|lnkLqjwX@uNg z{Z4+@H~;1&{D;(*>NDZ-X8k$#!|yoB^$F?MUF+$+&>Wmu-mi{Lxu&mSXd&o4Yq%D=qOMw8d)c3Odc-=y@|4KwtzZyM?W53ToIjd@YB z#{&I!-vU~2vu0BH+eeKsZ~v4Rzb)NJDrd{2tlHG4&9q)U5_Q}8zHIMub8f^(efcQI zM`iNaYYMG4Qu|zd0d8vkci+|h);;s@uk-7rvdZhARHLFizt-G2Xm%Sl%3SzRlvMw9zf}}x^F1_)Wpez|8Ncr4OwS#4ZHs(f zaQ5gHQ=^=1P3L;c=ULO=RMcxf&22V+ko$d9-@4{`-|qO7Z#G40&wQgY>pd=bnJ>7> zexu*&(c0K7(@k4lt@oXbeyI)pa{>CN;VyZ<_pc`N^~wGXM81e}QuzUxUp+Cu-sh9g zUv{)9l;Vqi3ooKSiriv;wp8}ReW3sA{1#?<>m>Wb_ZQ6)o9yWSL-2>s zcZxSPo+rQ8U!BHS{NW~w{=e2Di)ivTtLXconpFQihi8ky@P|$5{WaThat8YU@s9UN zO%(mVC3%)O3jH6c=>J7`KAP6N`D9wB__yvcYsD-0x22T*iZ6&)*$)5KTk&sQbIuW8 z`u}@<-3##*c~brzU-5b63eg|_?G|OdwiN#4ckEXzRL)<1x;0S*VZUO$vR^TxLP_Dg z!B6YFQ$F7;>45V)JNBgq{AcefPxTh1WdFIq{>7H_j`GQ4rS_}|`_dZrWvF6bd`B-4 z#cu`i3@-`>1*#&k#7Kbcx*n&<)lwv6LYsXoK8 ze{ul!<*>4UQn>pJ5d!=2MzJrOao&9$`zM=b$a;g$yQ^Y)i{$9|NVBwU>!)#X8ziI9zwHmAaM79LkAIOjOS3LS_ zrQ#1P!hTm{_}g<8fBPENBQ;>J)%Ntj`Rss(3(X(1$@Xr4`}QIL_O66t?}C4v_Q83y zD6H5!@;^(#-qlp>-N;!VO_{gW(E1#b{pX%L7Kl>tpFd0(Aomx}$H%_9<1>7bd_KOR z!D_J@{&V-=M@jjQz`u2#9Bba7__xgv??LCenzA35jQxT6IM02foG-Y%ixO?%->y{l zqYff|>E_49`ekK5U(dBvT)=+*L1jPWOU7w)L##*oDf{93daV>C(LVK+_6gm)&-83l zW9{wM+|ql!xc8T6wZ&7voU4|Uerm-7(>jdNrpJp(cIWq&e~Jr(s_1^hqntuD|_DRF2B8Kb|JX?Q{++l2qybGt;`He!^ByRyy%n)OcJ(e_UAJk2;ZU zU84i(4Sf11$?;&%P}O64!YdBzLG zORrSorMn|u`ZVIDTXZNY(C6=8hwDw+kC*B{3Gvcje#vX@(_bDZb9|d>OWJ)i zeK*~d{G}gn(nKA%o#ydauiN(H48%(>JF?7l>R_alpW>z87Jp(6@{rrV(#V0@nb%oO z$2&bdB^_hQu#*_FP#VR(v$7POCLqNw69qnpT`j|eFO2*Z-v#l~c}_0zIj_V^rz2jvD&nPmp884kd4PE7Raa_i_fs=T?b#9W(!(Y+ zGS6Nu_wS?)Q+xs!Ofwzy8z<#|TJN10VG1^P?L21AXNo)$s=b{xUTS}VcQmh85HP+#jYt$}FGb)cgEOtb{+7U)i5*jrfzn*q^L1 zOZLaE=6xjkV?BOM*`NFq`;(q;us``xjz6hf`idXp3w$bq;s1Cl@e=XyXSyQ3dU8eCpP~5bx!4cfsq6>- zn9#u#jd;bjO1vV)R~Lmp(@5D5e2jR-={O&ZRL%!SjeH}9;(YM5az5w~7OGXm{>&fB zc~%9Eul}LzZ%+*O*8-jdnwl)gFOAQdMW2hhd0b3+e`JyR_Y~r**C1YEr4nB~9r4wb z;s0b-_V*~BBpv=tkaC_i^!ZJ(0sc%bC7$Hb9C!WqA-Tn(cJld4wr)3sV@?nAOXWPh z;+|G|_tDOxX`Vo-{?q%Wh;DYyLq~nuXd1O}n5m7Myq>L*^Q>rw{kjfuMWpu~fc>ir zh#!bj;?cIQzbdWxSATQ-_622s?*-zwi>$4o ztvfE4lY;o|aQIjFy>qF3CQt2V@^x;YwU|{!O83A2QnbMNvQW;K3+_(x+4Xs`K0xt* zW+Q(468xV9%K69^#IyA|6{i2A#Ir5L{@!}%lWNV^NpaCxp-)_)PfE>^^~o^o?|G9x znbS_n-yZSXVTj*;pu}$%$Nt_a?C-hzrbzh{FJCdu+WFqw`FDArsyO!dXnohG{!ZzB z!8-Wc!{Bd+DC40c_TLgQ9_lFZ{GSp3d>--7KPmCg*RcQged%s<_#QWtt^IwA`x>30 zPX;UcWC-@(azdYUQtoT?<9Mp`%6Lo0{u}L|7gz2Jq#%B{D&mK+|0ebCIPAZDMf`A^ z(|=0sQxx&T3D6I}De+W8vH$iH^uyQL^8JgYC%>C||K_9(A0nSKj>mr56YQsT-}6!` z|7_3h+UWWV&2w_e>kHaXYmN0q#eDL<#N;2R&1d01|EcV6(|*1y{O9jZ^8JNJxbH*p zBr}wFlCT=HEcbn~m;5ZXf4ysml5*g_&paib8?M{jS85Txu{|yhA*RW5-mfd>_PPtV2A;OeG#8&&QSG zcf@0CsU(+Q9`PQ|=dYOk9TIfgan7@rLld-p5s?`qiJ1jYWg!Tp6^u)pn;^Q@DwFBC5^La{F!5bwPn z_T{K@zTf@#k0!_TPo_r7e#;t%nU;9b2fYhR?SB^Wy%R>q`dn1vd&8bZh}&2Xs`m6d z=GWbU?KJoI&QdwF|IiQf>zbm^^LY%>HeEPl>a4^oPR9Pj1nfWTSI*b^!v1c;{92&c z--6hG7>4G(B71R}ou%SkyNV?+7Q z!Vmiu<&}7k4HfH%ymf18C)+iZ#?PYo5YgVw`S=O+*HiRY^91?)(G~j}ThL!Q6n|jR z0(aBr!MU{s?dAQAcG%yToXf-fLGcHialYohsfPAViQnsm{eh}>?AM<8?s{BkZc(ef z>~CoE=ZLZ>f2VR@Rub_K<=+M-^;6;>PJf>$CSyNsYM%m9d-jY^GOu=sHkDD%vxfXJ zTC~D>)@H@tx#PU=@oU)k#j<^0kNt{&uwUV#*!Na#2kNi8ml7klHWs$?_v4tA;>5zN z`mmnze4h+^djCS0K1Z>qbRUZ1!@Wb~_17ra)460%XUg`}3HPD;!k!k7l-FNp;h(of z{6HTiexOZYtQZIXyr7WRv(GPH(I@PApA@F-m(qQxfZ+edXRdv4CzVB-`9k-b+%R7{EA!wPN4t{!wq}pA02F%@g|n%keAb*^2(}5|8^1(Eqc2<@2)hn7?V5 zzpE5|Yr_4bQJB9^l>Ny<*k8?rc{IPDjm=Aw@xe||b=i6!X9QYe*{Ax?wuc7_S?@ByR^$#IhUBpZ0&ye?r2jD)D zTh7Pko{GM0G5@2f|N0u*Bq96fjxDx`-q3Fcm3XZZhzCCQ@s9b{YPtRmQgB}e_1~$~ z|9OzRX-PzG?OF?2-+n2-LHK>EW!|prCl`i)^%(DaU-7Ska9^e%-uEx%eNV%l{x&hz zXOd!1>Ap+~?CE!9eOealuddi%-K5-?iNbxEfv_(0`5O4O65^ola`!esb zzF4N{+n&&e3$BLgO%;7e@l?M+A68V>7bTz%t3w~oRPM`6L_Ae9=)+CQ`r;?7FNR`$ z@km);?CnxfQ2an0Wqon&$`#Wx>{nb=_A6c>o+=UgFjiS#?5vLX8I1qE%6@(cr2UHV zUsG9MI4=Kc+KctY5M_OF<4Apxf%U~mWqsj{`;~35z8ImbFN!06=^M`X1C;eeeynHv zA%5wJ62C;}1(h(rawzMI-zxMKlhcZt{`Pqw`I)s5zeN7tD&@ZFY3QE}=$~WC`N%!Q zFHM2|QSUG8$NB~F1KJT~{c>(=L6L#=OQ5oT$qoI3_$BSGvVJ*+_@zG3KQEN^%Q~!I zx?=qjrmSB!bZsbJV*S!ZS-)iJ(_IT|u+aR>Szf=;`AC1PU+O9AmsPlbu?zPvRw?%{ z2KiSNQMi9$Qtn?2h5i|X`RJ*f7Zk#I3Y`};Rqks~y;V`WzAqptQ#oJBZdUr5F8EABO@doV{_S2emi8r;FBKrf0*smjhz)v|pb!?eM+xt4JHcr{E^TB>yL-+$7mGjfB zt=8(z#}v^^uOBJt=d_h?!~};^=KlHQc#PdxFRa3PK|Qae{knb_KWcpS@dI1*?2!}n zFM9_|<*)fEL(B`BYxcSoF15p;$+>i`Ky__;%Z5_^1^Y8Z=e+yPd0P*c^0%lyL|c9T zjH$pz+1^Ft_X?sjZ86tU&J*1(FEIB@@DL-0)tAbjvGb)^@WsXa+vavs`ByRiT@b%F zLy6xTg#EO682@RC{cSbWT~8aGTbxtwr{uMO_d*ROO@ ze8Kwh(*il(X&}}+(}%*}NR!t)w14&G)xYC;+*Swc%;jy!>i~bn@ zjg|Y7Q=$I{?0)ZkSJD3yR-}kuq5sw22iOSx+5J^fQ>;nWpOX$Ji|!cz>V5xjqk3yi zt3TC$%_pzluS~ly!r_1Zque)K0R3MK`aeq1|5=(m6gl937EtaRZiByl8utO`DgJiv zOIO8TcH(s}z#mvMHr6Lj@du`B$>Jvbf!#_xVR`tI%W>Z!{)9Zg+BjaaoYy;FK|Ch@ zjJTA#2ZK$wpwBndlJDoZ2((wuaVLm;K3l6HBt>P=Jc;vYbGv?!RWj?+_JP+;nUQ+zA5cp&5;E#P*{IRH>v&D7z zV=NeV5$yM>{@6Ce^H}2B6@M%c_x(5FzJJJGIUc4F;$i6bTPi93*eC4wZiYWL zUh&7u=KV!Hg+CUi_+wMB-#ZrbF-Vz@6c1AY^Rc7ikBv;9pt~b}1NUbo`$GFs4dIWK zSNyStxKDiq_o;g-^LI7&$6jLoep2pJUqZaZmC>>0-AcT~Q0$K#!Tg=3+#g&6f6N{J zm|5}1s^*y_zQG^!SNyS0*zekg`P)g^?<$J@uEChUUdr$Jc;7o@eipdYROh`M*J12; znU(w9O|$gX>ft`=)cNxKdW8M1aulDV{GLM~;ypTIehpXRnRjEq%NO%2NxA=c3;yBz zn@-wh#XrpU;1@yr+d+zdn7=#XMQblK-zX&ehk5SAhz9Tv^C6!9 zT22?kaX)>iaz8x<_c43nKITT{K4!&ylSLlSV&(wlKIT#U{!a+(uSv1L2RZ(vp5jlo zL_A*TjWCmo5|6zP=QWEkfAc8kzdJC0-yj|@Sc%75g7ca-n7_Jm{+on&yd{XotF6T2 z<@1}a4~IS7tDOHfyK+U(iFmx%%Ka3I$EM#OXr-M04#57*6YS3f7nAMdk$O9Ix}T`t z@5qMuv~Jj+>96e148{3NRy+IKI}2~ri+yeoF`WAQ%fAqSzYM&W=VFlM8AT1`-r;c+wJ7?`}HX=T%H%yMt7Cthl7{r)jJ+q zXD^Gjneq#@e=Yh(2&J2H# zeotx81#iiJE`a;Xxe%X_=Y|{~^~Z15#W2Jte9bK1M>q_B@7Hm$K5rC%Zz}vf`u#VP z5?>d9@jnXwUcUYE_-_P%uN}t!pUVE>b*$e{!(Mb#*6)wt@Abg=SMRqTfxmYP{@&Pq z|MvInoge)(#NFh8cuTVqZ#fhG-Zdu=^E~Cep!MEXrefjFT6|u4-Man!VM~0%*MH>u zu#wK2OrzHgGyPpsj!!rizEgN0KB3`FIbLWy>``{uqj}2ymu+cOaNP86rgWU|_nax8@BiBDs_2RH{qM`=`zdkwy@DC|y@Hm?`Ti&P zds*P`9arKTw}0$yig2l}bt_m$8ds@&f1!sGVU*& zS|#7(2$@t#uU!A2>E-+(QaN>Te_;gfFPM9{OX=0OSJ!^Jc*q>TLq11%h5HNjaDSn> zdwD7U>M2=;^Rs4RbSL?DT4vyWK|aJEK2qWjE8~7a2<{hb@|Euw)WH3M+qhpa=A|4z zxua+uE%Z_ay;MaxJqGs$df>jmpU34msB44knu{Wy-%W|<&xv^cv54ot@>xD-H^JXt zdNWM_;v~mwxt=;KqV4Q|*2Dg1C-~b!iPws|w^LMsz22et+ZSQ4^TS@xSM2q(S4TuQ z*y}mf&P#Uf%f&0EqFDb9Q{pS0eLF1nz+O*K{OvKLdy8z9pPB;P8cO4#-HTI}-?#Kq ze&4bx>~$09H~e0lu(hY7www_ku%Fpk@t<$k8X{6Ip3%P?SYo!#A3t!P2!Z}tr2PJ5 zVZ?_Yg8jXu*xyz^9~5MN0~LSu%)F2KnhiBXKXWdrJ~0oD2`|jY+{*7I2Eo7bz7}R` zp!ipjZ@Y?V=r1qj{LUZ!6@>osQTl5~Szl2B{Z&jkzdMHh>W%&iQu?coDM*B)ztr=) zJ?F4KN_g+x>-J!2Ubu&J6K3?6pK^W|ivB8w{z_E(>qniDVvHSov>5B12&{M1-y>~( zV3eTyW$O8t2Y&zIXZ-#{nDYA%f8)OJTdZHy-+wp;dlWq?*5`|2kLu$-BmMqKW5ph2 z#dw%_^^D%={SF^t(-raaew(c z?sv>lem~(BevdQ=>zCV0f!g

Wq)8zg+ZdH9eZKg8RK*1-oMX7qi~J|eI>!G71RS)C;g0jB2h4KI8 zO;)i?8UIhAucl!9?^4zmnGp{*ZP$BmPdoZ*KaGE7eK7^&|81qGrV`5dZwq}z`)@mx zc+uw=|D7=YhbZfPLtm-!Gl3YNL$93C@9dMu=LYDjme5ybC7xvUzF-r64@CQ}j8A{) zEAp4JDC>m+@E`VLJXBZCA4y-)c$lI1^Vy-VvONeh4OH%D1><~e0s2e5pZhn~gWs?o zoU82T(C-!0M1QIGbL-=N?k~8XdsexhOXq8Qv7b{!xu07e{k3n$d+(}Bf2HAkjrvQy zpIa8^Wec!BGfCN>`3>h~Kd?We-iP&peW?!nGEK2B#c^Kt9{OsNav%0O?zdLJ{np*e z{njHmpR#wq)f@L)ufo2ZR_?bR$NAJ`^jEra|HvEnRbS!0YDML~>KdF+J;eS)s&Zeo z=lAE{%dtMH;V%E4(z-r}MHj4(o__2j>G{a(hms!P_mrxH$-k#0%Iy%9u|E1aK)z2+ zzjy8WJd@_5tdBa4IUJQ7MIsMYGB777!7}beos&BuX0$A{C4?_X>E$U9=U+|6^!{+ zN;%)z2!G%h`fGyX546VoqTfS!tMu2vIUn^Bn`?*?iLyVi67%cN)BnETv<&*N{+TfS znW7IT!XKdD1KFkg-Xon~WU{kgdKmry=|lDWLg4%&0OuF|l=F*n><_5t7u_zwAHe+T zuFNm;2Xf5+v3{~F5y|1FgR{%a@){5MSw z_%D(i@ZS_U;J+kta0T)M1%QG;A)qi&1Sks7|DRYKC;^lNN&%&TGC*0t4JZec2Pyy+ zfl5GSpbAhGs0O$L)qxs7O`sOw0eAwnfjU540RP>+1OCf-hXw%t>vab&fPUbDF00T6 z3~eTpBh?sa0{8+=fo4E+paswpXa)EI{y=M>4bT>72ebz|00BTC&=KeabOyQrU4d>u zcOVD|26_NL0X>0UKyRQA5CZfC`T_lc0l+|D5HJ`B1%?1afnmUKU<5D{2m``_QNUUF+SOKgARsk`;jGgCxHvV z4d5>D5_k`M0WzTy*?^otKAJ0@MZ?0gZu{fIrX)=mzuz z1_C32$-r!2A+Q8k4QvK>0trA8a1uxc=>Jbm1)cz}fiD34->EJ@KA;d#9B>0F0@Z-p zfDh0dp#Mj;BM=M>0!9Mkf$6|JU^%c3_!Za<>;udI{r{=Sz;)mj@CbMgyahf3KY*MV z7X?U%0B912r)8`ZRs4_5$%@bPXQX*rSxbHt;Xv~2fT3>pWkXVL>?1Ig~G@^VNk4^#vy0aTtB zK;_YQdI0o2D${s2J=b2DhMbK$|wN@10#U~fFUo1&u*MP9y9{5 zmD6`APZ@ynQ5io0{eb?!KwuC+-!Yy|&$TVrDASPBvu*1|b)t8&O)ClB1W=z+TT;K$ zGpKB8YkD6e&v1M;%Ahu(eAEVN-XNqI_3w$#RIY8A#`BGGsZ4s7kxtK4>ty>*WCO|o zWdUj{qkSUqncBlhC!XqOn?~(Oyio>ypYqw3Z!4#=NKRvv##IHtc5F3d8I3zb7KG2X zT(=0@VO_z!zu=Gy}-CO$90ghFs+-FXamZXuM4T zCIXWH`kqlfm2G_2NTV`spGWcUV zfbxt2MgwDkaR9xSQJ(QkdY)RQA){wD0F1tFgwLdN@&NgOazK56`qq$98jTs-bjnL< zG&U&RDAV|kZ5owD&&UB7y59$%O@Ib82F3t00B^uZYl6>B0h-U@0Og_Y7X^v|H2-LB z+J1-f(mbX7RNgFr5<@P0>(I?JVqZHW5M=2w&fVlF`hx?P+lXQo& zc*a$;{f`;3y=fI1>^>7^HDiN0m@I~g1%#vYm{j`o1SZwtJaUoH1bg$x&YLE-GJ`E z5P<5D6X*=srbmLG4H)fj^s#L|%0qob`HV7*XBg!h<hq}#BOg7ZCQuuoHm?ix z254@C0DXbc0OhF#&{(0d*b6Y^G|p&z(f6AGzCbg8=ALanDrYP}`Ds4VcZ_n4GJ7M9 zo=wj+%2n$}W%dRrAJu{0-*}(?_)PCT5TJJ_St)?p&`3AhoYE*ipi`kL1P}F~*^7KHGAPGK^;#&!PNA8kJuR z@BvJK1~dgm03(4gARMR+R0T*j95B+ya-AUTaGV=PghlO8bSR7Nhq8=&XW`!@#Y zJM^yfJu2JwJGNySYKrGc`5 z8$f+zn~%yR-YCx~%l28eaw?zZ8_l2I0KE^*i7CKTU>YzTAo*lq8bCaahblldz#X76 zngR5E+kD3NjPi`KdUIZS7UehO)9^Vb&=TkZ7r!OxrrqcMUl`*AaMH2LIrXK05)KfXo2> zWdX7RG)GBJe0IPYZ~0yiY!SHr}ZKK2!N5qw!G)C=3(<=zVDp z(zB_2WBgDXlmMt5N&%FY##0%fEZ_!|1IhyxfQmpRfa*u(8|_HnF~$ImIb*(;;dEnM zR0m%Js0on%_W(SB+5qLDxl|XZ2h;}|01W{zz#V7=Q2+V>)F&Fy7-$0c0!@KtKy#o4 zK+mHx>3h`AtpMt4f1ou$b)n}`nIvxm&=_q8vwsW@=_|AZBzf+#>KoAfN^ZMfd#-q;1^&K zK+mHx>3fTTXkZDj6j%mOUFdmKCdrorD}a^2DuCKA23QTO0oDTRfb~EuumP9=(Dx`` z9Iz4C1Z)O=1*rY0y&?drH^<1~uxnwAOCN@R z0Q(TO3pN_YG#U00>|@v`uuoyTVV}YFz&?k40ox0s&zG>TVEbV7{~GoU>|5A=*mtn+ zVL!kQzz)KgCgaif5bQ@7_rY`+mtlutM_@-`$6!CfeukC8et{i_G3*5FSJ+9|Z!r2W z>=f)Y?0487ursi;uyZh`!8r6`#T)_i!y;i(uxJ?f!Ovn~9RH66rorN{9S=)@CBir_ zz`Sr@^yTNtuoPG-EDe^9&lrdE2N|$3u(Ggnu=219u!=CwEmVe8fid6QFZaXr7`G}c z6IKnDfzP>r?uTjev+A%Ku$r)1u!~^*;ddR3Wrd&DhH>uVVi?N~%Le1rh1G+N0kf>I z3@{z~^Rr7}obO<|j89*NT?%Un-)vYHSOaiFSR+_tSQA)N7{i;vn!{SaIA_ul)(X}d z7C_u5U{Aw%O}-3cI&ENWVeMd9uxuFTT7od{gK5&IJ*)#P2i6gGIjj}Z2*SF;m>2Gw zY0j7iAXIZ3QPgpNlZ&)8#Ul^|mmUWg@9uxDx^!ma2 z!v?^vgk1$22)i1_Yl!8V`(&E*9RwQ;y9UO5a6gRC@F6hHB@KfOhmC-ZgpGn-3mXj^ zfb=H7_}O)^F|e_)>tW+ySK_m=uzVQH1;2lOpZxxq)(x;5VOQbvi7=+kbQqooy9qWP z#{DsE`ZD}x7_Yqu=mc0kY$9wDY%+{t|AO5D^TYW06xdYQt+3l*x5K8vro(2y7@u+I zHxtI|Iugn>nGWMJJQ3lUu$r(-V6zZb0J{TrC+sd*62i;ClCWI{MxWWRyJ7dh?uFID z=Z#^lVclT4Fs3sHb{}jmY#wYrYys?kSTcOd(y-0_F-`hE0DBPj5G)0sSA$&ys}EzI zxL>A8zlULuz#fG?23rVg0>Ab!ezpj<81^`932Z5h-!;EiejhydjQ<4eN!T*ja@Y!3 z2c*GtnFc?93idQ?CF~g(_s6sukDslA4MCjiVK>2^gYiD{A?#Uv_8jba*lO7A2)hsV zynMC>VTG_4VB-+B3r7DJVK2d6h84l)B78NB=`apIe+9M{_9|>BKDz-n9<~O?eKB38 zK|j{xsnBw;OxSC%*J0~m>tP#UtmmVklVL1h^w|j81Pj3&Sb11CSZ^4wxgjv7qhOn1 zTVTboH(*;~+hAvrZZwqTmHT6w^nVlf7VK>p?=5N23b1N0=85}dn)I88&v}k`KHhtPHpfxQdkIpevZAH&{*Er8Dk*cKS$(vRWq!|q2I&m+?#*9Lz8{SdYb z_7SWO!kWT*!0rOih0*6@*e9@N2+x7_gt0t64r94t`CvMq!gj+h#^=ppyG9CK0 zLHvr)dtmcn55f+?euN!{9f4JXb%zawu^h4t(dQ`a7_2SQ=niXw?bfi%VVz*Pu&ZIi zU<+VO^C#HPu*$F=u;DP4NA8R1@$*tx71+J7`(Y2km=ErYaryZj*dNSQrrU_HY^MtA7rNUHlp)i#k5~h+% zgsJ4c!c_7RVJi8IFqNE)1~BiHRC1;;mE2I6O3oIhl6weK$wP#x=HM3_q6D@-LH5vG#Q2vf<)8FKtka;7kq+)$WG&K9PUdk9m>Lxid1 zJYgz%nlP0-Pnb$xDoiC83RB4;VJf*qm`dI&OeG%?rjpMHQ_0C_fVtm4l$9Q_0!FRB{htDtU-7m7FI`B~KHklIICi$xDT) zO_)laCrl+T6{eC4g{kC_FqK>)OeOCXrjm~cQ^{w9spRAea{N$orZAP27N(MW z2vf;JgsJ2_VJdl=FqJ${m`YwMOeGfzQ^_G=D!D|MO5Q6>B_9!{lFtZJ$;lPv_@U%X zVJf+yFqNDwOeOaarjmyUQ^|S4RPr=oDtVqTmAq7#N-h+pl0(8&a)~gNyjPe?J|avd zpAn{#lPk&bL&=%KRB}UMDmh!2O70;{B@Yp%lJkVAhlHu* z5@9NNuP~K-M3_oGBTOYHSC-?4k~4*=!c_8JVJi8EFqM2pm`YBrBF7IUX9`ov4TY)XY+)+7hcJ~qM3_p> z6Q+`<2~)}QgsJ4E!c=mhFqIq9Q_0!FRB{htDtU-7m7FI`B~KHklIICi$xDT)N}eW6 zCC?M4l9vio$%VpHa!8m;E)k}Z_X<5Gs0AIat%3tC^=J@N^U4jC1(p$$vuRr zLxid1JYgz%nlP0-Pnb$xDoiC83RB4;VJf*qm`dI&OeG%?rjpMH zQ_0D-Lxid1JYgz%nlP0-Pnb$x zDoiC83RB4;VJf*qm`dI&OeG%?rjpMHQ_0D-<@llGOkpayp)i%4Elef%5T=rc2vf;< z!c_7!VJdl^FqOPim`W}brjkR#RC0+hmAqG&Njd9N^)d_7D!GR+l{`e4O3o9elBWq%$@7G%W`HDi{^;tix!9$i582Niu#c#(`_c2BbqN-AX+3^ELtk+kCynNIimTZ z1)@cw#iFI6{uqfbnj@MoS|C~^S}a;B>W`K9qB)}Zq6MNwqQ#=6qJGRr;81+cL~}&* zMGHiWM2kgBMg8#-Uo=NFU$j89NVHhARMej!@kMh)^F<3pi$se>OGW*O5??e&G+(qp zv`DmAv{cleB=JRaMDs-pM2kd=MN38f$r4{QM>JowK(t7-ShQ5sj|B(r`4`O*%@-{Y zEfOsjEfw{rN_^2A(R|SY(IU}e(Na-A=6l@zi{^;tix!9$i582Niuy5M;>H)v5zQAZ z5G@id7A+O^XGna}9MOEy0?{JTV$o7jKgR3b{fp*^=8G1H7Ks*%mWuk($Z_L~=7{Et z7Kj#!7K@gO`Y~SY#uv>I%@-{YEfOsjEfw`+yw!~_nj@MoS|C~^S}a;B>c@Dc8(%a> zG+(qpv`DmAv{clO@jf@cXpU&UXn|;vXt8Lis2}5HZhX-k(R|SY(IU}e(Na-A#+%&u zqB)}Zq6MNwqQ#=6qJE6mxba1EMDs-pM2kd=MN38fRVBV?j%dDUfoPFvv1qBNAL9k? z{zY>{^F<3pi$se>OGW+YZ@ckDb42q+3q*@Vi$zOC{phc{@kMh)^F<3pi$se>OGW)P zB)({lXufEHXpv~KXsM{bro>50GpE$EJ<^<%PyZDF{)HJvKkZ-PSg9H|CBkXDW0LD{a|9#cPy3h2KCVWM zYwlDVG|%<7nf_+_1s@z!74e+vs1x_Q{x;LMpOO9}wGXS`wl)ZjUozkIx0(LE4gblD ze^AY@{UG%1hT*Qi&GheM_$Orjs8Xta8~XW?1+Kr%^zU!@M|A#9y_LBr^m^e;*Wczy z`0|+b`Ki$47j^&M^3J2ZR=EB))1QCZ{}A3A)#8l==huHdaLG3fM1o%&fVJDwIg+QEB%ug&ytVfc@m|AWe(*e+Ceoa3f%GyTo)t6$e6 z>cH{3A^(Y2U4NVDZ=U}d*Bw^XzTF(U{_z)Ff19J>A7kX_(8E8v@5TP5{d3s}_SsB- zG;z-#Z=)vS^~JZJSv zd5*Wu^yi;G|4W}bt!`?Vu)pt&F{BwcBy(P zBFX8ps=MoNGyTo$#Xshd`WDZrJ|XYfv6=p6`LFibx9)orZk6}!*vxZjrvKIMT`Cdp znNso|9GmHHrvKi?Pt{d;E_B%g0XP3P)4wlFpU*dcdta@>dvpFJ@6EB9{x=%_@8i91 zweTL&*v3`e^lhg9^@jfq&3Cx(QED#lQL>r-;|zbkhc1Zs9959_9NA3&Jj4Ij2Y0CI zc&}V*d9RJlJWiHTeY|%+dsw}S=hn`A{bRR$+Dt!wXWD;G<=@=r(zlW4(%Vcwvpnz0 zIIia7IigAO9C(}QZJtIP?7guu6r_DMaS|`Sps%`hDg?{+Gy6bN<{dkVF z|1P}8(2wV)u94^7+e|;Rylo!6U*+Ms-z^Tea?`h&{$_c*YtKGagy(+WTD61gZ!^!0 znV-AVL3Jsf%lfH2SKnrIkKMKQI{$pn^-4S!w@99gYcu`Pr96MUd=K>|JhxWAch6?} zqYHfAKLPK>&c<_e2g`c^|HAOS((vz&_u7vz-qU9@y669vAHMgQ?_nt;&$+dk{;XK_ z@veSqnVNw2u+-0f%RQeq)4#pppPTfU`V!B*e?{KAXETp=py5Au;63VDyoWSb-a~3L z{muMb_2^w{*w+_1WiH+3=Er9Go9Aa)rF+$#c<{Q|>3i1$zz;=OPF zH&?m-Hq-wO!=LY=?t}WO*IIt^V(xJ)88yV&!;X^cQ=|7S~SdS&)7`=_D1@3Yb{hKn^q1@Kd{No zkIl@xnV*;Np7GwOPrAu-o^8f(k@s6Vs2|oO?OW#&)F=8qp*GXM3``$y-pOy>_l~_O z&%w5t{umNE??3-vuR8(MCxfIuv6=p@4ga~fZFPnl^@+`C@HO*usAsbKobz&0pV&^=tk_wH`s7KePi*F~wl(}uzje3sBXZ!`Vt8vdVt-QV%WRCETco#y)6jNwN2H~ji|AA0czXC&T> z(MjH8Ycu^>Cba*ocjMJmJlFlKyl2*C`kUqRA{C*oH=d(zGyQoCI{o=ilsK)>KB@4Y z_a0cA>2H>wtG45MLHp!>d2gxB^f$}HbxU7!4x@eYs=T+A7$8R^$WeeyNx6a8Kuo9SQ6 z@P7>T$-AgevgN%zHuG4A82+Oly3=_hy=iEJyqC>p`kVQA7WGLK>XZBAJv%nj-#kA@ zP@fc_KH0F&drz6o^f&Y02=&R;s88;f_w3kA{~9n|p39*=DTDf?ro6|;X8MmY{EJYZ zG(&w-{?*HZ2=>`b|Ivp3S=1*tqCUC#hAh|LX8K=i_#YcI%vpo_WYqpPuD{LnA8Yu3 zjQYfn`egd9ISDep2KEmzujC;jY9jR`Iqmx`LVe&{LTDSDQK?_ zpgzf381H^xHq)PVmd^i{!n$fa`aAD@;Jqi*X8N1uA!0^Z_dQ={wpVr2x0%Pvdw@GUDz-H4{4r(!;H^KUc#&HUul`PLbU{?3-Sz4xfvOn>wI3~v6j^8o6T*u)cV`Zm+w z%>Rgcesg-GKIvM+J6@aVZ4AbZHz1p8R_0ivX_k`c|x0(J!4gZnfz2&5%zw^d* zp1;ji;mb0o(?6I{S4}|su$9d=W)1iAq-g{zvZW$rx4D`Q}0Iy`?tu zSk3&8!F!zfp23y!-Y%PKSovvk^pns{b4G=RjQ8I6YI9BaGf(<_R^Kwic?JFP3i6&Z zo9Sh>{2Y__SlP_Jh}pk5iT9|s!h2Njt8hyIANg#ie;t_4&rNu*>w9>w>+L1p{Flw_ z8=3u`cjUdXAKc>2f7wibGyO;Kp4Jr1f1Nt+&41a$ba>T!@0-o^ zA8+^%`Sdn521A4mko6XF-nV+0V52?x+|J2u`&CJULBmF_&4p#oirlHV5FaI{v z-^@?EZ2H2tL)Xkx)o_3OW$JZq`Zm*_$Ds2wqs2^h z4epOM5QZ@RfqVr7!uRmfl{TmzpyRZ03 z?HGHB(>3p6H~%&_f-mFf{Qt1`gzB=Yne%RP6W8Bn`kU$BiTU@csDBR2d!lWo??@y4 zhcW-&ZhM2!nzdek(`Nb)GyKmTIiy2AXlySb9>AnBj zX8N1o?_|usPrE%mw4z)~H+`Gw&tuT}8H@RMbs{Y^CbpUDZ!`US82 zom_vL>2H2toNrG&SvU04@D858#q=L;q|f>GN|=8yzc$On2F?-b!0ujIqA>Z%yZw*NI!PqM=BzzY3QKzXKkjx znV(ssK2!sZ{;bXPH@~kNzyDY*$Ne-}`m;9E-^~93>kWqHd;M9P=|9o%pM>=WoWE-#{aKsoKgsad>kHnK z{;bXPzs2zXP1YOikp8UAm%*3UfIi-O)sLv5xL>c8{;bXPXPMCcTwibx`m=@dUTK@@ zZ(c7SV!c5=?$-skS_NY(%K^#U%Iq+f0A6{NIlC2B#LJg+`1{as6$k zKhKfQf8$EutIJXo0%_->U4NVDKg{s&_T@p<8U1A?{bif!Z&SZ`2*@%(wxU$&X& z#;gx(#r~`|e-#y~d4)HhZZrMO{LjMrgnDS7L`nbJ=2q};4b#UvAN}hmQJ-Jh>4|Iv z`)sCvJHx*U`qylqk7!kxMSq*=-^TFIL;pI9_3hm~-Sll{Ud;4wK>s%h^=E%sPh~Ux zFEY|!w)_sK=8-l|pM3+}`-RQSi|N05;`q?&U(=i+W!ky^Hq+ni@4VUd>QLnO5l(QG zw;svnw(#dM>+@L!{p+phUpL74&^=z8>2IF@5756pi}!lxzf{Z3kInQq&(9R}ufIkA z`s$Ysy6M|YfAjp`g8ua%nD5Tr_LJ*xGyTo};3xSNov#a4g}!^ZqnjU_>2IE&Sw}8* zn(t2ug?{nY+t|#!oB6pB{r4d#pMT80!Yw~GGmsh8=W{}%yWI7DahWIG{MbzY_J)5+ z>)GlU=BFb1?Q#8WrawQ>>HoZMf@*{Lsm`B#=la`B|2qu-Hb-w)ahRWKzwQIq-)82$ zz2VRPVl>Kg8)*;NO#hn<|0TXV)lZn8`f9j0UTQP_^9}zA-`%P{!~B%K|Juw<-evgr zME`VJa?{W+a{slN{$_rT>>s3}F+bJ!DQ`U4X8N1wCjF;ZK?E$JQ#*=Hyc(Tp(uWI=3OX#gOV?6m|8BeyE{*?^>Hs~)ug8OeH zx&PWs|H_8{F7%f#L4UbK?!PwEKhyAM|2P%>C)-T__J;p3^q1=!_g|ao&tuT(PeXrsD*DT7Wjxtt`kUov+u7UH zG|W%U7*UoV`D|vOSsrdUFiCa6c=AfQKib?L{$_s4p+BC7`s8%nE(ZH-?triyn9e`f z-*Np+)<~~EYcu^j8U9>+we6epjWy>z~?8fAjmw#d^G9 z=wI}#RmDx;X6D_@57*yCp*|V2!<#>~nf~>R{4`j+RQ-thq}s#Yc(u*+H^)yd$9lZ? zQJ(~5zT0LVD>JIkXYjteRZY|VF z&Ga|Re=gSJJ&yY1x~^@#@7H4bk2llDdOVK5ovi1LCvZKU$@Dj`mn*OykK=D=7kTsV zHeU{ZmN}jO+`h}yEoje|Q{MQ4&Ga{~m(@L1s|l!2zLWWGo9Se)Ns@%ugQG3 z&GhFn==}UrvPiWftL~f1BxVmIo*KVYLJ8?bl?! z+h*q7%+HHhkJl3Q$*Zq>^RqU0hW`~Xoqx`6FF<{Av9zCUrhhlX{|C%>Z$N#rOxn*j z)4z-1e;ekzFGqdyw6vdXW?sznt6={64CaseNc-7l`llM{Z(m%~ZEqZx_5U{0zl`A@ zBlFjDW&OX+%)6O>{FwtzJlYSNWc|O*^f%LAg!$!;xPH|SUVGbS`llQD8HV}gsknYC zp6le+|2ET~ZPqxLAGYkn51j58KfgFV)AhHR{$_i=ALf@g;QDPL>;G-0zuBJOUfY{r zt|IIIZKl83p67gW2CrZLK301^o4X>6WkTowCZ7%oqj3CGwWkKGkbqmx4yEO{*4U(O5={I za(S7~n(5wnug&x~$A>pyJd^E>t}_2+GyR7f>2v(@TC_KAlld>3d2Y<(owxS18j!X& zl-B(wH~%&>FC&fgQ!u`_9`j#H=D%#F|8T>9EXM2Z#r^$|%zxQT|CxsWXBbbLhxUAx z-4osX*i8RvhJUNNJJqRn&7EK8jdA^LrvG%qpW|nzevEhO%KVqj^q*z;bNs9xuHRNN z|7CMe`0_i@D--?I-hJHq+lMpG$_ER`(9NC)D=Sd^i6#)8G8QHsSY!vtC@a zDWtslFPrJlW6=3|5WlZ^FmhF>iOhf5%(Tt&yual!H9jynboI5}-Tc^0|3*goZ_N8e zIj_e$pWow^XPfD7=I4&WgKFNXgwQ7|z4=+2d&A!x?_ECRL-jcBzj{5q&GheY*v6=pT4gc(0-csFgeGQcL@HW$boZ)}_y6x&}TwjkJ>+9B6HZ$*Lexf_< zQ;BHLmzDMKHq(Eik^bZ|0{{aD(Fgy^E}ex0(Lt`S~JulUj@GeU<#a#%B7P`L9*WQJ11U&_>q7 z+f4t-FkPPO4SQYPjrPFnvL4=M`X?LyFHTyku0?ww@|gGg8k^~#VEFG^^s@Q}?SXjt zeT~iZPc;0S-21A^Mti=g{JzF!`llHF15drIl2D&imEYIc+z-AibNYDyb=NL68udwg zSr2bB{mtv;y_sLCe6;6(m-X;A)88zgEvN2L4bYxnwRw?S9&DyRk3r`rH=@LyPmh=N z@HW$bqT%0Q=XNy_?fDh59^Pj9o8{qb`?pkkj1PPu>)~x?-p%}cS?7H<2JL}PvL4>% z0r0=l$j_%(ud)L5Ndsxm+f4tf4gcq`Ud3I%D(!ij>3@~s|0C9`a6G(3+VeIuFJ}52 zFRX+5p`WzpZKi*Lk^bWtKRk%~;a6$T+f4u2hX0KiKU|OcVWza_ZD!uh^!4~(NZRu@ z)89=0MU3y|;QHMp?RlH&f2Wb3uQ9%N5&PrvdtRIA&o-hiZ(RQ}8rN@2Y0ukCf3y8u z72|u);QDPW?RlH&Z?>Pg{-rLi-$ZH8+f0A9L3Mu0V|*_Y*KbGpJ+I9J;mb0i{pSpw zt#+Y3pDFEmo9SLe=tnv{}s$<-H+=xRo0)|O#h*VKi7vkXb*Ie^$9l9{~E*pA zj4=;kvl;)|F!5Jmp6$@#HqI?ic;g~A>-aoZ;f}u#)~OD~I@O=kcf0oyo6Y#)_P-;4 zeCP$t+vQy9%|qC1#=kC1{^wvGuO{a48m4*clx^1WhafJ$1G4%3rFWg>+=Tn=%Q6pc zvl*Y?fgOK+%R-008`0~$Z8qbF`~D7ASn5>5eR!74liO^@=XYT5KXF1&=Xzt@-exoY z*f8-2Kbq$Bd;N(}m4n{86PwNW;m&{6Ys)#kZoMq@Sx@i$+pOdB*u&+24CW1QL_Oe_ zd2O3@{9%YcJWT$3|Nem*ir=|yl;648Y{nlICjNrxUFti`E50Vbd$ZY$KO#*0D?-~; zUCc9%l;6SGY{s7yCjNnrJJi|x{`_5>%{u;Y#0{7KDD*Sx2IY&PSE z%m3B9&G;k2?7toQRXtIE|0MGyHkI8xzbhL3t}QZ;VzZ9VV;>PF{@3V-U4!~t|BldR9iR99aQB}d z@jH%|_#H>52DRPm*Jd+*xckr5_+7_#{H|l`qKn-4HtYDKvHx)Gk3I4`kK9_`ys^z@ z{BZlf1Hb!7$GYpUW!<&SI{p~!pLrmg<-ZYr2l5$y2QvAfw=UUcGk&=IUxwd>jK}Xn zLf15KkKbl9ez^0Wgx`t$3%?V2@1*xTR-4WE;f{YXem8OremC;dmP_6J+pObXkK^We z5!pQcjIHa`gJ{?5c{ZEP_<3RCe|Kh`dI|0PsnSok*^GZfnD{I97OG3o?q4JQcAIs4 z<~`j0C$4%^{epS90n(4R*^JNeCbD__Z#IA3ou@k~{d$|t_#98N-aqOaQiP@xlE;DoNu%A`)xMkhui<%_dKn};r{oDj04zg#!m{9|M}aNs=*i+SRvyA zHkmh_#jHh}mq$4_E#df3;b)#r-cuo-1av89&_h_xzYw)JWX_?w99)*=)uSSALf^ zds$^;oH1XX3udz!KV118wW?4x$NleHc}|$kIzEp*T>iVveND0d(pSbYY}WB_Lj3VC zvRQr$j$Wl^qW)_u>y~UbjRn{@tY{tJiO#C%9b5tGFf0bojlg(!Q z%3QT^Nxo6Y#Q zhl$^+=nD6D`|YLwVzZ9Vb5}J?{3e8Z*Hve+Zt8A%PKeEB z{BY<0)18;9n=$XApBrMc89&_d&%33uYLEJRuJm7QHsjwK=J;3sTvHuS_$G9Tth2J& zj9(#4{Kr47s;)%;Wvb#m#E6 z(SNboj34g$TT*AN8fx@kY&PSEt3O`7tcNn6Yhtq*KV12rv!ja|h5CDqtoyRrj32K2 zR(Q38I*xT>TmtKIh)P+w}kor z*$#x7myz?)c}R{XGWt_fYwr zo6TnYj$w}fI<&uQC4CbbD(miTHsiB`C7bo{ldT_Dzhm7_g8UB7W;1?PnE0v37pmQ; zzgN}u*1_9s#%BZ9-ap&h*P{OZK-THoY{qXNCjRls3sv#_7$;e2!hR4zTyX zAMNkysJ~y3`2(BH_~Gi09%z4a-hPezuFhsNez@z8?QPcIcgXyK&1U?t^#|JDSD^hJ zl6C*fEjHtK2y^`Rqy0St_4icy9e~Yd{BY%WFxuZgqyBzGeivY~j?ZHcm;Y{Pe{=jP zTILUI*714onHnblgR#zc9_nxX92%R=_~Gt9hp_IK^|yX5jm>8KaP22P=c+O4Z~dGa zo6Y#;!sP!Ho`W^iSodeMj?ZHcm;WkQSNt>D-%rbPX>8W=>J!i=VsV!#;+D8ei7CI&%pTiB6*I6 z&1U@SVd9t6{=^BO{?Y3SZ8qcA3KM@Y)(KZc`>~0vGqhR9zYTH2wV$|7_+_j!s94Th z2WhhzKV13$1nY>;Vcmg#4v@`e{BY%G3Dyw>4@`Y)B|cG#@rbL@P2nDhU{h;`~p%pdMQK7zM5pUr0cSz+Rzx?#QIb2IlZ z=;y|_*^ECUOni0G8dVSThjaUQ&$+SLj2~|P<;v%=t_;6hoSoCl-M`H`K94HX%bp3*T2nX{BZdXp#3uu*Z;S2{o8EDzckGGTaNa} z<7j_eE$fDDHsjX|6F(Ef>*wm&Y{qX8CjKij{-@U&+pOcy zMBH%mKm8}KSDP^ZweAk@`nTDPAFlj!ye|*!kBj9wJT{y0XNAfCLbN}A+Vm!f_yvf6N0|KIhVeH(*YX81e;vl(*niXOkZm^OUlAsLbBw?7cZQ2(U9!zOK94zHlU@peujZit7U+6y03Z2mHsgoO|9XtS@wwl6owLnm{BY-gFUH@dqyBnI);-&7#t(P= zBQgFq6aBXyvJTp2Gk%pY$G^B@ib}@%f&F{8yT@;{89yUje2l-{jPbV{r+e$97h7z` zPYo0Q;C1EIa@3z^wt4R*u-S~C7AF1zjKA@{D$QjbwasSyGGXF>h4Ht_Y(L4mYMXWZ zyAYRk0NE@*7s>dWUT1By89!Y85r5guYC7sqz3$p(Gk&=1Z!yN-8l(TVQr2PHY{m~) ze{9G2+a%PVdR?~7X8dsFe=)}2hM@oUq^#4n*^D2q{9c0bx4xJ^`CQg*+pOdB*u&-j z2*%$gq5jU6b=)>Hek)A;%=LS}^8>oyA;bAc)!Ssa{ToMG9A$B|#W5DgS{!F_yv2Hs z3c>E59`n(x=Rh^<}~YTNOL+i%;VSBxc*#UGn(}nx@O%c(_9`KW_r5M zr$5(Y;F@)r(p=e!uj?%Rc~$FkU8eNs)vV8}TU^89nikix_#%sITU^KDi!EkdVV)1& zhD5OYr`v>@>tn<8*KJn)xo!h$ZfN;8vbeFuO)PF|aWjjXTin9p%PekbaVv{kTinLt zwidUuILqQ}i+K|>&tK5u_7-=rILG3S7GG|$9+N__`_~!&oBP-IeEHb@O{)31Zj-I`*#)oH`5r49+B(MLTqyaPSdVXpl4r8P2YnbyemdUcbx`u#2_Am|B_B@om@fk(rzLw_ z8%l1G;&B%!d0?u?H$us`r+Iuol)Nn6D*HoK()^8c=eR@*ZCf zCHJr3@mMH%N=1+7Ldi=idHfQTyt%T+A3@3ct9bkylpL4oaaAa}K{b!tL&?3XdweaF zJgJ7q_dv-DYkIr}O5Rk<Bx}kH3JDuWjq`6exK(8!*sGQ1VMbkGDd}RXcjz1nP2UVJLZB zSC4l>$!pm_fW8eSH|XVYdnkEfUys*7T^=9|CAYZR<1SEglffQe4kgbV>hZ%+^5GF4 z^WhGz|7h`tl6Ue32i*rHzdg?5FQDX#yg@-5K*@LV1_WIQb(uF9GL&3{Hw?2+6wS}^_<7N0_}&?RoM`>t z9*-2w!S~9~Zxt=T_ekC#ItSk$xmYxRjK|N5j?D9Tv1q|Wi7&bb=biC0Zu7Ksx~KJL zcv^Iqr-wwJ#|?}A--vF1&}08Yp4M9I=^)XzPk5X!+HIxB1)@1?Jib-*P?5*AUhy<% zgM2PJ$np3=(aPIA?kk$H)8lTU%|7&aoamg-JT4YpvDf20q9gZvyjXP5j~+iLdh5>~ z7m0rOo5u;KJU#S>r?t*_dO9+~JzveDJS|P|w0@$e8R?#O6V0d~ELy*c$0J1#)%3Vl zEl*F^^R(F|o>p$`X;8Jg%iY-Luux zjBTEt-tK9$9iI06(9=1h<390tg=qb~9*-2Qwcq1GqB(~=zEyPb&mMm$T6DtWL!$YA zc>KKRxJbWS9#@FYiTAiz^qVw~E2n#Ux~!+o%6Yn>il?QbMYTLWB>G`Jj}tEOw0;v$ zM~ddO@c35IzU@4oBib#;;{wsrE*{tK>S?#$^10~9{vIzDtu@%=L86sMdfZpE?O2cV zMIRjR@pjSYCwlyi=(t-wULhKVy3Y?o^Uqa?@i)`G`x^o0HyMvHD)E1`?f#k$<7#uA zjsIo_dk*Xu(ecWGJ(4A~YsXFz9do5uY9#Kgu#;C^#1pA+G*X+!0yAzfu(O=6za4t*VVNP>j#&<`Baw2 zPh~aV&3DYrR6BR>3?VUh`<~*R*$4|#X@4ybdbd>jeE<2GcjEv5DOcBB_r3BpdHVIE zALIt~cDwC6-EEd1bDKWMrF+g8uD5kK)6wBNP4hUBKF-s>mn-hWELZeL8jfAA{8qVw zpE`p4{FBSo`E!bEjOQgcIx=hQ;$dyKUHsODGD99|M{T^TG^^`^+uD$+_dIeWt9kQZ z+;X*O5ue*LQ?V?)ztbyI7fQLpb>WsPl!I1!8{c(++x*VWZTjf4#BjZ>!&#PeIJdp< zKd&F8`M1gy_xpFs70cQ`xm=;n_RcBF70*j<^c`83J^EFfTUKXngtenq^j(?#`P#Y+ zYeyyX`o_5m!B|g8xylV(Nc9!-&3l$t=Xl#*oio!dSLQZ-nm2#te7N4$;Y^4A4A*J$ zzJ~JW{(0M8eZ~721D~_%EBdrG>MI@pT=1{=L0wZ{qPuio8xVU??$J98af2J|+| z2De#nnA<#0ixyQnU#|4F4%g+1;W|xSF8H1Az`4=)L0uO9PnWBO*!O?CT$$&^Jg2%` z?Ot1V1IkcaYO^i(x#fw>a`oG)j_puSIjpbreURk}>0D6tl|JsT7gq}E?K^kmy4x&Q z<~DuwIb*oq*5NEmI-J`K|KBNBNaK9FUB?esU+qKsybtO!%Ch@UDp$;(c}{sB9I!Pi z3-`MXLFYl<_cp9}xltCj+mfk&80D&2b3PAYrn+0o)xA*Kh0t#2wZSql*`Hy$<&uN-`AFP z9Lv>p*YUZ~GZo8K3GRazV!86#m|hw4+Uh=^ZeQ`-aGO3nW*x4#bvVnCZjW)B;ksP7 z=hyx3f3C0olXg4mtA9Yb^3IWcPP<{8;aZF{>|VQS-Q^flpjLQ%7}{00wb6EV;jlI= zQ#7-ERdT_NGvvB$Y_HDow!J#XtIN%8`rugII-cQrTZilVis9kvD}3j;{{H83^`F#N z3$gG2c70`@7v2-~dC~P%`4t~*xcZYDvZ$f{$K3jg%=)V6j@enb7Tx=xSzm3x!0IcG zmFV`l-e!B7+Z=;3x7j8~m9trg>unv*bm-4;ohIsWvipZL&zCD5&M_!!TvRa)WBf`n zGSf51+Zmtj`+xHI72ECZc|_gKbJPp<)xfQHwtENTp~pHj%A#((BPKh?$!JTa&NaqG zb-VpS9v78%yIYpLw)ak>eeP}32Vb#UX6U20bvVnL4(B$*&HLaEV_cNiq%JR3xe6kU zzqH$1HvjkWE4DkBzTLh$ckbMOy}r`tMcVCdeZ}+A9qp@VwA&|PJhTt$Cu+j_(b*|z zual|ejd4-kZod=ls}E6MQE3-ayB&2k$I{(4Jn9CPAGeM$x9OwXqzu>FI-K>r4(B$* z&2q&w|IU4oV_Let((%K!+Zkq;E0o=TK>Nz;OY`{MLzeTx@v9~nZ%4aoJ{nAoq`HA$_*5&in9#X8$&i6M;`7v7RB)AM20s)-zyH z0v0VqMc{+TD1YSn^$hMx25(hE`1K4??s|r3_kXTuzzPYUx01nL&!FdVcpUot@?7X~ z(QcT(8IgHS7WIYXbMCk(nd72+jd>j1zG8jFa&=+VSKe4C>ulcFSjP0djAg^z_I$j0 z%nSFnb@-ogy=#==X1T&W>TivU{%7~Wf6ln5cV7NHr}{pKF$K)y+{W>R4UrfJ<^7LL zCF^lf^FE0C$Awm|+_t)mZMxgu*n-zqH@E47D#2~HGhA=$aJJQTIJdp#vwU9P{~chCXOt?Zmj~bhOux zw*Sc0el70Go{sSak2kfgVYJ)zID^+8ys+j6^?i+FczT;-oBFu}ar zI-J`KH|s0hqt2Hr^ZsU*EBgN@h)W(-zZj{aW zW->Kl(j}N<-sz5Cq5bO4<8a=Y_rVKkos4d)dv&&V|1$4!<~DtFTb<#0TZi-f>2Pi{ z+$>jrx844q+z0LYnCg!Kj^0aH^$rllm6g8X`F%mLHC$(F3kSm zCm3f)Kslmre|?!d-%MtI@OfjL!R!xSX!C>m-lzL=5ap9d~*@S*|$md?Af9u#LpyhPiDg zZlg?`Z#$XW^kJKlWrpE;TZiko4Cgk(&2ojd&);gd|0nG$+z0>b^_6*E*xu9UMYpfA zoQ#dIcGOjM{Ml?*k*Q?XaY*BWZeMY%#Mj%qXX$O$Kip>dF}J-sE&OWPbiS&M@=8Uaoj-Ja??GxPF!8 zisz*##u=`}deOaWS8ZtTWVpIA>(Q+Cxc`x;S$W+>eFh8j4E4H!q zHrtrGuV-#cyWN=I@#-!e&htlqU0>Pl_P<+SA&v9pO4oPc+E+~9ZeRVA>MOR}b$!M2 zqUUkiqMmvuuT>Ux(UX1FdFtgrs=c>8~{{tE4@|9XAJ`iAwDeNOfIs~#9T zWUjwTFvi>Uxaftr4q4YxJO_H4Wkc6j=C+(C_ndj<$E&Y&_@Cv^kjD9SGP-^BZkYBJ)Bh*8ub4mGzT$b|`m5{k z`@ubEUv*w^TRUp@vmLYWJHj?(Du17&+gG@@-E;hZqkT08&yM{h?{yCZ z;>!G_4qRK`>3rYZK;QaD)E9HRJNHJ;4Wz6-tZrM`&ADgvoWQ!9PpAPczYFEQc6Z=- z{s}cOVqYlc=&V52zF$<;&ig{IjO!nG^6_)(hYqRE@4Fue%-C^GHSS%@>DBhZz~Vc9 zbMt&@;{}1MJN}}wUidNee(!#PIoF+2gW6o~WaK>%c&%y2V9}k`f}hlEAK0=ogmV`Y zk$iH7YBKt6_la2>=bTe`a6?r7oV3<`UaFJz%pWt<<3IHb#QUOBo1_g1eEQQ1fp_bT z3*NkHKp@!{8F8-DCxPl4z7N#c+ch|2Lv8dOA|p1u@E7e)r_Agt>R>+t>D6nrA#=8cOcmsj10yQ*amdV5Cjz}lHkbENlO^%<)0(iPd$ zM{db#(eSKliMZq5nW09ssFMA9!zoz@hMZGv5ccZ)saeGbXQ)RmEzIgPvxSp|V_Px& z4LtW_rt0=l;<^@#bDba_kMZ5Jt%JQ&E(t!fbAa>9YfiAEFVg?iqPD^AoofWwe>l(i zV$YUfXM|Nxy+1p+VNxjf!1Q3zJ(*5dTnX7-AIko6ah=d3HD&~_+Ed=?!K-6ZudG$e zvO=w1oe_NV(|epgJdVV;gs61)DIIv|OiXNCOmtjyd_r7&LVQ$WOk7e-Vp3vqQgUQc zq%S2lDK;iGIyN;nB{jvD>hq^X#i!xX9qEzD=~0mx{NT_VtaB%GXBIQpFft*6p4z9OiK14kr+JiBi4sB z;GB?{l$w^3nwC+fysvDz@)huG6+SM6e|&rhp4f++GsIhVlj=*ub_R@(5Q)SS|4?v! z=`a*(ylgiLpR>E1?mk{57XL@%(Jj&VG*v?4kl#dD5-b+~r{Mosd>RkGIHZt>|Kp+Y zNGTqBN_6*;i2WoX)nxdm;$H?chy_P~RxGSQSefwRJ+-HM+pmtzY29wwto7}BZfZmQ z?wStmYIgFqCQ~bZ9Bems_(`>3Ry}9Rs!47|yQyw^cAIsLvWF~Ll|^%R60V+<4_x_k zoq`$4ZEuy7_uP`_@hrao)AeoBnLb|)>}MqGrgsjjPhQJ)?)v(^zzCd{joaPdNChUp zbxvKCn(JIM{DHvGPKVXx+PO~CUL}F<>1Wi?&&xQwdzS=?OU|h%Uy{4M7XGP8DNfa) z4+ZYH{+z0D)i0ryTNek4)}L07O^SB_O1OWo~z zKI-O7KKf)}?K{WR)E)Jl`9tOf4%aMItxIdT+sD_RQ{yL;bvjLZFmUPYQZ@SN>Q3~u z2hQ&+?vo_}XWL<~?%lC7@J*#371M0=>z2TzksoaQx!lZ6tA3pk%s%vy!!x>n@8cWK zoSC77|^?IqHgB4^BmotL}^52(S)L`f{S0=sc0Na{S{?O3eePgCi4L*3EHNW=;>3 zZ8lN0p8P=QQpC;r{zzzBw~MoXPM)rI-E(7hBZT$8?t{Qn+s6h!9Hnzd9IU-@At}%gR&Z&##*0VO*XvMskze&VIOuc7kIMxcGdl{8QEVi?2z5p z7a6;8WbYO`zqm?${6u^(_2#Y40AFO>gy~xXFC4!vc=T-lz$=})2L~d5)Bn{j*mg;U z;HHb#1X8|wJ~$X**T1qkQ2wj2!Ba<@2d*mHGdL7$BO~}+r3gPN{rK3J_!xh@KO#ON zIw3JK!IzYPYTxHi_QxfoO7q90#Kfh<`BPE3CMBmP$EC%_r^QF7MMtGYrKY9ErNzbK zQF!UTg!F{S^vH+|+zlcVGZIsyA}U2B#8r+%YLzNSMC0YVG0`!VszxQ_BkU(R)t4Dt zCAM0Xs+rY%<;qttS3a|P4DJ#BNPkLXRC0>HVq}>z6%#X3QZp)4s92_KYui0$VErB` zcZ>{NzR|E$SQ=_{Qamipy)*DW5d)5K?-0Bv#Nrd&wvb*N!r~Aw&b>#Zxp$2u{GWim zCt(k%utcQDdqxr{8OA#o|3=C^<4#nRth`vku@Y?b>fp9tK60jY>)eOezq=}>E%m$J z{oCF4W{=inYK?8Z+718er22JbGiTP))$To`{YzW2B5H5WI{C~n*RYGf*7NS3<-fmo zzc_?vZ~iqM-8K)G#{b+tZ#>iItA<<*g>^1hs(jB@TVHZ4H}DSUg|TF}ANng}u)Pj# zb+p$5(=v{$9_>C0z1^@^;Drju)#jx4+m1|rGBEJ7L#jn=7iX@&PvGbMht<)JU7SU= z=L9}`2W{*(z7Lg|cW+?p72m6(mGzx9<(~@_zwy0#VN6eF@4%Cn5Uy*%{pu*=>4V}7ivc5JHi?de{@DXW*`7^5SuIrGeh zkA7I&x)gOv=9F#$JPR%HkdqdwH+|ZsR`1PF-(D3Lh(p+%($6={Jvk#d>AiwYg`vyZ zpxDN5ygJEQK6aXF_(}QDxC37~De#*(wY}=&tEG0{lkKE0*r?DHO6VVxqpo@_Q*D2J zu(NIZMvR|DCPd7Ra}EslJ6|oiO*KrK7pj1`%L3DbHzxcTnsnuBS-^BMP~ejunn~~w8MAg`*`&C!5XOBc6EHg36Z5U?Ny&&!%U~6V`#@|&WQ5;eHL_fpa%HMisTvUkBy3rN{@?= z%Sg|_Qu@rQnW?Dz*_@BAl$M@Wsbb}dl`3cA-hrM0+Wd(b6?_$vQxePi%BG=jP`;9{ zjIUzlDtNqLL}Yvfo-Y^^8<|=*Dmo?#_obMM=)m~m5)%*seT2lasQJ?vrL3<^MPK;} zm8(?M^}qK}LDt&*W1X7e-UHY_h(L`Tfm%2MwJ&S@X#DR-4bFQ3?*zOTFqBL7Bi$N5 z5tUpjJQ&6Y67o@mykEq)b$u-AbM$}Q*vKCKB_bVK5-b^?vZuhhUf1&}ZfH7EV11tk z51v;3?MCIqN{AI3D<@y_`)?biFl)7xc#8?ig<-5%3i#V-C@U%Pvj|H9ST-bak5pPTs&p1u6n zbpH42{jx~8(M%tj5}lOloyYw4K*%x_T?-HjQaT()&ANq zH`bo9B+&Z!0abVI6;5gHlYt$1rE2b$3Qp(ga|83PJ9It|zkPZ{6%Ov=JlJzbAamk5 zwZD0av#-yN!2KB~RM#!LLq86l6ZrhLbL#RpPKLUdTN2naaVQN_2Z1-+OF?z>Kk1ri(@o>R(j9$_ zzjN2V=K{;t^;ZM#sHCc4&EL@0Z#c{DyH>rkZL+ibt?r8bgK~SG2!%$i3w(SwPaUe7 z!u~g6JQlt$M0?V8ZwewYGW>wIcpd0R4lAb0h9^8jOlp zuTIWYxidFA>>uoEKGL~n`F+ly*T<_pFZXoNKZty`c4cSbfZJ7{C69;v1>ZR6A4Cpb z_1UJ(@%a60!PHPu%h3+{2ktq|T{%My9d}iz({C-=KZsa-?EQ5tUz}UW-M-tT$sk~{a4`;VvOevadLe<25%*>RXzV7bcqxz2N)^+w*f zQ^drK>!elaob(tTqrq`B>K#ma4D)p^t{CGxxHxEBG-{=b(#^%q z)m>*WI67cVZ_>GYAgrU*dT5<-5!7te7_`pLdc8sE=;)#K_we-e^YeFbRC%Z<56a!$ zL+xYqF=DK4@IhN2;2+?mb9SNjA1z&g-rL33+gD*U`TF>J``~%Hx_WtfDZCVZ7}29( ztP&TZtKecr^uZX;^LAb5tjCw5SMXLC5$y3r>#lJ1vd4S;{7ag43i;S7!D{haqk+Bw zO*z$$RihE6=AA-8H01ZdQEI|%wPfjMR5FyOMqH1k+yM=-18>?5_6D57JRbkll+!St znsX1{pwsZ(gvOd0bm{_ZLwEy@(D2=ehMbyoH~atH@Ky9dZ5Xvr)UMdtEro*Gt@4{| znDZK+i65}YF*jAMG}CtCs_K^Se>oIKk7+wLDALlR_yt>8O_E0Kr1t_$XKgmruqJ$c z-4g9EmT&1Ee{PTIXvxQau3fM87mw$uQ=@i07+Y%B@lmkqn5*3HEEx@IFBJ6LMf=Y@ zFwQ@{cvl|c>M0{$vB%XfVLebIA#BTMcCw#QJ~#4PA#T`5cIRiM++xXMVd3r1ETj0f z)bUY{E6{}L_XDRYUve3HqC#I+~FQM;;?BDMj zd^JZXV^S1EJt)J!wz$VD)?|9a{NI{o2vL_`v%oG_Bwe{_!p&iy*mrC6^2!$T1?#-m zETPslX;j{1Vb>yz^G83=?escBC_Tr#hrT%_emCoe(f6j&KT>@mWPdqD%Sv@LZ zy@^_RE^iETSgw}4H*vDEp^5?wF;uJHpBDxl+bS=c+*)k#%1K1bN7>o?uJBp6QC={= zg}BJaPsD&kxqA0{A^&(wHYMhk9268nad-Wu;XetzgQrTXd-r8!%soZKeDqJkX9%AX z2geQW@U@sZqKSZ*kK**shr*^k&1BD(9mJhQ0X*hYeO!241&rA@K7XB8?%L@D#N8D$ z*Jnwx-qy#w{=SNgn2#d0e5mm1#U6RPPapB=kh*vq5RBo!Z*M)n;FEOx`!S-~ZG=oQ zpE2%fEIw*0a;6cIcK=KA4QP(O8BnJcDdWZ6fv}I z1s?MmTIQp0wC7Iw^1Fs&#=B}FwdrSI9Rr$w!xolOSeNDW5fJlHPHVec*nGA>dwYJm zS?b_TF(2is?)NcgOlFsN9uh8%jzr8yqg=dmhM-&6h1yTRRU^cMPs+RcNo;~+w>x&R zj-HSvo-2FX^7iNvE82NQrKBl>_r)⁡oo-r}+m3wDXFz&_Uv{b#sOK&*O#B9dC$e z=kbD~I@^vYtgUrKLaGz`duO#ur`PJVPCAtmqjrNM;`a!`D-BBC+B@^;j+2AY!Gz&E z0@jF|Q={+dg4mAH)o5~4A)e#p=A=U7<)HFZxj1;4T+lir&aN{WF{X73a&&bLaCHj^ za&T1oC{><5O0@YJwE2km`>6GZ@;IT3G3X6Wfo|@BL9TvYzP^51T|l70=;80@@9mGa zUxgrvPT`0^i6gFnkQBZVHD(4*ZVryF6u&_v%788m0eyc2^u2xk5H6y>pOS$)weVC? zom%&j;C{)VoxW3Q*-L^qI_%M)-Hjim5WlTzIE8Fz&o*qQ06(?%__pzLp&>j4_nokZ z?h@@dZ4G!#LwE|_P#E7C|54E27QCUr4GrRH_)aaoEA~nPHq??(%SNr%Q)P5gkk#?K0}hP@tC-x%CcCzPf)?q z6?Nr;2M2O@wRyy9d>tau{?P0PEUWe1eA;(zQN)t(itNiQh(!6eTRCgjm|xlD zm=yW`+{MPnFiJ7-KCz zINMw=Ue0@hIRDD&S_^*CTHm3)#AKHXLfG0I>$SsYMDzj9OKyx7TS~C4P%k(ACkRl*M8YUywLxqP&U7- zbazo9^#QsrEr+r*BbLZJx2??Ay!wse{tD-IUEd=wW^x-)& z`T)n!-Y)FaBhl)$r@1)p;C%D}8pX4A&TRLOzEY3E)?(M{a~R?{id6q(Veg?JapBuq z;?FDB3y9-5ck47#o?>Cbci}z6&1x+}9EX10_K$QCuMdjjD6g3|TYp+sMf}MvPCUQP zQ=m9b1D}<`$Y)WaacG#hWP+2Jdexb-}U2ox|Cx9g(8@iEPp~nE62D(~<(ZS&0WN=a=wyrnnwQi0YHxosG z+}$+p8V936<>8^!xw@b`@o@Ffx$5*LH+N4@cLz@gqo>iu)5W9$5yO_X=uS~d0ZqRS zQG4_-iV(zvyuCvdpGfpD4_Q@5U=cp)o2|u1W{JO6{uF!6VQ= zIypLdV}gPH1{W~7xZ%r8J~X@V@C@+s_WeW0V+(Omm!ZIOx4oT*tsBy#YoaLzMRI6j zL669lspFwPIQ$&(h@3!!uO?a6U`jw;jsuQUx8s1v4hm2FE5(cG|J3D>E4$%5iWHG1 z({zHS7}Vi-VBds2n=RAif;t@!zV+l?4@Hn{do=Ap6b%3Fj_bK&pFXHrq^48x@IWp# z&D6Y7lUlERyt&CQ8{&jJiMf4Ru8XIw^>mP>p6YrmJ*KU=D%jHH@grs&<}J5N8-)%C z%h4~lxAuKK&N@u<*+QTECVxf0)E4jQ_UG&T_xmM!Zx>6tLQw|W5%|nOUlGEsxskA^ z{%5xRd9u9K8ekpY>mJ`9u{KoDY`V$!3ms|-sbz1mQFR;0eFIX2qd$LSot>vjW}g(H z;aD{!86!S}UfsWHTbH-HQ`*a<;*PJf5*nopJvly(t z%a$#Okv;Mvg^+Q-vP9h?DKpYXn0D_us~2@un(9zw_3!$E?`sZUwvGsU!m6Lr%4^4K z`MpZ6*%r<_Y;hwwv0(Q7wBJ@zhJWr>pC&5jW^U46l%t3^`!^z&Bw zUe?~JD)$`O-Ad2XWua9z`PH=^%znhoQDx-{1qR_{Kb_b#_K4+Zjn*u&V75r_o|REJ zE3X*+TJ_0S%?q7d%XpzX4Ia8VFSVmFe=Xwim)fSv7<6dWz!Z~FQlj`WLqO!cNHsYAIUx4Gbk3Nc$1MP)XD52 zzC4>N7j6!qSd?O3VSt$RDn%&xst)VAZ>5NN3tmOG55$QW{XQ{o(frWtv~b9~o4Btj z%%V>-nzy+3de?&OH=0<>kKTEMgKjg5MX_7i^6f9&nX$6K(&i^J#G*7i0!GMTokp+$ z-(1Wsy(WTT-r`h!jH_7WIVOHd^X5#M^sR__i{dw(T1@EBR%|4nww^9MndU9-=ZF6& z%rbl>j&y1wpBb1)R;}o}{FqQ&=PNPTFjcz$uq|1&A~D5B)Q6>rDL!?rXZb+?pUZ zQ)t|GUr>ru@3j_NW&!mN` zBE)(-<5|mvi>018)-39@H1JvlaRalmvQ6ToFL8{14<)}79bU_Qv9_w+ZD;Yftre`b z`nP6|D`$%X(W>0sY7kGg8EH*#+>(77I8PjkW4;C~X0lJN&;p}V!juM+5`|u^(QDA+ zstp>o(b>u5Vl=rL+>|;8Cr8A5+;vKKwEPCOhpWlMWb`mPd1?%v23Jp44^Iy#bblHz zH=Vbax3ibC(aY%K;|$Tz`RKIHZeA|FzAh#MzMSkut#)*TU%SF2OlZU1+?5^*56tPD zbsnk!%Md>kBTdU_Vn&)ylQVJ|+oX(oKbn+zDZKH2 zAAHiJOo#jEa72eAG(B_0{|&g7FaB>^i$#4WeXSSoH|Y!$9=qVN3(lf`(-r4?;aYC| zu_vxZ_weDbFls8P%gDl?J#`bFXzHnJ@I84iLHTK0+@wBExi9K#5@_p~c*z{{P1!hl zOxt&DFPWPw-?F>i0_7&FefZ?AZ__%~A97n+>t)@t&?mpipZmX(S2u0{bMd>bfq!j3 zN^|ePbiy-*A`YLFJM?*PBl*)_TRx=Xbl`5vsY4h)~^ax)mz1j@(g>QjL>OzDVsBWvs8v0~Jn zwKDZzkwt5yvzD=9LhY?q{{~(%`Y&~}Cjx8ycDCSt-e0VBb1Mr(yY((^h#azNh&a1t zeWCfFt8xg=E45}QTVw7d?7G%a7<2j>*}3}r;L)sQu|i(c?Ugip$sJY}&tK!km_>SOpw2zwN2AA<+|FAJ?8lz?9?S3fn=G_TzC?2_{0LEph*L87*ioZ)1Ue`+sFJ2t zIzp2X4svvI#Ntv%9XJ6)Z5`Sbm0smc?*fMkYG`4pfknHAB}UL>jE>c042}*)ql=5H z6V`+34F)4Fpf{LIZcqe#nG%sBQVq;g)DA{O!O%wG(l`Z+elRnkf^Q{DKxsHmwCl(l zA1xkHbco_Uw#7XvYSMW_Lmog&c1ju@9nPYKo)izF#XPi>M~6q$0F?~MX{)DSwW0-H zlmGFxO|SpKWlxwhqC(?Wo2TYRj2N3h+w4>GEHzt>ilfK0{jO-9#nRv+d)V!$RI0yZ z8&DrwZ#94FZk>@=lYi1Z{)%=W7w>`l=j;6U$I}$&iAh%|N@Lp>pI=r)>>f0|@L8Zh z`%Wp7q&9sLg=e2W)8AONxWkPEbMARwZ;K*gbk6XVm8EKv%fljHvK`JpOEs{juI{7< ze67ssL;03{c&#niPHI^GlOW^`4RRytm3Ntjflqp#IE{3c(oL-$>N_&VDLD*rSf zQCM~A7T@2MFABq5F7P!vS!-(X{nHJ8$ft9nXFOr8TFsaGzn{VHd!ctZnXdE8pxbO& zOg*{R^LoPC3n2F;XLHwRQNJqaI@`3aj@-O?k{}fqv$6ARCNbSj6lXfjkv-P>vu6=o z(FQoEg1$^+-^Y1b^HaXE4jrHUPPOtN<|#*#Htw9u1W-J{%)CoHb*5586}=c z+bnh1UQ>4e<-CYCM>XHql^v+FT)s504%>TT9JM*>_RU<`xUc8QKTWI0^m*f`%~3}t zYNYn-B3YA<2`snbK&dkR@N2I*D}UeL%swyDi5b>!Sapmc1NNC^`F%8ddM-kI+RK;L z*lT<3tRknpuf~S0s>(LhSu4lmdZBGh(hn|GS>Bd7*6!0}iPqT1?ozV2*=^Xx))nQs z`zA6G$I1z6Hg$J1_QEtu4kaM zw~}Azn#+keHeqs+c^%eN9XI#QAFSzPNy6`K)2=9S(UW4~;R!vPe`Sq`IFGW-**fC) zH$voYTY_0&`i~;wJgVlK=RrfCC@oCN_5RSEVst7 zR@e4Ob6XFVuYEsUoFyEU+v3>!jAr8ftt;f#%2)FH_&gC~W>s0o3S#A$zVeXwG2*;c z!$gdk6}Pe{=38gH%6gSGRDl>PBk1X`nqL#!;hicGB|n04?GqCZn1&v6B;mJZ?&Zn?djD z;Nq$?xEhp*t+*o)vjam-`d$5AvP4A({pjhpx!dO`C35=!{LcX{sR(UFE zBp9Y6kupA3b7=12HDG?{|27kJVUoD&c2$ESdFD6f7Q?EhQBC@w_lPrA@g|fsVI* zkt`?qSGLkMr&eqwCB|15RyX{_HX0^LkLE@Qbo`I!C_Wxf5E_ID-yi(IXuo@er_kZ> zXZECZeL4N)=>&S7Ss8Egt2Df2E_u$e2}bLBpU149?-=QJ&P1!U^d0-07$i48JlHyW z-wWncbX6Mv;HI@zj}QF5#lB?(`r3l>%krjHePVgG=@Yv@sJ{ID4|T1&Y7g_i{4GuV zVU2(O_%UB$oUGC9K6^GVX53YC8N_$KS=u}wgFPo*^)xX?-%^^AJw)>Dc8`pL{vs4J zsx`Ha+?dAd6m*Zpc$t3XinCv(iIe@OOZ5~3qsb`tBaSn4;xr5W+rBqEH$gK4*FG_N zuX%d%$-HSFd2WK{T)_xdx+p0xu6U53pYV~9&I~zIW$(U=$*CQm2c(HUX_->_jxX~wuO%GuY#@d^PNsN|vd^IR!fs=*)VNJ2F}r?Kiub5yu6iw$pBf`i zd)iJs#*)aXRRg?@;-rWBg~ju%qUijM*dEvOxa=W%KJFsCi*6vsb()Dt-jL2VxiyIMA2&0@|9+A~)1E8N4) zKR_^4k6`b=i4*VZbwWQJ(;H9=nv5L3L#%(oBthkX*@!LMO^dLNR_|ocs~nN@W>hJS zO07|=!qmZ}L{q6TXEYqz?BVRrLpx3$o-P_^2c4If z&fUx18Sxu6?&IO^p)@(WID1nL156w(Jl3}w9MKw^TvZwc`X|qj;1CC`Bb?qTR2Qnn zYFB5hz;X)I8}+3EO9hn<3<@pnGrcTMmSqXMmfpAF|`{)mRD}5L_xW3M@MWcr3f=9Ktf%bP0w)~{72msZE5~Q>zrslh1@HAYUn42E~X@G^T*^l znoHTbHtMu&T^e;~lq^TYVOv+_j&2R9g1mDhs-Uh7-v|DkLN+#0H(_gALq&HgSs+XJ zL0{p4Pj`F`fd_q*w8Yf9cSOsrK+8=nvDq48PQUmxwy^rfJ;QPq#M8E~tB>WGGBlPR z(>6N9$5Pbt9cw*hhE(t25I!rr-gvk*@|)nh{-5`At1JDr{Ty}iRnl$i zt2$#}mp+%J9%v-LI@d@jc$CeeZi@1|8cD*;nJZYq&=86C``=y0era_#pY|72`;lGU zXEO=!kv}qFWTKof?`vW1@C*Bw4AM*6eLG!b_(%W zSMRp?iuA+96+)kmw&xkfM)PYP$9jN-XZwWTvX=7a?7M$7|JvS7QlwF{Ch~J$V_iX{ z;~^otTO_M?DnaaZX`nS~PjmF&4vGc)v(3Mx6>zUO^Q0+qCp1oFOrzP$1K~okd8RaP z?ndT}*YlC=2XT9JuOwr{SeEBkT`<5FRF-t%WTsZwJboD4Q&%CnppVP#(L)UW=B6-b zZ8zyt#B32mJcsgqOAF?eqgj{cS1f7McIRW=to~!a<-3}}(mStTnxA<)QO3Gitxwa5 zW?xwPm80kKn(VJ9W8JJi=UJ@0x?mK$k&|ovy3Q<(Mf-+I>#$Xk;zzYv3?K4DYL5Gs^-Q!To~$g++ZZp3 zYh?+2mnN&`+WZc3q}U(lUAP!4!zvV=#+PHY(`t%QJ7r6hPXmT|m%;^|1_itjB3ELf z|rOJgGP@>EE9SMT|E=nxG z(zzSaYrwQkMwK4P4N8q#i^#qU;%4qzCl~x1-A?7J@KpvWf;0w0kP1m|&WPe8@{dF} zotq0XuN}ReOeQZcZ+CCZmi!btpFo9=Tc9z}KhVqH=;P|?;prCOiPgB64ACr48Kl%0 zRBElt*_R^yI&_03M|W=?>_-#rW;A&jaS5Z33q4^^^sq4Te-+^813k3ZwBFX1phi<4 z>NRMZLt7+{N8hv^9^OXKo#o$;S5cmUX)(@qqp4o9(TIzm2o{ z0SV395f?43+BM)vCKES=3#T>D0hI<>+hGEX&pjdBr z?<_Aesc>&+xc9djC+^-q!o9b@Oc8S6-ZwT(`jdM{;P*-MpbE`T3)yh* zo^bEWKRI#t-VXO}1^2%5%sa0~#qYU$Z!gN0k5+VNovR3}*Pct1gP}?G9U-@Yd#~?% zG1sq^6L;@6aPJ4tN5`kZy%&`q#oaqZuNF(gz5U_d*#qLZd#A#^$HBdy>zW|$6-4tO zg)`jyIox}Q>s0BnIh4Ei7P$AJ&=m2$TU~3*;1=Aym&3i|;oduZovkC^Hs5~JrM4_9qzp?r!sf%`#!_+3{Z4%AW@J4ugBQtUOh~ zJV-wh?!6rDT@&uToVf~!;pqp$z0=^{OX1$bBg+ej;r)|))88Dq_f)vIZd(OwS-AI( zrNg*;SK5Yr#SSB_4dLGR!$$t?-haFIf7QL|w6ZaCXE2qXU zy^*)4eb-hAw6*qVXMQnxe;hrg?Kxc&^Yo~VtQhV+GnUdW(iypT#s7=$O-~-qCl?>G z)e}?v9JrhIyDpy3!r|WUoNUMGoTV2i{{zm0b7;T&$+_IUYaMSQbZ?Tu6t{Zs(P)!} zL&v7Efur;DE?+((gk&ydS+}?4HJs5;7~dj;c@FlHT3c^b_3sT)nNNI!R)&fR-7+`Bj2+v(nYX<76%?%p-MX31HvhB4zxrF3TB z2N`RPmHh_vW9j>j<_iiYG+mMLw|nz(xXr!kHA%1SjFQ)Ok?r*_!o5dsDw}Y=Y-Q9v zQJQJntdG*tsb!6LdQ96PDKE_fMo(uq;oikRE#!Y2zZ_g|tqS)Z3HPQ?dKLc_<7r*g zzq-zU-@R%1Pkg$~5e8%5VJhC227nTIJx8E@a&Px#M};tqv+>W0@u;8I_sLYddmrcL zjDUNO`5{+GtiF!PaPOC$R|>;-FXPs|qepk)bq?Yjs27ntrVBsb8}9wdw;w-F?%n9l zU}5~G1>C*qz9)a1$E~}^ilf3A)gr!MQ0Jhqq1H6+-tz84e4pH#&hcKmh{eR#lRMrx zBJ`41vMOh0Nb)aJ1fO1+Y|k23`Tow0!UgB0+`YFY_Y$(2%;WCu>Ux|%pYw2Xy6;oJ zrFH{9E`+sR%(mVMk*810625a4#Z|^Ra>q6PEU4K;v<)^7pAHWn1rM*ia|a_2uXcYR z_wZ%#@UG=MvmD|O!%iHD z5Wo8nOl^^N?8`cG)?JM6T1T;KVW%XtMe4zEZfxXlYve#pEv6ac#67&~Aa^!R8Y-{7 zmdM5(bwpdFQ9p)D7sI7r8?MUTlQx;*;ri$Ao=aA^^nAGVP79OZ;relQmzLnt+WW06 z@o?z^xO7vv^i#O>Ct;)r4_DqlQ%9_FFGP-pOFwNoRfLDDmcyk>!=!2=6^Gck`I_77(84p!?dqXx0&|Y#Gko`SAl6yv77e0=7(jBrL|61I_xeeWi##A zbH`7{sn6v-1k8RUH(@UBG|lX7B=mrLFkY3{-u%IfE+7CZ91+*#UyyLtyYqw)4vjN z7Y~;b5qEI&G$=il4qhr$%TRl%Ro*&-r?;n@tG6r9OyE-Pu6A@p&Vv#)^fZBbc61ol#Xr7nIJ1CA6FrG|F6{C3!MPb12F?xIR*Y{ zP3V74&8g0k6JG^Nc@#D^r!}GfP;;udL~2f`U|ShlqUJ6*Zes>-+>>B|c!3xh9SRyI z67)T2pn2oY1^u`%v{gUz$D9}O^0c{ovKAjppzXcledZJ1>*MG#ZR`2$G?#H)!8BdQ zO38P(^UkkIY-{V>^!e7I1CJ0XADpT@ZM{duJ_SUNPO%&G1|Xty6(1|0oU%8$RF zZ}@d5Ki(OR-tOBG{F*c1=o)o_aDL2owi%9oK2qYx|9DOf*tufHF5$xaZH)Fk#$*W# ze#>SaZR*Pn`=JagdaK{uN7eR|HV0|p9L8fLPAaP(#0P7$7;*u+!~g5>^eqOkYP zT4sWy?<-m%Ok1*z-}l^$-TZ5_;OM^&{z?eDv7J4IqgRa`E3|~8_lBcigQM?GcHoZw z`OMk859wFUWntYLrqvco96cG1o&-nVp1SOJN54_k=IGC7G!jZ2{R|vE8;+j(TYC#R z`o2FndS0a;sm7mX7Os67j=mg@9_REU#gDk7551O@7Y0Xv{&Y8w9~FmBkX_;EW#Q=V z;Z=Tj^g=lLH8}c#x#r&;y(S#J2OK@!eU(g(UJ;Jo!tUrUMGu8A^eIVj^iaE_tD8Kb zd~e+=IQl*~`Y<^9jktQ;(VbH)EWo>V{_dU;m^gOljy|t%Q#P-xiCyUFCl_{G#vOea z9R0)r-~2W|Wl9y-WpPKp07o~#(TBj%0|WYTM_&d8f}>A@qfgN`3yxmD%x1)o)T+U7 z^i(+d3OIU$5en|;Zgxk13rFvH#(_I}Jve$49KA9e{rtpc+|k>;nPEK-N529`uY9nnl_>%94jlb)3rQxQdIpmUo{%Gxqtm{>*2EosDIERi z!HfL-p>Xu>M{miW;OI5r=uaZ9%Io3i7C3s-v=6cu9DO?+-T4`9gM;`-6r*p{BW8vsq;powD^l_I5TGRT@mB~I%z|o`93-a!v&)G37 znLD}wM_;@zTu6hXe>qyu9evmS2XQCuj^0*fbM%qsbU}op{{%^a!0RVcXSIJeSuia9sP5U7P7;OkzzO; z{Yj-ni5%Srj{e-Iru73Hy=kzPJGv_z{V^Q<931^%O=s@tg>dxNaP$js^g?y6K#pE9 ztfm-L%|m?dyIOeFbeuqr{yw>WPCYpKMmTz=-O=yD(I3One}khx(5<38b?)c`;OMX6 z=(`TC6UfoaHJK|MgQJJT(Z_tTFrOTK6CB-nkVf=^qX$iz${jrej(!D>eiDwJuy)q( zj=l(v9{#$laKHI-nH+r@9K8^ZejSeP<+u`c!_|uEaP+1-FD6ukqi?vU=kmuY5$;`KU3Kqov!H) zTp0&Pr{i=^1RS0A={j_;iF@+pfjocwxL~MxNT&SpXK?hZ875W_j=lqq-nsBsxh@?2 zFdY5+ybpZ8CmcOgx+hnIqwj{J)4fWrnKIFj4Tqz*g`@X8s$(1B=mt1?lP`|Qls`_6 zUcB~`oCimDfTPp*LiywK;pp_-$k9!3^fsSv$_a4vQE>FzaP-B|M=bep^c4k;6c1Ds z*&V$<^2c3bnsG+I?f4srCBH`xb81CqYhna zMgDlL?K8NeuU?iWG=!rsf};l={XwAh#35$_#L2&=2#>z3!%A&5{mIek_eqZK4@chy zM?U~ZZ@i-=^(F4#!O_2gqif!H=S95=;EsOyX13f0`QzD@1$MQD7kBihej{W7j(%s* z#oV0(woolYr+7H}$0noW=flxW^BlROo8agXaP(<#^efdfg&MfWHaPkuIQm!4O=M;N zjRHA(H8}bcIQm-CRB6w*nL<4rYXe7Dgr$gj@ z6T8=dqbI`Ai{R+RW4{xyp4k00^2f`-(F@_|mmC)els|p|j-CcbPlcn$Y??#!AonW1 z!}6=b(eJ>~W4eCF9laVHJr$0A8;<_%rP18cufWl-!O_2hqj%gkSwQSh@8F)4KNpVf z2S=}1dlq-}?QryO?fK)WI|gz`-vUP;2}fT6M_=^yH-B<;dM%Tq4}haDL;iRy99@^B z<&ORV`Qt0vj#0gkSAJ}#7;Lv~(r4(-3r{6TJm{P7xa^jGW8%8KINdmQ2D=?iDcoxjP? zyADTxdF!;SDB6}64M!id`>ebl`QsmI4-?|X6w009=q=#rbHaAW?r?OU|KRBK-s_m1 zI?t+Wb9A`5=zIJGcl6VB{^97FlPTQMYuoe3o80M_pM112cl6}@w)}B&^r}BJ;*PF` zqlek^$JM`z+|e67{)eMmTA22r|5Bvg&Xnrrz}Q>+F#1pQ%Y#< zz|lLx(TkBkex=PWxiXH8_njq2!_jAb4@WPa!5#es9DVrxqxp3{$-&s>GQ7|Pyf5~$E~&fSvuaQp$c4?_DdXn_+q@zFFwf8{Q{@U^!|KQCzsA4 zM;{AEA6Wgfyc3T82991k@sfNRcD^5uo{&(;_m6^U=r}pL!LJ`bPLAFdjvnTUF*@Gw zf$qDiw4U+l(PjGbYpc!&`yvGAMI_;mcJGw*X2QuZ47j&P-uYV3MPS?5o zYk_$H^Ivb;N^pSOK~sXUVczq0&;w#;N^Yq|JlpwXF^_n0r}&P;pN-md*BxQpa_XtTFP(Etj+cdAat7vvT5KGc(WCiE$@YJb&Ce4XkIWX$Y z$RCdjnMz)+J^-h`0jGCE{`mF$X;yf-{tcYo0;gXAr!OpAm;f)=kGDJhNjUwGs=u1y z<%WfDdezfn;WC{5Tg*_S!q*RY{`eQC_ei7L4VDkV=~oGlxtEWH)3=1vCw_h@Z~1(R#>}eQ4i&`P z(S7BeaQc^ruSys*E6&2&U)!xcX0BhfCxAu)E zkIP@;*uS*#zw^gSlI;Hfm_JU<3^kKS(5(8SNv39-n&edEkMBr*5#KlN@NR!smjv22 zo3Jq9D*D-YBY%7Z z^2h(^-jqMS8}8lR?%tF?KE$3sZd~BU-Fqes;w0RA9o&0KT|e&L2a!J>d^ai2;ocyj z?zM_M-jjm-@m~#2EFA7_==he`TcZ0?{&*4G`_v!YI|1(92kt%5?%q*w?^8<{&@W4BEgNjcTc$Y+>^ffX$Lc<9-&^`y-&ftz2V;D;oj?SE+RWnErxp^ zfP43Xdv}XkAs}zU@fF-#5BFAec$x2zd0wFW@jSS<%IBCQ--)-RW}c=x=c)v_w*>bd zkNolMI?X8FqcXz1@4>yb$RAHN;5};bwOiocv*6z6qbEtZ;!KM7IKF~=AA@^;SFx5< z(0K;MdmMj)dpCxAZx~k1`fcuLiub5)!oA&2U9nbxdk-0zW<|V*=Z~x4-pAnH)80<9 zQvP@}+&kRO=H6>QmXgT5Yr(xg!@VcLz58CTC6Rll!oABq+AoZOds~)_v{L@K0qz}! z{PFj2?@nt+SSf$}DBOE|n6EG^$5*`ivNpwglqR@$A>8{W+&li(4DQ~OT0Ig5!M)p= z&kBR*jkb_`_kw$WsusaMBY*tB)~@p3?)|rW+uVDoy(OmBeZ9TqCik|$y}yKe=jXEB zog3%yZJj2)6KcS_=`n59J!&MR*444je{k>PaBnYow*dF1Eww;@jeGyQ>$mUfwSg+w z%Y{q*#Gk|c8P#uJ6XPekFDjDLQNNw`9X?)?>$JI>Py6j)$SH7URmVheK(xj7cD#o>zZcbS&(Vd8?Hx_L ze*5+rmBe+2F7j)Re-R=MI(ADQjr#2l_sfY_Bd^LWP`^FBcTI8D_z!Xf>bGw{6D?Yw z`>>s;-(Go98PWggZkg)0(|xmEpOk+H8ZE^tz7Wg9^XVMLN89(6h5GGjLn?@y24$O% z#L0Q6Y0j?i^%Lx}yCXGbiN^HINj z>DgfF+Z2u;I>#L|wvjiZetWG{z37el?ekH;{Wj{i*BYB=U9o=`^=(c=vc~Uj3oGx1 z`t8ZpYtou7hj;e+?R`+c{qE@cw5H2of{SOOe)}!dZ;!rrnAdMF^oTG&MSl6KTd(sj zgni=m+Z|EAeGTfj&lxsS8hG<)J}kpgjr#2q?u*t4)Nju^-41KIG>VI;-~M%uuQUYp z+lv-;qMQmvchqmsLjCsDsNX&T`6tM!aBkCSq?~AB!dldCuN@apITf})2LAta5x*No z_1jZjHe0u&e)}oZZ}&WOQih8=YkgM=U!i{c^C76;t{X4I#hv$|e*5KEvp5g++cn*m z;(eJkiVv-m*>2Qt{|@!r%MUnAb-ff$sNa49_1l}He*5DsGS&4`WTSrj0@QCm`+kD; zeCi4r^D@O_)Nk*B`t3hv&9F8Yw@s#X%xzG={lviuJIA7ayVseHyng%HT%+|X)Nk*H z`t2LG;kAc2VMEk!UySbI}%^(@*S_1o2NBg8H(&&cg?%zghNX&~yi zzeoM{Z-+eQ_1hye_vcqf{q{OJX0c1xM>5rKKZyG6t5Lt*7xmkJb+Jg@@w0b8{r1wR z-`=c3fyKMh47nH1v(-EKyMFus1NGaf38to#n%doHnyGoE=1hV5?XmHj5}Kxg-_N$; z+op3KCyZY@H=Z8THt}+J!tOh_WVd17^7NV&(43{SSC`sbd!T-MFVt?QPyScLP!rynp-|sby;@`^}_{(ckweh2<;hQG57rGNMLwea^7@b|8x1NnR`7XJPkdF-+9_exL7Q=jFW zi2Ciz;O{R{zuj=KDe?f-x(;@KzXpHTw3$tPmQxq_`!V?YVEB8linqAG_lCb$g1>(O ze=n8u;CFwo2Y+9WuxsT>ueiUbz~3|B?+4-U*AqJY$=?U!_gUiaTjB3J;O}?#zO$0Q zmw(@atu>ffm0!H`l)LTzjy(41$YY;{JobSu0W=@ej6fcHOZfY?J{NP#_}Tou0sQ^p z<R+i`#QgTIHv-%rBd6)mQ7e_sfHp8$V941b^Fe2)9O1^)g3{(b}gekpPb z_xIWG_p8WbAL~)qI-ucZ?(b9J@AcvD)BT;TH@j}5`Ivhn_-(%tLMeuhqG6?m&H2Nm+_YUy)BKZ50 zG0s$rQlA5VzXN~o4u8LZ_ozoKQD0x5l)nM~{&{FQ7PZ`&)*T;qR5;@1=%!;QsD`Jod5eFeik+ zZ+g(-Z-4*W-~YS*PJi~)O*o;cr>@~6{Qb=LQxa0(?>#2P@~tsrUqY!_&Ex4YZOPwj z!{6^9kG;}(k@urR;qOi1?@eLv^!bPV!9aDd6y)^v&D*QdQepTKOP#$|6^4Lef-szL>@mGwe|2O=d^4Q0ouOXKB z`+%GzvBclkAHx`z{JjeKdn0}h`FokX+Tt+y`yTjv(V`f!7Mz`O*UzVw664_Sw14qH zFh5TIzF~7HKTiJsO{vmih~3}mzM1fMN~>J5BT3u}f2aL}QyYjHn0pBP{XngTe4p~z z=^TyS-w*hH!LLtw>2#eV@OK09+YPOf!~*y`)o(u+A0n24zf=A8{{0(?A;0^3BXJ7+ zeX-r&Tdj+r@v$oK%QQ9>{yr1_{`qA%_xH;7eD(G4_Z`))|0!R+#NY40-*3a;*TLU2 zA6O*v_p>7-Bv_fcuXylzpsM7moW^GecwudbeP z*XHj9@b|7y19-mr*uJ0guEXE&!Qa1qUc~)5)_xDAp-`*4c{t*7&@$CR=bJU&S?>*q}`{3`Mm%bLr z-|;3UQfK&kGW^{%@e=pC=VKmWnsUu@iB{iDAhg}=XF)XqZwJ`esL3V%Nbe?PxCgx7Bm zhQG(b-@77D-f?|3Uca64$g9JzrTXNZ-l>(|MrNCF|*!rv#_bKR%KHDcuNl?b7hur=yfwsD-)y(~SSBmzufxq8?zc+!s)8}8( zU;S_R`&{^Yr5b)BnRq4mdrD0|vBcBI!YfMro%T!oz4FphA~|~|{Jq#%E`Yy3=v7Z7f6s!0pZQpaAOGVy(rM&Yp z>QIsV{WPzo2>tukxw}ZbofWMcj zbN6?DuUWmRbvXR}i(Y>8KI6aFZ!dtqug@)GC8HpJZ~Pzpo$}5z;O{-*@3U9>a(_Px ze=ok3ly?Pr=P!-5`FObl{QWohdl>vZtwYN1dFLhm9#bxujDiow1o(ST`1@&n07JY- z)foO>5&pgn{ysyqh>Sux7ye$$?(cQ%{@xUM=ZE3%bK&nDo^|H_zMzSPJrAgz|E606 zD`Rny$lrhN-;`A5!{M{G+J{bP~aM4um z@053b68;_re?M{S-0%KwfWMpI?=y0)aDUH-zdOR;v*7Pz8lB|+9tD5j3x8h*e{V9X z9L0N7I{5oT_`4DQ9{y-P_xDZk_j&O5oACDs^S__43x>=b@2DL_WJEjZjY16-`~LB zE%5hL_$^Ug>1)bjf6MW>Go_pFUr4D!xzIUX0rrj=$F zkate|wW@}&5agZH{;Xq-?0M(Mg?V@%YpUP=Y3og4V#^@*4)xo2{&+&r-VS7efTL#m zYr=+WZcGuIB7Zm9N8CHq$m_S$exrn%tXH)Z`9;4kymNJ?O0<+t;?MK>fja_Slk(2@SM(Cw9}eKpx$ogS{A(%i z{L;&Z{2aUC_tLsNWulyz{}|caz@E z^%5!Xd?E7AV~}@Vy2TYsZq!GK^3Gq_>$e|3-uX3EU0%PvF7nR3k$2t;dFL-5*5`TW zhwORhPCIg~&Ql6_-nkomU5~u;EaaWn%UH|v&L20m)o-8K^kd$(j&FJ1c?{~et6z*1 zBawGL!EGhaJO8Dh3sZX4wEE>V7d^|Q@VxUUsm^SACtv9y^3LnsX-s{W;w19U+avEh z{7R0s%RxsGR-w6tyz^yMJ;c^Ns|7`ctvv7iRw>1fs>nOvi@fs@(oEzEYBZF0-V1r> zy;I&>eLubDdFS0wzkMe1&Rh7tv<@8nndhCKMc(-yZX6 zzX|frMR&>s+avU@bRu&yITS__ooS2ML+y8^qIN+J+ono#3%5oKfC+@1VzsDW@~4-~JhS z=K;t$r_aBtKlpdMchvDlJnx*=NQv!}cro75QANVDi~zpB@03Y=ALh#UFR%9&SNpl~ z-0qrB{KW2K6Im0ucl2XFv2)W#>>Ny+_TSe@X1CzpmEZXAYrbmIMHO1j!m0WYeu10J$+}rr3NXYzXWh>y`yKn2n7l(aVCfqw*=P6d3T#apq zd*}El`S(KZ{i@vqfu6q!?)_lEU13nQa2AKW^8t&TMfd(X@hRLp6YgytlT2|v?%q_t zL<9FeInw6dRKI-(+DPdkcX!Hwb}yM|c-PoiDqQEjO&-&W=TL z!2<~%++BjZ2X}V~1c$+$kaSfAx8Uv>+$A{7z!Eu$ zfaXohUpB7#SL@yYmLvu0Toqgx!1#7Xa4K!*pKq2QREd*PD!BIJn4RY{sfM|vz%jHP zt~PN0_DPv%gm8U`OuF}zr$njkq8{_VzMw}sBO5IHaW+j|*) z70$d3l3PLdo`o1OK{ zl5^(?k5a^gKJkwDMp~Cp=ms?tt!{Qe&$lU%!o9_ih5+`^m={LSE?J3+9#Q zy7ygsKWPX2+nY75E+iiAAcaEXF+=yx1>O5YR!!kflcHSrCja(+(7hivdN0oG>Bjxr zyMa3ogn#=a=-xHPC2-w46S{XP=-!WxUJ%zOX}N#bul<6mMvpPAjHJi3PKh}cHBR~{orLaPrSNaOKYa_jcUkD(ZJ~M7 z@>lhz|JAy8?}4@C7zijeS6LZt6L)SO?awxzjOV|x{)+-wzcFvP?oIt&I)-%bw-epj zhs@Hl4BdNkdo`+Z7936=*-{-uJU_@%>@Yy{BBeE5xMRxPLoc z_eV>Uyd8p0r!oFa-yL)Q*q+_@?%7W7WfFAn)zG~?*9OWJ zkXKK-cP{AOd!T#E(7lDAhFte1pY~{Q=c}Q6PZ_rE-|61;nV9iASHq|M3Uu!w(7lf} z8!wUWJrdmcDVI;X(0xAV&euZseg^J50J?W~cE?G&_jKsqZqU6$z?}zFRC4Y-2;6yf zmv{T5_0KtXei7XHZI|x7Ds>*$z57A;{vEpaTIk*vvr03>9MvJ{-e;kECqVbUU40+d zy-!2;_5^oc8M=4ME>Bhv$1R2Ky}j}>$ny7x7BqbDt2 z&2{fv(7mrg_l|(>eL!X9x_2(rEhp}LC%E%^y_efb_x|Y*e;B%V@~KK(_g(_s`v?5t zuR!-+0KKU;=IeilKYUGi_t%8(t&ff3y7zME-eE4?yXe?FT=$-OB}2Tju&k5~e|W{- zFs^$)-n?I|)1j~Q3v};IHHvZFyQhmgPXc#7WPDMsd;bF6dn0u3Z0O#fL*9w#Gb@fl z_kIuEyBEG&1uq73-Mbic@98ex`}R`*KXmU*m+l?4G~jRD`~S|mY zVVlBOGIa0EF0-S$6!6-Af6*Gg9(|!u^n%u^NP0}`M(Ykmb?cQ^-VWWnY0;d%E9u_H zp?lYc=1t502;DohONdMwa&|zb@XLlcu6vgc&J<2!UWnS<1!ppa1v<3tuI=$_gSp@O zm($mT4aI74-Fw#!3;TI|^maE!`$=u_-hPjtlXUNWWxbfKT@9{3uQ=(!=vse1hIH@U zpWT>evud0>m-?95%$D(TAaw7k%T5dQIy0bqzi)VsZ_{h`?0-iH{4Kvsy0_-*OQD)d z;JWvf0?&n~4NA*q=-zWytB`Y6m0x%HW*ejPkna5;<)*MPe@(7?E5<`_WLHF(g-P?OU7zVUSC82u{c5&w+8ONOeR`o35a zn;Xm!jzaeqd@FO^`$N24_VB6feAGEyE-`%-=gyZW){|csa+A%_z0Lj0aNWB)zSWy~%IgS)`Kqy3-Y|drL0eI~%%p`7<)ty|bWuFNf}347&Ha zS(2S}@0rlO-$VC44eq?$)5~_!y(Q@0wN1IiDCpjq$6t!1d*6oc{d8h^X&`j(>t}xx zN%w97-8&e%_bBMzyPr7iqEj%Z{GPV=g#vseJ(79?wwWPqA+CbDbAg5gzl|`?)?ee`MH!$e{<)5*DXhR z5xV`1#1!4fxgs}3;;PWS8oICfb z`J9i+e)_FP|Bv%qudC2-zx69;;+b;WDT(TqU+o&tI&|nSZHMkn+x^2jOUF^SoVIJ9 z%#>Vp%UPobrzO(8A2}Mcki)XFNMP36;oNUscYg%y7a7d` z)@l3n`aMz?=-&6F*6d_PJAVA00txKJN+X>y<2fBCQy7uCs?<2V1`Y7n$6`*@Rf!}(EH#H^F zy^|7i{MH{q_pVjd!FBJ&(7k=2dzXUl-Q#Ia-SXQm-TNv0*2BAQ<+`_X4U^Q+y$?e7 zt{47->)u~ll#V_PuKZTp-_xTWsU7*DY1D$>x&^xTL+IWEV_w_IZ(Rw$^;X^$9Tw=` zjr(`yy7zC;y$3`0z6;&^R`p(7_r3t#y9RV`6LfFWat-%epAX&p1a$9U_^m(7*e${{ zMe}5DzC9J7d#6M9KL5@vlkR;Vy0>}31V;tv-lwjYa**FT>E2_Ydxt~!uKFO+L4NCd zT)MY6bnp9vUV$rDYnsDv{W)~+g3!Gij;ttG!DoL8y7vwEt!Kh-z4yi%a&_#xQz2X? zzx4^wy@!QP;kx%+_^ls<-?|LH^@6bpT=yOT-TTO_t5Fr8d)rtd*S%}RDIMLQd+VTk zul?*JH^6mkp>BBubnj)*z2lu;GTJW9;OMpZW*29@pnHcX17y;@JHc-~8h-0$_^mru zdjG9^|NlVurdURP>sJutC?-<;qByk#y7#7M*63p$E~OsZ5Ew=4I(dAewO`UB=`pSK zABRPzK7%#~-8*;yalfPFS z1h|BP=1Gz7iq8)>XaKbRJF>TNB=h^Ks$#Yq9!+ zLnLqTaRnWicloC}uk?a6Mtz$conR+)0`?W!Hs+1WVc*X>udOoTxlZ5@K8|#Pjc0l| z^#^0PPEg#%$B{p61YR@peHEeL<5IxKQJvRnia5^4m3Z_Io#60};0W?0X$zg;2&oa^ zD%U_FoxlS+!3gLC1)&qPo3UTYhkd_7CvbyKFsjLWaq-J%BIfLrS>WSFfR9@Xogi04 z8HPDKr39Uz4RnGm)Oig&_DRH?osx6{;^R(3Cn#0;fe23$+YBy=1tlX$cEqqM; zR-Q#Hn!hiJ|$%#XNk58iKnGk$ZJ~AVkAGO0+9EO z<3sp68mbscTW642MB=VZB{??0qg`dZE zUAg`&}-BCQRsTKS@nj)_$9eGW2 z1}&m_E<+dOH62G@Q)KuMvF@o=+|T1N@|udk&!aT*n%o}g8RoeZBa@SaO2}(Eg}kQu zMHCDkREnXZ|4DgGMUdCD1$j*ikk_=gROfW^^LT}N z8sFgOap6%iM*y~$ZJ}J zyr%J$r}Dg}g~)5Vg1n~A$ZHzAwIR=Inv1+9hPuBO74n+aBCkn zHC^6P#8CiwO_jcM=Xp&5$ZPUPUQ<)#HRb8u{qMY{zw?^@t9ea@@%7q{CSwDB_5o-n zz9X-Rnud$WYid{RO4KX2{i(mFx$`ya_$=zS|Aa_-OlwoZu*gCeHc0o8*VJ}TU*1h2 zKaX(aHPt~*6D|B(Ozj%glmE}!wSQY5-YXRRIfSYmhW?DUDZgO#cJq4@ zTXSWGsEAp!kJ=qNhVl!Vyc)=SPs0Nc`2}7lyRt2ZI&zj?zpFk=Uf+;!8^6@!`@12( z;KtnqzCRrK1zYMjVwx5OxUW53x5FJ9XX!JajARphOY-fn>BCt<(Rm_q^I2 z(=m$*my=?VM^J0>NVeq57>Vk`f0^Bq?T8pAQGIx~4?Wq2+I6Ljg%{IwJsPmy<4v5a zU$ruczaGj*pzC%!TbFy>)B7@*RT3PqfrrS6*IzJe;j<(1h2AU*)O~?}z&E2d1fM45RLj`tavaAKt2|BoB}M z%6a=R)Q6vr`tX}jAAWb3hLPWWZ|MIQp#R4~{}(%N70MvilJ7j#hhGH!KkHV2P#*hw zx_swHL;u&d>u-<5=QkSqe_wF#hoS$gy81Ia+Ij`J_dWMRr8?06k7&af@(xrZq5pfk zeCG$Hj+WtfuaCc%A;zsKD+$p5hm;x1>%+fK+b=5H^_5mZ|KF(}%j?7Mfc`%L-1{(a z@43A6ygvLM=>MCc|38BM->77mjJyLyq4>4ZLDYwjKz;bjU6+&Jy_#|$1mr**Kn_Ge zU0F=PzCh$aY(@@5H|tR8@`cGx@b>Dn$Q}6ZV&>mwjN*9*g^@cj$>mvJ?sAe0k1D+m z%=|G|?m%v|M`+XZGhOxJQ&AtjwYX|a&|8gF3&=J_}k-r+28fy|E>@J@9M)-U?M`_fB?;dI~o8Af}>F%eu}eE zw8y7})OBy_N74G-`1a8|%xxp-F|8L^21n*9)mze`K77S#IjvDB>cdY%efTzGKHF*G ztx?W6i#YrLtUaQF^%0{Kiu_pj#_~$nLZaH|t^38Z3FA&m`M}MO?jO&NQ4XMD)Xp8J z81uWf$NbiW`_{KRU7wAcc3N5lZa$!5zdw#&={tb$Z;AYY-cnUe;}~+0M_KO4By?%sQlOZuo|yUNebi-lqgq=(d$e_{y>}A zwfQ!^=3XlrvP+GIO5Kq^(4~D#cA&yGNda!Y-k0V~e{-RvMgG87V^@~9oy4!J@fygV zOTP6@$|tbN!;eYNz|D6m)RgJVJWHqif#9`)&a5Jfqluf(gZzQs$R8+#an!p!@qcjh zdBM%cA%CD*_3?jj^H*K@163x+|G~{uz4p+cDPq`{7JqQ_rty>c|E>;4G9`?wG~`>q zdc?u#fwj-1FE4+RcoEHM{p98=A%CC)i8_Dwrwu7732Um7p2RHxA^brDa^SWO39CTn@rJ9ZWfm6sIXoviPu#TH~{=mDSBvuXi z14EEMP_s)P;iqqXL*x&bQLo)MsW#{4i@Wj%R)U)kIorV=gY#*-=j0C*LjHi;k%Byb zU>))Y<{^K8>b2J~mE-vXuaQ4+9{B^sz|BWbDa7*!h?`FUH(v+&1EuS1c3@nkqWpoa z@U1V1{DC_u2AT2)W+Q*V;PS1%=BAS=e_$i>2Yf8KLQ0>|92wa}+&nE#8l|3wl;c=& zz}lM9^o~=6;%ncCf#n~HP4-R{9vpuowpC_{rdOkd_RFq{*Q#cT$=wo!SHIMdZdbHP z*6Xu{gN5UyVs-OM4Ws4=tKYiw*IcH=Orhl2)1qeUb1|)M1HoGvD>aC$BKh^0E!-$o znN1p(i%riHBb1tT7oV0+>G3H^o>y%mZv$?&uOaCWCpS%Tk0`LdfPFnU4trK@0Y1C7 zA091*qi?nfdkc4C^(reck>?o|zYAy~-k^JiPWvYss9k-T8Il}RNZMEh( zc6Cj4)~cMu%2b~wl|jC@i@l_;@ zVKkjjB*~U?L5@w$2HVeIo)%*mP1>Fz_Oz!-^3G~o>_PMDN*KeaSGGA6L1V)_m&~a} zQ4^V=|DL@*g59tdVYBWwls<-6p|(ObU{MsSRW+1#y**uen^1?^3RMfwSq`^0{l%pi z`<|FTQ>vlRD2m0+b*PgIh%-Wy*udS>q1VIX{%{@pu@t*lW=|4ZG-jTJ@ruI3YBrcO z+<{%G(CYLCoz|c=nhZvhQDfE_EIPBrY_(X`7PZ1nZ_(>)TD?v0W^+^66e@R((Osp~ zc&M!&8nvg&-RNo5+B|J4rAq0cvRK^RJ(ON5FAsk&UtfQf4^HIm?W6Zp=smp@K5C8H zO{3NNx%sKB8iT=T#6>JNHyd2wbqa${@9FF7XEZ5HCbPoZ=I-aOR9TcNFQtc<%4|`n z^lFV(tud%ARs~L?(<|^F&VhqXW{b_;&F1du<*V@a@%6(LztSbj5JK*T#m4vGJ!8L3 z;f{MxENXl}YK28X0-^^Ne5n;CEbdq|*rUbk(&JtWnMaGi+FW}K*l)&S;eWT_3VQsr z;Rpl%neaCQm!ph0lMz=k^J|!K9ShEC#ql=$^Tg{?DE=H+D1cBfp&xJP&A6!S*Ha?u z9-F>z;E=NwXx%_FG@?{hMFc&jwXcVNME-MnY24_-(!llo1qHrLPYQWBx}_F(%t~Hw zr-ff6=k7n!sVFXP4FBK9#ZsdbiclQe4ohmAc=6iacxmvjQ-zDi;-z$GAXH4Nk|9p2 zXp5Ixx0x-RyAv%A$R972s&iV%-MF08;ii{#t?p^zZd4pJTnpdsWQvpgEN+r_tGU7x z|5&M1<9A~6;Uz+|C3&Ug{k2kT|5?Im-*{9Vr-#N*xoNq{~dkdHDxl> z!^_1<`0}`qo7-1Pxa!9)f2$(z8a$Tz+Um9CJ>-J$mTqnhm5qW2aUPrzOMPv#&yytiQO$$)s}CF46ARR$SZVsM@@5^3 z)n%c>2;p&9SE{LMJh;!s*1f+iR2xuMo?CC3fLN)tH83)LRxOrj87tlFI9Q-qX+Jer zT<|R_{Z>Mf9MyKRfLN)Ho3~DE6Su+s%|A*0v}+1!80r(nDmxxlc3^Z0yeNCQy=mG~De=Pz5gLYhRQ^hmWEd&TFVjzEt*205TRrpDOL0|vLB~1kNO}A6 zNyKKWeL9^NHlOUm^0ZENJYAlb@|{%jsw2Y2!rfV$p|MeOhDT7Yu5!{{QCKhbV1;)d zN+0(zlKR@pj$)#;Gxre8v7y%J=2;H(wM`W&&Xit1>BC-c3KwQZ?T<#Tu4&E3UxXcp zy0a2mK}Z?#)sgZe+RB(-EmFTDr=U}T@U)0Y@e=yl?v1N9vxgx+VVR?3+Odmq#o(fYi#Z|gS$cR zp+wX%d6?85YNaQlw%Y7zwrP|BN|PbbfU^YzDz%DWg-)vr2-aBfCtSyBQ-tV)^tpn9 zLvks6d~^HwhUC^EmaEh%H?_v z=o`ReC#^kr^d?&nd@}fF08<0`~k6&|a2Z2cM6DGsY$k=+wNU!)=;>QZ#id1S;M zcOJnhp6l>@9gpM`yY=`BnirhUfPDr$&%k53JCE)b+?#N93$9?pV#XOMwp;MXiiKJj zx>0bX;6j0tf>%idI0}N6J1OQV);;;~(^{eb;(z6|^3b*=frFG6=JysiIwKElsNlFmTSr!$bo{VXi!@jvG` z{M5?-quhp3>_3~&p?-CVQ3^#atXpAu^)gLV7;^8w_ZnW=ZK^^;P?SzMk8MT9uGE}< zw$SRp4KY6Yx_BYHjxf^urkH_(jcu$cLSQR5v8Fy&8my`()I48DR8)zT7UZ8I6s_=4 zY;x$4=sA6|Fv?><6xGMw==+PXVqa7`6@I+cWc44{+J7K}@6YISI;#GV1Hy{iMV+K6 zR9!3yYi@OM((&Hr6rpm$Lb2JdVp8(uX+o<@_eAmqZnkWhAk2Fvl72De?n0s4zDHu) zs$a#^UvpkV-HI3a_U|+Fa_-kdr2Aj%u)Ld=OVA6HZ+os!Gko41@fI?}bE(z73sfK16gJi%m20Ase3uQA zFGZ9fe_rznVI=EpdM*xXwAX$jDa#4Hz`Ztfot>QqMHJihJUu*@6a~G&^9}Z$%aew= zCWWGHk*XD-7wA`4-YSXN#?7pM>+?ZFt|(0NsARS4R8tzNBFs|-e!L8UY(5l)R}qXAufvq@=IB3A3HIL?w$^W3!=W z>t^+^8a>?g9(tXdr{3L@LL%A)y;7}Ise;u$UOrwyLBUF++GaGF+}vy`y+*I`Fc=M< z9-cbAE+ja_hPHsZ;o1Oq5BC87K>vWi5VR%e(W9?!_ViQuS>4Ru3U7Dx>3st*)b|ez zQmWKSWK63xXx7v=Z;e)`K|7`M$G}5jFq`lM^zF^wXbIfuDc%Y%e}%7KU{LVS_TZ-> zl#RZPJjQzRHi7!}N+PwWd%e%%=j%&^ z3)`-V8SU?+=TAx&6gTIjXO@eV`c_?uk9O_eL8o%YGO<&NI|u((UDCv)2+0SZi8T*g z6Q4GpBJ6zlNzCngU92~FvJk2LEVf(!TrApVvM{UvYGt)R%D71n>YWnyZim+oJ%WzASoe&xZ=M2n3--}- zH*FirGN;!O78urvHig>y`qL_Lm0~3OH2bi4El;W)zjuqh`XOmW_YQJQyFt>s z)Tj$Dc`a?|yjGYnufDwLYz-P$ST4m35WYU{$TIFbrAohe(YV4Z&yzvy>&-Qe9>@Af zrd|hV4#vB|+9V#=SGQ{{mTtP4*PgBSbf@&@-B$aC%wF=>sZD5HVQI7BfpjYC7h!2? zf?O(BJ$OE8ET!%*7oW6G6?T8`A>W-mgLGsID>g{jJ${+cY+0hLFTNc7y4u@6aIDbj z$SHfic7xp?yfl@%KI zD`DrIr6z21&cB(&Ue-8EUV*k4&jQlqz~fTnkIt-f=?BD2n9|pdko@AeN}tMhk-xMn zE!3jd^0t7qZqgpfEGNo^^E06?_U+3`l8c}J=Dbt9MtWNJIPwZq%R5HOgDdBA+&LtQ zSB@7TuRzPn->b+y&544?9DmuTQg267?33GN;4|$a`z$IWU23bve7#O>(m;7}%c-iT zM&qDD#~U*w2BXfX#gv9wqc*G2bm(k4ErOoOX2N`q!QI1P_4M+FuT0x$E5xKHf?nrPfDl^f4Mdyu5KjHO_0$S}^XgDm5B!ZJ@W0Pe4E*I`x=`F?mz0 z#C%auV35vFr^nonpU&UUUl)uxXtVjd2P2TXS=~%t3QtcjFK>5@9n3ZlPmf>^UmsuJ z;DBIiA2hfM#t0e(E~K~MEILf*;8kM;VX!K26*LR(o(en_Esf0&Z3V^+9=^dozIY)) zKN|`KLVQk-R*N7_x10%}e+(X|;qb=dgP2JT0!;+baDlq^H2GuZO#%%Ov^a*QfoOQ3 z<6V1tM8koc#({pb4M>f(>V*!2udIGz1nb)NJHT{?M_WXclwsy|Inv z4$tI2d<8{AiXaqOaw4EYK@rgVSWNWN4i_S)YtHQJKHy>mtw+_n6q)IMJc1t6dcWJu zhzQMbQ6q?A-5tB}{894u^D&NZYwy^%T^zyJ{3F5LU))~&#p4DFWW`72j2l{Dn}$-O zPPt1xF2)PAt;p!KkG8vA!+7G{!hLC&cW;*KS23;3b(+%=UY4sV9qD0}t`C_jOdS{@ z9lfTMnk-r<^nMyAwSV+M^uMr72yGQBy|E~r-=lX6#m3$jLmRYAr~N4jH^txr*F?AM zTEeJ_Op2*IJF4$*JO8+D{#(0+fNixT!_xx%xi>%E74uK2>HJZDsc^~uNxanNrs!5^ zvhZM7j5KqNSz4DcN9eL8TYO*fwm33{Hm$>lrNZ2m(fjfC@NFC=TTaqA zNMoL^2@~3kjFKz(6lD>~<7lo)X>yK`UoB8e-{K4oeb)}eN2oS_xhyO@wN;ump)sp9 zvK8ke8u&gG%9uAw)8-_w)lCxky!@8!>xFj*8_FHq-jjB|@pRB!Q@(Zwgs#ZzEY_nt zYP+`)FxO;0o*zTi{(~Y0w;ag2N6w+SCPn7nXTt6M^(D`SE!qA7Eooj}xvfF|h{6~f z+D`Z)|QU*Dntish!Ywd?Ix6t0j-wcT5P`XrgvPxpnVUVf?&!Sbj!Amq_Ih?Wr6$lw-MSjv=a(v+(cpjmA35qtYgB6E4xIr6N)!^`mi&r zX9=C(Mhb0(IBF;Gg+d@jCmZofr`2l>=r0)I;%?TP^ahhkiO~T9tc3!#(xOCs(pims zR>`2XYTYnQz=SsD)wMQECD|~iWOcW?d8jatWbiPk5XQ7BZ0nlI|XR3&{a)t*a09di$ZR2x+ z_&}c*qCE{1XrhVM7Cfe*0<{P<&2Pj%5(RQ5jcCG%1`9MyuwtJ(ZwYcHiYSs$WTU9X zqZy(NMVQ8=*F^1pu|Hx$8Me=JSVO*k{OxT-qjU2r&|_MMRmvT4CnB#@_*Exy)~Yc) z-p4KsbKJ~()K1GUf8kXOELNxOnPI zabx9F7f=0l(PEd6csv_^cQN-7C!YGl?a}gP7f-!+&1iYMi>G$0GFT=~Q3E!y@XdbQ zN1V2so|`Lo0#E%bc#Z=hhp&e@z+T_HJy`q>f+$3+xm^>uX!1GYI<&67f(&cd<0Lu!NpUT0#E%NJoV13NW?y^ z;yifjA}*e~I+#4-sq=%UzIY_RptDaCcLz)ZBLQFSgHI#QfTy;GkCZ!C%i*anfu~*! zo_ZH}>J@Fqa-LcSPwfGox&?UZIL#o2ae#I(cq?*dPKuUoL32d}Sq z>l~iCOo!joQ_fpBPyJhm1j!vdb-&X?#KJ0zR0#3uD}2PG{VO_b;Heu1Y?X`Rm-q=h z_2pLn;yv)xd*^NCJoQEJ)K$S#2ZN_>R;L;F5&xK{A}dqci_HsIC8R!4GsJw&N#o)@ z#lce_1yB9_Pds%1cn@&pY_q1Er@jiFdM0@4F&_#FV^`Oa5%U#2z*D~l zPu&?j_4Vjj88Khc3Ose|V^^bUfT#BExm`xgSG=u}<0I|`p8DKq8|SIL;UiwbZa9Gw3|^1{?lHms9yG{FNb!5RJtWqQYdqF~C1SYc^xT-{fI~ zQmpeexVicG_5=r9*0bYkM?1%kmx-qia`DuYz*D~hPhA)+H7)!i z{O+%9AO6+8;CEb@prUMtQ=jd=f^?ZSDao$si+Zh zGJM5}zjFr8da6t{v`2uyOZ%3yP5fPubAn9uv_+Qi@095_u*b@6xfUWmVI2mX#;+fV+kYy5b4nCI|!M)-=i zD0{-b7W`elVOuayqgA|c@pob1@9HU=a{lfJ_`B0C{%(M7H0ST~fWKRA)YvU!vV`3q z4siaiI{3Ta!QX{}ziawxIgKZj-NE0f8+Ksbz~2oYagnrZ&fjfo4<74fIlHCaQl2L| z1pM7{@OR$N)jWwiQd+q~&SI6omYhU}OyYHCJeZ>>O-z@-tw*>s% z>)iVt7*A*(`VE#^gTG7edNplW^G}?=s|Wrr(tAYYSnzk{^;dOBf1Y@z1)t(#A?fS!HSqz~7w&f7j4FNzCx_W61qcq=3IW2mWp__`61f zinAK@T<~|%;P1MDzjI#(&JFw8gTE^e{%$LL#b;mAF=*GG-r(;%!QV;X?>4Xf!F|Oa zg1_qm{%$GwyAq$@b6@d9zX8rt;O`!Qze@?N%=x>9;P0Bce8pR)|8}u@Ao^KIWrvMBioN?~=jaT>*a=1paQwnk}5avw*+5+h~ZRBltVtkz4=f@BZfR z{;T{QeZ6*qzoRft&4dY|o|*;;{9P^Zcj41h_PZ7T%-2=M505?%?v5VQ`iKsRiWmF0zT!D;>tEZh{;T~%Fbd^9%jB8Bw_W}rQ@{0*zq6&o$r zgwJ>}_=o&jw7=~CANYshT4=j8Mx)C=1b!hbR5P0Uhm2~Q-w8hv9zS}2PT>9_Gh9C7 zx6bx(_K0Z8=f_I@$v@=k${hcYhATchE4h5ettYB*{}4Lvr_Xo;XIL8AGsUkDQ$!Q| zL&#@*R_}?tJ(~>wkiGB^xf{FHQPUPc^JD4+_=o&}&v+>OLyGrV0iIl=9u5DHOYje= z4F8Y`4^K*=I4&6eArbHonS8gVa7>uRea4@`KSa2%kPb9{F9y4JCiYJG$ZM8#!fKYz z!arnT_&cEp_8ozLNEP^p41#}1)9gmvXMAYS4ssXxhva|!L_A!%0rweSY?&^-fq%&E zg-Y>q<`u4`--3V0mN_S#mEbeJf5M8t{X=*^9nBAJ^qu_aAM*3NO}~Zw@DCXd|B%gl z-O`%1TFKXwZF%j@;2T1ZX?-DWRrD`M+R7LI9h@v}|Kx%vVcvz_4ROIM*0++W-Zu4z>6o8f@YcoCWC>ibC%E8SxyEv@ zaW%N$WpxHmV{CFZy1g~5EAxM2VK zt!45ZCoY(_e{#X6^H1cy;~(N$@$(bsOXqp%J5=rhUN`}~aCC3bu~7-?;eSKHmZu@_E#o;5%Lr^|syM zJKncTq67In>bYQoYk&#%0TbMLMr{Z3dDPwEJ6;z|@HQ~Pd(XAz{O_&W|L`3j_T8KK zUv(mU$K9MurOogiU%{3$#2{4%_>SL#?|3|X$Lpn(VfnC60w+8jzT-`HRFvXF$1}tr z)f)JYuZQor9=_vq3fFQV2B|xv-u3|aj;EvEcE5-o4(PV(+VCCk0pIaT@Ew0z%F6lQ zi90V!ANY<>Ss@CM zIA00)j;F$Rd<%TX8~kQulsg~p@*Q6f=5}i9AKZ7GnA?3|ZcoE^yx)==+;_aGi#x6j z?)c8y8QgdLS8&GyxZ~mAjvK~x_@{c?yTKi2`mg7{C2bDS0m_qhGF?bpA${&tneqvf9*@g)6XxuA<9UW9ohdN;%okEA}U zYy0E)(cFieIO2&X7RyV)5&MH9{&{=~IAYr0#>ElSIj4dn4g$Rv{a~TI862?&95L=-Zi21nc(9C4$v zb7U1b;=1673$>gkyMrVC29Egk_xb#~YH-B#T=F3&j(AelMe-|f#2vvAH$eUEF5gf$ z4nE|ok4;KLf7;Xt9Pv9BN31(rlXJu-_>jM|H54PZ^b<>Wn)rtgxye<3yVAemh(-92 z&-|Rj5g!8EQ23Af+lyt)4{?sTBYenOkj{XaS1C`rBzj=1ZeIAZc4?+lLE*ToUr!4X#hN1O(ZxWj2Z*PHW# zBQEUXh~IZPMS8R873yzi)Sn>?07ty6)e6oLCp5In?ebT4X0{5KYcAPJdb90a-+FRj zh?_hM9C6^2L8Lus+JhsWao*qQb38>nnRhn#A-@8S*aD8Y3pnE8pCd_oP%QvQO!c<~ zaKuY)wPctd(!B{vVwR*7aZ0Oq&WMO{+=qN0e8_9~pAxTvBi`RBiROn?Vc>{Q!H3)p z9C2cEJ={aB#%Uw?@$XknWYshkQ&}CGl`% zd72;6{p5%@^(*Zt)+7(j52>z#Bd&5jha>J5&{o9!ka8+GVlQyS9Hbl#7W?YZ-66y299{SZkd3#OevuL_7zwC?M4w{Xv;Jz1$@ZYfg?T(A962a z8Amr<_f0^MpaDnx13u&%(I4r7eP#=eC3yqwBvc1T-YTu?C)K7`nzVYe0TKuV4ue&t zv?}#hy$ZmAn-a6`8aEAckRWO+J(O-9Zb)YJ^zw9fw|RR(?(i~tdTT7+7K4|!O@llt zA0LyakEan?Qj`e=l|$)fv>APgfq=G+v?1ifT6FFTi<`SjqsZmu?H!scRIArPZ#U#I z<52Xh{Hb+Mn_LRGj45-5>In zM0crdS^#U=|Gn%1B=PE<0M=v3TX`**=9k^Vnd#^Uxup4lxN&1qCP?4pePEim1(aZ> z<8S2RmGeo@CKY3AdVi2-R(L25s#uiW>-#}|qsS7ww=BfMv);*@t7oD1PY@ft^oQIN z>~hrxCD`4QKjge%mj{k5!Qv~wlQ(U9E*^^tVv{@lkeh>7ejQwbRZmQnmVn<~t?Zq? z$j29LwU)OHlskpD%5%h^k!!1g3An#)JnyI+o%(|`a&_g~byIZ*av0_a-#~bdYuw(r zw-m}|ZxzOZVNU-&lo&i!kB+in4ZA5^U0t6o4QxeuQL3{|ZU`G+tQK^$nlScZmVmq{ z)#<@iSb-YB%+fAaSlDVeLp!DVd{oB{m)5h?Sw&gjJfRGEQL48~HV9juCNjge`a)A( z0E3R9(oN0Fe#>8xJ&hT=@ z;pj8;fW1|>AJk5%L%=5I>k{OsRAiWai)Y?%Cypz z*3~u56yUj?0TmigN>!*!BlzcrIx) z2TIqmhmEj{31E(GdyB%4SFPD!Y_=n@=?by`?2*ij8iHt(G-j>Fillu+HDs$IZvTYc zFcqUV>5a%!GE<_D)@;yo#tkYl!nM+-1?gr2o1jK|j+;B;xH~jkU!`8>td)g&WfQB3YU6Dw33`nNea7 zNy>=d5Z-V~dXJENiAmEy{?*_ZN;$P)`7>oqR2mTpIjN?UYD9uFJ)*SIoWxTSm?;H` z1ZI+$f6@pvA5ORauAlr8{Iuz3?v9@`{lvQY$45ox+8J5??CAY(^~0lR?LMMGw1>DU zf*#YlhAAdGqU9%f@QlLJ+gbUT0zb3(FYb=A^NTyAPV4Qo@QdW!{k3tCxa7Z*KcIHv z&m42l6EEbe;FyavF2>s8L(1Wp;dOoNhujn#^E}@Ytaa5FGBL;Bt+iO3$M14maLgCn zYO#Z-f5--K%(T4+$9sTd9^g}wjqUnFE(*+V|M4M=j(p@!x7HZjL5Tb5_LPrR0gfnzT26V6`d$(EzRG1K;k{XgVB;Ft|-OR!=S zvgIz|n4jh^@yE3i&zEKLk(?O++o^bVKj67c=N!?tI-A?(e7e~;hhxsTS{E@=qquWx zY5I3?%)J9L(>Ham$2sQYIen$^;FvSOF^?Z^xg{!6d$(u?p=N$9;2QNii&4P~4;Fv3&d%`*9eBhXW z0mm$XV_qBAlJbmHC%`dp0LPp*E;g#;v)0ttS8f2uyc!(y+wF(aJ%4Y?W9X?}iBgr& z9FBR#hi#+N6Kkw_02FKh49CI^p z%tP$a)Yn%%1IN4q9P?^$%wywrKWnbQGESFkgWU*BPWMb0> zf@9tSj@j@dLC}0D$B1K|1&%oc9P?#x%nddyW?<7)oxm{%fMdQ5j@b&0|8I_&w*fHV z(_#hL<{I*yaJ6!z{*FB`SQS9KMM=~LVS3D#BxK_1e)%bqmn7#5< zXL+2DW#X7EyQ;F>5l{H>+3+>qbn~@b2OM+x^TpVfxp)oWn0?A&zwLue9CPtTrP-bH z?`7hc&)m;>4a70i_GfU+#a$e;vC1jDN3AkEdtKUU|2>>z?xP7nPAcG{gYII%aU-1N zz%dW+VqgaB+i>q@+B9&?gU^g{Ui^NAbIc{0S)}FQnA0!&iUnF-Bi+N?9vpKgaLfz9 zG5_%1DMR-#)d9zx0FF5V9CO1n+hyn;rtuRD()Z>n=|=J}`Jiqc=a^T4W3CU5xjZ;# zN3kr@Jvhg_apIte$>5l`WIrO^gLBM@d2=}COC2AP?xC+;C5L0a0gky~;s(-QmA_7z zEG-4c+zuRbUE30_y$%RnAshn7+!P#h=XHKk5p>-?fMZT~amKJVC6~rE+OAVe6~QqtY4z3Vw)g_)m~*)}<^|xG`xh_6 zIc7I-%(qO{gr?w_2UWf;BTv;Rf@3~*t(*7`9P{o$=VaoTMR3e>!7;mmV|LDv$oCYE z5qac^;FxECWB#?w74kh*-U7!ggJYf#j=4+abL4xfWZ;;x*JM2=2LbrKa5f6^} zmlIZD2RP=k#cs*OF$aKSZVZk&8XWW8v3F&(6@PQg)Dioi#xYZHq98IXR^$S=Kki*l?vno8_a)I>l0;NlN|Y|rHF z198mpjJ9+5;CNQ$%OiOQ_~Sgr3aoJD$MUH3Tj@XYS7kdej>yjkmQ{HF zL=FR&eAiN*o$8S-&p6;GOPvYm80Br&cox#{hx`DHawA(jo8|dI zjs^GJVqO@#HSC964ZO0YPg!;o{OL3Brv<>DCQq{CJ?i)zOa*Yrtoj+}Qq5Ys4&(c} zE*`iO*xHGMo-+)2m5&||V){F49Jf#Qk!Hqy!W@j+qgeOy!on8)SRel}Qn@@j;uLJr z7wr*rzBAR%I6LoOOT04wwZv>5%1)oHBcuogsqUNA0Iqo(xaMDG92N&}+aUVmy7j>@ zR|CU56%2FhXDf+Q(DVdzJP6G3IxxrK*C&Bf&}ceD9Fk^D?I5o`IzW0=rVM$GswZ7u zE^Y#c{0JPff4Yjs51PKQ1B7OeI@TiBUJR!7}obFwna!Hki z+D(;ewl~U)2gJ*DhjkV)2cym|(+=L8ZhddcUmm!w=$_2~S8QZm?NBiQ8l>M7137OJisRVAD8z0=**5Tm`0p}<#O>s!g%o1QQ)cf#Li$~(>$7( z^(w=tI0N}rn2csT9c~xC z3Mp~x+@A0#TV7FG6jvXJ;bFe_h8RcVfp_eJb|hc(i}1U@w!dHcU(6rlC1nX(>vRZi($#j-^(%Jk7@tzp!aeV_~Y020$Ah5-(^LW z*-^<4Fy-pHZvRU$tbm&$qa^radhX+n@8!DSkMG;cva&Zm$U@tj;+4VX6u>zBOnPcg_Y0OG>n6MrE@kj5X z?DNEqoIk#tK0>~hjJ|7KgX4N_Wd`xb%fKJ^0)Lzg{&>rmngZsClzqS-e>H8CW`RE* z96CwB9FemB-u1%!6Ak6%mF`JyEo)JJrTJ-}1484#N#gac-Q`B@S24^HncIRt{`7Tp z#02oi4^ksJe|#VOaTfSvGx*~}+b0k&pgfm9hd)05_Cxy41q-4vN2Ewyzg?7F{Bh`- zk`m^K6eYnQf5_f1?F4@;2?x0zoNHwZ$EVrf#p~dYn+?e)BgQL7fIp5bo5LUX^ZY?` zM5?zg{&-(VT6z`4Jj8g;A8WuL?^#sUej{0tLG$dyA6Ec>{2u)A*aKNKN2II-{&>RB zeUAFzkKd~A(j1Xu5PL7|0e@T>{Bd%PE!^v_4fx~ro%Tvk!5`O~bx5EX-x&OHSMbMS zxfPCM4_gVCBU1KmmMZK3e_Zt1l<1kSd}xkHIikZ8A=JN?oOjPL;m%YY=7==Px8RR` z=f}%eav7Q5=!p*Ek8k=M6$XGmeiLtYoXW_B7_U}#1%LeJWnn4fQwgEj%G(SqnliLU zQF6sh&u$HMHk>!AN4$Fxyf#{}@lZG-RIk63p(5cd^3>rE8mF1BU0l8*^@$Mqmy zKyjx)A69(wEMZl4q%gqu3U~oDUo^G!ItHMUUO`Rjvj8c$nvJ?AESec2vYJ?ER(dpmr#rO24;QJe*T zoE!Y{Bj^R=jOPX7j|+i6c0Zb5@QRuyruKMG+N$Du#?y#2S3T#76=ebadgB4`$5X){ z?*o5qxz?ET$5hWb5d3lC+V*00;w8=>=K_Ch2Y>7f{&=c#sssIcbJUg`{&*Sq<5PyJ zyq@W+0L$rDdrO5gjw67}oNkH8-<2Y-A9{PE*HesV6%!%PEz91i}t5BOuBcnjx` zYcwt$eFiz)0Zo2Sziu;f{`frVIUB(rH##*$Ozyv)^T$O{&si5((eY|m12#C1C=-8N zu$fUF4gUBD_~YTt(@0xY5Pw`B{PFx7yB$Fl&rr>Sw(cnu^EK;p zkJ{ZB{PAM&$L+;w=+|pBk0*~{d*@GZ?5Op{;h%DaVO~em3H6-&gFjyH_s+37;40^j zbJd$A+ysAo<5592{KYT<{d!Fn_~W2H8fF;Tl<5|EbN;wB_~Vn{k1wH~^VZTf&L7_d ze>@5N@l)`}l@G4r{P8*P$CJSy_XB@?wcAF{AFl>~9OHF0${+mk>iP#{#C%0SO{HTh z>N!6{o#s_<2a`9ErY88~4&aXmY>Z^BuQsF{AWeM5wa!7{j~n8+-Y+&I2S}snj(W}! z;E&rl{}+4b9oEFU_UjaS@4Xj0R(g^dW!XUl!QOi>C@R>%g1vV|#ojAcB$=^`3X0t& z7Q_OI6&o&>dVbHF;BxPM{@Lf!b6wx{$=+cmvxX$Z@V+y1Klkqul;ypa{q~PB?z0m) zyf<_n@ITQ%rm>9tV;bXbU`(X(i^i!t@Q>96wZf}yYkG8D3wH%AQ{pQtoo_S?qx-ac zo8+PNdsZrrgMXat{+y*#kbnFq{Nu`SkLiZDMfde{&j)_Be|!MrJ@x;jWBsfq-+g8L)^Bfd;5$?*VvcWv7tZ{JTVKR}=>Hk?+?j8F;+tq7OJwV& z9+G2D>j!9ReQ;!tSp!m9Vh>xMw$nc6Pg}8da)s%+=65e*{xQ9V5%S04YWT<1?QMAP ziGPXF=>KU^*NmT0{6>s~f9%v(#=G<=W9$7yDWB}~LJWd`Y}LewJy*qJc6k3yOho@r z=MRNk@8#v<0rdYo`p|^eoA6j%5C7QD#E#!_r%XHn|M;+@l>IK7;UE9q@hL~I(+d4R z%Z5JY&SaK~O8CbKOO0{u$%MZYd`_7Q|5%Zig`)(0NxIHI4uOB%=z`Wi=HVX?hJU;j zUf1btH_R=1))V0$PecFD38{tLmQ(U$IG>Pj)Aj$ffq&e2SUQLE3F%Y#$B)tf(+d7E zw>*mKOXW|&rulA>>hxzpO78`dV_?p5@{iZTKdu4)IL&f6F=ykA$(bRo;UCLx59JSC z@P@A?Hwl7&O#MHl?ar%S)|^7;6GqYSkMF@hepNGB^E78K^N*jwKUTs&er8ZAjI#g4 z;e0|e1^#gu{NonzkDHk^ple2wW$6DI@GY9-(f@P1Sq@z@s`%hznJUu1C*~GCd-%uu z;UBMrf4mm26?2PCfB46z;2(Q^ambGNRwU9jqq9Ys!sF^TqFF6Y9Pq82t{LgQcTEyJ z;U6y?ck^hqMm#@o;zMA2)!1Y~vHnS95HnIv=u>`Ny&FkNd+v ze&u1Ts`F+c^N;JnKaPQa{2c!AoE77lfBfj8ln;P^Y%!t$+L&{Xgezo5Xd-{C^w%@j3X%6X72R z$+vOcuq_V$@e26IHt>)0I-RBZQqyGk$MfJHH-mrd*RC_y2isN!9ks;b8DkL?d-G5`4KZZqDieX?pC{Nu?k>fiqHZ~yqe z^^fV}MJ=Q0&)xvj1P%2xHApWOhktf*3{M_tbaaaKd$x2K_*Buk#3hXG)3T_;pNcr? zN3j_G@#knWcG5Kr{;?ANadY(kq+7+u7|WkKul{=fIG6dCm6kd4NIk^0HMb+QUbokM zF{x3ca4JN%9X;MNFXtkYPrDDT*G|7H_JV($ntPF}R)cTcQ@*PICd*c<-w6Zprn2KvOn zr9I&v&&|9oxa3{Y^gf!){Noh($6etczj{)lDZF}~`NwCy<_NO4BgHB^rJ9YNl^Fw1 z95z_&?|ngi;xB=l)93kb|Cn9F*ZRlwnI!-C$Imu>{ujbO4yb-DJV!D8=+mp)6tuL> zU#+ZUx-N|F({f+o0;Q_iO;OV8yry-PzuED&)!8j74*v0KxW{y(&!_h5=Z*`%+CT1J z4cFX(oFmtp^R!O>v2vmloTqQ>Z!U4UGaq*JI`fa|c$oGf|F~=#j(;R?#Y6CqclVU@ z4byN<1vN0uR@~xFOe|*WQT{hM+D`uQi?Taxdky%I{f3t=C`@=?)StUn;QxW1&Vc_JYoJZ{Vr+nj~Bx~c7}hfcFn^Wr1g)d!#|!4 z|G4cF=`nC4d94zyf4l|$u~F$JwGp@<9a~oXi_?2ziv6yl|L{xr$A{n_SA91@w7|CH zF*Suf@Q>$QND%kG$y8Zm+gkX?H%*5M?(mOes)bM;j(i&YV^jFYKJbr|tQDdow$*}v zTnGN~QTWGyr1(%Bjx4{!*X%s60P+0-rI`PA9)~&{`7rp$Z?e;cUGR?|6`Z9y99bg# zzZK+0k&d@Mu^=vBWS)#26%R3;%dI z{NoewkB^%M(ikMK4ga_c{Not-$MyV%a@2pg!RD(%onZ>mXR!&N+hzsxk1HQn2!}og ziL$E!{Qj4nnSUI6sJ74&{_!aI$77?zG+}tWK={YI;2$4>f9&z4C#S@=TJVom==r-5 z{&9;5Ng`_D<-YKb=fXceZZSqU5jB+RaO4ku=zF~5ZLq2ljxj?%z0rhDOyaM>KXy6s zm!>JUP1f~2z6Jld@9~YwNc_8PhJU;g{_#ur$5SsKWB#!N`W{~`^b&f*KW?qO%KYQi z@Q;1rA5VjS>|j=t`N!se9n*Bx1Pa%#jN!v}G-dwrmz!CdbM1x;1@Mn2*J#T8<8$zj z)8HRhLf_+qYp*i@_%Zq(m!a?RA^69AhSlJ4Of9(z|M)Lm?_!HQZ{{CYLhs@!I{!Gr z%>gxBazi8ZF3!>QF7BD({M$bUP&WJD=O5EBL&IbX46ETZBxBen|DZMe<8}QOgeUE~ zk#+t3Ue;f<q3Gl-z(>v=!`zblUC<(^g6e~KYrIbpRLntwn@ClZFYPvc7uPc_ty(f zv$9zSx@{&6L6hMfUtIJlffru9yh1k81vtZffCi9O|;U6bzoYZ~P8Jfx=pG9I1 z*We#pz(4K*|JbtEK4K5D>F|%Q!$0l-|9FSvCgvZ%fq(1*|2PBwu~aDe?jQGne_ROv zctQ0ibbW~V$NBJ&Z@js#ax9%m*N0^92iD-f!auGC|G3C%6tj59wSuk>Nu%K(A2s*Tw1t0cSM-W_vn&Drv1~fB7GHMcW9Jm(`ViPW{Nsu6 zkJI5FcM7V-cf#Wt!9R|MfBXr3jJr1v=E*;ffq(4n>%{pVbmBwjFQt4ssTzHZAHhGq z+B}@!K46nT{;>f6Sb%@LKKLp(b&)MU0MBs>{;?(e<8t`N1HIja!PxfOKc=2P9@-vm z)^@JePR^);g1wB^J+2;}-afuRRzqp~GLRA{0}Y`HDB|K&okZ)}6mHVwNR-nycY}n- z>X)cKN)J^{q|CwG23NPkciQX6CY_Yfs%_{-N*q;4Q4%)^bEM0e>FT9yu#NgHP~{Z$ zU?7Fg9{Z3&XNO0px+n|$Pg@&B&s5RShZ0(~T^nrhbJVdxTQyZN64U5jF>=#L%)>u! zJjX2jdcEyg`fn^0w7k{bQ~CFuj8M8y%P=oTWnt@bu`T>#+vcV0tgWJtarnRVF{ZiU zXJ60x)j8f#5n!RTKyFB~Zap35SLlf9Ol;b^xZ@}#WM-RFb z&c`6f+bz-cg$xrHI49(Z{KyzH@X3aP&XH(W6moN*w(hIQlwp^vB@nIo2~!A1gPA z0Y`TRM_&YvKEcpd>+3Dv7|efxeTIQk)Q^zLh#WfMn#42~{Cj(26`c(_^imN=?+cFp4LRPf;OGfo(>17%m85~A-v&p&2#$XL z+8zyRrzAJP(U*dw*9J#V+iO8Rek60i(euF34}qiCKISR3z_uiC^trQdh6jP8*Q+s2 zAdbER96bRXU5XrU-yMgkcY|IvaP+3&=ySl)H-|(ih@+Qto7COG(FcN~@2J~eO&q;1 zI6CEcTW1N%3v;CcSjX=iZyFHr-uzGH=roqmI7MR|jfpgV(U`Ri9DQ8Y*3i?vt{v%h zpekE_I@2Vq?84m;x=+h5@5hGif0iVqfTLTbjlng%R51}8{XICkH5fYG*xSRt{oLz% zznY`3zK|;rM~551?JGSe>;)8Asd81lxE{~eM{n}xjLIsp^?dyX+}_-3045 zTBn3|;OGj+Xztzh3&Im*bklleO`bqG-hO;z_Lv5MD?zX8vF)_aobgrJIz0|OSC7p# zgrVrcPOo9u!3F~5c-v&xdi>vM%9aCD#M-l_pL_Xr!o(VM@w=HAa}Bv6ib`P^V`I=@^v1dg6G z^SX+D7s~N&mE223ub*a(7w-BCoBwG?P>;lR;Dz|l8>PYlYA!Q7%}T@M`n5jeUyv5>3n^@#cc$@_w%e@2dX zC2;gzr;ezIqhAL{F9Amn0!QC`{i%jH`V*W_<#vx$e=H4B=GC}Fb-D6RVAE=F^v2-m zOJ_{e5Jw*mj$RcU-4Go8kE4_6Jjq0%CwKe%N1yoZ z3jBK#M-Ko;-vy4o8XUdEq!!IBHgCbv-)sVH_o6Lwyn~VB{S-OgO>g#Q z9Nph3N$3QQzI5Qtqb?T~lY3#*0vx@?h;d<4!O>$^kEgm^No8{f&kmFtEG@fgQ zpG^ZtZw!vU13BJy6DDv`*wz*towsk#PX$L;&+g6PJjuoYIo|Hz=+}_reLlJy%kjPm zj-CLHz6%`vVO~c%PqMjfKT=%{9Q`>s`moz}jH5S0j(58uHTg&2=q~ByD$FgWy+a~3 z55duUf}^h%O&LdDZ5F9s1&(e3j{ecfk#Y2oPhM#jfTK4CN59peM1^a9rWXS9HN(Ks zH-e)Fm%mo^$F?6idL?|8iK9;eNB00nuL_RdC}JWv3}d+zIo?HWlT`!3(FZJ^%q3!* zlbKAa(?wXD1w#Y03_{Z%)GVNp9S+jvW_ogSV81_;Ko? zDwi7=pf5GL%pnmf!F;?&alU;bvv+=I!lc?q?3CMB-;=Z-)Na=!@-Vj;^VmzP^5T=!D_sEAe%9adY?b zMwv98NkM@3bdYcwgB)I;Em_nNGASPO#{dN+0*M zZ7=9ViW=h4$rXtwbb3W;B-F@)njYCp9Pr%{H#)g8VW(FPSUTb{iIQtivYfEgHol;S zNc6MRIM0&pVS)RWxNj+O!Wy;3u){rSi$VA8@c8r`6mTSwRKdrKri@kivp2>xK`k3- zYIuMg?<-&Sgub`PI?`{_ezrXSJ}K<|m`b7SK9)A|W5fKeY!xWSJ9@n%JMp3%?>KPu zcrbLju_w`f`?>S#ujc3yNowY|6Hx+g^owOm^4*TmxJRXGWoGIW|+AsT!9qJNCPi&**==(8GbvhPB zo{5~cA=jH-2c>QBOr+Mx@g|O5_vT=A*`_GQ(F03*AiGc^DaV-KaC8rF^dQ$dn9ua&i^E3hov~7?#`#9DP1=y!#->`~IaE z>WMAC3yyvbIo@m9ztiN@Ys-3K53!psgjkpghr!X$gpSmJVM+IZqc1{^_vV}{nxuL$ z0vMKbJUDtcaP$Ij^dMDBp%%7nw4NgbBgebvDyilY<|%T?8w?#R_BeE2T}>)-0T(-v zOOCe?U4B@LXrw9`=*bNr-AVNfWpL#T&?Oqi9s2Ybn;09IK&LZC$P&gGnW@ZJBBdXa zqOlDPxEKemVAWXzVCc!ou`|#&H%E?=5wed=%_zyv*woAdnRyV{Fsz_c8(Do4Jv^H^ zWz->E$;1@9n3+SgLqZb`KJ&PWWWX^y1Ij(#PC9E+E&dp6lpy;GU2Ej8(rn0 z4m|o8m?{P#3P&=)Hi|>iI&j(s&1AdL7kwuG{j*J<|2p94%0Tb1to|*JtZx?_Rygv-qu;cCL$njQ!qmKkbryF|`_U-463nqbdmZN>Y z=;F5aefxj!yG+AmSgJ&V*+DWKH(RfZ0s)zYuiQ9VCyw53U{h{dPOgCeTsJf)iaT&) zu7+~F>3Ep-84ZqJdukQVE^oPT6dXPHS+Q#0$=5t-dmnK0 zYqg~++D;tZqKlKtxRbw-xv82!&pQCQ#srAI4sFWKa;VML52<;sSGC0&%JJU2F@mk< zf}_(u`>F&9m5|q6^rkVl>eD2l_LW(hUR9^64u*~uvNl=?2J4KtUC}WDar8jLYsyh+ zCc;i|^!T_)j$RLOcY59-_}iSYK-(YG{BpRk`;nK>TxrKGwBq^Q=JSL;8(qY_Wz{e) zYWey!@byXH>wi?gg5zqre7I3UsN!}CKLC8)@6g@sf9LCVc(3s3m6w69-v(b_1HRsF zStR9LFur~Se0?_fdU@djHSzUXVCj{?(%r$*_fId;5MK`hOILuU9|lXWG(<)D-m>OS zq5PU%>B94Op5ifke~$Qiq@#jszA9Ke6BHm;**`$(j&1kB%{Ak9YHap25cUNBslwPK z`>^Y(U^Yr2Hk@I?H@m%o#wMF-M-;+cd9Y}CA%NewVkM1DhJU_oDC~P&Q?zdzC_b1Q zNn?|INT{{=@$*JOrWYaZTJTy!e7$ahjo3+(C~UvmRCEk@q#?e(8=U)5WFKCJob5jo zW3%hw7_b02+dMe;6mafFhi0jRv27AK_ZDP=oC4<_wzRV%3Ely5Tr*?#|%cExx@Ka!c&FNIc#oaPF?)+^&BG^Up_} z(L`g^NsQVgoPXOybiQFE&TuKy#Nzj@3D(bn^&bQ4Z}_sW5RYx{VEvoG`uCWR5lkDk z7usUmIWY296&c-8aY6??Z}lG-`IdT7bREag0F3;Ej**|tixRqF+k(nYnvhh~7=(q2 z>I>oOo_J3qhWl!q&1#8#(!$01&JOCn^gb)hG<&0JioTHwF>d#(?16aR`PEF+{i_Cu zi)JXr1^yXFhhRTLa|=^kSI2lxlK~T%jSTc8#zuxFIFiP|Z7#QzB1g~E%39wF4La~HaK>MXDzkIv9X&e+-iFVS2vlby}P@oiLHsVjjgkXho_!}fh8Tg zo4dHU;mIxW5)2J#2)DDcGxW9e@$ohCMMqIDFJI*IIhi>+I+>cedP&gw*~!_#(cIhH z$Hm*-gB>@s-k|m}6C1gnfu6aAz5#4$q@!9I;t|jn&e#kS5Pnc%f`>qtIZJaFZyYy+ zP5@1~dw9}8Gne@@|xA^u+@{SL+L&(r<)~(`P3OEeCswrlmEqm4jM(jkhZFssS8!T zCzUJd#-60&+s~a3e>ImcHRvSF2jiC9&OADG%6Xv%xP1Mkdyk$)?|1yFnG#9wkQ1pm z2G*@l_`97zTt3IjX}{BU}m$H3*SninZ5UUSWG zbJgWGV}vAd`GNyeRL4X12!_Z7Z+N z<&1G>aopZSSh}r|%Cep|7d&8-i+aKgWj6jCOrpW%11H{5_~ZK0fdy5vad2s54leIu z)>;#{XN1P=N_)x*q`w)7wT{bo-rOssg3Dh9m-lm>sTufbToC?L7?(Fqo54OVy-w#+ z-l`sYtBC8ypHQSlU(CJ;_Jcnny$j&-3+_f{9|o77Vtkt&pWB1W8-dIFgUjDeoXP53 z>3NCEzXz9J)TlXKZ(;|3DscJ!;PQ_=0~nWY(A1c(3od^MTz+l#4wVn)m?q%z-nv}y ze(8n+arp$~f}d_RmzxPLf30w)K-ZgMS}H{o=ReeKdk2VXH!fwl;F|`=if{ca#HPpv zA8dY)Sccv(aQPu;ozxj8GBiu83=D!R04|%b)M*LM%hJ7+n4wxO``D`TAae zQ{Om)ci{5T6EZZNJHJ)?*t91P+#nmd;B6c)XpF(-r=M?2*PCQ@kqdqjTz(jG!9z}- zRn^Bf<3Tm}QgHbIaQU5!KB)e{&u-J@f|muQX=IbXsff$J0hhlBEt%SyvUg@2v{gn`HOF7&q#`aq4_v-{Zv>Z%T<|@KH&n#s ztANX!SbJzXgUd_OT~)Z=Bnt+YcbXY2Oa+&}f3aBE9^2Z3%bS&+;?lt7OFExd5tpZ2 z@MhrhpTXr*GB2x$%O7~wj88`{_;%!iS6$*p*PEo_$OXR!E`J|f{>V`)#^n>*mU5H9 z*C5uz~#S!%Xd=T(G146-(3DTmzPK?Mq(P>Q*7(lX{2HeOgAlWrRif?H0O$%h!1}f}I7PM=rPn^1vH{%hQrZ zpo*`bJMZ1D{d3O)?eQ{$QY8``^GF8ZmY6q~#X71k<#M6uF}n)<`k_HC7mNPdV@7#t zXx%(&vKZLzv6|K!qgQn_IQSX(3rnn1@;kpldF-xqrvOtpz*L~pW<>H}2UU&=FeUsHFaqjr0?0G|HrixqL z$7!T1UvUp&SFn9nF3MxS*G_eN&BD~@TuDNv!Z1w8evY{(0j>z%X+x*PzI>GB4Q|Ay z1FD>^J*fwV@v{5l_!Lc!YN2_#YQ*H8RD&k%IM|PiTQW{e8*^8=Gd)3rxz6nL`4nzb zGehpx{E_0--hMpIb*uXK=8K0s;07J4;2azjS;gZWUEG;d`xqlQOKT2N7{qsHyN=~y~4Q> z&2{?6!X_)+!15z3u4W%-*O=xyGkb9R*$HvH#K(x=_vQj+o=D8x0u(Rczu$iOKD+4J zS0&~;L)C|PVb`-{e&wiS&53k>n(GYS^|chMm+-34tT;aJ_+-?e=}C@vG!{D^aMDb= z+?HQCa56a^lI|`oxE*KR`7IwK_}iz==vtJqb=PDeSSfOQ{Ce{rF4QKc1D`VO7hU_q z=R*v|`=_?tsan6PHeX;J%6H%0MgX@rPIX+%b$u1cdnEesiDjcz;P%F%RZa1Bh=N}{ zyMt=ole);Y(vwVY*FyYjh7(?!m+J6<&Xj8?F$fM2uUre^eQ#Id20aJE!M0tUYl@2x zhV%XZnyh*}A&_znB@XjK#h}@>`EmPZsm#AcAlFbXX=!RJzWcl0p(%4?`7R5lia6hs z^v^a|b$nlwPu>~MoAjK9^F2M|X~j{h2?oJ@;GBB=nwvuf* z&JYaE%=M9FZe}FMRW?%#Q$uS5J!=a?Yn;qk>)Gh(o14jOZKWnwmgZLGwpO+#RwkxE z8g_Oz03zmg=9YGr7C6xZHNp9Zo)kgsxbA17r;jUtCK4|LLjwl~FNwFkx4oC1xw*I0 z4%zCqws!i6WjA%Vb8~Z-+aQQ49-dClwyv&jbXtnv#@b;I(iWL3Y;g6CZW~F;) zvZd3f1VyQN^Dw$kOU2}9#b0S@qV-4zVY{1Fvw!zzCspV76IFfnzA5R(o<#fY=gw2V zx;~(y&o_B66@9)ZLYl0k>+?;XeVne(H+lA7QnY=(Nv7kY`Wp#PaF6`s@09(`%>^K3-gj`haTi?5WRpU7crN1%1AQ zP#@q3&;AJdeA9X#c=pcd^BsWt084oG6@9+xF{#h@7}N*Yz_XX4&-YT)2V}vskFGUA z%+PuE&Cut2C+Y(Z!Lz5|WdrI1%Hi45YqLOozzcZxebMJT6!iha;MspceL%N5=ajop zA5d$^Brp$s$upg2-w>Yt2EGle573}KV5Y9m_n%u_nP=~X`hX+o^KCk*kZUn%2kY~F zJ5j+&lSlEI15xKA?Tg!yM)?0-@!*_ z@YQJ?)qN3{PQiOm=W9-=57>kHfFjffG@5dm)dyTceLxL!3-OPa4%v~Hw0*uy?`I0t zQ6FGZhZDzV$Fcf=IQ04Mhx&k>eQq9YvrpUSyBX>OX1`1hn~wT`#wRB;&prV40dA-d zsE+!8jxuK+=W8}iP#-W3^#R>XV+83)d#aF7WDyVt*2`u8e35vwPYCT174y& zU?OTj;(OI&o_!MP16ra!z|PB9Ro|oz)lu7YLw!IH>I2@PJ|H07j(PTux<22hP#H|7%S;J9% zz$(-S3`Bjv4%7#X?X#VE_L3i*H2N%4eLxE81J>-Rs;Z9qfWC7lG0)x~^#RX2C97JX zK49y$$-h1O-}M3it!GakFY@ds;mc=lM=dG^%j z`yKjxZ(yFib|0;atlfv!EBbs-#ko^OpKtQ)JE70_u@rUoN_h5DsL%JKJ=x|p?s8Ai zQ@IBEd?&!Or#|0Ns1KL}&%O|SzHLz-Ai}f%u|5E=4Re>C@wT4Y`hb0?4+z@e$~^n6 z*oONez40@2eZJ@G>I3304ptAZ)|J%U(zXupd3 zfPvZCKHsOGWN7xIKAH}&t->q8E|2fsW$zxC-V1fDoAJhkk z$rG7p@5ql3l29K|-k}LM*m#5Bh5c@ANEAORx^f$ensWv&Q<-P~5%mE!s1JyXf2VoT zWCZi<6{rueKz+b*)CVM_olsGIz%$ebK41Xq14>XI@T#N> z^X&7{=eq>;0b|hT`%06$tUlmA`h0IgpYJ;8^L>8MoZp^3J9O992heBoAJ6`u&%Z6| z17=mb7QPmJzMa3-QP8q#(iO!blXYQqpOz=l=X>kv?&3An2Q<=o_P0x2Y48&v!KH21?-BSM>P~hi6|I zeZDI^`?yqXpKtnIW?A!m20VK!c=oZospdjo=H5R=Jc>Gilc)pOw0^aykH6R4ah=mz}&-n%(K7K?Q8a9c=m{X z5NCNWVxIk2ooBxmp8b{a<9LigvP1A!F2l2rgJ*wk-yO~u+tjERkfrX_jD%-zU4%Md zY+DY`-Uy!k-|*}`CQYWS4|!L3_QQ3a{eXapRHGy}gl9hho_!;D_DQ)@m}g(S_o@(^ zq!8`WO!zIbF3huEa!?_>G6)upasv3B9YRIa0T>=bpYP7_?5WSUt)rj{!{Y_~;Mp$< zPi3BcRj~K^VDGoV-cycPiR9TkfW7Yld+!VO-Y43CdG?=Be{d1?2c1xVuy5jR6|M`J zw$XX^cTs;(`h4%}7{omLky%-qSKWpSM^JyT zWl<3G><6L#AO`gZGf{tFd1?al?BApQzyW=}H^Q?IF0!LzYUbIS&3daIiqF=$u^!B` zuZkLi1@P><|CPdTJLAYadqdO^TtN*1`X2IYR{i$uQOEGV(X*#vhK5ES!zvq+F>F(a z?^1a7Iq>X+aCr8# zy|>P@r^h6oe+YIb_4y{AzXqN?ZU1qf3eTSUeABuHp8aR^`E~)%p9RmJUMKN<^6V>K zGkNw6(C2$Jc)lE-eOvVTHUQ7R4$r;{`h1&$=P!h3Pkp}G^TM;IpQS$EFH2 z-zGlhdcd>q|2c)<4bQ&H)76aUyMyO{K%Z~&?5ADL`R>_|HEpfY%N(Ie?J$KH2jls< zbz@aY+tJ7S-#q(Fc=p48@a$XaJbR19+CJaJ^H;#L9|X^SWh2Ho^sa&D7r?VO1<#kd zZf3{R_x&a#Q_4tm2hac9IqF|L`y%js$(?^Zdrrsm?R1`f7J;Q5`bdoj=cYm`!SxBEj~&^JKbu-pxdLvFcYV66C}vW0jM zo_*IX1gXf3q*QM)2jOXWq=XZc-@6@#p^X!S|$AahEf#)kP`ZLe| z33&eNiv_C6;Q0ebPbGgux)?m)2A=&n@ci*#(#Ri?%E0p%*m`LCf#=({T*r9696Z1N zEG^GZs5x8J9W-G_N&12Gdm=6#PhAd^Q(gAzX#91pqI)K&udSA0pb_%{KYG0|Mu*E_xT1e zp|6UOm`3-Ck();1K=6DOJo{qw_kLlyl`Rc+3|D-DUr+aGIak-`yDNCUjn1>r0nfJu z$FB#TPfOjD#}+?#-uu;_y=m%vu^l}74d_X7tTa;$f@i-m*qNU*dyRM-o;|G(eY{E} z&z{y7*WJ(Z>gl}4A$h+@p8a7HKYsq`bkR(iueLIG;bXaUkv!GHBi{V_>?JI({>h%^ ze64AVSYAD?zwN(^<<%dWRfBhFw~FmQrOb<$IA@6D*&CNs=8Feqk|pSnqO zhG!pfC5Ru`Mf*DIF7;=RNuIq`m!|yRdsnj8Jam~q`&shrEAOhp_MyD`nNOSXd*RvF zgJ&NO&wh*09@m5PC0F3t*U{zG%OAM#kXsAS-fv6~-V)56JbQcO)qg}@{aAwqJc>N^r@^xigJ(a9^6I^e zH00R}gS2_|JK)(HRcXLH`_;O<`a*d2om?9-&;GE^vtI$veqNeH^uRd&Z6hyKhi9J( z&%WLn6P8zhyklKOE_i+Yu3xhGLq;sGz7g{3Ey|Ml`?<-QHGf42mGPRZz_Z`(+(7ke ze;mKM(H4YrzCW_k73;MqsPv(JEMKX~3$$`sby(JACGGjb{26^>|kyk%AVH!`KeSdiN)!^A5LSB7? zgy}4=-V&bueR%fG;Mrdf?5H8n-eCL{jRo@Rt>M|nM%QL}^_St<7wA0uO&w~py!xB) z?B~O?Plsn8_NqV2s~-Z-{slaH9-jSeO@EeGKNp_;lzBJ9E5ozTtg)Tt)fd3CUj)y- z2>yJhPx&mb{xdxL{_yOF!n2R5b4oyMnqKROP3k0g_VL)S_VhObdG@{F+4J!1dma*$ zlaeEU=hXw9SCm5kCs-%cO}Oy$s2=uAsX+?NA=({}^5M*qbG|DB8-YH6-@cBpkZ z0df)ttr$$#mOPV0s1*pQZ|Zsgit9hAVk$iQhw$t@;MmiRJqi2vbLWR&&C!c7-s?Pj{`r_pF%wWEp@lDhWaUb> z{y`SOhu>Sw*3Ao=@$=d*Vf;JMs|Eknbe}i?9KD}s3x53jOqN$q>&=Jm7u}Fo-=k_I zd(4`UFE=k~%(hcr{omz(uyx|-^jxPGFA;}nJ$rs@@N$+{-??ccKK{TiF$NsHes7-F zxNH)mz|Nbk4C14gXxEpQ1@gOEuN8yA(Ho3Wu;;3H%sEx|izC6&6}x@;6&H4h2f@)x z9XLL8-*T2$-&WOxzi+u&JPD3o+&qx|E|gav@Srk#ZIoAErPQDQ{CEw^t6zUk$rlYa z;X{#EuK`Ezm%E9s14_2)JbM>#^sbZJF^)b79Q~G#qj&Ud$vAo?aP;%w=x^ZJAJpVA zjvfP!ZVHZmdSxWHd#5|&4m>!zW$Rx2yZehZ(Xo0guf7MD;OHB{(et|pFphoz9KGlJXl@xedXG0d z|AV6s!@nnSbYF1vOmOr;;OH0re8f0<+Q)biPPHgQUj1y-4I<_i`JjiH!j~GztFOt4 znm{?@=#*FQ4vwCHy!x;jMl7#h0gfKsdwkdeaCEz|nbd^oTci7)Ku!oUcg-M;`@_ey6CEadfI@s2Go$ z;ct;R`cQE6QSj`8!O>ek+{8FKdG-k%l2!e{(XWPY`OVRPbM*g~qtj4NQwIIn(=<^V zLp@Cmj>xNjuwh#G<@?!LH^)6;%O$SU6ybB?!stFNElpz-(*n1PPr%V@Oyb$JN_q8t z!O;>aVEX zht_*toG*5RXP>yjh3^%UE|O)CffUj2v`Js3xi{lT+u(bJh~n_tKVT~MYYY+RzG<5 z8=Tv-yn5Bc3{6ku)stu6^l?`hj;(x=s$4u>G(|k`)9iyKL0bo(JRG8Dr!}(byTuq z1zXO)UR4=i`XG$%)AC~UTg9+(GsUmq=$)I?VSgLt;OL#e(I_7NF>TPCu^+ijA z`J^MOSVsM=6i@#Bft76i_Gu5cojCgTo!)Faar6nEzBuQ_F+4nbdfrQ)7cfAy;$S3y zRkoC^pPk-}-xe{0arDy>&DlC}blRt%u$JZ3pLMFv9{(CRIz5iprlsN$z^Z;;l%By!i6vjAuaMQ2Z zIpFAjfuo0?y308F5ODM|{=^j6^L+nVJvjvkD>dLQJ~ zha<1val|yn(Or>OuR&h@UsnS71Jipkj-G_P`WE2miQwq3@|tn~&e6BcJi|D8JzZY? zba3=-{yvPOR{=+#1&+QKdG!J2c8sHkfTLdkNAC}gF7yuKh@;KN1xFvXWI5yLPT=U*kXPRg9KF58R>sjYz|p;RdG)QY zcVHa7Ci3dXA+P=l^6L3cgBVA5yp^Rng}nMZ;OG-i4rCntJUIFkaCFM6Kf7@)8)+8D{OihGO6Ttav8Jc zo$#En+@+K#Wp9OyC@VKu^FFS~k}`8PgEip^=UvYnHiiYPc^eyheFuF52S*vm2znY`pPfZu6gQM4|k6z~MGQ~>Z z=+O<(hpC=+{+h7TnRlUMR(#R=0?%}oS6^$TC-2>JznBh={@A?!_x%SwY{0g6BQJiI zAA8JM;OHfN8}rx4?-O@|qvwBV$hQBuPkpfSC)FeP8=v-wwElV{$1nbzDcXXgf0DZJ z^g0iKqX%?B-M{WND+l}V1BqV-sk>4@g+EV-FNo-V@zwj{dL;Iv_v;G0cnvuE=A-^9as^M~x=*5xqi5IH&+_VL zfurYvqpt=>-+K_hFRrx^M^A(o?*oor-|#d$p56tH?g)-v6&$@z|B2r@`ek_Wcfir> zRrdJq#Ww&)?+Y(J-_%va^&y!TIC@)f^mE|o1O6~&96j;}FCGQ10P zfTMRFzJPJ`kZ7ei%Ha?7v_1i1&Js_?(U%R171JtNh}Xfh2N0&^Og%+!#Sl{K`ysFX2=eNeJ9x7Fy^vSmd%2%j2#&rFdG%GBdyAXE(HA4H{`T-Xq6Ij*KJx07 zzLD&8#vrer9+NowDx9Zu%5i0{xia$V>1Vrvqc1^TJ?%prJq>yF#L?@5qt5|HPpguT zoEv?~JaF`9$g6*XIp|3Aqi~if4356&q#u_Aj_%*L0psY8(D!|)F0Wpmq|K`jM_&DF zb z(B{?m1xK&QtADttIpgT3bsRkp9KChHE|ymx2JhVw9DNlyx_GUK<<;x8(&p92$9~Bk zXMB(4)z3v<{TJlbw+2VwV0cAC9NhpMeUFniufE-jGL}~_1xK$Bj!t>?Wu9*ZuntK+ zIC?BN`ZsX&HkU0KN56=?`t``GU*Wi(lYV>2^6Ke>9}bS51&)3;Lz`Fs5FFhQdG)oC zS6_RSG2`fzS3eUR-5+`NHw#S}N8cSYpUVVC_XbCwv9bn796bYh^>2|^?+uQgQ2Vu} zAzn-24;;POl9!q$*jB;OGr-Y1mR@Fg_37Z~0yz3NaP;~n4_RLQNO1JhkvGFb!O^>% z`ABym}hTXq=KfJAIVK#C(ijG)}DpN1u$m`i_-n zX9Zt>%$B_(R)v2?PCebHWuu(+;kN7i#PL7m)sF*5e+rK73WiQM_V%!EKX-ok)f_z# z-dsgqJ>Myk$%RP>A1+FFW$TH^tAFZa#nvgWevz{^ zFEtRA;OHxnS6`A|TU3Fgk3n9&@q#*R{XO#P&s$d(YlEY&L0&yQSH)vaIvgb?gQJ@u zuRi^YN?Z?)-UNB|k8&JE%B%l?y!z@>>xu`!(T5_ho_-g~s}DzBJ-s%{t1pDB+^4Re z7zQ8R@0c0)2^`%P9DOf1`r0!uk+Y&Nxu^5d!@<$LkHj*Lo(ztj+1XsZ1)g8ihpkv% zeM4~cA;_yA1CIX9A)0aY=g6!7fV_G?_~;Y5RAwB#?&L?p75M1x@X;IGT_TW=PJQ1` zBCoy_dG*ylwP5E-L3zs2j-^ajH7o)UVU3|^p5>*9?j@~MnHa;Q9E$-oZI8VQozyu`;<|B zn8Y6(-3J_fFnn~4#XXKV`aE#-6mWFv`~G1{7DqmM9dPs);ON$t(>1D;j@WvN48_?gEaU3yvNx zxyAD8?|`EZ2S*ihT5@ z==)v(jy@P1J>>RF6>;=Y){*K3;OMU4=;8V{%tyBYM_&w%-UuB1ROECO`RLWq_kBD# z`U-ILHG5XGyn4pubORE7mMik=^T5%ofulcM@QUTtJAtDQ0Y~oujy})p-S52m-yHqF z<>>VBA|IXp>}i^yp`NCOr|{8lBCp=?a*Hg@@+M)l%Hct#sx)d%_ zUVW4NN!e1qaM=F}l3^b;zr~HnJJ>(J8Oq3mn}I96d4e4X*p? z$?t=sOTf`zfuk$+?FHiK)c1WN^6CwcS07^Oz&QFHaP-sQ==D0h)7WozVH`aX9KEhC zum046+QhJ=TfotGA+P=&^6Jx!tr$m7)#cT121nmt(~|kdVfYSJ#t>+`FCjzd8C39GyOs#L=n$Ld9pBKK~)$=#7w9-)UERR^?Um*|K-t z^Wl4uQ&0D4d9D71@M*#a;SM)zkI>aC9@|)%Vj_GLBBU@schk;%)#U%Az+OWW&}EBCo#p%{K!1 z=#*Da>%`G%pZR-j#UOa+uaQ?D_z=h2y1e>Df&OAeUcL1g7uNT^HuCCE85%Q=9*4Yo zdOa0+^${ywDwsOA&Bb1%y!vLyt6ze=`W?ut?~T0rkN)hqTIL2%eGmA0Hu(Auz9r-9 z(~Y&BdVlcsYVYs-M_&CfyjR56-+`|efUnO3Ump?kP#{k|1D<*o`1&mH^>p*S8uHXB zuih0b-2*KB;>dlBubY6StH9EafTa(+j()MYwjGJQ`V3uOed^`MEU!KqdG*b7dG(uQ z`&I7P?+&>68|2kDMP7Zk?O!>JO)`%?SB2-ut6x9Ogx@u_oaNQW999Sh`oUu9xd48H z-!Ya~FCwpguP(2C`3@=L>%)*&e;0Z6M#!t5AG??F^*YF_Z==hrdwpuGALaPGU{ z+}_~aQJ!X+dN?lhhcB)G=RN|?z5DQFO)$0%*7@S&!MT^O%wc);Q^2{0Bd`86ICs#& z2gKK<2H@Oo$g6J!&h3=(o`a_@8v)L3q4UMRtr^Vn>T5hcrfIz;P_TwCE}WXn^6KXc zS(@tb#SegUpG#WE^6Cr0xi^4wpZ)Sy*p%>=<<(CB=k5W{?TNhlL-ne2(U=#akyoFC zy!uMWs}E{EUO;}KJV3|#Z-Mm}s0&zLy(?J%Hn9FwIP(VUuCu)Q4PfNgb&TBUReP3K zUj>XjP1n=?&wEYjI*#Glqn(fRHJwfUVfdC;wR!c2kyjs#y!xZat8d_WljYTSMqa%W z^6GmduYSSBJT>LjpG98%?kH_u{ZQAP>VbHDe!9H+g~+QP6uUJ0cV7MPy!!vhtEWMn z23#7T$I#%e%c~!byn1`&)vFfSW({7nFN~Hmo8^YDMNU24r{!aVQ{lUZ`-pnoCulC| z^6G0KuYMNt>W3n$o^BOWAzS|3`S4eBd9Qx%;&O0#N;KZKHBzjp%d0<6c~0!BcgRu$ z90Tjt(>A$@^>ummTWhos*MrN~MP7Zy{;|lbr|tbfgX$x%o*r{KxIB-PWXm4S#7uDc zBIMQ6_8<2lr#%FD^)?+EGrzqv^6IB`juQWBi@f^0{BU}mr@-aCkXK*vnrkDk-sNvU zaU8h(UF6j_mT{snxO`*e)jy4^%eZ_$R(KE`_AQ0!*3rAzx~I& zdg>#;99(`CH{yFWSNg`ntUOqLtGamp}1vqi_RUp8CkQxSq@M>f6OD#Y(<^s2_9<5F@rZFfMOCJXRdw zVIgKBufF@m2*%}mgUi3TEsAmZQ{eKx@Y{QW%RAg*EJLBm_dXvFcU0%H{xO`I71-jm3@D5y_^6JZ~MrgL~%Vl}>$KbcO1eae7 zzdh|}4qb1OJph-dy!tBO@+&6qW?X(gxcqD6)#t%)*H`XlTs|0FKG)Ji(+OODLE;d) z-Xv=XF8>l-J`G&HbWC?#Z<5PegUeS#UVRFNg+Q&ba(ZaQRu_ z^2@>HL$1D}>rGNSm+>of~9^ z&rVW_Z+-YG(!Q_n$lO{c0|ME9$ODedKRkjN<1U`NsVAoBgBs z4(&@t>LX9<%FL(CZ>RO{-@Y*}PxZ)ed?d$+%a^Iz@|_!&hmjKK9r6$MboQOGU}`2u)+xj{IKk z8S~rkq$l$Fab=*Yj~4!`T9D)eQB!# zWqzdrD)QUUz;7om9|$h5YN7h>w-c8Sgx`K9vOeSTufXLq&__NFT>ju$FXp$80GE#g zmk$P)zbZs9zkOh1EtkK@f5{$n$e#J_OZvtOZ@}eE&L?Zi%U24-}7zPlw-r5q|sCz4y<>SHSm%KF<$!~uOF8??Db_x9U6+QDAmnXk{B)I(F4sTU2^e;0m-w#~gEijPJ zeo~3|HyN%bF8>x>z8C!Vg7NKn-(>@t-|qNem1g&(GHxOI$j>(E&;0i5@Y`p@Z~qD| z-_CUx^V<)C%WnjiH={oC`*$(F{VBNoxz{(spDc{!tyQJWZ#RmRs{RC*UkBbk#Kc&P z!}IQQXsX%+E?*s7K4Qc-=C_A7*`z)JE^m(gMm6*niOcr@m*>Fcw}8u=EM5NFZ-=e^ zKizMqv5fro8yMqgOr-IM#;MpkVT$NdbH%Q0O^-f)wva8$FZ0UlpR&W~J}uiMdno;$ zm5Qn0@-;_x;u(Jgm%k4#Zx1FJIC%S4XA5p1DbZFX4xQ6v} zx4wua;PSNnNRw}3k9RHD&kpNbEc%qU5UK@_!mz}6dBjOUZP7kz)s&hp2i-y+m@ zj!ojbE-x1k*lyH#G*93s6u%Lh2H(+)&FjZo_9$cP=l%P!$8Q(WT{C4&5&U+x|5)@;1PU{Ujp5hbDHE^VE7Z75=*znW zn(&ADN~#*FwxX~8WBj`s%6gTjhy~u&)W)lVm3yv9j)6-UO-`R6o^9A%+4u5QRpv?k zV^oj)am3DSuTI)t@%`sd1ZUT?TIaVY`zGd?xQx4sxM!UNv`Dbn`%GU{Rp}r~#U|>z z)mMs`7tAKLQSw`iO~m1ME_40nHszgke_h9;Gld?XhVn+msiG^6i}BAR=?phLug!VY zt+C6gUdtk~N==^o6wY7$JVq05cYycCu{Sp`f%`+*hp(EZ7LKQNPj)q3$nzP`P^>Hp1kqpuAI2qpXLRF$1m@4mG}3-`zDb%e(O)Q$1)83V$T{K*fuMd z6y~PSIBX}j&TYvL7(QC1@Lno{sT&=&Fcjv0uE96h5hlidcuVIv#z#9j@Q4>szCFhy||I$kA!tRu3&5sX?TvwZ5&b zzMh?x)W!}892Vww=p2b&kk+o~+JQdlQhjs|cD8j!XAwj65k_xexuvCz+{wV$z|h#v z&dCz)3kC*rJqw8i8Wbb)!_3~!9({?eOdYHo9ULX-S83uZaka9xcaS(cyGUi$Qhjs| zk;~+kasxxTr6U?#;`50fmiR5u^wGo=9XZgN!_~yf8eP*R=FaFbY3uBQe(4ftmmfPm zTF}2Yejn=iC_x_%>iVc{OiaBw=pMBu*2B#JLl*T9F~&idoZbO!rLO4ILxdtr^ln}0pr$;jwvPUAQQEhjG3SMo>G!stFNi&xxI z^!V~Ye3a}aygxXc4ga(C8>&_Yv{h|wSEQsHy(7A>pF95lf8fU=c$t9fGd%d2D7oc! zgx14*-4}fuM+$A$Xt&co{H3Vx`_Ouw^t)m|@Z(LnE%@5*C5#_;D2U?cEx#ewAEwUs znl^#|FtAvZ+}@MjEo@6*{CKs_ z!zO+_Ix&iQ*iNg;)h2pUO_Sp(qT@o2dD!Vi|M270>3f-nZFxIGlL!yH*OLjn=a6~q z`c%tX8#Q0yVc!Vft#W+ZfnA@90zbAYpUb_thU~2T=gh;7sxv}(3x0e&x(TPYb`Xgl zw+BBifrtJ1W^-_o zXAd8YzK|ExvtJ2Zixiw&VT{NBfA>4bXNo?P|MJ-`)P4Rd=PAZ#ZdP zk>XygIGc@aoZoe?rtJOv zpHJ^`us^*2mvW>t874DHo352v=Q^)@)rs32XJkAc!PcF<$Jf844r3$SE^`n2Q~%+7 zo%k{B6FcPv_psGTE%@M)o;ZU2emR@-W3TRY+1Q}loFA`RIg%aB z&gRURUdv>6#=6794qEFkFV;QB?={E6?g&mi2b|d2T%CpvO`Y_lS8O~or?-F;FPftl zQ6kHT$J5V;e|5pnggEgqaANb$JhJfUsZ{MlP3~dehljltoOmuc@&3q{0y;49Ex@i(IJ=jvFi(&OPh_$TOGVVLQ#T z$|E~^FmPgZe|XqO;bCuwhrQ+IBSxIK5c~!i9(E6S*yVM&{>C;5Jb5xa><;j-*VcH# z&<3eS!^3`1X{j^>9(I=}>6{ZcMxOaVc-Y6_VP7qGl5^r#@UW}E!|nhN`{o>HMx1!y zv9utWvkpI)T6XidcL?GX611s=B38H2p#_)YF% zo5826BG0@H`1Fzwuepc46MQ<@QBVDl$7Jqdr^Or;>wQL^`Pm`t{H^3N`7Rw(jf*$1~x)gSXb^TB*WV`tQ0&9>$|w`27hu=jhP$uoRwR%R?Ge zme$2oXX2s{Jj49@$EGa#@N4-f-0O$B&a6TEFZ{f(ECbkI#h>yF^Ia}D@1}1&!~Aak z#{4-%z1k$wd0Sd{TD#ARmOI47Gqrz7yj~|&o68qc50A^qGcP<8tPk^5s6P30@LqXK zUwoE%!O)lSJo6SMYuox0@12;$(3ffH=XD*t_oL5bG2feJHq3d_9f3E{-@$tizyB_y zFVh4Z93&sTmzcWgZf{}dHGP^V+U&^uW2AIf7kS;z8m#=m-(}2sQcuQs$tiH*DOJy; zj&Af__NULL___+-``S2L%hzMz`p`Xomhh@+a>g6%GUdyr&dN*`<5a> z_G_Uuf`B+*NJ_qhn+?=s|Oy^snJVdyZT#hBkR)Z&>~*!{=$|VJh5R=d!bsa0peab2QI$j^36l-?ZL$?$pF*)ok5lm0O-DZ$F}llAFBhAtM9U zv=kh-D>!a&+s0y^lgns~+<6x`?k4!vXA6!KI~i9ojFCIPSsTsfJdBf9uPY%MLRK=k zYt9Q=M6)lk@$%B}aNEVT^BLSV)!6-cm~(hJIql0O+l1f7v1-^hrMwT5y-Ns3msMr^ zJ{H)^pe-sM128*_aE!n5fZ*3S0QPo-ZPEhnNC3OVHZL#3C4P)f0@QSFncleeq zf1yNnYw$JVy~@`%BU>{6gfKM0#)8TmA>ON8QNx3Mt=>Tpld7_<-A;n{YLv~Vd9w3{ zCc+=qsw~X)4E1HokZD0|)1uyj%lI;E;nuI5_g)PS5Ly+Bk}D67Wwr9$lRDtM<18-( zryf=1>?h}hMCDb==~F2-p10MDC?ZFmjbq*08sHbGRZP<=p>Ep(@{Y_htY4lAa!+h? z(&;_Da*DoUVQ$yud!cG5bz=$uqKrQYDIHE2`@m9tTyF=|XSLWB5KrOr*Ka#JbI zdPI*PfW+18>TY(|TM!nab+Nd(TijheGzNp#;^AR2d6+bw?k=8scP~#DFBc~~0s|>3 zlgX^~(7Ee8&0g*vo?b{IF(4Vl=wdM#EgmY3A;{$F8X6Sp>X0p;ECqLpUl7x2UiOJ=%bq29Ll1lw%0T z8ACY8MZt?iv0a51zvqnoXb6asYYiBRp@AJL1xsaPJ#q8mgFreQlZwH*^C2Ej?3pv9 zLn*dK{0|N2nD7`nQ;s%3ZqDX@c8Qq-ghLz8$S1&oS1hU_jOl$weg(hrX4US(#g`{I2fjS(gwQJG80WyW zo^NRu=fE?nO%;-+oaOuXDB49Ro|Gv+ho2p%9wT_JJtwb&pItz+SLkuzs_X_1y!y&A zVcE=w{CNh*!}u|Y0~h+^uu$Yd27k`xBg6P(JAeZZm^PO0^Bx>H*!j4y*};M1ZuGL% z7pGFcr>F-GycvErap0Q;>j}hx^TN-*h@5i|>s0Z~$D5o3OGlo>`Z@gUQF%)UM)Yw7 zz=5BD1D^#4UjNjOb6`6-a1c1K8ad|?Zg$RrJ-~qz;Agi)&iR~}f}8`Fjm+V|6TpFI zJ*>hxa3_bK{TdwjZeT^ufp>ueuK)-B3=TYMj*fHSFUUD}0SDd#4!r%-842V4ijZ14 z9Jo-;uc=uh6r2MufS>&Z9JmPl?9r%|P8|4CcQ-l9yR6N;yDodabRp-!?;GpnuPuDV z`{2Mj{d~@W&%@7d1V8%^aNsK~4sZ^<92|HIIIz)wm5@|&4(Gr_-W1zY3LMxD4*aH; zD;zqF<^eeHGjQPi@UzRdN#h)t{OpF{z#;In_r6Ty95_EX@Lu@YrQv5MTwl%o?Bd|S zZ{cT$!_Tg@@wh~Ob|U=j1IRhQ0uEeek6l6^ryveI9~{^Z9Jq4%-#7kZXVgYx-me+Y4mNnQ*UZefX+u`5yf2593bqW4?y8m)s(aZ>N0<=S}77B8O4r@5c~@~|jOe3T`ZhM&Fj>ki><^{eotZ;FRHE)&L{$XRdgyHt2M z@q%0ge)jJC8~M3%k9n|ZHm?_6A*8=>=G$#~3H)rA*4upZsn#e{NJS{EKCTP{J>h*9#wTY_sqQes<}&lh)1fvqO5$!?lK!VwJ za?aJrIgf*%y=y=m&6ibY<2q{&a?Zyf=lo2WN1R6tf}gz#es(_i*&{l)W`1b*$06su zy~EEgy8b?VHnpB1=e#jk@>%%V-}Cg7a{cTh@UwTp&%S$MDfhEi!_O}6@UwdrIw+8z zT>$mM6X9ofhM#Sl6UKAShhzq@q%Spu@trHk?JunP4?mk&GW|Y@B?md`g>QhLt>{*q z`WDMo)C@6`2&GGwr1^(oW~_ky1tQB077R+%x!NUb^SJxJ;eKRdYnm6VNn z!Z=HA4?kP%J|eC^*mTS%o@1qmfS(-(KYJeh?1|UAu`)PE(x4naJ4IVdTJW$8v1G+5 z_}LfXXU{QA6q~-QN-SB?89C=~;b#x@sc5@Wdm^!9OF#J8b>U}c1?y~^ijCtr=MCUz z+u&zkfuEgh>%w!+P4Ke=z?{dx&pvXZJK^ z?6SpX;QC2pNP?f;9Dep4_}P1oX?V{05!4I62S2+V{OqY6Yti+S!ObtxJ_>$zVffi~ z){dj=Cqtj?Kg31wv&+HH?l9?~4cAYGzNi;I0)F;l_}QC0zj8mDeh;~yR_Sk%{Orld zIe!j6I}iNq@~!9boO7xdKDFs!TP^t619mU?m2>{f&;FnK*~9SmqAnv0fA-W(yh2k? zU4sfa=bw}l7Be=9R@!; z7JhakxY=~eeH;Ju>#l#Bua}_Q$HPfd_VILqucKZ#t zq4jynBXS+^^-Afrg!yC6pw@V&17Do03!lE(l)qTR)721N$)Rk zKby9}*XHd<@9?IaukT)&<7aC!yW6`C>&N+ez_GvmZ107M0{Pj8SAMWB*DA#d;OpJC z`t$yb_RICN$6i^;`TC=W%f*-8Nwy^L_4zNAygwWFaE-Vde7$hht+ob&H|Oj1z}NNg zvqRx$3l%qUzJAEoS6YO6;a?k976L3+rBL)CUyyUY34V63yVcOwoZ@`_4EXxFhYG26 zn=4nz#)C+I3NGYD2>(BXmQTW-5cbu{hQOd$C|I@$tIv>}`sTWS~NqYa&`#FaG z798*Y0QlL}H|2}p;M^(<*BP}tSh&Pat8eDtb=oT!;l3( zyE^!KN3eCe{oOG9-0_%yo3F>FX3J#&YKq+6Ezmmgb<2`dLVb+8&}$lfDqUC_YL^v7 z$`%Vk`S!x# z>s2505mwwf&iOi>R}pvWt-S5L|n;BB|Nb5d}zWpKW}sd`7@?wBL;=5-Y$vpHP|t)Ag|-5q>=$fS*EgPgdBJso^~6!?0T(~o81>(#*56TsJ3fv;OmH2bf5;q-GOzWxGy z{Q*4eN${|@n+I~fzTV+sPX=GNM@;4(_6G3v8{q3c;Om>dm6eG}Ob1_g1z!&WUpLIC z$eDxyMCgUTd{pAimxOeBH&qSlR}@UZ&q#&exZL zuV*^yh5JrE%j<=wfv+C`U#|+j9%ett`T9ce^+?nUe*?a*O=dFMAa!f-^+Dk4Y2fR- z?hDigsVjl6cLrat1irqdZkmnw`X{*F3kD|09mea~C(IQsfzPa+_a;at)C+%vdg1d9 z7UO*V1L}o024C+5z8>%GC&l4-`M}pVgRdU|Uw?IAtBv?Nxz7xI-44DU=bppY1HsqV zfv<0b`}|^BYtGlRz}N4>|2BfJx3FHYSH$PeZ^${ffv+zEUvH&0lZR~>Y@}6!7&{;Oj5of5#nJ!TEZ2W(5}WC{&6CU$4Gx8|Ujwz}E{p{O^#nf0Bo-^}L^k z@>VfYaroaKH@I`Y{yp`8_!$284*1^>KDl$g?ghSX24BCccq?sezLWEH7w3X32=&5e zg0HI*q8UC@D;j~XHw9nsf%lea(G3ZoskMK=cq`-J>$879ModC`0(`x*!{PpXIb8yi z_?2_+r!WQsG`Lwj%f&g>oi@E_5IN{L*BnTwXT+tk)Kr=;YzNnUCf}DAy zR2JugVw)L{%PEcL$$J-SW~iCmhh}vN zHObtnP8X&j=ln_I*KyW@@_}kIofBwTUCwL$ws~DF-KXW@Yr)n%rO(SNz}J&r?%-Wm zEOO3|g0D9OTc;a8$IBFI+r9Q z(Pvi2`jI+kIA70uww+LKUbegeeEnOET|f3WecH>n_XN3VHhU01<`S@WjXF(m+3`T$ z3!nOO5s`2I=RU;O6;t*Jx~Th{wR;ZVE*veAExRJ;yjhPL0zJhg7Rz#9eh z5?n`Q%46YEFP%L>$fLX?yTYgLA&(W_7rZ8Wg0xJvV*Y)Q5 z;-<}g#anI9GI#}?uP=7^)NiIF3As7v=fT$t1WXnSe`#jL9|q4kFYMs!UM;e@PdydK z?f`CH20r!6_-q;<;yLGGcN0^?;8O=~d&)mgmx52NGP%g%@Ts4-sP-Q@=h^V7FU&}w z@ge?UEfzj?5BSs*EGubzNEHU3x+;9?bokUu8%NUkka8Y!&OIDHb?9%tGRBAWeIKlm z4#TIO44+z8q9e~akE~;rvx3Uo6WT<{arqX=g;6g&uvcxlR+y_?0zUPZD#y4_-5Eah z`P07k!$+2j$F|>>F+QZZ1)o|CpSl}->UfP|E>tl{F#)niUaQJL+cvs|{ zhYXxV<3r9n!Qm%@!@I$!KD=TIjSo4$gHL?|KJ{GWoX_@~%3XuQ4xhU0z~Z)#sNIcXpD6~kg#SbX>|pZb?ijqZ=WsD-9h))%dNZp%$AaVhxJZHAPMD{EhHVE=;|@wEJ0 z;X{J$Yl&F8Ps`br-y~GB-p z=Nw&;tcuN7XCe2g%OKDE_3N>`_BO3wOdP{~YFhuaU}0{~xnkIzg`A`BM9%rUTccz% z>V+#_WXJDaGm6*St%IC%*9wC;pZbW*-~u=La*j^xjnB>I9Nmtb^O4eMzJDIdIUhNW z*9+f=obxJI$8eu|0dme)KA$3cfTMdO=luMU1^ju|N6tANlQ{ZHT&J}58O5J-By!H_ zu~aX733AS9pSR%XlaX`22^_r?eCmD3Ip2E;Z3RAn`GTYO21kE@K1e$^Ie|EO1UUMA zaP-f}Io};Pn{)K1$T`2Edn>v}jgY)MLVS9RqaeYPX#T#KCZ`tDVE&Uq|y&g;Ubz5tHiGc70Qyt9L&Uj|1X^1KS?=zAO- z{Wv)K^);Ci)e8@SPo0}{E?NZ6(T6uLo{$08sdCqx3N4;=s#$d7V2OH<; zdid0L!O@+;(Vtx^&N;doKD7sY>g(X>r<05R;OLZd{uvy-eEV*kqo;wRw*W`~2A_JO zjO!irZ@$Od#w38F?*m8Qv?wR%{2@5{AK>Veb3Qq%#}AG^5*$4rIC|0Dy*Ni-k9y(9 zz|kv!qlY@r;2b>z9Q`#odMG$LD;CZ<`Y8uTzYLCkd!zRcj=l&S{r%f~LNqJ#gQI^2 zN3REte$_95bM$WD=!b7yiMN8I7b_9RIr=DY^a0@LU%|)kwmHmm&V5iXJP{myDmZ$B zi;*_s=p}@;_IBXtov`2YQ?KmA(OZL~Q@!vR;OGn6=ljLcaru*bq4dACUO2U7#L<({ z#$};Rq~LYb585T zyy;xc-w$+f^duoXemLjo7UZ0#`p=PL!O@o?=REJIDRMkG`Z(mA@BN&!t~hbs=4~G@ zM}woUM$S2%EBBahr!SNTA?Lg(a?TaSXUWUJ(W@cnynOTs&e1<0=e+WOsqzkR^r6T( zr`JL`=Pi(PPS1@vy0c$JTic{@oTC>=GYU_@(M!ghw5EWgcRN&s#sL)}nbUavj3dZ7 z|1i8R=jcO_bAH5;a~@%+&pEm`IC>az&SOVs33pxRa*loy99;>HUIHB5r*R+79r})b zASuDo%Yvh;EBwiG&L4xL4+Tdb4UYa-)FOVJ)C(MaD>!;MIC`N8PMo8cNZMI?FgW_B zYdx9A{+yiiv8RXgdf_*~(PzBQ$vJP0obwEDbRFu2Z;hzMIr?yL^upli#gKD;_G%B# z(fyHgE`XzJFQ!O!1J3iD^K@|ZkKbzuT5$AvSrz_^qtow`I6CE=Z$ZxaNpSR9MZWQz z^X1^^eZbMr{^6b4?!`3D(N`en{2(}bPvo4N)Jo3Lry%FNJ~(>wE>}{DxqRR`=keg^ zefAHFn+1-(^ILJcPErJbqvr)jFN=ENh5JO%b&_Q#a?Zyi=e&ikmSkJ6pz9<>32^jh z;OHHZbG~tqj;@mw)4m~z4vtH^K&JS*)Zm3IO&mSp8}2^29DnQPosb_Kf`En^xweI zlfco%#w)GF(K~>n_X0=X0FIvjoacXW^lf-A6Gx|d;r+Me)C=GA3Uxiu&r!YbV~q#f zI)kIfHYom!qyOUQ|5J`mO(o@=ufU&u6?7BS)Kk}>21kF6ob!g$mLG`OzbKBD#qW71 z7>4GHrTet>cJWDgxoC!b4;;OQBj-FB9K9JhdNVL|y8Yd){^a?~|29X5qr-EaDchOW zb92sr``lahM$S2Id^^vA<~ip%`%upLoX$NsM^C;zGU3$TQ9p9do3?8uCnM)P>v1Jv zg3~BD4IKRea?YQmU>|Vw&&WCVj~pfU14maBpOSF5P(RrSj^5(Ga?X>`cWHE8>ix~p zkN;JVbM*PxmdnvkVjIT&lb?gNfqkvMvZ zPdw+m=s$AKPwy?vIl2-Y{e~mwy!f+mJm-7{a?Vr1(O)3v+;96jo^xIc96bUYJp>$m zt)?R9=$Y2O(jIVhBRKk;Is>Fo@SxA&=sglz3M;d!33Z&=)$T@$5 zobxKkId6aBKF>LC1dhH=I%VICoO5Aazh4~v9~_V(2_w)9@opavxe7G2lnedB-EYcp+TMFz=Z;h_CNO&beQm zmYkzg&N;28J95syc@L45;N^#qbDoiB0?#?`P;k6$c*eLNIp@}1@W@dwJQg|Ug?jYl z9K9ZL&guE&=A73{PUcLVUYB{)&>uPHbC7es13BmIkaMm{E|0d!NfnHo^R3|PcJTFE zsE1B`eWkuP=j&8Qd_c^9=bY2ellb~=@b$;w>l?t=le-kQ^D8!o)419 zU!UyAIS&C#-`CEQ^YuJn>2Z#nbHk8)0-QfpJ>;CvLC*Puw;{6sR4ez_t0L#Tnj`1D zTf;oW*Ht&b&EF&Eyf$*q$Bk*r`Fh(;7bO3F3G&^kdRA~jK5CmRjZzb&C}k;mOGXqM zyW=4_f7*bz6{Ic5IrnTBBj4y-i`pi2N93H>`m#oPr!FTqU>45Tqmgso1UcthZdH*# zZFWc7q*32=aBf#{?pd?P@tkw5!z14S&b@5Z1DS}+xWgl#ReuD}Ip6mpO>DkBMw)S92pjLd zisziaJ8?j?HSZ%G0_S#eUCVRMdxLY=2j?F6{f*S(uj(uj$Lj}=ygEGcLdZF9e*PxU zIsb;7^XtetzjDb%?t3KdKXT6RgY{QG7)JiOItZ+PF<5^E)HL5;GlclMIvR|;w8KH4 zKC>0iIe!U89_wJ_rpXm~&iU9y&G$R~HHGJ#U%8r-bG{il=W)n6--n#@I^7D0ZSgZr zbmW|OM9z6wl>#E=oIgX(`Szroob#i3UB#|AuTMd}y;H#`c{Xy+H*{6mf90J2$~gy( z_XL>m!gtcV6$)yYsPgy%G|;Q4aR-s7MzAw-&RvjmzV>nN10E;L@w7BmADu88`Q~(= zmhG&`36r~xl|QulJLkLra?Xb%=e#pA&gsTalKbuF_J{vAm#_F})Q_C=iQ0v7QAf`C z0*p)XSCrMRbTWMgrZ24jHEtB=@+T~5)(IyU%4@*oqmgr-yMGPjoYVF$pg}g|oYOHW z=iG{P-Gm48dEWRP7*vIShe6>`r1_%@fH_a<`A>9NG+`yuCi zV#NjWdvN)=$T@F^oO9yxJCSp4K4;`yJ{&pc?~rp&T)wXSmFJurz~#T{>x&&xe|$@g zQ9ro+DRB8g@ZMXlYgam#%TvyIDss;64;%0!=e&S}%bVsbY|Rxp9cA+!0)ULbWNJ%Xa{m-*Lv*-uu{cQ4zY3bNQ>_@;Y$&A>i`1 z@>MvOr~2c^z~w7|%SRN+&$&GL_IJSLD}c-QjT*(d`~h%zH*onq;PPj0CUY)t1(z4W z<%8c`vMo*vr17Tz;PRsn72sTcJGlH*aQP=C$B7Zm3Ue+`Ip?Rr z@~8V1x3#KJh;#XS;PN5JInNI+|8Alu=khbbK?T>kq|%r6|& z(%K!{3`Px7_8@=by3nDxJE^oT&hX83daY9Lq&2u0p|~5IT}&#aNvSnyRjzJkS0yG@ zA?44_-J*BbE8UfdA~d_3EglxL+0E0#!$s$zvv_KZo<z#}UL4+@_(kOyGJUv5$L!GqFdaa8~m_AGkyY-9=e)Qh=lnFdyeD{kad3HBQVW#(^>h2Zf1AtKQfMT~InO$mE-1I1 zmSXNQ>7H}C(5_uSDHDD>t@kV3QSxp0&`#?$PNhpXF)y9wRyTN%AyLlxx2<=D;r6D| zTlnq!c4Y|TUpJP_;97MIw*=FzD2aI2!eKtFZ(N|Xw^<@z&se`l>WKQ|ueZMzPNlWs z`!61GL-=-lkn{n5`;yL21h?P1O6%dbmoMqcUi!|HEa390|`dm{0oQQ-fm{P zKwLf+TwZx3kB|l~Up`_J*oj(ka_5uS6!`5XaQUo)vOs?ONO1WI;PPqYw~x8Uxjgyp z0pRkX@Y`?1cN8!+)2R)(d};XYkKwngKQf7O&fj#;;qpho<+BwPx!;~!e_V0;VruhQ zRXLYG;o$P$!R3dFi#eBf0+-jrZ{H5TJ$U*E&gF~LFP@MNE?=R+*VO&}UUDw)2ESeP zdN8XCzy0O1r3vJ>zlGmE5nSF2T>k!1PtN6E!f&sM`s0tm zLxzi{E&TRb;PTbL<-ZiUVnc?Drb6u*!bWg;XK?x82eqZL*j8nDrg#EezBIUem2Ve0 zmsf+!Ur2r}cr9tgMy%QxOHS-<)i=z8u~{c+y>{qLrQ`E*$n@H^!wOReZ<;&fOj$hvH z;{NRNYvX8ndQVdP;!9QI=sqpazZ)92_vs*M1ai(h1wH38xB7w0zX6wb2a~5;Ztw83 z=PUo)Tz={4bcyPZFI?!yc0M~P5o8$_lO_0HuE*C8pLJzrUgzWM*VlWq?DRqsvG1}k z{MhH{BT^l3`I685*xO5|rK@1>w4PtgkRF4}N5A*s$NT_T)3=QW-%k6SJZk3abR0U@ z{B@BM`R()^R_!S(QT_2kUKZBm{9Y*@T;5dN$jn{mNLFxp?~W=~r~W*?-d~?lI$5rAtG=Egh`r~=@o@@?VAngK|-|eI1 zuZ6h$+on$hdj3>@{7KJ;LPXJl64f8?IZww-J@o8h$&=QV;PR?qZyG;T_&B(H2XOhX zyXtT*p9(HN41W7sJJUEw60GIa!mmdnhebCM_0&)3W;POMj<^529ym-UK zR1Zqg4_y8Zxcn;DiQ>{)LwWu2+2Hb*z~!f){`iKroq7H71>o}W;PR#*oz3k;FRBM+ z=>{$z4K8m7mk;Yxgx4Prg5Pcemp=_I-!UMR*B}1_T)sWHd@pc$-!KolPO@A;{qZPp z`A6XLV>&+LTz&$$d=qf_d*Jdn_GEIu{bi{{@fEmyWBBbp8_o;F<%<{-?W@4$UBKmc zk2%k|d^^-1pXsPS9=Ga@KwN$k>W_~Em!AVJ-%Ec{fQw`Jr{A6r?`7ih%fRIyZ7FE; zh2LHx!<%#YqTurL;kQ=?moFBCwh*k|*QioLM4=pa@=2Vv&WKpoX<>_~H3kZ}QX4gD zlg`D}&E#q}y5j=N#o40JTlBavQmBk-53{R>D`LT1_{Edi)9m5t;o{`!r15gsBg9MR zr89Y%+u?_hTt)a5<&4ub$50)yXed?WL(`9uI?74hr$DCUOK&p zDnRR^_wfl(xw+x`2$^DT8Yic4=Wr*3!Q0#45F8X76dD@t8VLO+EG*oV$As%CMINJ< zF~rL|IK-I8OY$3x3*QfaBsqn>ja(mqHodU#6cpTmPpK|#Eczf+cmoXfF_GQsc zd_q%S4qbzY`r{{ked6!B9@uXyygrVWh?tKr@Yp|&?$h#X-Jx-jnHwbH@*is$(VSws z8@Rmt{~!Ez{(HxDRKEFscwzX0-%IQ7Qaq(>`0dL}JGNt=o#&|@c+Nhw9^BViY5~7} zO!^tYe@qiealO-l>?i5M0Q(X#3x50JP+z9}SWlV(F7Fa~OK@4!M6!U(_i(u@Y=~+g zRRNcu`tgiVYfzBn4K6QV_CQ|e$eicFPek7|y3t+!=JJK+`tkhucb)&{^35@qn7I6^ zWpC}bkstr!Sa*BT-IX|(&wKlCzkL&)GjaLN%Rbm=IqHu;Z-0`{Gt2)EE)5Q-YVYNeNcnpE?Be>rH5 zQXGvM?35qBu19ydX!0q0JB=*-b>@KdD?dI*E2MW9y(h_U|L1#~-v1VG`Ei9V#wT~K zxxZV==r~#`BhJT9(XWi7`?PG{)jclz*m{xt_VNY3@Xy;1;kTCnm+uB9Pd7S8&ezW! zkNLO#c8}0A68Y`bR+$*B6PLG+@?{fFq+_f?q3E~3k1e@8T_nGqJ`dAAFOP!L*2a6&b5Uk zI&Zt%ZW4)`9Y$je*1ITQpIzUZ)hjedB)@%@n-5&h|9;Dt_!`!=_T^p6B7Jbm$S8`5i_re^japtZ(rf?+ZU_P zKNs@b3po7t@%4jve*B@UX=3D}80j3aee5O{k2D|U* zVE3a71@Qd%r(pNY!S2ny{dj&n`R&~ue*2Y$e!ueL|8M5UQ!_)&Btx^xn`AWG3($-$ zhTopvX=XgDUT^>9s&C?GdFtiH_&F_Aade-SZ<7bcne+6LHp6dkTqx(WZ5jCOhv2uj zf!j{Ef2IHWw>kPV=VsDGxZ&agl zNy(@>`!VCHFm`H&v!`FDe*3ah z?u^d$&wbLqq{r|6;K~|3k|kOfdmC8Im!~BYIQsOZ83H}e{ov?t>!0K6^qejIZVTrd z43T=lZ&!bMAsj5dO;UlQU&{MTaK15Lat24Ay;{Y>+ekU*-R#EbIOo98A1uEiOd57v zdJc~Mebhr?o}*s)8gTTq8C_9WK%+N+qrY|33vV^}H22$$;OODT`r?7DeZ|^E`v|#y z`&ozIo_}(>kjv3C!O<^*qp$dQ^M~L5(81B$9!-}pKBSofj^1VXp@fPx&ZO>5J}u$% zwB`&rdjC6#snfH23tdV&@z2wr@{E!Ez|jN2(XT!B`47MSB{=%~8}ru&t4dQ`=xHRV+48-`+zDPX~`(3ywY)9Q_+O z`os4Ayk7WAaP;%w=uHci6PJc~@_OMZ;OO;^>XQ(N(Ay{skO8cI_$Y7f09Wy%Yu`I6S5X zASB-1Gr--~4@vQ$@csdT0l^_*;Ssq}E(&~-;H4NaSb`xh48!CO>(GD-t-Cu0btoS` zHz!_;bpwW3a)x_oct?Z1H5hWq33Q>sHYdkW4_!skpbtg4P)JKogbNMy7;tmJ(2WPa z>oA0*!&**SJY~I8lnY*mV~B@_bIdqLPT4;SZ}G%^N{6@L=7BXzhqvG#O(4th+jCoD zYTa{NZfc3+z|qT0Gsdsq-*^A4zfQ!_(y*a!{KuQiW9dFEs|7BPOUkoVY6`#IQtcVP zYP$-K9_Zlcv~+ZNeDQOy+pZTy3ykCb%zCgTlNAai_$a#IHXfPC@GGSAi~N`qvXU2r zH?Jw>$AXX(-)%ssNbA>;6K`zv&`#?;Q;x|sz^zp+s<1uCgC7LmbbEgo-#!wI{OY!9 z>;lcw9->b+u`#hsR8;`8BDkpMy2%YQQpeoXCeI9mVNtS#a3~R@fNH%)P zS$@pXuR~dXWX5;8QciSwoS)S~W_+EoK~i$3vdo%-x_OIkh&wV%ve;P<<-J)MuH^clJ-TXVlSU2&6t*z;UZS~j`nlq*>**%ZYaPBa< z=8#*~6}MD2^mWGglOu)mRkVWZ%>MGmtf35JN7_}L+q1hp?h5VgZNxI!5<_37-%`Jy z{0f=vYqzYhuTbBkIb({ipIgPAFg21kT8GGkn;V$7LhYV8BUZY*cZj@fM5@iHtOxaV zF1@yo-rodHe9^v(>@O;nrM}KdjvJE@h#KR8t`}0nXO^SB&NvR7eNFGW>|&S;^L!m7 zqpwr!FhwQ20B2ut?OiHHer=dDrX3DPW%<*=ETi9G@lF4!QUUZEnoe%A^$D{TK2VoU zdvh3b#x#lxO?BvVeZ~Ig8?w}rhsfzryz#3p95^1tR{vFw>9$AF*pcpYi^0-ht1PU} z)1JLnk0z%B@3P#lWQO+#)k;xra@}m(vZN@x>>kUC6c_v2DMj4R5Il5De`OR=D7CD@#n+oeW$ zehEGAmkc|@zvLuF;ykeAF;CPjnAF&tx5XCC*PGHl+ zK1r>ytwpOma)~`fSh;gMrTU86ay$I&L-yvEjdjYh8->%XQ@T!&J7T|_d0^lc8fQwv zQoEq!hF+;tDhzs^L5GG>Ycx3-om`AAYP9nPSA*8wS>x`ib=Nvu+%*=BlgX&^@KEZ_ zZYHzI!|b6q>rtZC;^}Dtz%Y55+&tY}RZ0&~4m8OcrAp}pUZK}GX>~fiA{3~^+dEVd z<`w1@sxg_ul%6WH*~7!r$!IVdf;cKn%yu2xbj5;lPW94*M)ES|eGj3EeTY>Hag|4v&kqPQ_D1D6X zp-)K!_#F%g5HE{T?&cqHYFQO(+%E{r-ZN*}ZEE-NQ{%o)uhHJ#MdQqxS$ zD>bRcX2AJzo8l|^mqS_HiRXNrZLBzCf zx>1!Kapcwa3$4y5uf8gHey5P?jPmM_fz{JGWn^Cj&u>#OkstE`AkVtFmH2kr=gWuk ze4W@ko$J$&y!s?|6M6NE!1G&FsmLZEuf8~Ve%bbn{fWH#lHmE(7L{b9kylUa3tz{u zd&sMg0?#iuB!QnR_n4GdPoBMXYXnP2Uj2OV{O8^R>+Z;_Z)mH`Jdjtv89e`SwHW?d zD6c;HZhrpU$g?l_EH8_8sj7XC#@2A{@0-g@kVe`tU+FVHu^bl@cd#` zn{b{#96Z0AgXh=&y(Z`R`M~oZAg}%{cz)i4pE=LBf#-h(&o2g^U-tJ-oPUgmXa5B} zzcF}z5vStRhw;4n%JA$P!?SOknUhyP8a#g~c)kUm{e;1&>4Elf5%TJDJ^MCCYIB}% zbL7?E0nZ;%V>;*geZcc&@cg^Tt1tWK3hvo&1F0w!1J{}ft2B5ISS7{-sCE; zfoI=oO-^3@IPm-h@a$*9vyTXwgt=mBO*}mNCgAzqyIx5t{V7z&^_oi=@cfn8!{Vlc z=YO{y;XFSGJU;?FKMJ1x$S!RduGcKn!ShFf=Uc$@-|nnW^PUyO!1G^#=br-4A9JV{ z_w1X4=YImvU*%iTX1Otrd-jdM^V@^xw+hkOjt?2bJ^PyA`4zkxv(e!B7X~!rp8Y3y z_F>@pZ^84or`G45{b}(0LE!m&!Sk;Us?9xn!N0$~IC%a;@cgv7zQ`lf7^;Bh*96ah z4xT^$^<~cUr^F)Ruo=Wi)-PV5ApzY{#)-*V-@cs>P+=X&;Skyl?DJU@2eLC*8PZ8fqoO>#W@%;txG z@%&#r|9{H!si~)~p&$P2shgmtp1KBKc=q>JPl#WHoch<#y%K1t)1FC)nN~NB?$h!! z^6FENSDyu*A2pisesv;v{$%j{4sh)0_OJD;|F&nJn^)iXR1(Y0tEct3$g3{_&px}0 zV>_6qaf#oLeP}&5uYS-%e>RV@Kks!qkbi?8qrCc8L+z;->n5^>$gA&lXIpCVlVR)t zvcY$w9(=of5sdQc$+Q2u&7V)-#mY3%UYc0@4>cQ z&%R!0PF}t1s+_!f&j;P@hbQ&mJip#Q>cKBb@}p}qMYmNS?497*mxpJ6?*r!G;d-R* z^S|@z<<~iR^`Gu97yJ7r*=i!M{?q-AeEhNE{Want@ciDDw%YuC;<(3C13W*{kypRo zdWw7Yg-Z98s;unGGU`d2eru6V#|Nz)hF?Ni09``EzkNRuYNCh ze%8EFY~!<>y!y){Ls$VvUj5ah!F)UM{NFdDz7V#PXFn_?f~|7o)zf*E$gAht=bl97 zguHrMKQ^%{yV2jy>%ku_SB- zDK3=VM_&CV@cbSJtZ^#P2nS=TC%BKNUW`+kt1?r;mQz zD>e?9;_KnlN3Oc{UpzlIul^Ez`WN8&JHhj(c~#*){WsKue+QmF2|j(9N6R?RUk;w{ zZR{!ef#-)5yDt&XC&&Iv`RYSgf! zXW;p*B5!h@KNvj!5qSPO@O*9mqYQ13YA|^I5%B!B;Q8|mQ7i)6Wbph^$g8i2y!y6X zPxHL`>EQYEkyrl^dG)uh-j#^wQ$6^};Q5EZ^S8Xd&FjGz1bKOoz@Q#)S-{9UlLA@O;<&J2=nZ0G_`PJpUzle!&zw&#U(X z&p+qz_>Xiw%k%1&g6Bto=TE3Gl6_LO&ouGlt{AD=g&}OQVgTp)U(*kWvGDl! zg6CH>_UAm`xU>%251t?K^^FvA}?^o!^J-{kq!%uv%v&FYFDdG$%GHF*AX zcjp8Xa_YCI&fv?V+nKdhr($t*pO)*8SHBl|^)tcqr!~*{Y-NCG0_XFAZ|J;XM_(z2?KJLh?f3-$nlvhtY|EtoU(eorP zKB`3kU#Gl!Yxi)J@5{-nFIlt@i*V%C2OTTG-XX8v13dr8<&rEnum1d4^^ayfPsQhHeb7I=_~OgFiE+4)7w>|4@LS=<+k0mI@ZzsI zcz)rIek_;gQ(k>x*c*?6U0xv!TUVMX2IeGQI;Q433^Dn)-Wa~b;CyfuO z6yW)G(N=h>Q92_?}QisZ2a^eUVIJk{LaX$ zzg=oP_u{kQ#qUF2eKfrI(chnw@1dLuo*xY_J{>&&&tXr=_fU3%7hex~^|itCSJtY^ zz4*TH;!nVf9}J#f;;|LJhg#JdJpVGh_$lz>N9VsT5YN|x=a&S}{|ugg;%$~dJbyTN z{sr*-Kfv<~#&n?ZA!S#1@#n$w?||n^FWz&Wf4A{7VF`G?Q|SxBr^^}Ki?@U4e}fnQ z89aaGt@Xcn{x2^cz=XbX^XjQ}&&{iUjFz|zcz!G8^!Vz?sn7ShbOJ3;+|*n9rap|N z`?Or+$g6J$o^QQcfM2zp1JCyX$8QTSo|cX-k1u|1zc)F54z&7NJfD6Zg_0EtKP>Cv zHZ~(sa_?rA=A`(squ~0)_Vc5E%Uz$Wjb>-Fvc$PnuZxdv`>`r>-`UrK$xp>TrHbzm zmzB&bz3dXjcE5fnT1^kci5m;C7g8Z9rH)$K;TO#!Pc0H3wJRjKZjNNSa~*jY%r6;$_UDR2K=_1mF|Cyly8-vz(1_KXj@fs#`yfU$>!Kr>+)LHqpo34 zkUxX3=w`As7YhBkRajY|3u}^MAikkgmAx!9+?Oo~cdD`#;x(F&rrf@1t57Jiq0ntw z7gl$@EA?MWRT({NI%AKpsY7|zVAw_S6_t-(Ef#ha>myI~xM%xRY8W36T9=?@LqsQ5 zv`Jy+5wni^FXjDe8-z8VyD~-hIzrJG>l4s_Df6}rXQL9!vT6Z^gb#Nr*{J{8y6l=z zNYR1a-hbCtRJ(*2z4G@i`=x#7day1Jd!|mQGQw6s;iL%~x?IXzvk$9PX|t_cWO-{8 zUawE}IkvLx_S>tMAIXx1NVzDkC2IF-XPqGi+uEHN$!2*)(Y2V;J#?hp)o+#U_ihKR zhlU~9^gk@A_!TdYAsW66r^u9dA0)Afez zchRta)1f5Ht=6cYu8(DxO$C`HtG?9p)>N8%rs}pJo>i$B%C_8^Ce7=-g65v7##m<9 z`ql0y{{DCbYj-e8uBy-|JQ8Qyx-88rP7fW)Dm{vnt7BX52Q{rXR#?Sidq%SDlZxi> zc$2|JkH}qEY^W|ph?pm#fD-F8$UreV14bi?L=A@Rsx@kz-JG;;S|DgJSCv_#Gpm#u zceTk~qqeBbI*ZQ9&Elp4>2_Bcjb^hu;J1gnuZOp{ugVJtf>EbMttks8AwimRg^%as z>Z3Mkz_xWbiP6o~4KyCknzPp8?d=0fuGbqBo^ECzU!}^ZRCy@fJ&@p{P-$V@sWmQY zqX{`Gc-DlxaSZGXxQ(if?rS5!rdw$QXI18zoskDNK0enl0tXzCSJ&7!GSM6}JgSsV0dww)YH%kVB+<5~>e z6ifGM8RYI8o9~=f8at|hRAEL0Z+;)-cel0KU&JbSfQFu3wU`PrO)7TH3r6yBsr59D2HdRKP2WwcDR6#=j2b z>yb;UNyB=3O2)O(tnQbCVy87B(t|wFKhD+Rd<^^RX`)E|#}|zC4eRMG(lLj%uFQ(H zKA)=gPPVUqk1VZ+)n)pLZhO5r^(#K}zbc-dDy^?VS-9rev-?OjulTUbpDV~i;Q3(Q zl=^ikciAOD$D&Q4a;@J_&>Ug4=a7-|E+i`o2)yw&y7ugdrPR& zKStht#haM3GN7)GX|k%bX2vm6g=O0XYLg>R&lc~0h)=y;Z=^gkvk*g@tgbd^ome$# zgY~oTNcnTy!o-}_k0Q(4E|-2{JER{W5AR=$n6t9y`M&a!56i5hq{WimNwgNg^J|}{ zoTPIZA*?FVR~|etA2Db3^_MTiPSx|-&YDKZgI*RS=BzH<;k>ZnR3}!riax0u%lKF&-Ze5-z#L)aiaVmPM(oaRu05POw3C(Q2rDN^U8R*FgYjphP`utW z!v^N8UsLus>F(p+?B%8?q1}NIBIXF|cfJ2z*nGGfvpNaF$=AhgbWPE}wJbEVb!G)$ z6cg4z>}jKRI_q1Cuxd&-Hs#qPo2A5A8@1E7#xE3V#P;Lo=wm5LbA*+*DmL5y74^m6 z6pTuFQ!Yuu9AR_63Qeq$pGL}+$`wtiFfEbh2%BFedI`%84U?PAA8A|gpg-matF>De z_{0R=Y$!iju491}{p9+%-W)jMps?j_2lnDyJz-h$CoASssa_9AVDlFHFm0aALXEet zM9ig9wcC{@_}}ToQeT!33JvdKYk|4HO0=rz3D61Xw9Yzbl}?4pP)>S-8g>8l=mr!j zlgh<}CQjw->g?hQ`5BF^(d1@wF>7^Zos-!~W7fEt-CWErT6db(il{8LyIN^M@1QnV z3~m~wpHlDQ?}DTG`750ifeL3QXTLy=3IB!jnA{XW+5l}Z<{ zt6F1nRr#ttJbVon%Fy!h_3+f{Ty*{cImn#GKuLpx}_)ej>-frhb6F$h@Z6PHMFFG*wr}w>V>) z3hlZI_o?QhE56etUo~&<)mTywV!;-g2jzwv%|@boI^4`Z`VD8?cji3?^$}Y95A`Qx zXS?F&h8y)6Gy{reKGAF_cPtI~ADSIy;eCh^_h?QO^HXT`QofQ_yit?o!0iXE zZz9sH8S7f|8$Sts`?>wc)51T$|A})i>tbTUHStCTGNhL~nN7w_|;B=c|KDkf>s_OAD5)y~%xH5IBz zI|dbIg-X8{8y(ITUqu#XW!(G6lP_uiGoG#37oWNn1BVwau|LjL;dmv!J*{^}yg8yW z+idoNmilWe6jhiNGaxgBx`Z;o=DE7N6C^*nDbQZ0@jT{=|m+t$m*E-WPhzavGP@)b*iuV^F7Zd2aXFF}k~DNLCpO({J|YIwaHJ6$i9 zGu}@@D}?WPM@eG$E-X-6is}I?Co&lR+@KvXq8@Wnb}4Bu%`j@YL{OYFmAK@NL_hL zVIym!h&ettuo<= zr`+;M4{7!M%IugWnC9Ion?{$HEBqND?^`H}gHz6lH82i2`Dut8b*h!r?J8rc%YHKY z3gx5AgXD?+Uc&mFR;hKpT~_KVDlHi#S2|@9_T8@}EqnHW`U;nTj3IKftPZv^`ifG+ zBGatsE6`lRa-fN&$iC2E5-S>QqzbB?)G8Os;840K(VSw&EFuQ=2EEdtL|g4_az<~V zL#t#oXx!ZJ3EI`n;ZIr!Jl?FWkgG~pBzL}b~|7NNxZ$%dGUqwpWJ~y?2ov~{7 zqNIt9Rnn`C(d<(3Z(^%Go|3gV^5bUC5#`YT$KHEDHIcr3{~-xAh2B9B!H!)7LT0cR ziVeZu3l>lj8y2wlRqPF{*b5?}NHSxuSXNzo$G-Lowtc_Xoy2v2`~1)UJm=_h&hx&y zC(dMcNCJlY&fK5t^Svqwmn@OBdbyGCxn;4w=lPoax$T$r`+D3gD9NhD@4Gg);7IKz zLTT$d_|azN4L@nPmYF)eif+i~#zJ4z!Y@7WMBjA(WqqglmH3?dAM`#hSM+oID)Acg zVttSGf9glORN~tvuhCVQ*;u%(4C2qpC3@52gx5&aZ|TrP*shA?_w;HaJgBJ_;%p=N zoXt&yCI>(0m8hY&QCae4dq;Ayty_p^4wT00uwa$awf;=ym$p8w8?4R>!&;AWKztDQ zrQ;C(sLOcaMnDVB8o#qC7s7&ra9%~67vr84ro=J&*@bUO;ZL4v&Sh|A1zU+s_4dPR z{YuGLe%{z4pi$8H!C)Db`fUYYX9Ul$n6Rxk-Haa#~=#*HO!*zvItE^NuuK(U6PA_Rw znXUBF70MPH?g@prH*(AO#E3OJTceg$uDozBQ~$ij9&X#$ z1aSebD=;r8yH^>GJc10aUPgcMO`AX-^Mcb|j|trP-%o~FbRRCNv3^zqqo8zQ75&yfh& zB|0lrEY~+qe>b7DfNKb|VVlnGp`Rh;t{{S2tS^z#S;afGv) zZ-HaGZ>NeD=RfJ5R%lxApkg!1IK<-PSTVkS8Eun8dVPnfKiWSBZEY%R<&JlWXVVBN^d&fZD|W6oZsaBxs49hA5{FmrNna#r$Hs|9TC7WXdU#s6T3BL@ z$<+cmP8MDm3vF%P?7T3Lt5s?nh-(gTE9`LXpg@MNy_Y@0rChw+y=Z=r<5_TxfV^BQ z3d^-rSRe@suNqenRtQP5vB9)}geiO}W*S>p%oXJPxp+Cd;DvaaCJG6D1}1I7a1mix zX!`r&fhGjV4ef@dCc^~+O$9VL z&_x0b`83&391~q2*y7P>g21GPsYHnzO&c^l&;(&{_zZtL;s2T9;OU)5qalqTG_n{* zK#7D#K>5*dO{o8^(6REb8px`o8Lk^TVxKOhMxV43>MnEVX%lgN6-T84-cpSK#rbS%*u}1Bk5oDSJ#Z;Cq#sawAM7v zAyo{lv5irwG<767deYbM{phDs-E(ij^5~{QB^--?mMTsQ-=OQYv|(7ZZyfpP(w)^) z_|W4{!c)IVU9M4LV%||MvCaYk^Mu*bycyi;`H|uxA8WpP#uduKHS6heglqM%zqmX` zpM&23{W+i=U-)6VaNx{CuKj?10_F*`UY)yX z$4p4&CzdS=b5L?R%oCEe&8Bd1m%8!$e>=)8n>~_zbV*|A!F>4oIb6+GAzZzwIvwT- z42Bp;@gW=Im4&&bIl}N{)-tJ$0-1bPHc~TO9bkY}(m-vdG{g90p|WPHN>=77b2Tm# zuyBs`dvjYXCD~$431XevUW#=jD|;&`hB0%glhoGSS#9eCjTs}eN`=qP_TCnD)}D6u zp5EpbX0B#ZCs#8W^8RSV$CZFgfz>615?aEmv+}Zc@bb2EcXo4gx3ux}QmP!usq=7g zlSoPalUQK%wZJ1_Lclj7!xe~?y*XwkiZsO6tH_me!4w3d;r^X2M{5_P%8?)^!FOeX z45o_%`c7%gH!T|3V2>^i4CXhX1{(PdOGUJ2xI7?fPK6u3ZTwv5Qh^`?#raW`A4zjq z)y93gRG=Bb9)DA$AHfI1q7f|^(ZvE?CXg~mez$3%h(;0`*_Pr0p*M|Y7;R{T=}}{C z=;*WR(3v&)-8Yw6h0wOgIp@%Y55j}#K5c8&^9jBY>?f3d-dn$YcR4oRw^&q3`@ru= z7~Qr^vShzi^wapUNo%{rk1yqlx-O@6jnJ1ow9R%=QYTt? ziXOj5e7CZ`qf-+3ReAzU1_nlz%=S^{Dfk<+9gY3Vq4xYh#dqJ`;V(=^V;GAC11` z+2~7N<4ha+|Q3`d5<9*O*OHS*8P>i6q#9bg@Z{PV||mfRWSpD*~do5OX073H71BL7^2{PWg1Yj|7- zn72Uwc_{MFb;v)zkvTZb8S_B$wv64a;9##q{&^oTP&cgmIHNDQGsfii=u7U&QRvlK6q;pWDOBRv7co=XaXK^3O-NHuNPw*!oLB#?2Qj|GWqC&%eGJ z$^VA@^UUGXgmSe0g1+Q8T=lJ`RXd2i&OtB`+wS1CW0%P8~wm29h4gKmUmQ^MS}ekB=J< z4lI-OLjHNL`?+y0*(E&1yIM&&9IP!D{t)4|Dh`bO81}{z_46I<35e)H2Tx^04)j`P_rr6)e%Q* zFy7;u3+E{?=F?&kEg8|(fSUbH@-)o_lmS2)?w&HJWpoT__%a3r+h)R;R?X#=hkAn71L()k0r#I!@=zL|<~+C%2iN zt5=onVj}X-aXrE{KD&eY()Q>}{ygfaSPj1Pa`Yu{pDT#9;7E@~U-BnaM7Cdi^r|-E zMZQ=WzVu4;C8y^yJ!ZKBh2lu~(rWZ2uhr|YI3K=r6Z9p&+$@LnC4Y~;96pmJHnUV)21xd6ERiT zOCN+U-D!V$=1c40OE-Zp?EznU(WE^h<`!9X_|kphOCN_XUGBI)T~Ek$$UpA}UwV7r zOM9)(J279nJ$z~R7h^)kz?V)xF@X8f0q~`L;Y%+<{<-6gI3Cv%4i!fj^3MlawGbj_ z`ZHg82Yl&^@TEH_r|KSnfcQF;7iBBm!9Bjt$kON$b9Lx z@TEiGOTUCK9e5{}`O>z?KX->Oy$-(g$IGpmFMS8T^bq*c-teU>9B9RS>Gm!|b>-np zKZP${FhYuTC%K{xeCb&D(huNETgFY%U~WH}j?4kbnL=eChVcKX1Rh-!EVKmoNR_^`+_Ul?`8-hH;uEZepmX zzT_W~e|`sj$=z#Q&VRS&_Ym4%aG9ntLqBr5PursvrfK|6A7s9Cq_HpgMEKG@;Y)Xi zD@`}k+Zfv)JFot1UwR4pDpFr&>Pt@hroQAKt8Ec2;7jAijB)wg0tvL?)^Mhdq}0@OujT7!}^%n z9iuP3>{5d6bKGF&ONV~fmpoNFf%PSKT2rh$ZSHWa>e8~D=Bh3E8*&DJtsIt{*bTlms>@TJA~t3@yqvo7dM{vLhF z+hv&PLp{~Zmu?APdN=x#|AD^bhtF*M}h#-jo0N-lpG$((t9rqA&T5h0XUW z#k!%i{ascuY&`mr(|y`z22>2Qa#<^$gD?HY*q5Aq=@9tRBj8HY?eBr%$Bqj>+n3HP zeM+P{9O_F>`=-9+1t$w>&d#B}7AEsaoGM9SyMI8@(X%W8ko#UsNFTLpL zpx{vW(gWa2KOJ(d0QEdrf<)hQ;~)B&fHTRS!k4}aUwRRI=~tBpGGBTW^3Su4{l_0H z>mi_?N45^W^j_qjd&8H0elC*rA17bh4Eg7!;Y&|ew-8a!BWsGD1j(q7W z?Y|aWf-n6XzVr)aMIGvSWPRaFe}ONZ4PSb#asrPrNID4XQ|IAJw}CJH(Q6=wdLGuN zT!#GfMD!_tb$Jb67RMIBm#zR``U8Avm*S>W&m-#$UpgMX^bz>dvkIEh7$mcYFWnoy zbW`}!&UH0<%0HjK?YuB$m`3a|)rKGOq6PD%Z|>FzljT8T-xGm+dWJdkrQad{JPy9} z5ctxYpN?bP))l@q<)80{FTE3ayi}uK8NPH~_|m)KOIKRkM&xnK3%>L^_|n;`6yeM1 z*36eKf-ijzzH}4#(vw{e>rv06C=Xv+17G?eeCY>Se$;fD3H#wo2d>!7`j5X{){1|-EmKG~dnCBhzhWvAXPJ0@i zo)K(@IkUsfNCBUzEiF-5gGx-Q8G={?W38d9rdSn0>|ycI(9 z?9G(+N`;-dt(}e1PHBehItK*pSzti|WkM!`4ol(P5sMqgGYKYNt&u?0C`{eKu6@RTauWcYSe4x}HznV^6^ zRQcn}?G^uT`qDJa&@j0Y!zvq+QE^1W*eLkY@}pOSH?CcuzhZooP})9Heb8L2Z68ec zX&dw9t;RERx0nH6`jo9Jef$#3!2k!B{D>-`$ zLJP&p#y;XFv5v&PA@mNOrt-W7esD=sJ$zs5Bd z!qG>ZUgtje(!S^;ZhFnt(MLS_-X3u{^3QLhkNEUHheZqIpGTsPc!xQnsDdv&0DZ*$ zY8+?Jdl!Ag>1(s$OOHh#@q!U2#aGBbUyeTF-HrL@8E9k(RttkI|v|Ss0)RrOoqPDr;eCfIHrAMNVc!&S!Bc6l&^Bdpw5pQnHKks|E z@LM18CGe$t!qBMXOWUigL=X7VF;7?~EUVKw z7n>?xhc7+)OE+I;Nxa#n2J+7@ z!Iz!~Upl)>dFD$WLLYGt^bt?(8Yp^hT*!RsH1rX#hd$zM;Y+Kl>|(w&^${P8KH{y> zM|@kwLgq_fg)eOdU%DTB>FP6Qe)FYI!IyT2FI`2}pZU_S;Y+`RFWmvYv~|r~=1Wr_ zaq^{)!OX{EBExF^&#m{_|h8q(&OMu_g>+FJUy9o z2z==j_|l8uOFvvvkM$9EgfHz5U-}(<>AtHYSRe6@@TKKt+&EYC5kJ3YCiA7gBLDo7 zG5_30HbhVP=MwZ0-w0oNGx~@>64iV^JV*R@`R8i+Vr>GB{putBEB{;~F^$C3N8B`W z(?}cyUwRb!h_7xiCI40IfDqcM77Ln(=pRn^X}fZ_pxNSgSnNo?w6Tx)1^Ch)@T4ok zm!>V76^wuV*m>_~bM!4sLPhE$z6P~Yo`X{vpQiBLoSazkEI2yt59`@lv_l_p+TRbx zOMS%2!zgN)#yI*eWSH-n+Cr3soz>Z@Jor$T7NQk`dv75Z{kmO4k^1xA+}@0Tw?3S4 zblOi#KyNqn5#Nc-^OH?mvGXS&^L+8iIPonwx&<=NJC2DF*MXx?MCQ3_T~E;o9Gyev z`JmXb>~&T{<~cnkadgYhP59ZLqSBYNWK)B77Z z`W$d{$Fg-9NAGLo=zGD@j~-~qIQn{U^wr?#i^0*S*S*d-dV6qmKXCL(=p)`a_yyzW zo*fMwy=9j#1qZ|BT7SHj@Ln;3`t?Y@Cpfxbb6rmy-4Pu9FSokdFFRZF?-opF9Nn(H zwb&gT{Q@}pu=+C?M?V9O9t)0s4;=l@^lFTw&p;pX%jhHSj6UM3uUE;_lTWtK&us>d zz8)NXXsdI`hLy|jqmTFvaC9{|`mPZb7)Pf*;`!j{pIqN)eQhft!w z>$82z9Ty_uI)i^xxa`6mqr~3E-0}ISt(Qm*x#O;3X`;hwL+&^|rhiLA?l>K%b0~M5 z_UUoxxhfuPAW|Q3s&al|(M-%h?szBUj@OqC6{Eq?dE}0}p6MYr14nOy-0_e@J=y*u zR1=Xh8yIQkW@={(IX z>x>-z133CDeJtbX6Ts1rf}?MM*VcPMH0Bn$eE>N69&q%(kUJi+cLn3!lH#caJPBafi;}=vHld@}A)6eKlLj0hc|7D?S?>Jqa9r(ZF%+I%zC8I^~X+2S@K9 zmvh9?zt0^{JN(bw@khuVzZzr69d8egeh#_gz0gPe#kL^E(MN)#2O)P{4UXs*^J3isDig9#DaP&9e z=svbn_19K@rK}FgRB-enaP&Ej4YlT*9T-O+4~`xIjy}f2TD#iYfpPS@;ONc3(F?)R zE53X{xl#^qkvm=<9DN%&`jf-gSRe5t;OJw((UZW@3u>O{Ft<2(I1km;0Y|?Bj_$wC zljV-r0Y{GqN52e?o>%;p<&GECiO@d=NAC)b9$HS$W6e+DhuraOaP;Eja$;;-E4ofn zEJPpiOmK7!IC{bJw;a~|6di)j>X(3{r+}lUx0mq$$ZT${p_(itDcD@%iPEJ6^VW zpt#SNJAU(0v^WSHy*6^kSJ!JHJ^)AWgWPdxKy$GlIQnPgj&J)AE~=3`{tCI{-}ez` zDk?bo;Rpjq--UU~qE$4@9gk?{ufu(|4m#s;E5^|;u6nDxjy~dB?k4D}I>s`NUhk`+ zk9aXYKYSW#$Q^Hn-0`m#X8MN69WP(ak>!quzwN#k=U}dsNPPBv&L@t3AGza4z|kpp z{K$hiHlKaGyH!O;(_&J=tx zKRSV<`+}oa1V?x6--~hd6X58(?n#7O9pCCN3!#jow{xB&xZ5g(S>WjJ^R{us(Wil< ztH9AOpE#$V6|V-8iAU z@m1hj3>*84qkqTI={;$BZ^LXrEr{11${lY4j(!8V<5Ol`&)+<~F56l^JD_=lym7iu z+nmx3HN)pt5%2y-?s(n*3po0@7<>jc=8n@oadgTZzlpU8`W>O%@ucKRBJ~lc&%<<% zDR;cIgg!$Wa>u9Iv=%9o;*V4xexj^7+rNZ>Tsls<;~S7WPRA*Cd=zrWhd-~!I6CEp z2c>Jj<&JYJ8h*9DN&d$E$;*i^v_Xh`c1?=qHdnegho+AvpTD_P03V=p(?< zAAzH<2S<0w9?m%WFmUuE;OO1J(YLO${8#RH)s$$)(HDTD4+Tem2#(%iiAxx9^e*7& zy};2Af};mM9~(v-{dHrxzAHF-6gc{|2j^Js_{xpvh5bnyvFmIb{?P26jH7qgYlQm9 z9iMq75T5~CGLBvfx#MlX(FcR0ALXWUA$Yus;OJ|>(f5O+>o=U@h@*d>J3egEb!6Si zWPaf2i^0(wA$R<(rzq6Jv1D-c3*hJx;OH^s+OXX5zlvY!!@$uq!O`#Sch?d}H|36> z07q}bPh=cD8ytNca>t*6qxZiP&p5gSx#M~0Bi3scxj!D99aP-H+yZq=|@R?O&*x!4(IpgS*JN~?Cnz#WR{T_11P3QMV?l>K%Oz|+} zj?-gO?)XEb-PT9{(L8YUv&bE%wawDR^J06JK@oL}Yj<+y!^aEG}!upV$a>p~l(Z_(Je=<*H9Q_11`k6Zs z1qZ>=eH+hXpQkn8=pT_gUJe}HYjM1Y^&z%|`#U)LJ8<;S?{dfMAa^|RyWH_+;OG^= z(RYBOPdKzvPaNGB9KC{(qnE-yarD{X=ps1!ByjY1Z&4_MF?L4FFfkjsyB`n&`+rx9jC+kklA!_bUSeLGvMftT-)l1qYnf} z-=rv|Z{D^G?{Tsru?Oi?aP&n}gMD0h4wIJz}BdLeShZ^TXGFqfGP21h>&j(#7xkqN8i{FiH;vqsJI;fncR}uWVL?EC z{~JfxcI}PUnq=gS(|y_&mZ&xRHV+be{};LAt$%v%_|N9(Yv5kC1xLSqwvaRV=yxp& zxw7!l&w-=Uz7>3QFK~3)H~Hv=g@v5SN0)BD!;z1k4Ih2y&QshI_~>@vP_c>|oCZER z<5Qzu`J+Z3eJ%FMNAC@e{we!4M?N~8pE>p#w*)?VF*y2~zK^+4aLU(%qes?O^MAlc zw*^PHSs~?3KKlE^_c(e?;^?O>m5t5#Z>z-#lUG5Jzv4=fabZUK1Ss z#+5sRL(M?V6Nt^`N#xuS=D-}H5iqn8Iq*T6?_1CBmF0?s+ED;iWb zaP$Ol^fML>8Aopdj_!(Dg_Idi={AEYyn3v2aY}h9Q{@O z*Nmf&)zr|OMxXEz)xH!c7aBPF(fAnQ4t#XgiIIBq;*kPzbOkuNwR2sq1$^}5gI6++ zZVrw|r3OIW4-Au;O&w`_O1V=vuj_&he1>@+w%GBkXf}`8ItmaNE8ccJU+~$vp zwRmv!TyXTx`k9QQKLAJH4~}jQj{fNJ8phFkgQIrdT=VIC`l+*D#JQf};-sNB;|aeEo~@jHBNHM~?zWpAL@R<4Rw~ z(cfyabiKgQ<8fZc6B`&u?*xwC037{Pfe?1`vPGcF3Q#8iWm`LLhjZ-VZ z(T82D8hQ~PdWR!P2{(M>)&)lHGlodYN`s@83;HGFj1KX^vXUxa8#`&ZYy@Rf`{dfjL4JUQIa z;OMoVy7T0tpN4Br`{Z-qhL2wLy(@dn=a3YKba!OO>73(-?btpsZ+fn7@X-f>qtk1s z4i4&~n()z=gQM>$vf(cneRO{tCw?S+^lWhSTvs#py-@$|w;dicSDyLk1MhPS z;iCtGqYqqY&HqUp9sRp^gQE-HnY0clxoPC+?a;q_n0Z^q(HnxJPc?G%v(>#AN2mVX zC&AI*furx8bcJ#BN8spY;OKtv(PtI)XFmEQqmN!296jJ(DY{N#9K9(xdIUIn(MyAm zJ`@~13mm;FIC|{)vdl;C);*^V4Oj6xVQFv&nN8QHV}jekN52n_?p9->Kt6f` zIQk)Q^mXvjJwMN49DN)(dS!5Q^3mJYd&oHYPH^-naP(>5=$}%`F^=8{K6uPcK}BZ1V`@&j;>0G zqIzS8bw-Xp$GU}(+b)E0^m5?n&%x0%!O`pe6-?Jjl4Nl7=iul|TpDUCJsHS2dJ;H# z3^@9HZ)@$yVf`6LZwQXw7#zI>9KDN2Q|6<81xF76M_&exZc$jD`RJ#?(MN)#r+}j$ zT^P=M^bYQZ{@wS$(WeF7Wj;C&j@}*|y$BqA{Fa4`qbGo)-vLMOL;bre@8q!Nr_ib* zbSuEoRq)aKJ~&R-Ns3AE(dU7qHw8y8**KYT^mXvj$AF_}fTMSwzknl-{=K_Jzl+4t z$AY8VfumOgN00E!WE@=zj$R0k-WMEw5$6A7)R4I;(R{-g!i8`U=q`x9f@>pD$Pmbg zFc6tiE>l@sscltiJEgsujk%SDgT%(c1~H5hsZ!=>2en4!sIqdBE1i^fPIho?tjwLv z<<9mth)hH-qsm!j>uQaJT^m;$OKW>)TQ@gbwGv-WS->)xg$44}k(OwtM(m)ygBc=4 zko{$C<0$n+0+_3-r_|Qg!-FgxWWJmGS@@YN6fQ0vic;RCyy5Doz3lA0VCty+RmgFa z_$!^2$bm<`yT1xfk58F0{!Z?0?p|diW!ycCJ`SEr0x`(aTKbEl|93e$`RFt?(62pB z6E88;)70Prj&9-Z8X61_{W*VtZPlSmG<_a9aWpvk zIB@i~VCZ!Fds_X$>y7^tK00y4vWtk3FJT;=_CLW#_XkJcUdM2p&dK?`kh$r^+G(GB z^jL88DTSvw=A++>&wun7JxJlBhmY13tn_u`_3+W>+}>Uwt$c&?f%{tsj^4}a4i^O< zJqa9rUdd^0Eqrw1=)y%u`r+bc__NsPqrZ**+eg2;(Tj0(YaBEA=u$_6kA7mMfur}h znV^g6)t_AH>wdkB{ku1Uqi?S4D$u%L1UPybaP$Ch^x7NOGmd^Sc!=P=Y6x!^+n5VS zKU-g%R|OpX0Qz@txzUVUXt|ql^n7siNc8V+(Dkj}*=`Ht=v~pj`#v~&7jX2v&^bEd z=sm#Er-Gw5I(1I(rOW*0qqhS`cX;?nU)eu{arAD^vxLpy=-f&({o|W9%ts#tj{e}- z30+nA=%XI%esT2gI6A#2|MA`iN2m9HV{r6S6)%L|g@>NicbtZ{De`(@$81)G(0$s9 zMj!nKIC^CH&+PNI!hCgpW=fJz}+rH~Hvc9KFes%iM49&S^g);1Wm2iK9P# zeVrXAjy~`5EzZj5qto;DfsamrsP}j`zCV0)+MnOXg|BP$(dXK_vVG#{bdJeKFMIL@ zdwk;P^f3f+Bj-C#V?gox-d4C}eaCAR#^wwv-3dGTU;G$xg!S*9VD!=d07st|^&8{pTfosL zf}_6%M?be^IpgSF;OL>~-`xuw{n^dU|KjLFZdUkL|L!yy&p3MEseFA-ha}-NIJ*2c z$2j`&<*oQh=-*xT>l-0%+(yRH@54ub4Ie$PB#6Jg;dlB>{SS`b-{1FN9DV33mw$0| zNv8X+{@wrY`sg$?Hp8%LK|?ZzZ5qZpfupaBPY<014}FJ2sD`!!zAD0cbdiS8ecA@Y zNB4q{PW`*vS2TRKtp<*M0vx>s7&_gIQ`nE4zkW7HH@V%f-3yr`PCj~&SK&9meBtRr z&g7%hzR7AVIdz$N=j5a3Tveh+fx%x7%~ta!3(_h3E_+P!(er9K@+KcW^MpNb^3hG_ z5J%4~R`VtwT|ZdCn|$PCokEHfPyBIrI+6H#w7!F8lb5Gx_L$1pLX7kFEqq zpSwoNn|$=lEw;SLN58k?8fWs+{~C9nGx_M-$VXrJ>0AHq_eLLmN!n4)@?U#RL{kx^$=;@B7^zq>6=^iu5vyjTb(Zgm036sIm<&l%HJ|vSSfuj!q zM_&$(?m6=rM;zS_9KC|kN52~Ro+FOl1{_@lj$Rr*di#zYnUDSk9Q}f^f46(zodR+6 zity3bgQJgukA6>foFk4t&e*^E3;K62tk~ffNB`Bo8@avo$21bt=x!RhX(X-=jvhKo z8JYnP{dw_Sw!IX3M)T(SieS1=+oeVyy#qM9W3xZmRoi9w=w9&9D}bZZmOY8_uOB<_ z{cMgtvbQD6b-#Ezl7Fa;WS;k>zLEUc)H328FlpMaSKU{iqG$|%AX&wHblQ&$tt-ZZqu&*} z@QYo1*!j5uF?_GZ{^D(L^dQd;e1&GE#Vm02ZOfAR+ey_$OK|i=^S*ponF#heyB=@L z9+NnFwe(SZ$77!CHD{h^%f7ZNIC{+O4(uG_=$pL8@H>pT?#tk#_uw80#5zuaqX)uA zr(E}j+9;klItPwE8$S9taP*qpYBG*~Yv1GGL-5g6;OHs!8!{g~6h8Vh2$^jGV8GLF6g96bme-96@7*x__*fjD~5Rs%=B4vyZav6gZ4-r(qN z;OGzGqg&K7_~^%s9Q_(NdTx#L%t!A5j_wMMz7QOJd$_e&8rK2!S{XQczm{JLcC@o% zKKcygx_<#j9|RwLd~iqRqkm1X73(|J)jEKqAM2aWIC=?k-FLx9zXOim(rex~j@}X+ zU2!c}dt=xqat7s2;OL3q=;p4gxy|d^Gao%n_BvMsj=l#R{p=fsNIv>KaP$&z^m^dv zf7&AB9$(uN9DNEndJuBmL&`klI2;qf(KEr(Yk;GN3c1Wj-wBTXbda16fR8>`9?3ZR zNpSSN;OLjY(Wi}X$vFBgaP$mt^v2-m1?_AYM_&exE`p<5#7xkJM}HBb@N-E5M=v|| zQfMeR`gx0ajHCAhNACxYZjD^`Aiaaw8n4C1v57VW9DOA?`lSN3NIrU4XqK)WIC?TT z`W1Umk$m*7;OOwXbq9F2)*F@DiFwG146 z%M+C*w%pA8xsMA&X=`^RR%2CC5JLB98-8qcsN*Vsmh0{{v?Hxai+F2T2qqViXV zzh>Jrj!v)P;CUBu88~|Ss1dyVnYv;qIC}EpB>vH|YVg95>wYSpw@$Cl_D=@H^C#@f ziPgZ-hi*+|&t-bd@w+3%6maweWN|P1q7_$wqx&=)%-=iaDz1c&K7CLMUukj;aVI#s z=h!~%dsz#P-qooCdu_Jx(L0oC$M>$`4`yFhxcGS>{|Owu1~~dQaP+As(`g;>8%M7L zjy_rw$2fWcIQk-R^!4!kQue1Yj@}#`-OolI76Fc4>GeFu(f1(Ny=25N-VPl7#OT=? z^3iKdxF`IMT=!Do=oGxs{{ymAKmj*}A1xN1(j^0pN zhWY5xB{5=xQY~J4=2B3mMk5h5TCx-H(VM|X7vZD-wXr`(9DOfx-MfRMNAAV96fVQ1s-dDiic$)bnU>=JAk7v8c~t?=wINY z&jm-X4~|}aSpZKy`fK>;3&7DwgQHg-Uy1qX^zUFAkLY)iIQn>S^nu$eXe)uEPq&-P zIJy@&dJ%Hn|lRdKGZ=Hel#wMhQSr#AxSy33}F_FiM=qlXp$?W2$Vw2JxYpOEWb1{^)&!B{?c z@B}uW?Ln@4E`0QoCfl^J6<*SOCLG09ZgQHIZN59nDg(r@l4vzkE$5o*- zeDsk|-Vwtx8<*HqB#wR(KKhkoF9gbUU#y-bta~?9th&TZU%h)K^U*EA(f?X=Lf1(u za%!jUzc~7L96b^5NqYa&`}x#&?|(mV^pqXzH1)SG%YR?58rvq;x}a&>%RZFu(^eOL zGIX-=UZ7m}=_x(g!0-sU?!?gtf}zvx?}6dRjte%m@SDL#8wt8g(Wpazs0PJ!V+X$b z3t81|TbtF7Z5yRB9&K8`p;`UNCXv(?(G|ClG>OC?+a%lu4#RZ_fXoi7WS;iPM_==B zEWhzYq=^45xrRQU$>U!NlOIotylNegvk0HJ&&|-6q<7-y)(Q~w*V+l{cZs}Riifyw z(fPd=39b19me!1;uU?hPUJr41dfxD*9?VUr?`wmHv$*Y^uW;+yV1BM0&#za_7W%C9 z5Oa>xL}18!pM$*jamafweBYk&^(3po!5U<8$0P53!F3z`f9Ac@&x$hXM&{{*N+l>z|t26q;tgAcf(01mQGIkg{Lie@O5bm zH+WlHmkE#F`iMohk{DmF;i};xmIsN4YX^#ZU-|Oz)LD*u!I&-jw#ae6VqccW*d!IV zpBMTM*NFL(ZTJl5{xmi@OwR-RHV+abj|cJ_-22nmWVz!_17XMgDxynVEirx9Esps5 zfM9#E=+j!kN?uQF;W?SZ*dz-a>>y6kCkvZyG!fO+<}toL(&&pf1LrCICsySu6!8AI`YML!541{ z&OLwMNFID$Iu^O>j>uh~)F72_dS(Lgb<2xI`}7a9Y6)eLyIx{GRRmwRJfq9kuj`g1 ztOn;Euw{w}Pu;R~Ml1dzIQRa~Zv?-V9ry@5UN$)Q7I5w-;N0)ZpAn)le*{Nn2?yUa z7HeFz66Y=q=33(WrR;eg+4DQV`cE!dB*fsD2b}p$VErk`o)53ngYw>G$8#p?-cEm` zOT_!5{(^CguUCX?J{_6uU69!>lcbUlVQF!#)1IR~GlS_pcov_N@mbq)Ryj9)P+D~{ zKO|U;-=M^2ZMm#fQW?F6vZ~l)QmCjtuIBsT*f5P!zb&$g=og_8ZzS9C{qekiR<_Y4 zR6zg1X<_2A_0D`E&igMj;0*!r-_qaBl(xuxw>P&#!&kY5)qj=vZtG}kN_;oBcT$?6 zE4Z`N(b-YvER(v}D4krK?Co6atXz=4&XV9AP=jiZ%2Q|5n0hHZ6)0Op614o4bpv3KgmzrM*l2od@qMwQ*p1@M?1lTM0VfTH0FT5zznET4{}_Ty!9} z!9%#H@T4B4(MHzU#nl5HWJ~$@mi9BX5I2P#N?6-KY8Os}x*0C7sX-t$@uRIHZcg|= zGVDoNGjaORAwxSq8D-_;s0>G`c_6ivm7~3%Id1m&+ld{s#CJ(;#T`%|OwDAeSs*nN zRIww5W`cJ3KQ1_Kjf!DvB51?z8CuCwdvROb9N8;!!r#r-tiJ9{!>44sI&s>Jw7J@-@x@_uV^3oG>&MQAKby;!j`wDMdzT@R{KgFt zVij=tamkT90`%E@xZ_kLzsLfgCGdy#Cuezy;S0}%c0bjM-%vS9Tn#SoR(Hs^^H;hI zWyj;;w+|BH*kdjRm-kvWlDF;NRLp_jF0Vd<9sm9u;_@C{hVl;W8!^AV%;mxSlunW2 zN94rUtR2PE>pTQ5-!(m&?UR!~aAh0b^E1{3;kU>4=)^aYa-uc-_7)`__$RGvh_>MJ z#nyfK;fop?p4V|0`&#nb+Xlt(oBW&Mb9-Za)* z1(z=eZZUd9#5cd)9)5eX>>+ypJ>|b~d9#`=wZoAU-(XrKZ{qUjz~xtf%f}UCtrFuL zarq@izdinNB=g&6;IZXn4rp$J%j?o2$lH*g1eec--<}IDA2cM5eLl|tm-kayiT>d7 zkK)JwgUg=>mmij7`;E(Mz~%dc%X>wIi^S!dgUeS0m(K>5f0VyNAisU{xQ&9=$mO3c zog$Fmo&zo~fXj~qmyf(Nn{oMeF=3*Anfkh0T>`~*-FZE6dE2CxV!u*qQ4cP!@bzb0 zz8ARs?`Pa}t&XnHM^y`BT>cQad>L^0j^Of{jm{CvkS+t4KMlXV4E*+~mL81DzXg}) zz~z15w{yMx7?&@A-yR0PeHZ-p1{2(Ay-8XIT>b>O{CoKA{PXEtIF88&ROVmm!o@4_tl{xcnbwU%&~JNh84J)BilgC4$TUb$NzBT;38~z8$#yC;08nHH!q| z@_&NM*Y|Vddc$vzRN3iz;JltjE`Jw(``bD-P-7;S&Vb*(3|zijo%3AW1Y3c){4{X+ z&+ywNql5Xf%Y4KH9Q&0M|0^e6BB2qQM%k_y-D%{OVC1Hem;;v|+vP>*>_Tb&aLYor zU9dA+bFa`jgznR}UEQ3}nIm8afy)n67^urxaCuko_|8AwZ@*gY$6g0IWB#h0CXwJX zkE9=NPvLTcu?uo=`Th>4#HHZZ#NQ_b>=9#z8Mu5n{Px@M+v)fp@X4dV!TrF&Jul~q zk?=s(;O}%iwPS?v;qDl|HJtV&O*GpNh4&s_<*e>FAH_dK&#=bF40*rwTyIA-5sJX{ ztH5=?3b*t+82ux-?(~>BVD#7Ey2oCsr>_Ap32>7V#z7fhl=Oj=g?Y|Wmex_{H?@0+#y|ey<^vn zv=(Kvy-l+CaM)tu-PV=5QclNdu9Hlcb_>o|wG}pprHGH>wY-Z&W`AN%uy8XkMZ7n* zK>J&sn&vvI=#}I5v`3Hjlp#xXW%_7ot~1{mGC|`7mOs(Mh#I%d7EU?SuIZJ)a5S_SWrP zR&uc~YViY;{dnQv3_ZBL^#Qvo;?+7DK7U4g?TRmB#JYGb$zZ6?)7|(=2Yj{tk1wI? zJ&7_XP&{>^4j**2EZ071I$iHcc6O>F&fXQu_x(6QyQzPgi0eIx-OY-Lb){>7dIwj(IPcoxGrLFs}3O{E{C|~ru4eF`o*7C=Z+U^!X ze2ZB%d7qYFgtmBnoLlJ3B{5Cv&Ajsql94^758B*g4qP+Txl|siHPq zRvzviF79euwTHslwUn!yvzvD*wU520r;pmT6gq)9dU|?MYchN{&b|`4%1nx0V+yIv zPG$oqQOP=$(bc3vslo%OZSC=8YF9U0v^hF?I=i^xvW>3T=#527WQ0He9Z#>o8PwpN zuC5H%Y;?t@#4#zmLc`Ay_fUd^|L8i+9ybU4bg9)lT~X220XHZ7UuyDBe^cvsHM?hp zbLf%jr%zXC)KuOEk4w$o?eI4}f-P<;+@n_SDm;#%-MiYjXNUjq#IDt-^}7T1>CXTR zi!^l7P)kE|3k-!cq#o-KqB*EgYa&~C@4Z&HH`|_ck%i?4>O$x~ZHFZs)CA`55!FLo zgx$%8iK_TYNA1XWI3LFokR5jv`;Lbo@=nN z?>oJQR`BepK432D16~?Ed#VrUV)X3Cpg!QG(X&5=`hZqO&z|Z7=($XfSstGK7}N(O zqCOzV=-KaB)&FfXwV>I2TAKENOK0bWB~X%1t3--p7p9|g}oVf<-! zy_Sgj0P6c*2K52@BPA@aJ_CKU_@xD=?H89e(TH*u zXfM`ep1tIf86SuGfQzUP*x$bj^X#LHeczvH`jDIJ5eI zV$=s*M}5Em)CVM_`0!Y>R18-}=$4{Bz!voZSD%+-^#Qr4514`a0P6d`DMQ8T1GK0Q z7?1jZ*{Bb2%ywb*0pIt1r}r||2kbz7faBH*S|#cO5`vGj`hZfX4@hk@QriLb0e-7a z{HhQ5RUh!*tq(BueWziZrU{Bvp{ZdW>H`8$A0Sk}oUc}t*U+}=qXJDH>H_FKZRfzV zFALB94m^8PeLx!O18(HUYCEDffNno+Uj5ni0nDv8)(5ctJ%;*#_wejsO#Yfcm}P(eoyYj>H}_7Xo`M{coH<>I1f| zJi_V&&T&J8RMZC?Zr_;e{@W+P7xUwnHOb49@Hl>I2lM4+uYUPQPmSl5ctST~Qy9kNSY6Ef+D* zeu#XQ;P(Ob0l%5)`!BL&o_$1Of*9ECgs!QD$c>eq{Z${pKDrzFzSDcsR3Cs`2hmg? z^CaMurV;7`V&T`nT>6A<^$mzyb9E)PJ37 z0_3OibU5OMTz7fvbr9Q{Q*mr}_Zu_3mb@ z4>0w8r*ll6{kw?H?D2{B)8njxXRkxuKp)f%nEJlUP#-{j-?yOeJJko6`o7cmG7Fyl ze0cWiED!PWxx*NP44ysJ0VJXhU{Kb1RtM1R@u1)kaNhZ-16Z`>-*o`=Gg098-u;1> zcnoy_y-^1+vW`9T>~A5j{w3-Fro*$pKGllV0c?P0UlDor_Q>{*R@_H$4h&0Q$qTzXs1f5}tkim_~dVtdR>tQutZ$?AyY#PpY$@v$uk0-xqoH4ZooGEIzwY-}ml&&I|9xXvBFbHvF-h zE0|}m+Nu#wsDs2F`vUpEsHx1ePe9-I_VDaSz_Sl;x|Bm5fUGJ!``z&Dx52Y-onXPE z4&WPm-vIWWHMgdSIslm~*!y9y_o~ViVL7t8>fu;Bqh}wD`h&aE#<0BlTc|(aP=7EU z^#|2&+Js?U=v!WWKI#uP&(w!uT}XKV^#_gN**{19!Ijl}m}gIY-#b6@6{@2C;Q7*% z%(Gu^?E5|$^#{*CPhp;YsWbcZC9`V@J^o1HV>YHU&pvxizP?I)k}w7J2e;nLVRZmO z@a!w1{-CSmt)PFnpFUGdt6NmyTL%pg`k?-xdzmjif=CgCuOt$gpZeD@Ok& z{AO6ML3|fmF{1S%BK*Yq|4sOvBt-aW?Z^s$%dwh+vIBfItwsI+6Mh?fl@-2%){snu zpVpB6Cj9o;C&F)sn?0WYZ^BP2NA~!Cj>a`38fIu{q+wNR^z0=V#x}#VFWVzla|?d` z0_iHYZQ8GD*wMjVL+Czjrx`u_z3}Y!%`s4Y^6ZbnvyX;jPdDQf_G8zJem2iHdG^Hf z$$cl!o_M~=na|@cdD4irD9A%B!~o&-Ve(&swwmA3UEt z`-Ja!ewdNxdl-4X20T9uJih=ue^<_WEf|N{_nv)AW8e2XMxH+cJpbOcY{v7i!?SOK zzVE%@*? z{6E3-)$r_FE*bF;&t3waU!&((=Gngl&p!>G-yNQP+g_uYXD@>1Q{VS%@a*gGsA0h4 z-2u;!LtZ_3_N^|4kw0QK7d-zfc>W3S{Ig>;%(HI`&%S}Gls*PLzeVGvdgA%<@az+e zec#J1*rX?(-wizf0X+N3;Q4!wRbrmK5ibUnroQiUn$6^>?>n8JSgjvt>iZrd zo4}d+zL%HharWr@PI>j~E@g72zVDvmX!e-o*;jmVkfXlu^qTDsjb>jv2%i10Srgeg z5(W@BW|?iFLGsXP<+-dg}YWe@AnUJbUW<-UXh08}xmD5IqR2 zLngU!;Bl}!JbTKk_f^+qdG$Ns*-t><_k4KvX5pteTj16`@a%oz*?X<)q0e3t&OCcl z-}f`ft9QDU&HBCz12T5E2Aj`^XTR=F6Xx0XgJKDjmRJ9=gQ4&HT=adfT^;%< zy}=U|&1LeEyfV9L!L!%HvoCC+W_k7G+5ZL4J_?@wsTZ|bUOn}F9}dsHK0N!}pkS6) ze;%HFK0JGSc=qKp_iO9o@p^ve*-uN)5E|fT|9#*0ur?V&V;s8(&weR9`?K)uhre-T zo_zv5`{(fNUm&mk`673gSKk?){jAHELYu;~_sVO?Jo^jq?E4r!`?&QomRCQ;rHQsK zJo~xu?CWoMKy#T~q0Q2DfM-7lp1sxls;Eu-yYKrb^nGvYVnOxUzdU<3_Wkem>`i^& zi!sL0m`LLhjZ?GW*`M7$Eu=I0z8~G;7fM^bm%XOO?EArVpSG#!``-9M9LuXW-#rPA zTAE0C^{g_Pt2R1tIoH+?}gk)^nE9e{^FpXYlObibTfeXP$=?kxJguYzZ7@7)Re?%&V^gj^1Tr28UWO$#3xN>w}{o zgl9kO@pY~|j_rkKA0TPYIl;5f_!{{Sj!wT9HSzCR1>few~P>NpvRupp#$j2OSYg(4f;3PfYRrbs{O4 zsTsl;mWpSlqo+n-g?D=SBRw;O-9uQY!8p17Q-$|bF}7qaA&TZC-utfCr5&8@;rn&&JV1arAvS`X%L{ z9lbY>?v0~2;piXN-_beyMsoJ)IJyx>U%s(T=j^}pS#BCZ&i*ovel>9i^T?dtX5r|+ z!qLCN(N)b9#ks|;3P-<)qo?BNN$#r@*ZkZ(Y$(Zeiy~jH*hU>F!Smk#nG>1DDCLIaCBeh z)u-U-=D&~acJyvX|EZ2HOTGP+F^JQIf!=pHHB{l~jSlO>&(r( zy3x3|N1qaysHFE@ za`xV_r{ssr`O5ksLs!MopGx_`(PQf>Exfnc$wbZ`SLg30gW)&VtiA6uY`yPqle4dN zN!E@YXq#6rz3-`$=qqzW^!aQM_p|rDzj@r+`@RcDZzN|w5l7Fy z)MSzK+0-kA=J#;)QXGBT)_po>pMazHAZI@aM}MQjs2zRDm}Qn?9NlYrtm>beW*NxW zx{$M97cony%9&xBxnD|v{rM|tr+d-Gs)TelC#gn(F^tlm@zDeG8{bu zM~^P6Hn)8krX76^IeT&RRvf+BEmS*tIyw7;UQ)ljxNthadde;@0901b0*~Z?@!Kt^1Fc%vGl%|M!loA^&{s-22C9sF1Ka-3cc?y z(EEN4M{hW_T`vrhvk&ic7AByT$N3~yX+s!Owq^1(Qo;t>Ekl5 zKIY2|wanK0F5h>Qt@nLi{#g}KVC{WB8GS~58SuF7eYX^q>3zxB%YEkCdf$uYZqSb} zjxLX5ruY3B96hzZTt(Y@-}g;gpl;fF-#t7k)bpLa?-eQ+N6*L6J#h5?VPjZ>taBZ6a;^;-|XX<(N4!pLsu3pUb<>w}j-b$Xn0Y_hlqqq3nun@R) z$|g^L%r>t+$n|$d$C26N1W zqhG+$*Wl=X?8p07@)d63%&U*Y(La(L|K%}yUi~p!jz14af6nl8?dZigdJ>M_ileW%IYK*ne{%el z%&Skv(I;LVryV^TNB1SiFOI&+w^8!+uB#hPn&-a#gk=Uf{v7jN$m6`e5ujU4|0 z9Q`mo1Hb0jW*q&uIQoMfH!KU)813i*IQk?UeHD%#?LJUmQ|o#4?zuNiOL%T=X**}( zHMQ$wWbt3e(Nk_`Ma^z6XT~pPP8PqKEI!YHlB=5%2Z%uCrUrg_N-24p@vh{NrAKCNZAHw9eY_HM# zo=@-lUK~CC+avlE7KWqO;po#abosO`XaC*TwfEc6?H%fV3*wY?v5&yf3sU1$yY78A z7-m()D{Jq&b>H3|99TJ5Nvm)nj&6AR&z<-0efzjRzKAqt^0t-wF(nuOfYV7Oz3-BX zKObz?$GhG~9NjVZ17+`h_s)Dzndp6YN{Y42d2X_@_rCkr|5EQuE`D0SrAm6=B^RH+ z?Nuec?>))IFDcDY0rb9mkc+o8eBaqz49`cM##?tr5Q;^_HT zy?*5AO*nexmPoli)H$zyA-VV*&$s0IkmE=k{V5#16i0u}??pYY{&jNk<7~P3*VyO! zP|v)kLdzv`@dt49BgP@x(TC&c58&v7Qihdo+Uuts{m#3#nONB6|hhqm|7j&9Gz{|rYjsddwi zF1h$}96g_0eCy|K+R-H!ACIH2AQx}(a?y@1^Xg-5x%lkN-P+M57vErW^wa*kwWH6+ z(VxW86L9nkn+M4CA;;%&^gTHGYI5qyH60Ux1@;#nC66a?p<6OfJ3_N54oeKI_bC&SlPy$w~iE>v8lpdf$8XiPw() zdmO!kT>Kpz-Kp@A?s@gyj&5^wS)pZ>^<{OpuiUZ{kHgW^UmO=+M(_LWqy7=H&2ROM mjJ+2UCbwn#iLLj2Ho5qNO*#6McMeDIho4LDyKJqeyng`(tWmcB literal 0 HcmV?d00001 diff --git a/AutomatedTesting/Assets/Destruction/cinder_wall_complex.fbx b/AutomatedTesting/Assets/Destruction/cinder_wall_complex.fbx new file mode 100644 index 0000000000..62c305c35e --- /dev/null +++ b/AutomatedTesting/Assets/Destruction/cinder_wall_complex.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f94f2634eacb4d7bee20dacc45edef96e4d268f1adb7960b8aa8f3b6e2906ed +size 6867609 From c7d1c4603f80174b57ae217dbb801a3875d77499 Mon Sep 17 00:00:00 2001 From: mrieggeramzn <61609885+mrieggeramzn@users.noreply.github.com> Date: Mon, 24 Jan 2022 09:24:20 -0800 Subject: [PATCH 393/620] Removing lux core (whats left of it) (#7089) * Removing lux core (whats left of it) Signed-off-by: mrieggeramzn * Removing files recommended by NLawson and EPapp Signed-off-by: mrieggeramzn --- Gems/Atom/Feature/Common/Code/CMakeLists.txt | 1 - .../Common/Clang/atom_feature_common_clang.cmake | 7 ------- .../Common/GCC/atom_feature_common_gcc.cmake | 13 ------------- .../Common/MSVC/atom_feature_common_msvc.cmake | 7 ------- 4 files changed, 28 deletions(-) delete mode 100644 Gems/Atom/Feature/Common/Code/Source/Platform/Common/Clang/atom_feature_common_clang.cmake delete mode 100644 Gems/Atom/Feature/Common/Code/Source/Platform/Common/GCC/atom_feature_common_gcc.cmake delete mode 100644 Gems/Atom/Feature/Common/Code/Source/Platform/Common/MSVC/atom_feature_common_msvc.cmake diff --git a/Gems/Atom/Feature/Common/Code/CMakeLists.txt b/Gems/Atom/Feature/Common/Code/CMakeLists.txt index a832c46539..0d779cc3ea 100644 --- a/Gems/Atom/Feature/Common/Code/CMakeLists.txt +++ b/Gems/Atom/Feature/Common/Code/CMakeLists.txt @@ -18,7 +18,6 @@ ly_add_target( ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake PLATFORM_INCLUDE_FILES ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake - ${common_source_dir}/${PAL_TRAIT_COMPILER_ID}/atom_feature_common_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake INCLUDE_DIRECTORIES PRIVATE . diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/Clang/atom_feature_common_clang.cmake b/Gems/Atom/Feature/Common/Code/Source/Platform/Common/Clang/atom_feature_common_clang.cmake deleted file mode 100644 index 7a325ca97e..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/Clang/atom_feature_common_clang.cmake +++ /dev/null @@ -1,7 +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 -# -# diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/GCC/atom_feature_common_gcc.cmake b/Gems/Atom/Feature/Common/Code/Source/Platform/Common/GCC/atom_feature_common_gcc.cmake deleted file mode 100644 index b3f7867308..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/GCC/atom_feature_common_gcc.cmake +++ /dev/null @@ -1,13 +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 -# -# - -set_source_files_properties( - Source/LuxCore/LuxCoreRenderer.cpp - PROPERTIES - COMPILE_OPTIONS -fexceptions -) diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/MSVC/atom_feature_common_msvc.cmake b/Gems/Atom/Feature/Common/Code/Source/Platform/Common/MSVC/atom_feature_common_msvc.cmake deleted file mode 100644 index 7a325ca97e..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/MSVC/atom_feature_common_msvc.cmake +++ /dev/null @@ -1,7 +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 -# -# From 0d2204917e1d6ac6a3e598df041890666bec5312 Mon Sep 17 00:00:00 2001 From: Scott Romero <24445312+AMZN-ScottR@users.noreply.github.com> Date: Mon, 24 Jan 2022 09:49:13 -0800 Subject: [PATCH 394/620] [development] enabled mouse wheel scrolling in the Profiler gem visualizer (#6930) Resolves #6698 Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com --- Gems/Profiler/Code/Source/ImGuiCpuProfiler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Gems/Profiler/Code/Source/ImGuiCpuProfiler.cpp b/Gems/Profiler/Code/Source/ImGuiCpuProfiler.cpp index 27397f05f7..3e071570bd 100644 --- a/Gems/Profiler/Code/Source/ImGuiCpuProfiler.cpp +++ b/Gems/Profiler/Code/Source/ImGuiCpuProfiler.cpp @@ -536,8 +536,7 @@ namespace Profiler ImGui::Columns(1, "TimelineColumn", true); // Timeline - if (ImGui::BeginChild( - "Timeline", { 0, 0 }, true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) + if (ImGui::BeginChild("Timeline", { 0, 0 }, true, ImGuiWindowFlags_AlwaysVerticalScrollbar)) { // Find the next frame boundary after the viewport's right bound and draw until that tick auto nextFrameBoundaryItr = AZStd::lower_bound(m_frameEndTicks.begin(), m_frameEndTicks.end(), m_viewportEndTick); From 7bf7b03dd290af04e169ab6ea037e1f8b24d7962 Mon Sep 17 00:00:00 2001 From: SWMasterson Date: Mon, 24 Jan 2022 09:50:37 -0800 Subject: [PATCH 395/620] Added base level for tests, updated automation to use prefabs, and restored sandboxed tests (#6993) Signed-off-by: Sean Masterson --- .../Gem/PythonTests/Atom/TestSuite_Main.py | 10 +++- .../Gem/PythonTests/Atom/TestSuite_Sandbox.py | 10 ---- ...ntsLevel_DiffuseGlobalIlluminationAdded.py | 6 +-- ...ditorComponentsLevel_DisplayMapperAdded.py | 4 +- .../hydra_AtomEditorComponents_BloomAdded.py | 4 +- .../hydra_AtomEditorComponents_DecalAdded.py | 3 +- ...a_AtomEditorComponents_DeferredFogAdded.py | 4 +- ..._AtomEditorComponents_DepthOfFieldAdded.py | 4 +- ...mEditorComponents_DiffuseProbeGridAdded.py | 4 +- ...mEditorComponents_DirectionalLightAdded.py | 4 +- ...AtomEditorComponents_DisplayMapperAdded.py | 4 +- ...omEditorComponents_EntityReferenceAdded.py | 4 +- ...omEditorComponents_ExposureControlAdded.py | 4 +- ...EditorComponents_GlobalSkylightIBLAdded.py | 4 +- .../hydra_AtomEditorComponents_GridAdded.py | 4 +- ...omEditorComponents_HDRColorGradingAdded.py | 4 +- ...ra_AtomEditorComponents_HDRiSkyboxAdded.py | 4 +- .../hydra_AtomEditorComponents_LightAdded.py | 4 +- ...mEditorComponents_LookModificationAdded.py | 4 +- ...ydra_AtomEditorComponents_MaterialAdded.py | 4 +- .../hydra_AtomEditorComponents_MeshAdded.py | 4 +- ...orComponents_OcclusionCullingPlaneAdded.py | 4 +- ...a_AtomEditorComponents_PhysicalSkyAdded.py | 4 +- ...nents_PostFXGradientWeightModifierAdded.py | 4 +- ...a_AtomEditorComponents_PostFXLayerAdded.py | 4 +- ...ponents_PostFXRadiusWeightModifierAdded.py | 4 +- ...mponents_PostFxShapeWeightModifierAdded.py | 4 +- ...omEditorComponents_ReflectionProbeAdded.py | 4 +- .../hydra_AtomEditorComponents_SSAOAdded.py | 4 +- .../Graphics/base_empty/base_empty.prefab | 53 +++++++++++++++++++ .../Levels/Graphics/base_empty/tags.txt | 12 +++++ 31 files changed, 153 insertions(+), 41 deletions(-) create mode 100644 AutomatedTesting/Levels/Graphics/base_empty/base_empty.prefab create mode 100644 AutomatedTesting/Levels/Graphics/base_empty/tags.txt diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py index f1e66ac492..cca20bbf8c 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py @@ -21,7 +21,7 @@ TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "tests") @pytest.mark.parametrize("launcher_platform", ['windows_editor']) class TestAutomation(EditorTestSuite): - enable_prefab_system = False + enable_prefab_system = True @pytest.mark.test_case_id("C36525657") class AtomEditorComponents_BloomAdded(EditorSharedTest): @@ -120,6 +120,14 @@ class TestAutomation(EditorTestSuite): class AtomEditorComponents_SSAOAdded(EditorSharedTest): from Atom.tests import hydra_AtomEditorComponents_SSAOAdded as test_module + @pytest.mark.test_case_id("C36529666") + class AtomEditorComponentsLevel_DiffuseGlobalIlluminationAdded(EditorSharedTest): + from Atom.tests import hydra_AtomEditorComponentsLevel_DiffuseGlobalIlluminationAdded as test_module + + @pytest.mark.test_case_id("C36525660") + class AtomEditorComponentsLevel_DisplayMapperAdded(EditorSharedTest): + from Atom.tests import hydra_AtomEditorComponentsLevel_DisplayMapperAdded as test_module + class ShaderAssetBuilder_RecompilesShaderAsChainOfDependenciesChanges(EditorSharedTest): from Atom.tests import hydra_ShaderAssetBuilder_RecompilesShaderAsChainOfDependenciesChanges as test_module diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py index bd0477a1db..5299e55a2b 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py @@ -26,13 +26,3 @@ class TestAutomation(EditorTestSuite): @pytest.mark.test_case_id("C36525660") class AtomEditorComponents_DisplayMapperAdded(EditorSharedTest): from Atom.tests import hydra_AtomEditorComponents_DisplayMapperAdded as test_module - - # this test causes editor to crash when using slices. once automation transitions to prefabs it should pass - @pytest.mark.test_case_id("C36529666") - class AtomEditorComponentsLevel_DiffuseGlobalIlluminationAdded(EditorSharedTest): - from Atom.tests import hydra_AtomEditorComponentsLevel_DiffuseGlobalIlluminationAdded as test_module - - # this test causes editor to crash when using slices. once automation transitions to prefabs it should pass - @pytest.mark.test_case_id("C36525660") - class AtomEditorComponentsLevel_DisplayMapperAdded(EditorSharedTest): - from Atom.tests import hydra_AtomEditorComponentsLevel_DisplayMapperAdded as test_module diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponentsLevel_DiffuseGlobalIlluminationAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponentsLevel_DiffuseGlobalIlluminationAdded.py index ddcd5c3c46..0c9b39e354 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponentsLevel_DiffuseGlobalIlluminationAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponentsLevel_DiffuseGlobalIlluminationAdded.py @@ -60,7 +60,7 @@ def AtomEditorComponentsLevel_DiffuseGlobalIllumination_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Add Diffuse Global Illumination level component to the level entity. @@ -86,10 +86,10 @@ def AtomEditorComponentsLevel_DiffuseGlobalIllumination_AddedToEntity(): # 4. Set Quality Level property to Low diffuse_global_illumination_component.set_component_property_value( - AtomComponentProperties.diffuse_global_illumination('Quality Level', GLOBAL_ILLUMINATION_QUALITY['Low'])) + AtomComponentProperties.diffuse_global_illumination('Quality Level'), GLOBAL_ILLUMINATION_QUALITY['Low']) quality = diffuse_global_illumination_component.get_component_property_value( AtomComponentProperties.diffuse_global_illumination('Quality Level')) - Report.result(diffuse_global_illumination_quality, quality == GLOBAL_ILLUMINATION_QUALITY['Low']) + Report.result(Tests.diffuse_global_illumination_quality, quality == GLOBAL_ILLUMINATION_QUALITY['Low']) # 5. Enter/Exit game mode. TestHelper.enter_game_mode(Tests.enter_game_mode) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponentsLevel_DisplayMapperAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponentsLevel_DisplayMapperAdded.py index c050dd76d4..f9660957bb 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponentsLevel_DisplayMapperAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponentsLevel_DisplayMapperAdded.py @@ -67,7 +67,7 @@ def AtomEditorComponentsLevel_DisplayMapper_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Add Display Mapper level component to the level entity. @@ -102,7 +102,7 @@ def AtomEditorComponentsLevel_DisplayMapper_AddedToEntity(): display_mapper_component.set_component_property_value( AtomComponentProperties.display_mapper('Enable LDR color grading LUT'), True) Report.result( - Test.enable_ldr_color_grading_lut, + Tests.enable_ldr_color_grading_lut, display_mapper_component.get_component_property_value( AtomComponentProperties.display_mapper('Enable LDR color grading LUT')) is True) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_BloomAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_BloomAdded.py index 56b22eb20d..ce29a1de88 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_BloomAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_BloomAdded.py @@ -97,7 +97,7 @@ def AtomEditorComponents_Bloom_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create an Bloom entity with no components. @@ -170,10 +170,12 @@ def AtomEditorComponents_Bloom_AddedToEntity(): # 13. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, bloom_entity.exists()) # 14. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not bloom_entity.exists()) # 15. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py index e840cf3cf1..eb5e24e3a6 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py @@ -95,7 +95,7 @@ def AtomEditorComponents_Decal_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a Decal entity with no components. @@ -162,6 +162,7 @@ def AtomEditorComponents_Decal_AddedToEntity(): # 11. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not decal_entity.exists()) # 12. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DeferredFogAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DeferredFogAdded.py index 71163ece94..f1578cbf8d 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DeferredFogAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DeferredFogAdded.py @@ -97,7 +97,7 @@ def AtomEditorComponents_DeferredFog_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create an Deferred Fog entity with no components. @@ -174,10 +174,12 @@ def AtomEditorComponents_DeferredFog_AddedToEntity(): # 13. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, deferred_fog_entity.exists()) # 14. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not deferred_fog_entity.exists()) # 15. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DepthOfFieldAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DepthOfFieldAdded.py index e2c5f9c77d..3913420981 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DepthOfFieldAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DepthOfFieldAdded.py @@ -107,7 +107,7 @@ def AtomEditorComponents_DepthOfField_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a DepthOfField entity with no components. @@ -189,10 +189,12 @@ def AtomEditorComponents_DepthOfField_AddedToEntity(): # 15. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, depth_of_field_entity.exists()) # 16. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not depth_of_field_entity.exists()) # 17. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DiffuseProbeGridAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DiffuseProbeGridAdded.py index f42c091057..04b4f7876b 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DiffuseProbeGridAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DiffuseProbeGridAdded.py @@ -90,7 +90,7 @@ def AtomEditorComponents_DiffuseProbeGrid_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a Diffuse Probe Grid entity with no components. @@ -168,10 +168,12 @@ def AtomEditorComponents_DiffuseProbeGrid_AddedToEntity(): # 12. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, diffuse_probe_grid_entity.exists()) # 13. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not diffuse_probe_grid_entity.exists()) # 14. Look for errors or asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DirectionalLightAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DirectionalLightAdded.py index f3ffc0f366..19cfbedcd5 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DirectionalLightAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DirectionalLightAdded.py @@ -95,7 +95,7 @@ def AtomEditorComponents_DirectionalLight_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a Directional Light entity with no components. @@ -168,10 +168,12 @@ def AtomEditorComponents_DirectionalLight_AddedToEntity(): # 12. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, directional_light_entity.exists()) # 13. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not directional_light_entity.exists()) # 14. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DisplayMapperAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DisplayMapperAdded.py index 558d69046e..d3ea669eab 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DisplayMapperAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DisplayMapperAdded.py @@ -91,7 +91,7 @@ def AtomEditorComponents_DisplayMapper_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a Display Mapper entity with no components. @@ -166,10 +166,12 @@ def AtomEditorComponents_DisplayMapper_AddedToEntity(): # 11. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, display_mapper_entity.exists()) # 12. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not display_mapper_entity.exists()) # 13. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py index dddcca64fa..ec402f0f5f 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py @@ -81,7 +81,7 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create an Entity Reference entity with no components. @@ -139,10 +139,12 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): # 9. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, entity_reference_entity.exists()) # 10. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not entity_reference_entity.exists()) # 11. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_ExposureControlAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_ExposureControlAdded.py index 6fa9660539..f60f0e18be 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_ExposureControlAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_ExposureControlAdded.py @@ -101,7 +101,7 @@ def AtomEditorComponents_ExposureControl_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Creation of Exposure Control entity with no components. @@ -169,10 +169,12 @@ def AtomEditorComponents_ExposureControl_AddedToEntity(): # 12. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, exposure_control_entity.exists()) # 13. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not exposure_control_entity.exists()) # 14. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GlobalSkylightIBLAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GlobalSkylightIBLAdded.py index 7f0c38e289..0e8e6fa43e 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GlobalSkylightIBLAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GlobalSkylightIBLAdded.py @@ -99,7 +99,7 @@ def AtomEditorComponents_GlobalSkylightIBL_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a Global Skylight (IBL) entity with no components. @@ -176,10 +176,12 @@ def AtomEditorComponents_GlobalSkylightIBL_AddedToEntity(): # 11. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, global_skylight_entity.exists()) # 12. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not global_skylight_entity.exists()) # 13. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GridAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GridAdded.py index a77a1f50a4..3c6d261f22 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GridAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GridAdded.py @@ -82,7 +82,7 @@ def AtomEditorComponents_Grid_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a Grid entity with no components. @@ -139,10 +139,12 @@ def AtomEditorComponents_Grid_AddedToEntity(): # 9. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, grid_entity.exists()) # 10. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not grid_entity.exists()) # 11. Look for errors or asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_HDRColorGradingAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_HDRColorGradingAdded.py index 4972079fcd..5846206e50 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_HDRColorGradingAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_HDRColorGradingAdded.py @@ -96,7 +96,7 @@ def AtomEditorComponents_HDRColorGrading_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create an HDR Color Grading entity with no components. @@ -173,10 +173,12 @@ def AtomEditorComponents_HDRColorGrading_AddedToEntity(): # 13. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, hdr_color_grading_entity.exists()) # 14. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not hdr_color_grading_entity.exists()) # 15. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_HDRiSkyboxAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_HDRiSkyboxAdded.py index 0f96bc5424..fc093b60db 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_HDRiSkyboxAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_HDRiSkyboxAdded.py @@ -87,7 +87,7 @@ def AtomEditorComponents_HDRiSkybox_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create an HDRi Skybox with no components. @@ -158,10 +158,12 @@ def AtomEditorComponents_HDRiSkybox_AddedToEntity(): # 10. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, hdri_skybox_entity.exists()) # 11. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not hdri_skybox_entity.exists()) # 12. Look for errors or asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LightAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LightAdded.py index 249671556d..75a04612a3 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LightAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LightAdded.py @@ -89,7 +89,7 @@ def AtomEditorComponents_Light_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a Light entity with no components. @@ -144,10 +144,12 @@ def AtomEditorComponents_Light_AddedToEntity(): # 9. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, light_entity.exists()) # 10. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not light_entity.exists()) # 11. Look for errors asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LookModificationAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LookModificationAdded.py index afb8033426..149af73151 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LookModificationAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LookModificationAdded.py @@ -104,7 +104,7 @@ def AtomEditorComponents_LookModification_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create an Look Modification entity with no components. @@ -192,10 +192,12 @@ def AtomEditorComponents_LookModification_AddedToEntity(): # 14. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, look_modification_entity.exists()) # 15. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not look_modification_entity.exists()) # 16. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_MaterialAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_MaterialAdded.py index c613bb23e7..919a6753f4 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_MaterialAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_MaterialAdded.py @@ -102,7 +102,7 @@ def AtomEditorComponents_Material_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a Material entity with no components. @@ -184,10 +184,12 @@ def AtomEditorComponents_Material_AddedToEntity(): # 16. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, material_entity.exists()) # 17. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not material_entity.exists()) # 18. Look for errors or asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_MeshAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_MeshAdded.py index 9d56753961..a87ee75b53 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_MeshAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_MeshAdded.py @@ -87,7 +87,7 @@ def AtomEditorComponents_Mesh_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a Mesh entity with no components. @@ -151,10 +151,12 @@ def AtomEditorComponents_Mesh_AddedToEntity(): # 10. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, mesh_entity.exists()) # 11. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not mesh_entity.exists()) # 12. Look for errors or asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_OcclusionCullingPlaneAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_OcclusionCullingPlaneAdded.py index 4226ae3dfe..56bb5eb68c 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_OcclusionCullingPlaneAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_OcclusionCullingPlaneAdded.py @@ -80,7 +80,7 @@ def AtomEditorComponents_OcclusionCullingPlane_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a occlusion culling plane entity with no components. @@ -140,10 +140,12 @@ def AtomEditorComponents_OcclusionCullingPlane_AddedToEntity(): # 9. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, occlusion_culling_plane_entity.exists()) # 10. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not occlusion_culling_plane_entity.exists()) # 11. Look for errors or asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PhysicalSkyAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PhysicalSkyAdded.py index fa8c626016..e0c558811e 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PhysicalSkyAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PhysicalSkyAdded.py @@ -89,7 +89,7 @@ def AtomEditorComponents_PhysicalSky_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a Physical Sky entity with no components. @@ -146,10 +146,12 @@ def AtomEditorComponents_PhysicalSky_AddedToEntity(): # 9. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, physical_sky_entity.exists()) # 10. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not physical_sky_entity.exists()) # 11. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFXGradientWeightModifierAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFXGradientWeightModifierAdded.py index 6e4ae2d9ac..b36267433f 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFXGradientWeightModifierAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFXGradientWeightModifierAdded.py @@ -92,7 +92,7 @@ def AtomEditorComponents_PostFXGradientWeightModifier_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a PostFX Gradient Weight Modifier entity with no components. @@ -162,10 +162,12 @@ def AtomEditorComponents_PostFXGradientWeightModifier_AddedToEntity(): # 12. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, postfx_gradient_weight_entity.exists()) # 13. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not postfx_gradient_weight_entity.exists()) # 14. Look for errors or asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFXLayerAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFXLayerAdded.py index efef4c0a43..07fffb9bde 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFXLayerAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFXLayerAdded.py @@ -80,7 +80,7 @@ def AtomEditorComponents_postfx_layer_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a PostFX Layer entity with no components. @@ -137,10 +137,12 @@ def AtomEditorComponents_postfx_layer_AddedToEntity(): # 9. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, postfx_layer_entity.exists()) # 10. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not postfx_layer_entity.exists()) # 11. Look for errors or asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFXRadiusWeightModifierAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFXRadiusWeightModifierAdded.py index 228ddfcdc5..616233d2d2 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFXRadiusWeightModifierAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFXRadiusWeightModifierAdded.py @@ -92,7 +92,7 @@ def AtomEditorComponents_PostFXRadiusWeightModifier_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a Post FX Radius Weight Modifier entity with no components. @@ -161,10 +161,12 @@ def AtomEditorComponents_PostFXRadiusWeightModifier_AddedToEntity(): # 12. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, postfx_radius_weight_entity.exists()) # 13. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not postfx_radius_weight_entity.exists()) # 14. Look for errors and asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFxShapeWeightModifierAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFxShapeWeightModifierAdded.py index 0a37ac6bf7..5f7d571a18 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFxShapeWeightModifierAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PostFxShapeWeightModifierAdded.py @@ -98,7 +98,7 @@ def AtomEditorComponents_postfx_shape_weight_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a PostFx Shape Weight Modifier entity with no components. @@ -188,10 +188,12 @@ def AtomEditorComponents_postfx_shape_weight_AddedToEntity(): # 15. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, postfx_shape_weight_entity.exists()) # 16. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not postfx_shape_weight_entity.exists()) # 17. Look for errors or asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_ReflectionProbeAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_ReflectionProbeAdded.py index 70adf9143a..85156b4db6 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_ReflectionProbeAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_ReflectionProbeAdded.py @@ -97,7 +97,7 @@ def AtomEditorComponents_ReflectionProbe_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a Reflection Probe entity with no components. @@ -183,10 +183,12 @@ def AtomEditorComponents_ReflectionProbe_AddedToEntity(): # 13. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, reflection_probe_entity.exists()) # 14. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not reflection_probe_entity.exists()) # 15. Look for errors or asserts. diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_SSAOAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_SSAOAdded.py index 15f40f8b70..09f77c4a9f 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_SSAOAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_SSAOAdded.py @@ -94,7 +94,7 @@ def AtomEditorComponents_SSAO_AddedToEntity(): # Test setup begins. # Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level. TestHelper.init_idle() - TestHelper.open_level("", "Base") + TestHelper.open_level("Graphics", "base_empty") # Test steps begin. # 1. Create a SSAO entity with no components. @@ -163,10 +163,12 @@ def AtomEditorComponents_SSAO_AddedToEntity(): # 12. UNDO deletion. general.undo() + general.idle_wait_frames(1) Report.result(Tests.deletion_undo, ssao_entity.exists()) # 13. REDO deletion. general.redo() + general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not ssao_entity.exists()) # 14. Look for errors and asserts. diff --git a/AutomatedTesting/Levels/Graphics/base_empty/base_empty.prefab b/AutomatedTesting/Levels/Graphics/base_empty/base_empty.prefab new file mode 100644 index 0000000000..f7e42e7731 --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/base_empty/base_empty.prefab @@ -0,0 +1,53 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043 + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Graphics/base_empty/tags.txt b/AutomatedTesting/Levels/Graphics/base_empty/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/base_empty/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 From 2b7b975a88ecd90a59376d94aae3c0ad37020ac2 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Mon, 24 Jan 2022 12:38:29 -0600 Subject: [PATCH 396/620] Fixed missing include compile issue Signed-off-by: Chris Galvan --- Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.cpp b/Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.cpp index cf042dc4ac..0640271c37 100644 --- a/Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.cpp +++ b/Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include From f3daeba165f77fd8c61b91c9052c2dea09af14fd Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Mon, 24 Jan 2022 13:08:41 -0600 Subject: [PATCH 397/620] Removed unused IViewPane Editor class Signed-off-by: Chris Galvan --- Code/Editor/Include/IEditorClassFactory.h | 4 - Code/Editor/Include/IViewPane.h | 74 ------------------- Code/Editor/Plugin.cpp | 20 ----- Code/Editor/Plugin.h | 8 -- Code/Editor/QtViewPane.h | 40 ---------- Code/Editor/QtViewPaneManager.h | 8 -- .../TrackView/2DBezierKeyUIControls.cpp | 2 - .../TrackView/AssetBlendKeyUIControls.cpp | 2 - .../Editor/TrackView/CaptureKeyUIControls.cpp | 2 - .../Editor/TrackView/CommentKeyUIControls.cpp | 2 - .../Editor/TrackView/ConsoleKeyUIControls.cpp | 2 - Code/Editor/TrackView/EventKeyUIControls.cpp | 2 - Code/Editor/TrackView/GotoKeyUIControls.cpp | 2 - .../TrackView/ScreenFaderKeyUIControls.cpp | 2 - Code/Editor/TrackView/SelectKeyUIControls.cpp | 2 - .../TrackView/SequenceKeyUIControls.cpp | 2 - Code/Editor/TrackView/SoundKeyUIControls.cpp | 2 - .../TrackView/TimeRangeKeyUIControls.cpp | 2 - .../TrackView/TrackEventKeyUIControls.cpp | 2 - Code/Editor/ViewManager.h | 1 - Code/Editor/editor_lib_files.cmake | 1 - .../Editor/AudioControlsEditorPlugin.cpp | 13 ---- .../Editor/Animation/UiAnimViewDialog.cpp | 1 - 23 files changed, 196 deletions(-) delete mode 100644 Code/Editor/Include/IViewPane.h diff --git a/Code/Editor/Include/IEditorClassFactory.h b/Code/Editor/Include/IEditorClassFactory.h index 6c85192436..82422799cf 100644 --- a/Code/Editor/Include/IEditorClassFactory.h +++ b/Code/Editor/Include/IEditorClassFactory.h @@ -135,9 +135,6 @@ struct IClassDesc ////////////////////////////////////////////////////////////////////////// }; - -struct IViewPaneClass; - struct CRYEDIT_API IEditorClassFactory { public: @@ -149,7 +146,6 @@ public: virtual IClassDesc* FindClass(const char* pClassName) const = 0; //! Find class in the factory by class id virtual IClassDesc* FindClass(const GUID& rClassID) const = 0; - virtual IViewPaneClass* FindViewPaneClassByTitle(const char* pPaneTitle) const = 0; virtual void UnregisterClass(const char* pClassName) = 0; virtual void UnregisterClass(const GUID& rClassID) = 0; //! Get classes that matching specific requirements. diff --git a/Code/Editor/Include/IViewPane.h b/Code/Editor/Include/IViewPane.h deleted file mode 100644 index f2425fb954..0000000000 --- a/Code/Editor/Include/IViewPane.h +++ /dev/null @@ -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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IVIEWPANE_H -#define CRYINCLUDE_EDITOR_INCLUDE_IVIEWPANE_H -#pragma once - -#include "IEditorClassFactory.h" - -#include - -class QWidget; -class QRect; - -struct IViewPaneClass - : public IClassDesc -{ - DEFINE_UUID(0x7E13EC7C, 0xF621, 0x4aeb, 0xB6, 0x42, 0x67, 0xD7, 0x8E, 0xD4, 0x68, 0xF8) - - enum EDockingDirection - { - DOCK_TOP, - DOCK_LEFT, - DOCK_RIGHT, - DOCK_BOTTOM, - DOCK_FLOAT, - }; - - virtual ~IViewPaneClass() = default; - - // Return text for view pane title. - virtual QString GetPaneTitle() = 0; - - // Return the string resource ID for the title's text. - virtual unsigned int GetPaneTitleID() const = 0; - - // Return preferable initial docking position for pane. - virtual EDockingDirection GetDockingDirection() = 0; - - // Initial pane size. - virtual QRect GetPaneRect() = 0; - - // Get Minimal view size - virtual QSize GetMinSize() { return QSize(0, 0); } - - // Return true if only one pane at a time of time view class can be created. - virtual bool SinglePane() = 0; - - // Return true if the view window wants to get ID_IDLE_UPDATE commands. - virtual bool WantIdleUpdate() = 0; - - ////////////////////////////////////////////////////////////////////////// - // IUnknown - ////////////////////////////////////////////////////////////////////////// - HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObj) - { - if (riid == __az_uuidof(IViewPaneClass)) - { - *ppvObj = this; - return S_OK; - } - return E_NOINTERFACE; - } - ////////////////////////////////////////////////////////////////////////// - -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IVIEWPANE_H diff --git a/Code/Editor/Plugin.cpp b/Code/Editor/Plugin.cpp index 16c386e31c..fd70cc282d 100644 --- a/Code/Editor/Plugin.cpp +++ b/Code/Editor/Plugin.cpp @@ -11,9 +11,6 @@ #include "Plugin.h" -// Editor -#include "Include/IViewPane.h" - #include CClassFactory* CClassFactory::s_pInstance = nullptr; @@ -149,23 +146,6 @@ IClassDesc* CClassFactory::FindClass(const GUID& rClassID) const return pClassDesc; } -IViewPaneClass* CClassFactory::FindViewPaneClassByTitle(const char* pPaneTitle) const -{ - for (size_t i = 0; i < m_classes.size(); i++) - { - IViewPaneClass* viewPane = nullptr; - IClassDesc* desc = m_classes[i]; - if (SUCCEEDED(desc->QueryInterface(__az_uuidof(IViewPaneClass), (void**)&viewPane))) - { - if (QString::compare(viewPane->GetPaneTitle(), pPaneTitle) == 0) - { - return viewPane; - } - } - } - return nullptr; -} - void CClassFactory::UnregisterClass(const char* pClassName) { IClassDesc* pClassDesc = FindClass(pClassName); diff --git a/Code/Editor/Plugin.h b/Code/Editor/Plugin.h index 5fa45ac140..7a6e2f8995 100644 --- a/Code/Editor/Plugin.h +++ b/Code/Editor/Plugin.h @@ -71,8 +71,6 @@ public: IClassDesc* FindClass(const char* className) const; //! Find class in the factory by class ID IClassDesc* FindClass(const GUID& rClassID) const; - //! Find View Pane Class in the factory by pane title - IViewPaneClass* FindViewPaneClassByTitle(const char* pPaneTitle) const; void UnregisterClass(const char* pClassName); void UnregisterClass(const GUID& rClassID); //! Get classes matching specific requirements ordered alphabetically by name. @@ -135,10 +133,4 @@ public: #define REGISTER_CLASS_DESC(ClassDesc) \ CAutoRegisterClassHelper g_AutoRegHelper##ClassDesc(new ClassDesc); -#define REGISTER_QT_CLASS_DESC(ClassDesc, name, category) \ - CAutoRegisterClassHelper g_AutoRegHelper##ClassDesc(new CQtViewClass(name, category)); - -#define REGISTER_QT_CLASS_DESC_SYSTEM_ID(ClassDesc, name, category, systemid) \ - CAutoRegisterClassHelper g_AutoRegHelper##ClassDesc(new CQtViewClass(name, category, systemid)); - #endif // CRYINCLUDE_EDITOR_PLUGIN_H diff --git a/Code/Editor/QtViewPane.h b/Code/Editor/QtViewPane.h index 194dd8919a..7d7dd04459 100644 --- a/Code/Editor/QtViewPane.h +++ b/Code/Editor/QtViewPane.h @@ -13,7 +13,6 @@ #include "IEditor.h" #include "Include/IEditorClassFactory.h" -#include "Include/IViewPane.h" #include "Include/ObjectEvent.h" #include "Objects/ClassDesc.h" @@ -107,43 +106,4 @@ public: } }; -template -class CQtViewClass - : public IViewPaneClass -{ -public: - const char* m_name; - const char* m_category; - ESystemClassID m_classId; - - CQtViewClass(const char* name, const char* category, ESystemClassID classId = ESYSTEM_CLASS_VIEWPANE) - : m_name(name) - , m_category(category) - , m_classId(classId) - { - } - - ESystemClassID SystemClassID() override { return m_classId; }; - static const GUID& GetClassID() - { - return TWidget::GetClassID(); - } - - const GUID& ClassID() override - { - return GetClassID(); - } - QString ClassName() override { return m_name; }; - QString Category() override { return m_category; }; - - QObject* CreateQObject() const override { return new TWidget(); }; - QString GetPaneTitle() override { return m_name; }; - unsigned int GetPaneTitleID() const override { return 0; }; - EDockingDirection GetDockingDirection() override { return DOCK_FLOAT; }; - QRect GetPaneRect() override { return {}; /* KDAB_TODO: ;m_sizeOptions.m_paneRect; */}; - bool SinglePane() override { return false; }; - bool WantIdleUpdate() override { return true; }; - QSize GetMinSize() override { return {}; /*return m_sizeOptions.m_minSize;*/ } -}; - #endif // CRYINCLUDE_EDITORCOMMON_QTVIEWPANE_H diff --git a/Code/Editor/QtViewPaneManager.h b/Code/Editor/QtViewPaneManager.h index 0515ae726e..5f65958592 100644 --- a/Code/Editor/QtViewPaneManager.h +++ b/Code/Editor/QtViewPaneManager.h @@ -269,14 +269,6 @@ bool RegisterQtViewPaneWithName([[maybe_unused]] IEditor* editor, const QString& return true; } -template -void UnregisterQtViewPane() -{ - // always close any views that the pane is responsible for before you remove it! - GetIEditor()->CloseView(CQtViewClass::GetClassID()); - GetIEditor()->GetClassFactory()->UnregisterClass(CQtViewClass::GetClassID()); -} - template TWidget* FindViewPane(const QString& name) { diff --git a/Code/Editor/TrackView/2DBezierKeyUIControls.cpp b/Code/Editor/TrackView/2DBezierKeyUIControls.cpp index 81cd151373..24f2633eb9 100644 --- a/Code/Editor/TrackView/2DBezierKeyUIControls.cpp +++ b/Code/Editor/TrackView/2DBezierKeyUIControls.cpp @@ -143,5 +143,3 @@ void C2DBezierKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& se } } } - -REGISTER_QT_CLASS_DESC(C2DBezierKeyUIControls, "TrackView.KeyUI.2DBezier", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/AssetBlendKeyUIControls.cpp b/Code/Editor/TrackView/AssetBlendKeyUIControls.cpp index 038a9d9780..d90f63ee24 100644 --- a/Code/Editor/TrackView/AssetBlendKeyUIControls.cpp +++ b/Code/Editor/TrackView/AssetBlendKeyUIControls.cpp @@ -220,5 +220,3 @@ void CAssetBlendKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& } } } - -REGISTER_QT_CLASS_DESC(CAssetBlendKeyUIControls, "TrackView.KeyUI.AssetBlends", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/CaptureKeyUIControls.cpp b/Code/Editor/TrackView/CaptureKeyUIControls.cpp index e6d88a6cd6..89d55f0a2b 100644 --- a/Code/Editor/TrackView/CaptureKeyUIControls.cpp +++ b/Code/Editor/TrackView/CaptureKeyUIControls.cpp @@ -143,5 +143,3 @@ void CCaptureKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& sel } } } - -REGISTER_QT_CLASS_DESC(CCaptureKeyUIControls, "TrackView.KeyUI.Capture", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/CommentKeyUIControls.cpp b/Code/Editor/TrackView/CommentKeyUIControls.cpp index 6b52efd8f1..e4d7183d5e 100644 --- a/Code/Editor/TrackView/CommentKeyUIControls.cpp +++ b/Code/Editor/TrackView/CommentKeyUIControls.cpp @@ -169,5 +169,3 @@ void CCommentKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& sel } } } - -REGISTER_QT_CLASS_DESC(CCommentKeyUIControls, "TrackView.KeyUI.Comment", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/ConsoleKeyUIControls.cpp b/Code/Editor/TrackView/ConsoleKeyUIControls.cpp index 7bf23e0b52..f3ed919393 100644 --- a/Code/Editor/TrackView/ConsoleKeyUIControls.cpp +++ b/Code/Editor/TrackView/ConsoleKeyUIControls.cpp @@ -118,5 +118,3 @@ void CConsoleKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& sel } } } - -REGISTER_QT_CLASS_DESC(CConsoleKeyUIControls, "TrackView.KeyUI.Console", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/EventKeyUIControls.cpp b/Code/Editor/TrackView/EventKeyUIControls.cpp index 56b16d7c02..b8c737fa6a 100644 --- a/Code/Editor/TrackView/EventKeyUIControls.cpp +++ b/Code/Editor/TrackView/EventKeyUIControls.cpp @@ -149,5 +149,3 @@ void CEventKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selec } } } - -REGISTER_QT_CLASS_DESC(CEventKeyUIControls, "TrackView.KeyUI.Event", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/GotoKeyUIControls.cpp b/Code/Editor/TrackView/GotoKeyUIControls.cpp index c48ce4c5ad..a2767e9d4f 100644 --- a/Code/Editor/TrackView/GotoKeyUIControls.cpp +++ b/Code/Editor/TrackView/GotoKeyUIControls.cpp @@ -121,5 +121,3 @@ void CGotoKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& select } } } - -REGISTER_QT_CLASS_DESC(CGotoKeyUIControls, "TrackView.KeyUI.Goto", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/ScreenFaderKeyUIControls.cpp b/Code/Editor/TrackView/ScreenFaderKeyUIControls.cpp index d8b3a2bdf7..b3f971bce0 100644 --- a/Code/Editor/TrackView/ScreenFaderKeyUIControls.cpp +++ b/Code/Editor/TrackView/ScreenFaderKeyUIControls.cpp @@ -167,5 +167,3 @@ void CScreenFaderKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& } } } - -REGISTER_QT_CLASS_DESC(CScreenFaderKeyUIControls, "TrackView.KeyUI.ScreenFader", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/SelectKeyUIControls.cpp b/Code/Editor/TrackView/SelectKeyUIControls.cpp index d12f449c73..81af5f8c8c 100644 --- a/Code/Editor/TrackView/SelectKeyUIControls.cpp +++ b/Code/Editor/TrackView/SelectKeyUIControls.cpp @@ -269,5 +269,3 @@ void CSelectKeyUIControls::ResetCameraEntries() OnCameraAdded(cameraComponentEntities.values[i]); } } - -REGISTER_QT_CLASS_DESC(CSelectKeyUIControls, "TrackView.KeyUI.Select", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/SequenceKeyUIControls.cpp b/Code/Editor/TrackView/SequenceKeyUIControls.cpp index 4199563e10..21c654ecc2 100644 --- a/Code/Editor/TrackView/SequenceKeyUIControls.cpp +++ b/Code/Editor/TrackView/SequenceKeyUIControls.cpp @@ -215,5 +215,3 @@ void CSequenceKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& se } } } - -REGISTER_QT_CLASS_DESC(CSequenceKeyUIControls, "TrackView.KeyUI.Sequence", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/SoundKeyUIControls.cpp b/Code/Editor/TrackView/SoundKeyUIControls.cpp index f001937e82..2ea41077c4 100644 --- a/Code/Editor/TrackView/SoundKeyUIControls.cpp +++ b/Code/Editor/TrackView/SoundKeyUIControls.cpp @@ -127,5 +127,3 @@ void CSoundKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selec } } } - -REGISTER_QT_CLASS_DESC(CSoundKeyUIControls, "TrackView.KeyUI.Sound", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/TimeRangeKeyUIControls.cpp b/Code/Editor/TrackView/TimeRangeKeyUIControls.cpp index e35c18329b..11e20d854b 100644 --- a/Code/Editor/TrackView/TimeRangeKeyUIControls.cpp +++ b/Code/Editor/TrackView/TimeRangeKeyUIControls.cpp @@ -122,5 +122,3 @@ void CTimeRangeKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& s } } } - -REGISTER_QT_CLASS_DESC(CTimeRangeKeyUIControls, "TrackView.KeyUI.TimeRange", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/TrackEventKeyUIControls.cpp b/Code/Editor/TrackView/TrackEventKeyUIControls.cpp index 035087733b..835636c080 100644 --- a/Code/Editor/TrackView/TrackEventKeyUIControls.cpp +++ b/Code/Editor/TrackView/TrackEventKeyUIControls.cpp @@ -235,5 +235,3 @@ void CTrackEventKeyUIControls::BuildEventDropDown(QString& curEvent, const QStri } } } - -REGISTER_QT_CLASS_DESC(CTrackEventKeyUIControls, "TrackView.KeyUI.TrackEvent", "TrackViewKeyUI"); diff --git a/Code/Editor/ViewManager.h b/Code/Editor/ViewManager.h index 5b84efd197..f67fb19bcb 100644 --- a/Code/Editor/ViewManager.h +++ b/Code/Editor/ViewManager.h @@ -17,7 +17,6 @@ #include "Cry_Geo.h" #include "Viewport.h" -#include "Include/IViewPane.h" #include "QtViewPaneManager.h" // forward declaration. class CLayoutWnd; diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 5d45bbd853..17f6b0b2f4 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -283,7 +283,6 @@ set(FILES Include/IPreferencesPage.h Include/ISourceControl.h Include/ITransformManipulator.h - Include/IViewPane.h Include/ObjectEvent.h Util/AffineParts.cpp Objects/BaseObject.cpp diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorPlugin.cpp b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorPlugin.cpp index f3d5a03ffc..209df2fa69 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorPlugin.cpp +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorPlugin.cpp @@ -63,7 +63,6 @@ CAudioControlsEditorPlugin::~CAudioControlsEditorPlugin() //-----------------------------------------------------------------------------------------------// void CAudioControlsEditorPlugin::Release() { - UnregisterQtViewPane(); // clear connections before releasing the implementation since they hold pointers to data // instantiated from the implementation dll. CUndoSuspend suspendUndo; @@ -198,15 +197,3 @@ CImplementationManager* CAudioControlsEditorPlugin::GetImplementationManager() { return &ms_implementationManager; } - -//-----------------------------------------------------------------------------------------------// -template<> -REFGUID CQtViewClass::GetClassID() -{ - // {82AD1635-38A6-4642-A801-EAB7A829411B} - static const GUID guid = - { - 0x82AD1635, 0x38A6, 0x4642, { 0xA8, 0x01, 0xEA, 0xB7, 0xA8, 0x29, 0x41, 0x1B } - }; - return guid; -} diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp index 9ad9a50aa5..27c5eac38e 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp @@ -37,7 +37,6 @@ #include "Objects/EntityObject.h" -#include "IViewPane.h" #include "PluginManager.h" #include "Util/3DConnexionDriver.h" #include "UiAnimViewNewSequenceDialog.h" From 1cf7d57b3fffa89367218cc3a82cc6172e4fdd8a Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Mon, 24 Jan 2022 11:20:15 -0800 Subject: [PATCH 398/620] Update deployment scripts to support AWSI automation tests on Linux (#7038) * Update deployment scripts to support AWSI automation tests on Linux Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- .../Gem/PythonTests/AWS/CMakeLists.txt | 6 ------ AutomatedTesting/Gem/PythonTests/AWS/README.md | 2 +- .../PythonTests/AWS/common/aws_credentials.py | 4 ++++ .../Gem/PythonTests/AWS/common/aws_utils.py | 2 +- .../Gem/PythonTests/AWS/common/constants.py | 4 +++- scripts/build/Platform/Linux/build_config.json | 4 ++-- .../Platform/Linux/deploy_cdk_applications.sh | 17 ++++++++++------- .../Platform/Linux/destroy_cdk_applications.sh | 16 ++++++++++------ scripts/build/Platform/Linux/pipeline.json | 14 -------------- .../Windows/deploy_cdk_applications.cmd | 4 ++++ .../Windows/destroy_cdk_applications.cmd | 3 +++ scripts/build/Platform/Windows/pipeline.json | 14 -------------- 12 files changed, 38 insertions(+), 52 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt index c8629bbe8b..10e90ecbfc 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt @@ -12,12 +12,6 @@ ################################################################################ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) - # Only enable AWS automated tests on Windows - set(SUPPORTED_PLATFORMS "Windows" "Linux") - if (NOT "${PAL_PLATFORM_NAME}" IN_LIST SUPPORTED_PLATFORMS) - return() - endif() - ly_add_pytest( NAME AutomatedTesting::AWSTests TEST_SUITE awsi diff --git a/AutomatedTesting/Gem/PythonTests/AWS/README.md b/AutomatedTesting/Gem/PythonTests/AWS/README.md index a25f39d9c2..73ef685261 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/README.md +++ b/AutomatedTesting/Gem/PythonTests/AWS/README.md @@ -3,7 +3,7 @@ ## Prerequisites 1. Build the O3DE Editor and AutomatedTesting.GameLauncher in Profile. 2. Install the latest version of NodeJs. -3. AWS CLI is installed and configured following [Configuration and Credential File Settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). +3. AWS CLI is installed and AWS crendentials are configured via [environment variables](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html) or [default profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). 4. [AWS Cloud Development Kit (CDK)](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#getting_started_install) is installed. ## Deploy CDK Applications diff --git a/AutomatedTesting/Gem/PythonTests/AWS/common/aws_credentials.py b/AutomatedTesting/Gem/PythonTests/AWS/common/aws_credentials.py index c6401f2828..d0bbfe7c3e 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/common/aws_credentials.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/common/aws_credentials.py @@ -68,6 +68,10 @@ class AwsCredentials: if (len(self._credentials.sections()) == 0) and (not self._credentials_file_exists): os.remove(self._credentials_path) return + + credentials_file_dir = os.path.dirname(self._credentials_path) + if not os.path.isdir(credentials_file_dir): + os.makedirs(credentials_file_dir) with open(self._credentials_path, 'w+') as credential_file: self._credentials.write(credential_file) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/common/aws_utils.py b/AutomatedTesting/Gem/PythonTests/AWS/common/aws_utils.py index 92f3762e71..2a5efbd03f 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/common/aws_utils.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/common/aws_utils.py @@ -16,7 +16,7 @@ logging.getLogger('nose').setLevel(logging.WARNING) class AwsUtils: def __init__(self, arn: str, session_name: str, region_name: str): - local_session = boto3.Session(profile_name='default') + local_session = boto3.Session() local_sts_client = local_session.client('sts') self._local_account_id = local_sts_client.get_caller_identity()["Account"] logger.info(f'Local Account Id: {self._local_account_id}') diff --git a/AutomatedTesting/Gem/PythonTests/AWS/common/constants.py b/AutomatedTesting/Gem/PythonTests/AWS/common/constants.py index b12aca5f29..a38974073a 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/common/constants.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/common/constants.py @@ -6,11 +6,13 @@ SPDX-License-Identifier: Apache-2.0 OR MIT """ import os +import platform # ARN of the IAM role to assume for retrieving temporary AWS credentials ASSUME_ROLE_ARN = os.environ.get('ASSUME_ROLE_ARN', 'arn:aws:iam::645075835648:role/o3de-automation-tests') # Name of the AWS project deployed by the CDK applications -AWS_PROJECT_NAME = os.environ.get('O3DE_AWS_PROJECT_NAME', 'AWSAUTO') +AWS_PROJECT_NAME = os.environ.get('O3DE_AWS_PROJECT_NAME').upper() if os.environ.get('O3DE_AWS_PROJECT_NAME') else \ + (os.environ.get('BRANCH_NAME', '') + '-' + os.environ.get('PIPELINE_NAME', '') + '-' + platform.system()).upper() # Region for the existing CloudFormation stacks used by the automation tests AWS_REGION = os.environ.get('O3DE_AWS_DEPLOY_REGION', 'us-east-1') # Name of the default resource mapping config file used by the automation tests diff --git a/scripts/build/Platform/Linux/build_config.json b/scripts/build/Platform/Linux/build_config.json index f61f91169a..c8f8752609 100644 --- a/scripts/build/Platform/Linux/build_config.json +++ b/scripts/build/Platform/Linux/build_config.json @@ -185,11 +185,11 @@ "COMMAND": "build_test_linux.sh", "PARAMETERS": { "CONFIGURATION": "profile", - "OUTPUT_DIRECTORY": "build\\linux", + "OUTPUT_DIRECTORY": "build/linux", "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DLY_PARALLEL_LINK_JOBS=4", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_awsi", - "CTEST_OPTIONS": "-L \"(SUITE_awsi)\" --no-tests=error", + "CTEST_OPTIONS": "-L (SUITE_awsi) --no-tests=error", "TEST_RESULTS": "True" } }, diff --git a/scripts/build/Platform/Linux/deploy_cdk_applications.sh b/scripts/build/Platform/Linux/deploy_cdk_applications.sh index 9a0a31397e..cccc796bdb 100755 --- a/scripts/build/Platform/Linux/deploy_cdk_applications.sh +++ b/scripts/build/Platform/Linux/deploy_cdk_applications.sh @@ -1,5 +1,5 @@ -#!/bin/bash - +#!/usr/bin/env bash +# # 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. # @@ -8,7 +8,7 @@ # Deploy the CDK applications for AWS gems (Linux only) -SOURCE_DIRECTORY=$(dirname "$0") +SOURCE_DIRECTORY=$PWD PATH=$SOURCE_DIRECTORY/python:$PATH GEM_DIRECTORY=$SOURCE_DIRECTORY/Gems @@ -80,11 +80,14 @@ fi # Set temporary AWS credentials from the assume role credentials=$(aws sts assume-role --query Credentials.[SecretAccessKey,SessionToken,AccessKeyId] --output text --role-arn $ASSUME_ROLE_ARN --role-session-name o3de-Automation-session) -AWS_SECRET_ACCESS_KEY=$(echo "$credentials" | cut -d' ' -f1) -AWS_SESSION_TOKEN=$(echo "$credentials" | cut -d' ' -f2) -AWS_ACCESS_KEY_ID=$(echo "$credentials" | cut -d' ' -f3) +export AWS_SECRET_ACCESS_KEY=$(echo $credentials | cut -d' ' -f1) +export AWS_SESSION_TOKEN=$(echo $credentials | cut -d' ' -f2) +export AWS_ACCESS_KEY_ID=$(echo $credentials | cut -d' ' -f3) -O3DE_AWS_DEPLOY_ACCOUNT=$(echo "$ASSUME_ROLE_ARN" | cut -d':' -f5) +export O3DE_AWS_DEPLOY_ACCOUNT=$(echo "$ASSUME_ROLE_ARN" | cut -d':' -f5) +if [[ -z "$O3DE_AWS_PROJECT_NAME" ]]; then + export O3DE_AWS_PROJECT_NAME=$BRANCH_NAME-$PIPELINE_NAME-Linux +fi # Bootstrap and deploy the CDK applications echo [cdk_bootstrap] Bootstrap CDK diff --git a/scripts/build/Platform/Linux/destroy_cdk_applications.sh b/scripts/build/Platform/Linux/destroy_cdk_applications.sh index 54f84911a6..fd91e1a786 100755 --- a/scripts/build/Platform/Linux/destroy_cdk_applications.sh +++ b/scripts/build/Platform/Linux/destroy_cdk_applications.sh @@ -11,7 +11,7 @@ # 1) Node.js is installed # 2) Node.js version >= 10.13.0, except for versions 13.0.0 - 13.6.0. A version in active long-term support is recommended. -SOURCE_DIRECTORY=$(dirname "$0") +SOURCE_DIRECTORY=$PWD PATH=$SOURCE_DIRECTORY/python:$PATH GEM_DIRECTORY=$SOURCE_DIRECTORY/Gems @@ -70,12 +70,12 @@ echo [cdk_installation] Install the current version of nodejs nvm install node echo [cdk_installation] Install the latest version of CDK -if ! sudo npm uninstall -g aws-cdk; +if ! npm uninstall -g aws-cdk; then echo [cdk_bootstrap] Failed to uninstall the current version of CDK exit 1 fi -if ! sudo npm install -g aws-cdk@latest; +if ! npm install -g aws-cdk@latest; then echo [cdk_bootstrap] Failed to install the latest version of CDK exit 1 @@ -83,9 +83,13 @@ fi # Set temporary AWS credentials from the assume role credentials=$(aws sts assume-role --query Credentials.[SecretAccessKey,SessionToken,AccessKeyId] --output text --role-arn $ASSUME_ROLE_ARN --role-session-name o3de-Automation-session) -AWS_SECRET_ACCESS_KEY=$(echo "$credentials" | cut -d' ' -f1) -AWS_SESSION_TOKEN=$(echo "$credentials" | cut -d' ' -f2) -AWS_ACCESS_KEY_ID=$(echo "$credentials" | cut -d' ' -f3) +export AWS_SECRET_ACCESS_KEY=$(echo $credentials | cut -d' ' -f1) +export AWS_SESSION_TOKEN=$(echo $credentials | cut -d' ' -f2) +export AWS_ACCESS_KEY_ID=$(echo $credentials | cut -d' ' -f3) + +if [[ -z "$O3DE_AWS_PROJECT_NAME" ]]; then + export O3DE_AWS_PROJECT_NAME=$BRANCH_NAME-$PIPELINE_NAME-Linux +fi ERROR_EXISTS=0 DestroyCDKApplication AWSCore diff --git a/scripts/build/Platform/Linux/pipeline.json b/scripts/build/Platform/Linux/pipeline.json index e9667d312d..605adf1837 100644 --- a/scripts/build/Platform/Linux/pipeline.json +++ b/scripts/build/Platform/Linux/pipeline.json @@ -16,13 +16,6 @@ }, "PIPELINE_JENKINS_PARAMETERS": { "nightly-incremental": [ - { - "parameter_name": "O3DE_AWS_PROJECT_NAME", - "parameter_type": "string", - "default_value": "", - "use_last_run_value": true, - "description": "The name of the O3DE project that stacks should be deployed for." - }, { "parameter_name": "O3DE_AWS_DEPLOY_REGION", "parameter_type": "string", @@ -46,13 +39,6 @@ } ], "nightly-clean": [ - { - "parameter_name": "O3DE_AWS_PROJECT_NAME", - "parameter_type": "string", - "default_value": "", - "use_last_run_value": true, - "description": "The name of the O3DE project that stacks should be deployed for." - }, { "parameter_name": "O3DE_AWS_DEPLOY_REGION", "parameter_type": "string", diff --git a/scripts/build/Platform/Windows/deploy_cdk_applications.cmd b/scripts/build/Platform/Windows/deploy_cdk_applications.cmd index f3d68d2fe8..fca0835bd8 100644 --- a/scripts/build/Platform/Windows/deploy_cdk_applications.cmd +++ b/scripts/build/Platform/Windows/deploy_cdk_applications.cmd @@ -49,6 +49,10 @@ FOR /f "tokens=1,2,3" %%a IN ('CALL aws sts assume-role --query Credentials.[Sec ) FOR /F "tokens=4 delims=:" %%a IN ("%ASSUME_ROLE_ARN%") DO SET O3DE_AWS_DEPLOY_ACCOUNT=%%a +IF "%O3DE_AWS_PROJECT_NAME%"=="" ( + SET O3DE_AWS_PROJECT_NAME=%BRANCH_NAME%-%PIPELINE_NAME%-Windows +) + REM Bootstrap and deploy the CDK applications ECHO [cdk_bootstrap] Bootstrap CDK CALL cdk bootstrap aws://%O3DE_AWS_DEPLOY_ACCOUNT%/%O3DE_AWS_DEPLOY_REGION% diff --git a/scripts/build/Platform/Windows/destroy_cdk_applications.cmd b/scripts/build/Platform/Windows/destroy_cdk_applications.cmd index dacc9d327a..fe57619ff9 100644 --- a/scripts/build/Platform/Windows/destroy_cdk_applications.cmd +++ b/scripts/build/Platform/Windows/destroy_cdk_applications.cmd @@ -48,6 +48,9 @@ FOR /f "tokens=1,2,3" %%a IN ('CALL aws sts assume-role --query Credentials.[Sec SET AWS_ACCESS_KEY_ID=%%c ) FOR /F "tokens=4 delims=:" %%a IN ("%ASSUME_ROLE_ARN%") DO SET O3DE_AWS_DEPLOY_ACCOUNT=%%a +IF "%O3DE_AWS_PROJECT_NAME%"=="" ( + SET O3DE_AWS_PROJECT_NAME=%BRANCH_NAME%-%PIPELINE_NAME%-Windows +) SET ERROR_EXISTS=0 CALL :DestroyCDKApplication AWSCore,ERROR_EXISTS diff --git a/scripts/build/Platform/Windows/pipeline.json b/scripts/build/Platform/Windows/pipeline.json index 28d8437408..47e6af2d10 100644 --- a/scripts/build/Platform/Windows/pipeline.json +++ b/scripts/build/Platform/Windows/pipeline.json @@ -16,13 +16,6 @@ }, "PIPELINE_JENKINS_PARAMETERS": { "nightly-incremental": [ - { - "parameter_name": "O3DE_AWS_PROJECT_NAME", - "parameter_type": "string", - "default_value": "", - "use_last_run_value": true, - "description": "The name of the O3DE project that stacks should be deployed for." - }, { "parameter_name": "O3DE_AWS_DEPLOY_REGION", "parameter_type": "string", @@ -46,13 +39,6 @@ } ], "nightly-clean": [ - { - "parameter_name": "O3DE_AWS_PROJECT_NAME", - "parameter_type": "string", - "default_value": "", - "use_last_run_value": true, - "description": "The name of the O3DE project that stacks should be deployed for." - }, { "parameter_name": "O3DE_AWS_DEPLOY_REGION", "parameter_type": "string", From b1caed0f8ea5cf8ed14b6daf0d65c1cf7eea2dae Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Mon, 24 Jan 2022 11:22:50 -0800 Subject: [PATCH 399/620] Introduce shortcut labeling in "Find in Viewport" context menu item in the Outliner (#7095) Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- .../AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp index c499d0f92f..31bb067603 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp @@ -890,6 +890,7 @@ namespace AzToolsFramework m_actionGoToEntitiesInViewport = new QAction(tr("Find in viewport"), this); m_actionGoToEntitiesInViewport->setShortcutContext(Qt::WidgetWithChildrenShortcut); + m_actionGoToEntitiesInViewport->setShortcut(tr("Z")); connect(m_actionGoToEntitiesInViewport, &QAction::triggered, this, &EntityOutlinerWidget::GoToEntitiesInViewport); addAction(m_actionGoToEntitiesInViewport); } From f34d3a822e06ac1a12b42a18cb5b18afa15eabf2 Mon Sep 17 00:00:00 2001 From: bosnichd Date: Mon, 24 Jan 2022 13:47:44 -0700 Subject: [PATCH 400/620] Add a ray cast API to the terrain system, implement it, and use it so entities can be placed on top of terrain. (#6895) * Add a ray cast API to the terrain system, implement it, and use it so entities can be placed on top of terrain. Still to do: - Unit tests - Profiling/benchmarks - Optimization (if needed, may not be now after updating to use the iterative approach, but one option could be to use SIMD to ray cast against both triangles at once) Signed-off-by: bosnichd * Fix typos. Signed-off-by: bosnichd * Added a FindNearestIntersectionIterative to use in place of the first-pass FindnearestIntersectionRecursive attempt. Signed-off-by: bosnichd * Remove some functions that are no longer being used. Signed-off-by: bosnichd * Remove a unicode character from a comment to fix the validation build. Signed-off-by: bosnichd * Remove another unicode character from a comment to fix the validation build. Signed-off-by: bosnichd * Update to bail out as soon as t > 1.0f Signed-off-by: bosnichd --- .../AzFramework/Render/IntersectorInterface.h | 2 +- .../Terrain/TerrainDataRequestBus.h | 7 + .../Mocks/Terrain/MockTerrainDataRequestBus.h | 4 + .../Viewport/ViewportMessages.cpp | 13 +- .../TerrainRaycast/TerrainRaycastContext.cpp | 392 ++++++++++++++++++ .../TerrainRaycast/TerrainRaycastContext.h | 62 +++ .../Source/TerrainSystem/TerrainSystem.cpp | 11 + .../Code/Source/TerrainSystem/TerrainSystem.h | 6 + Gems/Terrain/Code/terrain_files.cmake | 2 + 9 files changed, 494 insertions(+), 5 deletions(-) create mode 100644 Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.h diff --git a/Code/Framework/AzFramework/AzFramework/Render/IntersectorInterface.h b/Code/Framework/AzFramework/AzFramework/Render/IntersectorInterface.h index 44e1290911..10ea51dd75 100644 --- a/Code/Framework/AzFramework/AzFramework/Render/IntersectorInterface.h +++ b/Code/Framework/AzFramework/AzFramework/Render/IntersectorInterface.h @@ -24,7 +24,7 @@ namespace AzFramework //! IntersectorBus::EventResult(result, editorContextId, &IntersectorInterface::RayIntersect, ray); //! //! Raycast against all entities - //! RayResultAggregator rayResult; + //! AZ::EBusReduceResult rayResult; //! IntersectorBus::BroadCastResult(rayResult, &IntersectorInterface::RayIntersect, ray); // class IntersectorInterface diff --git a/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h b/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h index 8b29f2a554..f9ef264ab1 100644 --- a/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h +++ b/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include namespace AzFramework @@ -185,6 +187,11 @@ namespace AzFramework SurfacePointRegionFillCallback perPositionCallback, Sampler sampleFilter = Sampler::DEFAULT) const = 0; + //! Get the terrain raycast entity context id. + virtual EntityContextId GetTerrainRaycastEntityContextId() const = 0; + + //! Given a ray, return the closest intersection with terrain. + virtual RenderGeometry::RayResult GetClosestIntersection(const RenderGeometry::RayRequest& ray) const = 0; private: // Private variations of the GetSurfacePoint API exposed to BehaviorContext that returns a value instead of diff --git a/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h b/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h index 52ac28ef63..f5af0ff486 100644 --- a/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h +++ b/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h @@ -102,5 +102,9 @@ namespace UnitTest ProcessSurfaceWeightsFromRegion, void(const AZ::Aabb&, const AZ::Vector2&, AzFramework::Terrain::SurfacePointRegionFillCallback, Sampler)); MOCK_CONST_METHOD4( ProcessSurfacePointsFromRegion, void(const AZ::Aabb&, const AZ::Vector2&, AzFramework::Terrain::SurfacePointRegionFillCallback, Sampler)); + MOCK_CONST_METHOD0( + GetTerrainRaycastEntityContextId, AzFramework::EntityContextId()); + MOCK_CONST_METHOD1( + GetClosestIntersection, AzFramework::RenderGeometry::RayResult(const AzFramework::RenderGeometry::RayRequest&)); }; } // namespace UnitTest diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportMessages.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportMessages.cpp index 24b3c95310..610b9ec854 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportMessages.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportMessages.cpp @@ -7,6 +7,7 @@ */ #include +#include #include namespace AzToolsFramework @@ -66,15 +67,19 @@ namespace AzToolsFramework AZ::Vector3 FindClosestPickIntersection(const AzFramework::RenderGeometry::RayRequest& rayRequest, const float defaultDistance) { - AzFramework::RenderGeometry::RayResult renderGeometryIntersectionResult; + // attempt a ray intersection with any visible mesh or terrain and return the intersection position if successful + AZ::EBusReduceResult renderGeometryIntersectionResult; AzFramework::RenderGeometry::IntersectorBus::EventResult( renderGeometryIntersectionResult, AzToolsFramework::GetEntityContextId(), &AzFramework::RenderGeometry::IntersectorBus::Events::RayIntersect, rayRequest); + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + renderGeometryIntersectionResult, + &AzFramework::Terrain::TerrainDataRequests::GetClosestIntersection, + rayRequest); - // attempt a ray intersection with any visible mesh and return the intersection position if successful - if (renderGeometryIntersectionResult) + if (renderGeometryIntersectionResult.value) { - return renderGeometryIntersectionResult.m_worldPosition; + return renderGeometryIntersectionResult.value.m_worldPosition; } else { diff --git a/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.cpp b/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.cpp new file mode 100644 index 0000000000..d42388db60 --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.cpp @@ -0,0 +1,392 @@ +/* + * 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 + * + */ + +#include +#include + +#include +#include + +using namespace Terrain; + +namespace +{ + //////////////////////////////////////////////////////////////////////////////////////////////////// + // Convenience function to clamp a value to the given grid resolution, rounding up. + inline float ClampToGridRoundUp(float value, float gridResolution) + { + return ceil(value / gridResolution) * gridResolution; + } + + //////////////////////////////////////////////////////////////////////////////////////////////////// + // Convenience function to clamp a value to the given grid resolution, rounding down. + inline float ClampToGridRoundDown(float value, float gridResolution) + { + return floor(value / gridResolution) * gridResolution; + } + + //////////////////////////////////////////////////////////////////////////////////////////////////// + // Convenience function to find the nearest intersection (if any) between an AABB and a ray. + inline void FindNearestIntersection(const AZ::Aabb& aabb, + const AZ::Vector3& rayStart, + const AZ::Vector3& rayDirection, + const AZ::Vector3& rayDirectionReciprocal, + AzFramework::RenderGeometry::RayResult& result) + { + float intersectionT; + float intersectionEndT; + AZ::Vector3 intersectionNormal; + const int intersectionResult = AZ::Intersect::IntersectRayAABB(rayStart, + rayDirection, + rayDirectionReciprocal, + aabb, + intersectionT, + intersectionEndT, + intersectionNormal); + if (intersectionResult != AZ::Intersect::ISECT_RAY_AABB_NONE) + { + result.m_worldPosition = rayStart + (rayDirection * intersectionT); + result.m_worldNormal = intersectionNormal; + result.m_distance = rayDirection.GetLength() * intersectionT; + } + else + { + result.m_distance = FLT_MAX; + } + } + + //////////////////////////////////////////////////////////////////////////////////////////////////// + // Convenience function to find the nearest intersection (if any) between a triangle and a ray. + // This is an implementation of the Moller-Trumbore intersection algorithm. I first attempted to use + // the existing AZ::Intersect::IntersectSegmentTriangleCCW, which appears to use the same algorithm, + // but it takes a line segment as opposed to a ray and was not returning the expected results. Once + // I've written some tests I can go back and try it again to figure out what is different, but this + // is all likely to get replaced with an optimized SIMD version anyway so this should be ok for now. + inline void FindNearestIntersection(const AZ::Vector3& vertexA, + const AZ::Vector3& vertexB, + const AZ::Vector3& vertexC, + const AZ::Vector3& rayStart, + const AZ::Vector3& rayDirection, + AzFramework::RenderGeometry::RayResult& result) + { + const AZ::Vector3 edgeAB = vertexB - vertexA; + const AZ::Vector3 edgeAC = vertexC - vertexA; + const AZ::Vector3 pVec = rayDirection.Cross(edgeAC); + const float det = edgeAB.Dot(pVec); + if (AZ::IsClose(det, 0.0f)) + { + // The ray is parallel to the triangle. + return; + } + + const float detInv = 1.0f / det; + const AZ::Vector3 tVec = rayStart - vertexA; + const float u = detInv * tVec.Dot(pVec); + if (u < 0.0f || u > 1.0f) + { + // No intersection. + return; + } + + const AZ::Vector3 qVec = tVec.Cross(edgeAB); + const float v = detInv * rayDirection.Dot(qVec); + if (v < 0.0 || u + v > 1.0) + { + // No intersection. + return; + } + + const float t = detInv * edgeAC.Dot(qVec); + if (t > FLT_EPSILON) + { + result.m_worldPosition = rayStart + (rayDirection * t); + result.m_worldNormal = edgeAB.Cross(edgeAC); + result.m_distance = rayDirection.GetLength() * t; + } + } + + //////////////////////////////////////////////////////////////////////////////////////////////////// + // Convenience function to get the terrain height values at each corner of an AABB, triangulate them, + // and then find the nearest intersection (if any) between the resulting triangles and the given ray. + inline void TriangulateAndFindNearestIntersection(const TerrainSystem& terrainSystem, + const AZ::Aabb& aabb, + const AZ::Vector3& rayStart, + const AZ::Vector3& rayDirection, + const AZ::Vector3& rayDirectionReciprocal, + AzFramework::RenderGeometry::RayResult& result) + { + // Obtain the height values at each corner of the AABB. + const AZ::Vector3& aabbMin = aabb.GetMin(); + const AZ::Vector3& aabbMax = aabb.GetMax(); + AZ::Vector3 point0 = aabbMin; + AZ::Vector3 point2 = aabbMax; + AZ::Vector3 point1(point0.GetX(), point2.GetY(), 0.0f); + AZ::Vector3 point3(point2.GetX(), point0.GetY(), 0.0f); + point0.SetZ(terrainSystem.GetHeight(point0, AzFramework::Terrain::TerrainDataRequests::Sampler::DEFAULT)); + point1.SetZ(terrainSystem.GetHeight(point1, AzFramework::Terrain::TerrainDataRequests::Sampler::DEFAULT)); + point2.SetZ(terrainSystem.GetHeight(point2, AzFramework::Terrain::TerrainDataRequests::Sampler::DEFAULT)); + point3.SetZ(terrainSystem.GetHeight(point3, AzFramework::Terrain::TerrainDataRequests::Sampler::DEFAULT)); + + // Construct a smaller AABB that tightly encloses the four terrain points. + const float refinedMinZ = AZStd::GetMin(AZStd::GetMin(AZStd::GetMin(point0.GetZ(), point1.GetZ()), point2.GetZ()), point3.GetZ()); + const float refinedMaxZ = AZStd::GetMax(AZStd::GetMax(AZStd::GetMax(point0.GetZ(), point1.GetZ()), point2.GetZ()), point3.GetZ()); + const AZ::Vector3 refinedMin(aabbMin.GetX(), aabbMin.GetY(), refinedMinZ); + const AZ::Vector3 refinedMax(aabbMax.GetX(), aabbMax.GetY(), refinedMaxZ); + const AZ::Aabb refinedAABB = AZ::Aabb::CreateFromMinMax(refinedMin, refinedMax); + + // Check for a hit against the refined AABB. + float intersectionT; + float intersectionEndT; + const int intersectionResult = AZ::Intersect::IntersectRayAABB2(rayStart, + rayDirectionReciprocal, + refinedAABB, + intersectionT, + intersectionEndT); + if (intersectionResult == AZ::Intersect::ISECT_RAY_AABB_NONE) + { + return; + } + + // Finally, triangulate the four terrain points and check for a hit, + // splitting using the top-left -> bottom-right diagonal so to match + // the current behavior of the terrain physics and rendering systems. + AzFramework::RenderGeometry::RayResult bottomLeftIntersectionResult; + FindNearestIntersection(rayStart, + rayDirection, + point0, + point3, + point1, + bottomLeftIntersectionResult); + + AzFramework::RenderGeometry::RayResult topRightIntersectionResult; + FindNearestIntersection(rayStart, + rayDirection, + point2, + point1, + point3, + topRightIntersectionResult); + + if (bottomLeftIntersectionResult) + { + result = !topRightIntersectionResult || bottomLeftIntersectionResult.m_distance < topRightIntersectionResult.m_distance ? + bottomLeftIntersectionResult : + topRightIntersectionResult; + } + else if (topRightIntersectionResult) + { + result = topRightIntersectionResult; + } + } + + //////////////////////////////////////////////////////////////////////////////////////////////////// + // Iterative function that divides an AABB encompasing terrain points into columns (or a voxel grid) + // of size equal to the given grid resolution, steps along the ray visiting each voxel it intersects + // in order from nearest to farthest, then obtains the terrain height values at each corner in order + // to triangulate them and find the nearest intersection (if any) between the triangles and the ray. + // + // Visualization: + // - X: Column intersection but no triangle hit found + // - T: Column intersection with a triangle hit found + // ________________________________________ + // | | | | | | | | | + // |____|____|____|____|____|____|____|____| Ray + // | | | | | | | | | / + // |____|____|____|____|____|____|____|____| / + // | | | | | | | | X |/ + // |____|____|____|____|____|____|____|____/ + // | | | | | | | | X /| + // |____|____|____|____|____|____|____|__/_| + // | | | | | | | | /X | + // |____|____|____|____|____|____|____|/___| + // | | | | | | | X / X | + // |____|____|____|____|____|____|___/|____| + // | | | | | | | T/ | | + // |____|____|____|____|____|____|____|____| + // | | | | | | | | | + // |____|____|____|____|____|____|____|____| + inline void FindNearestIntersectionIterative(const TerrainSystem& terrainSystem, + const AZ::Vector2& terrainResolution, + const AZ::Aabb& terrainWorldBounds, + const AZ::Vector3& rayStart, + const AZ::Vector3& rayEnd, + AzFramework::RenderGeometry::RayResult& result) + { + // Find the nearest intersection (if any) between the ray and terrain world bounds. + // Note that the ray might (and often will) start inside the terrain world bounds. + const AZ::Vector3 rayDirection = rayEnd - rayStart; + const AZ::Vector3 rayDirectionReciprocal = rayDirection.GetReciprocal(); + FindNearestIntersection(terrainWorldBounds, + rayStart, + rayDirection, + rayDirectionReciprocal, + result); + if (!result) + { + // The ray does not intersect the terrain world bounds. + return; + } + + // The terrain world can be visualized as a grid of columns, + // where the terrain resolution determines the dimensions of + // each column, or a voxel grid with one cell in z dimension. + // + // Starting at the voxel containing the initial intersection, + // we want to step along the ray and visit each voxel the ray + // intersects in order from nearest to furthest until we find + // an intersection with the terrain or the ray exits the grid. + const AZ::Vector3& initialIntersection = result.m_worldPosition; + const float initialIntersectionX = initialIntersection.GetX(); + const float initialIntersectionY = initialIntersection.GetY(); + const float initialIntersectionZ = initialIntersection.GetZ(); + const float gridResolutionX = terrainResolution.GetX(); + const float gridResolutionY = terrainResolution.GetY(); + const float gridResolutionZ = terrainWorldBounds.GetMax().GetZ() - terrainWorldBounds.GetMin().GetZ(); + float initialVoxelMinX = ClampToGridRoundDown(initialIntersectionX, gridResolutionX); + float initialVoxelMinY = ClampToGridRoundDown(initialIntersectionY, gridResolutionY); + float initialVoxelMinZ = terrainWorldBounds.GetMin().GetZ(); + float initialVoxelMaxX = ClampToGridRoundUp(initialIntersectionX, gridResolutionX); + float initialVoxelMaxY = ClampToGridRoundUp(initialIntersectionY, gridResolutionY); + float initialVoxelMaxZ = terrainWorldBounds.GetMax().GetZ(); + + // For each axis calculate the distance t we need to move along + // the ray in order to fully traverse a voxel in that dimension. + const float rayDirectionX = rayDirection.GetX(); + const float rayDirectionY = rayDirection.GetY(); + const float rayDirectionZ = rayDirection.GetZ(); + const float stepX = AZ::GetSign(rayDirectionX) * gridResolutionX; + const float stepY = AZ::GetSign(rayDirectionY) * gridResolutionY; + const float stepZ = AZ::GetSign(rayDirectionZ) * gridResolutionZ; + const float tDeltaX = rayDirectionX ? + stepX / rayDirectionX : + std::numeric_limits::max(); + const float tDeltaY = rayDirectionY ? + stepY / rayDirectionY : + std::numeric_limits::max(); + const float tDeltaZ = rayDirectionZ ? + stepZ / rayDirectionZ : + std::numeric_limits::max(); + + // For each axis, calculate the distance t we need to move along the ray + // from the initial intersection point to the next voxel along that axis. + const float offsetX = stepX < 0.0f ? + initialVoxelMinX - initialIntersectionX : + initialVoxelMaxX - initialIntersectionX; + const float offsetY = stepY < 0.0f ? + initialVoxelMinY - initialIntersectionY : + initialVoxelMaxY - initialIntersectionY; + const float offsetZ = stepZ < 0.0f ? + initialVoxelMinZ - initialIntersectionZ : + initialVoxelMaxZ - initialIntersectionZ; + float tMaxX = rayDirectionX ? + offsetX / rayDirectionX : + std::numeric_limits::max(); + float tMaxY = rayDirectionY ? + offsetY / rayDirectionY : + std::numeric_limits::max(); + float tMaxZ = rayDirectionZ ? + offsetZ / rayDirectionZ : + std::numeric_limits::max(); + + // Calculate the min/max voxel grid value on each axis by expanding + // the terrain world bounds so they align with the grid resolution. + const float voxelGridMinX = ClampToGridRoundDown(terrainWorldBounds.GetMin().GetX(), gridResolutionX); + const float voxelGridMinY = ClampToGridRoundDown(terrainWorldBounds.GetMin().GetY(), gridResolutionY); + const float voxelGridMinZ = terrainWorldBounds.GetMin().GetZ(); + const float voxelGridMaxX = ClampToGridRoundUp(terrainWorldBounds.GetMax().GetX(), gridResolutionX); + const float voxelGridMaxY = ClampToGridRoundUp(terrainWorldBounds.GetMax().GetY(), gridResolutionY); + const float voxelGridMaxZ = terrainWorldBounds.GetMax().GetZ(); + + // Using the initial voxel values, construct an AABB representing the current voxel, + // then grab references to AABBs min/max vectors so we can manipulate them directly. + AZ::Aabb currentVoxel = AZ::Aabb::CreateFromMinMax({initialVoxelMinX, initialVoxelMinY, initialVoxelMinZ}, + {initialVoxelMaxX, initialVoxelMaxY, initialVoxelMaxZ}); + AZ::Vector3& currentVoxelMin = const_cast(currentVoxel.GetMin()); + AZ::Vector3& currentVoxelMax = const_cast(currentVoxel.GetMax()); + const AZ::Vector3 stepVecX(stepX, 0.0f, 0.0f); + const AZ::Vector3 stepVecY(0.0f, stepY, 0.0f); + const AZ::Vector3 stepVecZ(0.0f, 0.0f, stepZ); + + // Now we can step along the ray and visit each voxel the ray + // intersects in order from nearest to furthest until we find + // an intersection with the terrain or the ray exits the grid. + result = AzFramework::RenderGeometry::RayResult(); + while (currentVoxel.GetMin().GetX() <= voxelGridMaxX && + currentVoxel.GetMax().GetX() >= voxelGridMinX && + currentVoxel.GetMin().GetY() <= voxelGridMaxY && + currentVoxel.GetMax().GetY() >= voxelGridMinY && + currentVoxel.GetMin().GetZ() <= voxelGridMaxZ && + currentVoxel.GetMax().GetZ() >= voxelGridMinZ && + tMaxX <= 1.0f && tMaxY <= 1.0f && tMaxZ <= 1.0f) + { + TriangulateAndFindNearestIntersection(terrainSystem, + currentVoxel, + rayStart, + rayDirection, + rayDirectionReciprocal, + result); + if (result) + { + // Intersection found. + break; + } + + // Step to the next voxel. + if (tMaxX < tMaxY && tMaxX < tMaxZ) + { + currentVoxelMin += stepVecX; + currentVoxelMax += stepVecX; + tMaxX += tDeltaX; + } + else if (tMaxY < tMaxZ) + { + currentVoxelMin += stepVecY; + currentVoxelMax += stepVecY; + tMaxY += tDeltaY; + } + else + { + currentVoxelMin += stepVecZ; + currentVoxelMax += stepVecZ; + tMaxZ += tDeltaZ; + } + } + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// +TerrainRaycastContext::TerrainRaycastContext(TerrainSystem& terrainSystem) + : m_terrainSystem(terrainSystem) + , m_entityContextId(AzFramework::EntityContextId::CreateRandom()) +{ + AzFramework::RenderGeometry::IntersectorBus::Handler::BusConnect(m_entityContextId); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// +TerrainRaycastContext::~TerrainRaycastContext() +{ + AzFramework::RenderGeometry::IntersectorBus::Handler::BusDisconnect(); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// +AzFramework::RenderGeometry::RayResult TerrainRaycastContext::RayIntersect( + const AzFramework::RenderGeometry::RayRequest& ray) +{ + const AZ::Aabb terrainWorldBounds = m_terrainSystem.GetTerrainAabb(); + const AZ::Vector2 terrainResolution = m_terrainSystem.GetTerrainHeightQueryResolution(); + AzFramework::RenderGeometry::RayResult rayIntersectionResult; + FindNearestIntersectionIterative(m_terrainSystem, + terrainResolution, + terrainWorldBounds, + ray.m_startWorldPosition, + ray.m_endWorldPosition, + rayIntersectionResult); + + // If needed we could call m_terrainSystem.FindBestAreaEntityAtPosition in order to set + // rayIntersectionResult.m_entityAndComponent, but I'm not sure whether that is correct. + return rayIntersectionResult; +} diff --git a/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.h b/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.h new file mode 100644 index 0000000000..a5a50848c3 --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +//////////////////////////////////////////////////////////////////////////////////////////////////// +namespace Terrain +{ + class TerrainSystem; + + //////////////////////////////////////////////////////////////////////////////////////////////// + class TerrainRaycastContext : public AzFramework::RenderGeometry::IntersectorBus::Handler + { + public: + //////////////////////////////////////////////////////////////////////////////////////////// + //! Constructor + //! \param[in] terrainSystem The terrain system that owns this terrain raycast context + TerrainRaycastContext(TerrainSystem& terrainSystem); + + //////////////////////////////////////////////////////////////////////////////////////////// + // Disable copying + AZ_DISABLE_COPY_MOVE(TerrainRaycastContext); + + //////////////////////////////////////////////////////////////////////////////////////////// + //! Destructor + ~TerrainRaycastContext(); + + //////////////////////////////////////////////////////////////////////////////////////////// + //! Access to the terrain raycast context's entity context id + //! \return The terrain raycast context's entity context id + inline AzFramework::EntityContextId GetEntityContextId() const { return m_entityContextId; } + + //////////////////////////////////////////////////////////////////////////////////////////// + //! \ref AzFramework::RenderGeometry::RayIntersect + AzFramework::RenderGeometry::RayResult RayIntersect(const AzFramework::RenderGeometry::RayRequest& ray) override; + + protected: + //////////////////////////////////////////////////////////////////////////////////////////// + // RenderGeometry::IntersectorBus inherits from RenderGeometry::IntersectionNotifications, + // so we must override the following pure virtual functions. We could potentially implement + // them using TerrainSystem::m_registeredAreas, but right now that would not serve a purpose. + ///@{ + //! Unused pure virtual override + void OnEntityConnected(AZ::EntityId) override {} + void OnEntityDisconnected(AZ::EntityId) override {} + void OnGeometryChanged(AZ::EntityId) override {} + ///@} + + private: + //////////////////////////////////////////////////////////////////////////////////////////// + // Variables + TerrainSystem& m_terrainSystem; //!< Terrain system that owns this terrain raycast context + AzFramework::EntityContextId m_entityContextId; //!< This object's entity context id + }; +} // namespace Terrain diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp index 4dfa03ed53..35e6992db3 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp @@ -51,6 +51,7 @@ bool TerrainLayerPriorityComparator::operator()(const AZ::EntityId& layer1id, co } TerrainSystem::TerrainSystem() + : m_terrainRaycastContext(*this) { Terrain::TerrainSystemServiceRequestBus::Handler::BusConnect(); AZ::TickBus::Handler::BusConnect(); @@ -438,6 +439,16 @@ void TerrainSystem::GetSurfacePointFromFloats( GetSurfacePoint(AZ::Vector3(x, y, 0.0f), outSurfacePoint, sampleFilter, terrainExistsPtr); } +AzFramework::EntityContextId TerrainSystem::GetTerrainRaycastEntityContextId() const +{ + return m_terrainRaycastContext.GetEntityContextId(); +} + +AzFramework::RenderGeometry::RayResult TerrainSystem::GetClosestIntersection( + const AzFramework::RenderGeometry::RayRequest& ray) const +{ + return m_terrainRaycastContext.RayIntersect(ray); +} AZ::EntityId TerrainSystem::FindBestAreaEntityAtPosition(float x, float y, AZ::Aabb& bounds) const { diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h index 3e489730d0..1cdb6e52b1 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h @@ -23,6 +23,7 @@ #include #include +#include #include namespace Terrain @@ -187,6 +188,9 @@ namespace Terrain AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, Sampler sampleFilter = Sampler::DEFAULT) const override; + AzFramework::EntityContextId GetTerrainRaycastEntityContextId() const override; + AzFramework::RenderGeometry::RayResult GetClosestIntersection( + const AzFramework::RenderGeometry::RayRequest& ray) const override; private: void ClampPosition(float x, float y, AZ::Vector2& outPosition, AZ::Vector2& normalizedDelta) const; @@ -230,5 +234,7 @@ namespace Terrain mutable AZStd::shared_mutex m_areaMutex; AZStd::map m_registeredAreas; + + mutable TerrainRaycastContext m_terrainRaycastContext; }; } // namespace Terrain diff --git a/Gems/Terrain/Code/terrain_files.cmake b/Gems/Terrain/Code/terrain_files.cmake index ab19d33618..4b994c2587 100644 --- a/Gems/Terrain/Code/terrain_files.cmake +++ b/Gems/Terrain/Code/terrain_files.cmake @@ -27,6 +27,8 @@ set(FILES Source/Components/TerrainWorldDebuggerComponent.h Source/Components/TerrainWorldRendererComponent.cpp Source/Components/TerrainWorldRendererComponent.h + Source/TerrainRaycast/TerrainRaycastContext.cpp + Source/TerrainRaycast/TerrainRaycastContext.h Source/TerrainRenderer/Components/TerrainSurfaceMaterialsListComponent.cpp Source/TerrainRenderer/Components/TerrainSurfaceMaterialsListComponent.h Source/TerrainRenderer/Components/TerrainMacroMaterialComponent.cpp From 640fe70c56f7a5aaaf244d9913f88acc6899fd16 Mon Sep 17 00:00:00 2001 From: Allen Jackson <23512001+jackalbe@users.noreply.github.com> Date: Mon, 24 Jan 2022 15:09:15 -0600 Subject: [PATCH 401/620] Combining the original scene manifest with the new manifest (#7083) * Combining the original scene manifest with the new manifest to allow the OnPrepareForExport to execute Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> * fixing comment Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> --- .../Blast/Editor/Scripts/blast_asset_builder.py | 2 +- .../Editor/Scripts/blast_chunk_processor.py | 17 ++++++++++++++--- Gems/Blast/Editor/Scripts/bootstrap.py | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Gems/Blast/Editor/Scripts/blast_asset_builder.py b/Gems/Blast/Editor/Scripts/blast_asset_builder.py index a570489ed1..cd17360f9f 100644 --- a/Gems/Blast/Editor/Scripts/blast_asset_builder.py +++ b/Gems/Blast/Editor/Scripts/blast_asset_builder.py @@ -15,7 +15,7 @@ manifest that writes out asset chunk data for .blast files import os, traceback, binascii, sys, json, pathlib import azlmbr.math import azlmbr.asset -import azlmbr.asset.entity +import azlmbr.entity import azlmbr.asset.builder import azlmbr.bus diff --git a/Gems/Blast/Editor/Scripts/blast_chunk_processor.py b/Gems/Blast/Editor/Scripts/blast_chunk_processor.py index d112f465e9..500577716b 100644 --- a/Gems/Blast/Editor/Scripts/blast_chunk_processor.py +++ b/Gems/Blast/Editor/Scripts/blast_chunk_processor.py @@ -12,10 +12,10 @@ into a scene manifest This is also a SceneAPI script that executes from a foo.fbx.assetinfo scene manifest that writes out asset chunk data for .blast files """ -import os, traceback, binascii, sys, json, pathlib +import os, traceback, binascii, sys, json, pathlib, logging import azlmbr.math import azlmbr.asset -import azlmbr.asset.entity +import azlmbr.entity import azlmbr.asset.builder import azlmbr.bus @@ -24,6 +24,14 @@ import azlmbr.bus # blastChunksAssetType = azlmbr.math.Uuid_CreateString('{993F0B0F-37D9-48C6-9CC2-E27D3F3E343E}', 0) +def log_exception_traceback(): + """ + Outputs an exception stacktrace. + """ + data = traceback.format_exc() + logger = logging.getLogger('python') + logger.error(data) + def export_chunk_asset(scene, outputDirectory, platformIdentifier, productList): import azlmbr.scene import azlmbr.object @@ -97,7 +105,7 @@ def get_mesh_node_names(sceneGraph): return meshDataList def update_manifest(scene): - import uuid, os + import uuid, os, json import azlmbr.scene as sceneApi import azlmbr.scene.graph from scene_api import scene_data as sceneData @@ -116,6 +124,9 @@ def update_manifest(scene): meshGroup['id'] = '{' + str(uuid.uuid5(uuid.NAMESPACE_DNS, sourceFilenameOnly + chunkPath)) + '}' sceneManifest.mesh_group_select_node(meshGroup, chunkPath) + # combine both scene manifests so the OnPrepareForExport will be called + originalManifest = json.loads(scene.manifest.ExportToJson()) + sceneManifest.manifest["values"].append(originalManifest["values"][0]) return sceneManifest.export() sceneJobHandler = None diff --git a/Gems/Blast/Editor/Scripts/bootstrap.py b/Gems/Blast/Editor/Scripts/bootstrap.py index 93004d474f..aa7e7625e8 100755 --- a/Gems/Blast/Editor/Scripts/bootstrap.py +++ b/Gems/Blast/Editor/Scripts/bootstrap.py @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 OR MIT """ try: import azlmbr.asset - import azlmbr.asset.entity + import azlmbr.entity import azlmbr.asset.builder import blast_asset_builder except: From d1143770e0f985d00ae743614334db761c9f329e Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Mon, 24 Jan 2022 13:17:16 -0800 Subject: [PATCH 402/620] Prefab Focus Mode | Fixes to viewport top toolbar (#7094) * Fixes to the viewport top toolbar. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Additional checks to prevent issues if widgets aren't set up correctly. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Add asserts to catch UI changes that would break this class. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- Code/Editor/ViewPane.cpp | 37 +++++++++---------- Code/Editor/ViewportTitleDlg.cpp | 24 +++++++++--- Code/Editor/ViewportTitleDlg.h | 2 + Code/Editor/ViewportTitleDlg.ui | 15 ++++++++ .../AzQtComponents/Components/ToolBarArea.cpp | 3 +- .../Prefab/PrefabViewportFocusPathHandler.cpp | 3 ++ 6 files changed, 57 insertions(+), 27 deletions(-) diff --git a/Code/Editor/ViewPane.cpp b/Code/Editor/ViewPane.cpp index 90b44d9c9d..99b4c5a1cc 100644 --- a/Code/Editor/ViewPane.cpp +++ b/Code/Editor/ViewPane.cpp @@ -87,29 +87,15 @@ public: } // Handle labels with submenus - if (auto toolLabel = qobject_cast(toolWidget)) + if (auto toolLabel = qobject_cast(toolWidget)) { if (!toolLabel->isVisible()) { // Manually turn the custom context menus into submenus - if (toolLabel->objectName() == "m_fovStaticCtrl") + if (toolLabel->menu()) { - QAction* newAction = menu->addMenu(m_viewportDlg->GetFovMenu()); - newAction->setText(QString("FOV: %1").arg(toolLabel->text())); - } - else if (toolLabel->objectName() == "m_ratioStaticCtrl") - { - QAction* newAction = menu->addMenu(m_viewportDlg->GetAspectMenu()); - newAction->setText(QString("Ratio: %1").arg(toolLabel->text())); - } - else if (toolLabel->objectName() == "m_sizeStaticCtrl") - { - QAction* newAction = menu->addMenu(m_viewportDlg->GetResolutionMenu()); - newAction->setText(QString("%1").arg(toolLabel->text())); - } - else - { - // Don't add actions for other Labels + QAction* action = menu->addMenu(toolLabel->menu()); + action->setText(toolLabel->text()); continue; } } @@ -179,14 +165,25 @@ CLayoutViewPane::CLayoutViewPane(QWidget* parent) toolbar->installEventFilter(&m_viewportTitleDlg); toolbar->setContextMenuPolicy(Qt::CustomContextMenu); connect(toolbar, &QWidget::customContextMenuRequested, &m_viewportTitleDlg, &QWidget::customContextMenuRequested); - setContextMenuPolicy(Qt::NoContextMenu); - + if (QToolButton* expansion = AzQtComponents::ToolBar::getToolBarExpansionButton(toolbar)) { expansion->installEventFilter(m_expanderWatcher); } + AzQtComponents::BreadCrumbs* prefabsBreadcrumbs = + qobject_cast(toolbar->findChild("m_prefabFocusPath")); + QToolButton* backButton = qobject_cast(toolbar->findChild("m_prefabFocusBackButton")); + + AZ_Assert(prefabsBreadcrumbs, "Could not find Prefabs Breadcrumbs widget on CLayoutViewPane initialization!"); + AZ_Assert(backButton, "Could not find Prefabs Breadcrumbs back button on CLayoutViewPane initialization!"); + + if (prefabsBreadcrumbs && backButton) + { + m_viewportTitleDlg.InitializePrefabViewportFocusPathHandler(prefabsBreadcrumbs, backButton); + } + m_id = -1; } diff --git a/Code/Editor/ViewportTitleDlg.cpp b/Code/Editor/ViewportTitleDlg.cpp index 90aa044d25..bbd9eaaa10 100644 --- a/Code/Editor/ViewportTitleDlg.cpp +++ b/Code/Editor/ViewportTitleDlg.cpp @@ -383,12 +383,7 @@ void CViewportTitleDlg::OnInitDialog() bool isPrefabSystemEnabled = false; AzFramework::ApplicationRequests::Bus::BroadcastResult(isPrefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); - if (isPrefabSystemEnabled) - { - m_prefabViewportFocusPathHandler = new AzToolsFramework::Prefab::PrefabViewportFocusPathHandler(); - m_prefabViewportFocusPathHandler->Initialize(m_ui->m_prefabFocusPath, m_ui->m_prefabFocusBackButton); - } - else + if (!isPrefabSystemEnabled) { m_ui->m_prefabFocusPath->setEnabled(false); m_ui->m_prefabFocusBackButton->setEnabled(false); @@ -397,6 +392,23 @@ void CViewportTitleDlg::OnInitDialog() } } +void CViewportTitleDlg::InitializePrefabViewportFocusPathHandler(AzQtComponents::BreadCrumbs* breadcrumbsWidget, QToolButton* backButton) +{ + if (m_prefabViewportFocusPathHandler != nullptr) + { + return; + } + + bool isPrefabSystemEnabled = false; + AzFramework::ApplicationRequests::Bus::BroadcastResult(isPrefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); + + if (isPrefabSystemEnabled) + { + m_prefabViewportFocusPathHandler = new AzToolsFramework::Prefab::PrefabViewportFocusPathHandler(); + m_prefabViewportFocusPathHandler->Initialize(breadcrumbsWidget, backButton); + } +} + ////////////////////////////////////////////////////////////////////////// void CViewportTitleDlg::SetTitle(const QString& title) { diff --git a/Code/Editor/ViewportTitleDlg.h b/Code/Editor/ViewportTitleDlg.h index b8da7f20ea..8d8b06b96d 100644 --- a/Code/Editor/ViewportTitleDlg.h +++ b/Code/Editor/ViewportTitleDlg.h @@ -70,6 +70,8 @@ public: QMenu* const GetAspectMenu(); QMenu* const GetResolutionMenu(); + void InitializePrefabViewportFocusPathHandler(AzQtComponents::BreadCrumbs* breadcrumbsWidget, QToolButton* backButton); + Q_SIGNALS: void ActionTriggered(int command); diff --git a/Code/Editor/ViewportTitleDlg.ui b/Code/Editor/ViewportTitleDlg.ui index 7ba6361cf9..1711bdaf90 100644 --- a/Code/Editor/ViewportTitleDlg.ui +++ b/Code/Editor/ViewportTitleDlg.ui @@ -80,6 +80,9 @@ Camera settings + + Camera settings + :/Menu/camera.svg:/Menu/camera.svg @@ -91,6 +94,9 @@ Debug information + + Debug information + :/Menu/debug.svg:/Menu/debug.svg @@ -105,6 +111,9 @@ Toggle viewport helpers + + Toggle viewport helpers + :/Menu/helpers.svg:/Menu/helpers.svg @@ -119,6 +128,9 @@ Viewport resolution + + Viewport resolution + :/Menu/resolution.svg:/Menu/resolution.svg @@ -130,6 +142,9 @@ Other settings + + Other settings + :/Menu/menu.svg:/Menu/menu.svg diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/ToolBarArea.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/ToolBarArea.cpp index b1ef0a670b..14633dcb78 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/ToolBarArea.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/ToolBarArea.cpp @@ -32,7 +32,8 @@ namespace AzQtComponents { if (QWidget* widget = item->widget()) { - toolbar->addWidget(widget); + QAction* action = toolbar->addWidget(widget); + action->setObjectName(widget->objectName()); } else if (item->spacerItem()) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.cpp index c1fc9138d1..275079371a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.cpp @@ -73,6 +73,9 @@ namespace AzToolsFramework::Prefab { // Push new Path m_breadcrumbsWidget->pushPath(m_prefabFocusPublicInterface->GetPrefabFocusPath(m_editorEntityContextId).c_str()); + + // If root instance is focused, disable the back button; else enable it. + m_backButton->setEnabled(m_prefabFocusPublicInterface->GetPrefabFocusPathLength(m_editorEntityContextId) > 1); } } // namespace AzToolsFramework::Prefab From 075f5ce6931838971706ac8ace940ee457129db7 Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Mon, 24 Jan 2022 14:20:33 -0800 Subject: [PATCH 403/620] Reimplement the GCC fix for the AWS jobs using forward declare (#7088) * Revert the recent AWSApiRequestJob and ServiceRequestJob and use forward declaring to fix the GCC issue Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- .../Code/Include/Framework/AWSApiRequestJob.h | 149 ++++++++-------- .../Include/Framework/ServiceRequestJob.h | 161 +++++++++--------- 2 files changed, 162 insertions(+), 148 deletions(-) diff --git a/Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h b/Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h index 816e9bc4b4..e70aa37f58 100644 --- a/Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h +++ b/Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h @@ -177,6 +177,11 @@ namespace AWSCore using OnSuccessFunction = AZStd::function; using OnFailureFunction = AZStd::function; + class Function; + + template + static AwsApiRequestJob* Create(OnSuccessFunction onSuccess, OnFailureFunction onFailure = OnFailureFunction{}, IConfig* config = GetDefaultConfig()); + static Config* GetDefaultConfig() { static AwsApiJobConfigHolder s_configHolder{}; @@ -188,10 +193,6 @@ namespace AWSCore { } - RequestType request; - ResultType result; - ErrorType error; - /// Override AZ:Job defined method to reset request state when /// the job object is reused. void Reset(bool isClearDependent) override @@ -209,35 +210,11 @@ namespace AWSCore return m_wasSuccess; } + RequestType request; + ResultType result; + ErrorType error; + protected: - - /// Constructor for creating AwsApiRequestJob Jobs that can handle queued responses - /// for OnSuccess, OnFailure, and DoCleanup - AwsApiRequestJob(OnSuccessFunction onSuccess, - OnFailureFunction onFailure, - IConfig* config = GetDefaultConfig() - ) : AwsApiClientJobType(false, config) - , m_queueOnSuccess{ true } - , m_onSuccess{ onSuccess } - , m_queueOnFailure{ true } - , m_onFailure{ onFailure } - , m_queueDelete{ true } - { - } - - bool m_wasSuccess{ false }; - - // Flag and optional function call to queue for onSuccess events - bool m_queueOnSuccess{ false }; - OnSuccessFunction m_onSuccess{}; - - // Flag and optional function call to queue for onFailure events - bool m_queueOnFailure{ false }; - OnFailureFunction m_onFailure{}; - - // Flag to queue the delete during the DoCleanup calls - bool m_queueDelete{ false }; - void Process() override { @@ -295,56 +272,86 @@ namespace AWSCore /// Called when request has completed successfully. virtual void OnSuccess() { - if (m_queueOnSuccess) - { - AZStd::function callbackHandler = [this]() - { - if (m_onSuccess) - { - m_onSuccess(this); - } - delete this; - }; - AZ::TickBus::QueueFunction(callbackHandler); - } } /// Called when the request fails. virtual void OnFailure() { - if (m_queueOnFailure) - { - AZStd::function callbackHandler = [this]() - { - if (m_onFailure) - { - m_onFailure(this); - } - delete this; - }; - AZ::TickBus::QueueFunction(callbackHandler); - } } - /// Called when request can't process and still requires cleanup (Specifically for our derived class Function which does not use auto delete) + /// Called when request can't process and still requires cleanup (Specifically for the derived class AwsApiRequestJob::Function which does not use auto delete) virtual void DoCleanup() { - if (m_queueDelete) - { - AZStd::function callbackHandler = [this]() - { - delete this; - }; - AZ::TickBus::QueueFunction(callbackHandler); - } } - public: - template - static AwsApiRequestJob* Create(OnSuccessFunction onSuccess, OnFailureFunction onFailure = OnFailureFunction{}, IConfig* config = GetDefaultConfig()) - { - return azcreate(AwsApiRequestJob, (onSuccess, onFailure, config), Allocator); - } + bool m_wasSuccess{ false }; }; + /// A specialization of AwsApiRequestJob that lets you provide functions + /// that are called on success or failure of the request. + template + class AwsApiRequestJob::Function + : public AwsApiRequestJob + { + public: + // To use a different allocator, extend this class and use this macro. + AZ_CLASS_ALLOCATOR(Function, AZ::SystemAllocator, 0); + + Function(OnSuccessFunction onSuccess, OnFailureFunction onFailure = OnFailureFunction{}, IConfig* config = GetDefaultConfig()) + : AwsApiRequestJobType( + false, config) // No auto delete - we need to perform our callbacks on the main thread so we queue them through tickbus + , m_onSuccess{ onSuccess } + , m_onFailure{ onFailure } + { + } + + private: + void OnSuccess() override + { + AZStd::function callbackHandler = [this]() + { + if (m_onSuccess) + { + m_onSuccess(this); + } + delete this; + }; + AZ::TickBus::QueueFunction(callbackHandler); + } + + void OnFailure() override + { + AZStd::function callbackHandler = [this]() + { + if (m_onFailure) + { + m_onFailure(this); + } + delete this; + }; + AZ::TickBus::QueueFunction(callbackHandler); + } + + // Code doesn't use auto delete - this allows code to make sure things get cleaned up in cases where success or failure can't be + // called. + void DoCleanup() override + { + AZStd::function callbackHandler = [this]() + { + delete this; + }; + AZ::TickBus::QueueFunction(callbackHandler); + } + + OnSuccessFunction m_onSuccess; + OnFailureFunction m_onFailure; + }; + + template + template + AwsApiRequestJob* AwsApiRequestJob::Create( + OnSuccessFunction onSuccess, OnFailureFunction onFailure, IConfig* config) + { + return azcreate(Function, (onSuccess, onFailure, config), Allocator); + } } // namespace AWSCore diff --git a/Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h b/Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h index d3eac4983a..0c2429b9bb 100644 --- a/Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h +++ b/Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h @@ -150,6 +150,11 @@ namespace AWSCore using OnSuccessFunction = AZStd::function; using OnFailureFunction = AZStd::function; + class Function; + + template + static ServiceRequestJob* Create(OnSuccessFunction onSuccess, OnFailureFunction onFailure = OnFailureFunction{}, IConfig* config = GetDefaultConfig()); + static Config* GetDefaultConfig() { static AwsApiJobConfigHolder s_configHolder{}; @@ -212,45 +217,6 @@ namespace AWSCore } protected: - /// The URL created by appending the API path to the service URL. - /// The path may contain {param} format parameters. The - /// RequestType::parameters.BuildRequest method is responsible - /// for replacing these parts of the url. - const Aws::String& m_requestUrl; - - /// Constructor for creating ServiceRequestJob Jobs that can handle queued responses - /// for OnSuccess, OnFailure, and DoCleanup - ServiceRequestJob(OnSuccessFunction onSuccess, - OnFailureFunction onFailure, - IConfig* config = GetDefaultConfig() - ) : ServiceClientJobType{ false, config } - , m_requestUrl{ config->GetRequestUrl() } - , m_queueOnSuccess{ true } - , m_onSuccess{ onSuccess } - , m_queueOnFailure{ true } - , m_onFailure{ onFailure } - , m_queueDelete{ true } - { - } - - // Flag and optional function call to queue for onSuccess events - bool m_queueOnSuccess{ false }; - OnSuccessFunction m_onSuccess{}; - - // Flag and optional function call to queue for onFailure events - bool m_queueOnFailure{ false }; - OnFailureFunction m_onFailure{}; - - // Flag to queue the delete during the DoCleanup calls - bool m_queueDelete{ false }; - - std::shared_ptr m_AWSAuthSigner{ nullptr }; - - // Passed in configuration contains the AWS Credentials to use. If this request requires credentials - // check in the constructor and set this bool to indicate if we're not valid before placing the credentials - // in the m_AWSAuthSigner - bool m_missingCredentials{ false }; - /// Called to prepare the request. By default no changes /// are made to the parameters object. Override to defer the preparation /// of parameters until running on the job's worker thread, @@ -270,50 +236,31 @@ namespace AWSCore /// Called when a request completes without error. virtual void OnSuccess() { - if (m_queueOnSuccess) - { - AZStd::function callbackHandler = [this]() - { - if (m_onSuccess) - { - m_onSuccess(this); - } - delete this; - }; - AZ::TickBus::QueueFunction(callbackHandler); - } } /// Called when an error occurs. virtual void OnFailure() { - if (m_queueOnFailure) - { - AZStd::function callbackHandler = [this]() - { - if (m_onFailure) - { - m_onFailure(this); - } - delete this; - }; - AZ::TickBus::QueueFunction(callbackHandler); - } } /// Provided so derived functions that do not auto delete can clean up virtual void DoCleanup() { - if (m_queueDelete) - { - AZStd::function callbackHandler = [this]() - { - delete this; - }; - AZ::TickBus::QueueFunction(callbackHandler); - } } + /// The URL created by appending the API path to the service URL. + /// The path may contain {param} format parameters. The + /// RequestType::parameters.BuildRequest method is responsible + /// for replacing these parts of the url. + const Aws::String& m_requestUrl; + + std::shared_ptr m_AWSAuthSigner{ nullptr }; + + // Passed in configuration contains the AWS Credentials to use. If this request requires credentials + // check in the constructor and set this bool to indicate if we're not valid before placing the credentials + // in the m_AWSAuthSigner + bool m_missingCredentials{ false }; + private: bool BuildRequest(RequestBuilder& request) override { @@ -658,13 +605,73 @@ namespace AWSCore AZ_Printf(logRequestsChannel, "Response Body:\n"); PrintRequestOutput(responseContent); } - public: - template - static ServiceRequestJob* Create(OnSuccessFunction onSuccess, OnFailureFunction onFailure = OnFailureFunction{}, IConfig* config = GetDefaultConfig()) - { - return azcreate(ServiceRequestJob, (onSuccess, onFailure, config), Allocator); - } }; + + /// A derived class that calls lambda functions on job completion. + template + class ServiceRequestJob::Function + : public ServiceRequestJob + { + public: + // To use a different allocator, extend this class and use this macro. + AZ_CLASS_ALLOCATOR(Function, AZ::SystemAllocator, 0); + + Function(OnSuccessFunction onSuccess, OnFailureFunction onFailure = OnFailureFunction{}, IConfig* config = GetDefaultConfig()) + : ServiceRequestJob(false, config) // No auto delete - The Function class will handle it with the DoCleanup() function + , m_onSuccess{ onSuccess } + , m_onFailure{ onFailure } + { + } + + private: + void OnSuccess() override + { + AZStd::function callbackHandler = [this]() + { + if (m_onSuccess) + { + m_onSuccess(this); + } + delete this; + }; + AZ::TickBus::QueueFunction(callbackHandler); + } + + void OnFailure() override + { + AZStd::function callbackHandler = [this]() + { + if (m_onFailure) + { + m_onFailure(this); + } + delete this; + }; + AZ::TickBus::QueueFunction(callbackHandler); + } + + // Code doesn't use auto delete - this ensure things get cleaned up in cases when code can't call success or failure + void DoCleanup() override + { + AZStd::function callbackHandler = [this]() + { + delete this; + }; + AZ::TickBus::QueueFunction(callbackHandler); + } + + OnSuccessFunction m_onSuccess; + OnFailureFunction m_onFailure; + + }; + + template + template + ServiceRequestJob* ServiceRequestJob::Create( + OnSuccessFunction onSuccess, OnFailureFunction onFailure, IConfig* config) + { + return azcreate(Function, (onSuccess, onFailure, config), Allocator); + } } // namespace AWSCore From a3fbcae81fda93a1b7a67828439d2dd390d08a34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jan 2022 14:47:38 -0800 Subject: [PATCH 404/620] Bump urllib3 in /scripts/build/build_node/Platform/Linux (#7119) Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.4 to 1.26.5. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/1.26.4...1.26.5) --- updated-dependencies: - dependency-name: urllib3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- scripts/build/build_node/Platform/Linux/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build/build_node/Platform/Linux/requirements.txt b/scripts/build/build_node/Platform/Linux/requirements.txt index 1a466c03f8..7f0536a98e 100644 --- a/scripts/build/build_node/Platform/Linux/requirements.txt +++ b/scripts/build/build_node/Platform/Linux/requirements.txt @@ -36,8 +36,8 @@ requests==2.25.1 \ traceback2==1.4.0 \ --hash=sha256:05acc67a09980c2ecfedd3423f7ae0104839eccb55fc645773e1caa0951c3030 \ --hash=sha256:8253cebec4b19094d67cc5ed5af99bf1dba1285292226e98a31929f87a5d6b23 -urllib3==1.26.4 \ - --hash=sha256:2f4da4594db7e1e110a944bb1b551fdf4e6c136ad42e4234131391e21eb5b0df \ - --hash=sha256:e7b021f7241115872f92f43c6508082facffbd1c048e3c6e2bb9c2a157e28937 +urllib3==1.26.5 \ + --hash=sha256:753a0374df26658f99d826cfe40394a686d05985786d946fbe4165b5148f5a7c \ + --hash=sha256:a7acd0977125325f516bda9735fa7142b909a8d01e8b2e4c8108d0984e6e0098 tempfile2==0.1.1 \ --hash=sha256:77fdd256c16804053d3d588168b79595099ea5e874c3fb171893b0ababd10340 From b83fc89c7440104527f84e66be6965c8b86d1cc6 Mon Sep 17 00:00:00 2001 From: Neil Widmaier Date: Mon, 24 Jan 2022 15:03:27 -0800 Subject: [PATCH 405/620] Making requested changes to LevelLoadTest Signed-off-by: Neil Widmaier --- .../Gem/PythonTests/Atom/TestSuite_Main.py | 4 ++ .../Atom/atom_utils/atom_constants.py | 2 + .../Atom/tests/hydra_Atom_LevelLoadTest.py | 45 +++++++------------ 3 files changed, 22 insertions(+), 29 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py index cca20bbf8c..8fc9838b52 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py @@ -23,6 +23,10 @@ class TestAutomation(EditorTestSuite): enable_prefab_system = True + @pytest.mark.test_case_id("C36529679") + class AtomLevelLoadTest_Editor(EditorSharedTest): + from Atom.tests import hydra_Atom_LevelLoadTest as test_module + @pytest.mark.test_case_id("C36525657") class AtomEditorComponents_BloomAdded(EditorSharedTest): from Atom.tests import hydra_AtomEditorComponents_BloomAdded as test_module diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py index e6d6ac7fb1..393d71f0b2 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py @@ -32,6 +32,8 @@ GLOBAL_ILLUMINATION_QUALITY = { 'High': 2, } +# Level list used in Editor Level Load Test +LEVEL_LIST = ["hermanubis", "hermanubis_high", "macbeth_shaderballs", "PbrMaterialChart", "ShadowTest", "Sponza"] class AtomComponentProperties: """ diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_Atom_LevelLoadTest.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_Atom_LevelLoadTest.py index 77886e2123..1efcbe4d01 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_Atom_LevelLoadTest.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_Atom_LevelLoadTest.py @@ -23,10 +23,9 @@ def Atom_LevelLoadTest(): 1) Create tuple with level load success and failure messages 2) Open the level using the python test tools command 3) Verify level is loaded using a separate command, and report success/failure - 4) Create tuple with success and failure messages for entering gameplay - 5) Enter gameplay and report result - 6) Create tuple with success and failure messages for exiting gameplay - 7) Exit Gameplay and report result + 4) Enter gameplay and report result using a tuple + 5) Exit Gameplay and report result using a tuple + 6) Look for errors or asserts. :return: None """ @@ -34,45 +33,33 @@ def Atom_LevelLoadTest(): import azlmbr.legacy.general as general from editor_python_test_tools.utils import Report, Tracer, TestHelper - - level_list = ["hermanubis", "hermanubis_high", "macbeth_shaderballs", "PbrMaterialChart", "ShadowTest", "Sponza"] + from Atom.atom_utils.atom_constants import LEVEL_LIST with Tracer() as error_tracer: - # - for level in level_list: + for level in LEVEL_LIST: # 1. Create tuple with level load success and failure messages - level_check_tupple = (f"loaded {level}", f"failed to load {level}") + level_check_tuple = (f"loaded {level}", f"failed to load {level}") # 2. Open the level using the python test tools command TestHelper.init_idle() - TestHelper.open_level("graphics", level) + TestHelper.open_level("Graphics", level) # 3. Verify level is loaded using a separate command, and report success/failure - load_success = general.get_current_level_name() - Report.info(load_success) - if load_success == level: - level_match = True - else: - level_match = False - Report.info(level_match) - Report.result(level_check_tupple, level_match) + Report.result(level_check_tuple, level == general.get_current_level_name()) - # 4. Create tuple with success and failure messages for entering gameplay - Enter_game_mode_tupple = (f"{level} entered gameplay successfully ", f"{level} failed to enter gameplay") + # 4. Enter gameplay and report result using a tuple + enter_game_mode_tuple = (f"{level} entered gameplay successfully ", f"{level} failed to enter gameplay") + TestHelper.enter_game_mode(enter_game_mode_tuple) + general.idle_wait_frames(1) - # 5. Enter gameplay and report result - TestHelper.enter_game_mode(Enter_game_mode_tupple) - - # 6. Create tuple with success and failure messages for exiting gameplay - Exit_game_mode_tupple = (f"{level} exited gameplay successfully ", f"{level} failed to exit gameplay") - - # 7. Exit Gameplay and report result - TestHelper.exit_game_mode(Exit_game_mode_tupple) + # 5. Exit gameplay and report result using a tuple + exit_game_mode_tuple = (f"{level} exited gameplay successfully ", f"{level} failed to exit gameplay") + TestHelper.exit_game_mode(exit_game_mode_tuple) - # 11. Look for errors or asserts. + # 6. Look for errors or asserts. TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0) for error_info in error_tracer.errors: Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}") From f3e9e41f4f8e13860d7a25ffc352d5f8d0d5383c Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Mon, 24 Jan 2022 17:09:08 -0600 Subject: [PATCH 406/620] Adding partial implementation of C++20 concepts and range functions for AZStd::span (#7102) * Adding partial implementation of C++20 concepts and range functions for AZStd::span The new concepts to discovered existing issues with the PathIterator and deque::iterator classes PathIterator wasn't properly an input_iterator and therefore the Path classes weren't a range due to an incorrect const_iterator alias The deque::iterator classes was missing the operator+ friend function that accepted a (ptrdiff_t, deque::iterator) to fulfill the random_access_iterator concepts The AZStd implementations of (uninitialized_)copy(_n), (uninitialized_)move(_n) and (uninitialized_)file(_n) have been optimized to use memcpy and memset based on fulfilling the contiguous_iterator concept Fixed invalid AZStd::vector inserts in FrameGraphExecuter.cpp and SliceditorEntityOwnershipService.cpp The code was trying to copy the underlying addresses for vector to a vector using insert, which it was doing by using memcpy. relates to #6749 Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed the `fixed_vector` emplace function to not move initialized elements using uninitialized_move. This was causing initialized elements of the fixed_vector to be overwritten with the element at the emplace position. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed clang warnings about variables that are set, but never read Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the `az_has_builtin_is_constant_evaluated` define to not have "()" as is not a macro. This helps prevent users from using `az_has_builtin_is_constant_evaluated` define in a situation where they want to know if the function is being evaluated in a compile time context. In that case they need to use the `az_builtin_is_constant_evaluated()` macro (which of course looks quite similiar) but does not have the word "has" in it.. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the AZStd span class to be C++20 compliant. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Changed phrase "DoesNotCompiles" to be more grammatically correct. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Added more unit test for AZStd span Fixed an the the return type of the subspan template overload to account for the source span having a dynamic extent. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Removed unused variable from span unit test. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/IO/Path/Path.cpp | 30 +- Code/Framework/AzCore/AzCore/IO/Path/Path.h | 21 +- Code/Framework/AzCore/AzCore/IO/Path/Path.inl | 32 +- .../AzCore/AzCore/IO/Path/PathParser.inl | 17 +- Code/Framework/AzCore/AzCore/PlatformDef.h | 8 +- .../AzCore/AzCore/std/azstd_files.cmake | 7 + Code/Framework/AzCore/AzCore/std/base.h | 2 + .../AzCore/AzCore/std/concepts/concepts.h | 840 ++++++++++++ .../AzCore/AzCore/std/containers/deque.h | 10 +- .../AzCore/std/containers/fixed_vector.h | 25 +- .../AzCore/AzCore/std/containers/span.h | 202 ++- .../AzCore/AzCore/std/containers/span.inl | 276 ++-- .../AzCore/AzCore/std/createdestroy.h | 634 +++++---- .../AzCore/AzCore/std/function/invoke.h | 8 + Code/Framework/AzCore/AzCore/std/iterator.h | 63 +- .../AzCore/std/iterator/iterator_primitives.h | 200 +++ .../AzCore/AzCore/std/ranges/iter_move.h | 81 ++ .../AzCore/AzCore/std/ranges/ranges.h | 1157 +++++++++++++++++ .../AzCore/AzCore/std/string/fixed_string.h | 10 +- .../AzCore/AzCore/std/string/fixed_string.inl | 24 +- .../AzCore/AzCore/std/string/string.h | 57 +- .../AzCore/AzCore/std/string/string_view.h | 32 +- .../AzCore/std/typetraits/common_reference.h | 230 ++++ .../AzCore/std/typetraits/is_convertible.h | 16 +- .../AzCore/std/typetraits/is_destructible.h | 3 + .../AzCore/std/typetraits/is_floating_point.h | 3 + .../AzCore/std/typetraits/is_integral.h | 3 + .../AzCore/AzCore/std/typetraits/is_same.h | 4 + .../AzCore/AzCore/std/typetraits/typetraits.h | 2 + .../AzCore/AzCore/std/utility/declval.h | 15 + .../AzCore/AzCore/std/utility/move.h | 19 + Code/Framework/AzCore/AzCore/std/utils.h | 11 +- .../AzCore/Tests/AZStd/ConceptsTests.cpp | 202 +++ .../AzCore/Tests/AZStd/Iterators.cpp | 162 ++- .../AzCore/Tests/AZStd/RangesTests.cpp | 583 +++++++++ .../AzCore/Tests/AZStd/SpanTests.cpp | 249 ++++ .../AzCore/Tests/AZStd/TypeTraits.cpp | 721 +++++----- .../AzCore/Tests/azcoretests_files.cmake | 3 + .../AssetBrowser/Views/EntryDelegate.cpp | 6 +- .../SliceEditorEntityOwnershipService.cpp | 7 +- .../Code/Source/RHI/FrameGraphExecuter.cpp | 16 +- .../EMotionFXAtom/Code/Source/ActorAsset.cpp | 10 +- Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp | 2 + .../Code/Tests/TestAssetCode/MeshFactory.cpp | 2 + .../TerrainRenderer/TerrainMeshManager.cpp | 32 +- 45 files changed, 4998 insertions(+), 1039 deletions(-) create mode 100644 Code/Framework/AzCore/AzCore/std/concepts/concepts.h create mode 100644 Code/Framework/AzCore/AzCore/std/iterator/iterator_primitives.h create mode 100644 Code/Framework/AzCore/AzCore/std/ranges/iter_move.h create mode 100644 Code/Framework/AzCore/AzCore/std/ranges/ranges.h create mode 100644 Code/Framework/AzCore/AzCore/std/typetraits/common_reference.h create mode 100644 Code/Framework/AzCore/AzCore/std/utility/declval.h create mode 100644 Code/Framework/AzCore/AzCore/std/utility/move.h create mode 100644 Code/Framework/AzCore/Tests/AZStd/ConceptsTests.cpp create mode 100644 Code/Framework/AzCore/Tests/AZStd/RangesTests.cpp create mode 100644 Code/Framework/AzCore/Tests/AZStd/SpanTests.cpp diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.cpp b/Code/Framework/AzCore/AzCore/IO/Path/Path.cpp index 6e4dfdaa63..028ffaf535 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/Path.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.cpp @@ -15,9 +15,9 @@ namespace AZ::IO // Class template instantations template class BasicPath; template class BasicPath; - template class PathIterator; - template class PathIterator; - template class PathIterator; + template class PathIterator; + template class PathIterator; + template class PathIterator; // Swap function instantiations template void swap(Path& lhs, Path& rhs) noexcept; @@ -38,16 +38,16 @@ namespace AZ::IO const typename BasicPath::value_type* rhs); // Iterator compare instantiations - template bool operator==(const PathIterator& lhs, - const PathIterator& rhs); - template bool operator==(const PathIterator& lhs, - const PathIterator& rhs); - template bool operator==(const PathIterator& lhs, - const PathIterator& rhs); - template bool operator!=(const PathIterator& lhs, - const PathIterator& rhs); - template bool operator!=(const PathIterator& lhs, - const PathIterator& rhs); - template bool operator!=(const PathIterator& lhs, - const PathIterator& rhs); + template bool operator==(const PathIterator& lhs, + const PathIterator& rhs); + template bool operator==(const PathIterator& lhs, + const PathIterator& rhs); + template bool operator==(const PathIterator& lhs, + const PathIterator& rhs); + template bool operator!=(const PathIterator& lhs, + const PathIterator& rhs); + template bool operator!=(const PathIterator& lhs, + const PathIterator& rhs); + template bool operator!=(const PathIterator& lhs, + const PathIterator& rhs); } diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.h b/Code/Framework/AzCore/AzCore/IO/Path/Path.h index 7f89809294..235310a5da 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/Path.h +++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.h @@ -43,9 +43,9 @@ namespace AZ::IO public: using string_view_type = AZStd::string_view; using value_type = char; - using const_iterator = const PathIterator; + using const_iterator = PathIterator; using iterator = const_iterator; - friend PathIterator; + friend const_iterator; // constructors and destructor constexpr PathView() = default; @@ -319,9 +319,9 @@ namespace AZ::IO using value_type = typename StringType::value_type; using traits_type = typename StringType::traits_type; using string_view_type = AZStd::string_view; - using const_iterator = const PathIterator; + using const_iterator = PathIterator; using iterator = const_iterator; - friend PathIterator; + friend const_iterator; // constructors and destructor constexpr BasicPath() = default; @@ -692,7 +692,7 @@ namespace AZ::IO friend PathType; using iterator_category = AZStd::bidirectional_iterator_tag; - using value_type = PathType; + using value_type = AZStd::remove_cv_t; using difference_type = ptrdiff_t; using pointer = const value_type*; using reference = const value_type&; @@ -703,8 +703,9 @@ namespace AZ::IO constexpr PathIterator() = default; constexpr PathIterator(const PathIterator&) = default; - + constexpr PathIterator(PathIterator&&) noexcept = default; constexpr PathIterator& operator=(const PathIterator&) = default; + constexpr PathIterator& operator=(PathIterator&&) noexcept = default; constexpr reference operator*() const; @@ -733,10 +734,10 @@ namespace AZ::IO ParserState m_state{ Singular }; }; - template - constexpr bool operator==(const PathIterator& lhs, const PathIterator& rhs); - template - constexpr bool operator!=(const PathIterator& lhs, const PathIterator& rhs); + template + constexpr bool operator==(const PathIterator& lhs, const PathIterator& rhs); + template + constexpr bool operator!=(const PathIterator& lhs, const PathIterator& rhs); } #include diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl index ab991e1750..bde2353112 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl +++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl @@ -399,7 +399,7 @@ namespace AZ::IO constexpr auto PathView::begin() const -> const_iterator { auto pathParser = parser::PathParser::CreateBegin(m_path, m_preferred_separator); - PathIterator it; + const_iterator it; it.m_path_ref = this; it.m_state = static_cast(pathParser.m_parser_state); it.m_path_entry_view = pathParser.m_path_raw_entry; @@ -409,7 +409,7 @@ namespace AZ::IO constexpr auto PathView::end() const -> const_iterator { - PathIterator it; + const_iterator it; it.m_state = const_iterator::AtEnd; it.m_path_ref = this; return it; @@ -1262,7 +1262,7 @@ namespace AZ::IO constexpr auto BasicPath::begin() const -> const_iterator { auto pathParser = parser::PathParser::CreateBegin(m_path, m_preferred_separator); - PathIterator it; + const_iterator it; it.m_path_ref = this; it.m_state = static_cast(pathParser.m_parser_state); it.m_path_entry_view = pathParser.m_path_raw_entry; @@ -1273,7 +1273,7 @@ namespace AZ::IO template constexpr auto BasicPath::end() const -> const_iterator { - PathIterator it; + const_iterator it; it.m_state = const_iterator::AtEnd; it.m_path_ref = this; return it; @@ -1529,16 +1529,16 @@ namespace AZ::IO const typename BasicPath::value_type* rhs); // Iterator compare explicit declarations - extern template bool operator==(const PathIterator& lhs, - const PathIterator& rhs); - extern template bool operator==(const PathIterator& lhs, - const PathIterator& rhs); - extern template bool operator==(const PathIterator& lhs, - const PathIterator& rhs); - extern template bool operator!=(const PathIterator& lhs, - const PathIterator& rhs); - extern template bool operator!=(const PathIterator& lhs, - const PathIterator& rhs); - extern template bool operator!=(const PathIterator& lhs, - const PathIterator& rhs); + extern template bool operator==(const PathIterator& lhs, + const PathIterator& rhs); + extern template bool operator==(const PathIterator& lhs, + const PathIterator& rhs); + extern template bool operator==(const PathIterator& lhs, + const PathIterator& rhs); + extern template bool operator!=(const PathIterator& lhs, + const PathIterator& rhs); + extern template bool operator!=(const PathIterator& lhs, + const PathIterator& rhs); + extern template bool operator!=(const PathIterator& lhs, + const PathIterator& rhs); } diff --git a/Code/Framework/AzCore/AzCore/IO/Path/PathParser.inl b/Code/Framework/AzCore/AzCore/IO/Path/PathParser.inl index b19c518ff9..f8712551b0 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/PathParser.inl +++ b/Code/Framework/AzCore/AzCore/IO/Path/PathParser.inl @@ -10,6 +10,7 @@ #include #include +#include namespace AZ::IO::Internal { @@ -17,7 +18,7 @@ namespace AZ::IO::Internal { return elem == '/' || elem == '\\'; } - template >> + template >> static constexpr bool HasDrivePrefix(InputIt first, EndIt last) { size_t prefixSize = AZStd::distance(first, last); @@ -46,7 +47,7 @@ namespace AZ::IO::Internal //! Windows root names can have include drive letter within them template constexpr auto ConsumeRootName(InputIt entryBeginIter, InputIt entryEndIter, const char preferredSeparator) - -> AZStd::enable_if_t, InputIt> + -> AZStd::enable_if_t, InputIt> { if (preferredSeparator == PosixPathSeparator) { @@ -147,7 +148,7 @@ namespace AZ::IO::Internal //! If the preferred separator is '/' just checks if the path starts with a '/ //! Otherwise a check for a Windows absolute path occurs //! Windows absolute paths can include a RootName - template >> + template >> static constexpr bool IsAbsolute(InputIt first, EndIt last, const char preferredSeparator) { size_t pathSize = AZStd::distance(first, last); @@ -208,11 +209,11 @@ namespace AZ::IO::parser enum ParserState : uint8_t { // Zero is a special sentinel value used by default constructed iterators. - PS_BeforeBegin = PathIterator::BeforeBegin, - PS_InRootName = PathIterator::InRootName, - PS_InRootDir = PathIterator::InRootDir, - PS_InFilenames = PathIterator::InFilenames, - PS_AtEnd = PathIterator::AtEnd + PS_BeforeBegin = PathView::const_iterator::BeforeBegin, + PS_InRootName = PathView::const_iterator::InRootName, + PS_InRootDir = PathView::const_iterator::InRootDir, + PS_InFilenames = PathView::const_iterator::InFilenames, + PS_AtEnd = PathView::const_iterator::AtEnd }; struct PathParser diff --git a/Code/Framework/AzCore/AzCore/PlatformDef.h b/Code/Framework/AzCore/AzCore/PlatformDef.h index 8609ad5756..8416099f15 100644 --- a/Code/Framework/AzCore/AzCore/PlatformDef.h +++ b/Code/Framework/AzCore/AzCore/PlatformDef.h @@ -248,14 +248,14 @@ #if defined(__has_builtin) #if __has_builtin(__builtin_is_constant_evaluated) #define az_builtin_is_constant_evaluated() __builtin_is_constant_evaluated() - #define az_has_builtin_is_constant_evaluated() true + #define az_has_builtin_is_constant_evaluated true #endif #elif AZ_COMPILER_MSVC >= 1928 #define az_builtin_is_constant_evaluated() __builtin_is_constant_evaluated() - #define az_has_builtin_is_constant_evaluated() true + #define az_has_builtin_is_constant_evaluated true #elif AZ_COMPILER_GCC #define az_builtin_is_constant_evaluated() __builtin_is_constant_evaluated() - #define az_has_builtin_is_constant_evaluated() true + #define az_has_builtin_is_constant_evaluated true #endif #endif @@ -271,7 +271,7 @@ } } #define az_builtin_is_constant_evaluated() AZ::Internal::builtin_is_constant_evaluated() - #define az_has_builtin_is_constant_evaluated() false + #define az_has_builtin_is_constant_evaluated false #endif // define builtin functions used by char_traits class for efficient compile time and runtime diff --git a/Code/Framework/AzCore/AzCore/std/azstd_files.cmake b/Code/Framework/AzCore/AzCore/std/azstd_files.cmake index d516a56295..fe169c4964 100644 --- a/Code/Framework/AzCore/AzCore/std/azstd_files.cmake +++ b/Code/Framework/AzCore/AzCore/std/azstd_files.cmake @@ -19,6 +19,7 @@ set(FILES any.h base.h config.h + concepts/concepts.h createdestroy.h docs.h exceptions.h @@ -27,11 +28,14 @@ set(FILES hash.cpp hash.h hash_table.h + iterator/iterator_primitives.h iterator.h limits.h numeric.h math.h optional.h + ranges/iter_move.h + ranges/ranges.h ratio.h reference_wrapper.h sort.h @@ -151,6 +155,7 @@ set(FILES typetraits/alignment_of.h typetraits/config.h typetraits/common_type.h + typetraits/common_reference.h typetraits/conjunction.h typetraits/disjunction.h typetraits/extent.h @@ -217,4 +222,6 @@ set(FILES typetraits/void_t.h typetraits/internal/type_sequence_traits.h typetraits/internal/is_template_copy_constructible.h + utility/declval.h + utility/move.h ) diff --git a/Code/Framework/AzCore/AzCore/std/base.h b/Code/Framework/AzCore/AzCore/std/base.h index 46d1821328..44b11c61ef 100644 --- a/Code/Framework/AzCore/AzCore/std/base.h +++ b/Code/Framework/AzCore/AzCore/std/base.h @@ -30,4 +30,6 @@ namespace AZStd using std::nullptr_t; using sys_time_t = AZ::s64; + + using std::byte; } diff --git a/Code/Framework/AzCore/AzCore/std/concepts/concepts.h b/Code/Framework/AzCore/AzCore/std/concepts/concepts.h new file mode 100644 index 0000000000..420b671f31 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/std/concepts/concepts.h @@ -0,0 +1,840 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace AZStd +{ + // alias std::pointer_traits into the AZStd::namespace + using std::pointer_traits; + + // Alias re-declarations from iterator.h + /// Identifying tag for input iterators. + using input_iterator_tag = std::input_iterator_tag; + /// Identifying tag for output iterators. + using output_iterator_tag = std::output_iterator_tag; + /// Identifying tag for forward iterators. + using forward_iterator_tag = std::forward_iterator_tag; + /// Identifying tag for bidirectional iterators. + using bidirectional_iterator_tag = std::bidirectional_iterator_tag; + /// Identifying tag for random-access iterators. + using random_access_iterator_tag = std::random_access_iterator_tag; + /// Identifying tag for contagious iterators + struct contiguous_iterator_tag; +} + +namespace AZStd::Internal +{ + template + constexpr bool pointer_traits_has_to_address_v = false; + + template + constexpr bool pointer_traits_has_to_address_v::to_address(declval()))>>> > = true; + + + // pointer_traits isn't SFINAE friendly https://cplusplus.github.io/LWG/lwg-active.html#3545 + // So working around that by checking if type T has an element_type alias + template + constexpr bool pointer_traits_valid_and_has_to_address_v = false; + template + constexpr bool pointer_traits_valid_and_has_to_address_v> > + = pointer_traits_has_to_address_v; +} + +namespace AZStd +{ + //! Implements the C++20 to_address function + //! This obtains the address represented by ptr without forming a reference + //! to the pointee type + template + constexpr T* to_address(T* ptr) noexcept + { + static_assert(!AZStd::is_function_v, "Invoking to address on a function pointer is not allowed"); + return ptr; + } + //! Fancy pointer overload which delegates to using a specialization of pointer_traits::to_address + //! if that is a well-formed expression, otherwise it returns ptr->operator->() + //! For example invoking `to_address(AZStd::reverse_iterator(char_ptr))` + //! Returns an element of type const char* + template + constexpr auto to_address(const T& ptr) noexcept + { + if constexpr (AZStd::Internal::pointer_traits_valid_and_has_to_address_v) + { + return pointer_traits::to_address(ptr); + } + else + { + return to_address(ptr.operator->()); + } + } +} + +namespace AZStd::Internal +{ + // Variadic template which maps types to true For SFINAE + template + constexpr bool sfinae_trigger_v = true; + + template + constexpr bool is_class_or_enum = false; + template + constexpr bool is_class_or_enum> || is_enum_v>)>> = true; + + template + constexpr bool assignable_from_impl = false; + template + constexpr bool assignable_from_impl + && common_reference_with&, const remove_reference_t&> + && same_as() = declval()), LHS> >> = true; + + + template + constexpr bool common_with_impl = false; + template + constexpr bool common_with_impl, common_type_t> + && sfinae_trigger_v>(declval()))> + && sfinae_trigger_v>(declval()))> + && common_reference_with, add_lvalue_reference_t> + && common_reference_with>, common_reference_t, add_lvalue_reference_t>> + >> = true; +} + +namespace AZStd +{ + template + /*concept*/ constexpr bool common_with = Internal::common_with_impl; + + template + /*concept*/ constexpr bool assignable_from = Internal::assignable_from_impl; + + template + /*concept*/ constexpr bool constructible_from = destructible && is_constructible_v; + + template + /*concept*/ constexpr bool move_constructible = constructible_from && convertible_to; + + template + /*concept*/ constexpr bool derived_from = is_base_of_v && is_convertible_v; +} + +namespace AZStd::ranges::Internal +{ + template + constexpr bool is_class_or_enum_with_swap_adl = false; + template + constexpr bool is_class_or_enum_with_swap_adl> || is_enum_v> + || is_class_v> || is_enum_v>) + && is_void_v(), declval()))>> + >> = true; + + template + void swap(T&, T&) = delete; + + struct swap_fn + { + template + constexpr auto operator()(T&& t, U&& u) const noexcept(noexcept(swap(AZStd::forward(t), AZStd::forward(u)))) + ->enable_if_t> + { + swap(AZStd::forward(t), AZStd::forward(u)); + } + + // ranges::swap customization point https://eel.is/c++draft/concepts#concept.swappable-2.2 + // Implemented in ranges.h as to prevent circular dependency. + // ranges::swap_ranges depends on the range concepts that can't be defined here + template + constexpr auto operator()(T&& t, U&& u) const noexcept(noexcept((*this)(*t, *u))) + ->enable_if_t + && is_array_v && is_array_v && (extent_v == extent_v) + >; + + template + constexpr auto operator()(T& t1, T& t2) const noexcept(noexcept(is_nothrow_move_constructible_v&& is_nothrow_move_assignable_v)) + ->enable_if_t&& assignable_from> + { + auto temp(AZStd::move(t1)); + t1 = AZStd::move(t2); + t2 = AZStd::move(temp); + } + }; +} + +namespace AZStd::ranges +{ + inline namespace customization_point_object + { + inline constexpr auto swap = Internal::swap_fn{}; + } +} + +namespace AZStd::Internal +{ + template + constexpr bool swappable_impl = false; + template + constexpr bool swappable_impl(), declval()))>> = true; + + template + constexpr bool swappable_with_impl = false; + template + constexpr bool swappable_with_impl + && sfinae_trigger_v< + decltype(AZStd::ranges::swap(declval(), declval())), + decltype(AZStd::ranges::swap(declval(), declval())), + decltype(AZStd::ranges::swap(declval(), declval())), + decltype(AZStd::ranges::swap(declval(), declval()))>>> = true; +} +namespace AZStd +{ + template + /*concept*/ constexpr bool signed_integral = integral && is_signed_v; + template + /*concept*/ constexpr bool unsigned_integral = integral && !signed_integral; + + template + /*concept*/ constexpr bool swappable = Internal::swappable_impl; + + template + /*concept*/ constexpr bool swappable_with = Internal::swappable_with_impl; +} + + +namespace AZStd::Internal +{ + // boolean-testable concept (exposition only in the C++standard) + template + constexpr bool boolean_testable_impl = convertible_to; + + template + constexpr bool boolean_testable = false; + template + constexpr bool boolean_testable && boolean_testable_impl())>>> = true; + + // weakly comparable ==, != + template + constexpr bool weakly_equality_comparable_with = false; + template + constexpr bool weakly_equality_comparable_with&>() == declval&>())> + && boolean_testable&>() != declval&>())> + && boolean_testable&>() == declval&>())> + && boolean_testable&>() != declval&>())> + >> = true; + + // partially ordered <, >, <=, >= + template + constexpr bool partially_ordered_with_impl = false; + template + constexpr bool partially_ordered_with_impl&>() < declval&>())> + && boolean_testable&>() > declval&>())> + && boolean_testable&>() <= declval&>())> + && boolean_testable&>() >= declval&>())> + && boolean_testable&>() < declval&>())> + && boolean_testable&>() > declval&>())> + && boolean_testable&>() <= declval&>())> + && boolean_testable&>() >= declval&>())> + >> = true; +} + +namespace AZStd +{ + template + /*concept*/ constexpr bool equality_comparable = Internal::weakly_equality_comparable_with; +} + +namespace AZStd::Internal +{ + // equally_comparable + partially ordered + template + constexpr bool equally_comparable_with_impl = false; + template + constexpr bool equally_comparable_with_impl + && equality_comparable + && common_reference_with&, const remove_reference_t&> + && equality_comparable&, const remove_reference_t&>> + && Internal::weakly_equality_comparable_with + >> = true; +} + +namespace AZStd +{ + template + /*concept*/ constexpr bool equality_comparable_with = Internal::equally_comparable_with_impl; + + template + /*concept*/ constexpr bool partially_ordered_with = Internal::partially_ordered_with_impl; + + template + /*concept*/ constexpr bool totally_ordered = equality_comparable && partially_ordered_with; +} + +namespace AZStd::Internal +{ + // equally_comparable + partially ordered + template + constexpr bool totally_ordered_with_impl = false; + template + constexpr bool totally_ordered_with_impl&& totally_ordered + && equality_comparable_with + && totally_ordered&, const remove_reference_t&>> + && partially_ordered_with + >> = true; +} + +namespace AZStd +{ + template + /*concept*/ constexpr bool totally_ordered_with = Internal::totally_ordered_with_impl; +} + +namespace AZStd::Internal +{ + template + inline constexpr bool is_default_initializable = false; + template + inline constexpr bool is_default_initializable> = true; + + template + constexpr bool default_initializable_impl = false; + template + constexpr bool default_initializable_impl < T, enable_if_t < constructible_from + && sfinae_trigger_v && Internal::is_default_initializable >> = true; + + template + constexpr bool movable_impl = false; + template + constexpr bool movable_impl && move_constructible && + assignable_from && swappable> > = true; + + template + constexpr bool copy_constructible_impl = false; + template + constexpr bool copy_constructible_impl && + constructible_from && convertible_to && + constructible_from && convertible_to && + constructible_from && convertible_to> > = true; +} + +namespace AZStd +{ + // movable + template + /*concept*/ constexpr bool movable = Internal::movable_impl; + + // default_initializable + template + /*concept*/ constexpr bool default_initializable = Internal::default_initializable_impl; + + // copy constructible + template + /*concept*/ constexpr bool copy_constructible = Internal::copy_constructible_impl; +} + +namespace AZStd::Internal +{ + template + constexpr bool copyable_impl = false; + template + constexpr bool copyable_impl && movable && assignable_from && + assignable_from && assignable_from> > = true; +} + +namespace AZStd +{ + // copyable + template + /*concept*/ constexpr bool copyable = Internal::copyable_impl; + + // semiregular + template + /*concept*/ constexpr bool semiregular = copyable && default_initializable; + + // regular + template + /*concept*/ constexpr bool regular = semiregular && equality_comparable; +} + +// Iterator Concepts +namespace AZStd::Internal +{ + template + constexpr bool is_integer_like = integral && !same_as; + + template + constexpr bool is_signed_integer_like = signed_integral; + + template + constexpr bool weakly_incrementable_impl = false; + template + constexpr bool weakly_incrementable_impl + && is_signed_integer_like> + && same_as()), T&> + && sfinae_trigger_v()++)> >> = true; +} + +namespace AZStd +{ + // models weakly_incrementable concept + template + /*concept*/ constexpr bool weakly_incrementable = Internal::weakly_incrementable_impl; + + // models input_or_output_iterator concept + template + /*concept*/ constexpr bool input_or_output_iterator = !is_void_v + && weakly_incrementable; +} + +namespace AZStd::Internal +{ + template + constexpr bool incrementable_impl = false; + template + constexpr bool incrementable_impl + && weakly_incrementable + && same_as()++), T> >> = true; +} + +namespace AZStd +{ + template + /*concept*/ constexpr bool incrementable = Internal::incrementable_impl; +} + +namespace AZStd +{ + template + /*concept*/ constexpr bool sentinel_for = semiregular && + input_or_output_iterator && + Internal::weakly_equality_comparable_with; + template + inline constexpr bool disable_sized_sentinel_for = false; +} + +namespace AZStd::Internal +{ + template + /*concept*/ constexpr bool sized_sentinel_for_impl = false; + template + /*concept*/ constexpr bool sized_sentinel_for_impl + && !disable_sized_sentinel_for, remove_cv_t> + && same_as() - declval()), iter_difference_t> + && same_as() - declval()), iter_difference_t> >> = true; +} + +namespace AZStd +{ + template + /*concept*/ constexpr bool sized_sentinel_for = Internal::sized_sentinel_for_impl; + + template + struct iterator_traits; +} + +namespace AZStd::Internal +{ + // ITER_CONCEPT(I) general concept + template + constexpr bool use_traits_iterator_concept_for_concept = false; + template + constexpr bool use_traits_iterator_concept_for_concept::iterator_concept>> = true; + + template + constexpr bool use_traits_iterator_category_for_concept = false; + template + constexpr bool use_traits_iterator_category_for_concept::iterator_category>> = !use_traits_iterator_concept_for_concept; + + template + constexpr bool use_random_access_iterator_tag_for_concept = false; + template + constexpr bool use_random_access_iterator_tag_for_concept>> = !use_traits_iterator_concept_for_concept + && !use_traits_iterator_category_for_concept; + + template + struct iter_concept; + + template + struct iter_concept>> + { + using type = typename iterator_traits::iterator_concept; + }; + template + struct iter_concept>> + { + using type = typename iterator_traits::iterator_category; + }; + + template + struct iter_concept>> + { + using type = random_access_iterator_tag; + }; + template + using iter_concept_t = typename iter_concept::type; +} + +namespace AZStd +{ + // indirectly readable + template + /*concept*/ constexpr bool indirectly_readable = Internal::indirectly_readable_impl>; +} + +namespace AZStd::Internal +{ + // model the indirectly writable concept + template + constexpr bool indirectly_writable_impl = false; + + template + constexpr bool indirectly_writable_impl() = declval()), + decltype(*declval() = declval()), + decltype(const_cast&&>(*declval()) = declval()), + decltype(const_cast&&>(*declval()) = declval())> + > = true; +} +namespace AZStd +{ + // indirectly writable + template + /*concept*/ constexpr bool indirectly_writable = Internal::indirectly_writable_impl; + + // indirectly movable + template + /*concept*/ constexpr bool indirectly_movable = indirectly_readable && indirectly_writable>; +} + +namespace AZStd::Internal +{ + template + constexpr bool indirectly_movable_storage_impl = false; + + template + constexpr bool indirectly_movable_storage_impl && + indirectly_writable> && + movable> && + constructible_from, iter_rvalue_reference_t> && + assignable_from&, iter_rvalue_reference_t>> > = true; +} + +namespace AZStd +{ + template + /*concept*/ constexpr bool indirectly_movable_storable = Internal::indirectly_movable_storage_impl; +} + +namespace AZStd::Internal +{ + template + constexpr bool indirectly_copyable_impl = false; + + template + constexpr bool indirectly_copyable_impl && + indirectly_writable>> > = true; +} + +namespace AZStd +{ + // indirectly copyable + template + /*concept*/ constexpr bool indirectly_copyable = Internal::indirectly_copyable_impl; +} +namespace AZStd::Internal +{ + template + constexpr bool indirectly_copyable_storable_impl = false; + + template + constexpr bool indirectly_copyable_storable_impl && + indirectly_writable&> && + indirectly_writable&> && + indirectly_writable&&> && + indirectly_writable&&> && + copyable> && + constructible_from, iter_reference_t> && + assignable_from&, iter_reference_t>> > = true; +} + +namespace AZStd +{ + template + /*concept*/ constexpr bool indirectly_copyable_storable = Internal::indirectly_copyable_storable_impl; +} + +namespace AZStd::ranges::Internal +{ + template + void iter_swap(I1, I2) = delete; + + template + constexpr bool iter_swap_adl = false; + + template + constexpr bool iter_swap_adl(), declval()))>> = true; + + template + constexpr bool is_class_or_enum_with_iter_swap_adl = false; + + template + constexpr bool is_class_or_enum_with_iter_swap_adl + && (is_class_v> || is_enum_v>) + && (is_class_v> || is_enum_v>)>> = true; + + struct iter_swap_fn + { + template + constexpr auto operator()(I1&& i1, I2&& i2) const + ->enable_if_t + > + { + iter_swap(AZStd::forward(i1), AZStd::forward(i2)); + } + template + constexpr auto operator()(I1&& i1, I2&& i2) const + ->enable_if_t + && indirectly_readable + && indirectly_readable + && swappable_with, iter_reference_t> + > + { + ranges::swap(*i1, *i2); + } + + template + constexpr auto operator()(I1&& i1, I2&& i2) const + ->enable_if_t + && indirectly_movable_storable + && indirectly_movable_storable + > + { + *AZStd::forward(i1) = iter_exchange_move(AZStd::forward(i2), AZStd::forward(i1)); + } + + private: + template + static constexpr iter_value_t iter_exchange_move(X&& x, Y&& y) + noexcept(noexcept(iter_value_t(iter_move(x))) && noexcept(*x = iter_move(y))) + { + iter_value_t old_value(iter_move(x)); + *x = iter_move(y); + return old_value; + } + }; +} + +namespace AZStd::ranges +{ + inline namespace customization_point_object + { + inline constexpr Internal::iter_swap_fn iter_swap{}; + } +} + + +namespace AZStd::Internal +{ + template + constexpr bool indirectly_swappable_impl = false; + template + constexpr bool indirectly_swappable_impl&& indirectly_readable + && sfinae_trigger_v< + decltype(AZStd::ranges::iter_swap(declval(), declval())), + decltype(AZStd::ranges::iter_swap(declval(), declval())), + decltype(AZStd::ranges::iter_swap(declval(), declval())), + decltype(AZStd::ranges::iter_swap(declval(), declval()))>>> = true; +} + +namespace AZStd +{ + template + /*concept*/ constexpr bool indirectly_swappable = Internal::indirectly_swappable_impl; +} + +namespace AZStd::Internal +{ + template + constexpr bool input_iterator_impl = false; + template + constexpr bool input_iterator_impl + && derived_from, input_iterator_tag> + && indirectly_readable + >> = true; +} + +namespace AZStd +{ + // input iterator + template + /*concept*/ constexpr bool input_iterator = Internal::input_iterator_impl; +} + +namespace AZStd::Internal +{ + template + constexpr bool output_iterator_impl = false; + template + constexpr bool output_iterator_impl + && indirectly_writable + && sfinae_trigger_v()++ = AZStd::declval())> + >> = true; +} + +namespace AZStd +{ + // output iterator + template + /*concept*/ constexpr bool output_iterator = Internal::output_iterator_impl; +} + +namespace AZStd::Internal +{ + template + constexpr bool forward_iterator_impl = false; + template + constexpr bool forward_iterator_impl + && derived_from, forward_iterator_tag> + && incrementable + && sentinel_for> > = true; +} + +namespace AZStd +{ + // forward_iterator + template + /*concept*/ constexpr bool forward_iterator = Internal::forward_iterator_impl; +} + +namespace AZStd::Internal +{ + template + constexpr bool bidirectional_iterator_impl = false; + template + constexpr bool bidirectional_iterator_impl + && derived_from, bidirectional_iterator_tag> + && same_as()), I&> + && same_as()--), I> >> = true; +} + +namespace AZStd +{ + // bidirectional iterator + template + /*concept*/ constexpr bool bidirectional_iterator = Internal::bidirectional_iterator_impl; +} + +namespace AZStd::Internal +{ + template + constexpr bool random_access_iterator_impl = false; + template + constexpr bool random_access_iterator_impl + && derived_from, random_access_iterator_tag> + && totally_ordered + && sized_sentinel_for + && same_as() += declval>()), I&> + && same_as() + declval>()), I> + && same_as>() + declval()), I> + && same_as() -= declval>()), I&> + && same_as() - declval>()), I> + && same_as()[declval>()]), iter_reference_t>>> + = true; +} + +namespace AZStd +{ + template + /*concept*/ constexpr bool random_access_iterator = Internal::random_access_iterator_impl; +} + +namespace AZStd::Internal +{ + template + constexpr bool contiguous_iterator_impl = false; + template + constexpr bool contiguous_iterator_impl + && derived_from, contiguous_iterator_tag> + && is_lvalue_reference_v> + && indirectly_readable + && same_as, remove_cvref_t>> + > > + = same_as())), add_pointer_t>>; +} + +namespace AZStd +{ + // contiguous iterator + template + /*concept*/ constexpr bool contiguous_iterator = Internal::contiguous_iterator_impl; +} + +namespace AZStd::Internal +{ + // models the predicate concept + template + constexpr bool predicate_impl = false; + template + constexpr bool predicate_impl = Internal::boolean_testable>; +} + +namespace AZStd +{ + // models the predicate concept + template + /*concept*/ constexpr bool predicate = Internal::predicate_impl, F, Args...>; + + // models the relation concept + template + /*concept*/ constexpr bool relation = predicate && predicate + && predicate && predicate; + + // models the equivalence_relation concept + template + /*concept*/ constexpr bool equivalence_relation = relation; + + // models the strict_weak_order concept + // Note: semantically this is different than equivalence_relation + template + /*concept*/ constexpr bool strict_weak_order = relation; +} diff --git a/Code/Framework/AzCore/AzCore/std/containers/deque.h b/Code/Framework/AzCore/AzCore/std/containers/deque.h index 9eed66aeb3..d34bdb6b5a 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/deque.h +++ b/Code/Framework/AzCore/AzCore/std/containers/deque.h @@ -135,9 +135,10 @@ namespace AZStd AZ_FORCE_INLINE this_type& operator--() { --m_offset; return *this; } AZ_FORCE_INLINE this_type operator--(int) { this_type tmp = *this; --m_offset; return tmp; } AZ_FORCE_INLINE this_type& operator+=(difference_type offset) { m_offset += offset; return *this; } - AZ_FORCE_INLINE this_type operator+(difference_type offset) { this_type tmp = *this; tmp += offset; return tmp; } + AZ_FORCE_INLINE this_type operator+(difference_type offset) const { this_type tmp = *this; tmp += offset; return tmp; } + friend AZ_FORCE_INLINE this_type operator+(difference_type offset, const this_type& rhs) { this_type tmp = rhs; tmp += offset; return tmp; } AZ_FORCE_INLINE this_type& operator-=(difference_type offset) { m_offset -= offset; return *this; } - AZ_FORCE_INLINE this_type operator-(difference_type offset) { this_type tmp = *this; tmp -= offset; return tmp; } + AZ_FORCE_INLINE this_type operator-(difference_type offset) const { this_type tmp = *this; tmp -= offset; return tmp; } /// ??? AZ_FORCE_INLINE difference_type operator-(const this_type& rhs) const { @@ -197,9 +198,10 @@ namespace AZStd AZ_FORCE_INLINE this_type& operator--() { --base_type::m_offset; return *this; } AZ_FORCE_INLINE this_type operator--(int) { this_type tmp = *this; --base_type::m_offset; return tmp; } AZ_FORCE_INLINE this_type& operator+=(difference_type offset) { base_type::m_offset += offset; return *this; } - AZ_FORCE_INLINE this_type operator+(difference_type offset) { this_type tmp = *this; tmp += offset; return tmp; } + AZ_FORCE_INLINE this_type operator+(difference_type offset) const { this_type tmp = *this; tmp += offset; return tmp; } + friend AZ_FORCE_INLINE this_type operator+(difference_type offset, const this_type& rhs) { this_type tmp = rhs; tmp += offset; return tmp; } AZ_FORCE_INLINE this_type& operator-=(difference_type offset) { base_type::m_offset -= offset; return *this; } - AZ_FORCE_INLINE this_type operator-(difference_type offset) { this_type tmp = *this; tmp -= offset; return tmp; } + AZ_FORCE_INLINE this_type operator-(difference_type offset) const { this_type tmp = *this; tmp -= offset; return tmp; } AZ_FORCE_INLINE difference_type operator-(const this_type& rhs) const { return rhs.m_offset <= base_type::m_offset ? base_type::m_offset - rhs.m_offset : -(difference_type)(rhs.m_offset - base_type::m_offset); diff --git a/Code/Framework/AzCore/AzCore/std/containers/fixed_vector.h b/Code/Framework/AzCore/AzCore/std/containers/fixed_vector.h index 13f3ef2d7a..22edfbd927 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/fixed_vector.h +++ b/Code/Framework/AzCore/AzCore/std/containers/fixed_vector.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -101,7 +102,7 @@ namespace AZStd::Internal //! Invokes destructor on all elements in range //! No-op on empty container //! Nothing to destroy since the storage is empty. - template >> + template >> static constexpr void unsafe_destroy(InputIt, InputIt) noexcept { } @@ -214,7 +215,7 @@ namespace AZStd::Internal //! Destructs elements in the range [begin, end). //! This does not modify the size of the storage //! This is a no-op for trivial types - template >> + template >> void unsafe_destroy(InputIt, InputIt) noexcept { } @@ -334,7 +335,7 @@ namespace AZStd::Internal //! Destructs elements in the range [begin, end). //! This does not modify the size of the storage //! Invokes the destuctor via the AZStd::destroy method - template >> + template >> void unsafe_destroy(InputIt first, InputIt last) noexcept(is_nothrow_destructible_v) { AZSTD_CONTAINER_ASSERT(first >= data() && first <= data() + size(), "begin iterator is not in range of storage"); @@ -410,7 +411,7 @@ namespace AZStd AZStd::uninitialized_fill_n(data(), numElements, value); } - template >> + template >> fixed_vector(InputIt first, InputIt last) { resize_no_construct(AZStd::distance(first, last)); @@ -615,7 +616,7 @@ namespace AZStd insert(end(), numElements, value); } - template >> + template >> void assign(InputIt first, InputIt last) { clear(); @@ -641,8 +642,18 @@ namespace AZStd return &newElement; } - AZStd::uninitialized_move(insertPosPtr, dataEnd, insertPosPtr + 1); + // We need to move data with care, it is overlapping. + + // first move the last element into the uninitialized position as that will not overlap. + pointer nonOverlap = dataEnd - 1; + AZStd::uninitialized_move(nonOverlap, dataEnd, dataEnd); + + // copy the memory backwards while performing AZStd::move on the existing elements the area with overlapping memory + // to move the elments to the right by 1 + AZStd::move_backward(insertPosPtr, nonOverlap, dataEnd); + // add new elements AZStd::construct_at(insertPosPtr, AZStd::forward(args)...); + resize_no_construct(size() + 1); return iterator(insertPosPtr); } iterator insert(const_iterator insertPos, const_reference value) @@ -707,7 +718,7 @@ namespace AZStd } } - template>> + template>> void insert(const_iterator insertPos, InputIt first, InputIt last) { // specialize for iterator categories. diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.h b/Code/Framework/AzCore/AzCore/std/containers/span.h index fbf5f56870..d0ac704fc3 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/span.h +++ b/Code/Framework/AzCore/AzCore/std/containers/span.h @@ -7,9 +7,37 @@ */ #pragma once -#include -#include #include +#include +#include +#include + +namespace AZStd +{ + inline constexpr size_t dynamic_extent = numeric_limits::max(); + + template + class span; +} + +namespace AZStd::Internal +{ + template + inline constexpr bool is_std_array = false; + + template + inline constexpr bool is_std_array<::AZStd::array> = true; + + template + inline constexpr bool is_std_span = false; + + template + inline constexpr bool is_std_span<::AZStd::span> = true; + + template + inline constexpr bool is_array_convertible = is_convertible_v; + +} namespace AZStd { @@ -33,97 +61,149 @@ namespace AZStd * * Since the span does not copy and store any data, it is only valid as long as the data used to create it is valid. */ - template - class span final + template + class span { public: using element_type = T; using value_type = AZStd::remove_cv_t; - - using pointer = T*; - using const_pointer = const T*; - - using reference = T&; - using const_reference = const T&; - using size_type = AZStd::size_t; using difference_type = AZStd::ptrdiff_t; - using iterator = T*; - using const_iterator = const T*; + using pointer = element_type*; + using const_pointer = const element_type*; + + using reference = element_type&; + using const_reference = const element_type&; + + + using iterator = element_type*; + using const_iterator = const element_type*; using reverse_iterator = AZStd::reverse_iterator; using const_reverse_iterator = AZStd::reverse_iterator; - constexpr span(); + inline static constexpr size_t extent = Extent; + + constexpr span() noexcept = default;; ~span() = default; - constexpr span(pointer s, size_type length); + template && + Internal::is_array_convertible>, T> && + Extent == dynamic_extent>* = nullptr> + constexpr span(It first, size_type length); - constexpr span(pointer first, pointer last); + template && + Internal::is_array_convertible>, T> && + Extent != dynamic_extent, int> = 0> + constexpr explicit span(It first, size_type length); - // We explicitly delete this constructor because it's too easy to accidentally - // create a span to just the first element instead of an entire array. - constexpr span(const_pointer s) = delete; + template && + Internal::is_array_convertible>, T> && + sized_sentinel_for && + Extent == dynamic_extent>* = nullptr> + constexpr span(It first, End last); - template - constexpr span(Container& data); + template && + Internal::is_array_convertible>, T> && + sized_sentinel_for && + Extent != dynamic_extent, int> = 0> + constexpr explicit span(It first, End last); - template - constexpr span(const Container& data); + template> + constexpr span(type_identity_t (&arr)[N]) noexcept; - constexpr span(const span&) = default; + template > + constexpr span(array& data) noexcept; + template > + constexpr span(const array& data) noexcept; - constexpr span(span&& other); + template && + ranges::sized_range && + (ranges::borrowed_range || is_const_v) && + !Internal::is_std_span> && + !Internal::is_std_array> && + !is_array_v> && + Internal::is_array_convertible>, element_type> >> + constexpr span(R&& r); + + template >> + constexpr span(const span& other); + + constexpr span(const span&) noexcept = default; constexpr span& operator=(const span& other) = default; - constexpr span& operator=(span&& other); + // subviews -> https://eel.is/c++draft/views#span.sub + template + constexpr span first() const; + template + constexpr span last() const; + template + constexpr auto subspan() const; - constexpr size_type size() const; + constexpr span first(size_type count) const; + constexpr span last(size_type count) const; + constexpr span subspan(size_type offset, size_type count = dynamic_extent) const; - constexpr bool empty() const; + // observers - https://eel.is/c++draft/views#span.obs + constexpr size_type size() const noexcept; + constexpr size_type size_bytes() const noexcept; - constexpr pointer data(); - constexpr const_pointer data() const; + [[nodiscard]] constexpr bool empty() const noexcept; - constexpr const_reference operator[](size_type index) const; - constexpr reference operator[](size_type index); + // element access - https://eel.is/c++draft/views#span.elem + constexpr reference operator[](size_type index) const; + constexpr reference front() const; + constexpr reference back() const; + constexpr pointer data() const noexcept; - constexpr void erase(); + // iterator support - https://eel.is/c++draft/views#span.iterators + constexpr iterator begin() const noexcept; + constexpr iterator end() const noexcept; - constexpr iterator begin(); - constexpr iterator end(); - constexpr const_iterator begin() const; - constexpr const_iterator end() const; - - constexpr const_iterator cbegin() const; - constexpr const_iterator cend() const; - - constexpr reverse_iterator rbegin(); - constexpr reverse_iterator rend(); - constexpr const_reverse_iterator rbegin() const; - constexpr const_reverse_iterator rend() const; - - constexpr const_reverse_iterator crbegin() const; - constexpr const_reverse_iterator crend() const; - - friend bool operator==(span lhs, span rhs) - { - return lhs.m_begin == rhs.m_begin && lhs.m_end == rhs.m_end; - } - - friend bool operator!=(span lhs, span rhs) { return !(lhs == rhs); } - friend bool operator< (span lhs, span rhs) { return lhs.m_begin < rhs.m_begin || lhs.m_begin == rhs.m_begin && lhs.m_end < rhs.m_end; } - friend bool operator> (span lhs, span rhs) { return lhs.m_begin > rhs.m_begin || lhs.m_begin == rhs.m_begin && lhs.m_end > rhs.m_end; } - friend bool operator<=(span lhs, span rhs) { return lhs == rhs || lhs < rhs; } - friend bool operator>=(span lhs, span rhs) { return lhs == rhs || lhs > rhs; } + constexpr reverse_iterator rbegin() const noexcept; + constexpr reverse_iterator rend() const noexcept; private: - pointer m_begin; - pointer m_end; + pointer m_data{}; + size_type m_size{}; }; + // deduction guides https://eel.is/c++draft/views#span.deduct + template >> + span(It, EndOrSize) -> span>>; + + // array deductions + template + span(T(&)[N]) -> span; + template + span(array&) -> span; + template + span(const array&) -> span; + + template >> + span(R&&) -> span>>; + + // [span.objectrep], views of object representation + template + auto as_bytes(span s) noexcept + -> span; + + template + auto as_writable_bytes(span s) noexcept + -> enable_if_t, span>; + } // namespace AZStd +namespace AZStd::ranges +{ + template + inline constexpr bool enable_view> = true; + template + inline constexpr bool enable_borrowed_range> = true; +} + #include diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.inl b/Code/Framework/AzCore/AzCore/std/containers/span.inl index 2b24a11fc3..765056cb67 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/span.inl +++ b/Code/Framework/AzCore/AzCore/std/containers/span.inl @@ -9,116 +9,206 @@ namespace AZStd { - template - inline constexpr span::span() - : m_begin(nullptr) - , m_end(nullptr) - { } + template + template && + Internal::is_array_convertible>, T> && + Extent == dynamic_extent>*> + inline constexpr span::span(It first, size_type length) + : m_data{ to_address(first) } + , m_size{ length } + {} - template - inline constexpr span::span(pointer s, size_type length) - : m_begin(s) - , m_end(m_begin + length) + template + template && + Internal::is_array_convertible>, T> && + Extent != dynamic_extent, int>> + inline constexpr span::span(It first, size_type length) + : m_data{ to_address(first) } + , m_size{ length } + {} + + template + template && + Internal::is_array_convertible>, T> && + sized_sentinel_for && + Extent == dynamic_extent>*> + inline constexpr span::span(It first, End last) + : m_data{to_address(first)} + , m_size(last - first) + {} + + template + template && + Internal::is_array_convertible>, T> && + sized_sentinel_for && + Extent != dynamic_extent, int>> + inline constexpr span::span(It first, End last) + : m_data{to_address(first)} + , m_size(last - first) + {} + + template + template + inline constexpr span::span(type_identity_t(&arr)[N]) noexcept + : m_data{ arr } + , m_size{ N } + {} + + template + template + inline constexpr span::span(array& arr) noexcept + : m_data{ arr.data() } + , m_size{ arr.size() } + {} + template + template + inline constexpr span::span(const array& arr) noexcept + : m_data{ arr.data() } + , m_size{ arr.size() } + {} + + template + template + inline constexpr span::span(R&& r) + : m_data{ ranges::data(r) } + , m_size{ ranges::size(r) } { - if (length == 0) erase(); + AZ_Assert(Extent == dynamic_extent || Extent == m_size, "The extent of the span is non dynamic," + " therefore the range size must match the extent. Extent=%zu, Range size=%zu", + Extent, ranges::size(r)); } - template - inline constexpr span::span(pointer first, pointer last) - : m_begin(first) - , m_end(last) - { } - - template - template - inline constexpr span::span(Container& data) - : m_begin(data.data()) - , m_end(m_begin + data.size()) - { } - - template - template - inline constexpr span::span(const Container& data) - : m_begin(data.data()) - , m_end(m_begin + data.size()) - { } - - template - inline constexpr span::span(span&& other) - : span(other.m_begin, other.m_end) + template + template + inline constexpr span::span(const span& other) + : m_data{ other.data() } + , m_size{ other.size() } { -#if AZ_DEBUG_BUILD // Clearing the original pointers isn't necessary, but is good for debugging - other.m_begin = nullptr; - other.m_end = nullptr; -#endif + AZ_Assert(Extent == dynamic_extent || Extent == m_size, "The extent of the span is non dynamic," + " therefore the current size of the other span must match the extent. Extent=%zu, Other span size=%zu", + Extent, other.size()); } - template - inline constexpr AZStd::size_t span::size() const { return m_end - m_begin; } - - template - inline constexpr bool span::empty() const { return m_end == m_begin; } - - template - inline constexpr Element* span::data() { return m_begin; } - - template - inline constexpr const Element* span::data() const { return m_begin; } - - template - inline constexpr span& span::operator=(span&& other) + // subviews + template + template + inline constexpr auto span::first() const -> span { - m_begin = other.m_begin; - m_end = other.m_end; -#if AZ_DEBUG_BUILD // Clearing the original pointers isn't necessary, but is good for debugging - other.m_begin = nullptr; - other.m_end = nullptr; -#endif - return *this; + static_assert(Count <= Extent, "Count is larger than the Extent of the span, a subview of the first" + " Count elemnts of the span cannot be returned"); + AZ_Assert(Count <= size(), "Count %zu is larger than span size %zu", Count, size()); + return span{data(), Count}; } - - template - inline constexpr const Element& span::operator[](AZStd::size_t index) const + template + inline constexpr auto span::first(size_type count) const -> span + { + AZ_Assert(count <= size(), "Count %zu is larger than current size of span size %zu", count, size()); + return { data(), count }; + } + + template + template + inline constexpr auto span::last() const -> span + { + static_assert(Count <= Extent, "Count is larger than the Extent of the span, a subview of the last" + " Count elements of the span cannot be returned"); + AZ_Assert(Count <= size(), "Count %zu is larger than span size %zu", Count, size()); + return span{data() + (size() - Count), Count}; + } + template + inline constexpr auto span::last(size_type count) const -> span + { + AZ_Assert(count <= size(), "Count %zu is larger than span size %zu", count, size()); + return { data() + (size() - count), count }; + } + + template + template + inline constexpr auto span::subspan() const + { + static_assert(Offset <= Extent && (Count == dynamic_extent || Count <= Extent - Offset), + "Subspan Offset must <= span Extent and the Count must be either dynamic_extent" + " or <= (span Extent - Offset)"); + AZ_Assert(Offset <= size() && (Count == dynamic_extent || Count <= size() - Offset), + "Either the Subspan Offset %zu is larger than the span size %zu or the Count != dynamic_extent and" + " its value %zu is greater than \"span size - Offset\" %zu", + Offset, size(), Count, size() - Offset); + using return_type = span; + return return_type{ data() + Offset, Count != dynamic_extent ? Count : size() - Offset }; + } + + template + inline constexpr auto span::subspan(size_type offset, size_type count) const -> span + { + AZ_Assert(offset <= size() && (count == dynamic_extent || count <= size() - offset), + "Either the Subspan offset %zu is larger than the span size %zu or the count != dynamic_extent and" + " its value %zu is greater than \"span size - offset\" %zu", + offset, size(), count, size() - offset); + return { data() + offset, count != dynamic_extent ? count : size() - offset }; + } + + + // observers + template + inline constexpr auto span::size() const noexcept -> size_type { return m_size; } + + template + inline constexpr auto span::size_bytes() const noexcept -> size_type { return m_size * sizeof(element_type); } + + template + [[nodiscard]] inline constexpr bool span::empty() const noexcept{ return size() == 0; } + + // element access + template + inline constexpr auto span::operator[](size_type index) const -> reference { AZ_Assert(index < size(), "index value is out of range"); - return m_begin[index]; + return data()[index]; } - template - inline constexpr Element& span::operator[](AZStd::size_t index) + template + inline constexpr auto span::front() const -> reference { - AZ_Assert(index < size(), "index value is out of range"); - return m_begin[index]; + AZ_Assert(!empty(), "span cannot be empty when invoking front"); + return *data(); } - template - inline constexpr void span::erase() { m_begin = m_end = nullptr; } - - template - inline constexpr Element* span::begin() { return m_begin; } - template - inline constexpr Element* span::end() { return m_end; } - template - inline constexpr const Element* span::begin() const { return m_begin; } - template - inline constexpr const Element* span::end() const { return m_end; } + template + inline constexpr auto span::back() const -> reference + { + AZ_Assert(!empty(), "span cannot be empty when invoking back"); + return *(data() + (size() - 1)); + } - template - inline constexpr const Element* span::cbegin() const { return m_begin; } - template - inline constexpr const Element* span::cend() const { return m_end; } + // iterator support + template + inline constexpr auto span::data() const noexcept -> pointer { return m_data; } - template - inline constexpr AZStd::reverse_iterator span::rbegin() { return AZStd::reverse_iterator(m_end); } - template - inline constexpr AZStd::reverse_iterator span::rend() { return AZStd::reverse_iterator(m_begin); } - template - inline constexpr AZStd::reverse_iterator span::rbegin() const { return AZStd::reverse_iterator(m_end); } - template - inline constexpr AZStd::reverse_iterator span::rend() const { return AZStd::reverse_iterator(m_begin); } + template + inline constexpr auto span::begin() const noexcept -> iterator{ return m_data; } + template + inline constexpr auto span::end() const noexcept -> iterator { return m_data + m_size; } - template - inline constexpr AZStd::reverse_iterator span::crbegin() const { return AZStd::reverse_iterator(cend()); } - template - inline constexpr AZStd::reverse_iterator span::crend() const { return AZStd::reverse_iterator(cbegin()); } + template + inline constexpr auto span::rbegin() const noexcept -> reverse_iterator { return AZStd::make_reverse_iterator(end()); } + template + inline constexpr auto span::rend() const noexcept -> reverse_iterator { return AZStd::make_reverse_iterator(begin()); } + + + template + inline auto as_bytes(span s) noexcept + -> span + { + return span( + reinterpret_cast(s.data()), s.size_bytes()); + } + + + template + inline auto as_writable_bytes(span s) noexcept + -> enable_if_t, span> + { + return span( + reinterpret_cast(s.data()), s.size_bytes()); + } } // namespace AZStd diff --git a/Code/Framework/AzCore/AzCore/std/createdestroy.h b/Code/Framework/AzCore/AzCore/std/createdestroy.h index 355374a13a..2f5c7fde92 100644 --- a/Code/Framework/AzCore/AzCore/std/createdestroy.h +++ b/Code/Framework/AzCore/AzCore/std/createdestroy.h @@ -7,22 +7,19 @@ */ #pragma once +#include #include #include #include #include #include #include -#include #include #include #include // AZStd::addressof namespace AZStd { - // alias std::pointer_traits into the AZStd::namespace - using std::pointer_traits; - //! Bring the names of uninitialized_default_construct and //! uninitialized_default_construct_n into the AZStd namespace using std::uninitialized_default_construct; @@ -34,42 +31,6 @@ namespace AZStd using std::uninitialized_value_construct_n; } -namespace AZStd::Internal -{ - template - constexpr bool pointer_traits_has_to_address_v = false; - template - constexpr bool pointer_traits_has_to_address_v::to_address(declval()))>> = true; -} - -namespace AZStd -{ - //! Implements the C++20 to_address function - //! This obtains the address represented by ptr without forming a reference - //! to the pointee type - template - constexpr T* to_address(T* ptr) noexcept - { - static_assert(!AZStd::is_function_v, "Invoking to address on a function pointer is not allowed"); - return ptr; - } - //! Fancy pointer overload which delegates to using a specialization of pointer_traits::to_address - //! if that is a well-formed expression, otherwise it returns ptr->operator->() - //! For example invoking `to_address(AZStd::reverse_iterator(char_ptr))` - //! Returns an element of type const char* - template - constexpr auto to_address(const T& ptr) noexcept - { - if constexpr (AZStd::Internal::pointer_traits_has_to_address_v) - { - return pointer_traits::to_address(ptr); - } - else - { - return AZStd::to_address(ptr.operator->()); - } - } -} namespace AZStd::Internal { /** @@ -81,7 +42,7 @@ namespace AZStd::Internal /** * Type has trivial destructor. We don't call it. */ - template ::value_type, bool = is_trivially_destructible_v> + template , bool = is_trivially_destructible_v> struct destroy { static constexpr void range(InputIterator first, InputIterator last) { (void)first; (void)last; } @@ -163,7 +124,7 @@ namespace AZStd::Internal * Default object construction. */ // placement new isn't a core constant expression therefore it cannot be used in a constexpr function - template::value_type, + template, bool = is_trivially_constructible_v> struct construct { @@ -242,93 +203,125 @@ namespace AZStd::Internal ////////////////////////////////////////////////////////////////////////// // Sequence copy. If we use optimized version we use memcpy. /** - * Helper class to determine if we have apply fast copy. There are 2 conditions + * Class to determine if we have apply fast copy. There are 2 conditions * - trivial copy ctor. - * - all iterators satisfy the C++20 are contiguous iterator concept: pointers or iterator classes with - * the iterator_concept typedef set to contiguous_iterator_tag + * - all iterators satisfy the C++20 are contiguous iterator concept */ + template + constexpr bool indirectly_trivially_copyable = false; + template + constexpr bool indirectly_trivially_copyable>> = is_trivially_copyable_v>; + template - struct is_fast_copy_helper - { - using value_type = typename iterator_traits::value_type; - static constexpr bool value = AZStd::is_trivially_copyable_v - && Internal::satisfies_contiguous_iterator_concept_v - && Internal::satisfies_contiguous_iterator_concept_v; - }; + using is_fast_copy = bool_constant + && contiguous_iterator + && contiguous_iterator + >; - // Use this trait to to determine copy mode, based on the iterator category and object copy properties, - // Use it when when you call uninitialized_copy, Internal::copy, Internal::move, etc. - template< typename InputIterator, typename ResultIterator > - struct is_fast_copy - : public ::AZStd::integral_constant::value> {}; + template + constexpr bool is_fast_copy_v = is_fast_copy::value; + + // is_fast_copy argument is no longer used. template - constexpr ForwardIterator copy(const InputIterator& first, const InputIterator& last, ForwardIterator result, const false_type& /* is_fast_copy() */) + constexpr ForwardIterator copy(InputIterator first, InputIterator last, ForwardIterator result, bool) { - InputIterator iter(first); - for (; iter != last; ++result, ++iter) + if constexpr (is_fast_copy_v) { - *result = *iter; - } + // Specialized copy for contiguous iterators which are trivially copyable + size_t numElements = last - first; + if (numElements > 0) + { +#if az_has_builtin_memcpy + static_assert(sizeof(iter_value_t) == sizeof(iter_value_t), "Size of value types must match for a trivial copy"); + __builtin_memcpy(to_address(result), to_address(first), numElements * sizeof(iter_value_t)); +#else + if (az_builtin_is_constant_evaluated()) + { + for (; first != last; ++result, ++first) + { + *result = *first; + } - return result; + return result; + } + else + { + static_assert(sizeof(iter_value_t) == sizeof(iter_value_t), "Size of value types must match for a trivial copy"); + AZ_Assert((static_cast(&*result) < static_cast(&*first)) + || (static_cast(&*result) >= static_cast(&*first + numElements)), + "AZStd::copy memory overlaps use AZStd::copy_backward!"); + ::memcpy(to_address(result), to_address(first), numElements * sizeof(iter_value_t)); + } +#endif + } + return result + numElements; + } + else + { + for (; first != last; ++result, ++first) + { + *result = *first; + } + + return result; + } } - // Specialized copy for contiguous iterators (pointers) and trivial copy type. - // This overload cannot be constexpr until builtin_memcpy is added to MSVC compilers - template - inline ForwardIterator copy(const InputIterator& first, const InputIterator& last, ForwardIterator result, const true_type& /* is_fast_copy() */) - { - // \todo Make sure memory ranges don't overlap, otherwise people should use move and move_backward. - static_assert(sizeof(typename iterator_traits::value_type) == sizeof(typename iterator_traits::value_type), "Size of value types must match for a trivial copy"); - AZStd::size_t numElements = last - first; - if (numElements > 0) - { - AZ_Assert((static_cast(&*result) < static_cast(&*first)) || (static_cast(&*result) >= static_cast(&*first + numElements)), "AZStd::copy memory overlaps use AZStd::copy_backward!"); - AZ_Assert((static_cast(&*result + numElements) <= static_cast(&*first)) || (static_cast(&*result + numElements) > static_cast(&*first + numElements)), "AZStd::copy memory overlaps use AZStd::copy_backward!"); - /*AZSTD_STL::*/ memcpy(&*result, &*first, numElements * sizeof(typename iterator_traits::value_type)); - } - return result + numElements; - } // Copy backward. template - constexpr BidirectionalIterator2 copy_backward(const BidirectionalIterator1& first, const BidirectionalIterator1& last, BidirectionalIterator2 result, const false_type& /* is_fast_copy() */) + constexpr BidirectionalIterator2 copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, BidirectionalIterator2 result, bool) { - BidirectionalIterator1 iter(last); - while (first != iter) + if constexpr (is_fast_copy_v) { - *--result = *--iter; + // Specialized copy for contiguous iterators which are trivially copyable + size_t numElements = last - first; + if (numElements > 0) + { +#if az_has_builtin_memmove + static_assert(sizeof(iter_value_t) == sizeof(iter_value_t), "Size of value types must match for a trivial copy"); + result -= numElements; + __builtin_memmove(to_address(result), to_address(first), numElements * sizeof(iter_value_t)); +#else + if (az_builtin_is_constant_evaluated()) + { + while (first != last) + { + *--result = *--last; + } + + return result; + } + else + { + static_assert(sizeof(iter_value_t) == sizeof(iter_value_t), "Size of value types must match for a trivial copy"); + result -= numElements; + AZ_Assert(((&*result + numElements) <= &*first) || ((&*result + numElements) > (&*first + numElements)), "AZStd::copy_backward memory overlaps use AZStd::copy!"); + ::memmove(&*result, &*first, numElements * sizeof(iter_value_t)); + } +#endif + } + return result; } - - return result; - } - - // Specialized copy for contiguous iterators (pointers) and trivial copy type. - // This overload cannot be constexpr until builtin_memcpy is added to MSVC compilers - template - inline BidirectionalIterator2 copy_backward(const BidirectionalIterator1& first, const BidirectionalIterator1& last, BidirectionalIterator2 result, const true_type& /* is_fast_copy() */) - { - // \todo Make sure memory ranges don't overlap, otherwise people should use move and move_backward. - static_assert(sizeof(typename iterator_traits::value_type) == sizeof(typename iterator_traits::value_type), "Size of value types must match for a trivial copy"); - AZStd::size_t numElements = last - first; - if (numElements > 0) + else { - result -= numElements; - AZ_Assert((&*result < &*first) || (&*result >= (&*first + numElements)), "AZStd::copy_backward memory overlaps use AZStd::copy!"); - AZ_Assert(((&*result + numElements) <= &*first) || ((&*result + numElements) > (&*first + numElements)), "AZStd::copy_backward memory overlaps use AZStd::copy!"); - /*AZSTD_STL::*/ memcpy(&*result, &*first, numElements * sizeof(typename iterator_traits::value_type)); + while (first != last) + { + *--result = *--last; + } + + return result; } - return result; } template - constexpr ForwardIterator reverse_copy(const BidirectionalIterator1& first, const BidirectionalIterator1& last, ForwardIterator dest) + constexpr ForwardIterator reverse_copy(BidirectionalIterator1 first, BidirectionalIterator1 last, ForwardIterator dest) { - BidirectionalIterator1 iter(last); - while (iter != first) + while (last != first) { - *(dest++) = *(--iter); + *(dest++) = *(--last); } return dest; @@ -342,143 +335,209 @@ namespace AZStd * Specialized algorithms 20.4.4. We extend that by adding faster specialized versions when we have trivial assign type. */ template - constexpr ForwardIterator uninitialized_copy(const InputIterator& first, const InputIterator& last, ForwardIterator result, const false_type& /* is_fast_copy() */) + constexpr ForwardIterator uninitialized_copy(InputIterator first, InputIterator last, ForwardIterator result, bool) { - InputIterator iter(first); - for (; iter != last; ++result, ++iter) + // Specialized copy for contiguous iterators which are trivially copyable + if constexpr (Internal::is_fast_copy_v) { - ::new (static_cast(&*result)) typename iterator_traits::value_type(*iter); - } + size_t numElements = last - first; + if (numElements > 0) + { +#if az_has_builtin_memcpy + static_assert(sizeof(iter_value_t) == sizeof(iter_value_t), "Value type sizes must match for a trivial copy"); + __builtin_memcpy(to_address(result), to_address(first), numElements * sizeof(iter_value_t)); +#else + if (az_builtin_is_constant_evaluated()) + { + for (; first != last; ++result, ++first) + { + construct_at(static_cast*>(to_address(result)), *first); + } - return result; + return result; + } + else + { + static_assert(sizeof(iter_value_t) == sizeof(iter_value_t), "Value type sizes must match for a trivial copy"); + ::memcpy(to_address(result), to_address(first), numElements * sizeof(iter_value_t)); + } +#endif + } + return result + numElements; + } + else + { + for (; first != last; ++result, ++first) + { + construct_at(static_cast*>(to_address(result)), *first); + } + + return result; + } } - // Specialized copy for contiguous iterators and trivial copy type. - // This overload cannot be constexpr until builtin_memcpy is added to MSVC compilers - template - inline ForwardIterator uninitialized_copy(const InputIterator& first, const InputIterator& last, ForwardIterator result, const true_type& /* is_fast_copy() */) - { - static_assert(sizeof(typename iterator_traits::value_type) == sizeof(typename iterator_traits::value_type), "Value type sizes must match for a trivial copy"); - AZStd::size_t numElements = last - first; - if (numElements > 0) - { - /*AZSTD_STL::*/ - memcpy(&*result, &*first, numElements * sizeof(typename iterator_traits::value_type)); - } - return result + numElements; - } template - constexpr ForwardIterator uninitialized_copy(const InputIterator& first, const InputIterator& last, ForwardIterator result) + constexpr ForwardIterator uninitialized_copy(InputIterator first, InputIterator last, ForwardIterator result) { - return uninitialized_copy(first, last, result, Internal::is_fast_copy()); + return uninitialized_copy(first, last, result, {}); } // 25.3.1 Copy template constexpr OutputIterator copy(InputIterator first, InputIterator last, OutputIterator result) { - return AZStd::Internal::copy(first, last, result, AZStd::Internal::is_fast_copy()); + return Internal::copy(first, last, result, {}); } template constexpr OutputIterator reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator dest) { - return AZStd::Internal::reverse_copy(first, last, dest); + return Internal::reverse_copy(first, last, dest); } template BidirectionalIterator2 copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, BidirectionalIterator2 result) { - return AZStd::Internal::copy_backward(first, last, result, AZStd::Internal::is_fast_copy()); + return Internal::copy_backward(first, last, result, {}); } } namespace AZStd::Internal { ////////////////////////////////////////////////////////////////////////// - // Sequence move. If we use optimized version we use memmove. + // Sequence move template - constexpr ForwardIterator move(const InputIterator& first, const InputIterator& last, ForwardIterator result, const false_type& /* is_fast_copy() */) + constexpr ForwardIterator move(InputIterator first, InputIterator last, ForwardIterator result, bool) { - InputIterator iter(first); - for (; iter != last; ++result, ++iter) + // Specialized copy for contiguous iterators which are trivially copyable + if constexpr (is_fast_copy_v) { - *result = AZStd::move(*iter); + size_t numElements = last - first; + if (numElements > 0) + { +#if az_has_builtin_memcpy + static_assert(sizeof(iter_value_t) == sizeof(iter_value_t), "Size of value types must match for a trivial copy"); + __builtin_memcpy(to_address(result), to_address(first), numElements * sizeof(iter_value_t)); +#else + if (az_builtin_is_constant_evaluated()) + { + for (; first != last; ++result, ++first) + { + *result = ::AZStd::move(*first); + } + return result; + } + else + { + static_assert(sizeof(iter_value_t) == sizeof(iter_value_t), "Size of value types must match for a trivial copy"); + AZ_Assert((static_cast(&*result) < static_cast(&*first)) + || (static_cast(&*result) >= static_cast(&*first + numElements)), + "AZStd::move memory overlaps use AZStd::move_backward!"); + ::memcpy(to_address(result), to_address(first), numElements * sizeof(iter_value_t)); + } +#endif + } + return result + numElements; + } + else + { + for (; first != last; ++result, ++first) + { + *result = ::AZStd::move(*first); + } + return result; } - return result; } - // Specialized copy for contiguous iterators (pointers) and trivial copy type. - // This overload cannot be constexpr until builtin_memmove is added to MSVC compilers - template - inline ForwardIterator move(const InputIterator& first, const InputIterator& last, ForwardIterator result, const true_type& /* is_fast_copy() */) - { - static_assert(sizeof(typename iterator_traits::value_type) == sizeof(typename iterator_traits::value_type), "Size of value types must match for a trivial copy"); - AZStd::size_t numElements = last - first; - if (numElements > 0) - { - /*AZSTD_STL::*/ - memmove(&*result, &*first, numElements * sizeof(typename iterator_traits::value_type)); - } - return result + numElements; - } // For generic iterators, move is the same as copy. template - constexpr BidirectionalIterator2 move_backward(const BidirectionalIterator1& first, const BidirectionalIterator1& last, BidirectionalIterator2 result, const false_type& /* is_fast_copy() */) + constexpr BidirectionalIterator2 move_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, BidirectionalIterator2 result, bool) { - BidirectionalIterator1 iter(last); - while (first != iter) + // Specialized copy for contiguous iterators which are trivially copyable + if constexpr (is_fast_copy_v) { - *--result = AZStd::move(*--iter); + size_t numElements = last - first; + if (numElements > 0) + { +#if az_has_builtin_memmove + static_assert(sizeof(iter_value_t) == sizeof(iter_value_t), "Size of value types must match for a trivial copy"); + result -= numElements; + __builtin_memmove(to_address(result), to_address(first), numElements * sizeof(iter_value_t)); +#else + if (az_builtin_is_constant_evaluated()) + { + while (first != last) + { + *--result = ::AZStd::move(*--last); + } + return result; + } + else + { + static_assert(sizeof(iter_value_t) == sizeof(iter_value_t), "Size of value types must match for a trivial copy"); + result -= numElements; + AZ_Assert((static_cast(&*result + numElements) <= static_cast(&*first)) + || (static_cast(&*result + numElements) > static_cast(&*first + numElements)), + "AZStd::move_backward memory overlaps use AZStd::move!"); + ::memmove(to_address(result), to_address(first), numElements * sizeof(iter_value_t)); + } +#endif + } + return result; } - return result; - } - - // Specialized copy for contiguous iterators (pointers) and trivial copy type. - // This overload cannot be constexpr until builtin_memmove is added to MSVC compilers - template - inline BidirectionalIterator2 move_backward(const BidirectionalIterator1& first, const BidirectionalIterator1& last, BidirectionalIterator2 result, const true_type& /* is_fast_copy() */) - { - // \todo Make sure memory ranges don't overlap, otherwise people should use move and move_backward. - static_assert(sizeof(typename iterator_traits::value_type) == sizeof(typename iterator_traits::value_type), "Size of value types must match for a trivial copy"); - AZStd::size_t numElements = last - first; - result -= numElements; - if (numElements > 0) + else { - /*AZSTD_STL::*/ - memmove(&*result, &*first, numElements * sizeof(typename iterator_traits::value_type)); + while (first != last) + { + *--result = ::AZStd::move(*--last); + } + return result; } - return result; } template - constexpr ForwardIterator uninitialized_move(const InputIterator& first, const InputIterator& last, ForwardIterator result, const false_type& /* is_fast_copy() */) + constexpr ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result, bool) { - InputIterator iter(first); - - for (; iter != last; ++result, ++iter) + // Specialized copy for contiguous iterators which are trivially copyable + if constexpr (is_fast_copy_v) { - ::new (static_cast(&*result)) typename iterator_traits::value_type(AZStd::move(*iter)); - } - return result; - } - // Specialized copy for contiguous iterators and trivial move type. (since the object is POD we will just perform a copy) - // This overload cannot be constexpr until builtin_memcpy is added to MSVC compilers - template - inline ForwardIterator uninitialized_move(const InputIterator& first, const InputIterator& last, ForwardIterator result, const true_type& /* is_fast_copy() */) - { - static_assert(sizeof(typename iterator_traits::value_type) == sizeof(typename iterator_traits::value_type), "Value type sizes must match for a trivial copy"); - AZStd::size_t numElements = last - first; - if (numElements > 0) - { - /*AZSTD_STL::*/ - memcpy(&*result, &*first, numElements * sizeof(typename iterator_traits::value_type)); - } - return result + numElements; - } + size_t numElements = last - first; + if (numElements > 0) + { +#if az_has_builtin_memcpy + static_assert(sizeof(iter_value_t) == sizeof(iter_value_t), "Value type sizes must match for a trivial copy"); + __builtin_memcpy(to_address(result), to_address(first), numElements * sizeof(iter_value_t)); +#else + if (az_builtin_is_constant_evaluated()) + { + for (; first != last; ++result, ++first) + { + construct_at(static_cast*>(to_address(result)), ::AZStd::move(*first)); + } + return result; + } + else + { + static_assert(sizeof(iter_value_t) == sizeof(iter_value_t), "Value type sizes must match for a trivial copy"); + ::memcpy(to_address(result), to_address(first), numElements * sizeof(iter_value_t)); + } +#endif + } + return result + numElements; + } + else + { + for (; first != last; ++result, ++first) + { + construct_at(static_cast*>(to_address(result)), ::AZStd::move(*first)); + } + + return result; + } + } // end of sequence move. ////////////////////////////////////////////////////////////////////////// } @@ -492,19 +551,19 @@ namespace AZStd template ForwardIt uninitialized_move(InputIt first, InputIt last, ForwardIt result) { - return AZStd::Internal::uninitialized_move(first, last, result, AZStd::Internal::is_fast_copy{}); + return AZStd::Internal::uninitialized_move(first, last, result, {}); } // 25.3.2 Move template OutputIterator move(InputIterator first, InputIterator last, OutputIterator result) { - return AZStd::Internal::move(first, last, result, AZStd::Internal::is_fast_copy()); + return AZStd::Internal::move(first, last, result, {}); } template BidirectionalIterator2 move_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, BidirectionalIterator2 result) { - return AZStd::Internal::move_backward(first, last, result, AZStd::Internal::is_fast_copy()); + return AZStd::Internal::move_backward(first, last, result, {}); } } @@ -516,63 +575,77 @@ namespace AZStd::Internal * Helper class to determine if we have apply fast fill. There are 3 conditions * - trivial assign * - size of type == 1 (chars) to use memset - * - contiguous iterators (pointers) + * - contiguous iterators */ + template + constexpr bool indirectly_copy_assignable = false; + template + constexpr bool indirectly_copy_assignable>> = + is_trivially_copy_assignable_v> && sizeof(iter_value_t) == 1; + template - struct is_fast_fill_helper - { - using value_type = typename iterator_traits::value_type; - constexpr static bool value = is_trivially_copy_assignable_v && sizeof(value_type) == 1 - && Internal::satisfies_contiguous_iterator_concept_v; - }; - - // Use this trait to to determine fill mode, based on the iterator, value size, etc. - // Use it when you call uninitialized_fill, uninitialized_fill_n, fill and fill_n. - template< typename Iterator > - struct is_fast_fill - : public ::AZStd::integral_constant::value> - {}; + using is_fast_fill = bool_constant && contiguous_iterator>; + template + constexpr bool is_fast_fill_v = is_fast_fill::value; + // The fast fill trait is no longer used + // It is detected using C++20 concepts now template - constexpr void fill(const ForwardIterator& first, const ForwardIterator& last, const T& value, const false_type& /* is_fast_fill() */) + constexpr void fill(ForwardIterator first, ForwardIterator last, const T& value, bool) { - ForwardIterator iter(first); - for (; iter != last; ++iter) + if constexpr (is_fast_fill_v) { - *iter = value; + size_t numElements = last - first; + if (numElements > 0) + { + if (az_builtin_is_constant_evaluated()) + { + for (; first != last; ++first) + { + *first = value; + } + } + else + { + ::memset(to_address(first), reinterpret_cast(value), numElements); + } + } } - } - // Specialized version for character types where memset can be used - // This overload cannot be constexpr until builtin_memset is added to MSVC compilers - template - inline void fill(const ForwardIterator& first, const ForwardIterator& last, const T& value, const true_type& /* is_fast_fill() */) - { - AZStd::size_t numElements = last - first; - if (numElements > 0) + else { - /*AZSTD_STL::*/ - memset((void*)&*first, *reinterpret_cast(&value), numElements); + for (; first != last; ++first) + { + *first = value; + } } } template - constexpr void fill_n(ForwardIterator first, Size numElements, const T& value, const false_type& /* is_fast_fill() */) + constexpr void fill_n(ForwardIterator first, Size numElements, const T& value, bool) { - for (; numElements--; ++first) + if constexpr (is_fast_fill_v) { - *first = value; + if (numElements) + { + if (az_builtin_is_constant_evaluated()) + { + for (; numElements--; ++first) + { + *first = value; + } + } + else + { + ::memset(to_address(first), reinterpret_cast(value), numElements); + } + } } - } - - // Specialized version for character types where memset can be used to perform the fill - // This overload cannot be constexpr until builtin_memset is added to MSVC compilers - template - inline void fill_n(ForwardIterator first, Size numElements, const T& value, const true_type& /* is_fast_fill() */) - { - if (numElements > 0) + else { - /*AZSTD_STL::*/ - memset(&*first, *reinterpret_cast(&value), numElements); + for (; numElements--; ++first) + { + *first = value; + } } } } @@ -580,78 +653,85 @@ namespace AZStd::Internal namespace AZStd { template - constexpr void fill(const ForwardIterator& first, const ForwardIterator& last, const T& value) + constexpr void fill(ForwardIterator first, ForwardIterator last, const T& value) { - Internal::fill(first, last, value, Internal::is_fast_fill()); + Internal::fill(first, last, value, {}); } - template constexpr void fill_n(ForwardIterator first, Size numElements, const T& value) { - Internal::fill_n(first, numElements, value, Internal::is_fast_fill()); + Internal::fill_n(first, numElements, value, {}); } template - constexpr void uninitialized_fill(const ForwardIterator& first, const ForwardIterator& last, const T& value, const false_type& /* is_fast_fill() */) + constexpr void uninitialized_fill(ForwardIterator first, ForwardIterator last, const T& value, bool) { - ForwardIterator iter(first); - for (; iter != last; ++iter) + if constexpr (Internal::is_fast_fill_v) { - ::new (static_cast(&*iter)) typename iterator_traits::value_type(value); + size_t numElements = last - first; + if (numElements > 0) + { + if (az_builtin_is_constant_evaluated()) + { + for (; first != last; ++first) + { + construct_at(static_cast*>(to_address(first)), value); + } + } + else + { + ::memset(to_address(first), reinterpret_cast(value), numElements); + } + } } - } - - // Specialized overload for types which meet the following criteria. - // 1. Has it's iterator_traits::iterator_concept type set to to contiguous_iterator_tag - // 2. Is trivially assignable - // 3. Has a sizeof(T) == 1 - // In such a case memset can be used to fill in the data - // This overload cannot be constexpr until builtin_memset is added to MSVC compilers - template - inline void uninitialized_fill(const ForwardIterator& first, const ForwardIterator& last, const T& value, const true_type& /* is_fast_fill() */) - { - AZStd::size_t numElements = last - first; - if (numElements > 0) + else { - /*AZSTD_STL::*/ - memset(&*first, *reinterpret_cast(&value), numElements); + for (; first != last; ++first) + { + construct_at(static_cast*>(to_address(first)), value); + } } } template constexpr void uninitialized_fill(ForwardIterator first, Size numElements, const T& value) { - return uninitialized_fill(first, numElements, value, Internal::is_fast_fill()); + return uninitialized_fill(first, numElements, value, {}); } template - constexpr void uninitialized_fill_n(ForwardIterator first, Size numElements, const T& value, const false_type& /* is_fast_fill() */) + constexpr void uninitialized_fill_n(ForwardIterator first, Size numElements, const T& value, bool) { - for (; numElements--; ++first) + if constexpr (Internal::is_fast_fill_v) { - ::new (static_cast(&*first)) typename iterator_traits::value_type(value); + if (numElements > 0) + { + if (az_builtin_is_constant_evaluated()) + { + for (; numElements--; ++first) + { + construct_at(static_cast*>(to_address(first)), value); + } + } + else + { + ::memset(to_address(first), reinterpret_cast(value), numElements); + } + } } - } - - // Specialized overload for types which meet the following criteria. - // 1. Has it's iterator_traits::iterator_concept type set to to contiguous_iterator_tag - // 2. Is trivially assignable - // 3. Has a sizeof(T) == 1 - // In such a case memset can be used to fill in the data - template - inline void uninitialized_fill_n(ForwardIterator first, Size numElements, const T& value, const true_type& /* is_fast_fill() */) - { - if (numElements) + else { - /*AZSTD_STL::*/ - memset(&*first, *reinterpret_cast(&value), numElements); + for (; numElements--; ++first) + { + construct_at(static_cast*>(to_address(first)), value); + } } } template constexpr void uninitialized_fill_n(ForwardIterator first, Size numElements, const T& value) { - return uninitialized_fill_n(first, numElements, value, Internal::is_fast_fill()); + return uninitialized_fill_n(first, numElements, value, {}); } } diff --git a/Code/Framework/AzCore/AzCore/std/function/invoke.h b/Code/Framework/AzCore/AzCore/std/function/invoke.h index 88dbbea218..6dccb43e36 100644 --- a/Code/Framework/AzCore/AzCore/std/function/invoke.h +++ b/Code/Framework/AzCore/AzCore/std/function/invoke.h @@ -38,4 +38,12 @@ namespace AZStd { return Internal::INVOKE(Internal::InvokeTraits::forward(f), Internal::InvokeTraits::forward(args)...); } + + // models the invocable concept + template + /*concept*/ constexpr bool invocable = is_invocable_v; + + // models the regular_invocable concept + template + /*concept*/ constexpr bool regular_invocable = invocable; } diff --git a/Code/Framework/AzCore/AzCore/std/iterator.h b/Code/Framework/AzCore/AzCore/std/iterator.h index 8d0d49b649..5bc653e3b6 100644 --- a/Code/Framework/AzCore/AzCore/std/iterator.h +++ b/Code/Framework/AzCore/AzCore/std/iterator.h @@ -8,19 +8,19 @@ #pragma once #include -#include -#include -#include -#include // use by ConstIteratorCast +#include +#include +#include #include -#include +#include +#include #include namespace AZStd { - // Everything unless specified is based on C++ standard 24 (lib.iterators). + // Everything unless specified is based on C++ standard 20 (lib.iterators). /// Identifying tag for input iterators. using input_iterator_tag = std::input_iterator_tag; @@ -51,16 +51,6 @@ namespace AZStd::Internal typename Iterator::reference> > = true; - - template - inline constexpr bool has_iterator_category_v = false; - template - inline constexpr bool has_iterator_category_v> = true; - template - inline constexpr bool has_iterator_concept_v = false; - template - inline constexpr bool has_iterator_concept_v> = true; - // Iterator iterator_category alias must be one of the iterator category tags template struct iterator_traits_category_tags @@ -98,6 +88,8 @@ namespace AZStd struct iterator_traits : Internal::iterator_traits_type_aliases> { + // Internal type alias meant to indicate that this is the primary template + using _is_primary_template = iterator_traits; }; /** @@ -114,45 +106,6 @@ namespace AZStd using iterator_category = random_access_iterator_tag; using iterator_concept = contiguous_iterator_tag; }; - -} - -namespace AZStd::Internal -{ - // iterator_category tag testers - template >> - inline constexpr bool has_iterator_category_convertible_to_v = false; - template - inline constexpr bool has_iterator_category_convertible_to_v = is_convertible_v::iterator_category, Category>; - - template - inline constexpr bool is_input_iterator_v = has_iterator_category_convertible_to_v; - - template - inline constexpr bool is_forward_iterator_v = has_iterator_category_convertible_to_v; - - template - inline constexpr bool is_bidirectional_iterator_v = has_iterator_category_convertible_to_v; - - template - inline constexpr bool is_random_access_iterator_v = has_iterator_category_convertible_to_v; - - template - inline constexpr bool is_contiguous_iterator_v = has_iterator_category_convertible_to_v; - - template - inline constexpr bool is_exactly_input_iterator_v = has_iterator_category_convertible_to_v && !has_iterator_category_convertible_to_v; - - // iterator concept testers - template - inline constexpr bool derived_from = is_base_of_v && is_convertible_v; - - template >> - inline constexpr bool satisfies_iterator_concept = false; - template - inline constexpr bool satisfies_iterator_concept = derived_from::iterator_concept, Concept>; - template - inline constexpr bool satisfies_contiguous_iterator_concept_v = satisfies_iterator_concept; } namespace AZStd diff --git a/Code/Framework/AzCore/AzCore/std/iterator/iterator_primitives.h b/Code/Framework/AzCore/AzCore/std/iterator/iterator_primitives.h new file mode 100644 index 0000000000..39d89e1f2f --- /dev/null +++ b/Code/Framework/AzCore/AzCore/std/iterator/iterator_primitives.h @@ -0,0 +1,200 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace AZStd +{ + // Bring in std utility functions into AZStd namespace + using std::forward; + + // forward declare iterator_traits to avoid iterator.h include + template + struct iterator_traits; +} + +// C++20 range traits for iteratable types +namespace AZStd::Internal +{ + // Models the can-reference concept which isn't available until C++20 + // template + template + constexpr bool can_reference = true; + template <> + inline constexpr bool can_reference = false; + + // Models the dereferencable concept which isn't available until C++20 + template + /*concept*/ constexpr bool dereferenceable = false; + template + constexpr bool dereferenceable())>>> = true; + + template + constexpr bool is_primary_template_v = false; + template + constexpr bool is_primary_template_v>> = true; + + // indirectly readable traits + template + constexpr bool has_value_type_v = false; + template + constexpr bool has_value_type_v> = true; + template + constexpr bool has_element_type_v = false; + template + constexpr bool has_element_type_v> = true; + + template + struct object_type_value_requires {}; + template + struct object_type_value_requires>> + { + using value_type = remove_cv_t; + }; + template + struct indirectly_readable_requires {}; + template + struct indirectly_readable_requires> + && is_void_v::value_type>> >> + { + // iterator_traits has been been specialized + using value_type = typename iterator_traits::value_type; + }; + + template + struct indirectly_readable_requires> + && is_array_v>> + { + using value_type = remove_cv_t>; + }; + + template + struct indirectly_readable_requires> + && has_value_type_v && !has_element_type_v>> + : object_type_value_requires {}; + + template + struct indirectly_readable_requires> + && has_element_type_v && !has_value_type_v>> + : object_type_value_requires {}; + + template + struct indirectly_readable_requires> + && has_value_type_v&& has_element_type_v + && same_as, remove_cv_t> >> + : object_type_value_requires {}; + + // incrementable traits + template + constexpr bool has_difference_type_v = false; + template + constexpr bool has_difference_type_v> = true; + + template + struct object_type_difference_requires {}; + template + struct object_type_difference_requires>> + { + using difference_type = ptrdiff_t; + }; + + template + struct incrementable_requires {}; + // iterator_traits has been specialized + template + struct incrementable_requires> + && is_void_v::difference_type>> >> + { + using difference_type = typename iterator_traits::difference_type; + }; + template + struct incrementable_requires> + && has_difference_type_v>> + { + using difference_type = typename T::difference_type; + }; + template + struct incrementable_requires> + && !has_difference_type_v + && integral() - declval())> >> + { + using difference_type = make_signed_t() - declval())>; + }; +} + +namespace AZStd +{ + // indirectly_readable_traits for iter_value_t + template + struct indirectly_readable_traits + : Internal::indirectly_readable_requires {}; + template + struct indirectly_readable_traits + : Internal::object_type_value_requires {}; + template + struct indirectly_readable_traits + : indirectly_readable_traits {}; + + template + using iter_value_t = typename indirectly_readable_traits>::value_type; + + template + using iter_reference_t = enable_if_t, decltype(*declval())>; + + // incrementable_traits for iter_difference_t + template + struct incrementable_traits + : Internal::incrementable_requires {}; + template + struct incrementable_traits + : Internal::object_type_difference_requires {}; + template + struct incrementable_traits + : incrementable_traits {}; + + template + using iter_difference_t = typename incrementable_traits>::difference_type; + + template + using iter_rvalue_reference_t = decltype(ranges::iter_move(declval())); + + namespace Internal + { + // model the indirectly readable concept + template + constexpr bool indirectly_readable_impl = false; + + template + constexpr bool indirectly_readable_impl()), iter_reference_t> + && same_as())), iter_rvalue_reference_t> + && common_reference_with&&, iter_value_t&> + && common_reference_with&&, iter_rvalue_reference_t&> + && common_reference_with&&, const iter_value_t&>>> = true; + } + + template + using iter_common_reference_t = enable_if_t, + common_reference_t, iter_value_t&>>; +} diff --git a/Code/Framework/AzCore/AzCore/std/ranges/iter_move.h b/Code/Framework/AzCore/AzCore/std/ranges/iter_move.h new file mode 100644 index 0000000000..a9519f03c5 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/std/ranges/iter_move.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace AZStd +{ + // Bring in std utility functions into AZStd namespace + using std::forward; +} + +// C++20 range traits for iteratable types +namespace AZStd::ranges::Internal +{ + void iter_move(); + + template + constexpr bool iter_move_adl = false; + + template + constexpr bool iter_move_adl()))>> = true; + + template + constexpr bool is_class_or_enum_with_iter_move_adl = false; + + template + constexpr bool is_class_or_enum_with_iter_move_adl + && (is_class_v> || is_enum_v>)>> + = true; + + struct iter_move_fn + { + template + constexpr auto operator()(It&& it) const + ->enable_if_t, + decltype(iter_move(AZStd::forward(it)))> + { + return iter_move(AZStd::forward(it)); + } + template + constexpr auto operator()(It&& it) const + ->enable_if_t&& is_lvalue_reference_v(it))>, + decltype(AZStd::move(*AZStd::forward(it)))> + { + return AZStd::move(*AZStd::forward(it)); + } + template + constexpr auto operator()(It&& it) const + ->enable_if_t && !is_lvalue_reference_v(it))>, + decltype(*AZStd::forward(it))> + { + return *AZStd::forward(it); + } + }; +} + +namespace AZStd::ranges +{ + inline namespace customization_point_object + { + inline constexpr auto iter_move = Internal::iter_move_fn{}; + } +} diff --git a/Code/Framework/AzCore/AzCore/std/ranges/ranges.h b/Code/Framework/AzCore/AzCore/std/ranges/ranges.h new file mode 100644 index 0000000000..a3ead81456 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/std/ranges/ranges.h @@ -0,0 +1,1157 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace AZStd +{ + // alias std:: reverse_iterator names into AZStd:: + using std::make_reverse_iterator; +} + +namespace AZStd::ranges +{ + // Range variable templates + template + inline constexpr bool enable_borrowed_range = false; + + template + inline constexpr bool disable_sized_range = false; + + namespace Internal + { + // Variadic template which maps types to true For SFINAE + template + constexpr bool sfinae_trigger_v = true; + + template + constexpr bool is_lvalue_or_borrowable = is_lvalue_reference_v || enable_borrowed_range>; + + //! begin + template + constexpr bool has_member_begin = false; + template + constexpr bool has_member_begin().begin())>> = true; + + template + constexpr bool has_unqualified_begin = false; + template + constexpr bool has_unqualified_begin()))>> + = !has_member_begin && AZStd::Internal::is_class_or_enum; + + template + void begin(T&) = delete; + template + void begin(const T&) = delete; + + struct begin_fn + { + template + constexpr auto operator()(T& t) const noexcept -> + enable_if_t && sfinae_trigger_v>, + decltype(t + 0)> + { + return t + 0; + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(AZStd::forward(t).begin())) -> + enable_if_t&& is_lvalue_or_borrowable + && !is_array_v&& has_member_begin, + decltype(AZStd::forward(t).begin())> + { + return AZStd::forward(t).begin(); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(begin(AZStd::forward(t)))) -> + enable_if_t&& is_lvalue_or_borrowable + && !is_array_v && has_unqualified_begin, + decltype(begin(AZStd::forward(t)))> + { + return begin(AZStd::forward(t)); + } + }; + } + inline namespace customization_point_object + { + inline constexpr Internal::begin_fn begin{}; + } + + template + using iterator_t = decltype(ranges::begin(declval())); + + namespace Internal + { + template + constexpr bool has_iterator_t = has_member_begin; + + //! end + template + constexpr bool has_member_end = false; + template + constexpr bool has_member_end().end())>> = true; + + template + constexpr bool has_unqualified_end = false; + template + constexpr bool has_unqualified_end()))>> + = !has_member_end && AZStd::Internal::is_class_or_enum; + + template + void end(T&) = delete; + template + void end(const T&) = delete; + + struct end_fn + { + template + constexpr auto operator()(T& t) const noexcept -> + enable_if_t && extent_v != 0, + decltype(t + extent_v)> + { + return t + extent_v; + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(AZStd::forward(t).end())) -> + enable_if_t>&& is_lvalue_or_borrowable + && !is_array_v && has_member_end, + decltype(AZStd::forward(t).end())> + { + return AZStd::forward(t).end(); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(end(AZStd::forward(t)))) -> + enable_if_t>&& is_lvalue_or_borrowable + && !is_array_v && has_unqualified_end, + decltype(end(AZStd::forward(t)))> + { + return end(AZStd::forward(t)); + } + }; + } + inline namespace customization_point_object + { + inline constexpr Internal::end_fn end{}; + } + + namespace Internal + { + //! cbegin + struct cbegin_fn + { + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::begin(static_cast(t)))) + ->enable_if_t, decltype(ranges::begin(static_cast(t)))> + { + return ranges::begin(static_cast(t)); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::begin(static_cast(t)))) -> + enable_if_t, decltype(ranges::begin(static_cast(t)))> + { + return ranges::begin(static_cast(t)); + } + }; + } + inline namespace customization_point_object + { + inline constexpr Internal::cbegin_fn cbegin{}; + } + + namespace Internal + { + //! cend + struct cend_fn + { + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::end(static_cast(t)))) + ->enable_if_t, decltype(ranges::end(static_cast(t)))> + { + return ranges::end(static_cast(t)); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::end(static_cast(t)))) -> + enable_if_t, decltype(ranges::end(static_cast(t)))> + { + return ranges::end(static_cast(t)); + } + }; + } + inline namespace customization_point_object + { + inline constexpr Internal::cend_fn cend{}; + } + + namespace Internal + { + //! rbegin + template + constexpr bool has_member_rbegin = false; + template + constexpr bool has_member_rbegin().rbegin())>> = true; + + template + constexpr bool has_unqualified_rbegin = false; + template + constexpr bool has_unqualified_rbegin()))>> + = !has_member_rbegin && AZStd::Internal::is_class_or_enum; + + template + constexpr bool has_bidirectional_rbegin = false; + template + constexpr bool has_bidirectional_rbegin())), decltype(ranges::end(declval()))> + && bidirectional_iterator()))> + && bidirectional_iterator()))> + >> = !has_member_rbegin && !has_unqualified_rbegin; + + + template + void rbegin(T&) = delete; + template + void rbegin(const T&) = delete; + + struct rbegin_fn + { + template + constexpr auto operator()(T&& t) const noexcept(noexcept(AZStd::forward(t).rbegin())) -> + enable_if_t && is_lvalue_or_borrowable + && has_member_rbegin, + decltype(AZStd::forward(t).rbegin())> + { + return AZStd::forward(t).rbegin(); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(rbegin(AZStd::forward(t)))) -> + enable_if_t && is_lvalue_or_borrowable + && has_unqualified_rbegin, + decltype(rbegin(AZStd::forward(t)))> + { + return rbegin(AZStd::forward(t)); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(AZStd::make_reverse_iterator(ranges::end(AZStd::forward(t))))) -> + enable_if_t, + decltype(AZStd::make_reverse_iterator(ranges::end(AZStd::forward(t))))> + { + return AZStd::make_reverse_iterator(ranges::end(AZStd::forward(t))); + } + }; + } + + inline namespace customization_point_object + { + inline constexpr Internal::rbegin_fn rbegin{}; + } + + namespace Internal + { + //! rend + template + constexpr bool has_member_rend = false; + template + constexpr bool has_member_rend().rend())>> = true; + + template + constexpr bool has_unqualified_rend = false; + template + constexpr bool has_unqualified_rend()))>> + = !has_member_rend && AZStd::Internal::is_class_or_enum; + + template + constexpr bool has_bidirectional_rend = false; + template + constexpr bool has_bidirectional_rend())), decltype(ranges::end(declval()))> + && bidirectional_iterator()))> + && bidirectional_iterator()))> + >> = !has_member_rend && !has_unqualified_rend; + + template + void rend(T&) = delete; + template + void rend(const T&) = delete; + + struct rend_fn + { + template + constexpr auto operator()(T&& t) const noexcept(noexcept(AZStd::forward(t).rend())) -> + enable_if_t && is_lvalue_or_borrowable + && has_member_rend, + decltype(AZStd::forward(t).rend())> + { + return AZStd::forward(t).rend(); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(rend(AZStd::forward(t)))) -> + enable_if_t && is_lvalue_or_borrowable + && has_unqualified_rend, + decltype(rend(AZStd::forward(t)))> + { + return rend(AZStd::forward(t)); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(AZStd::make_reverse_iterator(ranges::begin(AZStd::forward(t))))) -> + enable_if_t, + decltype(AZStd::make_reverse_iterator(ranges::begin(AZStd::forward(t))))> + { + return AZStd::make_reverse_iterator(ranges::begin(AZStd::forward(t))); + } + }; + } + + inline namespace customization_point_object + { + inline constexpr Internal::rend_fn rend{}; + } + + namespace Internal + { + //! crbegin + struct crbegin_fn + { + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::rbegin(static_cast(t)))) + ->enable_if_t, decltype(ranges::rbegin(static_cast(t)))> + { + return ranges::rbegin(static_cast(t)); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::rbegin(static_cast(t)))) -> + enable_if_t, decltype(ranges::rbegin(static_cast(t)))> + { + return ranges::rbegin(static_cast(t)); + } + }; + } + inline namespace customization_point_object + { + inline constexpr Internal::crbegin_fn crbegin{}; + } + + namespace Internal + { + //! crend + struct crend_fn + { + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::rend(static_cast(t)))) + ->enable_if_t, decltype(ranges::rend(static_cast(t)))> + { + return ranges::rend(static_cast(t)); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::rend(static_cast(t)))) -> + enable_if_t, decltype(ranges::rend(static_cast(t)))> + { + return ranges::rend(static_cast(t)); + } + }; + } + inline namespace customization_point_object + { + inline constexpr Internal::crend_fn crend{}; + } + + namespace Internal + { + //! size + template + constexpr bool has_member_size = false; + template + constexpr bool has_member_size().size())>> = true; + + template + constexpr bool has_unqualified_size = false; + template + constexpr bool has_unqualified_size()))>> + = !has_member_size && AZStd::Internal::is_class_or_enum; + + template + constexpr bool has_end_subtract_begin = false; + template + constexpr bool has_end_subtract_begin()) - ranges::begin(declval()))>> + = !has_member_size && !has_unqualified_size; + + template + void size(T&) = delete; + template + void size(const T&) = delete; + + struct size_fn + { + template + constexpr auto operator()(T&) const noexcept -> + enable_if_t && extent_v != 0, + decltype(extent_v)> + { + return extent_v; + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(AZStd::forward(t).size())) -> + enable_if_t> && has_member_size + && AZStd::Internal::is_integer_like(t).size())>, + decltype(AZStd::forward(t).size())> + { + return AZStd::forward(t).size(); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(size(AZStd::forward(t)))) -> + enable_if_t> + && has_unqualified_size + && AZStd::Internal::is_integer_like(t)))>, + decltype(size(AZStd::forward(t)))> + { + return size(AZStd::forward(t)); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::end(AZStd::forward(t)) - ranges::begin(AZStd::forward(t)))) -> + enable_if_t< + has_end_subtract_begin + && sized_sentinel_for(t))), decltype(ranges::begin(AZStd::forward(t)))> + && forward_iterator(t)))>, + AZStd::make_unsigned_t(t)) - ranges::begin(AZStd::forward(t)))>> + { + using size_type = AZStd::make_unsigned_t(t)) - ranges::begin(AZStd::forward(t)))>; + return static_cast(ranges::end(AZStd::forward(t)) - ranges::begin(AZStd::forward(t))); + } + }; + } + inline namespace customization_point_object + { + inline constexpr Internal::size_fn size{}; + } + + namespace Internal + { + //! ssize + struct ssize_fn + { + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::size(t))) -> + enable_if_t<(sizeof(ptrdiff_t) > sizeof(make_signed_t)), ptrdiff_t> + { + return static_cast(ranges::size(t)); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::size(t))) -> + enable_if_t), make_signed_t> + { + using ssize_type = make_signed_t; + return static_cast(ranges::size(t)); + } + }; + } + inline namespace customization_point_object + { + inline constexpr Internal::ssize_fn ssize{}; + } + + namespace Internal + { + //! empty + template + constexpr bool has_member_empty = false; + template + constexpr bool has_member_empty().empty()), bool>>> = true; + + template + constexpr bool has_size_compare_to_0 = false; + template + constexpr bool has_size_compare_to_0()) == 0), bool> >> + = !has_member_empty; + + template + constexpr bool has_begin_compare_to_end = false; + + template + constexpr bool has_begin_compare_to_end()) == ranges::end(declval())), bool> >> + = !has_member_empty && !has_size_compare_to_0; + + struct empty_fn + { + template + [[nodiscard]] constexpr auto operator()(T&& t) const noexcept(noexcept(AZStd::forward(t).empty())) -> + enable_if_t && has_member_empty, bool> + { + return AZStd::forward(t).empty(); + } + + template + [[nodiscard]] constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::size(AZStd::forward(t)) == 0)) -> + enable_if_t && has_size_compare_to_0, bool> + { + return ranges::size(AZStd::forward(t)) == 0; + } + + template + [[nodiscard]] constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::begin(AZStd::forward(t)) == ranges::end(AZStd::forward(t)))) -> + enable_if_t && has_begin_compare_to_end, bool> + { + return ranges::begin(AZStd::forward(t)) == ranges::end(AZStd::forward(t)); + } + }; + } + inline namespace customization_point_object + { + inline constexpr Internal::empty_fn empty{}; + } + + namespace Internal + { + //! data + template + constexpr bool has_member_data = false; + template + constexpr bool has_member_data().data())>> = true; + + template + constexpr bool has_qualified_ranges_begin = false; + template + constexpr bool has_qualified_ranges_begin()))>> > + = !has_member_data; + + struct data_fn + { + template + constexpr auto operator()(T&& t) const noexcept(noexcept(AZStd::forward(t).data())) -> + enable_if_t && has_member_data, + decltype(AZStd::forward(t).data())> + { + return AZStd::forward(t).data(); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(AZStd::to_address(ranges::begin(AZStd::forward(t))))) -> + enable_if_t && has_qualified_ranges_begin, + decltype(AZStd::to_address(ranges::begin(AZStd::forward(t))))> + { + return AZStd::to_address(ranges::begin(AZStd::forward(t))); + } + }; + } + inline namespace customization_point_object + { + inline constexpr Internal::data_fn data{}; + } + + namespace Internal + { + //! cdata + struct cdata_fn + { + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::data(static_cast(t)))) -> + enable_if_t, decltype(ranges::data(static_cast(t)))> + { + return ranges::data(static_cast(t)); + } + + template + constexpr auto operator()(T&& t) const noexcept(noexcept(ranges::data(static_cast(t)))) -> + enable_if_t, decltype(ranges::data(static_cast(t)))> + { + return ranges::data(static_cast(t)); + } + }; + } + inline namespace customization_point_object + { + inline constexpr Internal::cdata_fn cdata{}; + } +} + +namespace AZStd::ranges +{ + namespace Internal + { + template + constexpr bool range_impl = false; + template + constexpr bool range_impl())), decltype(ranges::end(declval()))>> = true; + } + + // Models range concept + template + /*concept*/ constexpr bool range = Internal::range_impl; + + // sentinal type can now be defined after the range concept has been modeled + template + using sentinel_t = enable_if_t, decltype(ranges::end(declval()))>; + + // Models borrowed range concept + template + /*concept*/ constexpr bool borrowed_range = range + && (is_lvalue_reference_v || enable_borrowed_range>); + + struct dangling + { + constexpr dangling() = default; + template + constexpr dangling(T&&...) noexcept {} + }; + + template + using borrowed_iterator_t = conditional_t, iterator_t, dangling>; + + // Models sized range concept + namespace Internal + { + template + constexpr bool sized_range_impl = false; + template + constexpr bool sized_range_impl + && sfinae_trigger_v()))> >> = true; + } + + template + /*concept*/ constexpr bool sized_range = Internal::sized_range_impl; + + namespace Internal + { + template + constexpr bool output_range_impl = false; + template + constexpr bool output_range_impl>> = range && output_iterator, T>; + } + + template + /*concept*/ constexpr bool output_range = Internal::output_range_impl; + + namespace Internal + { + template + constexpr bool input_range_impl = false; + template + constexpr bool input_range_impl>> = range && input_iterator>; + } + + template + /*concept*/ constexpr bool input_range = Internal::input_range_impl; + + namespace Internal + { + template + constexpr bool forward_range_impl = false; + template + constexpr bool forward_range_impl>> = input_range && forward_iterator>; + } + + template + /*concept*/ constexpr bool forward_range = Internal::forward_range_impl; + + namespace Internal + { + template + constexpr bool bidirectional_range_impl = false; + template + constexpr bool bidirectional_range_impl>> = forward_range && bidirectional_iterator>; + } + + template + /*concept*/ constexpr bool bidirectional_range = Internal::bidirectional_range_impl; + + namespace Internal + { + template + constexpr bool random_access_range_impl = false; + template + constexpr bool random_access_range_impl>> = bidirectional_range && random_access_iterator>; + } + + template + /*concept*/ constexpr bool random_access_range = Internal::random_access_range_impl; + + template + using range_size_t = enable_if_t, decltype(ranges::size(declval()))>; + template + using range_difference_t = enable_if_t, iter_difference_t>>; + template + using range_value_t = enable_if_t, iter_value_t>>; + template + using range_reference_t = enable_if_t, iter_reference_t>>; + template + using range_rvalue_reference_t = enable_if_t, iter_rvalue_reference_t>>; + + + namespace Internal + { + template + constexpr bool contiguous_range_impl = false; + template + constexpr bool contiguous_range_impl + && contiguous_iterator> + && same_as())), add_pointer_t>> >> = true; + } + + template + /*concept*/ constexpr bool contiguous_range = Internal::contiguous_range_impl; + + template + /*concept*/ constexpr bool common_range = range && same_as, sentinel_t>; +} + +namespace AZStd::ranges +{ + // iterator operations + // ranges::advance + namespace Internal + { + struct advance_fn + { + template + constexpr auto operator()(I& i, iter_difference_t n) const -> + enable_if_t> + { + if constexpr (random_access_iterator) + { + i += n; + } + else + { + for (; n > 0; ++i, --n) {} + + // The Precondition is that if I is not a bidirectional iterator, n must be positive + if constexpr (bidirectional_iterator) + { + for (; n < 0; --i, ++n) {} + } + } + } + + template + constexpr auto operator()(I& i, S bound) const -> + enable_if_t&& sentinel_for> + { + if constexpr (assignable_from) + { + i = AZStd::move(bound); + } + else if constexpr (sized_sentinel_for) + { + operator()(i, bound - i); + } + else + { + for (; i != bound; ++i) {} + } + } + + template + constexpr auto operator()(I& i, iter_difference_t n, S bound) const -> + enable_if_t&& sentinel_for, iter_difference_t> + { + if constexpr (sized_sentinel_for) + { + if (const auto dist = bound - i; + (n > 0 && n > dist) || (n < 0 && n < dist)) + { + // advance is limited to the i reach bound + operator()(i, bound); + return n - dist; + } + else if (n != 0) + { + // advance is limited by the value of n + operator()(i, n); + return 0; + } + + return 0; + } + else + { + for (; i != bound && n > 0; ++i, --n) {} + if constexpr (bidirectional_iterator && same_as) + { + for (; i != bound && n < 0; --i, ++n) {} + } + + return n; + } + } + }; + } + + inline namespace customization_point_object + { + inline constexpr Internal::advance_fn advance{}; + } + + // ranges::distance + namespace Internal + { + struct distance_fn + { + template + constexpr auto operator()(I first, S last) const -> + enable_if_t && sentinel_for && !sized_sentinel_for, + iter_difference_t> + { + // Since S is not a sized sentinel, can only increment from first to last + iter_difference_t result{}; + for (; first != last; ++first, ++result) {} + + return result; + } + + template + constexpr auto operator()(const I& first, const S& last) const -> + enable_if_t && sentinel_for && sized_sentinel_for, + iter_difference_t> + { + return last - first; + } + + template + constexpr auto operator()(R&& r) const -> + enable_if_t, range_difference_t> + { + if constexpr (sized_range) + { + return ranges::size(r); + } + else + { + operator()(ranges::begin(r), ranges::end(r)); + } + } + }; + } + + inline namespace customization_point_object + { + inline constexpr Internal::distance_fn distance{}; + } + + // ranges::next + namespace Internal + { + struct next_fn + { + template + constexpr auto operator()(I x) const -> + enable_if_t, I> + { + ++x; + return x; + } + + template + constexpr auto operator()(I x, iter_difference_t n) const -> + enable_if_t, I> + { + ranges::advance(x, n); + return x; + } + + template + constexpr auto operator()(I x, S bound) const -> + enable_if_t&& sentinel_for, I> + { + ranges::advance(x, bound); + return x; + } + + template + constexpr auto operator()(I x, iter_difference_t n, S bound) const -> + enable_if_t&& sentinel_for, I> + { + ranges::advance(x, n, bound); + return x; + } + }; + } + + inline namespace customization_point_object + { + inline constexpr Internal::next_fn next{}; + } + + //ranges::prev + namespace Internal + { + struct prev_fn + { + template + constexpr auto operator()(I x) const -> + enable_if_t, I> + { + --x; + return x; + } + + template + constexpr auto operator()(I x, iter_difference_t n) const -> + enable_if_t, I> + { + ranges::advance(x, -n); + return x; + } + + template + constexpr auto operator()(I x, iter_difference_t n, S bound) const -> + enable_if_t&& sentinel_for, I> + { + ranges::advance(x, -n, bound); + return x; + } + }; + } + + inline namespace customization_point_object + { + inline constexpr Internal::prev_fn prev{}; + } +} + +namespace AZStd::ranges +{ + namespace Internal + { + template + constexpr bool is_initializer_list = false; + template + constexpr bool is_initializer_list> = true; + } + + //! views + // view interface can be used with non-constant class types + template + class view_interface; + template + class view_interface< D, enable_if_t && same_as> >> + { + private: + constexpr D& derived() noexcept + { + return static_cast(*this); + } + constexpr const D& derived() const noexcept + { + return static_cast(*this); + } + + public: + template + constexpr auto empty() -> enable_if_t, bool> + { + return ranges::begin(derived()) == ranges::end(derived()); + } + template + constexpr auto empty() const -> enable_if_t, bool> + { + return ranges::begin(derived()) == ranges::end(derived()); + } + + template ()))>> + constexpr explicit operator bool() const noexcept(noexcept(ranges::empty(derived()))) + { + return !ranges::empty(derived()); + } + + template + constexpr auto data() -> + enable_if_t>, decltype(to_address(ranges::begin(derived())))> + { + return to_address(ranges::begin(derived())); + } + template + constexpr auto data() const -> + enable_if_t>, decltype(to_address(ranges::begin(derived())))> + { + return to_address(ranges::begin(derived())); + } + + template + constexpr auto size() -> + enable_if_t && sized_sentinel_for, iterator_t>, + decltype(ranges::end(derived()) - ranges::begin(derived()))> + { + return ranges::end(derived()) - ranges::begin(derived()); + } + template + constexpr auto size() const -> + enable_if_t&& sized_sentinel_for, iterator_t>, + decltype(ranges::end(derived()) - ranges::begin(derived()))> + { + return ranges::end(derived()) - ranges::begin(derived()); + } + + template + constexpr auto front() -> + enable_if_t, decltype(*ranges::begin(derived()))> + { + return *ranges::begin(derived()); + } + template + constexpr auto front() const -> + enable_if_t, decltype(*ranges::begin(derived()))> + { + return *ranges::begin(derived()); + } + + template + constexpr auto back() -> + enable_if_t && common_range, decltype(*ranges::prev(ranges::end(derived())))> + { + return *ranges::prev(ranges::end(derived())); + } + + template + constexpr auto back() const -> + enable_if_t&& common_range, decltype(*ranges::prev(ranges::end(derived())))> + { + return *ranges::prev(ranges::end(derived())); + } + + template + constexpr auto operator[](range_difference_t n) -> + enable_if_t, decltype(ranges::begin(derived())[n])> + { + return ranges::begin(derived())[n]; + } + template + constexpr auto operator[](range_difference_t n) const -> + enable_if_t, decltype(ranges::begin(derived())[n])> + { + return ranges::begin(derived())[n]; + } + }; + + struct view_base {}; + namespace Internal + { + template + void derived_from_view_interface_template(view_interface&); + template + inline constexpr bool is_derived_from_view_interface = false; + template + inline constexpr bool is_derived_from_view_interface()))> = true; + } + template + inline constexpr bool enable_view = derived_from || Internal::is_derived_from_view_interface; + + template + /*concept*/ constexpr bool view = range && movable && enable_view; + + template + /*concept*/ constexpr bool viewable_range = range && + ((view> && constructible_from, T>) || + (!view> && + (is_lvalue_reference_v || (movable> && !Internal::is_initializer_list)))); +} + + +namespace AZStd::ranges +{ +#if __has_cpp_attribute(no_unique_address) +#define az_no_unique_address [[no_unique_address]] +#else +#define az_no_unique_address +#endif + template + struct in_in_result + { + az_no_unique_address I1 in1; + az_no_unique_address I2 in2; + + template&& convertible_to> > + constexpr operator in_in_result() const& + { + return { in1, in2 }; + } + + template&& convertible_to> > + constexpr operator in_in_result()&& + { + return { AZStd::move(in1), AZStd::move(in2) }; + } + }; + +#undef az_no_unique_address + + template + using swap_ranges_result = in_in_result; + + namespace Internal + { + struct swap_ranges_fn + { + template + constexpr auto operator()(I1 first1, S1 last1, I2 first2, S2 last2) const -> + enable_if_t&& sentinel_for + && input_iterator&& sentinel_for + && indirectly_swappable, + swap_ranges_result> + { + for (; !(first1 == last1 or first2 == last2); ++first1, ++first2) + { + ranges::iter_swap(first1, first2); + } + return { AZStd::move(first1), AZStd::move(first2) }; + } + + template + constexpr auto operator()(R1&& r1, R2&& r2) const -> + enable_if_t&& input_range + && indirectly_swappable, iterator_t>, + swap_ranges_result, borrowed_iterator_t>> + { + return operator()(ranges::begin(r1), ranges::end(r1), + ranges::begin(r2), ranges::end(r2)); + } + }; + } + inline namespace customization_point_object + { + constexpr Internal::swap_ranges_fn swap_ranges{}; + } +} + +namespace AZStd::ranges::Internal +{ + // Implementation of ranges::swap customization point overload which calls ranges::swap_ranges + // Must be done after the ranges::swap_ranges function has been declared + // ranges::swap customization point https://eel.is/c++draft/concepts#concept.swappable-2.2 + template + constexpr auto swap_fn::operator()(T&& t, U&& u) const noexcept(noexcept((*this)(*t, *u))) + ->enable_if_t + && is_array_v && is_array_v && (extent_v == extent_v) + > + { + ranges::swap_ranges(t, u); + } +} diff --git a/Code/Framework/AzCore/AzCore/std/string/fixed_string.h b/Code/Framework/AzCore/AzCore/std/string/fixed_string.h index ea841bc4ca..bbaab391b4 100644 --- a/Code/Framework/AzCore/AzCore/std/string/fixed_string.h +++ b/Code/Framework/AzCore/AzCore/std/string/fixed_string.h @@ -74,7 +74,7 @@ namespace AZStd constexpr basic_fixed_string(const_pointer ptr); // #6 - template && !is_convertible_v>> + template && !is_convertible_v>> constexpr basic_fixed_string(InputIt first, InputIt last); // #7 @@ -146,7 +146,7 @@ namespace AZStd constexpr auto append(size_type count, Element ch) -> basic_fixed_string&; template constexpr auto append(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, basic_fixed_string&>; + -> enable_if_t && !is_convertible_v, basic_fixed_string&>; constexpr auto append(AZStd::initializer_list ilist) -> basic_fixed_string&; constexpr auto assign(const basic_fixed_string& rhs) -> basic_fixed_string&; @@ -161,7 +161,7 @@ namespace AZStd constexpr auto assign(size_type count, Element ch) -> basic_fixed_string&; template constexpr auto assign(InputIt first, InputIt last) - ->enable_if_t && !is_convertible_v, basic_fixed_string&>; + ->enable_if_t && !is_convertible_v, basic_fixed_string&>; constexpr auto assign(AZStd::initializer_list ilist) -> basic_fixed_string&; @@ -179,7 +179,7 @@ namespace AZStd constexpr auto insert(const_iterator insertPos, size_type count, Element ch) -> iterator; template constexpr auto insert(const_iterator insertPos, InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, iterator>; + -> enable_if_t && !is_convertible_v, iterator>; constexpr auto insert(const_iterator insertPos, AZStd::initializer_list ilist) -> iterator; @@ -215,7 +215,7 @@ namespace AZStd constexpr auto replace(const_iterator first, const_iterator last, size_type count, Element ch) -> basic_fixed_string&; template constexpr auto replace(const_iterator first, const_iterator last, InputIt first2, InputIt last2) - -> enable_if_t && !is_convertible_v, basic_fixed_string&>; + -> enable_if_t && !is_convertible_v, basic_fixed_string&>; constexpr auto replace(const_iterator first, const_iterator last, AZStd::initializer_list ilist) -> basic_fixed_string&; constexpr auto at(size_type offset) -> reference; diff --git a/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl b/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl index caa047f3c8..65fc1d88be 100644 --- a/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl +++ b/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl @@ -325,14 +325,14 @@ namespace AZStd template template inline constexpr auto basic_fixed_string::append(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, basic_fixed_string&> + -> enable_if_t && !is_convertible_v, basic_fixed_string&> { - if constexpr (Internal::satisfies_contiguous_iterator_concept_v + if constexpr (contiguous_iterator && is_same_v::value_type, value_type>) { return append(AZStd::to_address(first), AZStd::distance(first, last)); } - else if constexpr (Internal::is_forward_iterator_v) + else if constexpr (forward_iterator) { // Input Iterator pointer type doesn't match the const_pointer type // So the elements need to be appended one by one into the buffer @@ -461,14 +461,14 @@ namespace AZStd template template inline constexpr auto basic_fixed_string::assign(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, basic_fixed_string&> + -> enable_if_t && !is_convertible_v, basic_fixed_string&> { - if constexpr (Internal::satisfies_contiguous_iterator_concept_v + if constexpr (contiguous_iterator && is_same_v::value_type, value_type>) { return assign(AZStd::to_address(first), AZStd::distance(first, last)); } - else if constexpr (Internal::is_forward_iterator_v) + else if constexpr (forward_iterator) { // Input Iterator pointer type doesn't match the const_pointer type // So the elements need to be assigned one by one into the buffer @@ -627,15 +627,15 @@ namespace AZStd template template inline constexpr auto basic_fixed_string::insert(const_iterator insertPos, - InputIt first, InputIt last)-> enable_if_t && !is_convertible_v, iterator> + InputIt first, InputIt last)-> enable_if_t && !is_convertible_v, iterator> { // insert [_First, _Last) at _Where size_type insertOffset = AZStd::distance(cbegin(), insertPos); - if constexpr (Internal::satisfies_contiguous_iterator_concept_v + if constexpr (contiguous_iterator && is_same_v::value_type, value_type>) { insert(insertOffset, AZStd::to_address(first), AZStd::distance(first, last)); } - else if constexpr (Internal::is_forward_iterator_v) + else if constexpr (forward_iterator) { // Input Iterator pointer type doesn't match the const_pointer type // So the elements need to be inserted one by one into the buffer @@ -927,14 +927,14 @@ namespace AZStd template template inline constexpr auto basic_fixed_string::replace(const_iterator first, const_iterator last, - InputIt replaceFirst, InputIt replaceLast) -> enable_if_t && !is_convertible_v, basic_fixed_string&> + InputIt replaceFirst, InputIt replaceLast) -> enable_if_t && !is_convertible_v, basic_fixed_string&> { // replace [first, last) with [replaceFirst,replaceLast) - if constexpr (Internal::satisfies_contiguous_iterator_concept_v + if constexpr (contiguous_iterator && is_same_v::value_type, value_type>) { return replace(first, last, AZStd::to_address(replaceFirst), AZStd::distance(replaceFirst, replaceLast)); } - else if constexpr (Internal::is_forward_iterator_v) + else if constexpr (forward_iterator) { // Input Iterator pointer type doesn't match the const_pointer type // So the elements need to be appended one by one into the buffer diff --git a/Code/Framework/AzCore/AzCore/std/string/string.h b/Code/Framework/AzCore/AzCore/std/string/string.h index c65d699d15..c2f4a6953e 100644 --- a/Code/Framework/AzCore/AzCore/std/string/string.h +++ b/Code/Framework/AzCore/AzCore/std/string/string.h @@ -114,28 +114,23 @@ namespace AZStd assign(count, ch); } - template && !is_convertible_v>> + template && !is_convertible_v>> inline basic_string(InputIt first, InputIt last, const Allocator& alloc = Allocator()) : m_storage{ skip_element_tag{}, alloc } { // construct from [first, last) assign(first, last); } - inline basic_string(const_pointer first, const_pointer last) - { // construct from [first, last), const pointers - assign(first, last - first); - } - inline basic_string(const this_type& rhs) : m_storage{ skip_element_tag{}, rhs.m_storage.second() } { - assign(rhs, 0, npos); + assign(rhs); } inline basic_string(this_type&& rhs) - : m_storage{ skip_element_tag{}, AZStd::move(rhs.m_storage.second()) } + : m_storage{ skip_element_tag{}, rhs.m_storage.second() } { - assign(AZStd::forward(rhs)); + assign(AZStd::move(rhs)); } inline basic_string(const this_type& rhs, size_type rhsOffset, size_type count = npos) @@ -251,14 +246,14 @@ namespace AZStd template inline auto append(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, this_type&> + -> enable_if_t && !is_convertible_v, this_type&> { // append [first, last) - if constexpr (Internal::satisfies_contiguous_iterator_concept_v + if constexpr (contiguous_iterator && is_same_v::value_type, value_type>) { return append(AZStd::to_address(first), AZStd::distance(first, last)); } - else if constexpr (Internal::is_forward_iterator_v) + else if constexpr (forward_iterator) { // Input Iterator pointer type doesn't match the const_pointer type // So the elements need to be appended one by one into the buffer @@ -299,7 +294,7 @@ namespace AZStd inline this_type& assign(const this_type& rhs) { - return assign(rhs, 0, npos); + return this != &rhs ? assign(rhs, 0, npos) : *this; } inline this_type& assign(basic_string_view view) @@ -319,7 +314,8 @@ namespace AZStd pointer rhsData = rhs.data(); // Memmove the right hand side string data if it is using the short string optimization // Otherwise set the pointer to the right hand side - if (rhs.m_storage.first().ShortStringOptimizationActive()) + if (rhs.m_storage.first().ShortStringOptimizationActive() || + (get_allocator() != rhs.get_allocator() && !allocator_traits::propagate_on_container_move_assignment::value)) { Traits::move(data, rhsData, rhs.size() + 1); // string + null-terminator } @@ -395,14 +391,14 @@ namespace AZStd template auto assign(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, this_type&> + -> enable_if_t && !is_convertible_v, this_type&> { - if constexpr (Internal::satisfies_contiguous_iterator_concept_v + if constexpr (contiguous_iterator && is_same_v::value_type, value_type>) { return assign(AZStd::to_address(first), AZStd::distance(first, last)); } - else if constexpr (Internal::is_forward_iterator_v) + else if constexpr (forward_iterator) { // forward iterator pointer type doesn't match the const_pointer type // So the elements need to be assigned one by one into the buffer @@ -431,7 +427,7 @@ namespace AZStd inputCopy.push_back(static_cast(*first)); } - return assign(inputCopy.c_str(), inputCopy.size()); + return assign(AZStd::move(inputCopy)); } } inline this_type& insert(size_type offset, const this_type& rhs) { return insert(offset, rhs, 0, npos); } @@ -539,15 +535,15 @@ namespace AZStd template auto insert(const_iterator insertPos, InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, iterator> + -> enable_if_t && !is_convertible_v, iterator> { // insert [_First, _Last) at _Where size_type insertOffset = AZStd::distance(cbegin(), insertPos); - if constexpr (Internal::satisfies_contiguous_iterator_concept_v + if constexpr (contiguous_iterator && is_same_v::value_type, value_type>) { insert(insertOffset, AZStd::to_address(first), AZStd::distance(first, last)); } - else if constexpr (Internal::is_forward_iterator_v) + else if constexpr (forward_iterator) { // Input Iterator pointer type doesn't match the const_pointer type // So the elements need to be inserted one by one into the buffer @@ -834,14 +830,14 @@ namespace AZStd template inline auto replace(const_iterator first, const_iterator last, InputIt replaceFirst, InputIt replaceLast) - -> enable_if_t && !is_convertible_v, this_type&> + -> enable_if_t && !is_convertible_v, this_type&> { - if constexpr (Internal::satisfies_contiguous_iterator_concept_v + if constexpr (contiguous_iterator && is_same_v::value_type, value_type>) { return replace(first, last, AZStd::to_address(replaceFirst), AZStd::distance(replaceFirst, replaceLast)); } - else if constexpr (Internal::is_forward_iterator_v) + else if constexpr (forward_iterator) { // Input Iterator pointer type doesn't match the const_pointer type // So the elements need to be appended one by one into the buffer @@ -1031,12 +1027,19 @@ namespace AZStd // same allocator, swap storage m_storage.first().swap(rhs.m_storage.first()); } + else if (allocator_traits::propagate_on_container_swap::value) + { + // The allocator propagates on swap, so the allocators can be swapped + m_storage.first().swap(rhs.m_storage.first()); + using AZStd::swap; + swap(m_storage.second(), rhs.m_storage.second()); + } else { // different allocator, do multiple assigns - this_type tmp = *this; - *this = rhs; - rhs = tmp; + this_type tmp = AZStd::move(*this); + *this = AZStd::move(rhs); + rhs = AZStd::move(tmp); } } diff --git a/Code/Framework/AzCore/AzCore/std/string/string_view.h b/Code/Framework/AzCore/AzCore/std/string/string_view.h index 1579e43f4d..c333e2cea1 100644 --- a/Code/Framework/AzCore/AzCore/std/string/string_view.h +++ b/Code/Framework/AzCore/AzCore/std/string/string_view.h @@ -7,6 +7,7 @@ */ #pragma once +#include #include #include #include @@ -613,8 +614,9 @@ namespace AZStd {} template - && is_same_v::value_type, value_type> + contiguous_iterator + && sized_sentinel_for + && is_same_v, value_type> && !is_convertible_v> > constexpr basic_string_view(It first, End last) @@ -961,23 +963,6 @@ namespace AZStd using string_view = basic_string_view; using wstring_view = basic_string_view; - template> - using basic_const_string = basic_string_view; - using const_string = string_view; - using const_wstring = wstring_view; - - template > - constexpr typename basic_string_view::const_iterator begin(basic_string_view sv) - { - return sv.begin(); - } - - template > - constexpr typename basic_string_view::const_iterator end(basic_string_view sv) - { - return sv.end(); - } - inline namespace literals { inline namespace string_view_literals @@ -1024,6 +1009,15 @@ namespace AZStd } // namespace AZStd +namespace AZStd::ranges +{ + template + inline constexpr bool enable_borrowed_range> = true; + + template + inline constexpr bool enable_view> = true; +} + //! Use this macro to simplify safe printing of a string_view which may not be null-terminated. //! Example: AZStd::string::format("Safely formatted: %.*s", AZ_STRING_ARG(myString)); #define AZ_STRING_ARG(str) aznumeric_cast(str.size()), str.data() diff --git a/Code/Framework/AzCore/AzCore/std/typetraits/common_reference.h b/Code/Framework/AzCore/AzCore/std/typetraits/common_reference.h new file mode 100644 index 0000000000..51fd9c1dda --- /dev/null +++ b/Code/Framework/AzCore/AzCore/std/typetraits/common_reference.h @@ -0,0 +1,230 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace AZStd +{ + template class TQual, template class UQual> + struct basic_common_reference + {}; +} + +namespace AZStd::Internal +{ + // const volatile and reference qualifier copy templates + template + struct copy_cv_qual + { + using type = conditional_t, conditional_t, const volatile QualType, const QualType>, + conditional_t, volatile QualType, QualType>>; + }; + + template + using copy_cv_qual_t = typename copy_cv_qual::type; + + static_assert(is_same_v, float>); + static_assert(is_same_v, const float>); + static_assert(is_same_v, volatile float>); + static_assert(is_same_v, const volatile float>); + static_assert(is_same_v, const float>); + static_assert(is_same_v, const float>); + static_assert(is_same_v, const volatile float>); + static_assert(is_same_v, const volatile float>); + static_assert(is_same_v, volatile float>); + static_assert(is_same_v, const volatile float>); + static_assert(is_same_v, volatile float>); + static_assert(is_same_v, const volatile float>); + static_assert(is_same_v, const volatile float>); + static_assert(is_same_v, const volatile float>); + static_assert(is_same_v, const volatile float>); + static_assert(is_same_v, const volatile float>); + + template + struct copy_reference_qual + { + using type = conditional_t, QualType&, + conditional_t, QualType&&, QualType>>; + }; + + template + using copy_reference_qual_t = typename copy_reference_qual::type; + + static_assert(is_same_v, float>); + static_assert(is_same_v, float&>); + static_assert(is_same_v, float&&>); + static_assert(is_same_v, float&>); + static_assert(is_same_v, float&>); + static_assert(is_same_v, float&>); + static_assert(is_same_v, float&&>); + static_assert(is_same_v, float&>); + static_assert(is_same_v, float&&>); + + template + using copy_cvref_qual_t = copy_cv_qual_t, QualType>; + + template + struct copy_qualifiers_from_t + { + template + using templ = copy_cvref_qual_t; + }; + + template + using cond_res = decltype(false ? declval, remove_reference_t>&>() + : declval, remove_reference_t>&>()); + + // common reference helper templates begin + template + struct common_reference_base_reference_test; + + // COMMON_REF is defined within the C++ standard at https://eel.is/c++draft/meta.trans.other#3.5 + template + struct common_reference_base_reference_test&& is_lvalue_reference_v, + void_t> >> + { + // Uses the ternary operator for determining the common type + using type = cond_res; + }; + + template + struct common_reference_base_reference_test&& is_rvalue_reference_v>> + { + using C = remove_reference_t&, remove_reference_t&>::type>; + using type = AZStd::enable_if_t&& is_convertible_v, C>; + }; + + template + struct common_reference_base_reference_test&& is_lvalue_reference_v>> + { + // Turn rvalue references to const lvalue references + using D = typename common_reference_base_reference_test&, remove_reference_t&>::type; + using type = AZStd::enable_if_t, D>; + }; + + template + struct common_reference_base_reference_test&& is_rvalue_reference_v>> + { + // Swap the parameters to call the 3rd specialization for common_reference_base_reference_test + using type = typename common_reference_base_reference_test::type; + }; + + template + constexpr bool has_reference_test = false; + + template + constexpr bool has_reference_test::type>> = true; + + template + struct basic_common_reference_test; + + template + struct basic_common_reference_test, remove_cvref_t, + copy_qualifiers_from_t::template templ, copy_qualifiers_from_t::template templ>::type>> + { + using type = typename basic_common_reference, remove_cvref_t, + copy_qualifiers_from_t::template templ, copy_qualifiers_from_t::template templ>::type; + }; + + template + constexpr bool has_basic_common_reference_test = false; + + template + constexpr bool has_basic_common_reference_test::type>> = true; + + template + constexpr bool has_condition_result_test = false; + + template + constexpr bool has_condition_result_test() : declval())>> = true; + + template + struct common_reference_base_test + {}; + + template + struct common_reference_base_test>> + : common_reference_base_reference_test + {}; + template + struct common_reference_base_test + && has_basic_common_reference_test>> + : basic_common_reference_test + {}; + template + struct common_reference_base_test + && !has_basic_common_reference_test && has_condition_result_test>> + { + using type = decltype(false ? declval() : declval()); + }; + template + struct common_reference_base_test + && !has_basic_common_reference_test && !has_condition_result_test>> + : common_type + {}; + + template + struct common_reference_base + {}; + + template + struct common_reference_base + { + using type = T; + }; + template + struct common_reference_base + : common_reference_base_test + {}; + + template + struct common_reference_base + : common_reference_base::type, V, Rs...> + {}; +} +namespace AZStd +{ + template + struct common_reference + : Internal::common_reference_base + {}; + + template + using common_reference_t = typename common_reference::type; + + // models the common reference concept + namespace Internal + { + template + constexpr bool common_reference_with_impl = false; + template + constexpr bool common_reference_with_impl, common_reference_t> + && convertible_to> + && convertible_to> + >> = true; + } + + template + /*concept*/ constexpr bool common_reference_with = Internal::common_reference_with_impl; +} diff --git a/Code/Framework/AzCore/AzCore/std/typetraits/is_convertible.h b/Code/Framework/AzCore/AzCore/std/typetraits/is_convertible.h index 65f3b9908c..1f2933cecf 100644 --- a/Code/Framework/AzCore/AzCore/std/typetraits/is_convertible.h +++ b/Code/Framework/AzCore/AzCore/std/typetraits/is_convertible.h @@ -8,12 +8,26 @@ #pragma once +#include #include +#include +#include namespace AZStd { using std::is_convertible; + using std::is_convertible_v; + + // models the C++20 convertible_to concept + namespace Internal + { + template + constexpr bool convertible_to_impl = false; + template + constexpr bool convertible_to_impl, void_t(declval()))>>> = true; + } template - constexpr bool is_convertible_v = std::is_convertible_v; + /*concept*/ constexpr bool convertible_to = Internal::convertible_to_impl; } diff --git a/Code/Framework/AzCore/AzCore/std/typetraits/is_destructible.h b/Code/Framework/AzCore/AzCore/std/typetraits/is_destructible.h index ac03f01d3b..39d79781f4 100644 --- a/Code/Framework/AzCore/AzCore/std/typetraits/is_destructible.h +++ b/Code/Framework/AzCore/AzCore/std/typetraits/is_destructible.h @@ -21,4 +21,7 @@ namespace AZStd constexpr bool is_trivially_destructible_v = std::is_trivially_destructible::value; template constexpr bool is_nothrow_destructible_v = std::is_nothrow_destructible::value; + + template + /*concept*/ constexpr bool destructible = is_nothrow_destructible_v; } diff --git a/Code/Framework/AzCore/AzCore/std/typetraits/is_floating_point.h b/Code/Framework/AzCore/AzCore/std/typetraits/is_floating_point.h index 7408866ed7..b973ac714c 100644 --- a/Code/Framework/AzCore/AzCore/std/typetraits/is_floating_point.h +++ b/Code/Framework/AzCore/AzCore/std/typetraits/is_floating_point.h @@ -13,4 +13,7 @@ namespace AZStd { using std::is_floating_point; using std::is_floating_point_v; + + template + /*concept*/ constexpr bool floating_point = is_floating_point_v; } diff --git a/Code/Framework/AzCore/AzCore/std/typetraits/is_integral.h b/Code/Framework/AzCore/AzCore/std/typetraits/is_integral.h index a51e06dc06..eb699aa6d1 100644 --- a/Code/Framework/AzCore/AzCore/std/typetraits/is_integral.h +++ b/Code/Framework/AzCore/AzCore/std/typetraits/is_integral.h @@ -13,4 +13,7 @@ namespace AZStd { using std::is_integral; using std::is_integral_v; + + template + /*concept*/ constexpr bool integral = is_integral_v; } diff --git a/Code/Framework/AzCore/AzCore/std/typetraits/is_same.h b/Code/Framework/AzCore/AzCore/std/typetraits/is_same.h index 858e9b1f52..61037d7549 100644 --- a/Code/Framework/AzCore/AzCore/std/typetraits/is_same.h +++ b/Code/Framework/AzCore/AzCore/std/typetraits/is_same.h @@ -13,4 +13,8 @@ namespace AZStd { using std::is_same; using std::is_same_v; + + // models the same_as concept + template + /*concept*/ constexpr bool same_as = is_same_v; } diff --git a/Code/Framework/AzCore/AzCore/std/typetraits/typetraits.h b/Code/Framework/AzCore/AzCore/std/typetraits/typetraits.h index d29b0c28ee..bf45d15836 100644 --- a/Code/Framework/AzCore/AzCore/std/typetraits/typetraits.h +++ b/Code/Framework/AzCore/AzCore/std/typetraits/typetraits.h @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/Code/Framework/AzCore/AzCore/std/utility/declval.h b/Code/Framework/AzCore/AzCore/std/utility/declval.h new file mode 100644 index 0000000000..c017bb142a --- /dev/null +++ b/Code/Framework/AzCore/AzCore/std/utility/declval.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include + +namespace AZStd +{ + using std::declval; +} diff --git a/Code/Framework/AzCore/AzCore/std/utility/move.h b/Code/Framework/AzCore/AzCore/std/utility/move.h new file mode 100644 index 0000000000..71f2a49b18 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/std/utility/move.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +namespace AZStd +{ + // rvalue + // rvalue move + template + constexpr AZStd::remove_reference_t&& move(T&& t) + { + return static_cast&&>(t); + } +} diff --git a/Code/Framework/AzCore/AzCore/std/utils.h b/Code/Framework/AzCore/AzCore/std/utils.h index 4c918250de..d3ead8022b 100644 --- a/Code/Framework/AzCore/AzCore/std/utils.h +++ b/Code/Framework/AzCore/AzCore/std/utils.h @@ -22,22 +22,15 @@ #include #include #include +#include +#include #include namespace AZStd { ////////////////////////////////////////////////////////////////////////// - // rvalue - // rvalue move - template - constexpr AZStd::remove_reference_t&& move(T && t) - { - return static_cast&&>(t); - } - using std::forward; - using std::declval; using std::exchange; template diff --git a/Code/Framework/AzCore/Tests/AZStd/ConceptsTests.cpp b/Code/Framework/AzCore/Tests/AZStd/ConceptsTests.cpp new file mode 100644 index 0000000000..718edfcde4 --- /dev/null +++ b/Code/Framework/AzCore/Tests/AZStd/ConceptsTests.cpp @@ -0,0 +1,202 @@ +/* + * 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 + * + */ + +#include +#include + +namespace UnitTest +{ + class ConceptsTestFixture + : public ScopedAllocatorSetupFixture + {}; + + TEST_F(ConceptsTestFixture, GeneralConcepts) + { + + // concept same_as + static_assert(AZStd::same_as); + static_assert(!AZStd::same_as); + + // concept derived_from + static_assert(AZStd::derived_from); + static_assert(!AZStd::derived_from); + + // concept convertible_to + static_assert(AZStd::convertible_to); + static_assert(!AZStd::convertible_to); + + + // Test structs to validate common_reference_with and common_with concepts + struct Base {}; + struct TestBase : Base {}; + struct NoMove + { + NoMove(NoMove&&) = delete; + NoMove& operator=(NoMove&&) = delete; + }; + struct NoDestructible + { + ~NoDestructible() = delete; + }; + struct NoDefaultInitializable + { + NoDefaultInitializable(bool); + }; + + struct CopyOnly + { + CopyOnly(const CopyOnly&) = default; + }; + struct MoveOnly + { + MoveOnly(MoveOnly&&) = default; + }; + + struct MoveableButNotCopyable + { + MoveableButNotCopyable(MoveableButNotCopyable&&) = default; + MoveableButNotCopyable& operator=(MoveableButNotCopyable&&) = default; + }; + + // concept common_reference_with + static_assert(AZStd::common_reference_with); + static_assert(AZStd::same_as, const Base&>); + static_assert(!AZStd::common_reference_with); + + // concept common_with + static_assert(AZStd::common_with); + static_assert(!AZStd::common_with); + + // arithmetic concepts + // concept integral + static_assert(AZStd::integral); + static_assert(!AZStd::integral); + + // concept signed_integral + static_assert(AZStd::signed_integral); + static_assert(!AZStd::signed_integral); + static_assert(!AZStd::signed_integral); + + // concept signed_integral + static_assert(AZStd::unsigned_integral); + static_assert(!AZStd::unsigned_integral); + static_assert(!AZStd::unsigned_integral); + + // concept floating_point + static_assert(AZStd::floating_point); + static_assert(!AZStd::floating_point); + + // concept assignable_from + static_assert(AZStd::assignable_from); + static_assert(!AZStd::assignable_from); + + // concept swappable + static_assert(AZStd::swappable); + static_assert(!AZStd::swappable); + static_assert(AZStd::swappable_with); + static_assert(!AZStd::swappable_with); + + // concept destructible + static_assert(AZStd::destructible); + static_assert(!AZStd::destructible); + + // concept constructible_from + static_assert(AZStd::constructible_from); + static_assert(!AZStd::constructible_from); + + // concept default_initializable + static_assert(AZStd::default_initializable); + static_assert(!AZStd::default_initializable); + + // concept move_constructible + static_assert(AZStd::move_constructible); + static_assert(!AZStd::move_constructible); + + // concept copy_constructible + static_assert(AZStd::copy_constructible); + static_assert(!AZStd::copy_constructible); + + // concept equality_comparable + static_assert(AZStd::equality_comparable); + static_assert(!AZStd::equality_comparable); + static_assert(AZStd::equality_comparable_with); + static_assert(!AZStd::equality_comparable_with); + static_assert(!AZStd::equality_comparable_with); + + // concept totally_ordered + static_assert(AZStd::totally_ordered); + static_assert(!AZStd::totally_ordered); + static_assert(AZStd::totally_ordered_with); + static_assert(!AZStd::totally_ordered_with); + static_assert(!AZStd::totally_ordered_with); + + // concept movable + static_assert(AZStd::movable); + static_assert(!AZStd::movable); + + // concept copyable + static_assert(AZStd::copyable); + static_assert(!AZStd::copyable); + + // concept semiregular + static_assert(AZStd::semiregular); + static_assert(!AZStd::semiregular); + + // concept regular + static_assert(AZStd::regular); + static_assert(!AZStd::regular); + + // concept invocable + static_assert(AZStd::invocable); + static_assert(!AZStd::invocable); + + // concept predicate + auto BooleanPredicate = [](double) -> int + { + return 0; + }; + auto BasePredicate = [](int) -> Base + { + return Base{}; + }; + + static_assert(AZStd::predicate); + static_assert(!AZStd::predicate); + static_assert(!AZStd::predicate); + + // concept relation + struct RelationPredicate + { + bool operator()(AZStd::string_view, Base) const; + bool operator()(Base, AZStd::string_view) const; + bool operator()(AZStd::string_view, AZStd::string_view) const; + bool operator()(Base, Base) const; + + // non-complete relation + bool operator()(Base, int) const; + bool operator()(int, Base) const; + }; + + static_assert(AZStd::relation); + static_assert(AZStd::relation); + static_assert(!AZStd::relation); + static_assert(!AZStd::relation); + + //concept equivalence_relation + static_assert(AZStd::equivalence_relation); + static_assert(AZStd::equivalence_relation); + static_assert(!AZStd::equivalence_relation); + static_assert(!AZStd::equivalence_relation); + + //concept strict_weak_order + static_assert(AZStd::strict_weak_order); + static_assert(AZStd::strict_weak_order); + static_assert(!AZStd::strict_weak_order); + static_assert(!AZStd::strict_weak_order); + } +} diff --git a/Code/Framework/AzCore/Tests/AZStd/Iterators.cpp b/Code/Framework/AzCore/Tests/AZStd/Iterators.cpp index 720aa0c7a8..28b596398e 100644 --- a/Code/Framework/AzCore/Tests/AZStd/Iterators.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/Iterators.cpp @@ -6,6 +6,7 @@ * */ #include "UserTypes.h" +#include #include #include #include @@ -13,13 +14,11 @@ #include #include -using namespace AZStd; -using namespace UnitTestInternal; namespace UnitTest { class Iterators - : public AllocatorsFixture + : public ScopedAllocatorSetupFixture { }; @@ -28,30 +27,30 @@ namespace UnitTest { Container int_container = {{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }}; - typename Container::iterator iter_begin = begin(int_container); + typename Container::iterator iter_begin = AZStd::begin(int_container); EXPECT_EQ(*iter_begin, 0); - EXPECT_EQ(*next(iter_begin), 1); - EXPECT_EQ(*next(iter_begin, 2), 2); + EXPECT_EQ(*AZStd::next(iter_begin), 1); + EXPECT_EQ(*AZStd::next(iter_begin, 2), 2); ++iter_begin; EXPECT_EQ(*iter_begin, 1); typename Container::iterator iter_end = end(int_container); EXPECT_EQ(iter_end, int_container.end()); - EXPECT_EQ(*prev(iter_end), 9); - EXPECT_EQ(*prev(iter_end, 2), 8); + EXPECT_EQ(*AZStd::prev(iter_end), 9); + EXPECT_EQ(*AZStd::prev(iter_end, 2), 8); --iter_end; EXPECT_EQ(*iter_end, 9); - typename Container::reverse_iterator iter_rbegin = rbegin(int_container); + typename Container::reverse_iterator iter_rbegin = AZStd::rbegin(int_container); EXPECT_EQ(*iter_rbegin, 9); - EXPECT_EQ(*next(iter_rbegin), 8); - EXPECT_EQ(*next(iter_rbegin, 2), 7); + EXPECT_EQ(*AZStd::next(iter_rbegin), 8); + EXPECT_EQ(*AZStd::next(iter_rbegin, 2), 7); ++iter_rbegin; EXPECT_EQ(*iter_rbegin, 8); - typename Container::reverse_iterator iter_rend = rend(int_container); - EXPECT_EQ(*prev(iter_rend), 0); - EXPECT_EQ(*prev(iter_rend, 2), 1); + typename Container::reverse_iterator iter_rend = AZStd::rend(int_container); + EXPECT_EQ(*AZStd::prev(iter_rend), 0); + EXPECT_EQ(*AZStd::prev(iter_rend, 2), 1); --iter_rend; EXPECT_EQ(*iter_rend, 0); @@ -65,30 +64,30 @@ namespace UnitTest { Container int_container = {{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }}; - typename Container::const_iterator iter_cbegin = cbegin(int_container); + typename Container::const_iterator iter_cbegin = AZStd::cbegin(int_container); EXPECT_EQ(*iter_cbegin, 0); - EXPECT_EQ(*next(iter_cbegin), 1); - EXPECT_EQ(*next(iter_cbegin, 2), 2); + EXPECT_EQ(*AZStd::next(iter_cbegin), 1); + EXPECT_EQ(*AZStd::next(iter_cbegin, 2), 2); ++iter_cbegin; EXPECT_EQ(*iter_cbegin, 1); - typename Container::const_iterator iter_cend = cend(int_container); + typename Container::const_iterator iter_cend = AZStd::cend(int_container); EXPECT_EQ(iter_cend, int_container.cend()); - EXPECT_EQ(*prev(iter_cend), 9); - EXPECT_EQ(*prev(iter_cend, 2), 8); + EXPECT_EQ(*AZStd::prev(iter_cend), 9); + EXPECT_EQ(*AZStd::prev(iter_cend, 2), 8); --iter_cend; EXPECT_EQ(*iter_cend, 9); - typename Container::const_reverse_iterator iter_crbegin = crbegin(int_container); + typename Container::const_reverse_iterator iter_crbegin = AZStd::crbegin(int_container); EXPECT_EQ(*iter_crbegin, 9); - EXPECT_EQ(*next(iter_crbegin), 8); - EXPECT_EQ(*next(iter_crbegin, 2), 7); + EXPECT_EQ(*AZStd::next(iter_crbegin), 8); + EXPECT_EQ(*AZStd::next(iter_crbegin, 2), 7); ++iter_crbegin; EXPECT_EQ(*iter_crbegin, 8); - typename Container::const_reverse_iterator iter_crend = crend(int_container); - EXPECT_EQ(*prev(iter_crend), 0); - EXPECT_EQ(*prev(iter_crend, 2), 1); + typename Container::const_reverse_iterator iter_crend = AZStd::crend(int_container); + EXPECT_EQ(*AZStd::prev(iter_crend), 0); + EXPECT_EQ(*AZStd::prev(iter_crend, 2), 1); --iter_crend; EXPECT_EQ(*iter_crend, 0); } @@ -98,15 +97,15 @@ namespace UnitTest { const ConstContainer const_int_container = {{ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }}; - typename ConstContainer::const_iterator const_iter_begin = begin(const_int_container); + typename ConstContainer::const_iterator const_iter_begin = AZStd::begin(const_int_container); EXPECT_EQ(*const_iter_begin, 10); - EXPECT_EQ(*next(const_iter_begin), 11); - EXPECT_EQ(*next(const_iter_begin, 2), 12); + EXPECT_EQ(*AZStd::next(const_iter_begin), 11); + EXPECT_EQ(*AZStd::next(const_iter_begin, 2), 12); - typename ConstContainer::const_iterator const_iter_end = end(const_int_container); + typename ConstContainer::const_iterator const_iter_end = AZStd::end(const_int_container); EXPECT_EQ(const_iter_end, const_int_container.end()); - EXPECT_EQ(*prev(const_iter_end), 19); - EXPECT_EQ(*prev(const_iter_end, 2), 18); + EXPECT_EQ(*AZStd::prev(const_iter_end), 19); + EXPECT_EQ(*AZStd::prev(const_iter_end, 2), 18); } TEST_F(Iterators, FunctionWrappers_MutableContainers) @@ -136,87 +135,78 @@ namespace UnitTest { int int_array[10] = { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }; - EXPECT_EQ(*begin(int_array), 20); - EXPECT_EQ(*next(begin(int_array)), 21); - EXPECT_EQ(*next(begin(int_array), 2), 22); + EXPECT_EQ(*AZStd::begin(int_array), 20); + EXPECT_EQ(*AZStd::next(AZStd::begin(int_array)), 21); + EXPECT_EQ(*AZStd::next(AZStd::begin(int_array), 2), 22); - EXPECT_EQ(end(int_array) - AZ_ARRAY_SIZE(int_array), begin(int_array)); - EXPECT_EQ(*prev(end(int_array)), 29); - EXPECT_EQ(*prev(end(int_array), 2), 28); + EXPECT_EQ(AZStd::end(int_array) - AZ_ARRAY_SIZE(int_array), AZStd::begin(int_array)); + EXPECT_EQ(*AZStd::prev(AZStd::end(int_array)), 29); + EXPECT_EQ(*AZStd::prev(AZStd::end(int_array), 2), 28); - EXPECT_EQ(*rbegin(int_array), 29); - EXPECT_EQ(*next(rbegin(int_array)), 28); - EXPECT_EQ(*next(rbegin(int_array), 2), 27); + EXPECT_EQ(*AZStd::rbegin(int_array), 29); + EXPECT_EQ(*AZStd::next(AZStd::rbegin(int_array)), 28); + EXPECT_EQ(*AZStd::next(AZStd::rbegin(int_array), 2), 27); - EXPECT_EQ(*prev(rend(int_array)), 20); - EXPECT_EQ(*prev(rend(int_array), 2), 21); + EXPECT_EQ(*AZStd::prev(AZStd::rend(int_array)), 20); + EXPECT_EQ(*AZStd::prev(AZStd::rend(int_array), 2), 21); - EXPECT_EQ(*crbegin(int_array), 29); - EXPECT_EQ(*next(crbegin(int_array)), 28); - EXPECT_EQ(*next(crbegin(int_array), 2), 27); + EXPECT_EQ(*AZStd::crbegin(int_array), 29); + EXPECT_EQ(*AZStd::next(AZStd::crbegin(int_array)), 28); + EXPECT_EQ(*AZStd::next(AZStd::crbegin(int_array), 2), 27); - EXPECT_EQ(*prev(crend(int_array)), 20); - EXPECT_EQ(*prev(crend(int_array), 2), 21); + EXPECT_EQ(*AZStd::prev(AZStd::crend(int_array)), 20); + EXPECT_EQ(*AZStd::prev(AZStd::crend(int_array), 2), 21); //verify we can successfully modify the value in a non-const iterator - *begin(int_array) = -42; - EXPECT_EQ(*begin(int_array), -42); + *AZStd::begin(int_array) = -42; + EXPECT_EQ(*AZStd::begin(int_array), -42); } TEST_F(Iterators, FunctionWrappers_ConstRawArray) { const int const_int_array[10] = { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 }; - EXPECT_EQ(*cbegin(const_int_array), 30); - EXPECT_EQ(*next(cbegin(const_int_array)), 31); - EXPECT_EQ(*next(cbegin(const_int_array), 2), 32); + EXPECT_EQ(*AZStd::cbegin(const_int_array), 30); + EXPECT_EQ(*AZStd::next(AZStd::cbegin(const_int_array)), 31); + EXPECT_EQ(*AZStd::next(AZStd::cbegin(const_int_array), 2), 32); - EXPECT_EQ(cend(const_int_array) - AZ_ARRAY_SIZE(const_int_array), cbegin(const_int_array)); - EXPECT_EQ(*prev(cend(const_int_array)), 39); - EXPECT_EQ(*prev(cend(const_int_array), 2), 38); + EXPECT_EQ(AZStd::cend(const_int_array) - AZ_ARRAY_SIZE(const_int_array), AZStd::cbegin(const_int_array)); + EXPECT_EQ(*AZStd::prev(AZStd::cend(const_int_array)), 39); + EXPECT_EQ(*AZStd::prev(AZStd::cend(const_int_array), 2), 38); } TEST_F(Iterators, IteratorTraits_ResolveAtCompileTime) { using list_type = AZStd::list; - static_assert(AZStd::Internal::has_iterator_category_v); - static_assert(AZStd::Internal::has_iterator_type_aliases_v); constexpr bool list_type_iterator_type_aliases = AZStd::Internal::has_iterator_type_aliases_v; static_assert(AZStd::is_convertible_v::iterator_category, AZStd::input_iterator_tag>); - static_assert(is_same_v::iterator_category, bidirectional_iterator_tag>); - static_assert(is_same_v::value_type, int>); - static_assert(is_same_v::difference_type, AZStd::ptrdiff_t>); - static_assert(is_same_v::pointer, int*>); - static_assert(is_same_v::reference, int&>); - static_assert(AZStd::Internal::is_input_iterator_v); - static_assert(!AZStd::Internal::has_iterator_concept_v>); - static_assert(!AZStd::Internal::satisfies_contiguous_iterator_concept_v); + static_assert(AZStd::is_same_v::iterator_category, AZStd::bidirectional_iterator_tag>); + static_assert(AZStd::is_same_v::value_type, int>); + static_assert(AZStd::is_same_v::difference_type, AZStd::ptrdiff_t>); + static_assert(AZStd::is_same_v::pointer, int*>); + static_assert(AZStd::is_same_v::reference, int&>); + static_assert(AZStd::input_iterator); + static_assert(!AZStd::contiguous_iterator); - static_assert(AZStd::Internal::has_iterator_category_v); - static_assert(AZStd::Internal::has_iterator_type_aliases_v); constexpr bool list_type_const_iterator_type_aliases = AZStd::Internal::has_iterator_type_aliases_v; static_assert(AZStd::is_convertible_v::iterator_category, AZStd::input_iterator_tag>); - static_assert(is_same_v::iterator_category, bidirectional_iterator_tag>); - static_assert(is_same_v::value_type, int>); - static_assert(is_same_v::difference_type, AZStd::ptrdiff_t>); - static_assert(is_same_v::pointer, const int*>); - static_assert(is_same_v::reference, const int&>); - static_assert(AZStd::Internal::is_input_iterator_v); - static_assert(!AZStd::Internal::has_iterator_concept_v>); - static_assert(!AZStd::Internal::satisfies_contiguous_iterator_concept_v); + static_assert(AZStd::is_same_v::iterator_category, AZStd::bidirectional_iterator_tag>); + static_assert(AZStd::is_same_v::value_type, int>); + static_assert(AZStd::is_same_v::difference_type, AZStd::ptrdiff_t>); + static_assert(AZStd::is_same_v::pointer, const int*>); + static_assert(AZStd::is_same_v::reference, const int&>); + static_assert(AZStd::input_iterator); + static_assert(!AZStd::contiguous_iterator); using pointer_type = const char*; - static_assert(AZStd::Internal::has_iterator_category_v>); - static_assert(AZStd::Internal::has_iterator_type_aliases_v>); - static_assert(is_same_v::iterator_concept, contiguous_iterator_tag>); - static_assert(is_same_v::iterator_category, random_access_iterator_tag>); - static_assert(is_same_v::value_type, char>); - static_assert(is_same_v::difference_type, AZStd::ptrdiff_t>); - static_assert(is_same_v::pointer, const char*>); - static_assert(is_same_v::reference, const char&>); - static_assert(AZStd::Internal::has_iterator_concept_v>); - static_assert(AZStd::Internal::satisfies_contiguous_iterator_concept_v); + static_assert(AZStd::is_same_v::iterator_concept, AZStd::contiguous_iterator_tag>); + static_assert(AZStd::is_same_v::iterator_category, AZStd::random_access_iterator_tag>); + static_assert(AZStd::is_same_v::value_type, char>); + static_assert(AZStd::is_same_v::difference_type, AZStd::ptrdiff_t>); + static_assert(AZStd::is_same_v::pointer, const char*>); + static_assert(AZStd::is_same_v::reference, const char&>); + static_assert(AZStd::contiguous_iterator); } } diff --git a/Code/Framework/AzCore/Tests/AZStd/RangesTests.cpp b/Code/Framework/AzCore/Tests/AZStd/RangesTests.cpp new file mode 100644 index 0000000000..7d0751a519 --- /dev/null +++ b/Code/Framework/AzCore/Tests/AZStd/RangesTests.cpp @@ -0,0 +1,583 @@ +/* + * 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 + * + */ + +#include +#include +#include + +namespace UnitTest +{ + class RangesTestFixture + : public ScopedAllocatorSetupFixture + {}; + + struct RangeLikeCustomizationPoint {}; + + RangeLikeCustomizationPoint* begin(RangeLikeCustomizationPoint& rangeLike) + { + return &rangeLike; + } + RangeLikeCustomizationPoint* end(RangeLikeCustomizationPoint& rangeLike) + { + return &rangeLike; + } + const RangeLikeCustomizationPoint* cbegin(const RangeLikeCustomizationPoint& rangeLike) + { + return &rangeLike; + } + const RangeLikeCustomizationPoint* cend(const RangeLikeCustomizationPoint& rangeLike) + { + return &rangeLike; + } + RangeLikeCustomizationPoint* rbegin(RangeLikeCustomizationPoint& rangeLike) + { + return &rangeLike; + } + RangeLikeCustomizationPoint* rend(RangeLikeCustomizationPoint& rangeLike) + { + return &rangeLike; + } + const RangeLikeCustomizationPoint* crbegin(const RangeLikeCustomizationPoint& rangeLike) + { + return &rangeLike; + } + const RangeLikeCustomizationPoint* crend(const RangeLikeCustomizationPoint& rangeLike) + { + return &rangeLike; + } + + constexpr size_t size(const RangeLikeCustomizationPoint&) + { + return 0; + } + constexpr size_t size(RangeLikeCustomizationPoint&) + { + return 0; + } + + + // range access + TEST_F(RangesTestFixture, RangesBegin_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + ArrayExtentType extentArray{}; + EXPECT_EQ(extentArray + 0, AZStd::ranges::begin(extentArray)); + } + + TEST_F(RangesTestFixture, RangesBegin_DoesNotCompile_WithNoExtentArray) + { + using ArrayNoExtentType = int[]; + static_assert(!AZStd::invocable); + } + + TEST_F(RangesTestFixture, RangesBegin_Compiles_WithMemberOverload) + { + AZStd::string_view strView; + EXPECT_EQ(strView.begin(), AZStd::ranges::begin(strView)); + } + + TEST_F(RangesTestFixture, RangesBegin_Compiles_WithADL) + { + RangeLikeCustomizationPoint rangeLike; + EXPECT_EQ(&rangeLike, AZStd::ranges::begin(rangeLike)); + } + + TEST_F(RangesTestFixture, RangesEnd_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + ArrayExtentType extentArray{}; + EXPECT_EQ(extentArray + 5, AZStd::ranges::end(extentArray)); + } + + TEST_F(RangesTestFixture, RangesEnd_DoesNotCompile_WithNoExtentArray) + { + using ArrayNoExtentType = int[]; + static_assert(!AZStd::invocable); + } + + TEST_F(RangesTestFixture, RangesEnd_Compiles_WithMemberOverload) + { + AZStd::string_view strView; + EXPECT_EQ(strView.end(), AZStd::ranges::end(strView)); + } + TEST_F(RangesTestFixture, RangesEnd_Compiles_WithADL) + { + RangeLikeCustomizationPoint rangeLike; + EXPECT_EQ(&rangeLike, AZStd::ranges::end(rangeLike)); + } + + TEST_F(RangesTestFixture, RangesCBegin_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + ArrayExtentType extentArray{}; + EXPECT_EQ(extentArray + 0, AZStd::ranges::cbegin(extentArray)); + } + + TEST_F(RangesTestFixture, RangesCBegin_Compiles_WithMemberOverload) + { + AZStd::string_view strView; + EXPECT_EQ(strView.cbegin(), AZStd::ranges::cbegin(strView)); + } + + TEST_F(RangesTestFixture, RangesCBegin_Compiles_WithADL) + { + RangeLikeCustomizationPoint rangeLike; + EXPECT_EQ(&rangeLike, AZStd::ranges::cbegin(rangeLike)); + } + + TEST_F(RangesTestFixture, RangesCEnd_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + ArrayExtentType extentArray{}; + EXPECT_EQ(extentArray + 5, AZStd::ranges::cend(extentArray)); + } + + TEST_F(RangesTestFixture, RangesCEnd_Compiles_WithMemberOverload) + { + AZStd::string_view strView; + EXPECT_EQ(strView.cend(), AZStd::ranges::cend(strView)); + } + + TEST_F(RangesTestFixture, RangesCEnd_Compiles_WithADL) + { + RangeLikeCustomizationPoint rangeLike; + EXPECT_EQ(&rangeLike, AZStd::ranges::cend(rangeLike)); + } + + TEST_F(RangesTestFixture, RangesRBegin_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + ArrayExtentType extentArray{}; + EXPECT_EQ(extentArray + 5, AZStd::ranges::rbegin(extentArray).base()); + } + + TEST_F(RangesTestFixture, RangesRBegin_Compiles_WithMemberOverload) + { + AZStd::string_view strView; + EXPECT_EQ(strView.rbegin(), AZStd::ranges::rbegin(strView)); + } + TEST_F(RangesTestFixture, RangesRBegin_Compiles_WithADL) + { + RangeLikeCustomizationPoint rangeLike; + EXPECT_EQ(&rangeLike, AZStd::ranges::rbegin(rangeLike)); + } + + TEST_F(RangesTestFixture, RangesREnd_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + ArrayExtentType extentArray{}; + EXPECT_EQ(extentArray, AZStd::ranges::rend(extentArray).base()); + } + + TEST_F(RangesTestFixture, RangesREnd_Compiles_WithMemberOverload) + { + AZStd::string_view strView; + EXPECT_EQ(strView.rend(), AZStd::ranges::rend(strView)); + } + TEST_F(RangesTestFixture, RangesREnd_Compiles_WithADL) + { + RangeLikeCustomizationPoint rangeLike; + EXPECT_EQ(&rangeLike, AZStd::ranges::rend(rangeLike)); + } + + TEST_F(RangesTestFixture, RangesCRBegin_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + ArrayExtentType extentArray{}; + EXPECT_EQ(extentArray + 5, AZStd::ranges::crbegin(extentArray).base()); + } + + TEST_F(RangesTestFixture, RangesCRBegin_Compiles_WithMemberOverload) + { + AZStd::string_view strView; + EXPECT_EQ(strView.crbegin(), AZStd::ranges::crbegin(strView)); + } + TEST_F(RangesTestFixture, RangesCRBegin_Compiles_WithADL) + { + RangeLikeCustomizationPoint rangeLike; + EXPECT_EQ(&rangeLike, AZStd::ranges::crbegin(rangeLike)); + } + + TEST_F(RangesTestFixture, RangesCREnd_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + ArrayExtentType extentArray{}; + EXPECT_EQ(extentArray + 0, AZStd::ranges::crend(extentArray).base()); + } + + TEST_F(RangesTestFixture, RangesCREnd_Compiles_WithMemberOverload) + { + AZStd::string_view strView; + EXPECT_EQ(strView.crend(), AZStd::ranges::crend(strView)); + } + + TEST_F(RangesTestFixture, RangesCREnd_Compiles_WithADL) + { + RangeLikeCustomizationPoint rangeLike; + EXPECT_EQ(&rangeLike, AZStd::ranges::crend(rangeLike)); + } + + // range access - size + TEST_F(RangesTestFixture, RangesSize_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + constexpr ArrayExtentType extentArray{}; + static_assert(5 == AZStd::ranges::size(extentArray)); + } + + TEST_F(RangesTestFixture, RangesSize_DoesNotCompile_WithNoExtentArray) + { + using ArrayNoExtentType = int[]; + static_assert(!AZStd::invocable); + } + + TEST_F(RangesTestFixture, RangesSize_Compiles_WithMemberOverload) + { + AZStd::string_view strView; + EXPECT_EQ(strView.size(), AZStd::ranges::size(strView)); + } + + + TEST_F(RangesTestFixture, RangesSize_Compiles_WithADL) + { + RangeLikeCustomizationPoint rangeLike; + + EXPECT_EQ(0, AZStd::ranges::size(rangeLike)); + } + + TEST_F(RangesTestFixture, RangesSSize_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + constexpr ArrayExtentType extentArray{}; + static_assert(AZStd::signed_integral); + static_assert(5 == AZStd::ranges::ssize(extentArray)); + } + + TEST_F(RangesTestFixture, RangesSSize_DoesNotCompile_WithNoExtentArray) + { + using ArrayNoExtentType = int[]; + static_assert(!AZStd::invocable); + } + + TEST_F(RangesTestFixture, RangesSSize_Compiles_WithMemberOverload) + { + AZStd::string_view strView; + static_assert(AZStd::signed_integral); + EXPECT_EQ(strView.size(), AZStd::ranges::ssize(strView)); + } + + TEST_F(RangesTestFixture, RangesSSize_Compiles_WithADL) + { + RangeLikeCustomizationPoint rangeLike; + static_assert(AZStd::signed_integral); + EXPECT_EQ(0, AZStd::ranges::ssize(rangeLike)); + } + + // range access - empty + TEST_F(RangesTestFixture, RangesEmpty_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + constexpr ArrayExtentType extentArray{}; + static_assert(!AZStd::ranges::empty(extentArray)); + } + + TEST_F(RangesTestFixture, RangesEmpty_DoesNotCompile_WithNoExtentArray) + { + using ArrayNoExtentType = int[]; + static_assert(!AZStd::invocable); + } + + TEST_F(RangesTestFixture, RangesEmpty_Compiles_WithMemberOverload) + { + constexpr AZStd::string_view strView; + static_assert(AZStd::ranges::empty(strView)); + } + + TEST_F(RangesTestFixture, RangesEmpty_Compiles_WithADL) + { + constexpr RangeLikeCustomizationPoint rangeLike; + + static_assert(AZStd::ranges::empty(rangeLike)); + } + + // range access - data + TEST_F(RangesTestFixture, RangesData_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + constexpr ArrayExtentType extentArray{}; + EXPECT_EQ(extentArray, AZStd::ranges::data(extentArray)); + } + + TEST_F(RangesTestFixture, RangesData_DoesNotCompile_WithNoExtentArray) + { + using ArrayNoExtentType = int[]; + static_assert(!AZStd::invocable); + } + + TEST_F(RangesTestFixture, RangesData_Compiles_WithMemberOverload) + { + constexpr AZStd::string_view strView; + EXPECT_EQ(strView.data(), AZStd::ranges::data(strView)); + } + + TEST_F(RangesTestFixture, RangesData_Compiles_WithADL) + { + RangeLikeCustomizationPoint rangeLike; + + EXPECT_EQ(&rangeLike, AZStd::ranges::data(rangeLike)); + } + + // range access - cdata + TEST_F(RangesTestFixture, RangesCData_Compiles_WithExtentArray) + { + using ArrayExtentType = int[5]; + + constexpr ArrayExtentType extentArray{}; + EXPECT_EQ(extentArray, AZStd::ranges::cdata(extentArray)); + } + + TEST_F(RangesTestFixture, RangesCData_DoesNotCompile_WithNoExtentArray) + { + using ArrayNoExtentType = int[]; + static_assert(!AZStd::invocable); + } + + TEST_F(RangesTestFixture, RangesCData_Compiles_WithMemberOverload) + { + constexpr AZStd::string_view strView; + EXPECT_EQ(strView.data(), AZStd::ranges::cdata(strView)); + } + + TEST_F(RangesTestFixture, RangesCData_Compiles_WithADL) + { + RangeLikeCustomizationPoint rangeLike; + + EXPECT_EQ(&rangeLike, AZStd::ranges::cdata(rangeLike)); + } + + // Ranges TypeTraits Test + TEST_F(RangesTestFixture, RangesTypeTraits_Compiles) + { + // string_view + static_assert(AZStd::same_as, const char*>); + static_assert(AZStd::same_as, const char*>); + static_assert(AZStd::same_as, ptrdiff_t>); + static_assert(AZStd::same_as, size_t>); + static_assert(AZStd::same_as, char>); + static_assert(AZStd::same_as, const char&>); + static_assert(AZStd::same_as, const char&&>); + + // string + static_assert(AZStd::same_as, char*>); + static_assert(AZStd::same_as, char*>); + static_assert(AZStd::same_as, ptrdiff_t>); + static_assert(AZStd::same_as, size_t>); + static_assert(AZStd::same_as, char>); + static_assert(AZStd::same_as, char&>); + static_assert(AZStd::same_as, char&&>); + + // int array type + using ArrayExtentType = int[5]; + static_assert(AZStd::same_as, int*>); + static_assert(AZStd::same_as, int*>); + static_assert(AZStd::same_as, ptrdiff_t>); + static_assert(AZStd::same_as, size_t>); + static_assert(AZStd::same_as, int>); + static_assert(AZStd::same_as, int&>); + static_assert(AZStd::same_as, int&&>); + + // RangeLikeCustomizationPoint type which specializes several range functions + static_assert(AZStd::same_as, RangeLikeCustomizationPoint*>); + static_assert(AZStd::same_as, RangeLikeCustomizationPoint*>); + static_assert(AZStd::same_as, ptrdiff_t>); + static_assert(AZStd::same_as, size_t>); + static_assert(AZStd::same_as, RangeLikeCustomizationPoint>); + static_assert(AZStd::same_as, RangeLikeCustomizationPoint&>); + static_assert(AZStd::same_as, RangeLikeCustomizationPoint&&>); + } + + // Ranges Concepts Test + TEST_F(RangesTestFixture, RangesConcepts_Compiles) + { + using ArrayExtentType = int[5]; + // concept - range + static_assert(AZStd::ranges::range); + static_assert(AZStd::ranges::range); + static_assert(AZStd::ranges::range); + static_assert(!AZStd::ranges::range); + + // concept - sized_range + static_assert(AZStd::ranges::sized_range); + static_assert(AZStd::ranges::sized_range); + // Path classes do not have a size() function so they are not a sized_range + static_assert(!AZStd::ranges::sized_range); + + // concept - borrowed_range + static_assert(AZStd::ranges::borrowed_range); + static_assert(AZStd::ranges::borrowed_range); + static_assert(!AZStd::ranges::borrowed_range); + + // concept - output_range + static_assert(AZStd::ranges::output_range); + static_assert(!AZStd::ranges::output_range); + + // concept - input_range + static_assert(AZStd::ranges::input_range>); + static_assert(AZStd::ranges::input_range); + static_assert(AZStd::ranges::input_range); + + // concept - forward_range + static_assert(AZStd::ranges::forward_range>); + static_assert(AZStd::ranges::forward_range); + static_assert(AZStd::ranges::forward_range); + + // concept - bidirectional_range + static_assert(AZStd::ranges::bidirectional_range>); + static_assert(AZStd::ranges::bidirectional_range); + static_assert(AZStd::ranges::bidirectional_range); + + // concept - random_access_range + static_assert(!AZStd::ranges::random_access_range>); + static_assert(AZStd::ranges::random_access_range>); + static_assert(AZStd::ranges::random_access_range); + static_assert(AZStd::ranges::random_access_range); + + // concept - contiguous_range + static_assert(!AZStd::ranges::contiguous_range>); + static_assert(AZStd::ranges::contiguous_range); + static_assert(AZStd::ranges::contiguous_range); + + // concept - common_range + static_assert(AZStd::ranges::common_range); + static_assert(AZStd::ranges::common_range>); + static_assert(AZStd::ranges::common_range>); + static_assert(AZStd::ranges::common_range); + static_assert(AZStd::ranges::common_range); + + // concept - view + static_assert(AZStd::ranges::view); + static_assert(!AZStd::ranges::view); + + // concept - viewable_range + static_assert(AZStd::ranges::viewable_range); + static_assert(AZStd::ranges::viewable_range); + static_assert(!AZStd::ranges::viewable_range); + } + + // Ranges iterator operations + TEST_F(RangesTestFixture, RangesAdvance_PositiveDifference_Succeeds) + { + AZStd::string_view testString{ "Hello World" }; + auto strIter = testString.begin(); + + // difference overload + AZStd::ranges::advance(strIter, 5); + ASSERT_NE(testString.end(), strIter); + EXPECT_EQ(' ', *strIter); + + // bound overload + AZStd::ranges::advance(strIter, testString.end()); + EXPECT_EQ(testString.end(), strIter); + + // difference + bound overload + strIter = testString.begin(); + ptrdiff_t charactersToTraverse = 20; + EXPECT_EQ(charactersToTraverse - testString.size(), AZStd::ranges::advance(strIter, charactersToTraverse, testString.end())); + EXPECT_EQ(testString.end(), strIter); + + strIter = testString.begin(); + charactersToTraverse = 5; + EXPECT_EQ(0, AZStd::ranges::advance(strIter, charactersToTraverse, testString.end())); + ASSERT_NE(testString.end(), strIter); + EXPECT_EQ(' ', *strIter); + } + + TEST_F(RangesTestFixture, RangesAdvance_NegativeDifference_Succeeds) + { + AZStd::string_view testString{ "Hello World" }; + auto strIter = testString.end(); + + // difference overload + AZStd::ranges::advance(strIter, -5); + ASSERT_NE(testString.end(), strIter); + EXPECT_EQ('W', *strIter); + + // difference + bound overload + strIter = testString.end(); + ptrdiff_t charactersToTraverse = -20; + EXPECT_EQ(charactersToTraverse + testString.size(), AZStd::ranges::advance(strIter, charactersToTraverse, testString.begin())); + EXPECT_EQ(testString.begin(), strIter); + + strIter = testString.end(); + charactersToTraverse = -5; + EXPECT_EQ(0, AZStd::ranges::advance(strIter, charactersToTraverse, testString.begin())); + ASSERT_NE(testString.end(), strIter); + ASSERT_NE(testString.begin(), strIter); + EXPECT_EQ('W', *strIter); + } + + TEST_F(RangesTestFixture, RangesDistance_Succeeds) + { + AZStd::string_view testString{ "Hello World" }; + EXPECT_EQ(testString.size(), AZStd::ranges::distance(testString)); + EXPECT_EQ(testString.size(), AZStd::ranges::distance(testString.begin(), testString.end())); + + AZStd::list testList{ 'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd' }; + EXPECT_EQ(testList.size(), AZStd::ranges::distance(testList)); + EXPECT_EQ(testList.size(), AZStd::ranges::distance(testList.begin(), testList.end())); + } + + TEST_F(RangesTestFixture, RangesNext_Succeeds) + { + AZStd::string_view testString{ "Hello World" }; + auto strIter = testString.begin(); + auto boundIter = testString.begin() + 5; + // single increment + EXPECT_EQ(testString.begin() + 1, AZStd::ranges::next(strIter)); + // increment by value + strIter = testString.begin(); + EXPECT_EQ(testString.begin() + 5, AZStd::ranges::next(strIter, 5)); + // increment until bound + strIter = testString.begin(); + EXPECT_EQ(testString.begin() + 5, AZStd::ranges::next(strIter, boundIter)); + // increment by value up until bound + strIter = testString.begin(); + EXPECT_EQ(testString.begin() + 5, AZStd::ranges::next(strIter, 10, boundIter)); + strIter = testString.begin(); + EXPECT_EQ(testString.begin() + 4, AZStd::ranges::next(strIter, 4, boundIter)); + } + + TEST_F(RangesTestFixture, RangesPrev_Succeeds) + { + AZStd::string_view testString{ "Hello World" }; + auto strIter = testString.end(); + auto boundIter = testString.end() - 5; + // single decrement + EXPECT_EQ(testString.end() - 1, AZStd::ranges::prev(strIter)); + // decrement by value + strIter = testString.end(); + EXPECT_EQ(testString.end() - 5, AZStd::ranges::prev(strIter, 5)); + // decrement by value up until bound + strIter = testString.end(); + EXPECT_EQ(testString.end() - 5, AZStd::ranges::prev(strIter, 10, boundIter)); + strIter = testString.end(); + EXPECT_EQ(testString.end() - 4, AZStd::ranges::prev(strIter, 4, boundIter)); + } +} diff --git a/Code/Framework/AzCore/Tests/AZStd/SpanTests.cpp b/Code/Framework/AzCore/Tests/AZStd/SpanTests.cpp new file mode 100644 index 0000000000..f9861ae1f2 --- /dev/null +++ b/Code/Framework/AzCore/Tests/AZStd/SpanTests.cpp @@ -0,0 +1,249 @@ +/* + * 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 + * + */ + +#include +#include + +namespace UnitTest +{ + class SpanTestFixture + : public ScopedAllocatorSetupFixture + {}; + + // range access + TEST_F(SpanTestFixture, IsConstructibleWithContiguousRangeLikeContainers) + { + constexpr AZStd::string_view testStringView{ "Foo" }; + AZStd::string testString{ "Foo" }; + AZStd::vector testVector{ 'F', 'o', 'o' }; + AZStd::fixed_vector testFixedVector{ 'F', 'o', 'o' }; + AZStd::array testStdArray{ 'F', 'o', 'o' }; + const char testCArray[]{ 'F', 'o', 'o' }; + + constexpr AZStd::span stringViewSpan(testStringView); + static_assert(stringViewSpan.data() == testStringView.data()); + + AZStd::span testStringSpan(testString); + EXPECT_EQ(testStringSpan.data(), testString.data()); + + AZStd::span testVectorSpan(testVector); + EXPECT_EQ(testVectorSpan.data(), testVector.data()); + + AZStd::span testFixedVectorSpan(testFixedVector); + EXPECT_EQ(testFixedVectorSpan.data(), testFixedVector.data()); + + AZStd::span testStdArraySpan(testStdArray); + EXPECT_EQ(testStdArraySpan.data(), testStdArray.data()); + + AZStd::span testCArraySpan(testCArray); + EXPECT_EQ(AZStd::data(testCArray), testCArraySpan.data()); + } + + TEST_F(SpanTestFixture, IsConstructibleWithContiguousIterators) + { + constexpr AZStd::string_view testStringView{ "Foo" }; + AZStd::string testString{ "Foo" }; + AZStd::vector testVector{ 'F', 'o', 'o' }; + AZStd::fixed_vector testFixedVector{ 'F', 'o', 'o' }; + AZStd::array testStdArray{ 'F', 'o', 'o' }; + const char testCArray[]{ 'F', 'o', 'o' }; + + constexpr AZStd::span stringViewSpan(testStringView.begin(), testStringView.end()); + static_assert(stringViewSpan.data() == testStringView.data()); + + AZStd::span testStringSpan(testString.begin(), testString.end()); + EXPECT_EQ(testStringSpan.data(), testString.data()); + + AZStd::span testVectorSpan(testVector.begin(), testVector.end()); + EXPECT_EQ(testVectorSpan.data(), testVector.data()); + + AZStd::span testFixedVectorSpan(testFixedVector.begin(), testFixedVector.end()); + EXPECT_EQ(testFixedVectorSpan.data(), testFixedVector.data()); + + AZStd::span testStdArraySpan(testStdArray.begin(), testStdArray.end()); + EXPECT_EQ(testStdArraySpan.data(), testStdArray.data()); + + AZStd::span testCArraySpan(AZStd::begin(testCArray), AZStd::end(testCArray)); + EXPECT_EQ(AZStd::data(testCArray), testCArraySpan.data()); + } + + TEST_F(SpanTestFixture, ObserverMethods_ReturnsCorrectValues) + { + AZStd::vector intVector{ 4, 5, 6, 1, 7 }; + + AZStd::span intSpan(intVector); + + EXPECT_FALSE(intSpan.empty()); + EXPECT_EQ(intVector.size(), intSpan.size()); + EXPECT_EQ(intSpan.size() * sizeof(int), intSpan.size_bytes()); + + intSpan = {}; + + EXPECT_TRUE(intSpan.empty()); + EXPECT_EQ(0, intSpan.size()); + EXPECT_EQ(0, intSpan.size_bytes()); + } + + TEST_F(SpanTestFixture, ElementAccessorMethods_Succeeds) + { + AZStd::vector intVector{ 4, 5, 6, 1, 7 }; + + AZStd::span intSpan(intVector); + + EXPECT_EQ(intVector.data(), intSpan.data()); + EXPECT_EQ(4, intSpan.front()); + EXPECT_EQ(7, intSpan.back()); + EXPECT_EQ(6, intSpan[2]); + + // Create subspan from elements 1 .. end - 1 + intSpan = intSpan.subspan(1, intSpan.size() - 2); + EXPECT_NE(intVector.data(), intSpan.data()); + EXPECT_EQ(5, intSpan.front()); + EXPECT_EQ(1, intSpan.back()); + EXPECT_EQ(6, intSpan[1]); + } + + TEST_F(SpanTestFixture, Supspan_Returns_Subview_Succeeds) + { + AZStd::vector intVector{ 4, 5, 6, 1, 7 }; + + AZStd::span intSpan(intVector); + + // dynamic_extent subspan with count + auto dynamicIntSubSpan = intSpan.subspan(1, 2); + ASSERT_EQ(2, dynamicIntSubSpan.size()); + EXPECT_EQ(5, dynamicIntSubSpan[0]); + EXPECT_EQ(6, dynamicIntSubSpan[1]); + + // dynamic_extent subspan without count + dynamicIntSubSpan = intSpan.subspan(1); + ASSERT_EQ(4, dynamicIntSubSpan.size()); + EXPECT_EQ(5, dynamicIntSubSpan[0]); + EXPECT_EQ(6, dynamicIntSubSpan[1]); + EXPECT_EQ(1, dynamicIntSubSpan[2]); + EXPECT_EQ(7, dynamicIntSubSpan[3]); + + // template subspan with count + auto templateIntSubSpan1 = intSpan.subspan<1, 3>(); + static_assert(decltype(templateIntSubSpan1)::extent == 3); + ASSERT_EQ(3, templateIntSubSpan1.size()); + EXPECT_EQ(5, templateIntSubSpan1[0]); + EXPECT_EQ(6, templateIntSubSpan1[1]); + EXPECT_EQ(1, templateIntSubSpan1[2]); + + // template subspan without count + auto templateIntSubSpan2 = intSpan.subspan<1>(); + static_assert(decltype(templateIntSubSpan2)::extent == AZStd::dynamic_extent); + ASSERT_EQ(4, templateIntSubSpan2.size()); + EXPECT_EQ(5, templateIntSubSpan2[0]); + EXPECT_EQ(6, templateIntSubSpan2[1]); + EXPECT_EQ(1, templateIntSubSpan2[2]); + EXPECT_EQ(7, templateIntSubSpan2[3]); + + // get subspan of fixed extent span without count + auto subSpanOfSubSpan = templateIntSubSpan1.subspan<1>(); + static_assert(decltype(subSpanOfSubSpan)::extent == 2); + ASSERT_EQ(2, subSpanOfSubSpan.size()); + EXPECT_EQ(6, subSpanOfSubSpan[0]); + EXPECT_EQ(1, subSpanOfSubSpan[1]); + } + + TEST_F(SpanTestFixture, FirstMethod_Returns_FirstCountElementsOfSpan) + { + constexpr size_t vectorElementCount = 5; + AZStd::vector intVector{ 4, 5, 6, 1, 7 }; + + AZStd::span intSpan(intVector); + + { + // No templated first function + auto prefixSpan = intSpan.first(3); + ASSERT_EQ(3, prefixSpan.size()); + EXPECT_EQ(4, prefixSpan[0]); + EXPECT_EQ(5, prefixSpan[1]); + EXPECT_EQ(6, prefixSpan[2]); + + auto prefixSpanRedux = prefixSpan.first(1); + ASSERT_EQ(1, prefixSpanRedux.size()); + EXPECT_EQ(4, prefixSpanRedux[0]); + + // Test failure of preconditions by requesting more + // elements thant stored in the span + AZ_TEST_START_TRACE_SUPPRESSION; + intSpan.first(intSpan.size() + 1); + AZ_TEST_STOP_TRACE_SUPPRESSION(1); + } + + { + // templated first function + auto prefixSpan = intSpan.first<3>(); + static_assert(decltype(prefixSpan)::extent == 3); + ASSERT_EQ(3, prefixSpan.size()); + EXPECT_EQ(4, prefixSpan[0]); + EXPECT_EQ(5, prefixSpan[1]); + EXPECT_EQ(6, prefixSpan[2]); + + auto prefixSpanRedux = prefixSpan.first<1>(); + ASSERT_EQ(1, prefixSpanRedux.size()); + EXPECT_EQ(4, prefixSpanRedux[0]); + + // Test failure of preconditions by requesting more + // elements thant stored in the span + AZ_TEST_START_TRACE_SUPPRESSION; + intSpan.first(); + AZ_TEST_STOP_TRACE_SUPPRESSION(1); + } + } + + TEST_F(SpanTestFixture, LastCountElementsOfSpan) + { + constexpr size_t vectorElementCount = 5; + AZStd::vector intVector{ 4, 5, 6, 1, 7 }; + + AZStd::span intSpan(intVector); + + { + // No templated last function + auto suffixSpan = intSpan.last(3); + ASSERT_EQ(3, suffixSpan.size()); + EXPECT_EQ(6, suffixSpan[0]); + EXPECT_EQ(1, suffixSpan[1]); + EXPECT_EQ(7, suffixSpan[2]); + + auto suffixSpanRedux = suffixSpan.last(1); + ASSERT_EQ(1, suffixSpanRedux.size()); + EXPECT_EQ(7, suffixSpanRedux[0]); + + // Test failure of preconditions by requesting more + // elements thant stored in the span + AZ_TEST_START_TRACE_SUPPRESSION; + intSpan.last(intSpan.size() + 1); + AZ_TEST_STOP_TRACE_SUPPRESSION(1); + } + + { + // templated last function + auto suffixSpan = intSpan.last<3>(); + static_assert(decltype(suffixSpan)::extent == 3); + ASSERT_EQ(3, suffixSpan.size()); + EXPECT_EQ(6, suffixSpan[0]); + EXPECT_EQ(1, suffixSpan[1]); + EXPECT_EQ(7, suffixSpan[2]); + + auto suffixSpanRedux = suffixSpan.last<1>(); + ASSERT_EQ(1, suffixSpanRedux.size()); + EXPECT_EQ(7, suffixSpanRedux[0]); + + // Test failure of preconditions by requesting more + // elements thant stored in the span + AZ_TEST_START_TRACE_SUPPRESSION; + intSpan.last(); + AZ_TEST_STOP_TRACE_SUPPRESSION(1); + } + } +} diff --git a/Code/Framework/AzCore/Tests/AZStd/TypeTraits.cpp b/Code/Framework/AzCore/Tests/AZStd/TypeTraits.cpp index aeba048d69..d0f34d14a0 100644 --- a/Code/Framework/AzCore/Tests/AZStd/TypeTraits.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/TypeTraits.cpp @@ -45,197 +45,197 @@ namespace UnitTest // Primary type categories: // alignment_of and align_to - AZ_TEST_STATIC_ASSERT(alignment_of::value == 4); - AZ_TEST_STATIC_ASSERT(alignment_of::value == 1); + static_assert(alignment_of::value == 4); + static_assert(alignment_of::value == 1); - AZ_TEST_STATIC_ASSERT(alignment_of::value == 16); - aligned_storage::type alignedArray; + static_assert(alignment_of::value == 16); + aligned_storage::type alignedArray; AZ_TEST_ASSERT((((AZStd::size_t)&alignedArray) & 15) == 0); - AZ_TEST_STATIC_ASSERT((alignment_of< aligned_storage::type >::value) == 8); - AZ_TEST_STATIC_ASSERT(sizeof(aligned_storage::type) == 16); + static_assert((alignment_of< aligned_storage::type >::value) == 8); + static_assert(sizeof(aligned_storage::type) == 16); // is_void - AZ_TEST_STATIC_ASSERT(is_void::value == false); - AZ_TEST_STATIC_ASSERT(is_void::value == true); - AZ_TEST_STATIC_ASSERT(is_void::value == true); - AZ_TEST_STATIC_ASSERT(is_void::value == true); - AZ_TEST_STATIC_ASSERT(is_void::value == true); + static_assert(is_void::value == false); + static_assert(is_void::value == true); + static_assert(is_void::value == true); + static_assert(is_void::value == true); + static_assert(is_void::value == true); // is_integral - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - //AZ_TEST_STATIC_ASSERT(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + //static_assert(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); + static_assert(is_integral::value == true); - AZ_TEST_STATIC_ASSERT(is_integral::value == false); - AZ_TEST_STATIC_ASSERT(is_integral::value == false); - AZ_TEST_STATIC_ASSERT(is_integral::value == false); + static_assert(is_integral::value == false); + static_assert(is_integral::value == false); + static_assert(is_integral::value == false); // is_floating_point - AZ_TEST_STATIC_ASSERT(is_floating_point::value == false); - AZ_TEST_STATIC_ASSERT(is_floating_point::value == true); - AZ_TEST_STATIC_ASSERT(is_floating_point::value == true); - AZ_TEST_STATIC_ASSERT(is_floating_point::value == true); - AZ_TEST_STATIC_ASSERT(is_floating_point::value == true); + static_assert(is_floating_point::value == false); + static_assert(is_floating_point::value == true); + static_assert(is_floating_point::value == true); + static_assert(is_floating_point::value == true); + static_assert(is_floating_point::value == true); // is_array - AZ_TEST_STATIC_ASSERT(is_array::value == false); - AZ_TEST_STATIC_ASSERT(is_array::value == true); - AZ_TEST_STATIC_ASSERT(is_array::value == true); - AZ_TEST_STATIC_ASSERT(is_array::value == true); - AZ_TEST_STATIC_ASSERT(is_array::value == true); + static_assert(is_array::value == false); + static_assert(is_array::value == true); + static_assert(is_array::value == true); + static_assert(is_array::value == true); + static_assert(is_array::value == true); - AZ_TEST_STATIC_ASSERT(is_array::value == true); - AZ_TEST_STATIC_ASSERT(is_array::value == true); - AZ_TEST_STATIC_ASSERT(is_array::value == true); - AZ_TEST_STATIC_ASSERT(is_array::value == true); + static_assert(is_array::value == true); + static_assert(is_array::value == true); + static_assert(is_array::value == true); + static_assert(is_array::value == true); // is_pointer - AZ_TEST_STATIC_ASSERT(is_pointer::value == false); - AZ_TEST_STATIC_ASSERT(is_pointer::value == true); - AZ_TEST_STATIC_ASSERT(is_pointer::value == true); - AZ_TEST_STATIC_ASSERT(is_pointer::value == true); - AZ_TEST_STATIC_ASSERT(is_pointer::value == true); + static_assert(is_pointer::value == false); + static_assert(is_pointer::value == true); + static_assert(is_pointer::value == true); + static_assert(is_pointer::value == true); + static_assert(is_pointer::value == true); // is_reference - AZ_TEST_STATIC_ASSERT(is_reference::value == false); - AZ_TEST_STATIC_ASSERT(is_reference::value == true); - AZ_TEST_STATIC_ASSERT(is_reference::value == true); - AZ_TEST_STATIC_ASSERT(is_reference::value == true); - AZ_TEST_STATIC_ASSERT(is_reference::value == true); + static_assert(is_reference::value == false); + static_assert(is_reference::value == true); + static_assert(is_reference::value == true); + static_assert(is_reference::value == true); + static_assert(is_reference::value == true); // is_member_object_pointer - AZ_TEST_STATIC_ASSERT(is_member_object_pointer::value == false); - AZ_TEST_STATIC_ASSERT(is_member_object_pointer::value == false); - AZ_TEST_STATIC_ASSERT(is_member_object_pointer::value == true); + static_assert(is_member_object_pointer::value == false); + static_assert(is_member_object_pointer::value == false); + static_assert(is_member_object_pointer::value == true); // is_member_function_pointer - AZ_TEST_STATIC_ASSERT(is_member_function_pointer::value == false); - AZ_TEST_STATIC_ASSERT(is_member_function_pointer::value == true); - AZ_TEST_STATIC_ASSERT(is_member_function_pointer::value == false); - AZ_TEST_STATIC_ASSERT((is_member_function_pointer::value)); - AZ_TEST_STATIC_ASSERT((is_member_function_pointer::value)); - AZ_TEST_STATIC_ASSERT((is_member_function_pointer::value)); - AZ_TEST_STATIC_ASSERT((is_member_function_pointer::value)); - AZ_TEST_STATIC_ASSERT((is_member_function_pointer::value)); - AZ_TEST_STATIC_ASSERT((is_member_function_pointer::value)); - AZ_TEST_STATIC_ASSERT((is_member_function_pointer::value)); - AZ_TEST_STATIC_ASSERT((is_member_function_pointer::value)); - AZ_TEST_STATIC_ASSERT((is_member_function_pointer::value)); + static_assert(is_member_function_pointer::value == false); + static_assert(is_member_function_pointer::value == true); + static_assert(is_member_function_pointer::value == false); + static_assert((is_member_function_pointer::value)); + static_assert((is_member_function_pointer::value)); + static_assert((is_member_function_pointer::value)); + static_assert((is_member_function_pointer::value)); + static_assert((is_member_function_pointer::value)); + static_assert((is_member_function_pointer::value)); + static_assert((is_member_function_pointer::value)); + static_assert((is_member_function_pointer::value)); + static_assert((is_member_function_pointer::value)); // is_enum - AZ_TEST_STATIC_ASSERT(is_enum::value == false); - AZ_TEST_STATIC_ASSERT(is_enum::value == false); - AZ_TEST_STATIC_ASSERT(is_enum::value == true); + static_assert(is_enum::value == false); + static_assert(is_enum::value == false); + static_assert(is_enum::value == true); // is_union - AZ_TEST_STATIC_ASSERT(is_union::value == false); - AZ_TEST_STATIC_ASSERT(is_union::value == false); - AZ_TEST_STATIC_ASSERT(is_union::value == true); + static_assert(is_union::value == false); + static_assert(is_union::value == false); + static_assert(is_union::value == true); // is_class - AZ_TEST_STATIC_ASSERT(is_class::value == false); - AZ_TEST_STATIC_ASSERT(is_class::value == true); - AZ_TEST_STATIC_ASSERT(is_class::value == true); + static_assert(is_class::value == false); + static_assert(is_class::value == true); + static_assert(is_class::value == true); // is_function - AZ_TEST_STATIC_ASSERT(is_function::value == false); - AZ_TEST_STATIC_ASSERT(is_function::value == false); - AZ_TEST_STATIC_ASSERT(is_function::value == true); + static_assert(is_function::value == false); + static_assert(is_function::value == false); + static_assert(is_function::value == true); ////////////////////////////////////////////////////////////////////////// // composite type categories: // is_arithmetic - AZ_TEST_STATIC_ASSERT(is_arithmetic::value == false); - AZ_TEST_STATIC_ASSERT(is_arithmetic::value == true); - AZ_TEST_STATIC_ASSERT(is_arithmetic::value == true); + static_assert(is_arithmetic::value == false); + static_assert(is_arithmetic::value == true); + static_assert(is_arithmetic::value == true); // is_fundamental - AZ_TEST_STATIC_ASSERT(is_fundamental::value == false); - AZ_TEST_STATIC_ASSERT(is_fundamental::value == true); - AZ_TEST_STATIC_ASSERT(is_fundamental::value == true); - AZ_TEST_STATIC_ASSERT(is_fundamental::value == true); + static_assert(is_fundamental::value == false); + static_assert(is_fundamental::value == true); + static_assert(is_fundamental::value == true); + static_assert(is_fundamental::value == true); // is_object - AZ_TEST_STATIC_ASSERT(is_object::value == true); - AZ_TEST_STATIC_ASSERT(is_object::value == false); - AZ_TEST_STATIC_ASSERT(is_object::value == false); - AZ_TEST_STATIC_ASSERT(is_object::value == false); + static_assert(is_object::value == true); + static_assert(is_object::value == false); + static_assert(is_object::value == false); + static_assert(is_object::value == false); // is_scalar - AZ_TEST_STATIC_ASSERT(is_scalar::value == false); - AZ_TEST_STATIC_ASSERT(is_scalar::value == true); - AZ_TEST_STATIC_ASSERT(is_scalar::value == true); - AZ_TEST_STATIC_ASSERT(is_scalar::value == true); + static_assert(is_scalar::value == false); + static_assert(is_scalar::value == true); + static_assert(is_scalar::value == true); + static_assert(is_scalar::value == true); // is_compound - AZ_TEST_STATIC_ASSERT(is_compound::value == false); - AZ_TEST_STATIC_ASSERT(is_compound::value == true); - AZ_TEST_STATIC_ASSERT(is_compound::value == true); - AZ_TEST_STATIC_ASSERT(is_compound::value == true); - AZ_TEST_STATIC_ASSERT(is_compound::value == true); - AZ_TEST_STATIC_ASSERT(is_compound::value == true); + static_assert(is_compound::value == false); + static_assert(is_compound::value == true); + static_assert(is_compound::value == true); + static_assert(is_compound::value == true); + static_assert(is_compound::value == true); + static_assert(is_compound::value == true); // is_member_pointer - AZ_TEST_STATIC_ASSERT(is_member_pointer::value == false); - AZ_TEST_STATIC_ASSERT(is_member_pointer::value == true); - AZ_TEST_STATIC_ASSERT(is_member_pointer::value == true); + static_assert(is_member_pointer::value == false); + static_assert(is_member_pointer::value == true); + static_assert(is_member_pointer::value == true); ////////////////////////////////////////////////////////////////////////// // type properties: // is_const - AZ_TEST_STATIC_ASSERT(is_const::value == false); - AZ_TEST_STATIC_ASSERT(is_const::value == false); - AZ_TEST_STATIC_ASSERT(is_const::value == true); - AZ_TEST_STATIC_ASSERT(is_const::value == true); + static_assert(is_const::value == false); + static_assert(is_const::value == false); + static_assert(is_const::value == true); + static_assert(is_const::value == true); // is_volatile - AZ_TEST_STATIC_ASSERT(is_volatile::value == false); - AZ_TEST_STATIC_ASSERT(is_volatile::value == false); - AZ_TEST_STATIC_ASSERT(is_volatile::value == true); - AZ_TEST_STATIC_ASSERT(is_volatile::value == true); + static_assert(is_volatile::value == false); + static_assert(is_volatile::value == false); + static_assert(is_volatile::value == true); + static_assert(is_volatile::value == true); // is_pod - AZ_TEST_STATIC_ASSERT(is_pod::value == true); - AZ_TEST_STATIC_ASSERT(is_pod::value == true); - AZ_TEST_STATIC_ASSERT(is_pod::value == false); - AZ_TEST_STATIC_ASSERT((is_pod< aligned_storage<30, 32>::type >::value) == true); + static_assert(is_pod::value == true); + static_assert(is_pod::value == true); + static_assert(is_pod::value == false); + static_assert((is_pod< aligned_storage<30, 32>::type >::value) == true); // is_empty - AZ_TEST_STATIC_ASSERT(is_empty::value == false); - AZ_TEST_STATIC_ASSERT(is_empty::value == true); - AZ_TEST_STATIC_ASSERT(is_empty::value == false); + static_assert(is_empty::value == false); + static_assert(is_empty::value == true); + static_assert(is_empty::value == false); // is_polymorphic - AZ_TEST_STATIC_ASSERT(is_polymorphic::value == false); - AZ_TEST_STATIC_ASSERT(is_polymorphic::value == true); + static_assert(is_polymorphic::value == false); + static_assert(is_polymorphic::value == true); // is_abstract - AZ_TEST_STATIC_ASSERT(is_abstract::value == false); - AZ_TEST_STATIC_ASSERT(is_abstract::value == true); + static_assert(is_abstract::value == false); + static_assert(is_abstract::value == true); // has_trivial_constructor static_assert(is_trivially_constructible_v); @@ -264,20 +264,20 @@ namespace UnitTest // has_nothrow_assign // is_signed - AZ_TEST_STATIC_ASSERT(is_signed::value == true); - AZ_TEST_STATIC_ASSERT(is_signed::value == false); - AZ_TEST_STATIC_ASSERT(is_signed::value == false); + static_assert(is_signed::value == true); + static_assert(is_signed::value == false); + static_assert(is_signed::value == false); static_assert(is_signed::value); // is_unsigned - AZ_TEST_STATIC_ASSERT(is_unsigned::value == false); - AZ_TEST_STATIC_ASSERT(is_unsigned::value == false); - AZ_TEST_STATIC_ASSERT(is_unsigned::value == true); - AZ_TEST_STATIC_ASSERT(is_unsigned::value == false); + static_assert(is_unsigned::value == false); + static_assert(is_unsigned::value == false); + static_assert(is_unsigned::value == true); + static_assert(is_unsigned::value == false); // true and false types - AZ_TEST_STATIC_ASSERT(true_type::value == true); - AZ_TEST_STATIC_ASSERT(false_type::value == false); + static_assert(true_type::value == true); + static_assert(false_type::value == false); //! function traits tests struct NotMyStruct @@ -290,7 +290,7 @@ namespace UnitTest { bool operator()(FunctionTestStruct&) const { return true; }; }; - + using PrimitiveFunctionPtr = int(*)(bool, float, double, AZ::u8, AZ::s8, AZ::u16, AZ::s16, AZ::u32, AZ::s32, AZ::u64, AZ::s64); using NotMyStructMemberPtr = int(NotMyStruct::*)(); using ComplexFunctionPtr = float(*)(MyEmptyStruct&, NotMyStructMemberPtr, MyUnion*); @@ -298,27 +298,27 @@ namespace UnitTest using MemberFunctionPtr = void(MyInterface::*)(int); using ConstMemberFunctionPtr = bool(FunctionTestStruct::*)(FunctionTestStruct&) const; - AZ_TEST_STATIC_ASSERT((AZStd::is_same::result_type, int>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::is_same::get_arg_t<10>, AZ::s64>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::is_same, AZ::u16>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::function_traits::arity == 11)); - - AZ_TEST_STATIC_ASSERT((AZStd::is_same, float>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::is_same, int(NotMyStruct::*)()>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::function_traits::arity == 3)); + static_assert((AZStd::is_same::result_type, int>::value)); + static_assert((AZStd::is_same::get_arg_t<10>, AZ::s64>::value)); + static_assert((AZStd::is_same, AZ::u16>::value)); + static_assert((AZStd::function_traits::arity == 11)); - AZ_TEST_STATIC_ASSERT((AZStd::is_same::class_fp_type, void(MyInterface::*)(int)>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::is_same::raw_fp_type, void(*)(int)>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::is_same::class_type, MyInterface>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::function_traits::arity == 1)); + static_assert((AZStd::is_same, float>::value)); + static_assert((AZStd::is_same, int(NotMyStruct::*)()>::value)); + static_assert((AZStd::function_traits::arity == 3)); - AZ_TEST_STATIC_ASSERT((AZStd::is_same::class_fp_type, bool(FunctionTestStruct::*)(FunctionTestStruct&) const> ::value)); - AZ_TEST_STATIC_ASSERT((AZStd::is_same::raw_fp_type, bool(*)(FunctionTestStruct&)> ::value)); - AZ_TEST_STATIC_ASSERT((AZStd::is_same::class_type, FunctionTestStruct>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::is_same, FunctionTestStruct&>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::function_traits::arity == 1)); - - AZ_TEST_STATIC_ASSERT((AZStd::is_same::class_fp_type, bool(FunctionTestStruct::*)(FunctionTestStruct&) const>::value)); + static_assert((AZStd::is_same::class_fp_type, void(MyInterface::*)(int)>::value)); + static_assert((AZStd::is_same::raw_fp_type, void(*)(int)>::value)); + static_assert((AZStd::is_same::class_type, MyInterface>::value)); + static_assert((AZStd::function_traits::arity == 1)); + + static_assert((AZStd::is_same::class_fp_type, bool(FunctionTestStruct::*)(FunctionTestStruct&) const> ::value)); + static_assert((AZStd::is_same::raw_fp_type, bool(*)(FunctionTestStruct&)> ::value)); + static_assert((AZStd::is_same::class_type, FunctionTestStruct>::value)); + static_assert((AZStd::is_same, FunctionTestStruct&>::value)); + static_assert((AZStd::function_traits::arity == 1)); + + static_assert((AZStd::is_same::class_fp_type, bool(FunctionTestStruct::*)(FunctionTestStruct&) const>::value)); auto lambdaFunction = [](FunctionTestStruct, int) -> bool { @@ -326,16 +326,16 @@ namespace UnitTest }; using LambdaType = decltype(lambdaFunction); - AZ_TEST_STATIC_ASSERT((AZStd::is_same::raw_fp_type, bool(*)(FunctionTestStruct, int)>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::is_same::class_fp_type, bool(LambdaType::*)(FunctionTestStruct, int) const>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::function_traits::arity == 2)); + static_assert((AZStd::is_same::raw_fp_type, bool(*)(FunctionTestStruct, int)>::value)); + static_assert((AZStd::is_same::class_fp_type, bool(LambdaType::*)(FunctionTestStruct, int) const>::value)); + static_assert((AZStd::function_traits::arity == 2)); static_assert(AZStd::is_same::return_type, bool>::value, "Lambda result type should be bool"); AZStd::function stdFunction; using StdFunctionType = decay_t; - AZ_TEST_STATIC_ASSERT((AZStd::is_same::raw_fp_type, void(*)(LambdaType*, ComplexFunction&)>::value)); - AZ_TEST_STATIC_ASSERT((AZStd::function_traits::arity == 2)); - } + static_assert((AZStd::is_same::raw_fp_type, void(*)(LambdaType*, ComplexFunction&)>::value)); + static_assert((AZStd::function_traits::arity == 2)); + } struct ConstMethodTestStruct { @@ -343,145 +343,264 @@ namespace UnitTest void NonConstMethod() { } }; - AZ_TEST_STATIC_ASSERT((static_cast(function_traits::qual_flags) & static_cast(Internal::qualifier_flags::const_)) != 0); - AZ_TEST_STATIC_ASSERT((static_cast(function_traits::qual_flags) & static_cast(Internal::qualifier_flags::const_)) == 0); -} + static_assert((static_cast(function_traits::qual_flags)& static_cast(Internal::qualifier_flags::const_)) != 0); + static_assert((static_cast(function_traits::qual_flags)& static_cast(Internal::qualifier_flags::const_)) == 0); -TEST(TypeTraits, StdRemoveConstCompiles) -{ - static_assert(AZStd::is_same_v>, "C++11 std::remove_const_t has failed"); - static_assert(AZStd::is_same_v>, "C++11 std::remove_const_t has failed"); - static_assert(AZStd::is_same_v>, "C++11 std::remove_const_t has failed"); - static_assert(AZStd::is_same_v>, "C++11 std::remove_const_t has failed"); - static_assert(AZStd::is_same_v>, "C++11 std::remove_const_t has failed"); - static_assert(AZStd::is_same_v>>, "C++11 std::remove_const_t has failed"); -} - -TEST(TypeTraits, StdRemoveVolatileCompiles) -{ - static_assert(AZStd::is_same_v>, "C++11 std::remove_volatile_t has failed"); - static_assert(AZStd::is_same_v>, "C++11 std::remove_volatile_t has failed"); - static_assert(AZStd::is_same_v>, "C++11 std::remove_volatile_t has failed"); - static_assert(AZStd::is_same_v>, "C++11 std::remove_volatile_t has failed"); - static_assert(AZStd::is_same_v>, "C++11 std::remove_volatile_t has failed"); - static_assert(AZStd::is_same_v>, "C++11 std::remove_volatile_t has failed"); - static_assert(AZStd::is_same_v>>, "C++11 std::remove_volatile_t has failed"); -} - -TEST(TypeTraits, StdIsConstCompiles) -{ - static_assert(!AZStd::is_const_v, "C++11 std::is_const has failed"); - static_assert(AZStd::is_const_v, "C++11 std::is_const has failed"); - // references are never const - static_assert(!AZStd::is_const_v, "C++11 std::is_const has failed"); - // pointer checks for constness - static_assert(!AZStd::is_const_v, "C++11 std::is_const has failed"); - static_assert(AZStd::is_const_v, "C++11 std::is_const has failed"); - static_assert(AZStd::is_const_v, "C++11 std::is_const has failed"); -} - -TEST(TypeTraits, StdIsVolatileCompiles) -{ - static_assert(!AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); - static_assert(AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); - // references are never volatile - static_assert(!AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); - // pointer checks for volatile - static_assert(!AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); - static_assert(AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); - static_assert(!AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); - static_assert(AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); -} - -TEST(TypeTraits, TemplateIsCopyConstructible_WithCopyConstructibleValueType_ReturnsTrue) -{ - static_assert(AZStd::Internal::template_is_copy_constructible>::value, ""); - static_assert(AZStd::Internal::template_is_copy_constructible>::value, ""); - static_assert(AZStd::Internal::template_is_copy_constructible>::value, ""); - static_assert(AZStd::Internal::template_is_copy_constructible>::value, ""); - static_assert(AZStd::Internal::template_is_copy_constructible>::value, ""); - static_assert(AZStd::Internal::template_is_copy_constructible>::value, ""); - static_assert(AZStd::Internal::template_is_copy_constructible>::value, ""); - static_assert(AZStd::Internal::template_is_copy_constructible>::value, ""); - static_assert(AZStd::Internal::template_is_copy_constructible>::value, ""); - static_assert(AZStd::Internal::template_is_copy_constructible>::value, ""); - static_assert(AZStd::Internal::template_is_copy_constructible>::value, ""); - static_assert(AZStd::Internal::template_is_copy_constructible>::value, ""); - - struct CopyableType + TEST(TypeTraits, StdRemoveConstCompiles) { - CopyableType() = default; - CopyableType(const CopyableType&) = default; - }; - static_assert(AZStd::Internal::template_is_copy_constructible::value, ""); -} + static_assert(AZStd::is_same_v>, "C++11 std::remove_const_t has failed"); + static_assert(AZStd::is_same_v>, "C++11 std::remove_const_t has failed"); + static_assert(AZStd::is_same_v>, "C++11 std::remove_const_t has failed"); + static_assert(AZStd::is_same_v>, "C++11 std::remove_const_t has failed"); + static_assert(AZStd::is_same_v>, "C++11 std::remove_const_t has failed"); + static_assert(AZStd::is_same_v>>, "C++11 std::remove_const_t has failed"); + } -TEST(TypeTraits, TemplateIsCopyConstructible_WithOutCopyConstructibleValueType_ReturnsFalse) -{ - static_assert(!AZStd::Internal::template_is_copy_constructible>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible, int>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible, int>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible, int>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible, int>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible, int>>::value, ""); - static_assert(!AZStd::Internal::template_is_copy_constructible>>::value, ""); - - struct MoveOnly + TEST(TypeTraits, StdRemoveVolatileCompiles) { - MoveOnly() = default; - MoveOnly(const MoveOnly&) = delete; - MoveOnly(MoveOnly&&) = default; - }; - static_assert(!AZStd::Internal::template_is_copy_constructible::value, ""); -} + static_assert(AZStd::is_same_v>, "C++11 std::remove_volatile_t has failed"); + static_assert(AZStd::is_same_v>, "C++11 std::remove_volatile_t has failed"); + static_assert(AZStd::is_same_v>, "C++11 std::remove_volatile_t has failed"); + static_assert(AZStd::is_same_v>, "C++11 std::remove_volatile_t has failed"); + static_assert(AZStd::is_same_v>, "C++11 std::remove_volatile_t has failed"); + static_assert(AZStd::is_same_v>, "C++11 std::remove_volatile_t has failed"); + static_assert(AZStd::is_same_v>>, "C++11 std::remove_volatile_t has failed"); + } -TEST(TypeTraits, MakeSignedCompiles) -{ - static_assert(AZStd::is_same_v::type, AZ::s8>); - static_assert(AZStd::is_same_v, AZ::s8>); - static_assert(AZStd::is_same_v, AZ::s16>); - static_assert(AZStd::is_same_v, AZ::s16>); - static_assert(AZStd::is_same_v, AZ::s32>); - static_assert(AZStd::is_same_v, AZ::s32>); - static_assert(AZStd::is_same_v, AZ::s64>); - static_assert(AZStd::is_same_v, AZ::s64>); -} - -TEST(TypeTraits, MakeUnsignedCompiles) -{ - static_assert(AZStd::is_same_v::type, AZ::u8>); - static_assert(AZStd::is_same_v, AZ::u8>); - static_assert(AZStd::is_same_v, AZ::u16>); - static_assert(AZStd::is_same_v, AZ::u16>); - static_assert(AZStd::is_same_v, AZ::u32>); - static_assert(AZStd::is_same_v, AZ::u32>); - static_assert(AZStd::is_same_v, AZ::u64>); - static_assert(AZStd::is_same_v, AZ::u64>); -} - -// VS2017 workaround, calling decltype directly on the fully specialized aznumeric_cast template -// function fails with error C3556: 'aznumeric_cast': incorrect argument to 'decltype' -// So invoke the attempt to invoke function in a non-evaluated context and SFINAE to prevent a compile -// error -template -constexpr bool NumericCastInvocable = false; -template -constexpr bool NumericCastInvocable(AZStd::declval()))>> = true; -TEST(TypeTraits, NumericCastConversionOperatorCompiles) -{ - struct AzNumericCastConvertibleCompileTest + TEST(TypeTraits, StdIsConstCompiles) { - constexpr operator int() { return {}; }; - }; - static_assert(NumericCastInvocable, "aznumeric_cast conversion operator overload is should be compilable"); + static_assert(!AZStd::is_const_v, "C++11 std::is_const has failed"); + static_assert(AZStd::is_const_v, "C++11 std::is_const has failed"); + // references are never const + static_assert(!AZStd::is_const_v, "C++11 std::is_const has failed"); + // pointer checks for constness + static_assert(!AZStd::is_const_v, "C++11 std::is_const has failed"); + static_assert(AZStd::is_const_v, "C++11 std::is_const has failed"); + static_assert(AZStd::is_const_v, "C++11 std::is_const has failed"); + } + + TEST(TypeTraits, StdIsVolatileCompiles) + { + static_assert(!AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); + static_assert(AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); + // references are never volatile + static_assert(!AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); + // pointer checks for volatile + static_assert(!AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); + static_assert(AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); + static_assert(!AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); + static_assert(AZStd::is_volatile_v, "C++11 std::is_volatile has failed"); + } + + + struct CommonReferenceSpecializationTest + {}; +} + +namespace AZStd +{ + template