Merge branch 'main' into Prefab/CreatePrefab
This commit is contained in:
@@ -12,4 +12,5 @@
|
||||
set(GEM_DEPENDENCIES
|
||||
Gem::Atom_RHI_Vulkan.Private
|
||||
Gem::Atom_RHI_DX12.Private
|
||||
Gem::Atom_RHI_Null.Private
|
||||
)
|
||||
@@ -15,5 +15,7 @@ set(GEM_DEPENDENCIES
|
||||
Gem::Atom_RHI_Vulkan.Builders
|
||||
Gem::Atom_RHI_DX12.Private
|
||||
Gem::Atom_RHI_DX12.Builders
|
||||
Gem::Atom_RHI_Null.Private
|
||||
Gem::Atom_RHI_Null.Builders
|
||||
Gem::Atom_RHI_Metal.Builders
|
||||
)
|
||||
@@ -138,6 +138,7 @@ endif()
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::BlastTests
|
||||
TEST_SUITE sandbox
|
||||
TEST_SERIAL TRUE
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/Blast/TestSuite_Active.py
|
||||
TIMEOUT 3600
|
||||
|
||||
@@ -23,15 +23,11 @@ endif()
|
||||
|
||||
include(cmake/Version.cmake)
|
||||
|
||||
set(INSTALLED_ENGINE TRUE)
|
||||
|
||||
if(NOT PROJECT_NAME)
|
||||
project(O3DE
|
||||
LANGUAGES C CXX
|
||||
VERSION ${LY_VERSION_STRING}
|
||||
)
|
||||
|
||||
set(INSTALLED_ENGINE FALSE)
|
||||
endif()
|
||||
|
||||
include(cmake/Initialize.cmake)
|
||||
|
||||
@@ -274,6 +274,10 @@ void PerInstanceConstantBufferPool::SetConstantBuffer(SRendItem* renderItem)
|
||||
deviceManager.BindConstantBuffer(eHWSC_Vertex, m_PooledIndirectConstantBuffer[indirectId], eConstantBufferShaderSlot_SPIIndex);
|
||||
deviceManager.BindConstantBuffer(eHWSC_Pixel, m_PooledIndirectConstantBuffer[indirectId], eConstantBufferShaderSlot_SPIIndex);
|
||||
#else
|
||||
AZ::u32 itemIndex = directId % SPI_NUM_INSTS_PER_CB;
|
||||
AZ::u32 first[1] = {itemIndex * static_cast<AZ::u32>(sizeof(HLSL_PerInstanceConstantBuffer))};
|
||||
AZ::u32 count[1] = {static_cast<AZ::u32>(sizeof(HLSL_PerInstanceConstantBuffer))};
|
||||
|
||||
deviceManager.BindConstantBuffer(eHWSC_Vertex, m_PooledConstantBuffer[bufferIndex], eConstantBufferShaderSlot_SPI, first[0], count[0]);
|
||||
deviceManager.BindConstantBuffer(eHWSC_Pixel, m_PooledConstantBuffer[bufferIndex], eConstantBufferShaderSlot_SPI, first[0], count[0]);
|
||||
#endif
|
||||
|
||||
@@ -755,6 +755,7 @@ lSysUpdate:
|
||||
buffer_handle_t nVB = ~0u;
|
||||
# if BUFFER_ENABLE_DIRECT_ACCESS && !defined(NULL_RENDERER)
|
||||
nVB = MS->m_nID;
|
||||
int nFrame = gRenDev->m_RP.m_TI[gRenDev->m_RP.m_nFillThreadID].m_nFrameUpdateID;
|
||||
if ((nVB != ~0u && (MS->m_nFrameCreate != nFrame || MS->m_nElements != m_nVerts)) || !CRenderer::CV_r_buffer_enable_lockless_updates)
|
||||
# endif
|
||||
goto lSysCreate;
|
||||
|
||||
@@ -167,14 +167,14 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
AZ_MATH_INLINE Vector2::Vector2(const Vector3& source)
|
||||
Vector2::Vector2(const Vector3& source)
|
||||
: m_x(source.GetX())
|
||||
, m_y(source.GetY())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
AZ_MATH_INLINE Vector2::Vector2(const Vector4& source)
|
||||
Vector2::Vector2(const Vector4& source)
|
||||
: m_x(source.GetX())
|
||||
, m_y(source.GetY())
|
||||
{
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ByteStreamSerializer.h"
|
||||
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <AzCore/Serialization/Json/JsonSerialization.h>
|
||||
#include <AzCore/StringFunc/StringFunc.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace ByteSerializerInternal
|
||||
{
|
||||
static JsonSerializationResult::Result Load(void* outputValue, const rapidjson::Value& inputValue, JsonDeserializerContext& context)
|
||||
{
|
||||
using JsonSerializationResult::Outcomes;
|
||||
using JsonSerializationResult::Tasks;
|
||||
|
||||
AZ_Assert(outputValue, "Expected a valid pointer to load from json value.");
|
||||
|
||||
switch (inputValue.GetType())
|
||||
{
|
||||
case rapidjson::kStringType: {
|
||||
JsonByteStream buffer;
|
||||
if (AZ::StringFunc::Base64::Decode(buffer, inputValue.GetString(), inputValue.GetStringLength()))
|
||||
{
|
||||
JsonByteStream* valAsByteStream = static_cast<JsonByteStream*>(outputValue);
|
||||
*valAsByteStream = AZStd::move(buffer);
|
||||
return context.Report(Tasks::ReadField, Outcomes::Success, "Successfully read ByteStream.");
|
||||
}
|
||||
return context.Report(Tasks::ReadField, Outcomes::Invalid, "Decode of Base64 encoded ByteStream failed.");
|
||||
}
|
||||
case rapidjson::kArrayType:
|
||||
case rapidjson::kObjectType:
|
||||
case rapidjson::kNullType:
|
||||
case rapidjson::kFalseType:
|
||||
case rapidjson::kTrueType:
|
||||
case rapidjson::kNumberType:
|
||||
return context.Report(
|
||||
Tasks::ReadField, Outcomes::Unsupported,
|
||||
"Unsupported type. ByteStream values cannot be read from arrays, objects, nulls, booleans or numbers.");
|
||||
default:
|
||||
return context.Report(Tasks::ReadField, Outcomes::Unknown, "Unknown json type encountered for ByteStream value.");
|
||||
}
|
||||
}
|
||||
|
||||
static JsonSerializationResult::Result StoreWithDefault(
|
||||
rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, JsonSerializerContext& context)
|
||||
{
|
||||
using JsonSerializationResult::Outcomes;
|
||||
using JsonSerializationResult::Tasks;
|
||||
|
||||
const JsonByteStream& valAsByteStream = *static_cast<const JsonByteStream*>(inputValue);
|
||||
if (context.ShouldKeepDefaults() || !defaultValue || (valAsByteStream != *static_cast<const JsonByteStream*>(defaultValue)))
|
||||
{
|
||||
const auto base64ByteStream = AZ::StringFunc::Base64::Encode(valAsByteStream.data(), valAsByteStream.size());
|
||||
outputValue.SetString(base64ByteStream.c_str(), base64ByteStream.size(), context.GetJsonAllocator());
|
||||
return context.Report(Tasks::WriteValue, Outcomes::Success, "ByteStream successfully stored.");
|
||||
}
|
||||
|
||||
return context.Report(Tasks::WriteValue, Outcomes::DefaultsUsed, "Default ByteStream used.");
|
||||
}
|
||||
} // namespace ByteSerializerInternal
|
||||
|
||||
AZ_CLASS_ALLOCATOR_IMPL(JsonByteStreamSerializer, SystemAllocator, 0);
|
||||
|
||||
JsonSerializationResult::Result JsonByteStreamSerializer::Load(
|
||||
void* outputValue, [[maybe_unused]] const Uuid& outputValueTypeId, const rapidjson::Value& inputValue,
|
||||
JsonDeserializerContext& context)
|
||||
{
|
||||
AZ_Assert(
|
||||
azrtti_typeid<JsonByteStream>() == outputValueTypeId,
|
||||
"Unable to deserialize AZStd::vector<AZ::u8>> to json because the provided type is %s",
|
||||
outputValueTypeId.ToString<AZStd::string>().c_str());
|
||||
|
||||
return ByteSerializerInternal::Load(outputValue, inputValue, context);
|
||||
}
|
||||
|
||||
JsonSerializationResult::Result JsonByteStreamSerializer::Store(
|
||||
rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, [[maybe_unused]] const Uuid& valueTypeId,
|
||||
JsonSerializerContext& context)
|
||||
{
|
||||
AZ_Assert(
|
||||
azrtti_typeid<JsonByteStream>() == valueTypeId,
|
||||
"Unable to serialize AZStd::vector<AZ::u8> to json because the provided type is %s",
|
||||
valueTypeId.ToString<AZStd::string>().c_str());
|
||||
|
||||
return ByteSerializerInternal::StoreWithDefault(outputValue, inputValue, defaultValue, context);
|
||||
}
|
||||
} // namespace AZ
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Serialization/Json/BaseJsonSerializer.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
using JsonByteStream = AZStd::vector<AZ::u8>; //!< Alias for AZStd::vector<AZ::u8>.
|
||||
|
||||
//! Serialize a stream of bytes (usually binary data) as a json string value.
|
||||
//! @note Related to GenericClassByteStream (part of SerializeGenericTypeInfo<AZStd::vector<AZ::u8>> - see AZStdContainers.inl for more
|
||||
//! details).
|
||||
class JsonByteStreamSerializer : public BaseJsonSerializer
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(JsonByteStreamSerializer, "{30F0EA5A-CD13-4BA7-BAE1-D50D851CAC45}", BaseJsonSerializer);
|
||||
AZ_CLASS_ALLOCATOR_DECL;
|
||||
|
||||
JsonSerializationResult::Result Load(
|
||||
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,
|
||||
JsonSerializerContext& context) override;
|
||||
};
|
||||
} // namespace AZ
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <AzCore/Serialization/Json/ArraySerializer.h>
|
||||
#include <AzCore/Serialization/Json/BasicContainerSerializer.h>
|
||||
#include <AzCore/Serialization/Json/BoolSerializer.h>
|
||||
#include <AzCore/Serialization/Json/ByteStreamSerializer.h>
|
||||
#include <AzCore/Serialization/Json/DoubleSerializer.h>
|
||||
#include <AzCore/Serialization/Json/IntSerializer.h>
|
||||
#include <AzCore/Serialization/Json/JsonSystemComponent.h>
|
||||
@@ -68,6 +69,8 @@ namespace AZ
|
||||
jsonContext->Serializer<JsonStringSerializer>()->HandlesType<AZStd::string>();
|
||||
jsonContext->Serializer<JsonOSStringSerializer>()->HandlesType<OSString>();
|
||||
|
||||
jsonContext->Serializer<JsonByteStreamSerializer>()->HandlesType<JsonByteStream>();
|
||||
|
||||
jsonContext->Serializer<JsonBasicContainerSerializer>()
|
||||
->HandlesType<AZStd::fixed_vector>()
|
||||
->HandlesType<AZStd::forward_list>()
|
||||
|
||||
@@ -505,6 +505,8 @@ set(FILES
|
||||
Serialization/Json/BasicContainerSerializer.cpp
|
||||
Serialization/Json/BoolSerializer.h
|
||||
Serialization/Json/BoolSerializer.cpp
|
||||
Serialization/Json/ByteStreamSerializer.h
|
||||
Serialization/Json/ByteStreamSerializer.cpp
|
||||
Serialization/Json/CastingHelpers.h
|
||||
Serialization/Json/DoubleSerializer.h
|
||||
Serialization/Json/DoubleSerializer.cpp
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/Serialization/Json/ByteStreamSerializer.h>
|
||||
#include <Tests/Serialization/Json/BaseJsonSerializerFixture.h>
|
||||
#include <Tests/Serialization/Json/JsonSerializerConformityTests.h>
|
||||
|
||||
namespace JsonSerializationTests
|
||||
{
|
||||
class ByteStreamSerializerTestDescription : public JsonSerializerConformityTestDescriptor<AZ::JsonByteStream>
|
||||
{
|
||||
public:
|
||||
AZStd::shared_ptr<AZ::BaseJsonSerializer> CreateSerializer() override
|
||||
{
|
||||
return AZStd::make_shared<AZ::JsonByteStreamSerializer>();
|
||||
}
|
||||
|
||||
AZStd::shared_ptr<AZ::JsonByteStream> CreateDefaultInstance() override
|
||||
{
|
||||
return AZStd::make_shared<AZ::JsonByteStream>();
|
||||
}
|
||||
|
||||
AZStd::shared_ptr<AZ::JsonByteStream> CreateFullySetInstance() override
|
||||
{
|
||||
// create a JsonByteStream (AZStd::vector<u8>) with ten 'a's
|
||||
return AZStd::make_shared<AZ::JsonByteStream>(10, 'a');
|
||||
}
|
||||
|
||||
AZStd::string_view GetJsonForFullySetInstance() override
|
||||
{
|
||||
// Base64 encoded version of 'aaaaaaaaaa' (see CreateFullySetInstance)
|
||||
return R"("YWFhYWFhYWFhYQ==")";
|
||||
}
|
||||
|
||||
void ConfigureFeatures(JsonSerializerConformityTestDescriptorFeatures& features) override
|
||||
{
|
||||
features.EnableJsonType(rapidjson::kStringType);
|
||||
features.m_supportsPartialInitialization = false;
|
||||
features.m_supportsInjection = false;
|
||||
}
|
||||
|
||||
bool AreEqual(const AZ::JsonByteStream& lhs, const AZ::JsonByteStream& rhs) override
|
||||
{
|
||||
return lhs == rhs;
|
||||
}
|
||||
};
|
||||
|
||||
using ByteStreamConformityTestTypes = ::testing::Types<ByteStreamSerializerTestDescription>;
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(JsonByteStreamSerialzier, JsonSerializerConformityTests, ByteStreamConformityTestTypes);
|
||||
} // namespace JsonSerializationTests
|
||||
@@ -98,6 +98,7 @@ set(FILES
|
||||
Serialization/Json/BaseJsonSerializerTests.cpp
|
||||
Serialization/Json/BasicContainerSerializerTests.cpp
|
||||
Serialization/Json/BoolSerializerTests.cpp
|
||||
Serialization/Json/ByteStreamSerializerTests.cpp
|
||||
Serialization/Json/ColorSerializerTests.cpp
|
||||
Serialization/Json/DoubleSerializerTests.cpp
|
||||
Serialization/Json/IntSerializerTests.cpp
|
||||
|
||||
@@ -105,8 +105,6 @@ namespace AzFramework
|
||||
virtual bool SetDrawInFrontMode(bool bOn) { (void)bOn; return false; }
|
||||
virtual AZ::u32 GetState() { return 0; }
|
||||
virtual AZ::u32 SetState(AZ::u32 state) { (void)state; return 0; }
|
||||
virtual AZ::u32 SetStateFlag(AZ::u32 state) { (void)state; return 0; }
|
||||
virtual AZ::u32 ClearStateFlag(AZ::u32 state) { (void)state; return 0; }
|
||||
virtual void PushMatrix(const AZ::Transform& tm) { (void)tm; }
|
||||
virtual void PopMatrix() {}
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzCore/Math/Vector2.h>
|
||||
#include <AzCore/Math/Color.h>
|
||||
#include <AzCore/std/string/string_view.h>
|
||||
#include <AzFramework/Viewport/ViewportId.h>
|
||||
|
||||
namespace AzFramework
|
||||
{
|
||||
using FontId = uint32_t;
|
||||
static constexpr FontId InvalidFontId = 0xffffffffu;
|
||||
|
||||
enum class TextHorizontalAlignment : uint16_t
|
||||
{
|
||||
Left,
|
||||
Right,
|
||||
Center
|
||||
};
|
||||
|
||||
enum class TextVerticalAlignment : uint16_t
|
||||
{
|
||||
Top,
|
||||
Bottom,
|
||||
Center,
|
||||
};
|
||||
|
||||
//! Standard parameters for drawing text on screen
|
||||
struct TextDrawParameters
|
||||
{
|
||||
ViewportId m_drawViewportId = InvalidViewportId; //! Viewport to draw into
|
||||
AZ::Vector3 m_position; //! world space position for 3d draws, screen space x,y,depth for 2d.
|
||||
AZ::Color m_color = AZ::Colors::White; //! Color to draw the text
|
||||
AZ::Vector2 m_scale = AZ::Vector2(1.0f); //! font scale
|
||||
TextHorizontalAlignment m_hAlign = TextHorizontalAlignment::Left; //! Horizontal text alignment
|
||||
TextVerticalAlignment m_vAlign = TextVerticalAlignment::Top; //! Vertical text alignment
|
||||
bool m_monospace = false; //! disable character proportional spacing
|
||||
bool m_depthTest = false; //! Test character against the depth buffer
|
||||
bool m_virtual800x600ScreenSize = true; //! Text placement and size are scaled relative to a virtual 800x600 resolution
|
||||
bool m_scaleWithWindow = false; //! Font gets bigger as the window gets bigger
|
||||
bool m_multiline = true; //! text respects ascii newline characters
|
||||
};
|
||||
|
||||
class FontDrawInterface
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(FontDrawInterface, "{545A7C14-CB3E-4A5B-B435-13EA606708EE}");
|
||||
|
||||
FontDrawInterface() = default;
|
||||
virtual ~FontDrawInterface() = default;
|
||||
|
||||
virtual void DrawScreenAlignedText2d(
|
||||
const TextDrawParameters& params,
|
||||
const AZStd::string_view& string) = 0;
|
||||
virtual void DrawScreenAlignedText3d(
|
||||
const TextDrawParameters& params,
|
||||
const AZStd::string_view& string) = 0;
|
||||
};
|
||||
|
||||
class FontQueryInterface
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(FontQueryInterface, "{4BDD8520-EBC1-4680-B25E-421BDF31750F}");
|
||||
|
||||
FontQueryInterface() = default;
|
||||
virtual ~FontQueryInterface() = default;
|
||||
|
||||
FontId GetFontId(const AZStd::string_view& fontName) const {return FontId(AZ::Crc32(fontName));}
|
||||
virtual FontDrawInterface* GetFontDrawInterface(FontId) const = 0;
|
||||
virtual FontDrawInterface* GetDefaultFontDrawInterface() const = 0;
|
||||
|
||||
};
|
||||
} // namespace AzFramework
|
||||
@@ -142,6 +142,7 @@ namespace Physics
|
||||
->Field("PhysicsAsset", &PhysicsAssetShapeConfiguration::m_asset)
|
||||
->Field("AssetScale", &PhysicsAssetShapeConfiguration::m_assetScale)
|
||||
->Field("UseMaterialsFromAsset", &PhysicsAssetShapeConfiguration::m_useMaterialsFromAsset)
|
||||
->Field("SubdivisionLevel", &PhysicsAssetShapeConfiguration::m_subdivisionLevel)
|
||||
;
|
||||
|
||||
if (auto editContext = serializeContext->GetEditContext())
|
||||
|
||||
@@ -141,6 +141,7 @@ namespace Physics
|
||||
AZ::Data::Asset<AZ::Data::AssetData> m_asset{ AZ::Data::AssetLoadBehavior::PreLoad };
|
||||
AZ::Vector3 m_assetScale = AZ::Vector3::CreateOne();
|
||||
bool m_useMaterialsFromAsset = true;
|
||||
AZ::u8 m_subdivisionLevel = 4; ///< The level of subdivision if a primitive shape is replaced with a convex mesh due to scaling.
|
||||
};
|
||||
|
||||
class NativeShapeConfiguration : public ShapeConfiguration
|
||||
|
||||
@@ -142,13 +142,6 @@ namespace Physics
|
||||
|
||||
virtual AZStd::shared_ptr<Shape> CreateShape(const ColliderConfiguration& colliderConfiguration, const ShapeConfiguration& configuration) = 0;
|
||||
|
||||
/// Adds an appropriate collider component to the entity based on the provided shape configuration.
|
||||
/// @param entity Entity where the component should be added to.
|
||||
/// @param colliderConfiguration Configuration of the collider.
|
||||
/// @param shapeConfiguration Configuration of the shape of the collider.
|
||||
/// @param addEditorComponents Tells whether to add the Editor version of the collider component or the Game one.
|
||||
virtual void AddColliderComponentToEntity(AZ::Entity* entity, const Physics::ColliderConfiguration& colliderConfiguration, const Physics::ShapeConfiguration& shapeConfiguration, bool addEditorComponents = false) = 0;
|
||||
|
||||
/// Releases the mesh object created by the physics backend.
|
||||
/// @param nativeMeshObject Pointer to the mesh object.
|
||||
virtual void ReleaseNativeMeshObject(void* nativeMeshObject) = 0;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include <AzCore/base.h>
|
||||
#include <AzCore/Math/Vector2.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <AzCore/RTTI/TypeInfo.h>
|
||||
|
||||
namespace AZ
|
||||
@@ -133,6 +134,18 @@ namespace AzFramework
|
||||
return !operator==(lhs, rhs);
|
||||
}
|
||||
|
||||
inline ScreenPoint ScreenPointFromNDC(const AZ::Vector3& screenNDC, const AZ::Vector2& viewportSize)
|
||||
{
|
||||
return ScreenPoint(
|
||||
aznumeric_caster(std::round(screenNDC.GetX() * viewportSize.GetX())),
|
||||
aznumeric_caster(std::round((1.0f - screenNDC.GetY()) * viewportSize.GetY())));
|
||||
}
|
||||
|
||||
inline AZ::Vector2 NDCFromScreenPoint(const ScreenPoint& screenPoint, const AZ::Vector2& viewportSize)
|
||||
{
|
||||
return AZ::Vector2(aznumeric_cast<float>(screenPoint.m_x), viewportSize.GetY() - aznumeric_cast<float>(screenPoint.m_y)) / viewportSize;
|
||||
}
|
||||
|
||||
//! Return an AZ::Vector2 from a ScreenPoint.
|
||||
inline AZ::Vector2 Vector2FromScreenPoint(const ScreenPoint& screenPoint)
|
||||
{
|
||||
|
||||
@@ -101,20 +101,25 @@ namespace AzFramework
|
||||
cameraState.m_nearClip, cameraState.m_farClip);
|
||||
}
|
||||
|
||||
ScreenPoint WorldToScreen(
|
||||
const AZ::Vector3& worldPosition, const AZ::Matrix4x4& cameraView, const AZ::Matrix4x4& cameraProjection,
|
||||
const AZ::Vector2& viewportSize)
|
||||
AZ::Vector3 WorldToScreenNDC(
|
||||
const AZ::Vector3& worldPosition, const AZ::Matrix4x4& cameraView, const AZ::Matrix4x4& cameraProjection)
|
||||
{
|
||||
// transform the world space position to clip space
|
||||
const auto clipSpacePosition = cameraProjection * cameraView * AZ::Vector3ToVector4(worldPosition, 1.0f);
|
||||
// transform the clip space position to ndc space (perspective divide)
|
||||
const auto ndcPosition = clipSpacePosition / clipSpacePosition.GetW();
|
||||
// transform ndc space from <-1,1> to <0, 1> range
|
||||
const auto ndcNormalizedPosition = (AZ::Vector4ToVector2(ndcPosition) + AZ::Vector2::CreateOne()) * 0.5f;
|
||||
return (AZ::Vector4ToVector3(ndcPosition) + AZ::Vector3::CreateOne()) * 0.5f;
|
||||
}
|
||||
|
||||
|
||||
ScreenPoint WorldToScreen(
|
||||
const AZ::Vector3& worldPosition, const AZ::Matrix4x4& cameraView, const AZ::Matrix4x4& cameraProjection,
|
||||
const AZ::Vector2& viewportSize)
|
||||
{
|
||||
const auto ndcNormalizedPosition = WorldToScreenNDC(worldPosition, cameraView, cameraProjection);
|
||||
// scale ndc position by screen dimensions to return screen position
|
||||
return ScreenPoint(
|
||||
aznumeric_caster(std::round(ndcNormalizedPosition.GetX() * viewportSize.GetX())),
|
||||
aznumeric_caster(std::round(viewportSize.GetY() - (ndcNormalizedPosition.GetY() * viewportSize.GetY()))));
|
||||
return ScreenPointFromNDC(ndcNormalizedPosition, viewportSize);
|
||||
}
|
||||
|
||||
ScreenPoint WorldToScreen(const AZ::Vector3& worldPosition, const CameraState& cameraState)
|
||||
@@ -127,12 +132,8 @@ namespace AzFramework
|
||||
const ScreenPoint& screenPosition, const AZ::Matrix4x4& inverseCameraView,
|
||||
const AZ::Matrix4x4& inverseCameraProjection, const AZ::Vector2& viewportSize)
|
||||
{
|
||||
const auto screenHeight = viewportSize.GetY();
|
||||
const auto flippedScreenPosition =
|
||||
AZ::Vector2(aznumeric_caster(screenPosition.m_x), aznumeric_caster(screenHeight - screenPosition.m_y));
|
||||
|
||||
// convert screen space coordinates to <-1,1> range
|
||||
const auto ndcPosition = (flippedScreenPosition / viewportSize) * 2.0f - AZ::Vector2::CreateOne();
|
||||
// convert screen space coordinates from <0, 1> to <-1,1> range
|
||||
const auto ndcPosition = NDCFromScreenPoint(screenPosition, viewportSize) * 2.0f - AZ::Vector2::CreateOne();
|
||||
|
||||
// transform ndc space position to clip space
|
||||
const auto clipSpacePosition = inverseCameraProjection * Vector2ToVector4(ndcPosition, -1.0f, 1.0f);
|
||||
|
||||
@@ -28,6 +28,11 @@ namespace AzFramework
|
||||
struct ScreenPoint;
|
||||
struct ViewportInfo;
|
||||
|
||||
//! Projects a position in world space to screen space normalized device coordinates for the given camera.
|
||||
AZ::Vector3 WorldToScreenNDC(
|
||||
const AZ::Vector3& worldPosition, const AZ::Matrix4x4& cameraView, const AZ::Matrix4x4& cameraProjection);
|
||||
|
||||
|
||||
//! Projects a position in world space to screen space for the given camera.
|
||||
ScreenPoint WorldToScreen(const AZ::Vector3& worldPosition, const CameraState& cameraState);
|
||||
|
||||
|
||||
@@ -145,6 +145,7 @@ set(FILES
|
||||
Components/NonUniformScaleComponent.cpp
|
||||
FileFunc/FileFunc.h
|
||||
FileFunc/FileFunc.cpp
|
||||
Font/FontInterface.h
|
||||
Gem/GemInfo.cpp
|
||||
Gem/GemInfo.h
|
||||
StringFunc/StringFunc.h
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace AzNetworking
|
||||
|
||||
ContainerType m_container;
|
||||
|
||||
template <AZStd::size_t, typename ElementType>
|
||||
template <AZStd::size_t, typename>
|
||||
friend class FixedSizeVectorBitset;
|
||||
};
|
||||
}
|
||||
|
||||
+24
-21
@@ -53,7 +53,7 @@ namespace AzToolsFramework
|
||||
float, cl_viewportGizmoAxisLabelOffset, 1.15f, nullptr, AZ::ConsoleFunctorFlags::Null,
|
||||
"The offset of the label for the viewport axis gizmo");
|
||||
AZ_CVAR(
|
||||
float, cl_viewportGizmoAxisLabelSize, 2.0f, nullptr, AZ::ConsoleFunctorFlags::Null,
|
||||
float, cl_viewportGizmoAxisLabelSize, 1.0f, nullptr, AZ::ConsoleFunctorFlags::Null,
|
||||
"The size of each label for the viewport axis gizmo");
|
||||
AZ_CVAR(
|
||||
AZ::Vector2, cl_viewportGizmoAxisScreenPosition, AZ::Vector2(0.045f, 0.9f), nullptr,
|
||||
@@ -3434,19 +3434,22 @@ namespace AzToolsFramework
|
||||
const auto cameraProjection = AzFramework::CameraProjection(gizmoCameraState);
|
||||
|
||||
// screen space offset to move the 2d gizmo around
|
||||
const AZ::Vector3 screenPosition =
|
||||
(AZ::Vector2ToVector3(cl_viewportGizmoAxisScreenPosition) - AZ::Vector3(0.5f, 0.5f, 0.0f)) *
|
||||
AZ::Vector2ToVector3(gizmoCameraState.m_viewportSize);
|
||||
const AZ::Vector2 screenOffset = AZ::Vector2(cl_viewportGizmoAxisScreenPosition) - AZ::Vector2(0.5f, 0.5f);
|
||||
|
||||
// map from a position in world space (relative to the the gizmo camera near the origin) to a position in
|
||||
// screen space
|
||||
const auto calculateGizmoAxis =
|
||||
[&cameraView, &cameraProjection, &gizmoCameraState, &screenPosition]
|
||||
(const AZ::Vector3& position)
|
||||
[&cameraView, &cameraProjection, &screenOffset]
|
||||
(const AZ::Vector3& axis)
|
||||
{
|
||||
return AZ::Vector2ToVector3(AzFramework::Vector2FromScreenPoint(
|
||||
AzFramework::WorldToScreen(
|
||||
position, cameraView, cameraProjection, gizmoCameraState.m_viewportSize))) + screenPosition;
|
||||
auto result = AZ::Vector2(
|
||||
AzFramework::WorldToScreenNDC(
|
||||
axis,
|
||||
cameraView,
|
||||
cameraProjection)
|
||||
);
|
||||
result.SetY(1.0f - result.GetY());
|
||||
return result + screenOffset;
|
||||
};
|
||||
|
||||
// get all important axis positions in screen space
|
||||
@@ -3456,31 +3459,31 @@ namespace AzToolsFramework
|
||||
const auto gizmoEndAxisY = calculateGizmoAxis(-AZ::Vector3::CreateAxisY() * lineLength);
|
||||
const auto gizmoEndAxisZ = calculateGizmoAxis(-AZ::Vector3::CreateAxisZ() * lineLength);
|
||||
|
||||
const AZ::Vector3 gizmoAxisX = gizmoEndAxisX - gizmoStart;
|
||||
const AZ::Vector3 gizmoAxisY = gizmoEndAxisY - gizmoStart;
|
||||
const AZ::Vector3 gizmoAxisZ = gizmoEndAxisZ - gizmoStart;
|
||||
const AZ::Vector2 gizmoAxisX = gizmoEndAxisX - gizmoStart;
|
||||
const AZ::Vector2 gizmoAxisY = gizmoEndAxisY - gizmoStart;
|
||||
const AZ::Vector2 gizmoAxisZ = gizmoEndAxisZ - gizmoStart;
|
||||
|
||||
// draw the axes of the gizmo
|
||||
debugDisplay.SetLineWidth(cl_viewportGizmoAxisLineWidth);
|
||||
debugDisplay.SetColor(AZ::Colors::Red);
|
||||
debugDisplay.DrawLine(gizmoStart, gizmoEndAxisX);
|
||||
debugDisplay.DrawLine2d(gizmoStart, gizmoEndAxisX, 1.0f);
|
||||
debugDisplay.SetColor(AZ::Colors::Lime);
|
||||
debugDisplay.DrawLine(gizmoStart, gizmoEndAxisY);
|
||||
debugDisplay.DrawLine2d(gizmoStart, gizmoEndAxisY, 1.0f);
|
||||
debugDisplay.SetColor(AZ::Colors::Blue);
|
||||
debugDisplay.DrawLine(gizmoStart, gizmoEndAxisZ);
|
||||
debugDisplay.DrawLine2d(gizmoStart, gizmoEndAxisZ, 1.0f);
|
||||
debugDisplay.SetLineWidth(1.0f);
|
||||
|
||||
const float labelOffset = cl_viewportGizmoAxisLabelOffset;
|
||||
const auto labelOffsetX = gizmoStart + gizmoAxisX * labelOffset;
|
||||
const auto labelOffsetY = gizmoStart + gizmoAxisY * labelOffset;
|
||||
const auto labelOffsetZ = gizmoStart + gizmoAxisZ * labelOffset;
|
||||
const auto labelXScreenPosition = (gizmoStart + (gizmoAxisX * labelOffset)) * editorCameraState.m_viewportSize;
|
||||
const auto labelYScreenPosition = (gizmoStart + (gizmoAxisY * labelOffset)) * editorCameraState.m_viewportSize;
|
||||
const auto labelZScreenPosition = (gizmoStart + (gizmoAxisZ * labelOffset)) * editorCameraState.m_viewportSize;
|
||||
|
||||
// draw the label of of each axis for the gizmo
|
||||
const float labelSize = cl_viewportGizmoAxisLabelSize;
|
||||
debugDisplay.SetColor(AZ::Colors::White);
|
||||
debugDisplay.Draw2dTextLabel(labelOffsetX.GetX(), labelOffsetX.GetY(), labelSize, "X", true);
|
||||
debugDisplay.Draw2dTextLabel(labelOffsetY.GetX(), labelOffsetY.GetY(), labelSize, "Y", true);
|
||||
debugDisplay.Draw2dTextLabel(labelOffsetZ.GetX(), labelOffsetZ.GetY(), labelSize, "Z", true);
|
||||
debugDisplay.Draw2dTextLabel(labelXScreenPosition.GetX(), labelXScreenPosition.GetY(), labelSize, "X", true);
|
||||
debugDisplay.Draw2dTextLabel(labelYScreenPosition.GetX(), labelYScreenPosition.GetY(), labelSize, "Y", true);
|
||||
debugDisplay.Draw2dTextLabel(labelZScreenPosition.GetX(), labelZScreenPosition.GetY(), labelSize, "Z", true);
|
||||
}
|
||||
|
||||
void EditorTransformComponentSelection::DisplayViewportSelection2d(
|
||||
|
||||
@@ -56,7 +56,7 @@ CAboutDialog::CAboutDialog(QString versionText, QString richTextCopyrightNotice,
|
||||
m_backgroundImage = QPixmap::fromImage(backgroundImage.scaled(m_enforcedWidth, m_enforcedHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||
|
||||
// Draw the Open 3D Engine logo from svg
|
||||
m_ui->m_logo->load(QStringLiteral(":/StartupLogoDialog/lumberyard_logo.svg"));
|
||||
m_ui->m_logo->load(QStringLiteral(":/StartupLogoDialog/o3de_logo.svg"));
|
||||
|
||||
// Prevent re-sizing
|
||||
setFixedSize(m_enforcedWidth, m_enforcedHeight);
|
||||
|
||||
@@ -60,35 +60,35 @@
|
||||
<property name="bottomMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_42">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QSvgWidget" name="m_logo" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_42">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QSvgWidget" name="m_logo" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>161</width>
|
||||
<height>49</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>161</width>
|
||||
<height>49</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_transparentVersion">
|
||||
<property name="text">
|
||||
@@ -251,6 +251,11 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QSvgWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qsvgwidget.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ClickableLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
|
||||
@@ -1245,28 +1245,6 @@ uint32 DisplayContext::SetState(uint32 state)
|
||||
return old;
|
||||
}
|
||||
|
||||
//! Set a new render state flags.
|
||||
//! @param returns previous render state.
|
||||
uint32 DisplayContext::SetStateFlag(uint32 state)
|
||||
{
|
||||
uint32 old = m_renderState;
|
||||
m_renderState |= state;
|
||||
m_renderState = pRenderAuxGeom->GetRenderFlags().m_renderFlags;
|
||||
pRenderAuxGeom->SetRenderFlags(m_renderState);
|
||||
return old;
|
||||
}
|
||||
|
||||
//! Clear specified flags in render state.
|
||||
//! @param returns previous render state.
|
||||
uint32 DisplayContext::ClearStateFlag(uint32 state)
|
||||
{
|
||||
uint32 old = m_renderState;
|
||||
m_renderState &= ~state;
|
||||
m_renderState = pRenderAuxGeom->GetRenderFlags().m_renderFlags;
|
||||
pRenderAuxGeom->SetRenderFlags(m_renderState);
|
||||
return old;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void DisplayContext::DepthTestOff()
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ CStartupLogoDialog::CStartupLogoDialog(QString versionText, QString richTextCopy
|
||||
m_backgroundImage = QPixmap::fromImage(backgroundImage.scaled(m_enforcedWidth, m_enforcedHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||
|
||||
// Draw the Open 3D Engine logo from svg
|
||||
m_ui->m_logo->load(QStringLiteral(":/StartupLogoDialog/lumberyard_logo.svg"));
|
||||
m_ui->m_logo->load(QStringLiteral(":/StartupLogoDialog/o3de_logo.svg"));
|
||||
|
||||
m_ui->m_TransparentConfidential->setObjectName("copyrightNotice");
|
||||
m_ui->m_TransparentConfidential->setTextFormat(Qt::RichText);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/StartupLogoDialog">
|
||||
<file>lumberyard_logo.svg</file>
|
||||
<file>o3de_logo.svg</file>
|
||||
<file>splashscreen_1_27.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -42,14 +42,14 @@
|
||||
<widget class="QSvgWidget" name="m_logo" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>60</height>
|
||||
<width>161</width>
|
||||
<height>49</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>60</height>
|
||||
<width>161</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 27 KiB |
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="323px" height="98px" viewBox="0 0 323 98" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Group 12</title>
|
||||
<defs>
|
||||
<polygon id="path-1" points="0 97.741 322.084 97.741 322.084 0 0 0"></polygon>
|
||||
</defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Group-12" transform="translate(0.000000, 0.000000)">
|
||||
<path d="M99.7068,20.425 C91.1008,11.686 79.6658,6.841 67.5068,6.782 L67.2838,6.781 C62.9678,6.781 58.7408,7.396 54.6908,8.566 L54.6908,25.339 C58.5158,23.54 62.6988,22.563 67.0218,22.517 C67.1388,22.516 67.2538,22.515 67.3698,22.515 C75.1318,22.515 82.4608,25.519 88.0388,30.996 C93.7828,36.635 96.9708,44.124 97.0168,52.084 C97.0628,60.037 93.9658,67.554 88.2968,73.251 C82.6908,78.884 75.2578,82 67.3558,82.025 L67.2718,82.025 C59.4228,82.025 51.9878,78.959 46.3368,73.393 C40.6918,67.833 37.5578,60.397 37.5108,52.453 C37.4888,48.659 38.1798,44.975 39.5088,41.546 L23.0748,41.546 C19.4908,56.362 23.4348,72.648 34.9328,84.219 C43.5408,92.882 54.9608,97.683 67.0878,97.738 L67.3028,97.738 L67.3058,97.738 C79.3458,97.738 90.7008,93.045 99.2768,84.524 C107.8718,75.984 112.6488,64.62 112.7288,52.524 C112.8088,40.435 108.1838,29.035 99.7068,20.425" id="Fill-1" fill="#FFFFFF"></path>
|
||||
<path d="M175.6326,27.8629 C175.6326,33.3889 173.9586,38.0879 170.6116,41.9599 C167.2646,45.8319 162.5656,48.4939 156.5146,49.9459 L156.5146,50.3089 C163.6536,51.1969 169.0586,53.3629 172.7296,56.8129 C176.3996,60.2619 178.2356,64.9099 178.2356,70.7579 C178.2356,79.2689 175.1496,85.8939 168.9786,90.6319 C162.8076,95.3719 153.9936,97.7409 142.5386,97.7409 C132.9386,97.7409 124.4286,96.1489 117.0076,92.9609 L117.0076,77.0489 C120.4356,78.7839 124.2076,80.1959 128.3216,81.2839 C132.4356,82.3729 136.5096,82.9179 140.5426,82.9179 C146.7146,82.9179 151.2716,81.8699 154.2156,79.7719 C157.1596,77.6749 158.6326,74.3079 158.6326,69.6679 C158.6326,65.5139 156.9386,62.5699 153.5506,60.8349 C150.1626,59.1009 144.7576,58.2329 137.3366,58.2329 L130.6206,58.2329 L130.6206,43.8939 L137.4576,43.8939 C144.3146,43.8939 149.3246,42.9979 152.4916,41.2019 C155.6576,39.4079 157.2406,36.3319 157.2406,31.9759 C157.2406,25.2809 153.0456,21.9329 144.6566,21.9329 C141.7526,21.9329 138.7986,22.4169 135.7936,23.3849 C132.7886,24.3529 129.4506,26.0279 125.7806,28.4069 L117.1306,15.5199 C125.1956,9.7119 134.8166,6.8079 145.9886,6.8079 C155.1446,6.8079 162.3736,8.6639 167.6786,12.3739 C172.9806,16.0869 175.6326,21.2499 175.6326,27.8629" id="Fill-3" fill="#FFFFFF"></path>
|
||||
<path d="M241.8563,51.9425 C241.8563,32.9455 233.4653,23.4465 216.6883,23.4465 L206.7053,23.4465 L206.7053,81.0435 L214.7523,81.0435 C232.8213,81.0435 241.8563,71.3435 241.8563,51.9425 M261.3363,51.4595 C261.3363,66.0195 257.1933,77.1715 248.9043,84.9165 C240.6153,92.6605 228.6463,96.5325 212.9973,96.5325 L187.9503,96.5325 L187.9503,8.0815 L215.7193,8.0815 C230.1593,8.0815 241.3723,11.8925 249.3583,19.5155 C257.3433,27.1365 261.3363,37.7855 261.3363,51.4595" id="Fill-5" fill="#FFFFFF"></path>
|
||||
<mask id="mask-2" fill="white">
|
||||
<use xlink:href="#path-1"></use>
|
||||
</mask>
|
||||
<g id="Clip-8"></g>
|
||||
<polygon id="Fill-7" fill="#FFFFFF" mask="url(#mask-2)" points="23.185 30.421 45.046 30.421 45.046 8.56 23.185 8.56"></polygon>
|
||||
<polygon id="Fill-9" fill="#FFFFFF" mask="url(#mask-2)" points="5.251 9.038 14.289 9.038 14.289 0 5.251 0"></polygon>
|
||||
<polygon id="Fill-10" fill="#FFFFFF" mask="url(#mask-2)" points="0 36.195 14.18 36.195 14.18 22.015 0 22.015"></polygon>
|
||||
<polygon id="Fill-11" fill="#FFFFFF" mask="url(#mask-2)" points="322.0838 96.4337 271.0538 96.4337 271.0538 7.8287 322.0838 7.8287 322.0838 23.2227 289.8418 23.2227 289.8418 42.6767 319.8418 42.6767 319.8418 58.0707 289.8418 58.0707 289.8418 80.9187 322.0838 80.9187"></polygon>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
@@ -2777,26 +2777,6 @@ AZ::u32 SandboxIntegrationManager::SetState(AZ::u32 state)
|
||||
return 0;
|
||||
}
|
||||
|
||||
AZ::u32 SandboxIntegrationManager::SetStateFlag(AZ::u32 state)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
return m_dc->SetStateFlag(state);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AZ::u32 SandboxIntegrationManager::ClearStateFlag(AZ::u32 state)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
return m_dc->ClearStateFlag(state);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::PushMatrix(const AZ::Transform& tm)
|
||||
{
|
||||
if (m_dc)
|
||||
|
||||
@@ -268,8 +268,6 @@ private:
|
||||
bool SetDrawInFrontMode(bool bOn) override;
|
||||
AZ::u32 GetState() override;
|
||||
AZ::u32 SetState(AZ::u32 state) override;
|
||||
AZ::u32 SetStateFlag(AZ::u32 state) override;
|
||||
AZ::u32 ClearStateFlag(AZ::u32 state) override;
|
||||
void PushMatrix(const AZ::Transform& tm) override;
|
||||
void PopMatrix() override;
|
||||
|
||||
|
||||
+50
-19
@@ -12,6 +12,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <Authentication/AuthenticationProviderBus.h>
|
||||
#include <AzCore/Component/TickBus.h>
|
||||
|
||||
namespace AWSClientAuth
|
||||
{
|
||||
@@ -28,74 +29,104 @@ namespace AWSClientAuth
|
||||
OnPasswordGrantMultiFactorConfirmSignInSuccess, OnPasswordGrantMultiFactorConfirmSignInFail,
|
||||
OnDeviceCodeGrantSignInSuccess, OnDeviceCodeGrantSignInFail,
|
||||
OnDeviceCodeGrantConfirmSignInSuccess, OnDeviceCodeGrantConfirmSignInFail,
|
||||
OnRefreshTokensSuccess, OnRefreshTokensFail,
|
||||
OnSignOut
|
||||
OnRefreshTokensSuccess, OnRefreshTokensFail
|
||||
);
|
||||
|
||||
void OnPasswordGrantSingleFactorSignInSuccess(const AuthenticationTokens& authenticationToken) override
|
||||
{
|
||||
Call(FN_OnPasswordGrantSingleFactorSignInSuccess, authenticationToken);
|
||||
AZ::TickBus::QueueFunction([authenticationToken, this]()
|
||||
{
|
||||
Call(FN_OnPasswordGrantSingleFactorSignInSuccess, authenticationToken);
|
||||
});
|
||||
}
|
||||
|
||||
void OnPasswordGrantSingleFactorSignInFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnPasswordGrantSingleFactorSignInFail, error);
|
||||
AZ::TickBus::QueueFunction([error, this]()
|
||||
{
|
||||
Call(FN_OnPasswordGrantSingleFactorSignInFail, error);
|
||||
});
|
||||
}
|
||||
|
||||
void OnPasswordGrantMultiFactorSignInSuccess() override
|
||||
{
|
||||
Call(FN_OnPasswordGrantMultiFactorSignInSuccess);
|
||||
AZ::TickBus::QueueFunction([this]()
|
||||
{
|
||||
Call(FN_OnPasswordGrantMultiFactorSignInSuccess);
|
||||
});
|
||||
}
|
||||
|
||||
void OnPasswordGrantMultiFactorSignInFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnPasswordGrantMultiFactorSignInFail, error);
|
||||
AZ::TickBus::QueueFunction([error, this]()
|
||||
{
|
||||
Call(FN_OnPasswordGrantMultiFactorSignInFail, error);
|
||||
});
|
||||
}
|
||||
|
||||
void OnPasswordGrantMultiFactorConfirmSignInSuccess(const AuthenticationTokens& authenticationToken) override
|
||||
{
|
||||
Call(FN_OnPasswordGrantMultiFactorConfirmSignInSuccess, authenticationToken);
|
||||
AZ::TickBus::QueueFunction([authenticationToken, this]()
|
||||
{
|
||||
Call(FN_OnPasswordGrantMultiFactorConfirmSignInSuccess, authenticationToken);
|
||||
});
|
||||
}
|
||||
|
||||
void OnPasswordGrantMultiFactorConfirmSignInFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnPasswordGrantMultiFactorConfirmSignInFail, error);
|
||||
AZ::TickBus::QueueFunction([error, this]()
|
||||
{
|
||||
Call(FN_OnPasswordGrantMultiFactorConfirmSignInFail, error);
|
||||
});
|
||||
}
|
||||
|
||||
void OnDeviceCodeGrantSignInSuccess(
|
||||
const AZStd::string& userCode, const AZStd::string& verificationUrl, const int codeExpiresInSeconds) override
|
||||
{
|
||||
Call(FN_OnDeviceCodeGrantSignInSuccess, userCode, verificationUrl, codeExpiresInSeconds);
|
||||
AZ::TickBus::QueueFunction([userCode, verificationUrl, codeExpiresInSeconds, this]()
|
||||
{
|
||||
Call(FN_OnDeviceCodeGrantSignInSuccess, userCode, verificationUrl, codeExpiresInSeconds);
|
||||
});
|
||||
}
|
||||
|
||||
void OnDeviceCodeGrantSignInFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnDeviceCodeGrantSignInFail, error);
|
||||
AZ::TickBus::QueueFunction([error, this]()
|
||||
{
|
||||
Call(FN_OnDeviceCodeGrantSignInFail, error);
|
||||
});
|
||||
}
|
||||
|
||||
void OnDeviceCodeGrantConfirmSignInSuccess(const AuthenticationTokens& authenticationToken) override
|
||||
{
|
||||
Call(FN_OnDeviceCodeGrantConfirmSignInSuccess, authenticationToken);
|
||||
AZ::TickBus::QueueFunction([authenticationToken, this]()
|
||||
{
|
||||
Call(FN_OnDeviceCodeGrantConfirmSignInSuccess, authenticationToken);
|
||||
});
|
||||
}
|
||||
|
||||
void OnDeviceCodeGrantConfirmSignInFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnDeviceCodeGrantConfirmSignInFail, error);
|
||||
AZ::TickBus::QueueFunction([error, this]()
|
||||
{
|
||||
Call(FN_OnDeviceCodeGrantConfirmSignInFail, error);
|
||||
});
|
||||
}
|
||||
|
||||
void OnRefreshTokensSuccess(const AuthenticationTokens& authenticationToken) override
|
||||
{
|
||||
Call(FN_OnRefreshTokensSuccess, authenticationToken);
|
||||
AZ::TickBus::QueueFunction([authenticationToken, this]()
|
||||
{
|
||||
Call(FN_OnRefreshTokensSuccess, authenticationToken);
|
||||
});
|
||||
}
|
||||
|
||||
void OnRefreshTokensFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnRefreshTokensFail, error);
|
||||
}
|
||||
|
||||
void OnSignOut(const ProviderNameEnum& provideName) override
|
||||
{
|
||||
Call(FN_OnSignOut, provideName);
|
||||
AZ::TickBus::QueueFunction([error, this]()
|
||||
{
|
||||
Call(FN_OnRefreshTokensFail, error);
|
||||
});
|
||||
}
|
||||
};
|
||||
} // namespace AWSClientAuth
|
||||
|
||||
+20
-2
@@ -16,6 +16,7 @@
|
||||
#include <AzCore/std/containers/map.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <Authentication/AuthenticationProviderBus.h>
|
||||
#include <Authentication/AuthenticationProviderScriptCanvasBus.h>
|
||||
#include <Authentication/AuthenticationProviderInterface.h>
|
||||
#include <Authentication/AuthenticationTokens.h>
|
||||
|
||||
@@ -23,7 +24,8 @@ namespace AWSClientAuth
|
||||
{
|
||||
//! Manages various authentication provider implementations and implements AuthenticationProvider Request bus.
|
||||
class AuthenticationProviderManager
|
||||
: AuthenticationProviderRequestBus::Handler
|
||||
: public AuthenticationProviderRequestBus::Handler
|
||||
, public AuthenticationProviderScriptCanvasRequestBus::Handler
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(AuthenticationProviderManager, "{45813BA5-9A46-4A2A-A923-C79CFBA0E63D}", IAuthenticationProviderRequests);
|
||||
@@ -43,6 +45,22 @@ namespace AWSClientAuth
|
||||
bool IsSignedIn(const ProviderNameEnum& providerName) override;
|
||||
bool SignOut(const ProviderNameEnum& providerName) override;
|
||||
AuthenticationTokens GetAuthenticationTokens(const ProviderNameEnum& providerName) override;
|
||||
|
||||
// AuthenticationProviderScriptCanvasRequest interface
|
||||
bool Initialize(const AZStd::vector<AZStd::string>& providerNames, const AZStd::string& settingsRegistryPath) override;
|
||||
void PasswordGrantSingleFactorSignInAsync(
|
||||
const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& password) override;
|
||||
void PasswordGrantMultiFactorSignInAsync(
|
||||
const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& password) override;
|
||||
void PasswordGrantMultiFactorConfirmSignInAsync(
|
||||
const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& confirmationCode) override;
|
||||
void DeviceCodeGrantSignInAsync(const AZStd::string& providerName) override;
|
||||
void DeviceCodeGrantConfirmSignInAsync(const AZStd::string& providerName) override;
|
||||
void RefreshTokensAsync(const AZStd::string& providerName) override;
|
||||
void GetTokensWithRefreshAsync(const AZStd::string& providerName) override;
|
||||
bool IsSignedIn(const AZStd::string& providerName) override;
|
||||
bool SignOut(const AZStd::string& providerName) override;
|
||||
AuthenticationTokens GetAuthenticationTokens(const AZStd::string& providerName) override;
|
||||
|
||||
virtual AZStd::unique_ptr<AuthenticationProviderInterface> CreateAuthenticationProviderObject(const ProviderNameEnum& providerName);
|
||||
AZStd::map<ProviderNameEnum, AZStd::unique_ptr<AuthenticationProviderInterface>> m_authenticationProvidersMap;
|
||||
@@ -50,9 +68,9 @@ namespace AWSClientAuth
|
||||
private:
|
||||
bool IsProviderInitialized(const ProviderNameEnum& providerName);
|
||||
void ResetProviders();
|
||||
ProviderNameEnum GetProviderNameEnum(AZStd::string name);
|
||||
|
||||
AZStd::shared_ptr<AZ::SettingsRegistryInterface> m_settingsRegistry;
|
||||
|
||||
};
|
||||
|
||||
} // namespace AWSClientAuth
|
||||
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <Authentication/AuthenticationTokens.h>
|
||||
|
||||
namespace AWSClientAuth
|
||||
{
|
||||
//! Abstract class for authentication provider script canvas requests.
|
||||
//! Private class to allow provide names to be string type instead of an enum as behavior context does not work well with enum's.
|
||||
class IAuthenticationProviderScriptCanvasRequests
|
||||
{
|
||||
public:
|
||||
AZ_TYPE_INFO(IAuthenticationProviderRequests, "{A8FD915F-9FF2-4BA3-8AA0-8CF7A94A323B}");
|
||||
|
||||
//! Parse the settings file for required settings for authentication providers. Instantiate and initialize authentication providers
|
||||
//! @param providerNames List of provider names to instantiate and initialize for Authentication.
|
||||
//! @param settingsRegistryPath Path for the settings registry file to use to configure providers.
|
||||
//! @return bool True: if all providers initialized successfully. False: If any provider fails initialization.
|
||||
virtual bool Initialize(const AZStd::vector<AZStd::string>& providerNames, const AZStd::string& settingsRegistryPath) = 0;
|
||||
|
||||
//! Checks if user is signed in.
|
||||
//! If access tokens are available and not expired.
|
||||
//! @param providerName Provider to check signed in for
|
||||
//! @return bool True if valid access token available, else False
|
||||
virtual bool IsSignedIn(const AZStd::string& providerName) = 0;
|
||||
|
||||
//! Get cached tokens from last last successful sign-in for the provider.
|
||||
//! @param providerName Provider to get authentication tokens
|
||||
//! @return AuthenticationTokens tokens from successful authentication.
|
||||
virtual AuthenticationTokens GetAuthenticationTokens(const AZStd::string& providerName) = 0;
|
||||
|
||||
// Below methods have corresponding notifications for success and failures.
|
||||
|
||||
//! Call sign in endpoint for provider password grant flow.
|
||||
//! @param providerName Provider to call sign in.
|
||||
//! @param username Username to use to for sign in.
|
||||
//! @param password Password to use to for sign in.
|
||||
virtual void PasswordGrantSingleFactorSignInAsync(const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& password) = 0;
|
||||
|
||||
//! Call sign in endpoint for provider password grant multi factor authentication flow.
|
||||
//! @param providerName Provider to call MFA sign in.
|
||||
//! @param username Username to use for MFA sign in.
|
||||
//! @param password Password to use for MFA sign in.
|
||||
virtual void PasswordGrantMultiFactorSignInAsync(const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& password) = 0;
|
||||
|
||||
//! Call confirm endpoint for provider password grant multi factor authentication flow .
|
||||
//! @param providerName Provider to call MFA confirm sign in.
|
||||
//! @param username Username to use for MFA confirm.
|
||||
//! @param confirmationCode Confirmation code (sent to email/text) to use for MFA confirm.
|
||||
virtual void PasswordGrantMultiFactorConfirmSignInAsync(const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& confirmationCode) = 0;
|
||||
|
||||
//! Call code-pair endpoint for provider device grant flow.
|
||||
//! @param providerName Provider to call device sign in.
|
||||
virtual void DeviceCodeGrantSignInAsync(const AZStd::string& providerName) = 0;
|
||||
|
||||
//! Call tokens endpoint for provider device grant flow.
|
||||
//! @param providerName Provider to call device confirm sign in.
|
||||
virtual void DeviceCodeGrantConfirmSignInAsync(const AZStd::string& providerName) = 0;
|
||||
|
||||
//! Call refresh endpoint for provider refresh grant flow.
|
||||
//! @param providerName Provider to call refresh tokens.
|
||||
virtual void RefreshTokensAsync(const AZStd::string& providerName) = 0;
|
||||
|
||||
//! Call refresh token if token not valid. If token valid, fires corresponding event.
|
||||
//! @param providerName Provider to get access token for.
|
||||
//! events: OnRefreshTokensSuccess, OnRefreshTokensFail
|
||||
virtual void GetTokensWithRefreshAsync(const AZStd::string& providerName) = 0;
|
||||
|
||||
//! Signs user out.
|
||||
//! Clears all cached tokens.
|
||||
//! @param providerName Provider to sign out.
|
||||
//! @return bool True: Successfully sign out.
|
||||
virtual bool SignOut(const AZStd::string& providerName) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
};
|
||||
|
||||
//! Authentication Request bus for different supported providers.
|
||||
class AuthenticationProviderScriptCanvasRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// EBusTraits overrides
|
||||
using MutexType = AZ::NullMutex;
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
};
|
||||
using AuthenticationProviderScriptCanvasRequestBus = AZ::EBus<IAuthenticationProviderScriptCanvasRequests, AuthenticationProviderScriptCanvasRequests>;
|
||||
|
||||
} // namespace AWSClientAuth
|
||||
@@ -15,6 +15,14 @@
|
||||
|
||||
namespace AWSClientAuth
|
||||
{
|
||||
constexpr char ProvideNameEnumStringNone[] = "None";
|
||||
constexpr char ProvideNameEnumStringAWSCognitoIDP[] = "AWSCognitoIDP";
|
||||
constexpr char ProvideNameEnumStringLoginWithAmazon[] = "LoginWithAmazon";
|
||||
constexpr char ProvideNameEnumStringGoogle[] = "Google";
|
||||
constexpr char ProvideNameEnumStringApple[] = "Apple";
|
||||
constexpr char ProvideNameEnumStringFacebook[] = "Facebook";
|
||||
constexpr char ProvideNameEnumStringTwitch[] = "Twitch";
|
||||
|
||||
//! Holds Login with Amazon provider serialized settings
|
||||
class LWAProviderSetting
|
||||
{
|
||||
|
||||
+9
-2
@@ -12,6 +12,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <Authorization/AWSCognitoAuthorizationBus.h>
|
||||
#include <AzCore/Component/TickBus.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
|
||||
namespace AWSClientAuth
|
||||
@@ -28,12 +29,18 @@ namespace AWSClientAuth
|
||||
|
||||
void OnRequestAWSCredentialsSuccess(const ClientAuthAWSCredentials& awsCredentials) override
|
||||
{
|
||||
Call(FN_OnRequestAWSCredentialsSuccess, awsCredentials);
|
||||
AZ::TickBus::QueueFunction([awsCredentials, this]()
|
||||
{
|
||||
Call(FN_OnRequestAWSCredentialsSuccess, awsCredentials);
|
||||
});
|
||||
}
|
||||
|
||||
void OnRequestAWSCredentialsFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnRequestAWSCredentialsFail, error);
|
||||
AZ::TickBus::QueueFunction([error, this]()
|
||||
{
|
||||
Call(FN_OnRequestAWSCredentialsFail, error);
|
||||
});
|
||||
}
|
||||
};
|
||||
} // namespace AWSClientAuth
|
||||
|
||||
+37
-12
@@ -12,6 +12,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <UserManagement/AWSCognitoUserManagementBus.h>
|
||||
#include <AzCore/Component/TickBus.h>
|
||||
|
||||
namespace AWSClientAuth
|
||||
{
|
||||
@@ -32,62 +33,86 @@ namespace AWSClientAuth
|
||||
|
||||
void OnEmailSignUpSuccess(const AZStd::string& uuid) override
|
||||
{
|
||||
Call(FN_OnEmailSignUpSuccess, uuid);
|
||||
AZ::TickBus::QueueFunction([uuid, this]() {
|
||||
Call(FN_OnEmailSignUpSuccess, uuid);
|
||||
});
|
||||
}
|
||||
|
||||
void OnEmailSignUpFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnEmailSignUpFail, error);
|
||||
AZ::TickBus::QueueFunction([error, this]() {
|
||||
Call(FN_OnEmailSignUpFail, error);
|
||||
});
|
||||
}
|
||||
|
||||
void OnPhoneSignUpSuccess(const AZStd::string& uuid) override
|
||||
{
|
||||
Call(FN_OnPhoneSignUpSuccess, uuid);
|
||||
AZ::TickBus::QueueFunction([uuid, this]() {
|
||||
Call(FN_OnPhoneSignUpSuccess, uuid);
|
||||
});
|
||||
}
|
||||
|
||||
void OnPhoneSignUpFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnPhoneSignUpFail, error);
|
||||
AZ::TickBus::QueueFunction([error, this]() {
|
||||
Call(FN_OnPhoneSignUpFail, error);
|
||||
});
|
||||
}
|
||||
|
||||
void OnConfirmSignUpSuccess() override
|
||||
{
|
||||
Call(FN_OnConfirmSignUpSuccess);
|
||||
AZ::TickBus::QueueFunction([this]() {
|
||||
Call(FN_OnConfirmSignUpSuccess);
|
||||
});
|
||||
}
|
||||
|
||||
void OnConfirmSignUpFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnConfirmSignUpFail, error);
|
||||
AZ::TickBus::QueueFunction([error, this]() {
|
||||
Call(FN_OnConfirmSignUpFail, error);
|
||||
});
|
||||
}
|
||||
|
||||
void OnForgotPasswordSuccess() override
|
||||
{
|
||||
Call(FN_OnForgotPasswordSuccess);
|
||||
AZ::TickBus::QueueFunction([this]() {
|
||||
Call(FN_OnForgotPasswordSuccess);
|
||||
});
|
||||
}
|
||||
|
||||
void OnForgotPasswordFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnForgotPasswordFail, error);
|
||||
AZ::TickBus::QueueFunction([error, this]() {
|
||||
Call(FN_OnForgotPasswordFail, error);
|
||||
});
|
||||
}
|
||||
|
||||
void OnConfirmForgotPasswordSuccess() override
|
||||
{
|
||||
Call(FN_OnConfirmForgotPasswordSuccess);
|
||||
AZ::TickBus::QueueFunction([this]() {
|
||||
Call(FN_OnConfirmForgotPasswordSuccess);
|
||||
});
|
||||
}
|
||||
|
||||
void OnConfirmForgotPasswordFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnConfirmForgotPasswordFail, error);
|
||||
AZ::TickBus::QueueFunction([error, this]() {
|
||||
Call(FN_OnConfirmForgotPasswordFail, error);
|
||||
});
|
||||
}
|
||||
|
||||
void OnEnableMFASuccess() override
|
||||
{
|
||||
Call(FN_OnEnableMFASuccess);
|
||||
AZ::TickBus::QueueFunction([this]() {
|
||||
Call(FN_OnEnableMFASuccess);
|
||||
});
|
||||
}
|
||||
|
||||
void OnEnableMFAFail(const AZStd::string& error) override
|
||||
{
|
||||
Call(FN_OnEnableMFAFail, error);
|
||||
AZ::TickBus::QueueFunction([error, this]() {
|
||||
Call(FN_OnEnableMFAFail, error);
|
||||
});
|
||||
}
|
||||
};
|
||||
} // namespace AWSClientAuth
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
namespace AWSClientAuth
|
||||
{
|
||||
//@ Abstract class for authentication provider requests.
|
||||
//! Abstract class for authentication provider requests.
|
||||
class IAuthenticationProviderRequests
|
||||
{
|
||||
public:
|
||||
@@ -35,32 +35,40 @@ namespace AWSClientAuth
|
||||
virtual bool IsSignedIn(const ProviderNameEnum& providerName) = 0;
|
||||
|
||||
//! Get cached tokens from last last successful sign-in for the provider.
|
||||
//! @param providerName Provider to get authentication tokens.
|
||||
//! @return AuthenticationTokens tokens from successful authentication.
|
||||
virtual AuthenticationTokens GetAuthenticationTokens(const ProviderNameEnum& providerName) = 0;
|
||||
|
||||
// Below methods have corresponding notifications for success and failures.
|
||||
|
||||
//! Call sign in endpoint for provider password grant flow.
|
||||
//! @param providerName Provider to call sign in.
|
||||
//! @param username Username to use to for sign in.
|
||||
//! @param password Password to use to for sign in.
|
||||
virtual void PasswordGrantSingleFactorSignInAsync(const ProviderNameEnum& providerName, const AZStd::string& username, const AZStd::string& password) = 0;
|
||||
|
||||
//! Call sign in endpoint for provider password grant multi factor authentication flow.
|
||||
//! @param providerName Provider to call MFA sign in.
|
||||
//! @param username Username to use for MFA sign in.
|
||||
//! @param password Password to use for MFA sign in.
|
||||
virtual void PasswordGrantMultiFactorSignInAsync(const ProviderNameEnum& providerName, const AZStd::string& username, const AZStd::string& password) = 0;
|
||||
|
||||
//! Call confirm endpoint for provider password grant multi factor authentication flow .
|
||||
//! @param providerName Provider to call MFA confirm sign in.
|
||||
//! @param username Username to use for MFA confirm.
|
||||
//! @param confirmationCode Confirmation code (sent to email/text) to use for MFA confirm.
|
||||
virtual void PasswordGrantMultiFactorConfirmSignInAsync(const ProviderNameEnum& providerName, const AZStd::string& username, const AZStd::string& confirmationCode) = 0;
|
||||
|
||||
//! Call code-pair endpoint for provider device grant flow.
|
||||
//! @param providerName Provider to call device sign in.
|
||||
virtual void DeviceCodeGrantSignInAsync(const ProviderNameEnum& providerName) = 0;
|
||||
|
||||
//! Call tokens endpoint for provider device grant flow.
|
||||
//! @param providerName Provider to call device confirm sign in.
|
||||
virtual void DeviceCodeGrantConfirmSignInAsync(const ProviderNameEnum& providerName) = 0;
|
||||
|
||||
//! Call refresh endpoint for provider refresh grant flow.
|
||||
//! @param providerName Provider to call refresh tokens.
|
||||
virtual void RefreshTokensAsync(const ProviderNameEnum& providerName) = 0;
|
||||
|
||||
//! Call refresh token if token not valid. If token valid, fires corresponding event.
|
||||
|
||||
@@ -11,20 +11,15 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Preprocessor/Enum.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <AzCore/std/chrono/clocks.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
|
||||
namespace AWSClientAuth
|
||||
{
|
||||
enum class ProviderNameEnum
|
||||
{
|
||||
None,
|
||||
AWSCognitoIDP,
|
||||
LoginWithAmazon,
|
||||
Google,
|
||||
Apple,
|
||||
Facebook
|
||||
};
|
||||
AZ_ENUM_CLASS(ProviderNameEnum, None, AWSCognitoIDP, LoginWithAmazon, Twitch, Google, Apple, Facebook);
|
||||
|
||||
//! Used to share authentication tokens to caller and to AWSCognitoAuthorizationController.
|
||||
class AuthenticationTokens
|
||||
@@ -55,6 +50,8 @@ namespace AWSClientAuth
|
||||
//! @return Expiration time in seconds.
|
||||
int GetTokensExpireTimeSeconds() const;
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
private:
|
||||
int m_tokensExpireTimeSeconds = 0;
|
||||
AZStd::string m_accessToken;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/RTTI/TypeInfo.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
|
||||
#include <aws/core/auth/AWSCredentialsProvider.h>
|
||||
@@ -24,6 +24,14 @@ namespace AWSClientAuth
|
||||
{
|
||||
public:
|
||||
AZ_TYPE_INFO(ClientAuthAWSCredentials, "{02FB32C4-B94E-4084-9049-3DF32F87BD76}");
|
||||
ClientAuthAWSCredentials() = default;
|
||||
ClientAuthAWSCredentials(const ClientAuthAWSCredentials& other)
|
||||
: m_accessKeyId(other.m_accessKeyId)
|
||||
, m_secretKey(other.m_secretKey)
|
||||
, m_sessionToken(other.m_sessionToken)
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
ClientAuthAWSCredentials(const AZStd::string& accessKeyId, const AZStd::string& secretKey, const AZStd::string& sessionToken)
|
||||
{
|
||||
@@ -50,6 +58,32 @@ namespace AWSClientAuth
|
||||
return m_sessionToken;
|
||||
}
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->Class<ClientAuthAWSCredentials>()
|
||||
->Field("AWSAccessKeyId", &ClientAuthAWSCredentials::m_accessKeyId)
|
||||
->Field("AWSSecretKey", &ClientAuthAWSCredentials::m_secretKey)
|
||||
->Field("AWSSessionToken", &ClientAuthAWSCredentials::m_sessionToken);
|
||||
}
|
||||
|
||||
AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context);
|
||||
if (behaviorContext)
|
||||
{
|
||||
behaviorContext->Class<ClientAuthAWSCredentials>()
|
||||
->Attribute(AZ::Script::Attributes::Category, "AWSClientAuth")
|
||||
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Constructor()
|
||||
->Constructor<const ClientAuthAWSCredentials&>()
|
||||
->Property("AWSAccessKeyId", BehaviorValueGetter(&ClientAuthAWSCredentials::m_accessKeyId), BehaviorValueSetter(&ClientAuthAWSCredentials::m_accessKeyId))
|
||||
->Property("AWSSecretKey", BehaviorValueGetter(&ClientAuthAWSCredentials::m_secretKey), BehaviorValueSetter(&ClientAuthAWSCredentials::m_secretKey))
|
||||
->Property("AWSSessionToken", BehaviorValueGetter(&ClientAuthAWSCredentials::m_sessionToken), BehaviorValueSetter(&ClientAuthAWSCredentials::m_sessionToken));
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
AZStd::string m_accessKeyId;
|
||||
AZStd::string m_secretKey;
|
||||
|
||||
@@ -22,11 +22,12 @@ namespace AWSClientAuth
|
||||
public:
|
||||
AZ_TYPE_INFO(IAWSCognitoUserManagementRequests, "{A4C90F21-7056-4827-8C6B-401E6945697D}");
|
||||
|
||||
//! Initialize Cognito User pool.
|
||||
//! Initialize Cognito User pool using settings from resource mappings.
|
||||
//! @param settingsRegistryPath settingsRegistryPath Path for the settings registry file to use.
|
||||
virtual bool Initialize() = 0;
|
||||
|
||||
// Requests interface
|
||||
|
||||
//! Cognito user pool email sign up start.
|
||||
//! @param username User name to use for sign up.
|
||||
//! @param password Password to use for sign up.
|
||||
@@ -59,7 +60,7 @@ namespace AWSClientAuth
|
||||
virtual void EnableMFAAsync(const AZStd::string& accessToken) = 0;
|
||||
};
|
||||
|
||||
//! Manages various authentication provider implementations and implements AuthenticationProvider Request bus.
|
||||
//! Implements AWS Cognito user pool user management requests.
|
||||
class AWSCognitoUserManagementRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
|
||||
@@ -22,6 +22,11 @@
|
||||
#include <aws/cognito-identity/CognitoIdentityClient.h>
|
||||
#include <aws/cognito-idp/CognitoIdentityProviderClient.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
AZ_TYPE_INFO_SPECIALIZE(AWSClientAuth::ProviderNameEnum, "{FB34B23A-B249-47A2-B1F1-C05284B50CCC}");
|
||||
}
|
||||
|
||||
namespace AWSClientAuth
|
||||
{
|
||||
constexpr char SerializeComponentName[] = "AWSClientAuth";
|
||||
@@ -44,20 +49,35 @@ namespace AWSClientAuth
|
||||
AWSClientAuth::GoogleProviderSetting::Reflect(*serialize);
|
||||
}
|
||||
|
||||
AWSClientAuth::AuthenticationTokens::Reflect(context);
|
||||
AWSClientAuth::ClientAuthAWSCredentials::Reflect(context);
|
||||
|
||||
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
|
||||
{
|
||||
behaviorContext->EBus<AuthenticationProviderRequestBus>("AuthenticationProviderRequestBus")
|
||||
behaviorContext->Enum<(int)ProviderNameEnum::None>("ProviderNameEnum_None")
|
||||
->Enum<(int)ProviderNameEnum::AWSCognitoIDP>("ProviderNameEnum_AWSCognitoIDP")
|
||||
->Enum<(int)ProviderNameEnum::LoginWithAmazon>("ProviderNameEnum_LoginWithAmazon")
|
||||
->Enum<(int)ProviderNameEnum::Google>("ProviderNameEnum_Google");
|
||||
|
||||
behaviorContext->EBus<AuthenticationProviderScriptCanvasRequestBus>("AuthenticationProviderRequestBus")
|
||||
->Attribute(AZ::Script::Attributes::Category, SerializeComponentName)
|
||||
->Event("Initialize", &AuthenticationProviderRequestBus::Events::Initialize)
|
||||
->Event("IsSignedIn", &AuthenticationProviderRequestBus::Events::IsSignedIn)
|
||||
->Event("GetAuthenticationTokens", &AuthenticationProviderRequestBus::Events::GetAuthenticationTokens)
|
||||
->Event("Initialize", &AuthenticationProviderScriptCanvasRequestBus::Events::Initialize)
|
||||
->Event("IsSignedIn", &AuthenticationProviderScriptCanvasRequestBus::Events::IsSignedIn)
|
||||
->Event("GetAuthenticationTokens", &AuthenticationProviderScriptCanvasRequestBus::Events::GetAuthenticationTokens)
|
||||
->Event(
|
||||
"PasswordGrantSingleFactorSignInAsync", &AuthenticationProviderRequestBus::Events::PasswordGrantSingleFactorSignInAsync)
|
||||
->Event("DeviceCodeGrantSignInAsync", &AuthenticationProviderRequestBus::Events::DeviceCodeGrantSignInAsync)
|
||||
->Event("DeviceCodeGrantConfirmSignInAsync", &AuthenticationProviderRequestBus::Events::DeviceCodeGrantConfirmSignInAsync)
|
||||
->Event("RefreshTokensAsync", &AuthenticationProviderRequestBus::Events::RefreshTokensAsync)
|
||||
->Event("GetTokensWithRefreshAsync", &AuthenticationProviderRequestBus::Events::GetTokensWithRefreshAsync)
|
||||
->Event("SignOut", &AuthenticationProviderRequestBus::Events::SignOut);
|
||||
"PasswordGrantSingleFactorSignInAsync",
|
||||
&AuthenticationProviderScriptCanvasRequestBus::Events::PasswordGrantSingleFactorSignInAsync)
|
||||
->Event(
|
||||
"PasswordGrantMultiFactorSignInAsync",
|
||||
&AuthenticationProviderScriptCanvasRequestBus::Events::PasswordGrantMultiFactorSignInAsync)
|
||||
->Event(
|
||||
"PasswordGrantMultiFactorConfirmSignInAsync",
|
||||
&AuthenticationProviderScriptCanvasRequestBus::Events::PasswordGrantMultiFactorConfirmSignInAsync)
|
||||
->Event("DeviceCodeGrantSignInAsync", &AuthenticationProviderScriptCanvasRequestBus::Events::DeviceCodeGrantSignInAsync)
|
||||
->Event("DeviceCodeGrantConfirmSignInAsync", &AuthenticationProviderScriptCanvasRequestBus::Events::DeviceCodeGrantConfirmSignInAsync)
|
||||
->Event("RefreshTokensAsync", &AuthenticationProviderScriptCanvasRequestBus::Events::RefreshTokensAsync)
|
||||
->Event("GetTokensWithRefreshAsync", &AuthenticationProviderScriptCanvasRequestBus::Events::GetTokensWithRefreshAsync)
|
||||
->Event("SignOut", &AuthenticationProviderScriptCanvasRequestBus::Events::SignOut);
|
||||
|
||||
behaviorContext->EBus<AWSCognitoAuthorizationRequestBus>("AWSCognitoAuthorizationRequestBus")
|
||||
->Attribute(AZ::Script::Attributes::Category, SerializeComponentName)
|
||||
@@ -77,11 +97,15 @@ namespace AWSClientAuth
|
||||
->Event("ConfirmForgotPasswordAsync", &AWSCognitoUserManagementRequestBus::Events::ConfirmForgotPasswordAsync)
|
||||
->Event("EnableMFAAsync", &AWSCognitoUserManagementRequestBus::Events::EnableMFAAsync);
|
||||
|
||||
|
||||
behaviorContext->EBus<AuthenticationProviderNotificationBus>("AuthenticationProviderNotificationBus")
|
||||
->Attribute(AZ::Script::Attributes::Category, SerializeComponentName)
|
||||
->Handler<AuthenticationNotificationBusBehaviorHandler>();
|
||||
behaviorContext->EBus<AWSCognitoUserManagementNotificationBus>("AWSCognitoUserManagementNotificationBus")
|
||||
->Attribute(AZ::Script::Attributes::Category, SerializeComponentName)
|
||||
->Handler<UserManagementNotificationBusBehaviorHandler>();
|
||||
behaviorContext->EBus<AWSCognitoAuthorizationNotificationBus>("AWSCognitoAuthorizationNotificationBus")
|
||||
->Attribute(AZ::Script::Attributes::Category, SerializeComponentName)
|
||||
->Handler<AWSCognitoAuthorizationNotificationBusBehaviorHandler>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace AWSClientAuth
|
||||
AZ_UNUSED(settingsRegistry);
|
||||
AWSCore::AWSResourceMappingRequestBus::BroadcastResult(
|
||||
m_cognitoAppClientId, &AWSCore::AWSResourceMappingRequests::GetResourceNameId, CognitoAppClientIdResourceMappingKey);
|
||||
AZ_Warning("AWSCognitoAuthenticationProvider", m_cognitoAppClientId.empty(), "Missing Cognito App Client Id from resource mappings. Calls to Cognito will fail.");
|
||||
AZ_Warning("AWSCognitoAuthenticationProvider", !m_cognitoAppClientId.empty(), "Missing Cognito App Client Id from resource mappings. Calls to Cognito will fail.");
|
||||
return !m_cognitoAppClientId.empty();
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <AzCore/std/smart_ptr/make_shared.h>
|
||||
#include <AzCore/Settings/SettingsRegistryImpl.h>
|
||||
#include <AzCore/IO/FileIO.h>
|
||||
|
||||
#include <Authentication/AuthenticationProviderTypes.h>
|
||||
#include <Authentication/AWSCognitoAuthenticationProvider.h>
|
||||
@@ -25,12 +26,14 @@ namespace AWSClientAuth
|
||||
{
|
||||
AZ::Interface<IAuthenticationProviderRequests>::Register(this);
|
||||
AuthenticationProviderRequestBus::Handler::BusConnect();
|
||||
AuthenticationProviderScriptCanvasRequestBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
AuthenticationProviderManager::~AuthenticationProviderManager()
|
||||
{
|
||||
ResetProviders();
|
||||
m_settingsRegistry.reset();
|
||||
AuthenticationProviderScriptCanvasRequestBus::Handler::BusDisconnect();
|
||||
AuthenticationProviderRequestBus::Handler::BusDisconnect();
|
||||
AZ::Interface<IAuthenticationProviderRequests>::Unregister(this);
|
||||
}
|
||||
@@ -38,12 +41,19 @@ namespace AWSClientAuth
|
||||
bool AuthenticationProviderManager::Initialize(const AZStd::vector<ProviderNameEnum>& providerNames, const AZStd::string& settingsRegistryPath)
|
||||
{
|
||||
ResetProviders();
|
||||
AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance();
|
||||
AZ_Assert(fileIO, "File IO is not initialized.");
|
||||
|
||||
m_settingsRegistry.reset();
|
||||
m_settingsRegistry = AZStd::make_shared<AZ::SettingsRegistryImpl>();
|
||||
|
||||
if (!m_settingsRegistry->MergeSettingsFile(settingsRegistryPath, AZ::SettingsRegistryInterface::Format::JsonMergePatch))
|
||||
AZStd::array<char, AZ::IO::MaxPathLength> resolvedPath{};
|
||||
AZ::IO::FileIOBase::GetInstance()->ResolvePath(settingsRegistryPath.data(), resolvedPath.data(), resolvedPath.size());
|
||||
|
||||
|
||||
if (!m_settingsRegistry->MergeSettingsFile(resolvedPath.data(), AZ::SettingsRegistryInterface::Format::JsonMergePatch))
|
||||
{
|
||||
AZ_Error("AuthenticationProviderManager", true, "Error merging settings registry for path: %s", settingsRegistryPath.c_str());
|
||||
AZ_Error("AuthenticationProviderManager", true, "Error merging settings registry for path: %s", resolvedPath.data());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -112,6 +122,7 @@ namespace AWSClientAuth
|
||||
{
|
||||
AuthenticationProviderNotificationBus::Broadcast(&AuthenticationProviderNotifications::OnRefreshTokensFail
|
||||
, "Provider is not initialized");
|
||||
return;
|
||||
}
|
||||
|
||||
AuthenticationTokens tokens = m_authenticationProvidersMap[providerName]->GetAuthenticationTokens();
|
||||
@@ -181,5 +192,77 @@ namespace AWSClientAuth
|
||||
}
|
||||
}
|
||||
|
||||
ProviderNameEnum AuthenticationProviderManager::GetProviderNameEnum(AZStd::string name)
|
||||
{
|
||||
auto enumValue = ProviderNameEnumNamespace::FromStringToProviderNameEnum(name);
|
||||
if (enumValue.has_value())
|
||||
{
|
||||
return enumValue.value();
|
||||
}
|
||||
AZ_Warning("AuthenticationProviderManager", true, "Incorrect string value for enum: %s", name.c_str());
|
||||
return ProviderNameEnum::None;
|
||||
}
|
||||
|
||||
bool AuthenticationProviderManager::Initialize(
|
||||
const AZStd::vector<AZStd::string>& providerNames, const AZStd::string& settingsRegistryPath)
|
||||
{
|
||||
AZStd::vector<ProviderNameEnum> providerNamesEnum;
|
||||
for (auto name : providerNames)
|
||||
{
|
||||
providerNamesEnum.push_back(GetProviderNameEnum(name));
|
||||
}
|
||||
return Initialize(providerNamesEnum, settingsRegistryPath);
|
||||
}
|
||||
|
||||
void AuthenticationProviderManager::PasswordGrantSingleFactorSignInAsync(const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& password)
|
||||
{
|
||||
PasswordGrantSingleFactorSignInAsync(GetProviderNameEnum(providerName), username, password);
|
||||
}
|
||||
|
||||
void AuthenticationProviderManager::PasswordGrantMultiFactorSignInAsync(const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& password)
|
||||
{
|
||||
PasswordGrantMultiFactorSignInAsync(GetProviderNameEnum(providerName), username, password);
|
||||
}
|
||||
|
||||
void AuthenticationProviderManager::PasswordGrantMultiFactorConfirmSignInAsync(const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& confirmationCode)
|
||||
{
|
||||
PasswordGrantMultiFactorConfirmSignInAsync(GetProviderNameEnum(providerName), username, confirmationCode);
|
||||
}
|
||||
|
||||
void AuthenticationProviderManager::DeviceCodeGrantSignInAsync(const AZStd::string& providerName)
|
||||
{
|
||||
DeviceCodeGrantSignInAsync(GetProviderNameEnum(providerName));
|
||||
}
|
||||
|
||||
void AuthenticationProviderManager::DeviceCodeGrantConfirmSignInAsync(const AZStd::string& providerName)
|
||||
{
|
||||
DeviceCodeGrantConfirmSignInAsync(GetProviderNameEnum(providerName));
|
||||
}
|
||||
|
||||
void AuthenticationProviderManager::RefreshTokensAsync(const AZStd::string& providerName)
|
||||
{
|
||||
RefreshTokensAsync(GetProviderNameEnum(providerName));
|
||||
}
|
||||
|
||||
void AuthenticationProviderManager::GetTokensWithRefreshAsync(const AZStd::string& providerName)
|
||||
{
|
||||
GetTokensWithRefreshAsync(GetProviderNameEnum(providerName));
|
||||
}
|
||||
|
||||
bool AuthenticationProviderManager::IsSignedIn(const AZStd::string& providerName)
|
||||
{
|
||||
return IsSignedIn(GetProviderNameEnum(providerName));
|
||||
}
|
||||
|
||||
bool AuthenticationProviderManager::SignOut(const AZStd::string& providerName)
|
||||
{
|
||||
return SignOut(GetProviderNameEnum(providerName));
|
||||
}
|
||||
|
||||
AuthenticationTokens AuthenticationProviderManager::GetAuthenticationTokens(const AZStd::string& providerName)
|
||||
{
|
||||
return GetAuthenticationTokens(GetProviderNameEnum(providerName));
|
||||
}
|
||||
|
||||
} // namespace AWSClientAuth
|
||||
|
||||
|
||||
@@ -79,4 +79,30 @@ namespace AWSClientAuth
|
||||
{
|
||||
return m_tokensExpireTimeSeconds;
|
||||
}
|
||||
|
||||
void AuthenticationTokens::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->Class<AuthenticationTokens>()
|
||||
->Field("AccessToken", &AuthenticationTokens::m_accessToken)
|
||||
->Field("OpenIdToken", &AuthenticationTokens::m_openIdToken)
|
||||
->Field("RefreshToken", &AuthenticationTokens::m_refreshToken);
|
||||
}
|
||||
|
||||
AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context);
|
||||
if (behaviorContext)
|
||||
{
|
||||
behaviorContext->Class<AuthenticationTokens>()
|
||||
->Attribute(AZ::Script::Attributes::Category, "AWSClientAuth")
|
||||
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Constructor()
|
||||
->Constructor<const AuthenticationTokens&>()
|
||||
->Property("AccessToken", BehaviorValueGetter(&AuthenticationTokens::m_accessToken), BehaviorValueSetter(&AuthenticationTokens::m_accessToken))
|
||||
->Property("OpenIdToken", BehaviorValueGetter(&AuthenticationTokens::m_openIdToken), BehaviorValueSetter(&AuthenticationTokens::m_accessToken))
|
||||
->Property("RefreshToken", BehaviorValueGetter(&AuthenticationTokens::m_refreshToken), BehaviorValueSetter(&AuthenticationTokens::m_accessToken));
|
||||
}
|
||||
}
|
||||
} // namespace AWSClientAuth
|
||||
|
||||
@@ -71,15 +71,15 @@ namespace AWSClientAuth
|
||||
|
||||
if (m_awsAccountId.empty() || m_cognitoIdentityPoolId.empty())
|
||||
{
|
||||
AZ_Warning("AWSCognitoUserManagementController", m_awsAccountId.empty(), "Missing AWS account id in resource mappings.");
|
||||
AZ_Warning("AWSCognitoUserManagementController", m_cognitoIdentityPoolId.empty(), "Missing Cognito Identity pool id in resource mappings.");
|
||||
AZ_Warning("AWSCognitoAuthorizationController", !m_awsAccountId.empty(), "Missing AWS account id not configured.");
|
||||
AZ_Warning("AWSCognitoAuthorizationController", !m_cognitoIdentityPoolId.empty(), "Missing Cognito Identity pool id in resource mappings.");
|
||||
return false;
|
||||
}
|
||||
|
||||
AZStd::string userPoolId;
|
||||
AWSCore::AWSResourceMappingRequestBus::BroadcastResult(
|
||||
userPoolId, &AWSCore::AWSResourceMappingRequests::GetResourceNameId, CognitoUserPoolIdResourceMappingKey);
|
||||
AZ_Warning("AWSCognitoUserManagementController", userPoolId.empty(), "Missing Cognito USer pool id in resource mappings. Cognito IDP authenticated identities will no work.");
|
||||
AZ_Warning("AWSCognitoAuthorizationController", !userPoolId.empty(), "Missing Cognito User pool id in resource mappings. Cognito IDP authenticated identities will no work.");
|
||||
|
||||
AZStd::string defaultRegion;
|
||||
AWSCore::AWSResourceMappingRequestBus::BroadcastResult(
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ namespace AWSClientAuth
|
||||
AWSCore::AWSResourceMappingRequestBus::BroadcastResult(
|
||||
m_cognitoAppClientId, &AWSCore::AWSResourceMappingRequests::GetResourceNameId, CognitoAppClientIdResourceMappingKey);
|
||||
AZ_Warning(
|
||||
"AWSCognitoUserManagementController", m_cognitoAppClientId.empty(), "Missing Cognito App Client Id from resource mappings. Calls to Cognito will fail.");
|
||||
"AWSCognitoUserManagementController", !m_cognitoAppClientId.empty(), "Missing Cognito App Client Id from resource mappings. Calls to Cognito will fail.");
|
||||
return !m_cognitoAppClientId.empty();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AWSClientAuthGemMock.h>
|
||||
#include <Authentication/AuthenticationProviderManager.h>
|
||||
|
||||
namespace AWSClientAuthUnitTest
|
||||
{
|
||||
class AuthenticationProviderManagerLocalMock
|
||||
: public AWSClientAuth::AuthenticationProviderManager
|
||||
{
|
||||
public:
|
||||
using AWSClientAuth::AuthenticationProviderManager::DeviceCodeGrantConfirmSignInAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::DeviceCodeGrantSignInAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::GetAuthenticationTokens;
|
||||
using AWSClientAuth::AuthenticationProviderManager::GetTokensWithRefreshAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::Initialize;
|
||||
using AWSClientAuth::AuthenticationProviderManager::IsSignedIn;
|
||||
using AWSClientAuth::AuthenticationProviderManager::m_authenticationProvidersMap;
|
||||
using AWSClientAuth::AuthenticationProviderManager::PasswordGrantMultiFactorConfirmSignInAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::PasswordGrantMultiFactorSignInAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::PasswordGrantSingleFactorSignInAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::RefreshTokensAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::SignOut;
|
||||
|
||||
AZStd::unique_ptr<AWSClientAuth::AuthenticationProviderInterface> CreateAuthenticationProviderObjectMock(
|
||||
const AWSClientAuth::ProviderNameEnum& providerName)
|
||||
{
|
||||
auto providerObject = AWSClientAuth::AuthenticationProviderManager::CreateAuthenticationProviderObject(providerName);
|
||||
providerObject.reset();
|
||||
return AZStd::make_unique<testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>>();
|
||||
}
|
||||
|
||||
AuthenticationProviderManagerLocalMock()
|
||||
{
|
||||
ON_CALL(*this, CreateAuthenticationProviderObject(testing::_))
|
||||
.WillByDefault(testing::Invoke(this, &AuthenticationProviderManagerLocalMock::CreateAuthenticationProviderObjectMock));
|
||||
}
|
||||
|
||||
MOCK_METHOD1(
|
||||
CreateAuthenticationProviderObject,
|
||||
AZStd::unique_ptr<AWSClientAuth::AuthenticationProviderInterface>(const AWSClientAuth::ProviderNameEnum&));
|
||||
};
|
||||
} // namespace AWSClientAuthUnitTest
|
||||
+261
@@ -0,0 +1,261 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/std/smart_ptr/unique_ptr.h>
|
||||
#include <AzCore/std/smart_ptr/make_shared.h>
|
||||
#include <AzCore/std/utils.h>
|
||||
#include <Authentication/AuthenticationProviderManager.h>
|
||||
#include <Authentication/AWSCognitoAuthenticationProvider.h>
|
||||
#include <Authentication/LWAAuthenticationProvider.h>
|
||||
#include <Authentication/AuthenticationTokens.h>
|
||||
#include <Authentication/AuthenticationProviderTypes.h>
|
||||
#include <AWSClientAuthGemMock.h>
|
||||
#include <Authentication/AuthenticationProviderManagerMock.h>
|
||||
|
||||
|
||||
class AuthenticationProviderManagerScriptCanvasTest
|
||||
: public AWSClientAuthUnitTest::AWSClientAuthGemAllocatorFixture
|
||||
{
|
||||
protected:
|
||||
void SetUp() override
|
||||
{
|
||||
AWSClientAuthUnitTest::AWSClientAuthGemAllocatorFixture::SetUp();
|
||||
|
||||
AWSClientAuth::LWAProviderSetting::Reflect(*m_serializeContext);
|
||||
AWSClientAuth::GoogleProviderSetting::Reflect(*m_serializeContext);
|
||||
|
||||
m_settingspath = AZStd::string::format("%s/%s/authenticationProvider.setreg",
|
||||
m_testFolder->c_str(), AZ::SettingsRegistryInterface::RegistryFolder);
|
||||
CreateTestFile("authenticationProvider.setreg"
|
||||
, R"({
|
||||
"AWS":
|
||||
{
|
||||
"LoginWithAmazon":
|
||||
{
|
||||
"AppClientId": "TestLWAClientId",
|
||||
"GrantType": "device_code",
|
||||
"Scope": "profile",
|
||||
"ResponseType": "device_code",
|
||||
"OAuthCodeURL": "https://api.amazon.com/auth/o2/create/codepair",
|
||||
"OAuthTokensURL": "https://oauth2.googleapis.com/token"
|
||||
},
|
||||
"Google":
|
||||
{
|
||||
"AppClientId": "TestGoogleClientId",
|
||||
"ClientSecret": "123",
|
||||
"GrantType": "urn:ietf:params:oauth:grant-type:device_code",
|
||||
"Scope": "profile",
|
||||
"OAuthCodeURL": "https://oauth2.googleapis.com/device/code",
|
||||
"OAuthTokensURL": "https://oauth2.googleapis.com/token"
|
||||
}
|
||||
}
|
||||
})");
|
||||
|
||||
m_mockController = AZStd::make_unique<testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderManagerLocalMock>>();
|
||||
}
|
||||
|
||||
void TearDown() override
|
||||
{
|
||||
m_mockController.reset();
|
||||
AWSClientAuthUnitTest::AWSClientAuthGemAllocatorFixture::TearDown();
|
||||
}
|
||||
|
||||
public:
|
||||
AZStd::unique_ptr<testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderManagerLocalMock>> m_mockController;
|
||||
AZStd::string m_settingspath;
|
||||
AZStd::vector<AZStd::string> m_enabledProviderNames { AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP,
|
||||
AWSClientAuth::ProvideNameEnumStringLoginWithAmazon, AWSClientAuth::ProvideNameEnumStringGoogle};
|
||||
};
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, Initialize_Success)
|
||||
{
|
||||
ASSERT_TRUE(m_mockController->Initialize(m_enabledProviderNames, m_settingspath));
|
||||
ASSERT_TRUE(m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP] != nullptr);
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantSingleFactorSignInAsync_Success)
|
||||
{
|
||||
m_mockController->Initialize(m_enabledProviderNames, m_settingspath);
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock> *cognitoProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get();
|
||||
|
||||
EXPECT_CALL(*cognitoProviderMock, PasswordGrantSingleFactorSignInAsync(testing::_, testing::_)).Times(1);
|
||||
m_mockController->PasswordGrantSingleFactorSignInAsync(AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP, AWSClientAuthUnitTest::TEST_USERNAME, AWSClientAuthUnitTest::TEST_PASSWORD);
|
||||
cognitoProviderMock = nullptr;
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantSingleFactorSignInAsync_Fail_NonConfiguredProviderError)
|
||||
{
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
m_mockController->PasswordGrantSingleFactorSignInAsync(AWSClientAuth::ProvideNameEnumStringApple, AWSClientAuthUnitTest::TEST_USERNAME, AWSClientAuthUnitTest::TEST_PASSWORD);
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantMultiFactorSignInAsync_Success)
|
||||
{
|
||||
m_mockController->Initialize(m_enabledProviderNames, m_settingspath);
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>* cognitoProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get();
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>* lwaProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get();
|
||||
|
||||
EXPECT_CALL(*cognitoProviderMock, PasswordGrantMultiFactorSignInAsync(testing::_, testing::_)).Times(1);
|
||||
m_mockController->PasswordGrantMultiFactorSignInAsync(AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP, AWSClientAuthUnitTest::TEST_USERNAME, AWSClientAuthUnitTest::TEST_PASSWORD);
|
||||
|
||||
EXPECT_CALL(*lwaProviderMock, PasswordGrantMultiFactorSignInAsync(testing::_, testing::_)).Times(1);
|
||||
m_mockController->PasswordGrantMultiFactorSignInAsync(AWSClientAuth::ProvideNameEnumStringLoginWithAmazon, AWSClientAuthUnitTest::TEST_USERNAME, AWSClientAuthUnitTest::TEST_PASSWORD);
|
||||
|
||||
cognitoProviderMock = nullptr;
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantMultiFactorConfirmSignInAsync_Success)
|
||||
{
|
||||
m_mockController->Initialize(m_enabledProviderNames, m_settingspath);
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock> *cognitoProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get();
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock> *lwaProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get();
|
||||
|
||||
EXPECT_CALL(*cognitoProviderMock, PasswordGrantMultiFactorConfirmSignInAsync(testing::_, testing::_)).Times(1);
|
||||
m_mockController->PasswordGrantMultiFactorConfirmSignInAsync(AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP, AWSClientAuthUnitTest::TEST_USERNAME, AWSClientAuthUnitTest::TEST_PASSWORD);
|
||||
|
||||
EXPECT_CALL(*lwaProviderMock, PasswordGrantMultiFactorConfirmSignInAsync(testing::_, testing::_)).Times(1);
|
||||
m_mockController->PasswordGrantMultiFactorConfirmSignInAsync(AWSClientAuth::ProvideNameEnumStringLoginWithAmazon, AWSClientAuthUnitTest::TEST_USERNAME, AWSClientAuthUnitTest::TEST_PASSWORD);
|
||||
|
||||
cognitoProviderMock = nullptr;
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, DeviceCodeGrantSignInAsync_Success)
|
||||
{
|
||||
m_mockController->Initialize(m_enabledProviderNames, m_settingspath);
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>* cognitoProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get();
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>* lwaProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get();
|
||||
|
||||
EXPECT_CALL(*cognitoProviderMock, DeviceCodeGrantSignInAsync()).Times(1);
|
||||
m_mockController->DeviceCodeGrantSignInAsync(AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP);
|
||||
|
||||
EXPECT_CALL(*lwaProviderMock, DeviceCodeGrantSignInAsync()).Times(1);
|
||||
m_mockController->DeviceCodeGrantSignInAsync(AWSClientAuth::ProvideNameEnumStringLoginWithAmazon);
|
||||
|
||||
cognitoProviderMock = nullptr;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, DeviceCodeGrantConfirmSignInAsync_Success)
|
||||
{
|
||||
m_mockController->Initialize(m_enabledProviderNames, m_settingspath);
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>* cognitoProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get();
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>* lwaProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get();
|
||||
|
||||
EXPECT_CALL(*cognitoProviderMock, DeviceCodeGrantConfirmSignInAsync()).Times(1);
|
||||
m_mockController->DeviceCodeGrantConfirmSignInAsync(AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP);
|
||||
|
||||
EXPECT_CALL(*lwaProviderMock, DeviceCodeGrantConfirmSignInAsync()).Times(1);
|
||||
m_mockController->DeviceCodeGrantConfirmSignInAsync(AWSClientAuth::ProvideNameEnumStringLoginWithAmazon);
|
||||
|
||||
cognitoProviderMock = nullptr;
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, RefreshTokenAsync_Success)
|
||||
{
|
||||
m_mockController->Initialize(m_enabledProviderNames, m_settingspath);
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock> *cognitoProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get();
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock> *lwaProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get();
|
||||
|
||||
EXPECT_CALL(*cognitoProviderMock, RefreshTokensAsync()).Times(1);
|
||||
m_mockController->RefreshTokensAsync(AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP);
|
||||
|
||||
EXPECT_CALL(*lwaProviderMock, RefreshTokensAsync()).Times(1);
|
||||
m_mockController->RefreshTokensAsync(AWSClientAuth::ProvideNameEnumStringLoginWithAmazon);
|
||||
|
||||
cognitoProviderMock = nullptr;
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokensWithRefreshAsync_ValidToken_Success)
|
||||
{
|
||||
m_mockController->Initialize(m_enabledProviderNames, m_settingspath);
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>* cognitoProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get();
|
||||
|
||||
AWSClientAuth::AuthenticationTokens tokens(
|
||||
AWSClientAuthUnitTest::TEST_TOKEN, AWSClientAuthUnitTest::TEST_TOKEN, AWSClientAuthUnitTest::TEST_TOKEN,
|
||||
AWSClientAuth::ProviderNameEnum::AWSCognitoIDP, 600);
|
||||
EXPECT_CALL(*cognitoProviderMock, GetAuthenticationTokens()).Times(1).WillOnce(testing::Return(tokens));
|
||||
EXPECT_CALL(*cognitoProviderMock, RefreshTokensAsync()).Times(0);
|
||||
EXPECT_CALL(m_authenticationProviderNotificationsBusMock, OnRefreshTokensSuccess(testing::_)).Times(1);
|
||||
m_mockController->GetTokensWithRefreshAsync(AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP);
|
||||
|
||||
cognitoProviderMock = nullptr;
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokensWithRefreshAsync_InvalidToken_Success)
|
||||
{
|
||||
m_mockController->Initialize(m_enabledProviderNames, m_settingspath);
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>* cognitoProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get();
|
||||
AWSClientAuth::AuthenticationTokens tokens;
|
||||
EXPECT_CALL(*cognitoProviderMock, GetAuthenticationTokens()).Times(1).WillOnce(testing::Return(tokens));
|
||||
EXPECT_CALL(*cognitoProviderMock, RefreshTokensAsync()).Times(1);
|
||||
m_mockController->GetTokensWithRefreshAsync(AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP);
|
||||
|
||||
cognitoProviderMock = nullptr;
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokensWithRefreshAsync_NotInitializedProvider_Fail)
|
||||
{
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
EXPECT_CALL(m_authenticationProviderNotificationsBusMock, OnRefreshTokensSuccess(testing::_)).Times(0);
|
||||
EXPECT_CALL(m_authenticationProviderNotificationsBusMock, OnRefreshTokensFail(testing::_)).Times(1);
|
||||
m_mockController->GetTokensWithRefreshAsync(AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP);
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokens_Success)
|
||||
{
|
||||
m_mockController->Initialize(m_enabledProviderNames, m_settingspath);
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>* cognitoProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get();
|
||||
|
||||
AWSClientAuth::AuthenticationTokens tokens(
|
||||
AWSClientAuthUnitTest::TEST_TOKEN, AWSClientAuthUnitTest::TEST_TOKEN, AWSClientAuthUnitTest::TEST_TOKEN,
|
||||
AWSClientAuth::ProviderNameEnum::AWSCognitoIDP, 60);
|
||||
|
||||
EXPECT_CALL(*cognitoProviderMock, GetAuthenticationTokens()).Times(1).WillOnce(testing::Return(tokens));
|
||||
m_mockController->GetAuthenticationTokens(AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP);
|
||||
|
||||
cognitoProviderMock = nullptr;
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, IsSignedIn_Success)
|
||||
{
|
||||
m_mockController->Initialize(m_enabledProviderNames, m_settingspath);
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>* cognitoProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get();
|
||||
|
||||
AWSClientAuth::AuthenticationTokens tokens(
|
||||
AWSClientAuthUnitTest::TEST_TOKEN, AWSClientAuthUnitTest::TEST_TOKEN, AWSClientAuthUnitTest::TEST_TOKEN,
|
||||
AWSClientAuth::ProviderNameEnum::AWSCognitoIDP, 60);
|
||||
EXPECT_CALL(*cognitoProviderMock, GetAuthenticationTokens()).Times(1).WillOnce(testing::Return(tokens));
|
||||
m_mockController->IsSignedIn(AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP);
|
||||
|
||||
cognitoProviderMock = nullptr;
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, SignOut_Success)
|
||||
{
|
||||
m_mockController->Initialize(m_enabledProviderNames, m_settingspath);
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>* googleProviderMock = (testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::Google].get();
|
||||
|
||||
EXPECT_CALL(*googleProviderMock, SignOut()).Times(1);
|
||||
EXPECT_CALL(m_authenticationProviderNotificationsBusMock, OnSignOut(testing::_)).Times(1);
|
||||
m_mockController->SignOut(AWSClientAuth::ProvideNameEnumStringGoogle);
|
||||
|
||||
googleProviderMock = nullptr;
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerScriptCanvasTest, Initialize_Fail_InvalidPath)
|
||||
{
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
ASSERT_FALSE(m_mockController->Initialize(m_enabledProviderNames, ""));
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
|
||||
}
|
||||
+10
-38
@@ -10,8 +10,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzTest/AzTest.h>
|
||||
#include <AzCore/UnitTest/TestTypes.h>
|
||||
#include <AzCore/std/smart_ptr/unique_ptr.h>
|
||||
#include <AzCore/std/smart_ptr/make_shared.h>
|
||||
#include <AzCore/std/utils.h>
|
||||
@@ -20,42 +18,7 @@
|
||||
#include <Authentication/LWAAuthenticationProvider.h>
|
||||
#include <Authentication/AuthenticationTokens.h>
|
||||
#include <AWSClientAuthGemMock.h>
|
||||
|
||||
namespace AWSClientAuthUnitTest
|
||||
{
|
||||
class AuthenticationProviderManagerLocalMock
|
||||
: public AWSClientAuth::AuthenticationProviderManager
|
||||
{
|
||||
public:
|
||||
using AWSClientAuth::AuthenticationProviderManager::m_authenticationProvidersMap;
|
||||
using AWSClientAuth::AuthenticationProviderManager::Initialize;
|
||||
using AWSClientAuth::AuthenticationProviderManager::PasswordGrantSingleFactorSignInAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::PasswordGrantMultiFactorSignInAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::PasswordGrantMultiFactorConfirmSignInAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::DeviceCodeGrantSignInAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::DeviceCodeGrantConfirmSignInAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::RefreshTokensAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::GetTokensWithRefreshAsync;
|
||||
using AWSClientAuth::AuthenticationProviderManager::GetAuthenticationTokens;
|
||||
using AWSClientAuth::AuthenticationProviderManager::SignOut;
|
||||
using AWSClientAuth::AuthenticationProviderManager::IsSignedIn;
|
||||
|
||||
AZStd::unique_ptr<AWSClientAuth::AuthenticationProviderInterface> CreateAuthenticationProviderObjectMock(const AWSClientAuth::ProviderNameEnum& providerName)
|
||||
{
|
||||
auto providerObject = AWSClientAuth::AuthenticationProviderManager::CreateAuthenticationProviderObject(providerName);
|
||||
providerObject.reset();
|
||||
return AZStd::make_unique<testing::NiceMock<AWSClientAuthUnitTest::AuthenticationProviderMock>>();
|
||||
}
|
||||
|
||||
AuthenticationProviderManagerLocalMock()
|
||||
{
|
||||
ON_CALL(*this, CreateAuthenticationProviderObject(testing::_)).WillByDefault(
|
||||
testing::Invoke(this, &AuthenticationProviderManagerLocalMock::CreateAuthenticationProviderObjectMock));
|
||||
}
|
||||
|
||||
MOCK_METHOD1(CreateAuthenticationProviderObject, AZStd::unique_ptr<AWSClientAuth::AuthenticationProviderInterface>(const AWSClientAuth::ProviderNameEnum&));
|
||||
};
|
||||
}
|
||||
#include <Authentication/AuthenticationProviderManagerMock.h>
|
||||
|
||||
|
||||
class AuthenticationProviderManagerTest
|
||||
@@ -239,6 +202,15 @@ TEST_F(AuthenticationProviderManagerTest, GetTokensWithRefreshAsync_InvalidToken
|
||||
cognitoProviderMock = nullptr;
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerTest, GetTokensWithRefreshAsync_NotInitializedProvider_Fail)
|
||||
{
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
EXPECT_CALL(m_authenticationProviderNotificationsBusMock, OnRefreshTokensSuccess(testing::_)).Times(0);
|
||||
EXPECT_CALL(m_authenticationProviderNotificationsBusMock, OnRefreshTokensFail(testing::_)).Times(1);
|
||||
m_mockController->GetTokensWithRefreshAsync(AWSClientAuth::ProviderNameEnum::AWSCognitoIDP);
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
|
||||
}
|
||||
|
||||
TEST_F(AuthenticationProviderManagerTest, GetTokens_Success)
|
||||
{
|
||||
m_mockController->Initialize(m_enabledProviderNames, m_settingspath);
|
||||
|
||||
@@ -20,6 +20,7 @@ set(FILES
|
||||
Include/Private/AWSClientAuthBus.h
|
||||
Include/Private/AWSClientAuthResourceMappingConstants.h
|
||||
Include/Private/Authentication/AuthenticationProviderTypes.h
|
||||
Include/Private/Authentication/AuthenticationProviderScriptCanvasBus.h
|
||||
Include/Private/Authentication/AuthenticationProviderManager.h
|
||||
Include/Private/Authentication/AuthenticationNotificationBusBehaviorHandler.h
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ set(FILES
|
||||
Tests/AWSClientAuthGemTest.cpp
|
||||
|
||||
Tests/AWSClientAuthSystemComponentTest.cpp
|
||||
Tests/Authentication/AuthenticationProviderManagerMock.h
|
||||
Tests/Authentication/AuthenticationProviderManagerTest.cpp
|
||||
Tests/Authentication/AuthenticationProviderManagerScriptCanvasBusTest.cpp
|
||||
Tests/Authentication/AWSCognitoAuthenticationProviderTest.cpp
|
||||
Tests/Authentication/LWAAuthenticationProviderTest.cpp
|
||||
Tests/Authentication/GoogleAuthenticationProviderTest.cpp
|
||||
|
||||
@@ -56,8 +56,7 @@ class CognitoIdentityPoolRole:
|
||||
# basic permissions
|
||||
stack_statement = iam.PolicyStatement(
|
||||
actions=[
|
||||
's3:Get*',
|
||||
's3:List*'
|
||||
's3:ListBuckets'
|
||||
],
|
||||
effect=iam.Effect.ALLOW,
|
||||
resources=[
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace AZ
|
||||
AZStd::string expectedHigherPrecedenceFileFullPath;
|
||||
AzFramework::StringFunc::Path::Join(gameProjectPath, RPI::ShaderVariantTreeAsset::CommonSubFolder, expectedHigherPrecedenceFileFullPath, false /* handle directory overlap? */, false /* be case insensitive? */);
|
||||
AzFramework::StringFunc::Path::Join(expectedHigherPrecedenceFileFullPath.c_str(), shaderProductFileRelativePath.c_str(), expectedHigherPrecedenceFileFullPath, false /* handle directory overlap? */, false /* be case insensitive? */);
|
||||
AzFramework::StringFunc::Path::ReplaceExtension(expectedHigherPrecedenceFileFullPath, AZ::RPI::ShaderVariantAsset::Extension);
|
||||
AzFramework::StringFunc::Path::ReplaceExtension(expectedHigherPrecedenceFileFullPath, AZ::RPI::ShaderVariantListSourceData::Extension);
|
||||
AzFramework::StringFunc::Path::Normalize(expectedHigherPrecedenceFileFullPath);
|
||||
|
||||
AZStd::string normalizedShaderVariantListFileFullPath = shaderVariantListFileFullPath;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <RayTracing/RayTracingFeatureProcessor.h>
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
#include <AtomCore/std/parallel/concurrency_checker.h>
|
||||
#include <AzCore/Console/Console.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -160,8 +161,14 @@ namespace AZ
|
||||
|
||||
// called when reflection probes are modified in the editor so that meshes can re-evaluate their probes
|
||||
void UpdateMeshReflectionProbes();
|
||||
|
||||
private:
|
||||
void ForceRebuildDrawPackets(const AZ::ConsoleCommandContainer& arguments);
|
||||
AZ_CONSOLEFUNC(MeshFeatureProcessor,
|
||||
ForceRebuildDrawPackets,
|
||||
AZ::ConsoleFunctorFlags::Null,
|
||||
"(For Testing) Invalidates all mesh draw packets, causing them to rebuild on the next frame."
|
||||
);
|
||||
|
||||
MeshFeatureProcessor(const MeshFeatureProcessor&) = delete;
|
||||
|
||||
// RPI::SceneNotificationBus::Handler overrides...
|
||||
|
||||
@@ -289,7 +289,7 @@ namespace AZ
|
||||
void AuxGeomDrawQueue::DrawQuad(
|
||||
float width,
|
||||
float height,
|
||||
const AZ::Transform& transform,
|
||||
const AZ::Matrix3x4& transform,
|
||||
const AZ::Color& color,
|
||||
DrawStyle style,
|
||||
DepthTest depthTest,
|
||||
@@ -302,8 +302,8 @@ namespace AZ
|
||||
return;
|
||||
}
|
||||
|
||||
Transform noScaleTransform = transform;
|
||||
noScaleTransform.ExtractScale();
|
||||
AZ::Matrix3x4 noScaleTransform = transform;
|
||||
AZ::Vector3 scale = noScaleTransform.ExtractScale();
|
||||
|
||||
ShapeBufferEntry shape;
|
||||
shape.m_shapeType = ShapeType_Quad;
|
||||
@@ -311,9 +311,9 @@ namespace AZ
|
||||
shape.m_depthWrite = ConvertRPIDepthWriteFlag(depthWrite);
|
||||
shape.m_faceCullMode = ConvertRPIFaceCullFlag(faceCull);
|
||||
shape.m_color = color;
|
||||
shape.m_rotationMatrix = Matrix3x3::CreateFromTransform(noScaleTransform);
|
||||
shape.m_rotationMatrix = Matrix3x3::CreateFromMatrix3x4(noScaleTransform);
|
||||
shape.m_position = transform.GetTranslation();
|
||||
shape.m_scale = transform.GetScale() * Vector3(width, 1.0f, height);
|
||||
shape.m_scale = scale * Vector3(width, 1.0f, height);
|
||||
shape.m_pointSize = m_pointSize;
|
||||
shape.m_viewProjOverrideIndex = viewProjOverrideIndex;
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace AZ
|
||||
void DrawTriangles(const AuxGeomDynamicIndexedDrawArguments& args, FaceCullMode faceCull = FaceCullMode::None) override;
|
||||
|
||||
// Fixed shape draws
|
||||
void DrawQuad(float width, float height, const AZ::Transform& transform, const AZ::Color& color, DrawStyle style, DepthTest depthTest, DepthWrite depthWrite, FaceCullMode faceCull, int32_t viewProjOverrideIndex) override;
|
||||
void DrawQuad(float width, float height, const AZ::Matrix3x4& transform, const AZ::Color& color, DrawStyle style, DepthTest depthTest, DepthWrite depthWrite, FaceCullMode faceCull, int32_t viewProjOverrideIndex) override;
|
||||
void DrawSphere(const AZ::Vector3& center, float radius, const AZ::Color& color, DrawStyle style, DepthTest depthTest, DepthWrite depthWrite, FaceCullMode faceCull, int32_t viewProjOverrideIndex) override;
|
||||
void DrawDisk(const AZ::Vector3& center, const AZ::Vector3& direction, float radius, const AZ::Color& color, DrawStyle style, DepthTest depthTest, DepthWrite depthWrite, FaceCullMode faceCull, int32_t viewProjOverrideIndex) override;
|
||||
void DrawCone(const AZ::Vector3& center, const AZ::Vector3& direction, float radius, float height, const AZ::Color& color, DrawStyle style, DepthTest depthTest, DepthWrite depthWrite, FaceCullMode faceCull, int32_t viewProjOverrideIndex) override;
|
||||
|
||||
@@ -387,6 +387,11 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
void MeshFeatureProcessor::ForceRebuildDrawPackets([[maybe_unused]] const AZ::ConsoleCommandContainer& arguments)
|
||||
{
|
||||
m_forceRebuildDrawPackets = true;
|
||||
}
|
||||
|
||||
void MeshFeatureProcessor::OnRenderPipelineAdded(RPI::RenderPipelinePtr pipeline)
|
||||
{
|
||||
m_forceRebuildDrawPackets = true;;
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace AZ
|
||||
//! @param depthWrite If depth writing should be enabled
|
||||
//! @param faceCull Which (if any) facing triangles should be culled
|
||||
//! @param viewProjOverrideIndex Which view projection override entry to use, -1 if unused
|
||||
virtual void DrawQuad(float width, float height, const AZ::Transform& transform, const AZ::Color& color, DrawStyle style = DrawStyle::Shaded, DepthTest depthTest = DepthTest::On, DepthWrite depthWrite = DepthWrite::On, FaceCullMode faceCull = FaceCullMode::Back, int32_t viewProjOverrideIndex = -1) = 0;
|
||||
virtual void DrawQuad(float width, float height, const AZ::Matrix3x4& transform, const AZ::Color& color, DrawStyle style = DrawStyle::Shaded, DepthTest depthTest = DepthTest::On, DepthWrite depthWrite = DepthWrite::On, FaceCullMode faceCull = FaceCullMode::Back, int32_t viewProjOverrideIndex = -1) = 0;
|
||||
|
||||
//! Draw a sphere.
|
||||
//! @param center The center of the sphere.
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace AZ
|
||||
AssetBuilderSDK::AssetBuilderDesc builderDescriptor;
|
||||
|
||||
builderDescriptor.m_name = "Atom Resource Pool Asset Builder";
|
||||
builderDescriptor.m_version = 1;
|
||||
builderDescriptor.m_version = 2; //ATOM-15196
|
||||
builderDescriptor.m_patterns.emplace_back(AssetBuilderSDK::AssetBuilderPattern(AZStd::string("*.") + s_sourcePoolAssetExt,
|
||||
AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard));
|
||||
builderDescriptor.m_busId = azrtti_typeid<ResourcePoolBuilder>();
|
||||
|
||||
@@ -17,11 +17,20 @@
|
||||
#include <Atom/RPI.Public/Scene.h>
|
||||
#include <Atom/RPI.Reflect/Material/MaterialFunctor.h>
|
||||
#include <Atom/RHI/DrawPacketBuilder.h>
|
||||
#include <AzCore/Console/Console.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace RPI
|
||||
{
|
||||
AZ_CVAR(bool,
|
||||
r_forceRootShaderVariantUsage,
|
||||
false,
|
||||
[](const bool&) { AZ::Interface<AZ::IConsole>::Get()->PerformCommand("MeshFeatureProcessor.ForceRebuildDrawPackets"); },
|
||||
ConsoleFunctorFlags::Null,
|
||||
"(For Testing) Forces usage of root shader variant in the mesh draw packet level, ignoring any other shader variants that may exist."
|
||||
);
|
||||
|
||||
MeshDrawPacket::MeshDrawPacket(
|
||||
ModelLod& modelLod,
|
||||
size_t modelLodMeshIndex,
|
||||
@@ -187,7 +196,7 @@ namespace AZ
|
||||
}
|
||||
|
||||
const ShaderVariantId finalVariantId = shaderOptions.GetShaderVariantId();
|
||||
const ShaderVariant& variant = shader->GetVariant(finalVariantId);
|
||||
const ShaderVariant& variant = r_forceRootShaderVariantUsage ? shader->GetRootVariant() : shader->GetVariant(finalVariantId);
|
||||
|
||||
Data::Instance<ShaderResourceGroup> drawSrg;
|
||||
if (drawSrgAsset)
|
||||
|
||||
+3
@@ -53,6 +53,9 @@ namespace MaterialEditor
|
||||
//! Modify camera's field of view
|
||||
//! @param value field of view in degrees
|
||||
virtual void SetFieldOfView(float value) = 0;
|
||||
|
||||
//! Check if camera is looking directly at a model
|
||||
virtual bool IsCameraCentered() const = 0;
|
||||
};
|
||||
|
||||
using MaterialEditorViewportInputControllerRequestBus = AZ::EBus<MaterialEditorViewportInputControllerRequests>;
|
||||
|
||||
@@ -76,11 +76,35 @@ namespace MaterialEditor
|
||||
void Behavior::TickInternal([[maybe_unused]] float x, [[maybe_unused]] float y, float z)
|
||||
{
|
||||
m_distanceToTarget = m_distanceToTarget - z;
|
||||
|
||||
bool isCameraCentered = false;
|
||||
MaterialEditorViewportInputControllerRequestBus::BroadcastResult(
|
||||
isCameraCentered,
|
||||
&MaterialEditorViewportInputControllerRequestBus::Handler::IsCameraCentered);
|
||||
|
||||
// if camera is looking at the model (locked to the model) we don't want to zoom past the model's center
|
||||
if (isCameraCentered)
|
||||
{
|
||||
m_distanceToTarget = AZ::GetMax(m_distanceToTarget, 0.0f);
|
||||
}
|
||||
|
||||
AZ::Transform transform = AZ::Transform::CreateIdentity();
|
||||
AZ::TransformBus::EventResult(transform, m_cameraEntityId, &AZ::TransformBus::Events::GetLocalTM);
|
||||
AZ::Vector3 position = m_targetPosition -
|
||||
transform.GetRotation().TransformVector(AZ::Vector3::CreateAxisY(m_distanceToTarget));
|
||||
AZ::TransformBus::Event(m_cameraEntityId, &AZ::TransformBus::Events::SetLocalTranslation, position);
|
||||
|
||||
// if camera is not locked to the model, move its focal point so we can free look
|
||||
if (!isCameraCentered)
|
||||
{
|
||||
m_targetPosition += transform.GetRotation().TransformVector(AZ::Vector3::CreateAxisY(z));
|
||||
MaterialEditorViewportInputControllerRequestBus::Broadcast(
|
||||
&MaterialEditorViewportInputControllerRequestBus::Handler::SetTargetPosition,
|
||||
m_targetPosition);
|
||||
MaterialEditorViewportInputControllerRequestBus::BroadcastResult(
|
||||
m_distanceToTarget,
|
||||
&MaterialEditorViewportInputControllerRequestBus::Handler::GetDistanceToTarget);
|
||||
}
|
||||
}
|
||||
|
||||
float Behavior::GetSensitivityX()
|
||||
|
||||
+13
@@ -96,6 +96,7 @@ namespace MaterialEditor
|
||||
void MaterialEditorViewportInputController::SetTargetPosition(const AZ::Vector3& targetPosition)
|
||||
{
|
||||
m_targetPosition = targetPosition;
|
||||
m_isCameraCentered = false;
|
||||
}
|
||||
|
||||
float MaterialEditorViewportInputController::GetDistanceToTarget() const
|
||||
@@ -246,6 +247,7 @@ namespace MaterialEditor
|
||||
cameraPosition = cameraRotation.TransformVector(cameraPosition);
|
||||
AZ::Transform cameraTransform = AZ::Transform::CreateFromQuaternionAndTranslation(cameraRotation, cameraPosition);
|
||||
AZ::TransformBus::Event(m_cameraEntityId, &AZ::TransformBus::Events::SetLocalTM, cameraTransform);
|
||||
m_isCameraCentered = true;
|
||||
|
||||
// reset model
|
||||
AZ::Transform modelTransform = AZ::Transform::CreateIdentity();
|
||||
@@ -258,6 +260,12 @@ namespace MaterialEditor
|
||||
AZ::RPI::ScenePtr scene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
auto skyBoxFeatureProcessorInterface = scene->GetFeatureProcessor<AZ::Render::SkyBoxFeatureProcessorInterface>();
|
||||
skyBoxFeatureProcessorInterface->SetCubemapRotationMatrix(rotationMatrix);
|
||||
|
||||
if (m_behavior)
|
||||
{
|
||||
m_behavior->End();
|
||||
m_behavior->Start();
|
||||
}
|
||||
}
|
||||
|
||||
void MaterialEditorViewportInputController::SetFieldOfView(float value)
|
||||
@@ -265,6 +273,11 @@ namespace MaterialEditor
|
||||
Camera::CameraRequestBus::Event(m_cameraEntityId, &Camera::CameraRequestBus::Events::SetFovDegrees, value);
|
||||
}
|
||||
|
||||
bool MaterialEditorViewportInputController::IsCameraCentered() const
|
||||
{
|
||||
return m_isCameraCentered;
|
||||
}
|
||||
|
||||
void MaterialEditorViewportInputController::CalculateExtents()
|
||||
{
|
||||
AZ::TransformBus::EventResult(m_modelCenter, m_targetEntityId, &AZ::TransformBus::Events::GetLocalTranslation);
|
||||
|
||||
+3
@@ -45,6 +45,7 @@ namespace MaterialEditor
|
||||
void GetExtents(float& distanceMin, float& distanceMax) const override;
|
||||
void Reset() override;
|
||||
void SetFieldOfView(float value) override;
|
||||
bool IsCameraCentered() const override;
|
||||
|
||||
// AzFramework::ViewportControllerInstance interface overrides...
|
||||
bool HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event) override;
|
||||
@@ -95,6 +96,8 @@ namespace MaterialEditor
|
||||
float m_distanceMin = 1.0f;
|
||||
//! Maximum distance from camera to target
|
||||
float m_distanceMax = 10.0f;
|
||||
//! True if camera is centered on a model
|
||||
bool m_isCameraCentered = true;
|
||||
|
||||
static constexpr float MaxDistanceMultiplier = 2.5f;
|
||||
static constexpr float StartingDistanceMultiplier = 2.0f;
|
||||
|
||||
+1
-3
@@ -34,10 +34,8 @@ namespace MaterialEditor
|
||||
targetPosition);
|
||||
}
|
||||
|
||||
void PanCameraBehavior::TickInternal(float x, float y, float z)
|
||||
void PanCameraBehavior::TickInternal(float x, float y, [[maybe_unused]] float z)
|
||||
{
|
||||
Behavior::TickInternal(x, y, z);
|
||||
|
||||
AZ::Transform transform = AZ::Transform::CreateIdentity();
|
||||
AZ::TransformBus::EventResult(transform, m_cameraEntityId, &AZ::TransformBus::Events::GetLocalTM);
|
||||
AZ::Quaternion rotation = transform.GetRotation();
|
||||
|
||||
+2
@@ -37,6 +37,8 @@ namespace MaterialEditor
|
||||
//Connect ok and cancel buttons
|
||||
QObject::connect(m_ui->m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||
QObject::connect(m_ui->m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
|
||||
setModal(true);
|
||||
}
|
||||
|
||||
void CreateMaterialDialog::InitMaterialTypeSelection()
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QMenu>
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
@@ -61,6 +62,8 @@ namespace MaterialEditor
|
||||
m_caller = nullptr;
|
||||
});
|
||||
|
||||
AddGenericContextMenuActions(caller, menu, entry);
|
||||
|
||||
if (entry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Source)
|
||||
{
|
||||
const auto source = azalias_cast<const SourceAssetBrowserEntry*>(entry);
|
||||
@@ -84,6 +87,18 @@ namespace MaterialEditor
|
||||
}
|
||||
}
|
||||
|
||||
void MaterialBrowserInteractions::AddGenericContextMenuActions([[maybe_unused]] QWidget* caller, QMenu* menu, const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry)
|
||||
{
|
||||
menu->addAction(QObject::tr("Copy Name To Clipboard"), [=]()
|
||||
{
|
||||
QApplication::clipboard()->setText(entry->GetName().c_str());
|
||||
});
|
||||
menu->addAction(QObject::tr("Copy Path To Clipboard"), [=]()
|
||||
{
|
||||
QApplication::clipboard()->setText(entry->GetFullPath().c_str());
|
||||
});
|
||||
}
|
||||
|
||||
void MaterialBrowserInteractions::AddContextMenuActionsForMaterialTypeSource(QWidget* caller, QMenu* menu, const AzToolsFramework::AssetBrowser::SourceAssetBrowserEntry* entry)
|
||||
{
|
||||
menu->addAction(AzQtComponents::fileBrowserActionName(), [entry]()
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace MaterialEditor
|
||||
//! AssetBrowserInteractionNotificationBus::Handler overrides...
|
||||
void AddContextMenuActions(QWidget* caller, QMenu* menu, const AZStd::vector<AzToolsFramework::AssetBrowser::AssetBrowserEntry*>& entries) override;
|
||||
|
||||
void AddGenericContextMenuActions(QWidget* caller, QMenu* menu, const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry);
|
||||
void AddContextMenuActionsForOtherSource(QWidget* caller, QMenu* menu, const AzToolsFramework::AssetBrowser::SourceAssetBrowserEntry* entry);
|
||||
void AddContextMenuActionsForMaterialSource(QWidget* caller, QMenu* menu, const AzToolsFramework::AssetBrowser::SourceAssetBrowserEntry* entry);
|
||||
void AddContextMenuActionsForMaterialTypeSource(QWidget* caller, QMenu* menu, const AzToolsFramework::AssetBrowser::SourceAssetBrowserEntry* entry);
|
||||
|
||||
+1
@@ -35,6 +35,7 @@ namespace MaterialEditor
|
||||
SetupPresetList();
|
||||
SetupSearchWidget();
|
||||
SetupDialogButtons();
|
||||
setModal(true);
|
||||
}
|
||||
|
||||
void PresetBrowserDialog::SetupPresetList()
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9d3c18d76f00688d15c54736ef3d8c953df08baf46a796fa71627de18bdb3c0f
|
||||
size 22804332
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6cbfc4d0a6722726070468da4368df7c76be67e8d067a7e3130fd29cdcdd5c6b
|
||||
size 7613840
|
||||
oid sha256:35a880abc018520d4b30d21a64f7a14fca74d936593320d5afd03ddf25771bf3
|
||||
size 9176416
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/arch_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,17 @@
|
||||
],
|
||||
"textureMap": "Textures/arch_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.885053813457489,
|
||||
0.801281750202179,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/arch_1k_metallic.png"
|
||||
},
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/background_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,23 @@
|
||||
],
|
||||
"textureMap": "Textures/background_1k_basecolor.png"
|
||||
},
|
||||
"clearCoat": {
|
||||
"enable": true,
|
||||
"factor": 0.5,
|
||||
"normalMap": "Textures/background_1k_normal.jpg",
|
||||
"roughness": 0.4000000059604645
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.8911573886871338,
|
||||
0.7894102334976196,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/background_1k_metallic.png"
|
||||
},
|
||||
@@ -24,7 +45,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.03099999949336052,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/bricks_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,23 @@
|
||||
],
|
||||
"textureMap": "Textures/bricks_1k_basecolor.png"
|
||||
},
|
||||
"clearCoat": {
|
||||
"enable": true,
|
||||
"factor": 0.5,
|
||||
"normalMap": "Textures/bricks_1k_normal.jpg",
|
||||
"roughness": 0.5
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.9703211784362793,
|
||||
0.9703211784362793,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/bricks_1k_metallic.png"
|
||||
},
|
||||
@@ -23,11 +44,9 @@
|
||||
"factor": 1.0
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"algorithm": "ContactRefinement",
|
||||
"factor": 0.03500000014901161,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
"quality": "Medium",
|
||||
"textureMap": "Textures/bricks_1k_height.png"
|
||||
},
|
||||
"roughness": {
|
||||
|
||||
@@ -4,17 +4,55 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/ceiling_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
0.800000011920929,
|
||||
0.800000011920929,
|
||||
1.0
|
||||
],
|
||||
"textureBlendMode": "Lerp",
|
||||
"textureMap": "Textures/ceiling_1k_basecolor.png"
|
||||
},
|
||||
"clearCoat": {
|
||||
"enable": true,
|
||||
"factor": 0.5,
|
||||
"influenceMap": "Textures/ceiling_1k_ao.png",
|
||||
"normalMap": "Textures/ceiling_1k_normal.png",
|
||||
"roughness": 0.30000001192092898
|
||||
},
|
||||
"emissive": {
|
||||
"color": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.7591058015823364,
|
||||
0.43776607513427737,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"normal": {
|
||||
"textureMap": "Textures/ceiling_1k_normal.png"
|
||||
},
|
||||
"opacity": {
|
||||
"factor": 1.0
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "ContactRefinement",
|
||||
"factor": 0.019999999552965165,
|
||||
"pdo": true,
|
||||
"quality": "Medium",
|
||||
"textureMap": "Textures/ceiling_1k_height.png"
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/ceiling_1k_roughness.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,17 @@
|
||||
],
|
||||
"textureMap": "Textures/chain_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
0.4891279339790344,
|
||||
0.7931944727897644,
|
||||
1.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/chain_alpha.png"
|
||||
},
|
||||
@@ -21,7 +32,7 @@
|
||||
},
|
||||
"opacity": {
|
||||
"alphaSource": "Split",
|
||||
"factor": 1.0,
|
||||
"factor": 0.30000001192092898,
|
||||
"mode": "Cutout",
|
||||
"textureMap": "Textures/chain_alpha.png"
|
||||
},
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/columnA_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,23 @@
|
||||
],
|
||||
"textureMap": "Textures/columnA_1k_basecolor.png"
|
||||
},
|
||||
"clearCoat": {
|
||||
"enable": true,
|
||||
"factor": 0.5,
|
||||
"normalMap": "Textures/columnA_1k_normal.jpg",
|
||||
"roughness": 0.30000001192092898
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.8964369893074036,
|
||||
0.8264744281768799,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/columnA_1k_metallic.png"
|
||||
},
|
||||
@@ -24,7 +45,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.017000000923871995,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/columnB_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,23 @@
|
||||
],
|
||||
"textureMap": "Textures/columnB_1k_basecolor.png"
|
||||
},
|
||||
"clearCoat": {
|
||||
"enable": true,
|
||||
"factor": 0.5,
|
||||
"normalMap": "Textures/columnB_1k_normal.jpg",
|
||||
"roughness": 0.30000001192092898
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.9015335440635681,
|
||||
0.8348516225814819,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/columnB_1k_metallic.png"
|
||||
},
|
||||
@@ -23,7 +44,6 @@
|
||||
"factor": 1.0
|
||||
},
|
||||
"parallax": {
|
||||
"enable": true,
|
||||
"factor": 0.020999999716877939,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/columnC_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,23 @@
|
||||
],
|
||||
"textureMap": "Textures/columnC_1k_basecolor.png"
|
||||
},
|
||||
"clearCoat": {
|
||||
"enable": true,
|
||||
"factor": 0.5,
|
||||
"normalMap": "Textures/columnC_1k_normal.jpg",
|
||||
"roughness": 0.30000001192092898
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
0.9050736427307129,
|
||||
0.9050736427307129,
|
||||
1.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/columnC_1k_metallic.png"
|
||||
},
|
||||
@@ -24,7 +45,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.014000000432133675,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/curtain_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,10 +17,22 @@
|
||||
],
|
||||
"textureMap": "Textures/curtainBlue_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
0.06195162981748581,
|
||||
0.2056153267621994,
|
||||
1.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/curtain_metallic.png"
|
||||
},
|
||||
"normal": {
|
||||
"factor": 0.5,
|
||||
"textureMap": "Textures/curtain_normal.jpg"
|
||||
},
|
||||
"opacity": {
|
||||
@@ -24,6 +40,9 @@
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/curtain_roughness.png"
|
||||
},
|
||||
"specularF0": {
|
||||
"enableMultiScatterCompensation": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/curtain_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,10 +17,22 @@
|
||||
],
|
||||
"textureMap": "Textures/curtainGreen_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
0.0,
|
||||
1.0,
|
||||
0.029526207596063615,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/curtain_metallic.png"
|
||||
},
|
||||
"normal": {
|
||||
"factor": 0.5,
|
||||
"textureMap": "Textures/curtain_normal.jpg"
|
||||
},
|
||||
"opacity": {
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/curtain_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,17 @@
|
||||
],
|
||||
"textureMap": "Textures/curtainRed_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.023315785452723504,
|
||||
0.048538949340581897,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/curtain_metallic.png"
|
||||
},
|
||||
@@ -24,6 +39,12 @@
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/curtain_roughness.png"
|
||||
},
|
||||
"uv": {
|
||||
"center": [
|
||||
16.0,
|
||||
0.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/details_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,15 @@
|
||||
],
|
||||
"textureMap": "Textures/details_1k_basecolor.png"
|
||||
},
|
||||
"clearCoat": {
|
||||
"enable": true,
|
||||
"factor": 0.5,
|
||||
"normalMap": "Textures/details_1k_normal.png",
|
||||
"roughness": 0.25
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/details_1k_metallic.png"
|
||||
},
|
||||
@@ -24,7 +37,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.02500000037252903,
|
||||
"pdo": true,
|
||||
"textureMap": "Textures/details_1k_height.png"
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/fabric_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,10 +17,22 @@
|
||||
],
|
||||
"textureMap": "Textures/fabricBlue_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
0.0,
|
||||
0.15049973130226136,
|
||||
1.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/fabric_metallic.png"
|
||||
},
|
||||
"normal": {
|
||||
"factor": 0.5,
|
||||
"textureMap": "Textures/fabric_normal.jpg"
|
||||
},
|
||||
"opacity": {
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/fabric_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,10 +17,22 @@
|
||||
],
|
||||
"textureMap": "Textures/fabricGreen_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
0.0,
|
||||
1.0,
|
||||
0.15378041565418244,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/fabric_metallic.png"
|
||||
},
|
||||
"normal": {
|
||||
"factor": 0.5,
|
||||
"textureMap": "Textures/fabric_normal.jpg"
|
||||
},
|
||||
"opacity": {
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/fabric_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,10 +17,22 @@
|
||||
],
|
||||
"textureMap": "Textures/fabricRed_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.08197146654129029,
|
||||
0.10267795622348786,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/fabric_metallic.png"
|
||||
},
|
||||
"normal": {
|
||||
"factor": 0.5,
|
||||
"textureMap": "Textures/fabric_normal.jpg"
|
||||
},
|
||||
"opacity": {
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/flagpole_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,17 @@
|
||||
],
|
||||
"textureMap": "Textures/flagpole_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.6520485281944275,
|
||||
0.7122911214828491,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/flagpole_1k_metallic.png"
|
||||
},
|
||||
@@ -24,7 +39,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.014000000432133675,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
@@ -32,6 +46,9 @@
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/flagpole_1k_roughness.png"
|
||||
},
|
||||
"specularF0": {
|
||||
"enableMultiScatterCompensation": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/floor_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,23 @@
|
||||
],
|
||||
"textureMap": "Textures/floor_1k_basecolor.png"
|
||||
},
|
||||
"clearCoat": {
|
||||
"enable": true,
|
||||
"influenceMap": "Textures/floor_1k_ao.png",
|
||||
"normalMap": "Textures/floor_1k_normal.png",
|
||||
"roughness": 0.25
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.9404135346412659,
|
||||
0.8688944578170776,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"normal": {
|
||||
"textureMap": "Textures/floor_1k_normal.png"
|
||||
},
|
||||
@@ -21,7 +42,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.012000000104308129,
|
||||
"pdo": true,
|
||||
"textureMap": "Textures/floor_1k_height.png"
|
||||
|
||||
@@ -13,6 +13,23 @@
|
||||
],
|
||||
"textureMap": "Textures/thorn_basecolor.png"
|
||||
},
|
||||
"clearCoat": {
|
||||
"enable": true,
|
||||
"factor": 0.05000000074505806,
|
||||
"normalMap": "Textures/thorn_normal.jpg",
|
||||
"roughness": 0.10000000149011612
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
0.46506446599960329,
|
||||
1.0,
|
||||
0.3944609761238098,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/thorn_metallic.png"
|
||||
},
|
||||
@@ -20,7 +37,8 @@
|
||||
"textureMap": "Textures/thorn_normal.jpg"
|
||||
},
|
||||
"opacity": {
|
||||
"factor": 0.5699999928474426,
|
||||
"doubleSided": true,
|
||||
"factor": 0.20000000298023225,
|
||||
"mode": "Cutout"
|
||||
},
|
||||
"parallax": {
|
||||
@@ -28,6 +46,25 @@
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/thorn_roughness.png"
|
||||
},
|
||||
"subsurfaceScattering": {
|
||||
"enableSubsurfaceScattering": true,
|
||||
"quality": 1.0,
|
||||
"scatterColor": [
|
||||
0.28143739700317385,
|
||||
1.0,
|
||||
0.13000686466693879,
|
||||
1.0
|
||||
],
|
||||
"scatterDistance": 1.0,
|
||||
"thickness": 0.10000000149011612,
|
||||
"transmissionMode": "ThinObject",
|
||||
"transmissionTint": [
|
||||
0.07225146889686585,
|
||||
0.16981765627861024,
|
||||
0.04444953054189682,
|
||||
1.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/lion_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,17 @@
|
||||
],
|
||||
"textureMap": "Textures/lion_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.7364919781684876,
|
||||
0.3672388792037964,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/lion_1k_metallic.png"
|
||||
},
|
||||
@@ -23,14 +38,18 @@
|
||||
"factor": 1.0
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"algorithm": "ContactRefinement",
|
||||
"enable": true,
|
||||
"factor": 0.023000000044703485,
|
||||
"factor": 0.009999999776482582,
|
||||
"pdo": true,
|
||||
"quality": "Ultra",
|
||||
"textureMap": "Textures/lion_1k_height.png"
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/lion_1k_roughness.png"
|
||||
},
|
||||
"specularF0": {
|
||||
"enableMultiScatterCompensation": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/roof_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -11,24 +15,27 @@
|
||||
0.800000011920929,
|
||||
1.0
|
||||
],
|
||||
"textureBlendMode": "Lerp",
|
||||
"textureMap": "Textures/roof_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"metallic": {
|
||||
"factor": 0.009999999776482582,
|
||||
"useTexture": false
|
||||
},
|
||||
"normal": {
|
||||
"factor": 0.5,
|
||||
"flipY": true,
|
||||
"textureMap": "Textures/roof_1k_normal.jpg"
|
||||
},
|
||||
"opacity": {
|
||||
"factor": 1.0
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"algorithm": "ContactRefinement",
|
||||
"factor": 0.019999999552965165,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
"quality": "Medium",
|
||||
"textureMap": "Textures/roof_1k_height.png"
|
||||
},
|
||||
"roughness": {
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/vase_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,17 @@
|
||||
],
|
||||
"textureMap": "Textures/vase_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.8713664412498474,
|
||||
0.6021667718887329,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/vase_1k_metallic.png"
|
||||
},
|
||||
@@ -24,7 +39,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.027000000700354577,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
@@ -32,6 +46,9 @@
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/vase_1k_roughness.png"
|
||||
},
|
||||
"specularF0": {
|
||||
"enableMultiScatterCompensation": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/vaseHanging_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,17 @@
|
||||
],
|
||||
"textureMap": "Textures/vaseHanging_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
0.765606164932251,
|
||||
1.0,
|
||||
0.7052567601203919,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"metallic": {
|
||||
"textureMap": "Textures/vaseHanging_1k_metallic.png"
|
||||
},
|
||||
@@ -24,7 +39,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.04600000008940697,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
|
||||
@@ -13,9 +13,39 @@
|
||||
],
|
||||
"textureMap": "Textures/vasePlant_1k_basecolor.png"
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
0.6788738965988159,
|
||||
1.0,
|
||||
0.026138704270124437,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"opacity": {
|
||||
"factor": 0.8399999737739563,
|
||||
"doubleSided": true,
|
||||
"factor": 0.28999999165534975,
|
||||
"mode": "Cutout"
|
||||
},
|
||||
"subsurfaceScattering": {
|
||||
"enableSubsurfaceScattering": true,
|
||||
"quality": 1.0,
|
||||
"scatterColor": [
|
||||
0.07421988248825073,
|
||||
0.10223544389009476,
|
||||
0.0,
|
||||
1.0
|
||||
],
|
||||
"subsurfaceScatterFactor": 0.0,
|
||||
"transmissionMode": "ThinObject",
|
||||
"transmissionTint": [
|
||||
0.33716335892677309,
|
||||
0.4620737135410309,
|
||||
0.0,
|
||||
1.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,10 @@
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"ambientOcclusion": {
|
||||
"enable": true,
|
||||
"textureMap": "Textures/vaseRound_1k_ao.png"
|
||||
},
|
||||
"baseColor": {
|
||||
"color": [
|
||||
0.800000011920929,
|
||||
@@ -13,6 +17,24 @@
|
||||
],
|
||||
"textureMap": "Textures/vaseRound_1k_basecolor.png"
|
||||
},
|
||||
"clearCoat": {
|
||||
"enable": true,
|
||||
"factor": 0.5,
|
||||
"influenceMap": "Textures/vaseRound_1k_ao.png",
|
||||
"normalMap": "Textures/vaseRound_1k_normal.jpg",
|
||||
"roughness": 0.25
|
||||
},
|
||||
"general": {
|
||||
"applySpecularAA": true
|
||||
},
|
||||
"irradiance": {
|
||||
"color": [
|
||||
1.0,
|
||||
0.5939116477966309,
|
||||
0.29176774621009829,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"normal": {
|
||||
"textureMap": "Textures/vaseRound_1k_normal.jpg"
|
||||
},
|
||||
@@ -21,7 +43,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.019999999552965165,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
@@ -29,6 +50,9 @@
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/vaseRound_1k_roughness.png"
|
||||
},
|
||||
"specularF0": {
|
||||
"enableMultiScatterCompensation": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ CD /d %LY_PROJECT_PATH%\%DEV_REL_PATH%
|
||||
set LY_DEV=%CD%
|
||||
echo LY_DEV = %LY_DEV%
|
||||
|
||||
CALL %LY_DEV%\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\Launchers\Windows\Env.bat
|
||||
CALL %LY_DEV%\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\Launchers\Windows\Env_Maya.bat
|
||||
|
||||
rem :: Constant Vars (Global)
|
||||
rem SET LYPY_GDEBUG=0
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user