Vector3.setFromArray()

Set the x, y and z values of the vector from the array given as parameter. array[0] for x, array[1] for y

Parameters

NameTypeDescription
1xnumber
2ynumber
3znumberThe vector with its new values

Return value

Vector3

Usage

import {Vector3} from '@lcluber/type6js';

let array = [2,2,2];
let vector = new Vector3(1,1,1);
console.log(vector); //(1,1,1)
vector.setFromArray(array);
console.log(vector); //(2,2,2)