Skip to content

Instantly share code, notes, and snippets.

@TheAllenChou
Last active July 18, 2018 14:44
Show Gist options
  • Save TheAllenChou/2c26f83fd0822fec285d69da09a0828f to your computer and use it in GitHub Desktop.
Save TheAllenChou/2c26f83fd0822fec285d69da09a0828f to your computer and use it in GitHub Desktop.
public struct Aabb
{
public Vector2 Min;
public Vector2 Max;
public Aabb(Vector2 min, Vector2 max)
{
Min = min;
Max = max;
}
public bool Intersects(Aabb rhs)
{
return
MinX <= rhs.MaxX
&& MinY <= rhs.MaxY
&& MaxX >= rhs.MinX
&& MaxY >= rhs.MinY;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment