@threeify/math
Version:
Computer graphics oriented, High performance, tree-shakeable, TypeScript 3D vector math library.
22 lines (17 loc) • 445 B
text/typescript
export class Quat {
static readonly NUM_COMPONENTS = 4;
constructor(public x = 0, public y = 0, public z = 0, public w = 1) {}
clone(result = new Quat()): Quat {
return result.set(this.x, this.y, this.z, this.w);
}
copy(v: Quat): this {
return this.set(v.x, v.y, v.z, v.w);
}
set(x: number, y: number, z: number, w: number): this {
this.x = x;
this.y = y;
this.z = z;
this.w = w;
return this;
}
}