public void TransformPoint() { var obb = new OrientedRectangle(Vector2.One, Vector2.Zero, MathF.PI / 2); var worldPoint = new Vector2(2, 0); var localPoint = obb.TransformPoint(worldPoint); Assert.That(localPoint, Is.Approximately(new Vector2(1, 3))); }
public void TransformPointRoundTrip() { var obb = new OrientedRectangle(new Vector2(3, 5), Vector2.Zero, MathF.PI / 4); var worldPoint = new Vector2(11, 13); var localPoint = obb.InverseTransformPoint(worldPoint); var result = obb.TransformPoint(localPoint); Assert.That(result, Is.EqualTo(worldPoint)); }