Closed trundlr closed 1 year ago
Oops, didn't see this when I did apetavern/sbox-grubs#242 which demonstrates how to rotate around any point.
I'll add an optional parameter to choose a midpoint / pivot, maybe between (0,0) for the bottom left, and (1,1) for the top-right.
The question is then what would you expect the default to be @trundlr, maybe (0.5, 0.5) for the center?
Yeah, 0.5, 0.5 makes sense 👍 Thanks again!
In Grubs, we allow players to rotate girders, which are created using TextureSdf.
Currently, applying a rotation to a girder seems to offset the position by an undesired amount. A texture with rotation 0 seems to place in the correct position, however.
Desired Behaviour Since we need to transform a TextureSdf after creating it, it would be nice if the Transform worked appropriately. I also can't help but think it would be nice to be able to just pass into a midpoint into the constructor.
Example
https://github.com/Facepunch/sbox-sdf/assets/57276947/e40b16ec-e958-443d-bec6-dffd3162144b
Code