Skip to content

Conversation

@Argmaster
Copy link
Collaborator

@Argmaster Argmaster commented Mar 12, 2025

This pull request adds functions for rotating block data around Z axis.

@Argmaster Argmaster marked this pull request as ready for review March 12, 2025 21:51
@IntegratedQuantum
Copy link
Member

IntegratedQuantum commented Mar 14, 2025

I wonder if it might be best to just restrict the rotations to only the z axis, then we could focus on optimizing these cases (to just one function call, instead of calling rotateZ 3 times in the worst case), without having to worry about any other rotation axis.

@ikabod-kee maybe you have an opinion about this? Are there many cases where you may really want to rotate a structure in any other direction? If so, would be fine about manually rotation things in that case?

@Argmaster
Copy link
Collaborator Author

I don't see how having all 3 axis available stops you from having bigger rotation tables, since every rotation is applied separately and simply there is no way to create rotation table for combination of rotations in different axis due to how API is designed.

I don't agree with removing rotations around X and Y, these have valid use cases of creating eg. XYZ junctions and in general anything that is symmetrical around X or Y axis. If you don't have X and Z rotations you can't use commands to create builds that are symmetrical around X or Y since even if you build it symmetrical along Z axis there is no tool to rotate it to horizontal position. This applies for example to tunnels.

@ikabod-kee
Copy link
Collaborator

@ikabod-kee maybe you have an opinion about this? Are there many cases where you may really want to rotate a structure in any other direction? If so, would be fine about manually rotation things in that case?

Unless you can defy gravity, there isn't much reason to turn a structure on its side.

@ikabod-kee
Copy link
Collaborator

Though it's still probably good to have that option, just in case.

@Argmaster
Copy link
Collaborator Author

Argmaster commented Mar 14, 2025

What about spikes, stalagmites and stalactites, reusing branches as flipped top-down, having leaves spawn child nodes point up and down? We will manually create exactly same model twice because we can't rotate it around X and Y?

And since allegedly we don't use it, why worry about its performance?

@IntegratedQuantum
Copy link
Member

IntegratedQuantum commented Mar 14, 2025

I don't see how having all 3 axis available stops you from having bigger rotation tables, since every rotation is applied separately and simply there is no way to create rotation table for combination of rotations in different axis due to how API is designed.

I mean that in the sense of focusing our efforts on making one thing faster, rather than having to work on 3 different things (6 including flips).

What about spikes, stalagmites and stalactites, reusing branches as flipped top-down, having leaves spawn child nodes point up and down? We will manually create exactly same model twice because we can't rotate it around X and Y?

Well, that is an argument for implementing flipping, not for implementing X or Y rotations (which require significantly more complicated code). Like Ikabod said, there rarely is a reason to turn something on its side.

@Argmaster
Copy link
Collaborator Author

Well then you can keep implementation of XY rotations suboptimal but present instead of removing it at all.

@IntegratedQuantum
Copy link
Member

Well then you can keep implementation of XY rotations suboptimal but present instead of removing it at all.

Well, it's not just about this code here, but also about the future rotation code. And you can't deny that it would make the structure rotation simpler too to restrict it on flipping and z rotations.
And of course it's just simply more code, and any code has to be maintained.

@Argmaster
Copy link
Collaborator Author

Argmaster commented Mar 14, 2025

So for ship wrecks you will also have separate model laying on side? No complicated fallen tree models either, unless you build separate set of assets for them. I am fairly certain that this will come back as a request. Things that were build vertical will stay vertical then.

@Argmaster Argmaster changed the title Add rotateX rotateY rotateZ for all rotations Add rotateZ for all rotations Mar 14, 2025
@IntegratedQuantum
Copy link
Member

I'm sure that both shipwrecks and fallen trees are better to built them sideways to begin with.
For shipwrecks especially, since you'd probably want to build a mast out of fences, which is impossible when it lies on the side.
Generally I think there are also just too many rotation modes that cannot be equivalently displayed sidewards (e.g. fences, torches, mushrooms).

Finally if we limit outselves to just z rotations it could make your idea

Then rotation of actual blueprint could be done by changing iteration order.

more viable, since then you could achieve cache locality by iterating the columns (and for flips we could precompute just one separate model)

Argmaster and others added 2 commits March 14, 2025 22:00
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
@Argmaster
Copy link
Collaborator Author

Seems to be working more or less

image

Argmaster and others added 2 commits March 17, 2025 22:59
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Copy link
Member

@IntegratedQuantum IntegratedQuantum left a comment

Choose a reason for hiding this comment

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

looks good to me.

@IntegratedQuantum IntegratedQuantum merged commit 112b1db into PixelGuys:master Mar 18, 2025
1 check passed
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.

3 participants