[cpp] BoneTimeline is pure now

This commit is contained in:
Mario Zechner 2025-07-24 14:25:49 +02:00
parent af05f0681d
commit d25c75d86b
6 changed files with 38 additions and 11 deletions

View File

@ -43,22 +43,15 @@ namespace spine {
RTTI_DECL_NOPARENT
public:
BoneTimeline(int boneIndex) : _boneIndex(boneIndex) {
BoneTimeline(int boneIndex) {
}
virtual ~BoneTimeline() {
}
/// The index of the bone in Skeleton::getBones() that will be changed when this timeline is applied.
virtual int getBoneIndex() {
return _boneIndex;
}
virtual int getBoneIndex() const = 0;
virtual void setBoneIndex(int inValue) {
_boneIndex = inValue;
}
protected:
int _boneIndex;
virtual void setBoneIndex(int inValue) = 0;
};
/// Base class for timelines that animate a single bone property.
@ -75,9 +68,19 @@ namespace spine {
virtual void apply(Skeleton &skeleton, float lastTime, float time, Array<Event *> *pEvents, float alpha, MixBlend blend,
MixDirection direction, bool appliedPose) override;
virtual int getBoneIndex() const override {
return _boneIndex;
}
virtual void setBoneIndex(int inValue) override {
_boneIndex = inValue;
}
protected:
/// Applies changes to the pose based on the timeline values.
virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) = 0;
int _boneIndex;
};
/// Base class for timelines that animate two bone properties.
@ -94,9 +97,19 @@ namespace spine {
virtual void apply(Skeleton &skeleton, float lastTime, float time, Array<Event *> *pEvents, float alpha, MixBlend blend,
MixDirection direction, bool appliedPose) override;
virtual int getBoneIndex() const override {
return _boneIndex;
}
virtual void setBoneIndex(int inValue) override {
_boneIndex = inValue;
}
protected:
/// Applies changes to the pose based on the timeline values.
virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) = 0;
int _boneIndex;
};
}

View File

@ -65,6 +65,7 @@ namespace spine {
virtual void setConstraintIndex(int inValue) override {
_constraintIndex = inValue;
}
private:
int _constraintIndex;

View File

@ -59,7 +59,18 @@ namespace spine {
virtual void apply(Skeleton &skeleton, float lastTime, float time, Array<Event *> *pEvents, float alpha, MixBlend blend,
MixDirection direction, bool appliedPose) override;
virtual int getBoneIndex() const override {
return _boneIndex;
}
void setBoneIndex(int inValue) override {
_boneIndex = inValue;
}
private:
int _boneIndex;
static const int ENTRIES = 2;
static const int INHERIT = 1;
};

View File

@ -64,6 +64,7 @@ namespace spine {
virtual void setConstraintIndex(int inValue) override {
_constraintIndex = inValue;
}
private:
int _constraintIndex;

View File

@ -65,6 +65,7 @@ namespace spine {
virtual void setConstraintIndex(int inValue) override {
_constraintIndex = inValue;
}
private:
int _constraintIndex;