MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / init

Method init

Source/Node/Spine.cpp:94–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92 , _listener(this) { }
93
94bool Spine::init() {
95 if (!Playable::init()) return false;
96 if (!_skeletonData) {
97 setAsManaged();
98 return false;
99 }
100 _animationStateData = New<spine::AnimationStateData>(*_skeletonData->getSkel());
101 _animationState = New<spine::AnimationState>(*_animationStateData.get());
102 _skeleton = New<spine::Skeleton>(*_skeletonData->getSkel());
103 _skeleton->updateWorldTransform(spine::Physics_Reset);
104 _clipper = New<spine::SkeletonClipping>();
105 auto& slots = _skeleton->getSlots();
106 for (size_t i = 0; i < slots.size(); i++) {
107 spine::Slot* slot = slots[i];
108 if (!slot->getBone().isActive()) continue;
109 spine::Attachment* attachment = slot->getAppliedPose().getAttachment();
110 if (attachment && !attachment->getRTTI().instanceOf(spine::BoundingBoxAttachment::rtti)) {
111 _bounds = New<spine::SkeletonBounds>();
112 setHitTestEnabled(true);
113 break;
114 }
115 }
116 this->scheduleUpdate();
117 return true;
118}
119
120void Spine::setSpeed(float var) {
121 AssertIf(_flags.isOn(Node::Cleanup), "can not operate on an invalid Spine");

Callers

nothing calls this directly

Calls 10

getSkelMethod · 0.80
isActiveMethod · 0.80
instanceOfMethod · 0.80
getMethod · 0.65
initFunction · 0.50
updateWorldTransformMethod · 0.45
sizeMethod · 0.45
getBoneMethod · 0.45
getAttachmentMethod · 0.45
scheduleUpdateMethod · 0.45

Tested by

no test coverage detected