来吐槽一下这个向量接口

比喻向量3,叫Vec3,也有一个叫IVec3,这个IVec3可以是更宽对象,只要带{x, y, z}就可以,这个很好,所以泛型上面我就用这个IVec3,但在这个泛型函数里面就尴尬了,这个Vec3的操作都是在Vec3,而不是IVec3,比喻Vec3.set(other:Vec3), constructor(v: Vec3); strictEquals(other: Vec3): boolean;, 这个Vec3他所有成员函数就不支持IVec3,导致我用IVec3的时候都得as Vec3。示例:

    public updateTargetPosition(target: IVec3 | Node): void {
        this.gotoTarget = target instanceof Node ? target : this.targetPosition.set(target as Vec3);
    }

遇到了 :nauseated_face: