MCPcopy
hub / github.com/yeemachine/kalidokit / add

Method add

src/utils/vector.ts:42–45  ·  view source on GitHub ↗

* Add a vector or number to this vector. * @param {Vector | number} a: Vector or number to add * @returns {Vector} New vector

(v: Vector | number)

Source from the content-addressed store, hash-verified

40 * @returns {Vector} New vector
41 */
42 add(v: Vector | number) {
43 if (v instanceof Vector) return new Vector(this.x + v.x, this.y + v.y, this.z + v.z);
44 else return new Vector(this.x + v, this.y + v, this.z + v);
45 }
46 /**
47 * Substracts a vector or number from this vector.
48 * @param {Vector | number} a: Vector or number to subtract

Callers 3

script.jsFile · 0.80
lerpMethod · 0.80
script.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected