Merge pull request #1511 from aws-lumberyard-dev/WhiteBoxAtomMeshFix
Fix for White Box mesh disappearing
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <AzCore/Math/Vector2.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <AzCore/Math/Vector4.h>
|
||||
#include <AzCore/Math/Aabb.h>
|
||||
#include <AzCore/Math/Transform.h>
|
||||
#include <AzCore/Math/Color.h>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -45,6 +45,6 @@ namespace WhiteBox
|
||||
AZStd::vector<AZ::PackedVector3f> m_bitangents;
|
||||
AZStd::vector<PackedFloat2> m_uvs;
|
||||
AZStd::vector<AZ::Vector4> m_colors;
|
||||
AZ::Aabb m_aabb;
|
||||
AZ::Aabb m_aabb = AZ::Aabb::CreateNull();
|
||||
};
|
||||
} // namespace WhiteBox
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "Util/WhiteBoxTextureUtil.h"
|
||||
#include "WhiteBoxTestFixtures.h"
|
||||
#include "Rendering/Atom/WhiteBoxMeshAtomData.h"
|
||||
|
||||
#include <AzCore/Casting/lossy_cast.h>
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user