mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[cpp] 4.3 porting WIP
This commit is contained in:
parent
9ace07c194
commit
e9f41ada04
@ -94,8 +94,22 @@ namespace spine {
|
|||||||
/// Returns all bounding boxes. Requires a call to update() first.
|
/// Returns all bounding boxes. Requires a call to update() first.
|
||||||
Vector<BoundingBoxAttachment *> &getBoundingBoxes();
|
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();
|
float getWidth();
|
||||||
|
|
||||||
|
/// The height of the axis aligned bounding box.
|
||||||
float getHeight();
|
float getHeight();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -63,7 +63,7 @@ void SkeletonBounds::update(Skeleton &skeleton, bool updateAabb) {
|
|||||||
Slot *slot = slots[i];
|
Slot *slot = slots[i];
|
||||||
if (!slot->getBone().isActive()) continue;
|
if (!slot->getBone().isActive()) continue;
|
||||||
|
|
||||||
Attachment *attachment = slot->getAppliedPose().getAttachment();
|
Attachment *attachment = slot->_applied->getAttachment();
|
||||||
if (attachment == NULL || !attachment->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) continue;
|
if (attachment == NULL || !attachment->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) continue;
|
||||||
BoundingBoxAttachment *boundingBox = static_cast<BoundingBoxAttachment *>(attachment);
|
BoundingBoxAttachment *boundingBox = static_cast<BoundingBoxAttachment *>(attachment);
|
||||||
_boundingBoxes.add(boundingBox);
|
_boundingBoxes.add(boundingBox);
|
||||||
@ -198,6 +198,22 @@ Vector<BoundingBoxAttachment *> &SkeletonBounds::getBoundingBoxes() {
|
|||||||
return _boundingBoxes;
|
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() {
|
float SkeletonBounds::getWidth() {
|
||||||
return _maxX - _minX;
|
return _maxX - _minX;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user