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

Function clamp

packages/particle-editor/src/panels/ParticleEditorPanel.tsx:123–125  ·  view source on GitHub ↗

限制值范围 | Clamp value to range

(value: number, min: number, max: number)

Source from the content-addressed store, hash-verified

121
122/** 限制值范围 | Clamp value to range */
123function clamp(value: number, min: number, max: number): number {
124 return Math.max(min, Math.min(max, value));
125}
126
127/** 随机范围值 | Random value in range */
128function randomRange(min: number, max: number): number {

Callers 2

emitParticleFunction · 0.70
updateFunction · 0.70

Calls 2

maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected