MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / clamp

Function clamp

src/math/index.ts:135–139  ·  view source on GitHub ↗
(value: number, min: number, max: number)

Source from the content-addressed store, hash-verified

133}
134
135export function clamp(value: number, min: number, max: number): number {
136 if (value < min) return min;
137 if (value > max) return max;
138 return value;
139}
140
141export function remap(value: number, inMin: number, inMax: number, outMin: number, outMax: number): number {
142 return outMin + (value - inMin) / (inMax - inMin) * (outMax - outMin);

Callers 12

handleInputFunction · 0.90
main.tsFile · 0.90
main.tsFile · 0.90
updateKartPhysicsFunction · 0.90
updateAIFunction · 0.90
main.tsFile · 0.90
main.tsFile · 0.90
main.tsFile · 0.90
main.tsFile · 0.90
main.tsFile · 0.90
main.tsFile · 0.90
sample_base_colorMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected