Vector3.setArray()
Set the x, y and z values from the array given as parameter. array[0] for x, array[1] for y, array[2] for z
Parameters
Name | Type | Description | |
---|---|---|---|
1 | array | number[] | The array containing values for x, y and z axis |
2 | offset | ?number | the starting index of the array |
Return value
Vector2
The vector with its new values
Usage
import {Vector3} from '@lcluber/type6js';
// set from array
let vector = new Vector3([2,2,2]);
console.log(vector); //(2,2,2)
vector.setArray([1,1,1]);
console.log(vector); //(1,1,1)