VehicleTest.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 is the base class for vehicle tests, it will create some sample geometry
  7. class VehicleTest : public Test
  8. {
  9. public:
  10. JPH_DECLARE_RTTI_VIRTUAL(JPH_NO_EXPORT, VehicleTest)
  11. // See: Test
  12. virtual void PrePhysicsUpdate(const PreUpdateParams &inParams) override;
  13. virtual void Initialize() override;
  14. // Optional settings menu
  15. virtual bool HasSettingsMenu() const override { return true; }
  16. virtual void CreateSettingsMenu(DebugUI *inUI, UIElement *inSubMenu) override;
  17. private:
  18. // List of possible scene names
  19. static const char * sScenes[];
  20. // Filename of animation to load for this test
  21. static const char * sSceneName;
  22. void CreateBridge();
  23. void CreateWall();
  24. void CreateRubble();
  25. void LoadRaceTrack(const char *inFileName);
  26. // A set of line segments to render a race track
  27. struct Line
  28. {
  29. RVec3 mStart;
  30. RVec3 mEnd;
  31. };
  32. Array<Line> mTrackData;
  33. };