Minetest-WorldEdit icon indicating copy to clipboard operation
Minetest-WorldEdit copied to clipboard

6D Facedir management and automatic orientation during flip and rotate

Open pyrollo opened this issue 10 years ago • 9 comments

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.

pyrollo avatar Oct 27 '15 08:10 pyrollo

Seems good, I only noticed minor issues. That said, I haven't actually tested this.

ShadowNinja avatar Oct 27 '15 23:10 ShadowNinja

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.

pyrollo avatar Oct 28 '15 08:10 pyrollo

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?

HybridDog avatar Jul 31 '16 06:07 HybridDog

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 :)

pyrollo avatar Jul 31 '16 12:07 pyrollo

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.

HybridDog avatar Jul 31 '16 15:07 HybridDog

You're welcome. I opted for tables instead of calculation. For small number of cases, I find them more convenient.

pyrollo avatar Aug 02 '16 08:08 pyrollo

l guess tables also work faster.

HybridDog avatar Aug 02 '16 08:08 HybridDog

related: https://github.com/Uberi/Minetest-WorldEdit/commit/0aeee79af6da45b6b861e2a8d516efb9e26299b1

HybridDog avatar Apr 25 '19 10:04 HybridDog