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; }
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); }
public Rectangle(double width, double height) { size = new Vector2(width, height); transform = Matrix23.Identity; }