mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[c][cpp] Ported active bone check in SkeletonBounds. See #1378.
This commit is contained in:
parent
f2fa37dbe0
commit
d790429cd1
@ -129,6 +129,7 @@ void spSkeletonBounds_update (spSkeletonBounds* self, spSkeleton* skeleton, int/
|
||||
spBoundingBoxAttachment* boundingBox;
|
||||
|
||||
spSlot* slot = skeleton->slots[i];
|
||||
if (!slot->bone->active) continue;
|
||||
spAttachment* attachment = slot->attachment;
|
||||
if (!attachment || attachment->type != SP_ATTACHMENT_BOUNDING_BOX) continue;
|
||||
boundingBox = (spBoundingBoxAttachment*)attachment;
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
#include <spine/SkeletonBounds.h>
|
||||
|
||||
#include <spine/Skeleton.h>
|
||||
#include <spine/Bone.h>
|
||||
#include <spine/BoundingBoxAttachment.h>
|
||||
|
||||
#include <spine/Slot.h>
|
||||
@ -56,6 +57,8 @@ void SkeletonBounds::update(Skeleton &skeleton, bool updateAabb) {
|
||||
|
||||
for (size_t i = 0; i < slotCount; i++) {
|
||||
Slot *slot = slots[i];
|
||||
if (!slot->getBone().isActive()) continue;
|
||||
|
||||
Attachment *attachment = slot->getAttachment();
|
||||
if (attachment == NULL || !attachment->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) {
|
||||
continue;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user