mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02: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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user