minetest.dir_to_facedir

From Minetest Developer Wiki
Jump to: navigation, search

Syntax

Description

Convert a vector to a facedir value, used in param2 for paramtype2 = "facedir". It also takes an optional parameter that, when present and not nil/false, will make it take the y component of dir into account.

result direction
0 z
1 x
2 -z
3 -x

See also: minetest.facedir_to_dir()

Example

facedir = minetest.dir_to_facedir({x=0,y=0,z=1})
-- facedir == 0
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox