Skip to content

TurnedBox

namespace Griff;
public struct TurnedBox

A rectangle in world space turned by Angle radians about its center.

public float Angle { get; init; }
public Box Bounds { get; }

The smallest upright box round it.

public Vector2 Center { get; init; }
public Vector2 HalfSize { get; init; }
public bool Contains(Vector2 point)
public Vector2[] Corners()

The four corners, going round.

public void Deconstruct(out Vector2 Center, out Vector2 HalfSize, out float Angle)
public override bool Equals(object obj)
public bool Equals(TurnedBox other)
public override int GetHashCode()
public bool Overlaps(Box box)

True if it and the upright box share any area (a separating-axis test).

public override string ToString()