add constants, delegate vector length calculation
This commit is contained in:
parent
2feaed6fd5
commit
1eaa48d511
3 changed files with 23 additions and 24 deletions
5
src/math.rs
Normal file
5
src/math.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
use sfml::system::Vector2f;
|
||||
|
||||
pub fn vec_len(vec: Vector2f) -> f32 {
|
||||
(vec.x * vec.x + vec.y * vec.y).sqrt()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue