MCPcopy
hub / github.com/processing/p5.js / set

Method set

src/math/p5.Vector.js:360–369  ·  view source on GitHub ↗

* @param {p5.Vector|Number[]} value vector to set. * @chainable

(...args)

Source from the content-addressed store, hash-verified

358 * @chainable
359 */
360 set(...args) {
361 if (args[0] instanceof Vector) {
362 this.values = args[0].values.slice();
363 } else if (Array.isArray(args[0])) {
364 this.values = args[0].map(arg => arg || 0);
365 } else {
366 this.values = args.map(arg => arg || 0);
367 }
368 return this;
369 }
370
371 /**
372 * Returns a copy of the <a href="#/p5.Vector">p5.Vector</a> object.

Callers 13

slerpMethod · 0.95
slerpMethod · 0.95
addMethod · 0.45
subMethod · 0.45
multMethod · 0.45
rotateMethod · 0.45
divMethod · 0.45
lerpMethod · 0.45
normalizeMethod · 0.45
limitMethod · 0.45
setMagMethod · 0.45
reflectMethod · 0.45

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected