sbrl / Minetest-WorldEditAdditions

Extra tools and commands to extend WorldEdit for Minetest
https://worldeditadditions.mooncarrot.space/
Mozilla Public License 2.0
16 stars 3 forks source link

Selection modifiers and Selection Info access #45

Closed VorTechnix closed 3 years ago

VorTechnix commented 3 years ago

New Selection Tools:

Selection modifiers //srel [x <amount>] &| [y <amount>] &| [z <amount>] &| [? <amount>] &| [up <amount>] &| [down <amount>] &| [left <amount>] &| [right <amount>] &| [front <amount>] &| [back <amount>] -- like scube but each axis length and direction must be separately defined.

//scenter -- sets pos 1 and 2 to the ceiling and floor respectively of the center point of the selection + 0.5. Ceiling and floor are used because in a selection of even length there are two center points and we want to select them both.

Measure Tools (mtools):

Selection info //msize -- returns the length and axis of the selection along each axis of the selection relative to pos1. Example: 4x, 5y, -10z (200 nodes) //midpos -- returns the vector of the center point of the selection area. //mtrig -- returns the length of the diagonals between pos1 and pos2 (with height excluded and with height included) as well as the angle on the xz plane and the hy plane. Example: If the difference between pos1 and pos2 is dx,dy,dz = 5,6,7 then //mtrig should return D: 10.49, X/Z: 54.46° D/Y: 60.23° (prototype sqrt(dx^2+dy^2+dz^2), arctan(z/x), arctan(y/sqrt(dx^2+dy^2+dz^2))) //mface -- returns player horizontal facing direction //mcount -- your //count function should be absorbed into this new library

sbrl commented 3 years ago

Awesome! Looks like a comprehensive set of commands. Perhaps for consistency //midpos could be //mcentre? Though that could be slightly awkward in terms of language. WorldEditAdditions has so far been written in my native language, en_GB. Perhaps //midpos should stay as-is and we change //scentre///scenter to //smidpos? Hrm, that's quite a tangle. I see 2 solutions:

1: Use en_GB, and standardise on centre

//scentre
//mcentre

2: Avoid the language issue and use //midpos instead

//midpos (//mmidpos?)
//smidpos

//mcount: Not sure on that one. I'd prefer to avoid renaming existing commands. Adding an alias of //mcount would be an acceptable compromise though.

VorTechnix commented 3 years ago

I'm going to close this issue open a separate issue with a todo list for mtools once I finish srel and pull request it.

sbrl commented 3 years ago

Sure thing :-)

VorTechnix commented 3 years ago

Selection tools implemented #48