어떤 Spine Runtime을 사용하고 있습니까? C 또는 C ++ 런타임을 사용하는 것처럼 당신이 무엇을 설명하고있는 것으로 들리십니까?
JSON에서 경계 상자를 직접 읽을 필요는 없습니다. 대신, 'Skeleton :: updateWorldTransform ()`을 사용하여 뼈대를 포즈를 취한 다음 현재 바운딩 박스 위치를 읽을 수 있습니다 :
SkeletonBounds bounds;
BoundingBoxAttachment *boundingBox;
boundingBox = skeleton->getAttachment("slot-name", "attachment-name");
// Somewhere in the update loop
skeleton->updateWorldTransform();
bounds.update(*skeleton, true);
Polygon *transformedBoundingBox = bounds.getPolygon(boundingBox);
What Spine Runtime are you using? From what you are describing it sounds like you are using the C or C++ runtime?
You do not have to read the bounding box from the JSON directly. Instead, you can pose a skeleton using Skeleton::updateWorldTransform()
, then read the current bounding box position:
SkeletonBounds bounds;
BoundingBoxAttachment *boundingBox;
boundingBox = skeleton->getAttachment("slot-name", "attachment-name");
// Somewhere in the update loop
skeleton->updateWorldTransform();
bounds.update(*skeleton, true);
Polygon *transformedBoundingBox = bounds.getPolygon(boundingBox);