MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / clamp

Function clamp

library/vec.h:23–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21static inline float mix(float a, float b, float factor) { return a * (1.0f - factor) + b * factor; }
22
23template <typename T> static inline T clamp(const T &v, const T &min, const T &max)
24{
25 if (v < min)
26 return min;
27 if (v > max)
28 return max;
29 return v;
30}
31
32} // namespace OpenApoc
33

Callers 15

startGameMethod · 0.85
drawMethod · 0.85
setPositionMethod · 0.85
groupMoveMethod · 0.85
findSidestepMethod · 0.85
startMethod · 0.85
setFollowPathMethod · 0.85
updateMethod · 0.85
getMovementSpeedMethod · 0.85
getFrameMethod · 0.85
updateMethod · 0.85
updateInfiltrationMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected