ConvexHullTest.h 755 B

123456789101112131415161718192021222324252627282930
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <Tests/Test.h>
  5. // Simple test to create a convex hull
  6. class ConvexHullTest : public Test
  7. {
  8. public:
  9. JPH_DECLARE_RTTI_VIRTUAL(ConvexHullTest)
  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. private:
  15. // A list of predefined points to feed the convex hull algorithm
  16. using Points = Array<Vec3>;
  17. Array<Points> mPoints;
  18. // Which index in the list we're currently using
  19. size_t mIteration = 0;
  20. // If we run out of points, we start creating random points
  21. default_random_engine mRandom { 12345 };
  22. };