Last active
September 12, 2018 18:44
-
-
Save themisir/da8448925315b5f4ec738b2dc7b437eb 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
private boolean clamp(float value, float min, float max) { | |
return Math.max(min, Math.min(max, value)); | |
} | |
public boolean collides(Rectangle r1, Circle c1) { | |
float cx = clamp(c1.x, r1.left(), r1.right()); | |
float cy = clamp(c1.y, r1.top(), r1.bottom()); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment