private void BoundValue(ref float value, float min, float max) { value = Math.Max(value, min); value = Math.Min(value, max); } }