Created
November 16, 2020 09:03
-
-
Save Pyknic/e758511f61de1735d2c8dbb4ee2dccbd to your computer and use it in GitHub Desktop.
This file contains 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 Rect { | |
public Vector3 TopLeft, BottomRight; | |
public bool Intersects(Rect other) { | |
return !( this.TopLeft.X > other.BottomRight.X | |
|| this.TopLeft.Y > other.BottomRight.Y | |
|| this.TopLeft.Z > other.BottomRight.Z | |
|| this.BottomRight.X < other.TopLeft.X | |
|| this.BottomRight.Y < other.TopLeft.Y | |
|| this.BottomRight.Z < other.TopLeft.Z); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment