SPINE怎么获取当前帧的边界框?

role.rar (99.2 KB)
image 如图有个boundingbox,每0.1秒都会变换位置


COCOS3.8.4,怎么获取当前帧这个boundingbox的4个顶点位置,从而做一个多边形碰撞体?

解决了,之前某个帖子传了空数组arr进去,不行

let slot = this.spine.findSlot(“root”);

var vertexAttachment: sp.spine.VertexAttachment = this.spine.getAttachment(“root”, “root”) as sp.spine.VertexAttachment;

var arr = (vertexAttachment.vertices as Array).concat();//这里不能传空数组进去

vertexAttachment.computeWorldVertices(slot, 0, vertexAttachment.worldVerticesLength, arr, 0, 2);

console.log(arr);

1赞