Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6D Facedir management and automatic orientation during flip and rotate #92

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

pyrollo
Copy link

@pyrollo pyrollo commented Oct 27, 2015

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.

-- @return The number of nodes flipped.
function worldedit.flip(pos1, pos2, axis)
function worldedit.flipnodes(pos1, pos2, axis)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flip_nodes

@ShadowNinja
Copy link
Collaborator

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

@pyrollo
Copy link
Author

pyrollo commented Oct 28, 2015

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.

@HybridDog
Copy link
Contributor

l should have taken a look at existing PRs.
HybridDog@995fe5f

How did you find out all the param2 values?

@pyrollo
Copy link
Author

pyrollo commented Jul 31, 2016

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

@HybridDog
Copy link
Contributor

HybridDog commented Jul 31, 2016

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.

@pyrollo
Copy link
Author

pyrollo commented Aug 2, 2016

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

@HybridDog
Copy link
Contributor

l guess tables also work faster.

@HybridDog
Copy link
Contributor

related: 0aeee79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants