ConvexHullShrinkTest.h 864 B

123456789101112131415161718192021222324252627282930
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <Tests/Test.h>
  5. // Create a convex hull, shrink it with the convex radius and expand it again to check the error
  6. class ConvexHullShrinkTest : public Test
  7. {
  8. public:
  9. JPH_DECLARE_RTTI_VIRTUAL(ConvexHullShrinkTest)
  10. // Initialize the test
  11. virtual void Initialize() override;
  12. // Update the test, called before the physics update
  13. virtual void PrePhysicsUpdate(const PreUpdateParams &inParams) override;
  14. // Number used to scale the terrain and camera movement to the scene
  15. virtual float GetWorldScale() const override { return 0.2f; }
  16. private:
  17. // A list of predefined points to feed the convex hull algorithm
  18. using Points = Array<Vec3>;
  19. Array<Points> mPoints;
  20. // Which index in the list we're currently using
  21. size_t mIteration = 0;
  22. };