pub fn clamp_vec_to_magnitude(v: &mut Vec2, magnitude: f32) {
    if v.magnitude() > magnitude {
        v.data = (v.normalize() * magnitude).data;
    }
}
/// If the length of a vector is longer than `magnitude`, scale the vector's length to equal
/// `magnitude`
If the length of a vector is longer than `magnitude`, scale the vector's length to equal
`magnitude`
If the length of a vector is longer than ` magnitude ` scale the vector ' s length to equal ` magnitude `
pub fn clamp_vec_to_magnitude(v: &mut Vec2, magnitude: f32) {
    if v.magnitude() > magnitude {
        v.data = (v.normalize() * magnitude).data;
    }
}
pub fn clamp_vec_to_magnitude ( v : & mut Vec2 , magnitude : f32 ) { if v . magnitude ( ) > magnitude { v . data = ( v . normalize ( ) * magnitude ) . data ; } }
If the length of a vector is longer than `magnitude`, scale the vector's length to equal
`magnitude`
If the length of a vector is longer than ` magnitude ` scale the vector ' s length to equal ` magnitude `
v
&mut Vec2
magnitude
f32
v
&mut Vec2
magnitude
f32