LoadRigTest.h 1.2 KB

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