Created
March 24, 2021 05:27
-
-
Save PranavSK/89d329c75f0c37ef82525d0b7d4144f6 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
class_name MathUtils | |
static func clamp_magnitude(vector, amount): | |
return vector if vector.length() < abs(amount) else vector.normalized() * amount | |
static func get_aabb_center(bounds: AABB) -> Vector3: | |
return bounds.position + bounds.size / 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment