Last active
September 29, 2019 11:03
-
-
Save av/66e6a3f1bc5a8afe95082f67a569cc23 to your computer and use it in GitHub Desktop.
Flutter: frac for Vector3
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
/// Returns a fractional part of given [Vector3] | |
/// Vector3(1.2, 1.5, 0.6) => Vector3(.2, .5, .6); | |
Vector3 frac3(Vector3 vec) { | |
return Vector3( | |
vec.x - vec.x.floor(), | |
vec.y - vec.y.floor(), | |
vec.z - vec.z.floor(), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment