1
0
Fork 0
mirror of https://github.com/Reuh/ubiquitousse.git synced 2025-10-27 09:09:30 +00:00

input: Rename clamped to normalize

This commit is contained in:
Étienne Fildadut 2022-10-07 12:29:36 +09:00
parent 0c765b315e
commit 4b4bccdf84
2 changed files with 2 additions and 2 deletions

View file

@ -1,6 +1,6 @@
return { return {
move = { move = {
"clamped(child.right - child.left, child.down - child.up)", "normalize(child.right - child.left, child.down - child.up)",
dimension = 2, dimension = 2,
right = { "scancode.right", "scancode.d", "axis.leftx.p", "button.dpright" }, right = { "scancode.right", "scancode.d", "axis.leftx.p", "button.dpright" },
left = { "scancode.left", "scancode.a", "axis.leftx.n", "button.dpleft" }, left = { "scancode.left", "scancode.a", "axis.leftx.n", "button.dpleft" },

View file

@ -254,7 +254,7 @@ expressionEnv = {
-- @tparam number y value -- @tparam number y value
-- @treturn number clamped x value -- @treturn number clamped x value
-- @treturn number clamped y value -- @treturn number clamped y value
clamped = function(x, y) normalize = function(x, y)
local mag = x*x + y*y local mag = x*x + y*y
if mag > 1 then if mag > 1 then
local d = sqrt(mag) local d = sqrt(mag)