Posted June 10, 2023 by SourLemonStudio
The doors are points on this plane listed as relative to 0,0 (the origin)
By rotating a plane 90 degrees around the origin I can calculate the final points of the doorway relative to the origin.
This is X'=-Y and Y'=X and repeating that as many times for as many rotations as needed. Then it was an issue of this would spawn the room in a different position so I had to account for that. That was real issue, by rotating the room it gets wildly different max and minimum coordinates. This was fixed by translating the room post rotation by the negative bounds of the room if it goes negative.
This is all very simple after the fact but it took hours to figure out how to do this properly.