The Input class provides functionality for handling input events in a raytracing project. It allows you to check for key presses, mouse button presses, and retrieve mouse position and scroll values.
Creates a new Input object with the specified GLFW window.
Parameters:
window: A pointer to the GLFW window.
Updates the input state. This function should be called every frame to handle input events.
Checks whether the specified ImGui key is currently pressed.
Parameters:
key: The ImGui key to check.
Returns:
trueif the key is currently pressed,falseotherwise.
Checks whether the specified ImGui mouse button is currently pressed.
Parameters:
button: The ImGui mouse button to check.
Returns:
trueif the mouse button is currently pressed,falseotherwise.
Gets the current x-coordinate of the mouse cursor.
Returns:
- The current x-coordinate of the mouse cursor.
Gets the current y-coordinate of the mouse cursor.
Returns:
- The current y-coordinate of the mouse cursor.
Gets the horizontal scroll value of the mouse wheel.
Returns:
- The horizontal scroll value of the mouse wheel.
Gets the vertical scroll value of the mouse wheel.
Returns:
- The vertical scroll value of the mouse wheel.
Sets the state of the mouse cursor.
Parameters:
state: The state of the mouse cursor (truefor visible,falsefor hidden).
Sets the lock state of the mouse cursor.
Parameters:
state: The lock state of the mouse cursor (truefor locked,falsefor unlocked).