mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Initial Gamepad support
Adds initial ingame gamepad support to minetest. Full Formspec support is not implemented yet and can be added by a later change.
This commit is contained in:
parent
1e86c89f36
commit
2060fd9cbe
17 changed files with 577 additions and 80 deletions
|
@ -528,18 +528,23 @@ void LocalPlayer::applyControl(float dtime)
|
|||
speedH += move_direction;
|
||||
}
|
||||
}
|
||||
if(control.down)
|
||||
{
|
||||
if (control.down) {
|
||||
speedH -= move_direction;
|
||||
}
|
||||
if(control.left)
|
||||
{
|
||||
if (!control.up && !control.down) {
|
||||
speedH -= move_direction *
|
||||
(control.forw_move_joystick_axis / 32767.f);
|
||||
}
|
||||
if (control.left) {
|
||||
speedH += move_direction.crossProduct(v3f(0,1,0));
|
||||
}
|
||||
if(control.right)
|
||||
{
|
||||
if (control.right) {
|
||||
speedH += move_direction.crossProduct(v3f(0,-1,0));
|
||||
}
|
||||
if (!control.left && !control.right) {
|
||||
speedH -= move_direction.crossProduct(v3f(0,1,0)) *
|
||||
(control.sidew_move_joystick_axis / 32767.f);
|
||||
}
|
||||
if(control.jump)
|
||||
{
|
||||
if (free_move) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue