13 return x *
x *
x * (
x * (
x * 6.0f - 15.0f) + 10.0f);
19 return x *
x *
x * (
x * (
x * 6.0f - 15.0f) + 10.0f);
40 v_result = v_to_min + factor * (v_to_max - v_to_min);
41 if (use_clamp > 0.0f) {
42 v_result.
x = (v_to_min.
x > v_to_max.
x) ?
clamp(v_result.
x, v_to_max.
x, v_to_min.
x) :
43 clamp(v_result.
x, v_to_min.
x, v_to_max.
x);
44 v_result.
y = (v_to_min.
y > v_to_max.
y) ?
clamp(v_result.
y, v_to_max.
y, v_to_min.
y) :
45 clamp(v_result.
y, v_to_min.
y, v_to_max.
y);
46 v_result.
z = (v_to_min.
z > v_to_max.
z) ?
clamp(v_result.
z, v_to_max.
z, v_to_min.
z) :
47 clamp(v_result.
z, v_to_min.
z, v_to_max.
z);
70 v_result = v_to_min + factor * (v_to_max - v_to_min);
71 if (use_clamp > 0.0f) {
72 v_result.
x = (v_to_min.
x > v_to_max.
x) ?
clamp(v_result.
x, v_to_max.
x, v_to_min.
x) :
73 clamp(v_result.
x, v_to_min.
x, v_to_max.
x);
74 v_result.
y = (v_to_min.
y > v_to_max.
y) ?
clamp(v_result.
y, v_to_max.
y, v_to_min.
y) :
75 clamp(v_result.
y, v_to_min.
y, v_to_max.
y);
76 v_result.
z = (v_to_min.
z > v_to_max.
z) ?
clamp(v_result.
z, v_to_max.
z, v_to_min.
z) :
77 clamp(v_result.
z, v_to_min.
z, v_to_max.
z);
99 factor =
clamp(factor, 0.0f, 1.0f);
100 factor = (3.0f - 2.0f * factor) * (factor * factor);
101 v_result = v_to_min + factor * (v_to_max - v_to_min);
122 factor =
clamp(factor, 0.0f, 1.0f);
123 factor = factor * factor * factor * (factor * (factor * 6.0f - 15.0f) + 10.0f);
124 v_result = v_to_min + factor * (v_to_max - v_to_min);
144 if (fromMax != fromMin) {
145 result = toMin + ((value - fromMin) / (fromMax - fromMin)) * (toMax - toMin);
169 if (fromMax != fromMin) {
170 float factor = (value - fromMin) / (fromMax - fromMin);
171 factor = (steps > 0.0f) ?
floor(factor * (steps + 1.0f)) / steps : 0.0f;
172 result = toMin + factor * (toMax - toMin);
196 if (fromMax != fromMin) {
197 float factor = (fromMin > fromMax) ? 1.0f -
smoothstep(fromMax, fromMin, value) :
199 result = toMin + factor * (toMax - toMin);
223 if (fromMax != fromMin) {
224 float factor = (fromMin > fromMax) ? 1.0f -
smootherstep(fromMax, fromMin, value) :
226 result = toMin + factor * (toMax - toMin);
T smoothstep(T, T, T) RET
constexpr T clamp(T, U, U) RET
void map_range_stepped(float value, float fromMin, float fromMax, float toMin, float toMax, float steps, float3, float3, float3, float3, float3, float3, float, float &result, float3 &)
float smootherstep(float edge0, float edge1, float x)
void map_range_smootherstep(float value, float fromMin, float fromMax, float toMin, float toMax, float, float3, float3, float3, float3, float3, float3, float, float &result, float3 &)
void map_range_linear(float value, float fromMin, float fromMax, float toMin, float toMax, float, float3, float3, float3, float3, float3, float3, float, float &result, float3 &)
void vector_map_range_smootherstep(float, float, float, float, float, float, float3 v_value, float3 v_from_min, float3 v_from_max, float3 v_to_min, float3 v_to_max, float3, float, float &, float3 &v_result)
void map_range_smoothstep(float value, float fromMin, float fromMax, float toMin, float toMax, float, float3, float3, float3, float3, float3, float3, float, float &result, float3 &)
void vector_map_range_linear(float, float, float, float, float, float, float3 v_value, float3 v_from_min, float3 v_from_max, float3 v_to_min, float3 v_to_max, float3, float use_clamp, float &, float3 &v_result)
void vector_map_range_smoothstep(float, float, float, float, float, float, float3 v_value, float3 v_from_min, float3 v_from_max, float3 v_to_min, float3 v_to_max, float3, float, float &, float3 &v_result)
void vector_map_range_stepped(float, float, float, float, float, float, float3 v_value, float3 v_from_min, float3 v_from_max, float3 v_to_min, float3 v_to_max, float3 v_steps, float use_clamp, float &, float3 &v_result)
float safe_divide(float a, float b)