PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

50M Downloads

Feature Suggestion: Relative rotation buttons in the Programmer GUI

HipHopHuman opened this issue · 4 comments

commented

It would be incredibly convenient and save a lot of time on the player's part if there were 3 new buttons in the Programmer GUI:

  • Rotate 180
  • Rotate 90 Clockwise
  • Rotate 90 Counter-Clockwise

It's fine if these buttons are disabled if the program doesn't use relative coordinates, but if the program does use relative coordinates, it should be easy to run a little transformation matrix on those relative coordinates, as well as on the cardinal direction "side access" options inside widgets, to effectively "Rotate" the coordinates of the program in alignment with a different cardinal direction.

Some light Googling tells me that it should be possible by just taking the Coordinate Widgets after the "Base Position" coordinate in the Coordinate Operator and running them through this matrix (along with the directions in those widgets that perform a Side Access):

  • 180: (x, z) -> (-x, z)
    • North -> South
    • South -> North
    • East -> West
    • West -> East
  • 90 Clockwise: (x, z) -> (z, -x)
    • North -> East
    • East -> South
    • South -> West
    • West -> North
  • 90 Counter-clockwise: (x, z) -> (-z, x)
    • North -> West
    • West -> South
    • South -> East
    • East -> North

Having this would mean that I could import a shared program from Pastebin, place it in my world, then rotate it however I wish at the click of a button with no extra effort needed.

commented

Added to the 1.18 dev builds

commented

This would be neat. Trickiest part is specifying the pivot point... I guess it could be the first coordinate widget found in the program? Or maybe a require a coordinate piece with a varname of "pivot" or similar?

BTW your 180 (x, z) -> (-x, z) there is a reflection on the east/west axis rather than a 180° rotation...

commented

This would be neat. Trickiest part is specifying the pivot point... I guess it could be the first coordinate widget found in the program? Or maybe a require a coordinate piece with a varname of "pivot" or similar?

I suggest keeping it simple and only having it work on programs that have been converted to relative coordinates. That way you gaurantee that there's always a ubiquitous pivot point (the base position variable). It wouldn't be too much effort for the player to just convert to relative if they want to rotate an existing build, plus it gives them more incentive to learn how that mechanic works even if they don't want to share any programs.

BTW your 180 (x, z) -> (-x, z) there is a reflection on the east/west axis rather than a 180° rotation...

ehem I think you mean some arbitrary google search result's 180 (x, z) -> (-x, z) is a reflection on the east/west axis 😎 . I'm not the mathematician, I'm just a guy that pulled a matrix transformation off of the internet and changed a "y" to a "z". But thanks for telling me in any case, I have absorbed knowledge

commented

While making my world-eater Quarry, I toyed with the idea of putting the quarry at world spawn (0,11,0) and having it rotate and mine a segment in each cardinal direction in a loop, which got me thinking that this proposed rotation behavior might be useful as a widget instead, or maybe as an option for the coordinate operator widget.