Time Nick Message 13:36 rubenwardy I'll tag 5.1.1 tonight unless there are any objections 13:37 rubenwardy Actually, should I pull translations in if the template hasn't been updated since 5.1.0? 13:37 rubenwardy Would keep Hamlet happy 14:12 sfan5 can we merge translations "twice" safely? 14:13 sfan5 as in, pull it into backport-5 and master 14:20 Wuzzy https://github.com/minetest/minetest/pull/9294 14:21 p_gimeno sfan5: I guess you can cherry-pick or rebase 14:21 Wuzzy !title 14:22 ShadowBot Add callbacks for falling and attached nodes by Wuzzy2 · Pull Request #9294 · minetest/minetest · GitHub 15:02 p_gimeno re https://github.com/minetest/minetest/pull/9205#issuecomment-571717643 : the dir does not have enough information, it lacks roll info 15:04 p_gimeno at least for facedir 15:07 p_gimeno the rhotator mod includes code that builds a matrix for each facedir, to use as a LUT, see https://github.com/entuland/rhotator/blob/master/init.lua#L116 15:08 p_gimeno actually https://github.com/entuland/rhotator/blob/master/init.lua#L63 15:10 p_gimeno with that, you can use a matrix to euler conversion code 15:10 p_gimeno that will give you a LUT for facedir-to-euler 15:12 p_gimeno I vouch for the exactness of the rhotator formulas 15:14 p_gimeno for matrix to euler code, see https://github.com/minetest/minetest/blob/master/src/util/numeric.cpp#L199 15:34 rubenwardy sfan5: surely git is clever enough for that 15:34 rubenwardy It's the same commits 15:57 p_gimeno Wuzzy: http://www.formauri.es/personal/pgimeno/pastes/facedir2euler.lua (re #9205) 15:57 ShadowBot https://github.com/minetest/minetest/issues/9205 -- Falling nodes: Add support for facedir, colorfacedirr, wallmounted, colorwallmounted, color, airlike, signlike, torchlike and glow by Wuzzy2 15:58 p_gimeno wait, there's a problem with element 0, you need to use facedir_to_euler[facedir + 1] because it's 1-based 16:00 Wuzzy this might be useful for a Lua API function 16:02 p_gimeno it needs testing, because the matrix might be transposed when converting to euler, so please test with a node where you can distinguish rotation easily and which has several different rotations 16:02 Wuzzy i currently try the math.atan2 solution 16:03 Wuzzy so you need to test yourself atm, sorry. You can use [devtest]. this contains a facedir test node ? 16:05 p_gimeno the math.atan2 solution simply can't work 16:06 Wuzzy not if you also take the face rotation into account 16:06 Wuzzy I have already made it work for wallmounted 16:07 p_gimeno ah ok 16:07 p_gimeno I meant as written by SmallJoker 16:07 Wuzzy yeah Krock's solution does not work 16:09 p_gimeno wallmounted is easier because you only have 6 directions with no roll (IIRC) 16:13 p_gimeno there are multiple eulers for the same rotation for 8 of the facedirs, so don't be surprised if your result doesn't match mine 16:13 p_gimeno (the other 16 should match) 16:22 Wuzzy hrm 16:22 Wuzzy i just noticed facedir_to_dir only gives me 1 of 4 possible directions 16:23 Wuzzy oops 16:23 Wuzzy nvm 16:30 p_gimeno facedir_to_dir does not give you the face rotation, it just returns one of 6 possible directions 16:31 Wuzzy yeah i know. i have to extract the face by hand 16:31 Wuzzy but even that is not enough, actually 16:31 p_gimeno it should 16:31 Wuzzy sigh 16:32 Wuzzy I am starting to wonder why we're even doing this 16:32 Wuzzy I am about to give up 16:36 p_gimeno working with Minetest's axis convention is very tricky 16:37 p_gimeno most formulas you find around don't work 16:40 Wuzzy I think this calls for more library functions 16:41 p_gimeno well, set_rotation is a very recent addition; it's kind of logical to add facedir_to_euler to the set, so that a facedir can be used in set_rotation 16:44 p_gimeno I have forgotten a lot of things. I don't remember what facedir_to_dir returns, but I believe it's the Y vector. And IIRC, roll rotates over a different vector, which means you can't apply roll over the vector returned by facedir_to_dir. 16:45 p_gimeno Very tricky, as I said. 16:46 Wuzzy p_gimeno: i just tested your facedir_to_euler. it does not work, sadly 16:46 p_gimeno ok, the matrix is probably transposed, let me fix it 16:47 p_gimeno did you remember to use facedir_to_dir[facedir + 1]? 16:47 p_gimeno err facedir_to_euler[facedir + 1] 16:47 Wuzzy yes 16:48 p_gimeno http://www.formauri.es/personal/pgimeno/pastes/facedir2euler_2.lua 16:49 p_gimeno reload if you have opened the link 16:49 Wuzzy nope 16:50 p_gimeno nope you haven't opened the link or nope it does not work? :) 16:51 Wuzzy its still wrong but its better than before 16:51 Wuzzy facedir=0-3 are correct 16:51 Wuzzy then facedir 4, 8, 12, 16 and 20 are correct 16:51 Wuzzy the rest is wrong 16:53 p_gimeno let me check the getPitchYawRollRad function more carefully to see if I screwed it up 16:54 Wuzzy i strongly recommend to use [devtest]. you can test the facedir stuff much faster 16:55 Wuzzy oh wait you still need to edit builtin... 16:55 p_gimeno the function is right, that can't be it 16:56 Wuzzy p_gimeno: look in my PR to see the correct values 16:57 Wuzzy basically i just got all the values by trial-and-error... ? 16:59 p_gimeno why not make a table with that then? 17:00 Wuzzy heh 17:00 Wuzzy well it would be nice to also have the formula that produced the table... 17:01 Wuzzy I am not sure what exactly is needed to make Krock happy anyway... lol 17:02 p_gimeno I'm not sure what the differences are with my version, I think it should match, maybe one sign convention is inverted 17:04 p_gimeno ohh 17:05 p_gimeno you have angles in range 0 to 2pi 17:05 p_gimeno I have angles in range -pi to pi 17:05 p_gimeno I think that could explain the differences 17:05 p_gimeno an angle of 7.8539816339744828 is very strange :) 17:07 p_gimeno http://www.formauri.es/personal/pgimeno/pastes/facedir2euler_3.lua <-- uses your empirical results 17:13 Wuzzy p_gimeno: my results, converted to lua: https://pastebin.com/raw/ihS5qAqf 17:14 p_gimeno let me see if I can output in that format 17:15 Wuzzy i just searched-and-replaced the constants by hand 17:19 p_gimeno http://www.formauri.es/personal/pgimeno/pastes/facedir2euler_5.lua 17:20 Wuzzy ah 17:20 Wuzzy i see a mistake already, its the last one 17:21 p_gimeno these could be equivalent 17:22 p_gimeno there must be at least 16 equal to each other to be considered good 17:23 Wuzzy wait, what? 17:23 * Wuzzy test 17:23 p_gimeno there are several eulers that map to the same rotation 17:23 Wuzzy ah right 17:24 Wuzzy but its wrong ? i tested 17:24 p_gimeno ok 17:24 Wuzzy my table works 17:24 Wuzzy actually 17:24 Wuzzy its the same problem as before 17:24 Wuzzy fdir 0-3, 4, 8, 12, 16, 20 work, all other dont 17:25 Wuzzy oh wait. 22 also works. interesting 17:25 p_gimeno it's sounding more and more like a sign problem 17:26 p_gimeno still, the problem was getting the table, now you have a table 17:27 p_gimeno I get dizzy working with MT's axis conventions 17:28 Wuzzy lol 17:30 p_gimeno really, with normal conventions this would be a breeze, but this way you have to rework every formula from the beginning in order to not screw up axes or signs, that's what caused #7927 17:30 ShadowBot https://github.com/minetest/minetest/issues/7927 -- get/set_rotation and get/set_yaw problems 17:30 p_gimeno I haven't done that, and as a result the formulas don't work 18:08 Wuzzy hey Krock you have missed a long and productive discussion with p_gimeno about the the rotation in falling_fixes PR 18:10 Wuzzy p_gimeno experimented with generating the facedirs a little http://www.formauri.es/personal/pgimeno/pastes/facedir2euler_5.lua 18:11 Krock calm down. post is still in progress 18:11 Wuzzy LOL 18:11 Wuzzy sorry 19:51 Wuzzy lol Krock your prediction came almost true. i did file a bug for dropped items, but for a completely different reason. 19:54 Krock in 2020 we'll reach 1000 bugs 19:54 Krock help to reach this goal 19:58 mmuller haha, I presume you mean by filing bugs rather than adding them to the code? 20:00 Krock mmuller: one or another will cause that as final result 21:26 paramat merging #9265 21:26 ShadowBot https://github.com/minetest/minetest/issues/9265 -- Improve Lua API documentation on sounds by Wuzzy2