[cpp] 4.3 porting WIP

This commit is contained in:
Mario Zechner 2025-07-02 15:51:06 +02:00
parent 9ace07c194
commit e9f41ada04
2 changed files with 31 additions and 1 deletions

View File

@ -94,8 +94,22 @@ namespace spine {
/// Returns all bounding boxes. Requires a call to update() first.
Vector<BoundingBoxAttachment *> &getBoundingBoxes();
/// The left edge of the axis aligned bounding box.
float getMinX();
/// The bottom edge of the axis aligned bounding box.
float getMinY();
/// The right edge of the axis aligned bounding box.
float getMaxX();
/// The top edge of the axis aligned bounding box.
float getMaxY();
/// The width of the axis aligned bounding box.
float getWidth();
/// The height of the axis aligned bounding box.
float getHeight();
private:

View File

@ -63,7 +63,7 @@ void SkeletonBounds::update(Skeleton &skeleton, bool updateAabb) {
Slot *slot = slots[i];
if (!slot->getBone().isActive()) continue;
Attachment *attachment = slot->getAppliedPose().getAttachment();
Attachment *attachment = slot->_applied->getAttachment();
if (attachment == NULL || !attachment->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) continue;
BoundingBoxAttachment *boundingBox = static_cast<BoundingBoxAttachment *>(attachment);
_boundingBoxes.add(boundingBox);
@ -198,6 +198,22 @@ Vector<BoundingBoxAttachment *> &SkeletonBounds::getBoundingBoxes() {
return _boundingBoxes;
}
float SkeletonBounds::getMinX() {
return _minX;
}
float SkeletonBounds::getMinY() {
return _minY;
}
float SkeletonBounds::getMaxX() {
return _maxX;
}
float SkeletonBounds::getMaxY() {
return _maxY;
}
float SkeletonBounds::getWidth() {
return _maxX - _minX;
}