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:
parent
0c765b315e
commit
4b4bccdf84
2 changed files with 2 additions and 2 deletions
|
|
@ -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" },
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue