Vector3.opposite()

Set each axis of this vector to its opposite value

Parameters

NameTypeDescription
1axisx | y | | z | undefinedThe 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(1,1,1);
console.log(vector); //(1,1,1)
vector.opposite('x');
console.log(vector); //(-1,1,1)
vector.opposite();
console.log(vector); //(-1,-1,-1)