PerformanceTestScene.h 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #pragma once
  5. // Base class for a test scene to test performance
  6. class PerformanceTestScene
  7. {
  8. public:
  9. // Virtual destructor
  10. virtual ~PerformanceTestScene() { }
  11. // Get name of test for debug purposes
  12. virtual const char * GetName() const = 0;
  13. // Load assets for the scene
  14. virtual bool Load([[maybe_unused]] const String &inAssetPath) { return true; }
  15. // Start a new test by adding objects to inPhysicsSystem
  16. virtual void StartTest(PhysicsSystem &inPhysicsSystem, EMotionQuality inMotionQuality) = 0;
  17. // Step the test
  18. virtual void UpdateTest([[maybe_unused]] PhysicsSystem &inPhysicsSystem, [[maybe_unused]] TempAllocator &ioTempAllocator, [[maybe_unused]] float inDeltaTime) { }
  19. // Update the hash with the state of the scene
  20. virtual void UpdateHash([[maybe_unused]] uint64 &ioHash) const { }
  21. // Stop a test and remove objects from inPhysicsSystem
  22. virtual void StopTest(PhysicsSystem &inPhysicsSystem) { }
  23. };