private Vector2 BoxToWorld(Vector2 p) { // // translate p to obb center basis // var offset = p-Center; // // rotate around center and translate back // return Matrix23.Rotation(Turn)*offset+Center; return(Matrix23.Rotation(Turn) * p); }
private void WorldToBox(ref Vector2 p) { // // translate p to obb center basis // var offset = p-Center; // // rotate around center and translate back // p = Matrix23.Rotation(-Turn)*offset+Center; p = Matrix23.Rotation(-Turn) * p; }