add constants, delegate vector length calculation

This commit is contained in:
Raptorox 2025-08-01 18:09:08 +02:00
parent 2feaed6fd5
commit 1eaa48d511
No known key found for this signature in database
GPG key ID: 8B3556FC3ED1F6D8
3 changed files with 23 additions and 24 deletions

5
src/math.rs Normal file
View 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()
}