G2Pavon / goldsrcmap

A Python library for creating, editing and writing GoldSrc .map files
https://github.com/G2Pavon/goldsrcmap/wiki
GNU General Public License v3.0
4 stars 0 forks source link

Check if two brushes collide #11

Open G2Pavon opened 6 months ago

G2Pavon commented 6 months ago

Explained by Captain P:

And here is how I check whether two brushes are touching: https://github.com/pwitvoet/mess/blob/master/MESS/Mapping/CollisionExtensions.cs#L7 I go over every face plane in both brushes, and check whether the vertices of the other brush are all on the outside of that plane. I return false as soon as I find such a plane. I also do a bounding-box check first because that's a fast early-out check.