CreateRigTest.cpp 712 B

12345678910111213141516171819202122232425262728293031
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2022 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #include <TestFramework.h>
  5. #include <Tests/Rig/CreateRigTest.h>
  6. #include <Application/DebugUI.h>
  7. #include <Utils/RagdollLoader.h>
  8. #include <Layers.h>
  9. JPH_IMPLEMENT_RTTI_VIRTUAL(CreateRigTest)
  10. {
  11. JPH_ADD_BASE_CLASS(CreateRigTest, Test)
  12. }
  13. CreateRigTest::~CreateRigTest()
  14. {
  15. mRagdoll->RemoveFromPhysicsSystem();
  16. }
  17. void CreateRigTest::Initialize()
  18. {
  19. // Floor
  20. CreateFloor();
  21. // Create ragdoll
  22. Ref<RagdollSettings> settings = RagdollLoader::sCreate();
  23. mRagdoll = settings->CreateRagdoll(0, 0, mPhysicsSystem);
  24. mRagdoll->AddToPhysicsSystem(EActivation::Activate);
  25. }