diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/game/item.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua index bf456a4e0..e51da6d6b 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -147,6 +147,14 @@ function core.wallmounted_to_dir(wallmounted) return wallmounted_to_dir[wallmounted] end +function core.dir_to_yaw(dir) + return -math.atan2(dir.x, dir.z) +end + +function core.yaw_to_dir(yaw) + return {x = -math.sin(yaw), y = 0, z = math.cos(yaw)} +end + function core.get_node_drops(nodename, toolname) local drop = ItemStack({name=nodename}):get_definition().drop if drop == nil then |