Merge branch 'main' into Atom/antonmic/PassChanges

This commit is contained in:
antonmic
2021-06-10 14:34:18 -07:00
213 changed files with 1514 additions and 2694 deletions
@@ -1,12 +0,0 @@
/*
* 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 "AssetMemoryAnalyzer_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/AssetMemoryAnalyzer_precompiled.cpp
Source/AssetMemoryAnalyzer_precompiled.h
Include/AssetMemoryAnalyzer/AssetMemoryAnalyzerBus.h
Source/AssetMemoryAnalyzer.cpp
@@ -1,13 +0,0 @@
/*
* 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 "ImageProcessing_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/ImageProcessing_precompiled.cpp
Source/ImageProcessing_precompiled.h
Source/Compressors/CryTextureSquisher/CryTextureSquisher.cpp
Source/Compressors/CryTextureSquisher/CryTextureSquisher.h
@@ -1,12 +0,0 @@
/*
* 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 <RHI/Atom_RHI_DX12_precompiled.h>
@@ -11,7 +11,6 @@
set(FILES
Source/RHI/Atom_RHI_DX12_precompiled.h
Source/RHI/Atom_RHI_DX12_precompiled.cpp
Source/RHI/Buffer.cpp
Source/RHI/Buffer.h
Source/RHI/BufferPool.cpp
@@ -1,12 +0,0 @@
/*
* 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 "Atom_RHI_Metal_precompiled.h"
@@ -10,6 +10,5 @@
#
set(FILES
Source/Atom_RHI_Metal_precompiled.cpp
Source/Atom_RHI_Metal_precompiled.h
)
@@ -1,12 +0,0 @@
/*
* 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 "Atom_RHI_Null_precompiled.h"
@@ -10,6 +10,5 @@
#
set(FILES
Source/Atom_RHI_Null_precompiled.cpp
Source/Atom_RHI_Null_precompiled.h
)
@@ -1,12 +0,0 @@
/*
* 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 "Atom_RHI_Vulkan_precompiled.h"
@@ -720,7 +720,7 @@ namespace AZ
StringList deviceExtensions = physicalDevice.GetDeviceExtensionNames();
StringList::iterator itRayTracingExtension = AZStd::find(deviceExtensions.begin(), deviceExtensions.end(), VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME);
m_features.m_rayTracing = (itRayTracingExtension != deviceExtensions.end());
m_features.m_unboundedArrays = true;
m_features.m_unboundedArrays = physicalDevice.GetPhysicalDeviceDescriptorIndexingFeatures().shaderStorageTexelBufferArrayNonUniformIndexing;
const auto& deviceLimits = physicalDevice.GetDeviceLimits();
m_limits.m_maxImageDimension1D = deviceLimits.maxImageDimension1D;
@@ -10,6 +10,5 @@
#
set(FILES
Source/Atom_RHI_Vulkan_precompiled.cpp
Source/Atom_RHI_Vulkan_precompiled.h
)
+1
View File
@@ -150,6 +150,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
PRIVATE
AZ::AtomCore
AZ::AzTest
AZ::AzTestShared
AZ::AzFramework
AZ::AzToolsFramework
Legacy::CryCommon
@@ -81,7 +81,7 @@ namespace AZ
//! Common arguments for free polygon (point, line, Triangle) draws.
struct AuxGeomDynamicDrawArguments
{
const AZ::Vector3* m_verts = nullptr; //!< An array of points, 1 for each vertice.
const AZ::Vector3* m_verts = nullptr; //!< An array of points, 1 for each vertex.
uint32_t m_vertCount = 0; //!< The number of vertices.
const AZ::Color* m_colors; //!< An array of colors, must have either vertCount entries or 1 entry.
uint32_t m_colorCount = 0; //!< The number of colors, must equal 1 or vertCount.
@@ -61,12 +61,13 @@ namespace AZ
//! Important: only to be used in the Editor, it may kick off a job to calculate spatial information.
//! [GFX TODO][ATOM-4343 Bake mesh spatial during AP processing]
//!
//! @param rayStart position where the ray starts
//! @param dir direction where the ray ends (does not have to be unit length)
//! @param distanceFactor if an intersection is detected, this will be set such that distanceFactor * dir.length == distance to intersection
//! @param normal if an intersection is detected, this will be set to the normal at the point of intersection
//! @return true if the ray intersects the mesh
bool LocalRayIntersection(const AZ::Vector3& rayStart, const AZ::Vector3& dir, float& distanceFactor, AZ::Vector3& normal) const;
//! @param rayStart The starting point of the ray.
//! @param rayDir The direction and length of the ray (magnitude is encoded in the direction).
//! @param[out] distanceNormalized If an intersection is found, will be set to the normalized distance of the intersection
//! (in the range 0.0-1.0) - to calculate the actual distance, multiply distanceNormalized by the magnitude of rayDir.
//! @param[out] normal If an intersection is found, will be set to the normal at the point of collision.
//! @return True if the ray intersects the mesh.
bool LocalRayIntersection(const AZ::Vector3& rayStart, const AZ::Vector3& rayDir, float& distanceNormalized, AZ::Vector3& normal) const;
//! Checks a ray for intersection against this model, where the ray is in a different coordinate space.
//! Important: only to be used in the Editor, it may kick off a job to calculate spatial information.
@@ -74,13 +75,19 @@ namespace AZ
//!
//! @param modelTransform a transform that puts the model into the ray's coordinate space
//! @param nonUniformScale Non-uniform scale applied in the model's local frame.
//! @param rayStart position where the ray starts
//! @param dir direction where the ray ends (does not have to be unit length)
//! @param distanceFactor if an intersection is detected, this will be set such that distanceFactor * dir.length == distance to intersection
//! @param normal if an intersection is detected, this will be set to the normal at the point of intersection
//! @return true if the ray intersects the mesh
bool RayIntersection(const AZ::Transform& modelTransform, const AZ::Vector3& nonUniformScale, const AZ::Vector3& rayStart,
const AZ::Vector3& dir, float& distanceFactor, AZ::Vector3& normal) const;
//! @param rayStart The starting point of the ray.
//! @param rayDir The direction and length of the ray (magnitude is encoded in the direction).
//! @param[out] distanceNormalized If an intersection is found, will be set to the normalized distance of the intersection
//! (in the range 0.0-1.0) - to calculate the actual distance, multiply distanceNormalized by the magnitude of rayDir.
//! @param[out] normal If an intersection is found, will be set to the normal at the point of collision.
//! @return True if the ray intersects the mesh.
bool RayIntersection(
const AZ::Transform& modelTransform,
const AZ::Vector3& nonUniformScale,
const AZ::Vector3& rayStart,
const AZ::Vector3& rayDir,
float& distanceNormalized,
AZ::Vector3& normal) const;
//! Get available UV names from the model and its lods.
const AZStd::unordered_set<AZ::Name>& GetUvNames() const;
@@ -63,12 +63,14 @@ namespace AZ
//! Important: only to be used in the Editor, it may kick off a job to calculate spatial information.
//! [GFX TODO][ATOM-4343 Bake mesh spatial information during AP processing]
//!
//! @param rayStart position where the ray starts
//! @param dir direction where the ray ends (does not have to be unit length)
//! @param distance if an intersection is detected, this will be set such that distanceFactor * dir.length == distance to intersection
//! @param normal if an intersection is detected, this will be set to the normal at the point of collision
//! @return true if the ray intersects the mesh
virtual bool LocalRayIntersectionAgainstModel(const AZ::Vector3& rayStart, const AZ::Vector3& dir, float& distance, AZ::Vector3& normal) const;
//! @param rayStart The starting point of the ray.
//! @param rayDir The direction and length of the ray (magnitude is encoded in the direction).
//! @param[out] distanceNormalized If an intersection is found, will be set to the normalized distance of the intersection
//! (in the range 0.0-1.0) - to calculate the actual distance, multiply distanceNormalized by the magnitude of rayDir.
//! @param[out] normal If an intersection is found, will be set to the normal at the point of collision.
//! @return True if the ray intersects the mesh.
virtual bool LocalRayIntersectionAgainstModel(
const AZ::Vector3& rayStart, const AZ::Vector3& rayDir, float& distanceNormalized, AZ::Vector3& normal) const;
private:
void SetReady();
@@ -79,9 +81,15 @@ namespace AZ
// mutable method
void BuildKdTree() const;
bool BruteForceRayIntersect(const AZ::Vector3& rayStart, const AZ::Vector3& dir, float& distance, AZ::Vector3& normal) const;
bool BruteForceRayIntersect(
const AZ::Vector3& rayStart, const AZ::Vector3& rayDir, float& distanceNormalized, AZ::Vector3& normal) const;
bool LocalRayIntersectionAgainstMesh(const ModelLodAsset::Mesh& mesh, const AZ::Vector3& rayStart, const AZ::Vector3& dir, float& distance, AZ::Vector3& normal) const;
bool LocalRayIntersectionAgainstMesh(
const ModelLodAsset::Mesh& mesh,
const AZ::Vector3& rayStart,
const AZ::Vector3& rayDir,
float& distanceNormalized,
AZ::Vector3& normal) const;
// Various model information used in raycasting
AZ::Name m_positionName{ "POSITION" };
@@ -137,12 +137,12 @@ namespace AZ
return m_modelAsset;
}
bool Model::LocalRayIntersection(const AZ::Vector3& rayStart, const AZ::Vector3& dir, float& distance, AZ::Vector3& normal) const
bool Model::LocalRayIntersection(const AZ::Vector3& rayStart, const AZ::Vector3& rayDir, float& distanceNormalized, AZ::Vector3& normal) const
{
AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender);
float start;
float end;
const int result = Intersect::IntersectRayAABB2(rayStart, dir.GetReciprocal(), m_aabb, start, end);
const int result = Intersect::IntersectRayAABB2(rayStart, rayDir.GetReciprocal(), m_aabb, start, end);
if (Intersect::ISECT_RAY_AABB_NONE != result)
{
if (ModelAsset* modelAssetPtr = m_modelAsset.Get())
@@ -151,7 +151,7 @@ namespace AZ
AZ::Debug::Timer timer;
timer.Stamp();
#endif
const bool hit = modelAssetPtr->LocalRayIntersectionAgainstModel(rayStart, dir, distance, normal);
const bool hit = modelAssetPtr->LocalRayIntersectionAgainstModel(rayStart, rayDir, distanceNormalized, normal);
#if defined(AZ_RPI_PROFILE_RAYCASTING_AGAINST_MODELS)
if (hit)
{
@@ -166,8 +166,12 @@ namespace AZ
}
bool Model::RayIntersection(
const AZ::Transform& modelTransform, const AZ::Vector3& nonUniformScale, const AZ::Vector3& rayStart, const AZ::Vector3& dir,
float& distanceFactor, AZ::Vector3& normal) const
const AZ::Transform& modelTransform,
const AZ::Vector3& nonUniformScale,
const AZ::Vector3& rayStart,
const AZ::Vector3& rayDir,
float& distanceNormalized,
AZ::Vector3& normal) const
{
AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender);
const AZ::Vector3 clampedScale = nonUniformScale.GetMax(AZ::Vector3(AZ::MinTransformScale));
@@ -175,12 +179,13 @@ namespace AZ
const AZ::Transform inverseTM = modelTransform.GetInverse();
const AZ::Vector3 raySrcLocal = inverseTM.TransformPoint(rayStart) / clampedScale;
// Instead of just rotating 'dir' we need it to be scaled too, so that 'distanceFactor' will be in the target units rather than object local units.
const AZ::Vector3 rayDest = rayStart + dir;
// Instead of just rotating 'rayDir' we need it to be scaled too, so that 'distanceNormalized' will be in the target units rather
// than object local units.
const AZ::Vector3 rayDest = rayStart + rayDir;
const AZ::Vector3 rayDestLocal = inverseTM.TransformPoint(rayDest) / clampedScale;
const AZ::Vector3 rayDirLocal = rayDestLocal - raySrcLocal;
bool result = LocalRayIntersection(raySrcLocal, rayDirLocal, distanceFactor, normal);
const bool result = LocalRayIntersection(raySrcLocal, rayDirLocal, distanceNormalized, normal);
normal = (normal * clampedScale).GetNormalized();
return result;
}
@@ -15,6 +15,7 @@
#include <AzCore/Debug/EventTrace.h>
#include <AzCore/Jobs/JobFunction.h>
#include <AzCore/Math/IntersectSegment.h>
#include <AzCore/std/limits.h>
#include <AzCore/RTTI/ReflectContext.h>
#include <AzCore/Serialization/SerializeContext.h>
@@ -75,7 +76,8 @@ namespace AZ
m_status = Data::AssetData::AssetStatus::Ready;
}
bool ModelAsset::LocalRayIntersectionAgainstModel(const AZ::Vector3& rayStart, const AZ::Vector3& dir, float& distance, AZ::Vector3& normal) const
bool ModelAsset::LocalRayIntersectionAgainstModel(
const AZ::Vector3& rayStart, const AZ::Vector3& rayDir, float& distanceNormalized, AZ::Vector3& normal) const
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender);
@@ -85,7 +87,7 @@ namespace AZ
m_modelTriangleCount = CalculateTriangleCount();
}
// check the total vertex count for this model and skip kdtree if the model is simple enough
// check the total vertex count for this model and skip kd-tree if the model is simple enough
if (*m_modelTriangleCount > s_minimumModelTriangleCountToOptimize)
{
if (!m_kdTree)
@@ -97,11 +99,11 @@ namespace AZ
}
else
{
return m_kdTree->RayIntersection(rayStart, dir, distance, normal);
return m_kdTree->RayIntersection(rayStart, rayDir, distanceNormalized, normal);
}
}
return BruteForceRayIntersect(rayStart, dir, distance, normal);
return BruteForceRayIntersect(rayStart, rayDir, distanceNormalized, normal);
}
void ModelAsset::BuildKdTree() const
@@ -136,7 +138,8 @@ namespace AZ
}
}
bool ModelAsset::BruteForceRayIntersect(const AZ::Vector3& rayStart, const AZ::Vector3& dir, float& distance, AZ::Vector3& normal) const
bool ModelAsset::BruteForceRayIntersect(
const AZ::Vector3& rayStart, const AZ::Vector3& rayDir, float& distanceNormalized, AZ::Vector3& normal) const
{
// brute force - check every triangle
if (GetLodAssets().empty() == false)
@@ -144,27 +147,27 @@ namespace AZ
// intersect against the highest level of detail
if (ModelLodAsset* loadAssetPtr = GetLodAssets()[0].Get())
{
float shortestDistance = std::numeric_limits<float>::max();
bool anyHit = false;
AZ::Vector3 intersectionNormal;
float shortestDistanceNormalized = AZStd::numeric_limits<float>::max();
for (const ModelLodAsset::Mesh& mesh : loadAssetPtr->GetMeshes())
{
if (LocalRayIntersectionAgainstMesh(mesh, rayStart, dir, distance, intersectionNormal))
float currentDistanceNormalized;
if (LocalRayIntersectionAgainstMesh(mesh, rayStart, rayDir, currentDistanceNormalized, intersectionNormal))
{
anyHit = true;
if (distance < shortestDistance)
if (currentDistanceNormalized < shortestDistanceNormalized)
{
normal = intersectionNormal;
shortestDistance = distance;
shortestDistanceNormalized = currentDistanceNormalized;
}
}
}
if (anyHit)
{
distance = shortestDistance;
distanceNormalized = shortestDistanceNormalized;
}
return anyHit;
@@ -174,7 +177,12 @@ namespace AZ
return false;
}
bool ModelAsset::LocalRayIntersectionAgainstMesh(const ModelLodAsset::Mesh& mesh, const AZ::Vector3& rayStart, const AZ::Vector3& dir, float& distance, AZ::Vector3& normal) const
bool ModelAsset::LocalRayIntersectionAgainstMesh(
const ModelLodAsset::Mesh& mesh,
const AZ::Vector3& rayStart,
const AZ::Vector3& rayDir,
float& distanceNormalized,
AZ::Vector3& normal) const
{
const BufferAssetView& indexBufferView = mesh.GetIndexBufferAssetView();
const AZStd::array_view<ModelLodAsset::Mesh::StreamBufferInfo>& streamBufferList = mesh.GetStreamBufferInfoList();
@@ -217,14 +225,13 @@ namespace AZ
AZStd::array_view<uint8_t> indexRawBuffer = indexAssetViewPtr->GetBuffer();
RHI::BufferViewDescriptor indexRawDesc = indexAssetViewPtr->GetBufferViewDescriptor();
float closestNormalizedDistance = 1.f;
bool anyHit = false;
const AZ::Vector3 rayEnd = rayStart + dir * distance;
const AZ::Vector3 rayEnd = rayStart + rayDir;
AZ::Vector3 a, b, c;
AZ::Vector3 intersectionNormal;
float normalizedDistance = 1.f;
float shortestDistanceNormalized = AZStd::numeric_limits<float>::max();
const AZ::u32* indexPtr = reinterpret_cast<const AZ::u32*>(indexRawBuffer.data());
for (uint32_t indexIter = 0; indexIter <= indexRawDesc.m_elementCount - 3; indexIter += 3, indexPtr += 3)
{
@@ -247,20 +254,22 @@ namespace AZ
p = reinterpret_cast<const float*>(&positionRawBuffer[index2 * positionElementSize]);
c.Set(const_cast<float*>(p));
if (AZ::Intersect::IntersectSegmentTriangleCCW(rayStart, rayEnd, a, b, c, intersectionNormal, normalizedDistance))
float currentDistanceNormalized;
if (AZ::Intersect::IntersectSegmentTriangleCCW(rayStart, rayEnd, a, b, c, intersectionNormal, currentDistanceNormalized))
{
if (normalizedDistance < closestNormalizedDistance)
anyHit = true;
if (currentDistanceNormalized < shortestDistanceNormalized)
{
normal = intersectionNormal;
closestNormalizedDistance = normalizedDistance;
shortestDistanceNormalized = currentDistanceNormalized;
}
anyHit = true;
}
}
if (anyHit)
{
distance = closestNormalizedDistance * distance;
distanceNormalized = shortestDistanceNormalized;
}
return anyHit;
@@ -208,10 +208,10 @@ namespace AZ
bool ModelKdTree::RayIntersection(
const AZ::Vector3& raySrc, const AZ::Vector3& rayDir, float& distanceNormalized, AZ::Vector3& normal) const
{
float closestDistanceNormalized = AZStd::numeric_limits<float>::max();
if (RayIntersectionRecursively(m_pRootNode.get(), raySrc, rayDir, closestDistanceNormalized, normal))
float shortestDistanceNormalized = AZStd::numeric_limits<float>::max();
if (RayIntersectionRecursively(m_pRootNode.get(), raySrc, rayDir, shortestDistanceNormalized, normal))
{
distanceNormalized = closestDistanceNormalized;
distanceNormalized = shortestDistanceNormalized;
return true;
}
+196 -90
View File
@@ -22,6 +22,7 @@
#include <AzCore/std/limits.h>
#include <AzCore/Component/Entity.h>
#include <AZTestShared/Math/MathTestHelpers.h>
#include <AzTest/AzTest.h>
#include <Common/RPITestFixture.h>
@@ -568,7 +569,7 @@ namespace UnitTest
ValidateModelAsset(serializedModelAsset.Get(), expectedModel);
}
// Tests that if we try to set the name on a Model
// Tests that if we try to set the name on a Model
// before calling Begin that it will fail.
TEST_F(ModelTests, SetNameNoBegin)
{
@@ -581,7 +582,7 @@ namespace UnitTest
creator.SetName("TestName");
}
// Tests that if we try to add a ModelLod to a Model
// Tests that if we try to add a ModelLod to a Model
// before calling Begin that it will fail.
TEST_F(ModelTests, AddLodNoBegin)
{
@@ -598,7 +599,7 @@ namespace UnitTest
creator.AddLodAsset(AZStd::move(lod));
}
// Tests that if we create a ModelAsset without adding
// Tests that if we create a ModelAsset without adding
// any ModelLodAssets that the creator will properly fail to produce an asset.
TEST_F(ModelTests, CreateModelNoLods)
{
@@ -618,8 +619,8 @@ namespace UnitTest
ASSERT_EQ(asset.Get(), nullptr);
}
// Tests that if we call SetLodIndexBuffer without calling
// Begin first on the ModelLodAssetCreator that it
// Tests that if we call SetLodIndexBuffer without calling
// Begin first on the ModelLodAssetCreator that it
// fails as expected.
TEST_F(ModelTests, SetLodIndexBufferNoBegin)
{
@@ -633,8 +634,8 @@ namespace UnitTest
creator.SetLodIndexBuffer(validIndexBuffer);
}
// Tests that if we call AddLodStreamBuffer without calling
// Begin first on the ModelLodAssetCreator that it
// Tests that if we call AddLodStreamBuffer without calling
// Begin first on the ModelLodAssetCreator that it
// fails as expected.
TEST_F(ModelTests, AddLodStreamBufferNoBegin)
{
@@ -648,8 +649,8 @@ namespace UnitTest
creator.AddLodStreamBuffer(validStreamBuffer);
}
// Tests that if we call BeginMesh without calling
// Begin first on the ModelLodAssetCreator that it
// Tests that if we call BeginMesh without calling
// Begin first on the ModelLodAssetCreator that it
// fails as expected.
TEST_F(ModelTests, BeginMeshNoBegin)
{
@@ -662,13 +663,13 @@ namespace UnitTest
}
// Tests that if we try to set an AABB on a mesh
// without calling Begin or BeginMesh that it fails
// without calling Begin or BeginMesh that it fails
// as expected. Also tests the case that Begin *is*
// called but BeginMesh is not.
TEST_F(ModelTests, SetAabbNoBeginNoBeginMesh)
{
using namespace AZ;
RPI::ModelLodAssetCreator creator;
AZ::Aabb aabb = AZ::Aabb::CreateCenterRadius(AZ::Vector3::CreateZero(), 1.0f);
@@ -691,13 +692,13 @@ namespace UnitTest
}
// Tests that if we try to set the material id on a mesh
// without calling Begin or BeginMesh that it fails
// without calling Begin or BeginMesh that it fails
// as expected. Also tests the case that Begin *is*
// called but BeginMesh is not.
TEST_F(ModelTests, SetMaterialIdNoBeginNoBeginMesh)
{
using namespace AZ;
RPI::ModelLodAssetCreator creator;
{
@@ -715,7 +716,7 @@ namespace UnitTest
}
// Tests that if we try to set the index buffer on a mesh
// without calling Begin or BeginMesh that it fails
// without calling Begin or BeginMesh that it fails
// as expected. Also tests the case that Begin *is*
// called but BeginMesh is not.
TEST_F(ModelTests, SetIndexBufferNoBeginNoBeginMesh)
@@ -751,7 +752,7 @@ namespace UnitTest
}
// Tests that if we try to add a stream buffer on a mesh
// without calling Begin or BeginMesh that it fails
// without calling Begin or BeginMesh that it fails
// as expected. Also tests the case that Begin *is*
// called but BeginMesh is not.
TEST_F(ModelTests, AddStreamBufferNoBeginNoBeginMesh)
@@ -785,7 +786,7 @@ namespace UnitTest
}
}
// Tests that if we try to end the creation of a
// Tests that if we try to end the creation of a
// ModelLodAsset that has no meshes that it fails
// as expected.
TEST_F(ModelTests, CreateLodNoMeshes)
@@ -804,7 +805,7 @@ namespace UnitTest
ASSERT_EQ(asset.Get(), nullptr);
}
// Tests that validation still fails when expected
// Tests that validation still fails when expected
// even after producing a valid mesh due to a missing
// BeginMesh call
TEST_F(ModelTests, SecondMeshFailureNoBeginMesh)
@@ -862,8 +863,8 @@ namespace UnitTest
ASSERT_EQ(asset->GetMeshes().size(), 1);
}
// Tests that validation still fails when expected
// even after producing a valid mesh due to SetMeshX
// Tests that validation still fails when expected
// even after producing a valid mesh due to SetMeshX
// calls coming after End
TEST_F(ModelTests, SecondMeshAfterEnd)
{
@@ -907,7 +908,7 @@ namespace UnitTest
AZ::Aabb aabb = AZ::Aabb::CreateCenterRadius(Vector3::CreateZero(), 1.0f);
ErrorMessageFinder messageFinder("Begin() was not called", 6);
creator.BeginMesh();
creator.SetMeshAabb(AZStd::move(aabb));
creator.SetMeshMaterialAsset(m_materialAsset);
@@ -955,6 +956,20 @@ namespace UnitTest
EXPECT_EQ(uvStreamTangentBitmask.GetFullTangentBitmask(), 0x70000F51);
}
//
// +----+
// / /|
// +----+ |
// | | +
// | |/
// +----+
//
static constexpr AZStd::array CubePositions = { -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f,
-1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f };
static constexpr AZStd::array CubeIndices = {
uint32_t{ 0 }, 2, 1, 1, 2, 3, 4, 5, 6, 5, 7, 6, 0, 4, 2, 4, 6, 2, 1, 3, 5, 5, 3, 7, 0, 1, 4, 4, 1, 5, 2, 6, 3, 6, 7, 3,
};
// This class creates a Model with one LOD, whose mesh contains 2 planes. Plane 1 is in the XY plane at Z=-0.5, and
// plane 2 is in the XY plane at Z=0.5. The two planes each have 9 quads which have been triangulated. It only has
// a position and index buffer.
@@ -972,52 +987,75 @@ namespace UnitTest
// *---*---*---*
// \ / \ / \ / \
// *---*---*---*
static constexpr AZStd::array TwoSeparatedPlanesPositions{
-1.0f, -0.333f, -0.5f, -0.333f, -1.0f, -0.5f, -0.333f, -0.333f, -0.5f, 0.333f, -0.333f, -0.5f, 1.0f, -1.0f, -0.5f,
1.0f, -0.333f, -0.5f, 0.333f, -1.0f, -0.5f, 0.333f, 1.0f, -0.5f, 1.0f, 0.333f, -0.5f, 1.0f, 1.0f, -0.5f,
0.333f, 0.333f, -0.5f, -0.333f, 1.0f, -0.5f, -0.333f, 0.333f, -0.5f, -1.0f, 1.0f, -0.5f, -1.0f, 0.333f, -0.5f,
-1.0f, -0.333f, 0.5f, -0.333f, -1.0f, 0.5f, -0.333f, -0.333f, 0.5f, 0.333f, -0.333f, 0.5f, 1.0f, -1.0f, 0.5f,
1.0f, -0.333f, 0.5f, -0.333f, -0.333f, 0.5f, 0.333f, -1.0f, 0.5f, 0.333f, -0.333f, 0.5f, 0.333f, 1.0f, 0.5f,
1.0f, 0.333f, 0.5f, 1.0f, 1.0f, 0.5f, 0.333f, 0.333f, 0.5f, 1.0f, -0.333f, 0.5f, -0.333f, 1.0f, 0.5f,
-0.333f, 0.333f, 0.5f, 0.333f, -0.333f, 0.5f, 0.333f, 0.333f, 0.5f, -1.0f, 1.0f, 0.5f, -0.333f, 0.333f, 0.5f,
-1.0f, 0.333f, 0.5f, -1.0f, -1.0f, -0.5f, -1.0f, -1.0f, 0.5f, 0.333f, -0.333f, 0.5f, 0.333f, -1.0f, 0.5f,
1.0f, -1.0f, 0.5f, 0.333f, -1.0f, 0.5f, 0.333f, 0.333f, 0.5f, 0.333f, -0.333f, 0.5f, 1.0f, -0.333f, 0.5f,
-0.333f, 0.333f, 0.5f, -0.333f, -0.333f, 0.5f, 0.333f, -0.333f, 0.5f,
};
// clang-format off
static constexpr AZStd::array TwoSeparatedPlanesIndices{
uint32_t{ 0 }, 1, 2, 3, 4, 5, 2, 6, 3, 7, 8, 9, 10, 5, 8, 11, 10, 7, 12, 3, 10, 13, 12, 11, 14, 2, 12,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 25, 29, 27, 24, 30, 31, 32, 33, 34, 29, 35, 17, 34,
0, 36, 1, 3, 6, 4, 2, 1, 6, 7, 10, 8, 10, 3, 5, 11, 12, 10, 12, 2, 3, 13, 14, 12, 14, 0, 2,
15, 37, 16, 38, 39, 40, 17, 16, 41, 24, 27, 25, 42, 43, 44, 29, 34, 27, 45, 46, 47, 33, 35, 34, 35, 15, 17,
};
// clang-format on
// Ensure that the index buffer references all the positions in the position buffer
static constexpr inline auto minmaxElement = AZStd::minmax_element(begin(TwoSeparatedPlanesIndices), end(TwoSeparatedPlanesIndices));
static_assert(*minmaxElement.second == (TwoSeparatedPlanesPositions.size() / 3) - 1);
template<class x> class TD;
class TwoSeparatedPlanesMesh
class TestMesh
{
public:
TwoSeparatedPlanesMesh()
TestMesh(const float* positions, size_t positionCount, const uint32_t* indices, size_t indicesCount)
{
using namespace AZ;
RPI::ModelLodAssetCreator lodCreator;
lodCreator.Begin(Data::AssetId(AZ::Uuid::CreateRandom()));
AZ::RPI::ModelLodAssetCreator lodCreator;
lodCreator.Begin(AZ::Data::AssetId(AZ::Uuid::CreateRandom()));
lodCreator.BeginMesh();
lodCreator.SetMeshAabb(Aabb::CreateFromMinMax({-1.0f, -1.0f, -0.5f}, {1.0f, 1.0f, 0.5f}));
lodCreator.SetMeshAabb(AZ::Aabb::CreateFromMinMax({-1.0f, -1.0f, -0.5f}, {1.0f, 1.0f, 0.5f}));
lodCreator.SetMeshMaterialAsset(
AZ::Data::Asset<AZ::RPI::MaterialAsset>(AZ::Data::AssetId(AZ::Uuid::CreateRandom(), 0),
AZ::AzTypeInfo<AZ::RPI::MaterialAsset>::Uuid(), "")
);
{
AZ::Data::Asset<AZ::RPI::BufferAsset> indexBuffer = BuildTestBuffer(s_indexes.size(), sizeof(uint32_t));
AZStd::copy(s_indexes.begin(), s_indexes.end(), reinterpret_cast<uint32_t*>(const_cast<uint8_t*>(indexBuffer->GetBuffer().data())));
AZ::Data::Asset<AZ::RPI::BufferAsset> indexBuffer = BuildTestBuffer(indicesCount, sizeof(uint32_t));
AZStd::copy(indices, indices + indicesCount, reinterpret_cast<uint32_t*>(const_cast<uint8_t*>(indexBuffer->GetBuffer().data())));
lodCreator.SetMeshIndexBuffer({
indexBuffer,
RHI::BufferViewDescriptor::CreateStructured(0, s_indexes.size(), sizeof(uint32_t))
AZ::RHI::BufferViewDescriptor::CreateStructured(0, indicesCount, sizeof(uint32_t))
});
}
{
AZ::Data::Asset<AZ::RPI::BufferAsset> positionBuffer = BuildTestBuffer(s_positions.size() / 3, sizeof(float) * 3);
AZStd::copy(s_positions.begin(), s_positions.end(), reinterpret_cast<float*>(const_cast<uint8_t*>(positionBuffer->GetBuffer().data())));
AZ::Data::Asset<AZ::RPI::BufferAsset> positionBuffer = BuildTestBuffer(positionCount / 3, sizeof(float) * 3);
AZStd::copy(positions, positions + positionCount, reinterpret_cast<float*>(const_cast<uint8_t*>(positionBuffer->GetBuffer().data())));
lodCreator.AddMeshStreamBuffer(
AZ::RHI::ShaderSemantic(AZ::Name("POSITION")),
AZ::Name(),
{
positionBuffer,
RHI::BufferViewDescriptor::CreateStructured(0, s_positions.size() / 3, sizeof(float) * 3)
AZ::RHI::BufferViewDescriptor::CreateStructured(0, positionCount / 3, sizeof(float) * 3)
}
);
}
lodCreator.EndMesh();
Data::Asset<RPI::ModelLodAsset> lodAsset;
AZ::Data::Asset<AZ::RPI::ModelLodAsset> lodAsset;
lodCreator.End(lodAsset);
RPI::ModelAssetCreator modelCreator;
modelCreator.Begin(Data::AssetId(AZ::Uuid::CreateRandom()));
AZ::RPI::ModelAssetCreator modelCreator;
modelCreator.Begin(AZ::Data::AssetId(AZ::Uuid::CreateRandom()));
modelCreator.SetName("TestModel");
modelCreator.AddLodAsset(AZStd::move(lodAsset));
modelCreator.End(m_modelAsset);
@@ -1030,40 +1068,20 @@ namespace UnitTest
private:
AZ::Data::Asset<AZ::RPI::ModelAsset> m_modelAsset;
static constexpr AZStd::array s_positions{
-1.0f, -0.333f, -0.5f, -0.333f, -1.0f, -0.5f, -0.333f, -0.333f, -0.5f, 0.333f, -0.333f, -0.5f, 1.0f, -1.0f, -0.5f,
1.0f, -0.333f, -0.5f, 0.333f, -1.0f, -0.5f, 0.333f, 1.0f, -0.5f, 1.0f, 0.333f, -0.5f, 1.0f, 1.0f, -0.5f,
0.333f, 0.333f, -0.5f, -0.333f, 1.0f, -0.5f, -0.333f, 0.333f, -0.5f, -1.0f, 1.0f, -0.5f, -1.0f, 0.333f, -0.5f,
-1.0f, -0.333f, 0.5f, -0.333f, -1.0f, 0.5f, -0.333f, -0.333f, 0.5f, 0.333f, -0.333f, 0.5f, 1.0f, -1.0f, 0.5f,
1.0f, -0.333f, 0.5f, -0.333f, -0.333f, 0.5f, 0.333f, -1.0f, 0.5f, 0.333f, -0.333f, 0.5f, 0.333f, 1.0f, 0.5f,
1.0f, 0.333f, 0.5f, 1.0f, 1.0f, 0.5f, 0.333f, 0.333f, 0.5f, 1.0f, -0.333f, 0.5f, -0.333f, 1.0f, 0.5f,
-0.333f, 0.333f, 0.5f, 0.333f, -0.333f, 0.5f, 0.333f, 0.333f, 0.5f, -1.0f, 1.0f, 0.5f, -0.333f, 0.333f, 0.5f,
-1.0f, 0.333f, 0.5f, -1.0f, -1.0f, -0.5f, -1.0f, -1.0f, 0.5f, 0.333f, -0.333f, 0.5f, 0.333f, -1.0f, 0.5f,
1.0f, -1.0f, 0.5f, 0.333f, -1.0f, 0.5f, 0.333f, 0.333f, 0.5f, 0.333f, -0.333f, 0.5f, 1.0f, -0.333f, 0.5f,
-0.333f, 0.333f, 0.5f, -0.333f, -0.333f, 0.5f, 0.333f, -0.333f, 0.5f,
};
static constexpr AZStd::array s_indexes{
uint32_t{0}, 1, 2, 3, 4, 5, 2, 6, 3, 7, 8, 9, 10, 5, 8, 11, 10, 7, 12, 3, 10, 13, 12, 11, 14, 2, 12,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 25, 29, 27, 24, 30, 31, 32, 33, 34, 29, 35, 17, 34,
0, 36, 1, 3, 6, 4, 2, 1, 6, 7, 10, 8, 10, 3, 5, 11, 12, 10, 12, 2, 3, 13, 14, 12, 14, 0, 2,
15, 37, 16, 38, 39, 40, 17, 16, 41, 24, 27, 25, 42, 43, 44, 29, 34, 27, 45, 46, 47, 33, 35, 34, 35, 15, 17,
};
// Ensure that the index buffer references all the positions in the position buffer
static constexpr inline auto minmaxElement = AZStd::minmax_element(begin(s_indexes), end(s_indexes));
static_assert(*minmaxElement.second == (s_positions.size() / 3) - 1);
};
struct KdTreeIntersectParams
struct IntersectParams
{
float xpos;
float ypos;
float zpos;
float xdir;
float ydir;
float zdir;
float expectedDistance;
bool expectedShouldIntersect;
friend std::ostream& operator<<(std::ostream& os, const KdTreeIntersectParams& param)
friend std::ostream& operator<<(std::ostream& os, const IntersectParams& param)
{
return os
<< "xpos:" << param.xpos
@@ -1076,13 +1094,15 @@ namespace UnitTest
class KdTreeIntersectsParameterizedFixture
: public ModelTests
, public ::testing::WithParamInterface<KdTreeIntersectParams>
, public ::testing::WithParamInterface<IntersectParams>
{
};
TEST_P(KdTreeIntersectsParameterizedFixture, KdTreeIntersects)
{
TwoSeparatedPlanesMesh mesh;
TestMesh mesh(
TwoSeparatedPlanesPositions.data(), TwoSeparatedPlanesPositions.size(), TwoSeparatedPlanesIndices.data(),
TwoSeparatedPlanesIndices.size());
AZ::RPI::ModelKdTree kdTree;
ASSERT_TRUE(kdTree.Build(mesh.GetModel().Get()));
@@ -1092,38 +1112,40 @@ namespace UnitTest
EXPECT_THAT(
kdTree.RayIntersection(
AZ::Vector3(GetParam().xpos, GetParam().ypos, GetParam().zpos), AZ::Vector3::CreateAxisZ(-1.0f), distance, normal),
AZ::Vector3(GetParam().xpos, GetParam().ypos, GetParam().zpos),
AZ::Vector3(GetParam().xdir, GetParam().ydir, GetParam().zdir), distance, normal),
testing::Eq(GetParam().expectedShouldIntersect));
EXPECT_THAT(distance, testing::FloatEq(GetParam().expectedDistance));
}
static constexpr inline AZStd::array<KdTreeIntersectParams, 21> intersectTestData{
KdTreeIntersectParams{ -0.1f, 0.0f, 1.0f, 0.5f, true },
KdTreeIntersectParams{ 0.0f, 0.0f, 1.0f, 0.5f, true },
KdTreeIntersectParams{ 0.1f, 0.0f, 1.0f, 0.5f, true },
static constexpr AZStd::array KdTreeIntersectTestData{
IntersectParams{ -0.1f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ 0.1f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
// Test the center of each triangle
KdTreeIntersectParams{-0.111f, -0.111f, 1.0f, 0.5f, true},
KdTreeIntersectParams{-0.111f, -0.778f, 1.0f, 0.5f, true},
KdTreeIntersectParams{-0.111f, 0.555f, 1.0f, 0.5f, true}, // Should intersect triangle with indices {29, 34, 27} and {11, 12, 10}
KdTreeIntersectParams{-0.555f, -0.555f, 1.0f, 0.5f, true},
KdTreeIntersectParams{-0.555f, 0.111f, 1.0f, 0.5f, true},
KdTreeIntersectParams{-0.555f, 0.778f, 1.0f, 0.5f, true},
KdTreeIntersectParams{-0.778f, -0.111f, 1.0f, 0.5f, true},
KdTreeIntersectParams{-0.778f, -0.778f, 1.0f, 0.5f, true},
KdTreeIntersectParams{-0.778f, 0.555f, 1.0f, 0.5f, true},
KdTreeIntersectParams{0.111f, -0.555f, 1.0f, 0.5f, true},
KdTreeIntersectParams{0.111f, 0.111f, 1.0f, 0.5f, true},
KdTreeIntersectParams{0.111f, 0.778f, 1.0f, 0.5f, true},
KdTreeIntersectParams{0.555f, -0.111f, 1.0f, 0.5f, true},
KdTreeIntersectParams{0.555f, -0.778f, 1.0f, 0.5f, true},
KdTreeIntersectParams{0.555f, 0.555f, 1.0f, 0.5f, true},
KdTreeIntersectParams{0.778f, -0.555f, 1.0f, 0.5f, true},
KdTreeIntersectParams{0.778f, 0.111f, 1.0f, 0.5f, true},
KdTreeIntersectParams{0.778f, 0.778f, 1.0f, 0.5f, true},
IntersectParams{ -0.111f, -0.111f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ -0.111f, -0.778f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ -0.111f, 0.555f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f,
true }, // Should intersect triangle with indices {29, 34, 27} and {11, 12, 10}
IntersectParams{ -0.555f, -0.555f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ -0.555f, 0.111f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ -0.555f, 0.778f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ -0.778f, -0.111f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ -0.778f, -0.778f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ -0.778f, 0.555f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ 0.111f, -0.555f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ 0.111f, 0.111f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ 0.111f, 0.778f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ 0.555f, -0.111f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ 0.555f, -0.778f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ 0.555f, 0.555f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ 0.778f, -0.555f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ 0.778f, 0.111f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ 0.778f, 0.778f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, true },
};
INSTANTIATE_TEST_CASE_P(KdTreeIntersectsPlane, KdTreeIntersectsParameterizedFixture, ::testing::ValuesIn(intersectTestData));
INSTANTIATE_TEST_CASE_P(KdTreeIntersectsPlane, KdTreeIntersectsParameterizedFixture, ::testing::ValuesIn(KdTreeIntersectTestData));
class KdTreeIntersectsFixture
: public ModelTests
@@ -1133,7 +1155,10 @@ namespace UnitTest
{
ModelTests::SetUp();
m_mesh = AZStd::make_unique<TwoSeparatedPlanesMesh>();
m_mesh = AZStd::make_unique<TestMesh>(
TwoSeparatedPlanesPositions.data(), TwoSeparatedPlanesPositions.size(), TwoSeparatedPlanesIndices.data(),
TwoSeparatedPlanesIndices.size());
m_kdTree = AZStd::make_unique<AZ::RPI::ModelKdTree>();
ASSERT_TRUE(m_kdTree->Build(m_mesh->GetModel().Get()));
}
@@ -1146,7 +1171,7 @@ namespace UnitTest
ModelTests::TearDown();
}
AZStd::unique_ptr<TwoSeparatedPlanesMesh> m_mesh;
AZStd::unique_ptr<TestMesh> m_mesh;
AZStd::unique_ptr<AZ::RPI::ModelKdTree> m_kdTree;
};
@@ -1154,7 +1179,7 @@ namespace UnitTest
{
float t = AZStd::numeric_limits<float>::max();
AZ::Vector3 normal;
constexpr float rayLength = 100.0f;
EXPECT_THAT(
m_kdTree->RayIntersection(
@@ -1181,4 +1206,85 @@ namespace UnitTest
EXPECT_THAT(
m_kdTree->RayIntersection(AZ::Vector3::CreateAxisZ(5.0f), -AZ::Vector3::CreateAxisZ(), t, normal), testing::Eq(false));
}
class BruteForceIntersectsParameterizedFixture
: public ModelTests
, public ::testing::WithParamInterface<IntersectParams>
{
};
TEST_P(BruteForceIntersectsParameterizedFixture, BruteForceIntersectsCube)
{
TestMesh mesh(CubePositions.data(), CubePositions.size(), CubeIndices.data(), CubeIndices.size());
float distance = AZStd::numeric_limits<float>::max();
AZ::Vector3 normal;
EXPECT_THAT(
mesh.GetModel()->LocalRayIntersectionAgainstModel(
AZ::Vector3(GetParam().xpos, GetParam().ypos, GetParam().zpos),
AZ::Vector3(GetParam().xdir, GetParam().ydir, GetParam().zdir), distance, normal),
testing::Eq(GetParam().expectedShouldIntersect));
EXPECT_THAT(distance, testing::FloatEq(GetParam().expectedDistance));
}
static constexpr AZStd::array BruteForceIntersectTestData{
IntersectParams{ 5.0f, 0.0f, 5.0f, 0.0f, 0.0f, -1.0f, AZStd::numeric_limits<float>::max(), false },
IntersectParams{ 0.0f, 0.0f, 1.5f, 0.0f, 0.0f, -1.0f, 0.5f, true },
IntersectParams{ 5.0f, 0.0f, 0.0f, -10.0f, 0.0f, 0.0f, 0.4f, true },
IntersectParams{ -5.0f, 0.0f, 0.0f, 20.0f, 0.0f, 0.0f, 0.2f, true },
IntersectParams{ 0.0f, -10.0f, 0.0f, 0.0f, 20.0f, 0.0f, 0.45f, true },
IntersectParams{ 0.0f, 20.0f, 0.0f, 0.0f, -40.0f, 0.0f, 0.475f, true },
IntersectParams{ 0.0f, 20.0f, 0.0f, 0.0f, -19.0f, 0.0f, 1.0f, true },
};
INSTANTIATE_TEST_CASE_P(
BruteForceIntersects, BruteForceIntersectsParameterizedFixture, ::testing::ValuesIn(BruteForceIntersectTestData));
class BruteForceModelIntersectsFixture
: public ModelTests
{
public:
void SetUp() override
{
ModelTests::SetUp();
m_mesh = AZStd::make_unique<TestMesh>(CubePositions.data(), CubePositions.size(), CubeIndices.data(), CubeIndices.size());
}
void TearDown() override
{
m_mesh.reset();
ModelTests::TearDown();
}
AZStd::unique_ptr<TestMesh> m_mesh;
};
TEST_F(BruteForceModelIntersectsFixture, BruteForceIntersectionDetectedWithCube)
{
float t = 0.0f;
AZ::Vector3 normal;
// firing down the negative z axis, positioned 5 units from cube (cube is 2x2x2 so intersection
// happens at 1 in z)
EXPECT_THAT(
m_mesh->GetModel()->LocalRayIntersectionAgainstModel(
AZ::Vector3::CreateAxisZ(5.0f), -AZ::Vector3::CreateAxisZ(10.0f), t, normal),
testing::Eq(true));
EXPECT_THAT(t, testing::FloatEq(0.4f));
}
TEST_F(BruteForceModelIntersectsFixture, BruteForceIntersectionDetectedAndNormalSetAtEndOfRay)
{
float t = 0.0f;
AZ::Vector3 normal = AZ::Vector3::CreateOne(); // invalid starting normal
// ensure the intersection happens right at the end of the ray
EXPECT_THAT(
m_mesh->GetModel()->LocalRayIntersectionAgainstModel(
AZ::Vector3::CreateAxisY(10.0f), -AZ::Vector3::CreateAxisY(9.0f), t, normal),
testing::Eq(true));
EXPECT_THAT(t, testing::FloatEq(1.0f));
EXPECT_THAT(normal, IsClose(AZ::Vector3::CreateAxisY()));
}
} // namespace UnitTest
@@ -11,8 +11,8 @@
*/
/* Style for visualizing property values overridden from their prefab values */
AzToolsFramework--PropertyRowWidget[IsOverridden=true] QLabel
AzToolsFramework--PropertyRowWidget[IsOverridden="true"] QLabel
{
font-weight: bold;
color: #F5A623;
color: #1E70EB;
}
@@ -37,9 +37,6 @@
"factor": 0.4343433976173401,
"textureMap": "Materials/Bricks038_8K/Bricks038_8K_Roughness.png",
"useTexture": false
},
"subsurfaceScattering": {
"useThicknessMap": false
}
}
}
@@ -18,15 +18,6 @@
},
"opacity": {
"factor": 1.0
},
"subsurfaceScattering": {
"enableSubsurfaceScattering": true,
"quality": 1.0,
"scatterDistance": 2.626262664794922,
"subsurfaceScatterFactor": 1.0,
"thickness": 0.1414141058921814,
"transmissionMode": "ThinObject",
"transmissionScale": 1.8181817531585694
}
}
}
@@ -31,18 +31,6 @@
},
"roughness": {
"factor": 0.0
},
"subsurfaceScattering": {
"enableSubsurfaceScattering": true,
"quality": 1.0,
"scatterColor": [
0.045288778841495517,
0.24347294867038728,
0.2060578316450119,
1.0
],
"scatterDistance": 4.040403842926025,
"subsurfaceScatterFactor": 0.5
}
}
}
@@ -20,11 +20,6 @@
},
"roughness": {
"factor": 0.20202019810676576
},
"subsurfaceScattering": {
"quality": 0.329292893409729,
"scatterDistance": 6.666666507720947,
"subsurfaceScatterFactor": 0.9595959782600403
}
}
}
@@ -28,17 +28,6 @@
},
"specularF0": {
"factor": 1.0
},
"subsurfaceScattering": {
"quality": 0.9838383793830872,
"scatterColor": [
0.143602654337883,
0.012634470127522946,
0.0005798428319394589,
1.0
],
"scatterDistance": 18.383838653564454,
"subsurfaceScatterFactor": 0.1414141058921814
}
}
}
@@ -25,17 +25,6 @@
},
"specularF0": {
"factor": 1.0
},
"subsurfaceScattering": {
"quality": 0.9838383793830872,
"scatterColor": [
0.143602654337883,
0.012634470127522946,
0.0005798428319394589,
1.0
],
"scatterDistance": 18.383838653564454,
"subsurfaceScatterFactor": 0.1414141058921814
}
}
}
@@ -4,20 +4,15 @@
"parentMaterial": "",
"propertyLayoutVersion": 3,
"properties": {
"occlusion": {
"diffuseTextureMap": "Textures/ceiling_1k_ao.png"
},
"baseColor": {
"textureBlendMode": "Lerp",
"color": [
0.800000011920929,
0.800000011920929,
0.800000011920929,
1.0
],
"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,
@@ -26,33 +21,8 @@
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",
"useTexture": false
},
"roughness": {
"textureMap": "Textures/ceiling_1k_roughness.png"
}
}
}
}
@@ -13,31 +13,16 @@
],
"textureMap": "Textures/chain_basecolor.png"
},
"general": {
"applySpecularAA": true
},
"irradiance": {
"emissive": {
"color": [
0.4891279339790344,
0.7931944727897644,
1.0,
0.0,
0.0,
0.0,
1.0
]
},
"metallic": {
"textureMap": "Textures/chain_alpha.png"
},
"normal": {
"textureMap": "Textures/chain_normal.jpg"
},
"opacity": {
"alphaSource": "Split",
"factor": 0.30000001192092898,
"mode": "Cutout",
"textureMap": "Textures/chain_alpha.png"
},
"roughness": {
"factor": 0.4000000059604645
"factor": 1.0
}
}
}
}
@@ -47,25 +47,6 @@
},
"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,9 +4,6 @@
"parentMaterial": "",
"propertyLayoutVersion": 3,
"properties": {
"occlusion": {
"diffuseTextureMap": "Textures/lion_1k_ao.png"
},
"baseColor": {
"color": [
0.800000011920929,
@@ -16,38 +13,16 @@
],
"textureMap": "Textures/lion_1k_basecolor.png"
},
"general": {
"applySpecularAA": true
},
"irradiance": {
"emissive": {
"color": [
1.0,
0.7364919781684876,
0.3672388792037964,
0.0,
0.0,
0.0,
1.0
]
},
"metallic": {
"textureMap": "Textures/lion_1k_metallic.png"
},
"normal": {
"textureMap": "Textures/lion_1k_normal.jpg"
},
"opacity": {
"factor": 1.0
},
"parallax": {
"algorithm": "ContactRefinement",
"factor": 0.009999999776482582,
"pdo": true,
"quality": "Ultra",
"textureMap": "Textures/lion_1k_height.png"
},
"roughness": {
"textureMap": "Textures/lion_1k_roughness.png"
},
"specularF0": {
"enableMultiScatterCompensation": true
}
}
}
}
@@ -28,24 +28,6 @@
"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
]
}
}
}
@@ -1,14 +0,0 @@
/*
* 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.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#include <AtomLyIntegration/AtomFont/AtomFont_precompiled.h>
@@ -33,5 +33,4 @@ set(FILES
Include/AtomLyIntegration/AtomFont/AtomNullFont.h
Include/AtomLyIntegration/AtomFont/resource.h
Include/AtomLyIntegration/AtomFont/AtomFont_precompiled.h
Source/AtomFont_precompiled.cpp
)
@@ -18,6 +18,7 @@
#include <Integration/System/SystemCommon.h>
#include <Integration/System/SystemComponent.h>
#include <EMotionFX/Source/ActorInstance.h>
#include <EMotionFX/Source/DebugDraw.h>
#include <EMotionFX/Source/MorphSetup.h>
#include <EMotionFX/Source/MorphSetupInstance.h>
#include <EMotionFX/Source/MorphTargetStandard.h>
@@ -27,6 +28,8 @@
#include <EMotionFX/Source/Node.h>
#include <MCore/Source/AzCoreConversions.h>
#include <Atom/RPI.Public/AuxGeom/AuxGeomDraw.h>
#include <Atom/RPI.Public/AuxGeom/AuxGeomFeatureProcessorInterface.h>
#include <Atom/RPI.Public/Scene.h>
#include <Atom/RPI.Public/Image/StreamingImage.h>
@@ -57,6 +60,8 @@ namespace AZ
Activate();
AzFramework::BoundsRequestBus::Handler::BusConnect(m_entityId);
}
m_auxGeomFeatureProcessor = RPI::Scene::GetFeatureProcessorForEntity<RPI::AuxGeomFeatureProcessorInterface>(m_entityId);
}
AtomActorInstance::~AtomActorInstance()
@@ -88,7 +93,119 @@ namespace AZ
AZ::Interface<AzFramework::IEntityBoundsUnion>::Get()->RefreshEntityLocalBoundsUnion(m_entityId);
}
AZ::Aabb AtomActorInstance:: GetWorldBounds()
void AtomActorInstance::DebugDraw(const DebugOptions& debugOptions)
{
if (m_auxGeomFeatureProcessor)
{
if (RPI::AuxGeomDrawPtr auxGeom = m_auxGeomFeatureProcessor->GetDrawQueue())
{
if (debugOptions.m_drawAABB)
{
const MCore::AABB emfxAabb = m_actorInstance->GetAABB();
const AZ::Aabb azAabb = AZ::Aabb::CreateFromMinMax(emfxAabb.GetMin(), emfxAabb.GetMax());
auxGeom->DrawAabb(azAabb, AZ::Color(0.0f, 1.0f, 1.0f, 1.0f), RPI::AuxGeomDraw::DrawStyle::Line);
}
if (debugOptions.m_drawSkeleton)
{
RenderSkeleton(auxGeom.get());
}
if (debugOptions.m_emfxDebugDraw)
{
RenderEMFXDebugDraw(auxGeom.get());
}
}
}
}
void AtomActorInstance::RenderSkeleton(RPI::AuxGeomDraw* auxGeom)
{
AZ_Assert(m_actorInstance, "Valid actor instance required.");
const EMotionFX::TransformData* transformData = m_actorInstance->GetTransformData();
const EMotionFX::Skeleton* skeleton = m_actorInstance->GetActor()->GetSkeleton();
const EMotionFX::Pose* pose = transformData->GetCurrentPose();
const AZ::u32 transformCount = transformData->GetNumTransforms();
const AZ::u32 lodLevel = m_actorInstance->GetLODLevel();
const AZ::u32 numJoints = skeleton->GetNumNodes();
m_auxVertices.clear();
m_auxVertices.reserve(numJoints * 2);
for (AZ::u32 jointIndex = 0; jointIndex < numJoints; ++jointIndex)
{
const EMotionFX::Node* joint = skeleton->GetNode(jointIndex);
if (!joint->GetSkeletalLODStatus(lodLevel))
{
continue;
}
const AZ::u32 parentIndex = joint->GetParentIndex();
if (parentIndex == InvalidIndex32)
{
continue;
}
const AZ::Vector3 parentPos = pose->GetWorldSpaceTransform(parentIndex).mPosition;
m_auxVertices.emplace_back(parentPos);
const AZ::Vector3 bonePos = pose->GetWorldSpaceTransform(jointIndex).mPosition;
m_auxVertices.emplace_back(bonePos);
}
const AZ::Color skeletonColor(0.604f, 0.804f, 0.196f, 1.0f);
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
lineArgs.m_verts = m_auxVertices.data();
lineArgs.m_vertCount = m_auxVertices.size();
lineArgs.m_colors = &skeletonColor;
lineArgs.m_colorCount = 1;
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
auxGeom->DrawLines(lineArgs);
}
void AtomActorInstance::RenderEMFXDebugDraw(RPI::AuxGeomDraw* auxGeom)
{
EMotionFX::DebugDraw& debugDraw = EMotionFX::GetDebugDraw();
debugDraw.Lock();
EMotionFX::DebugDraw::ActorInstanceData* actorInstanceData = debugDraw.GetActorInstanceData(m_actorInstance);
actorInstanceData->Lock();
const AZStd::vector<EMotionFX::DebugDraw::Line>& lines = actorInstanceData->GetLines();
if (lines.empty())
{
actorInstanceData->Unlock();
debugDraw.Unlock();
return;
}
m_auxVertices.clear();
m_auxVertices.reserve(lines.size() * 2);
m_auxColors.clear();
m_auxColors.reserve(m_auxVertices.size());
for (const EMotionFX::DebugDraw::Line& line : actorInstanceData->GetLines())
{
m_auxVertices.emplace_back(line.m_start);
m_auxColors.emplace_back(line.m_startColor);
m_auxVertices.emplace_back(line.m_end);
m_auxColors.emplace_back(line.m_endColor);
}
AZ_Assert(m_auxVertices.size() == m_auxColors.size(),
"Number of vertices and number of colors need to match.");
actorInstanceData->Unlock();
debugDraw.Unlock();
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
lineArgs.m_verts = m_auxVertices.data();
lineArgs.m_vertCount = m_auxVertices.size();
lineArgs.m_colors = m_auxColors.data();
lineArgs.m_colorCount = m_auxColors.size();
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
auxGeom->DrawLines(lineArgs);
}
AZ::Aabb AtomActorInstance::GetWorldBounds()
{
return m_worldAABB;
}
@@ -42,6 +42,8 @@ namespace EMotionFX
}
namespace AZ::RPI
{
class AuxGeomDraw;
class AuxGeomFeatureProcessorInterface;
class Model;
class Buffer;
class StreamingImage;
@@ -89,7 +91,7 @@ namespace AZ
// RenderActorInstance overrides ...
void OnTick(float timeDelta) override;
void UpdateBounds() override;
void DebugDraw(const DebugOptions& debugOptions) override { AZ_UNUSED(debugOptions) };
void DebugDraw(const DebugOptions& debugOptions) override;
void SetMaterials(const EMotionFX::Integration::ActorAsset::MaterialList& materialPerLOD) override { AZ_UNUSED(materialPerLOD); };
void SetSkinningMethod(EMotionFX::Integration::SkinningMethod emfxSkinningMethod);
SkinningMethod GetAtomSkinningMethod() const;
@@ -177,6 +179,13 @@ namespace AZ
void InitWrinkleMasks();
void UpdateWrinkleMasks();
// Helper and debug geometry rendering
void RenderSkeleton(RPI::AuxGeomDraw* auxGeom);
void RenderEMFXDebugDraw(RPI::AuxGeomDraw* auxGeom);
RPI::AuxGeomFeatureProcessorInterface* m_auxGeomFeatureProcessor = nullptr;
AZStd::vector<AZ::Vector3> m_auxVertices;
AZStd::vector<AZ::Color> m_auxColors;
AZStd::intrusive_ptr<AZ::Render::SkinnedMeshInputBuffers> m_skinnedMeshInputBuffers = nullptr;
AZStd::intrusive_ptr<SkinnedMeshInstance> m_skinnedMeshInstance;
AZ::Data::Instance<AZ::RPI::Buffer> m_boneTransforms = nullptr;
@@ -1,12 +0,0 @@
/*
* 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 "Camera_precompiled.h"
-1
View File
@@ -16,6 +16,5 @@ set(FILES camera_files.cmake
Source/CameraComponentController.cpp
Source/CameraComponentController.h
Source/CameraViewRegistrationBus.h
Source/Camera_precompiled.cpp
Source/Camera_precompiled.h
)
@@ -1,12 +0,0 @@
/*
* 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 "CameraFramework_precompiled.h"
@@ -16,6 +16,5 @@ set(FILES
Include/CameraFramework/ICameraTransformBehavior.h
Source/CameraRigComponent.h
Source/CameraRigComponent.cpp
Source/CameraFramework_precompiled.cpp
Source/CameraFramework_precompiled.h
)
@@ -1,13 +0,0 @@
/*
* 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 "DebugDraw_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/DebugDraw_precompiled.cpp
Source/DebugDraw_precompiled.h
Include/DebugDraw/DebugDrawBus.h
Source/DebugDrawModule.cpp
@@ -10,7 +10,6 @@
#
set(FILES
Source/DebugDraw_precompiled.cpp
Source/DebugDraw_precompiled.h
Include/DebugDraw/DebugDrawBus.h
Source/DebugDrawLineComponent.cpp
@@ -12,6 +12,7 @@
#pragma once
#include <AzCore/PlatformIncl.h>
#include <QOpenGLFunctions>
QT_FORWARD_DECLARE_CLASS(QOpenGLContext);
@@ -1,14 +0,0 @@
/*
* 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 "EMotionFX_precompiled.h"
@@ -435,19 +435,17 @@ namespace EMotionFX
void EditorActorComponent::LaunchAnimationEditor(const AZ::Data::AssetId& assetId, const AZ::Data::AssetType&)
{
// call to open must be done before LoadCharacter
const char* panelName = EMStudio::MainWindow::GetEMotionFXPaneName();
EBUS_EVENT(AzToolsFramework::EditorRequests::Bus, OpenViewPane, panelName);
if (assetId.IsValid())
{
AZ::Data::AssetId animgraphAssetId;
animgraphAssetId.SetInvalid();
EditorAnimGraphComponentRequestBus::EventResult(animgraphAssetId, GetEntityId(), &EditorAnimGraphComponentRequestBus::Events::GetAnimGraphAssetId);
AZ::Data::AssetId motionSetAssetId;
motionSetAssetId.SetInvalid();
EditorAnimGraphComponentRequestBus::EventResult(motionSetAssetId, GetEntityId(), &EditorAnimGraphComponentRequestBus::Events::GetMotionSetAssetId);
// call to open must be done before LoadCharacter
const char* panelName = EMStudio::MainWindow::GetEMotionFXPaneName();
EBUS_EVENT(AzToolsFramework::EditorRequests::Bus, OpenViewPane, panelName);
EMStudio::MainWindow* mainWindow = EMStudio::GetMainWindow();
if (mainWindow)
{
@@ -555,6 +553,7 @@ namespace EMotionFX
RenderActorInstance::DebugOptions debugOptions;
debugOptions.m_drawAABB = m_renderBounds;
debugOptions.m_drawSkeleton = m_renderSkeleton;
debugOptions.m_emfxDebugDraw = true;
m_renderActorInstance->DebugDraw(debugOptions);
}
}
@@ -10,7 +10,6 @@
#
set(FILES
Source/EMotionFX_precompiled.cpp
Source/EMotionFX_precompiled.h
../Assets/Editor/Layouts/Layouts.qrc
../Assets/Editor/Images/Icons/Resources.qrc
@@ -10,7 +10,6 @@
#
set(FILES
Source/EMotionFX_precompiled.cpp
Source/EMotionFX_precompiled.h
Include/Integration/AnimationBus.h
Include/Integration/MotionExtractionBus.h
@@ -1,12 +0,0 @@
/*
* 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 "FastNoise_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/FastNoise_precompiled.cpp
Source/FastNoise_precompiled.h
Include/FastNoise/Ebuses/FastNoiseBus.h
Include/FastNoise/Ebuses/FastNoiseGradientRequestBus.h
@@ -1,12 +0,0 @@
/*
* 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 "Gestures_precompiled.h"
-1
View File
@@ -10,7 +10,6 @@
#
set(FILES
Source/Gestures_precompiled.cpp
Source/Gestures_precompiled.h
Include/Gestures/GestureRecognizerClickOrTap.h
Include/Gestures/GestureRecognizerClickOrTap.inl
@@ -1,12 +0,0 @@
/*
* 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 "GradientSignal_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/GradientSignal_precompiled.cpp
Source/GradientSignal_precompiled.h
Include/GradientSignal/GradientSampler.h
Include/GradientSignal/SmoothStep.h
@@ -147,16 +147,17 @@ namespace GraphCanvas
return true;
}
QString test = model->data(index).toString();
QString test = model->data(index).toString();
bool showRow = false;
int regexIndex = test.lastIndexOf(m_filterRegex);
int regexIndex = m_filterRegex.indexIn(test);
if (regexIndex >= 0)
{
showRow = true;
AZStd::pair<int, int> highlight(regexIndex, m_filter.size());
AZStd::pair<int, int> highlight(regexIndex, m_filterRegex.matchedLength());
currentItem->SetHighlight(highlight);
}
else
@@ -283,8 +284,20 @@ namespace GraphCanvas
void NodePaletteSortFilterProxyModel::SetFilter(const QString& filter)
{
m_filter = QRegExp::escape(filter);
m_filterRegex = QRegExp(m_filter, Qt::CaseInsensitive);
// Remove whitespace and escape() so every regexp special character is escaped with a backslash
// Then ignore all whitespace by adding \s* (regex optional whitespace match) in between every other character.
// We use \s* instead of simply removing all whitespace from the filter and node-names in order to preserve the node-name and accurately highlight the matching portion.
// Example: "OnGraphStart" or "On Graph Start"
m_filter = QRegExp::escape(filter.simplified().replace(" ", ""));
QString regExIgnoreWhitespace(m_filter[0]);
for (int i = 1; i < m_filter.size(); ++i)
{
regExIgnoreWhitespace.append("\\s*");
regExIgnoreWhitespace.append(m_filter[i]);
}
m_filterRegex = QRegExp(regExIgnoreWhitespace, Qt::CaseInsensitive);
}
void NodePaletteSortFilterProxyModel::ClearFilter()
@@ -10,7 +10,6 @@
#
set(FILES
precompiled.cpp
precompiled.h
Include/GraphCanvas/Widgets/RootGraphicsItem.h
Include/GraphCanvas/tools.h
-14
View File
@@ -1,14 +0,0 @@
/*
* 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 "precompiled.h"
@@ -1,13 +0,0 @@
/*
* 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 "HttpRequestor_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/HttpRequestor_precompiled.cpp
Source/HttpRequestor_precompiled.h
Source/HttpRequestManager.cpp
Source/HttpRequestManager.h
@@ -10,7 +10,6 @@
#
set(FILES
Source/HttpRequestor_precompiled.cpp
Source/HttpRequestor_precompiled.h
Source/ComponentStub.cpp
)
@@ -1,12 +0,0 @@
/*
* 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 "ImGui_precompiled.h"
-1
View File
@@ -10,7 +10,6 @@
#
set(FILES
Source/ImGui_precompiled.cpp
Source/ImGui_precompiled.h
Include/ImGuiBus.h
Include/ImGuiContextScope.h
@@ -10,7 +10,6 @@
#
set(FILES
Source/ImGui_precompiled.cpp
Source/ImGui_precompiled.h
Include/LYImGuiUtils/HistogramContainer.h
Include/LYImGuiUtils/ImGuiDrawHelpers.h
@@ -1,13 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or
* a third party where indicated.
*
* 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 "InAppPurchases_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/InAppPurchases_precompiled.cpp
Source/InAppPurchases_precompiled.h
Include/InAppPurchases/InAppPurchasesBus.h
Include/InAppPurchases/InAppPurchasesInterface.h
@@ -1,13 +0,0 @@
/*
* 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 "LmbrCentral_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/LmbrCentral_precompiled.cpp
Source/LmbrCentral_precompiled.h
include/LmbrCentral/Ai/NavigationComponentBus.h
include/LmbrCentral/Ai/NavigationAreaBus.h
@@ -1,12 +0,0 @@
/*
* 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 "UiCanvasEditor_precompiled.h"
@@ -1,13 +0,0 @@
/*
* 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 "LyShine_precompiled.h"
@@ -1,13 +0,0 @@
/*
* 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 "LyShine_precompiled.h"
@@ -16,7 +16,6 @@ set(FILES
Source/LyShine.h
Source/LyShineDebug.cpp
Source/LyShineDebug.h
Source/LyShine_precompiled.cpp
Source/LyShine_precompiled.h
Source/StringUtfUtils.h
Source/UiImageComponent.cpp
@@ -12,7 +12,6 @@
set(FILES
Editor/LyShineEditorSystemComponent.cpp
Editor/LyShineEditorSystemComponent.h
Editor/UiCanvasEditor_precompiled.cpp
Editor/UiCanvasEditor_precompiled.h
Editor/UiCanvasEditor.qrc
Editor/Animation/UiAnimViewDialog.cpp
@@ -1,13 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or
* a third party where indicated.
*
* 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 "LyShineExamples_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/LyShineExamples_precompiled.cpp
Source/LyShineExamples_precompiled.h
Include/LyShineExamples/LyShineExamplesBus.h
Include/LyShineExamples/LyShineExamplesCppExampleBus.h
@@ -1,14 +0,0 @@
/*
* 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.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#include "Maestro_precompiled.h"
@@ -1,12 +0,0 @@
/*
* 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 "Maestro_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/Maestro_precompiled.cpp
Source/Maestro_precompiled.h
Source/Cinematics/ShadowsSetupNode.h
Source/Cinematics/ShadowsSetupNode.cpp
@@ -1,12 +0,0 @@
/*
* 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 "MessagePopup_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/MessagePopup_precompiled.cpp
Source/MessagePopup_precompiled.h
Include/MessagePopup/MessagePopupBus.h
Source/MessagePopupSystemComponent.cpp
@@ -1,12 +0,0 @@
/*
* 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 "Metastream_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/Metastream_precompiled.cpp
Source/Metastream_precompiled.h
Include/Metastream/MetastreamBus.h
Source/DataCache.h
@@ -1,13 +0,0 @@
/*
* 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 "Microphone_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/Microphone_precompiled.cpp
Source/Microphone_precompiled.h
Source/MicrophoneSystemComponent.cpp
Source/MicrophoneSystemComponent.h
@@ -368,26 +368,26 @@ void {{ ClassName }}::Signal{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.jo
->Method("{{ UpperFirst(Property.attrib['Name']) }}", [](const {{ ClassName }}* self, {{ ', '.join(paramDefines) }}) {
self->m_controller->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }});
})
->Method("{{ UpperFirst(Property.attrib['Name']) }}ByEntity", [](AZ::EntityId id, {{ ', '.join(paramDefines) }}) {
->Method("{{ UpperFirst(Property.attrib['Name']) }}ByEntityId", [](AZ::EntityId id, {{ ', '.join(paramDefines) }}) {
AZ::Entity* entity = AZ::Interface<AZ::ComponentApplicationRequests>::Get()->FindEntity(id);
if (!entity)
{
AZ_Warning("Network Property", false, "{{ ClassName }} Get{{ UpperFirst(Property.attrib['Name']) }} failed. The entity with id %s doesn't exist, please provide a valid entity id.", id.ToString().c_str())
AZ_Warning("Network Property", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId failed. The entity with id %s doesn't exist, please provide a valid entity id.", id.ToString().c_str())
return;
}
{{ ClassName }}* networkComponent = entity->FindComponent<{{ ClassName }}>();
if (!networkComponent)
{
AZ_Warning("Network Property", false, "{{ ClassName }} Get{{ UpperFirst(Property.attrib['Name']) }} failed. Entity '%s' (id: %s) is missing {{ ClassName }}, be sure to add {{ ClassName }} to this entity.", entity->GetName().c_str(), id.ToString().c_str())
AZ_Warning("Network Property", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId failed. Entity '%s' (id: %s) is missing {{ ClassName }}, be sure to add {{ ClassName }} to this entity.", entity->GetName().c_str(), id.ToString().c_str())
return;
}
{{ ClassName }}Controller* controller = static_cast<{{ ClassName }}Controller*>(networkComponent->GetController());
if (!controller)
{
AZ_Warning("Network Property", false, "{{ ClassName }} Get{{ UpperFirst(Property.attrib['Name']) }} method failed. Entity '%s' (id: %s) {{ ClassName }} is missing the network controller. This RemoteProcedure can only be invoked from {{InvokeFrom}} network entities, because this entity doesn't have a controller, it must not be a {{InvokeFrom}} entity. Please check your network context before attempting to call {{ UpperFirst(Property.attrib['Name']) }}.", entity->GetName().c_str(), id.ToString().c_str())
AZ_Warning("Network Property", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId method failed. Entity '%s' (id: %s) {{ ClassName }} is missing the network controller. This RemoteProcedure can only be invoked from {{InvokeFrom}} network entities, because this entity doesn't have a controller, it must not be a {{InvokeFrom}} entity. Please check your network context before attempting to call {{ UpperFirst(Property.attrib['Name']) }}.", entity->GetName().c_str(), id.ToString().c_str())
return;
}
@@ -429,6 +429,32 @@ void {{ ClassName }}::Signal{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.jo
->Method("Get{{ UpperFirst(Property.attrib['Name']) }}Event", [](const {{ ClassName }}* self) -> AZ::Event<{{ ', '.join(paramTypes) }}>&
{
return self->m_controller->Get{{ UpperFirst(Property.attrib['Name']) }}Event();
})
->Attribute(AZ::Script::Attributes::AzEventDescription, {{ LowerFirst(Property.attrib['Name']) }}EventDesc)
->Method("Get{{ UpperFirst(Property.attrib['Name']) }}EventByEntityId", [](AZ::EntityId id) -> AZ::Event<{{ ', '.join(paramTypes) }}>*
{
AZ::Entity* entity = AZ::Interface<AZ::ComponentApplicationRequests>::Get()->FindEntity(id);
if (!entity)
{
AZ_Warning("Network Property", false, "{{ ClassName }} Get{{ UpperFirst(Property.attrib['Name']) }}EventByEntityId failed. The entity with id %s doesn't exist, please provide a valid entity id.", id.ToString().c_str())
return nullptr;
}
{{ ClassName }}* networkComponent = entity->FindComponent<{{ ClassName }}>();
if (!networkComponent)
{
AZ_Warning("Network Property", false, "{{ ClassName }} Get{{ UpperFirst(Property.attrib['Name']) }}EventByEntityId failed. Entity '%s' (id: %s) is missing {{ ClassName }}, be sure to add {{ ClassName }} to this entity.", entity->GetName().c_str(), id.ToString().c_str())
return nullptr;
}
{{ ClassName }}Controller* controller = static_cast<{{ ClassName }}Controller*>(networkComponent->GetController());
if (!controller)
{
AZ_Warning("Network Property", false, "{{ ClassName }} Get{{ UpperFirst(Property.attrib['Name']) }}EventByEntity method failed. Entity '%s' (id: %s) {{ ClassName }} is missing the network controller. This RemoteProcedure can only be received by {{InvokeTo}} network entities, because this entity doesn't have a controller, it must not be a {{InvokeTo}} entity. Please check your network context before attempting to Get{{ UpperFirst(Property.attrib['Name']) }}Event.", entity->GetName().c_str(), id.ToString().c_str())
return nullptr;
}
return &controller->Get{{ UpperFirst(Property.attrib['Name']) }}Event();
})
->Attribute(AZ::Script::Attributes::AzEventDescription, AZStd::move({{ LowerFirst(Property.attrib['Name']) }}EventDesc))
{% endif %}
@@ -1,13 +0,0 @@
/*
* 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 "Multiplayer_precompiled.h"
@@ -10,7 +10,6 @@
#
set(FILES
Source/Multiplayer_precompiled.cpp
Source/Multiplayer_precompiled.h
Source/Debug/MultiplayerDebugModule.cpp
Source/Debug/MultiplayerDebugModule.h
@@ -41,7 +41,6 @@ set(FILES
Include/Multiplayer/NetworkTime/RewindableObject.inl
Include/Multiplayer/Physics/PhysicsUtils.h
Include/Multiplayer/ReplicationWindows/IReplicationWindow.h
Source/Multiplayer_precompiled.cpp
Source/Multiplayer_precompiled.h
Source/MultiplayerSystemComponent.cpp
Source/MultiplayerSystemComponent.h
@@ -11,7 +11,6 @@
set(FILES
Include/Multiplayer/IMultiplayerTools.h
Source/Multiplayer_precompiled.cpp
Source/Multiplayer_precompiled.h
Source/Pipeline/NetworkPrefabProcessor.cpp
Source/Pipeline/NetworkPrefabProcessor.h
@@ -1,13 +0,0 @@
/*
* 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 <NumericalMethods_precompiled.h>
@@ -10,7 +10,6 @@
#
set(FILES
Source/NumericalMethods_precompiled.cpp
Source/NumericalMethods_precompiled.h
Include/NumericalMethods/Optimization.h
Include/NumericalMethods/Eigenanalysis.h
@@ -1,13 +0,0 @@
/*
* 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 <PhysXUnsupported_precompiled.h>
@@ -1,13 +0,0 @@
/*
* 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 <PhysX_precompiled.h>
-1
View File
@@ -10,7 +10,6 @@
#
set(FILES
Source/PhysX_precompiled.cpp
Source/PhysX_precompiled.h
Source/SystemComponent.cpp
Source/SystemComponent.h
@@ -1,13 +0,0 @@
/*
* 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 <PhysXDebugUnsupported_precompiled.h>
@@ -1,12 +0,0 @@
/*
* 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 "PhysXDebug_precompiled.h"
@@ -42,7 +42,7 @@ namespace PhysXDebug
const float SystemComponent::m_maxCullingBoxSize = 150.0f;
namespace Internal
{
const AZ::Crc32 VewportId = 0; // was AzFramework::g_defaultSceneEntityDebugDisplayId but it didn't render to the viewport.
const AZ::Crc32 VewportId = AzFramework::g_defaultSceneEntityDebugDisplayId;
}
bool UseEditorPhysicsScene()
@@ -565,9 +565,9 @@ namespace PhysXDebug
static void physx_CullingBoxSize([[maybe_unused]] const AZ::ConsoleCommandContainer& arguments)
{
const int argumentCount = arguments.size();
if (argumentCount == 2)
if (argumentCount == 1)
{
float newCullingBoxSize = (float)strtol(AZ::CVarFixedString(arguments[1]).c_str(), nullptr, 10);
float newCullingBoxSize = (float)strtol(AZ::CVarFixedString(arguments[0]).c_str(), nullptr, 10);
PhysXDebug::PhysXDebugRequestBus::Broadcast(&PhysXDebug::PhysXDebugRequestBus::Events::SetCullingBoxSize, newCullingBoxSize);
}
else
@@ -584,9 +584,9 @@ namespace PhysXDebug
const int argumentCount = arguments.size();
if (argumentCount == 2)
if (argumentCount == 1)
{
const auto userPreference = static_cast<DebugCVarValues>(strtol(AZ::CVarFixedString(arguments[1]).c_str(), nullptr, 10));
const auto userPreference = static_cast<DebugCVarValues>(strtol(AZ::CVarFixedString(arguments[0]).c_str(), nullptr, 10));
switch (userPreference)
{
@@ -10,7 +10,6 @@
#
set(FILES
Source/PhysXDebug_precompiled.cpp
Source/PhysXDebug_precompiled.h
Source/EditorSystemComponent.cpp
Source/EditorSystemComponent.h
@@ -10,7 +10,6 @@
#
set(FILES
Source/PhysXDebug_precompiled.cpp
Source/PhysXDebug_precompiled.h
Include/PhysXDebug/PhysXDebugBus.h
Source/Module.cpp
@@ -11,6 +11,5 @@
set(FILES
Source/ModuleUnsupported.cpp
Source/PhysXDebugUnsupported_precompiled.cpp
Source/PhysXDebugUnsupported_precompiled.h
)

Some files were not shown because too many files have changed in this diff Show More