import { composeMat4, identityMat4 } from "./Keyframe.js";
export class Bone {
    name;
    parentIndex;
    translation;
    rotation;
    scale;
    inverseBindMatrix;
    constructor(descriptor) {
        if (descriptor.name.trim().length === 0) {
            throw new Error("Bone name cannot be empty.");
        }
        this.name = descriptor.name;
        this.parentIndex = descriptor.parentIndex;
        this.translation = descriptor.translation ?? [0, 0, 0];
        this.rotation = descriptor.rotation ?? [0, 0, 0, 1];
        this.scale = descriptor.scale ?? [1, 1, 1];
        this.inverseBindMatrix = descriptor.inverseBindMatrix ?? identityMat4();
    }
    localMatrix() {
        return composeMat4(this.translation, this.rotation, this.scale);
    }
}
//# sourceMappingURL=Bone.js.map