diff --git a/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.cpp b/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.cpp index f9616702f1..995c09a2cc 100644 --- a/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.cpp +++ b/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -53,6 +54,11 @@ namespace AZ << ")"; } + std::ostream& operator<<(std::ostream& os, const Aabb& aabb) + { + return os << "(min: " << aabb.GetMin() << ", max: " << aabb.GetMax() << ")"; + } + std::ostream& operator<<(std::ostream& os, const Quaternion& quat) { return os diff --git a/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.h b/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.h index d05260e455..c37fa42ff7 100644 --- a/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.h +++ b/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.h @@ -25,12 +25,14 @@ namespace AZ class Vector2; class Vector3; class Vector4; + class Aabb; class Transform; class Color; std::ostream& operator<<(std::ostream& os, const Vector2& vec); std::ostream& operator<<(std::ostream& os, const Vector3& vec); std::ostream& operator<<(std::ostream& os, const Vector4& vec); + std::ostream& operator<<(std::ostream& os, const Aabb& aabb); std::ostream& operator<<(std::ostream& os, const Quaternion& quat); std::ostream& operator<<(std::ostream& os, const Transform& transform); std::ostream& operator<<(std::ostream& os, const Color& transform); diff --git a/Gems/WhiteBox/Code/Source/Rendering/Atom/WhiteBoxMeshAtomData.h b/Gems/WhiteBox/Code/Source/Rendering/Atom/WhiteBoxMeshAtomData.h index 46cf235c8a..68dcaad087 100644 --- a/Gems/WhiteBox/Code/Source/Rendering/Atom/WhiteBoxMeshAtomData.h +++ b/Gems/WhiteBox/Code/Source/Rendering/Atom/WhiteBoxMeshAtomData.h @@ -45,6 +45,6 @@ namespace WhiteBox AZStd::vector m_bitangents; AZStd::vector m_uvs; AZStd::vector m_colors; - AZ::Aabb m_aabb; + AZ::Aabb m_aabb = AZ::Aabb::CreateNull(); }; } // namespace WhiteBox diff --git a/Gems/WhiteBox/Code/Tests/WhiteBoxUVTest.cpp b/Gems/WhiteBox/Code/Tests/WhiteBoxUVTest.cpp index 9568eaa03c..efdd82d96c 100644 --- a/Gems/WhiteBox/Code/Tests/WhiteBoxUVTest.cpp +++ b/Gems/WhiteBox/Code/Tests/WhiteBoxUVTest.cpp @@ -14,6 +14,7 @@ #include "Util/WhiteBoxTextureUtil.h" #include "WhiteBoxTestFixtures.h" +#include "Rendering/Atom/WhiteBoxMeshAtomData.h" #include #include @@ -285,4 +286,10 @@ namespace UnitTest ::testing::ValuesIn(Noise), ::testing::ValuesIn(Source), ::testing::Values(Rotation::Identity, Rotation::XZAxis))); + TEST(WhiteBoxRenderTest, WhiteBoxMeshAtomDataAabbIsInitializedToNull) + { + WhiteBox::WhiteBoxMeshAtomData atomData(WhiteBox::WhiteBoxFaces{}); + EXPECT_EQ(atomData.GetAabb(), AZ::Aabb::CreateNull()); + } + } // namespace UnitTest