DynamicScaledShape.h 824 B

12345678910111213141516171819202122232425262728293031
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2024 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #pragma once
  5. #include <Tests/Test.h>
  6. class DynamicScaledShape : public Test
  7. {
  8. public:
  9. JPH_DECLARE_RTTI_VIRTUAL(JPH_NO_EXPORT, DynamicScaledShape)
  10. // Description of the test
  11. virtual const char *GetDescription() const override
  12. {
  13. return "Demonstrates how you can scale a shape dynamically while a body is being simulated.";
  14. }
  15. // See: Test
  16. virtual void Initialize() override;
  17. virtual void PrePhysicsUpdate(const PreUpdateParams &inParams) override;
  18. // Saving / restoring state for replay
  19. virtual void SaveState(StateRecorder &inStream) const override;
  20. virtual void RestoreState(StateRecorder &inStream) override;
  21. private:
  22. BodyID mBodyID;
  23. float mTime = 0.0f;
  24. };