mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 13:04:05 +09:00
gamepad keyboard mockup
This commit is contained in:
@@ -50,9 +50,10 @@ interface TerrarumController {
|
||||
fun getAxis(index:Int): Float {
|
||||
val raw = getAxisRaw(index)
|
||||
val zero = if (index < 4) getConfigFloatArray("gamepadaxiszeropoints")[index] else 0f
|
||||
val inDeadzone = Math.abs(raw - zero) < gamepadDeadzone
|
||||
val compensatedRaw = raw - zero
|
||||
val inDeadzone = Math.abs(compensatedRaw) < gamepadDeadzone
|
||||
|
||||
return if (inDeadzone) 0f else raw
|
||||
return if (inDeadzone) 0f else raw//compensatedRaw // returning raw makes more sense
|
||||
}
|
||||
|
||||
fun inDeadzone(axis: Int): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user