HighSpeedTest.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. class HighSpeedTest : public Test
  7. {
  8. public:
  9. JPH_DECLARE_RTTI_VIRTUAL(JPH_NO_EXPORT, HighSpeedTest)
  10. // Description of the test
  11. virtual const char *GetDescription() const override
  12. {
  13. return "Spawns a number of high speed objects to check that they don't tunnel through geometry.";
  14. }
  15. // See: Test
  16. virtual void Initialize() override;
  17. // Number used to scale the terrain and camera movement to the scene
  18. virtual float GetWorldScale() const override { return sSelectedScene == 0? 1.0f : 0.2f; }
  19. // Optional settings menu
  20. virtual bool HasSettingsMenu() const override { return true; }
  21. virtual void CreateSettingsMenu(DebugUI *inUI, UIElement *inSubMenu) override;
  22. private:
  23. void CreateDynamicObject(RVec3Arg inPosition, Vec3Arg inVelocity, Shape *inShape, EMotionQuality inMotionQuality = EMotionQuality::LinearCast);
  24. void CreateDominoBlocks(RVec3Arg inOffset, int inNumWalls, float inDensity, float inRadius);
  25. void CreateFastSmallConvexObjects();
  26. void CreateSimpleScene();
  27. void CreateConvexOnLargeTriangles();
  28. void CreateConvexOnTerrain1();
  29. static const char * sScenes[];
  30. static int sSelectedScene;
  31. };