HighSpeedTest.h 1.2 KB

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