BroadPhaseInsertionTest.h 711 B

12345678910111213141516171819202122232425
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <Tests/BroadPhase/BroadPhaseTest.h>
  5. #include <random>
  6. // Test that adds/removes objects to/from the broadphase and casts a ray through the boxes to see if the collision results are correct
  7. class BroadPhaseInsertionTest : public BroadPhaseTest
  8. {
  9. public:
  10. JPH_DECLARE_RTTI_VIRTUAL(BroadPhaseInsertionTest)
  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. private:
  16. default_random_engine mRandomGenerator;
  17. size_t mCurrentBody = 0;
  18. int mDirection = 1;
  19. };