LoadRigTest.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <Tests/Test.h>
  5. #include <Jolt/Physics/Ragdoll/Ragdoll.h>
  6. #include <Utils/RagdollLoader.h>
  7. // This test loads a ragdoll from disc and simulates it
  8. class LoadRigTest : public Test
  9. {
  10. public:
  11. JPH_DECLARE_RTTI_VIRTUAL(LoadRigTest)
  12. // Destructor
  13. virtual ~LoadRigTest() override;
  14. // Number used to scale the terrain and camera movement to the scene
  15. virtual float GetWorldScale() const override { return 0.2f; }
  16. virtual void Initialize() override;
  17. // Optional settings menu
  18. virtual bool HasSettingsMenu() const override { return true; }
  19. virtual void CreateSettingsMenu(DebugUI *inUI, UIElement *inSubMenu) override;
  20. private:
  21. // Our ragdoll
  22. Ref<RagdollSettings> mRagdollSettings;
  23. Ref<Ragdoll> mRagdoll;
  24. struct ConstraintNameAndType
  25. {
  26. const char * mName;
  27. EConstraintOverride mType;
  28. };
  29. // List of possible constraint types and their names
  30. static ConstraintNameAndType sTypes[];
  31. // Type of constraints to create for this test
  32. static EConstraintOverride sConstraintType;
  33. };