-
Notifications
You must be signed in to change notification settings - Fork 0
input_system::axis
Paweł Waligóra edited this page May 22, 2024
·
11 revisions
Meant for tracking values controlled by 2 keys. Eg. forward/backward movement.
To Use construct axis object in game::your_script scope. To get axis value call axis::state().
following example shows how to use input_system::axis in a script.
#include"axis.h"
#include"time_system.h"
namespace game {
class my_script {
private:
input_system::axis a = input_system::axis(GLFW_KEY_UP, GLFW_KEY_DOWN); // constuct axis object
float x = 0.0f;
// ...
public:
virtual void update();
// ...
};
}
// ...
void game::my_script::update(){
x += a.state() * (float)time::delta_time; // get axis value using axis::state()
// ...
}
- engine
- scripts_system
- scene_loader
- time_system
-
input_system
- input_system::key_held
- input_system::key_events
- input_system::subscribe() (deprecated)
- input_system::axis_state()
- input_system::key_bind
- input_system::axis
- input_system::double_axis
- input_system::triple_axis
- input_system::axis2
- input_system::double_axis2
- input_system::triple_axis2
- input_system::axis-choice
- renderer
- physics
- ui_system
- game