From f3687a47a6edb78859fb6f3cfbe8ccb5074573a9 Mon Sep 17 00:00:00 2001 From: NullBite Date: Sat, 26 Mar 2022 16:06:21 -0400 Subject: [PATCH] Replace rad() with math.rad() This provides more accurate angle calculation and removes an unneeded function --- script.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/script.lua b/script.lua index bcf0536..a886866 100644 --- a/script.lua +++ b/script.lua @@ -208,7 +208,6 @@ end --- @param amp number Peak amplitude of sine wave function wave(x, period, amp) return math.sin((2/period)*math.pi*(x%period))*amp end function lerp(a, b, t) return a + ((b - a) * t) end -function rad(x) return x*math.pi/180 end -- }}} -- Master and local state variables -- {{{ @@ -849,10 +848,10 @@ function animateMTail(val) local chest_rot = 3 local per=2*math.pi -- model.Body.setRot(vectors.of{wave(val, per, 3), 0, 0}) - armor_model.CHESTPLATE.setRot(vectors.of{-wave(val, per, rad(3)), 0, 0}) + armor_model.CHESTPLATE.setRot(vectors.of{-wave(val, per, math.rad(3)), 0, 0}) -- this makes it work with partial vanilla - vanilla_model.TORSO.setRot(vectors.of{-wave(val, per, rad(3)), 0, 0}) - vanilla_model.JACKET.setRot(vectors.of{-wave(val, per, rad(3.25)), 0, 0}) + vanilla_model.TORSO.setRot(vectors.of{-wave(val, per, math.rad(3)), 0, 0}) + vanilla_model.JACKET.setRot(vectors.of{-wave(val, per, math.rad(3)), 0, 0}) model.Body.LeggingsTopTrimF.setRot(vectors.of{wave(val-1, per, 4), 0, 0}) model.Body.LeggingsTopTrimB.setRot(vectors.of{wave(val-1, per, 4), 0, 0})