mirror of
https://github.com/HybridDog/vector_extras.git
synced 2024-11-26 09:23:47 +01:00
automatic update
This commit is contained in:
parent
51f60dd676
commit
2c18e641f1
5
init.lua
5
init.lua
@ -151,7 +151,7 @@ function vector.twoline(x, y)
|
||||
if y < 0 then
|
||||
ymin, ymax = ymax, ymin
|
||||
end
|
||||
local m = y/x
|
||||
local m = y/x --y/0 works too
|
||||
local dir = 1
|
||||
if m < 0 then
|
||||
dir = -dir
|
||||
@ -178,6 +178,9 @@ end
|
||||
vector.zero = {x=0, y=0, z=0}
|
||||
|
||||
function vector.sun_dir(time)
|
||||
if not time then
|
||||
time = minetest.get_timeofday()
|
||||
end
|
||||
local t = (time-0.5)*5/6+0.5 --the sun rises at 5 o'clock, not at 6
|
||||
if t < 0.25
|
||||
or t > 0.75 then
|
||||
|
Loading…
Reference in New Issue
Block a user