Physics joints updated to the new API (#1361)
Co-authored-by: Ulugbek Adilbekov <ulugbek@amazon.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <QPushButton>
|
||||
@@ -29,6 +30,7 @@
|
||||
#include <Tests/UI/ModalPopupHandler.h>
|
||||
#include <Tests/UI/UIFixture.h>
|
||||
#include <Tests/D6JointLimitConfiguration.h>
|
||||
#include <Tests/Mocks/PhysicsSystem.h>
|
||||
|
||||
namespace EMotionFX
|
||||
{
|
||||
@@ -140,6 +142,31 @@ namespace EMotionFX
|
||||
|
||||
TEST_F(CanAddToSimulatedObjectFixture, CanAddCollidersfromRagdoll)
|
||||
{
|
||||
using ::testing::_;
|
||||
Physics::MockJointHelpersInterface jointHelpers;
|
||||
EXPECT_CALL(jointHelpers, GetSupportedJointTypeIds)
|
||||
.WillRepeatedly(testing::Return(AZStd::vector<AZ::TypeId>{ azrtti_typeid<D6JointLimitConfiguration>() }));
|
||||
|
||||
EXPECT_CALL(jointHelpers, GetSupportedJointTypeId(_))
|
||||
.WillRepeatedly(
|
||||
[](AzPhysics::JointType jointType) -> AZStd::optional<const AZ::TypeId>
|
||||
{
|
||||
if (jointType == AzPhysics::JointType::D6Joint)
|
||||
{
|
||||
return azrtti_typeid<D6JointLimitConfiguration>();
|
||||
}
|
||||
return AZStd::nullopt;
|
||||
});
|
||||
|
||||
EXPECT_CALL(jointHelpers, ComputeInitialJointLimitConfiguration(_, _, _, _, _))
|
||||
.WillRepeatedly(
|
||||
[]([[maybe_unused]] const AZ::TypeId& jointLimitTypeId, [[maybe_unused]] const AZ::Quaternion& parentWorldRotation,
|
||||
[[maybe_unused]] const AZ::Quaternion& childWorldRotation, [[maybe_unused]] const AZ::Vector3& axis,
|
||||
[[maybe_unused]] const AZStd::vector<AZ::Quaternion>& exampleLocalRotations)
|
||||
{
|
||||
return AZStd::make_unique<D6JointLimitConfiguration>();
|
||||
});
|
||||
|
||||
RecordProperty("test_case_id", "C13291807");
|
||||
AutoRegisteredActor actor = ActorFactory::CreateAndInit<SimpleJointChainActor>(7, "CanAddToSimulatedObjectActor");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user