DynamicScaledShape.h 726 B

1234567891011121314151617181920212223242526
  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. // Demonstrates how you can scale a shape dynamically while a body is being simulated
  7. class DynamicScaledShape : public Test
  8. {
  9. public:
  10. JPH_DECLARE_RTTI_VIRTUAL(JPH_NO_EXPORT, DynamicScaledShape)
  11. // See: Test
  12. virtual void Initialize() override;
  13. virtual void PrePhysicsUpdate(const PreUpdateParams &inParams) override;
  14. // Saving / restoring state for replay
  15. virtual void SaveState(StateRecorder &inStream) const override;
  16. virtual void RestoreState(StateRecorder &inStream) override;
  17. private:
  18. BodyID mBodyID;
  19. float mTime = 0.0f;
  20. };