Minetest-WorldEdit
Minetest-WorldEdit copied to clipboard
6D Facedir management and automatic orientation during flip and rotate
Hello,
Here is a pull request for adding 6D facedir management. 6D facedir is managed in orient function for rotate and flip operations.
Orient function/command has been modified so it takes two more parameters : the kind of operation (flip or rotate) and the axis.
I also changed rotate and flip so they automatically orient facedir and wallmount of rotated/flipped nodes. flip function has been split in "flipnodes" which flips node but don't do any orientation and "flip" that does both.
There is still an issue with "flip" orientation and diagonal symmetric nodes (roof corners...) which should be rotated instead of flipped.
Seems good, I only noticed minor issues. That said, I haven't actually tested this.
Thanks for the feedback ShadowNinja. flipnodes renamed and spaces before columns removed (putting space before column is the french way, should get rid of this habit :) ). I left extra dash on the TODO comment as there are extra dashes on other TODO comments.
l should have taken a look at existing PRs. https://github.com/HybridDog/Minetest-WorldEdit/commit/995fe5fc8551e4520966cede71127e288cfc7fb6
How did you find out all the param2 values?
On a platform in game, I put all 24 facedir position, took a screenshot and numbered them. That was my bible while writing the PR :)
There may be a way to calculate them, l assume it's called 6d facedir because there are 6*4 possible values: 4 for yaw, 4 for pitch and 2 for another pitch
Anyway, thanks for fixing rotate, orient and flip.
You're welcome. I opted for tables instead of calculation. For small number of cases, I find them more convenient.
l guess tables also work faster.
related: https://github.com/Uberi/Minetest-WorldEdit/commit/0aeee79af6da45b6b861e2a8d516efb9e26299b1