{"version":3,"file":"MeshAttachment.mjs","sources":["../../../src/core/attachments/MeshAttachment.ts"],"sourcesContent":["import { VertexAttachment } from './Attachment';\nimport { AttachmentType, Color, IMeshAttachment, TextureRegion } from '@pixi-spine/base';\n\n/**\n * @public\n */\nexport class MeshAttachment extends VertexAttachment implements IMeshAttachment {\n    type = AttachmentType.Mesh;\n\n    region: TextureRegion;\n    path: string;\n    regionUVs: Float32Array;\n    uvs: ArrayLike<number>;\n    triangles: Array<number>;\n    color = new Color(1, 1, 1, 1);\n    hullLength: number;\n    private parentMesh: MeshAttachment;\n    inheritDeform = false;\n    tempColor = new Color(0, 0, 0, 0);\n\n    constructor(name: string) {\n        super(name);\n    }\n\n    applyDeform(sourceAttachment: VertexAttachment): boolean {\n        return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);\n    }\n\n    getParentMesh() {\n        return this.parentMesh;\n    }\n\n    /** @param parentMesh May be null. */\n    setParentMesh(parentMesh: MeshAttachment) {\n        this.parentMesh = parentMesh;\n        if (parentMesh != null) {\n            this.bones = parentMesh.bones;\n            this.vertices = parentMesh.vertices;\n            this.worldVerticesLength = parentMesh.worldVerticesLength;\n            this.regionUVs = parentMesh.regionUVs;\n            this.triangles = parentMesh.triangles;\n            this.hullLength = parentMesh.hullLength;\n            this.worldVerticesLength = parentMesh.worldVerticesLength;\n        }\n    }\n\n    // computeWorldVerticesWith(slot, 0, this.worldVerticesLength, worldVertices, 0);\n}\n"],"names":[],"mappings":";;;AAMO,MAAM,uBAAuB,gBAA4C,CAAA;AAAA,EAc5E,YAAY,IAAc,EAAA;AACtB,IAAA,KAAA,CAAM,IAAI,CAAA,CAAA;AAdd,IAAA,IAAA,CAAA,IAAA,GAAO,cAAe,CAAA,IAAA,CAAA;AAOtB,IAAA,IAAA,CAAA,KAAA,GAAQ,IAAI,KAAA,CAAM,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC,CAAA,CAAA;AAG5B,IAAgB,IAAA,CAAA,aAAA,GAAA,KA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