How to calculate a rotated a Rect struct (not a RectTransform)?
I'm working on a game that uses a grid system, and I'm trying to figure out how to update the data model when the player rotates one of their assets. Since it's a grid, I'm only worried about rotations in increments of 90° at a time.
For example, if you rotated a horizontal 3-tile block that covers {3,4} {4,4} {5,4}
by 90°, it would end up as a vertical line covering {4,5} {4,4} {4,3}
.
Is there a method or class for this kind of thing? How can I calculate the positions covered by a Rect after it has been rotated?
Your answer
Follow this Question
Related Questions
[Solved] Problem with achieving rotation relative to current acceleration value 0 Answers
Object rotation problem 1 Answer
Broken rotation (c#) 0 Answers
i'm using a code to make my cube walk with character controller but when i play the cube spins. 0 Answers
Animations unwanted movement and rotation after updating 0 Answers