2
0

ConvexHullShrinkTest.h 943 B

12345678910111213141516171819202122232425262728293031
  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. // Create a convex hull, shrink it with the convex radius and expand it again to check the error
  7. class ConvexHullShrinkTest : public Test
  8. {
  9. public:
  10. JPH_DECLARE_RTTI_VIRTUAL(JPH_NO_EXPORT, ConvexHullShrinkTest)
  11. // Initialize the test
  12. virtual void Initialize() override;
  13. // Update the test, called before the physics update
  14. virtual void PrePhysicsUpdate(const PreUpdateParams &inParams) override;
  15. // Number used to scale the terrain and camera movement to the scene
  16. virtual float GetWorldScale() const override { return 0.2f; }
  17. private:
  18. // A list of predefined points to feed the convex hull algorithm
  19. using Points = Array<Vec3>;
  20. Array<Points> mPoints;
  21. // Which index in the list we're currently using
  22. size_t mIteration = 0;
  23. };