Fixed emfx unit tests
Signed-off-by: Benjamin Jillich <jillich@amazon.com>
This commit is contained in:
@@ -49,8 +49,6 @@ namespace EMotionFX
|
||||
if (serializeContext)
|
||||
{
|
||||
// Increasing the version number of the actor group exporter will make sure all actor products will be force re-generated.
|
||||
// Version history:
|
||||
// v3: Introduced Actor_Nodes2 (replaced Actor_Nodes) and Actor_Node2 (replaced Actor_Node)
|
||||
serializeContext->Class<ActorGroupExporter, AZ::SceneAPI::SceneCore::ExportingComponent>()->Version(3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <AzCore/Math/Matrix4x4.h>
|
||||
#include <AzCore/Math/Vector2.h>
|
||||
#include <MCore/Source/AABB.h>
|
||||
#include <MCore/Source/Vector.h>
|
||||
#include <MCore/Source/Ray.h>
|
||||
#include "MCommonConfig.h"
|
||||
|
||||
@@ -240,8 +240,8 @@ namespace MCommon
|
||||
// render selection gizmo around the given AABB
|
||||
void RenderUtil::RenderSelection(const AZ::Aabb& box, const MCore::RGBAColor& color, bool directlyRender)
|
||||
{
|
||||
const AZ::Vector3 min = box.GetMin();
|
||||
const AZ::Vector3 max = box.GetMax();
|
||||
const AZ::Vector3& min = box.GetMin();
|
||||
const AZ::Vector3& max = box.GetMax();
|
||||
const float radius = AZ::Vector3(box.GetMax() - box.GetMin()).GetLength() * 0.5f;
|
||||
const float scale = radius * 0.1f;
|
||||
const AZ::Vector3 up = AZ::Vector3(0.0f, 1.0f, 0.0f) * scale;
|
||||
@@ -249,15 +249,17 @@ namespace MCommon
|
||||
const AZ::Vector3 front = AZ::Vector3(0.0f, 0.0f, 1.0f) * scale;
|
||||
|
||||
// generate our vertices
|
||||
AZ::Vector3 p[8];
|
||||
p[0].Set(min.GetX(), min.GetY(), min.GetZ());
|
||||
p[1].Set(max.GetX(), min.GetY(), min.GetZ());
|
||||
p[2].Set(max.GetX(), min.GetY(), max.GetZ());
|
||||
p[3].Set(min.GetX(), min.GetY(), max.GetZ());
|
||||
p[4].Set(min.GetX(), max.GetY(), min.GetZ());
|
||||
p[5].Set(max.GetX(), max.GetY(), min.GetZ());
|
||||
p[6].Set(max.GetX(), max.GetY(), max.GetZ());
|
||||
p[7].Set(min.GetX(), max.GetY(), max.GetZ());
|
||||
const AZStd::array p
|
||||
{
|
||||
AZ::Vector3{min.GetX(), min.GetY(), min.GetZ()},
|
||||
AZ::Vector3{max.GetX(), min.GetY(), min.GetZ()},
|
||||
AZ::Vector3{max.GetX(), min.GetY(), max.GetZ()},
|
||||
AZ::Vector3{min.GetX(), min.GetY(), max.GetZ()},
|
||||
AZ::Vector3{min.GetX(), max.GetY(), min.GetZ()},
|
||||
AZ::Vector3{max.GetX(), max.GetY(), min.GetZ()},
|
||||
AZ::Vector3{max.GetX(), max.GetY(), max.GetZ()},
|
||||
AZ::Vector3{min.GetX(), max.GetY(), max.GetZ()},
|
||||
};
|
||||
|
||||
// render the box
|
||||
RenderLine(p[0], p[0] + up, color);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// include the Core system
|
||||
#include <MCore/Source/AABB.h>
|
||||
#include <MCore/Source/Vector.h>
|
||||
#include <MCore/Source/Ray.h>
|
||||
#include "MCommonConfig.h"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <AzCore/std/smart_ptr/unique_ptr.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <AzCore/std/typetraits/integral_constant.h>
|
||||
#include <AzCore/Math/AABB.h>
|
||||
#include <AzCore/Math/Aabb.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <AzCore/Math/Color.h>
|
||||
|
||||
|
||||
@@ -635,7 +635,7 @@ namespace EMotionFX
|
||||
}
|
||||
|
||||
// Expand the bounding volume by a tolerance area in case set.
|
||||
if (m_boundsExpandBy > 0.0f)
|
||||
if (!AZ::IsClose(m_boundsExpandBy, 0.0f))
|
||||
{
|
||||
const AZ::Vector3 center = m_aabb.GetCenter();
|
||||
const AZ::Vector3 halfExtents = m_aabb.GetExtents() * 0.5f;
|
||||
|
||||
+1
-1
@@ -6,7 +6,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// include the required headers
|
||||
#include "RenderWidget.h"
|
||||
#include "RenderPlugin.h"
|
||||
#include <EMotionFX/Rendering/Common/OrbitCamera.h>
|
||||
@@ -21,6 +20,7 @@
|
||||
#include "../EMStudioManager.h"
|
||||
#include "../MainWindow.h"
|
||||
#include <MCore/Source/AzCoreConversions.h>
|
||||
#include <MCore/Source/AABB.h>
|
||||
|
||||
|
||||
namespace EMStudio
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace EMotionFX
|
||||
"The method used to compute the Actor bounding box. NOTE: ordered by least expensive to compute to most expensive to compute.")
|
||||
->EnumAttribute(ActorInstance::BOUNDS_STATIC_BASED, "Static (Recommended)")
|
||||
->EnumAttribute(ActorInstance::BOUNDS_NODE_BASED, "Bone position-based")
|
||||
->EnumAttribute(ActorInstance::BOUNDS_MESH_BASED, "Mesh vertex-based (Expensive)")
|
||||
->EnumAttribute(ActorInstance::BOUNDS_MESH_BASED, "Mesh vertex-based (VERY EXPENSIVE)")
|
||||
->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree)
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &ActorComponent::BoundingBoxConfiguration::m_expandBy,
|
||||
"Expand by",
|
||||
@@ -75,7 +75,7 @@ namespace EMotionFX
|
||||
"This can be used to add a tolerance area to the calculated bounding box to avoid clipping the character too early. "
|
||||
"A static bounding box together with the expansion is the recommended way for maximum performance. (Default = 25%)")
|
||||
->Attribute(AZ::Edit::Attributes::Suffix, " %")
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.0f)
|
||||
->Attribute(AZ::Edit::Attributes::Min, -100.0f + AZ::Constants::Tolerance)
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &ActorComponent::BoundingBoxConfiguration::m_autoUpdateBounds,
|
||||
"Automatically update bounds?",
|
||||
"If true, bounds are automatically updated based on some frequency. Otherwise bounds are computed only at creation or when triggered manually")
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace EMotionFX
|
||||
}
|
||||
|
||||
// Ensure the Actor is correct
|
||||
ASSERT_TRUE(GetActorManager().FindActorByName("rinactor"));
|
||||
ASSERT_TRUE(GetActorManager().FindActorByName("rinActor"));
|
||||
EXPECT_EQ(GetActorManager().GetNumActors(), 1);
|
||||
}
|
||||
} // namespace EMotionFX
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace EMotionFX
|
||||
actor->SetID(0);
|
||||
actor->GetSkeleton()->UpdateNodeIndexValues(0);
|
||||
actor->ResizeTransformData();
|
||||
actor->PostCreateInit(/*makeGeomLodsCompatibleWithSkeletalLODs=*/false, /*generateOBBs=*/false, /*convertUnitType=*/false);
|
||||
actor->PostCreateInit(/*makeGeomLodsCompatibleWithSkeletalLODs=*/false, /*convertUnitType=*/false);
|
||||
return actor;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7db74f39a261bb70e1fdbdd546c337107809cdbdd1fc52568a0d30358b0f83d7
|
||||
size 30005
|
||||
oid sha256:55ecbc78a913c808cd007326b51dfc98b943b196b77fd6dc16aff0892b112e74
|
||||
size 16948
|
||||
|
||||
Reference in New Issue
Block a user