LoadRigTest.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. class LoadRigTest : public Test
  9. {
  10. public:
  11. JPH_DECLARE_RTTI_VIRTUAL(JPH_NO_EXPORT, LoadRigTest)
  12. // Description of the test
  13. virtual const char * GetDescription() const override
  14. {
  15. return "Loads a ragdoll from disc and simulates it.";
  16. }
  17. // Destructor
  18. virtual ~LoadRigTest() override;
  19. // Number used to scale the terrain and camera movement to the scene
  20. virtual float GetWorldScale() const override { return 0.2f; }
  21. virtual void Initialize() override;
  22. // Optional settings menu
  23. virtual bool HasSettingsMenu() const override { return true; }
  24. virtual void CreateSettingsMenu(DebugUI *inUI, UIElement *inSubMenu) override;
  25. private:
  26. // Our ragdoll
  27. Ref<RagdollSettings> mRagdollSettings;
  28. Ref<Ragdoll> mRagdoll;
  29. struct ConstraintNameAndType
  30. {
  31. const char * mName;
  32. EConstraintOverride mType;
  33. };
  34. // List of possible constraint types and their names
  35. static ConstraintNameAndType sTypes[];
  36. // Type of constraints to create for this test
  37. static EConstraintOverride sConstraintType;
  38. };