SoftBodyLRAConstraintTest.h 784 B

123456789101112131415161718192021222324
  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. // This test shows the effect of LRA constraints in a soft body which can help reduce stretch of the cloth. The left cloth uses no LRA constraints and the right one does.
  7. class SoftBodyLRAConstraintTest : public Test
  8. {
  9. public:
  10. JPH_DECLARE_RTTI_VIRTUAL(JPH_NO_EXPORT, SoftBodyLRAConstraintTest)
  11. // See: Test
  12. virtual void Initialize() override;
  13. virtual void PrePhysicsUpdate(const PreUpdateParams &inParams) override;
  14. private:
  15. // Size and spacing of the cloth
  16. static constexpr int cNumVerticesX = 10;
  17. static constexpr int cNumVerticesZ = 50;
  18. static constexpr float cVertexSpacing = 0.5f;
  19. };