mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-03 14:19:09 +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;
|
spBoundingBoxAttachment* boundingBox;
|
||||||
|
|
||||||
spSlot* slot = skeleton->slots[i];
|
spSlot* slot = skeleton->slots[i];
|
||||||
|
if (!slot->bone->active) continue;
|
||||||
spAttachment* attachment = slot->attachment;
|
spAttachment* attachment = slot->attachment;
|
||||||
if (!attachment || attachment->type != SP_ATTACHMENT_BOUNDING_BOX) continue;
|
if (!attachment || attachment->type != SP_ATTACHMENT_BOUNDING_BOX) continue;
|
||||||
boundingBox = (spBoundingBoxAttachment*)attachment;
|
boundingBox = (spBoundingBoxAttachment*)attachment;
|
||||||
|
|||||||
@ -34,6 +34,7 @@
|
|||||||
#include <spine/SkeletonBounds.h>
|
#include <spine/SkeletonBounds.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
#include <spine/Bone.h>
|
||||||
#include <spine/BoundingBoxAttachment.h>
|
#include <spine/BoundingBoxAttachment.h>
|
||||||
|
|
||||||
#include <spine/Slot.h>
|
#include <spine/Slot.h>
|
||||||
@ -56,6 +57,8 @@ void SkeletonBounds::update(Skeleton &skeleton, bool updateAabb) {
|
|||||||
|
|
||||||
for (size_t i = 0; i < slotCount; i++) {
|
for (size_t i = 0; i < slotCount; i++) {
|
||||||
Slot *slot = slots[i];
|
Slot *slot = slots[i];
|
||||||
|
if (!slot->getBone().isActive()) continue;
|
||||||
|
|
||||||
Attachment *attachment = slot->getAttachment();
|
Attachment *attachment = slot->getAttachment();
|
||||||
if (attachment == NULL || !attachment->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) {
|
if (attachment == NULL || !attachment->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user