Last active
July 18, 2018 14:44
-
-
Save TheAllenChou/2c26f83fd0822fec285d69da09a0828f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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