/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #pragma once #include #include #include #include #include namespace AzPhysics { struct TriggerEvent; } namespace PhysXEditorTests { using EntityPtr = AZStd::unique_ptr; //! Creates a default editor entity in an inactive state. EntityPtr CreateInactiveEditorEntity(const char* entityName); //! Creates and activates a game entity from an editor entity. EntityPtr CreateActiveGameEntityFromEditorEntity(AZ::Entity* editorEntity); //! Class used for loading system components from this gem. class PhysXEditorSystemComponentEntity : public AZ::Entity { friend class PhysXEditorFixture; }; //! Test fixture which creates a tools application, loads the PhysX runtime gem and creates a default physics world. //! The application is created for the whole test case, rather than individually for each test, due to a known //! problem with buses when repeatedly loading and unloading gems. A new default world is created for each test. class PhysXEditorFixture : public UnitTest::AllocatorsTestFixture , public Physics::DefaultWorldBus::Handler { public: void SetUp() override; void TearDown() override; void ConnectToPVD(); void DisconnectFromPVD(); // DefaultWorldBus AzPhysics::SceneHandle GetDefaultSceneHandle() const override; AzPhysics::SceneHandle m_defaultSceneHandle = AzPhysics::InvalidSceneHandle; AzPhysics::Scene* m_defaultScene = nullptr; // workaround for parameterized tests causing issues with this (and any derived) fixture void ValidateInvalidEditorShapeColliderComponentParams(float radius, float height); }; } // namespace PhysXEditorTests