#include <mouse.hpp>
◆ Mouse()
| Mouse::Mouse |
( |
double | user_sensitivity | ) |
|
|
inline |
◆ get_ndc_mouse_pos()
| glm::vec2 Mouse::get_ndc_mouse_pos |
( |
unsigned int | window_width, |
|
|
unsigned int | window_height ) |
◆ get_yaw_pitch_deltas()
| std::tuple< double, double > Mouse::get_yaw_pitch_deltas |
( |
double | mouse_position_x, |
|
|
double | mouse_position_y, |
|
|
double | senstivity_override = -1 ) |
Get delta angles based on mouse.
Take in absolute mouse positions and turn them into delta angles wrt yaw and pitch
- Note
- In radians tau = 2 * pi ~= 6.28 represents a full rotation, and on average we can assume that a a player usually wants to rotate their view angle by theta := tau/4 ~= 1.57, also note that delta mouse positions are coming in at (probably) a rate of at least 60Hz, which means that if a player wants to rotate their view by theta in one second they must at least be producing deltas of size theta/60 = 0.0261.
On average it seems that most mice produce deltas of size TODO, which are much greater than this value, and a general rule of thumb is that to produce good delta angles, we should scale down our delta by 1000x
- Parameters
-
| mouse_position_x | the current mouse x position |
| mouse_position_y | the current mouse y position |
- Returns
- a tuple t such that t1 is the change in yaw angle, and t2 is the change in pitch angle
- Author
- cuppajoeman
- Date
- 2024
◆ get_yaw_pitch_deltas_from_mouse_deltas()
| std::tuple< double, double > Mouse::get_yaw_pitch_deltas_from_mouse_deltas |
( |
double | mouse_delta_x, |
|
|
double | mouse_delta_y, |
|
|
double | requested_sens ) |
◆ last_mouse_position_x
| double Mouse::last_mouse_position_x = 0.0 |
◆ last_mouse_position_y
| double Mouse::last_mouse_position_y = 0.0 |
◆ sensitivity_scale
| double Mouse::sensitivity_scale = 0.001 |
◆ user_sensitivity
| double Mouse::user_sensitivity |
The documentation for this class was generated from the following files: