class Quaternion { | |
x: number; | |
y: number; | |
z: number; | |
w: number; | |
constructor(x: number = 0, y: number = 0, z: number = 0, w: number = 1) { | |
this.x = x; | |
this.y = y; | |
this.z = z; | |
this.w = w; | |
} | |
set(x: number, y: number, z: number, w: number): Quaternion { | |
this.x = x; | |
this.y = y; | |
this.z = z; | |
this.w = w; | |
return this; | |
} | |
flat(): number[] { | |
return [this.x, this.y, this.z, this.w]; | |
} | |
} | |
export { Quaternion }; | |