Improve input time scale handling
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "InputDevice.hpp"
|
||||
#include "InputAction.hpp"
|
||||
#include "InputShortcut.hpp"
|
||||
#include "Math/Range.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
@@ -22,7 +23,7 @@ namespace OpenVulkano::Input
|
||||
public:
|
||||
static InputManager* GetInstance();
|
||||
|
||||
void Tick();
|
||||
void Tick(double time);
|
||||
|
||||
void RegisterInputDevice(InputDevice* device)
|
||||
{
|
||||
@@ -53,9 +54,13 @@ namespace OpenVulkano::Input
|
||||
return lastActiveDevice;
|
||||
}
|
||||
|
||||
[[nodiscard]] float GetTimeScale() const { return timescale; }
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, std::unique_ptr<InputAction>> actionNameMapping;
|
||||
std::vector<InputDevice*> devices;
|
||||
InputDevice* lastActiveDevice = nullptr;
|
||||
const Math::Range<float> inputTimeRange = { 1.0f / 10000, 1.0f / 30 }; // Limit input time range from 1/10k FPS to 1/30fps
|
||||
float timescale = 1.0f / 60;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user