Vector2.copy()
Copy the values from the vector given as parameter
Parameters
Name | Type | Description | |
---|---|---|---|
1 | vector | Vector2 | A vector to copy |
Return value
Vector2
The vector with its new values
Usage
import {Vector2} from '@lcluber/type6js';
// Copy from Type6.Vector2 or any object containing properties 'x' and 'y'
let vectorOne = new Vector2(1,1);
let vectorTwo = new Vector2(2,2);
console.log(vectorOne); //(1,1)
vectorOne.copy(vectorTwo);
console.log(vectorOne); //(2,2)