Vector2.copy()

Copy the values from the vector given as parameter

Parameters

NameTypeDescription
1vectorVector2A 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)