ChangeMotionTypeTest.h 845 B

1234567891011121314151617181920212223242526272829303132
  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/Body/Body.h>
  7. class ChangeMotionTypeTest : public Test
  8. {
  9. public:
  10. JPH_DECLARE_RTTI_VIRTUAL(JPH_NO_EXPORT, ChangeMotionTypeTest)
  11. // Description of the test
  12. virtual const char *GetDescription() const override
  13. {
  14. return "Switches a body's motion type between static, kinematic and dynamic.";
  15. }
  16. // See: Test
  17. virtual void Initialize() override;
  18. virtual void PrePhysicsUpdate(const PreUpdateParams &inParams) override;
  19. virtual void SaveState(StateRecorder &inStream) const override;
  20. virtual void RestoreState(StateRecorder &inStream) override;
  21. private:
  22. void UpdateMotionType();
  23. Body * mBody = nullptr;
  24. float mTime = 0.0f;
  25. };