File: /home/creaqbdc/public_html/wp-content/uploads/ac_assets/morph_slider/vendor/ogl/src/math/Vec4.js
import * as Vec4Func from './functions/Vec4Func.js';
export class Vec4 extends Array {
constructor(x = 0, y = x, z = x, w = x) {
super(x, y, z, w);
return this;
}
get x() {
return this[0];
}
get y() {
return this[1];
}
get z() {
return this[2];
}
get w() {
return this[3];
}
set x(v) {
this[0] = v;
}
set y(v) {
this[1] = v;
}
set z(v) {
this[2] = v;
}
set w(v) {
this[3] = v;
}
set(x, y, z, w) {
if (x.length) return this.copy(x);
Vec4Func.set(this, x, y, z, w);
return this;
}
copy(v) {
Vec4Func.copy(this, v);
return this;
}
normalize() {
Vec4Func.normalize(this, this);
return this;
}
fromArray(a, o = 0) {
this[0] = a[o];
this[1] = a[o + 1];
this[2] = a[o + 2];
this[3] = a[o + 3];
return this;
}
toArray(a = [], o = 0) {
a[o] = this[0];
a[o + 1] = this[1];
a[o + 2] = this[2];
a[o + 3] = this[3];
return a;
}
}