* @param {p5.Vector} v p5.Vector to lerp toward. * @param {Number} amt * @chainable
(x, y, z, amt)
| 2421 | * @chainable |
| 2422 | */ |
| 2423 | lerp(x, y, z, amt) { |
| 2424 | if (x instanceof Vector) { |
| 2425 | return this.lerp(x.x, x.y, x.z, y); |
| 2426 | } |
| 2427 | this.x += (x - this.x) * amt || 0; |
| 2428 | this.y += (y - this.y) * amt || 0; |
| 2429 | this.z += (z - this.z) * amt || 0; |
| 2430 | return this; |
| 2431 | } |
| 2432 | |
| 2433 | /** |
| 2434 | * Calculates a new heading and magnitude that are between two vectors. |
nothing calls this directly
no test coverage detected