Vector3.absolute()
Set each axis of this vector to its absolute value
Parameters
Name | Type | Description | |
---|---|---|---|
1 | axis | x | y | | z | undefined | The axis you want to set or undefined if you want to change both axis |
Return value
Vector3
The vector with its new values
Usage
import {Vector3} from '@lcluber/type6js';
let vector = new Vector3(-2,-2,-2);
console.log(vector); //(-2,-2,-2)
vector.absolute('x');
console.log(vector); //(2,-2,-2)
vector.absolute();
console.log(vector); //(2,2,2)