Function eos_rs::api::math::clamp_component_abs
source · pub fn clamp_component_abs(vec2: &mut [i32; 2], max: i32)
Expand description
Clamps the absolute values in a two-component integer array.
Given an integer array [x, y] and a maximum absolute value M, clamps each element of the array
to M (max
) such that the output array is [min(max(x, -M), M), min(max(y, -M), M)].