A Vector3 whose components live in a shared Float32Array at a fixed
offset rather than in three own properties.
Every Vector3 method routes through x / y / z, so replacing those
with accessors inherits the whole API unchanged — including clone(), which
still returns a detached plain Vector3.
The accessors are installed on the prototype below rather than written as
get x() in the class body, because TypeScript forbids overriding an
inherited property with an accessor (TS2611). Runtime behaviour is the same:
one shared property descriptor for every instance.
A
Vector3whose components live in a sharedFloat32Arrayat a fixed offset rather than in three own properties.Every
Vector3method routes throughx/y/z, so replacing those with accessors inherits the whole API unchanged — includingclone(), which still returns a detached plainVector3.The accessors are installed on the prototype below rather than written as
get x()in the class body, because TypeScript forbids overriding an inherited property with an accessor (TS2611). Runtime behaviour is the same: one shared property descriptor for every instance.