MCPcopy
hub / github.com/microsoft/SandDance / clamp

Method clamp

docs/app/js/sanddance-app.js:69319–69322  ·  view source on GitHub ↗
(minVector, maxVector)

Source from the content-addressed store, hash-verified

69317 return this.check();
69318 }
69319 clamp(minVector, maxVector) {
69320 for(let i = 0; i < this.ELEMENTS; ++i)this[i] = Math.min(Math.max(this[i], minVector[i]), maxVector[i]);
69321 return this.check();
69322 }
69323 add(...vectors) {
69324 for (const vector of vectors)for(let i = 0; i < this.ELEMENTS; ++i)this[i] += vector[i];
69325 return this.check();

Callers 1

copyFunction · 0.45

Calls 3

checkMethod · 0.95
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected