export class ControlVector3 {
    x;
    y;
    z;
    constructor(x = 0, y = 0, z = 0) {
        this.x = x;
        this.y = y;
        this.z = z;
    }
    set(x, y, z) {
        this.x = x;
        this.y = y;
        this.z = z;
        return this;
    }
    copy(value) {
        return this.set(value.x, value.y, value.z);
    }
    clone() {
        return new ControlVector3(this.x, this.y, this.z);
    }
    add(value) {
        this.x += value.x;
        this.y += value.y;
        this.z += value.z;
        return this;
    }
    sub(value) {
        this.x -= value.x;
        this.y -= value.y;
        this.z -= value.z;
        return this;
    }
    length() {
        return Math.hypot(this.x, this.y, this.z);
    }
    normalize() {
        const length = this.length();
        return length > 0 ? this.set(this.x / length, this.y / length, this.z / length) : this;
    }
}
export function addVector3(target, delta) {
    if (!target)
        return;
    target.x += delta.x;
    target.y += delta.y;
    target.z += delta.z;
}
export function traverseControlObject(root, callback) {
    if (typeof root.traverse === "function") {
        root.traverse(callback);
        return;
    }
    callback(root);
    for (const child of root.children ?? [])
        traverseControlObject(child, callback);
}
//# sourceMappingURL=NativeControlTypes.js.map