mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[cpp] BoneTimeline is pure now
This commit is contained in:
parent
af05f0681d
commit
d25c75d86b
@ -43,22 +43,15 @@ namespace spine {
|
|||||||
RTTI_DECL_NOPARENT
|
RTTI_DECL_NOPARENT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BoneTimeline(int boneIndex) : _boneIndex(boneIndex) {
|
BoneTimeline(int boneIndex) {
|
||||||
}
|
}
|
||||||
virtual ~BoneTimeline() {
|
virtual ~BoneTimeline() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The index of the bone in Skeleton::getBones() that will be changed when this timeline is applied.
|
/// The index of the bone in Skeleton::getBones() that will be changed when this timeline is applied.
|
||||||
virtual int getBoneIndex() {
|
virtual int getBoneIndex() const = 0;
|
||||||
return _boneIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void setBoneIndex(int inValue) {
|
virtual void setBoneIndex(int inValue) = 0;
|
||||||
_boneIndex = inValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
int _boneIndex;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Base class for timelines that animate a single bone property.
|
/// 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,
|
virtual void apply(Skeleton &skeleton, float lastTime, float time, Array<Event *> *pEvents, float alpha, MixBlend blend,
|
||||||
MixDirection direction, bool appliedPose) override;
|
MixDirection direction, bool appliedPose) override;
|
||||||
|
|
||||||
|
virtual int getBoneIndex() const override {
|
||||||
|
return _boneIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void setBoneIndex(int inValue) override {
|
||||||
|
_boneIndex = inValue;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Applies changes to the pose based on the timeline values.
|
/// 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;
|
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.
|
/// 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,
|
virtual void apply(Skeleton &skeleton, float lastTime, float time, Array<Event *> *pEvents, float alpha, MixBlend blend,
|
||||||
MixDirection direction, bool appliedPose) override;
|
MixDirection direction, bool appliedPose) override;
|
||||||
|
|
||||||
|
virtual int getBoneIndex() const override {
|
||||||
|
return _boneIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void setBoneIndex(int inValue) override {
|
||||||
|
_boneIndex = inValue;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Applies changes to the pose based on the timeline values.
|
/// 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;
|
virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) = 0;
|
||||||
|
|
||||||
|
int _boneIndex;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -65,6 +65,7 @@ namespace spine {
|
|||||||
virtual void setConstraintIndex(int inValue) override {
|
virtual void setConstraintIndex(int inValue) override {
|
||||||
_constraintIndex = inValue;
|
_constraintIndex = inValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _constraintIndex;
|
int _constraintIndex;
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,18 @@ namespace spine {
|
|||||||
virtual void apply(Skeleton &skeleton, float lastTime, float time, Array<Event *> *pEvents, float alpha, MixBlend blend,
|
virtual void apply(Skeleton &skeleton, float lastTime, float time, Array<Event *> *pEvents, float alpha, MixBlend blend,
|
||||||
MixDirection direction, bool appliedPose) override;
|
MixDirection direction, bool appliedPose) override;
|
||||||
|
|
||||||
|
|
||||||
|
virtual int getBoneIndex() const override {
|
||||||
|
return _boneIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setBoneIndex(int inValue) override {
|
||||||
|
_boneIndex = inValue;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
int _boneIndex;
|
||||||
|
|
||||||
static const int ENTRIES = 2;
|
static const int ENTRIES = 2;
|
||||||
static const int INHERIT = 1;
|
static const int INHERIT = 1;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -64,6 +64,7 @@ namespace spine {
|
|||||||
virtual void setConstraintIndex(int inValue) override {
|
virtual void setConstraintIndex(int inValue) override {
|
||||||
_constraintIndex = inValue;
|
_constraintIndex = inValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _constraintIndex;
|
int _constraintIndex;
|
||||||
|
|
||||||
|
|||||||
@ -65,6 +65,7 @@ namespace spine {
|
|||||||
virtual void setConstraintIndex(int inValue) override {
|
virtual void setConstraintIndex(int inValue) override {
|
||||||
_constraintIndex = inValue;
|
_constraintIndex = inValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _constraintIndex;
|
int _constraintIndex;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user