This commit is contained in:
Stephen Gowen 2017-10-08 19:03:24 -04:00
parent 20db47d4b7
commit 26eabbf1df
25 changed files with 1922 additions and 42 deletions

View File

@ -43,69 +43,71 @@ namespace Spine
///
class Bone : public Updatable
{
friend class RotateTimeline;
public:
private:
static public bool yDown;
internal BoneData data;
internal Skeleton skeleton;
internal Bone parent;
internal ExposedList<Bone> children = new ExposedList<Bone>();
internal float x, y, rotation, scaleX, scaleY, shearX, shearY;
internal float ax, ay, arotation, ascaleX, ascaleY, ashearX, ashearY;
internal bool appliedValid;
internal BoneData _data;
internal Skeleton _skeleton;
internal Bone _parent;
internal ExposedList<Bone> _children = new ExposedList<Bone>();
internal float _x, _y, _rotation, _scaleX, _scaleY, _shearX, _shearY;
internal float _ax, _ay, _arotation, _ascaleX, _ascaleY, _ashearX, _ashearY;
internal bool _appliedValid;
internal float a, b, worldX;
internal float c, d, worldY;
internal float _a, _b, _worldX;
internal float _c, _d, _worldY;
// internal float worldSignX, worldSignY;
// public float WorldSignX { get { return worldSignX; } }
// public float WorldSignY { get { return worldSignY; } }
internal bool sorted;
internal bool _sorted;
public BoneData Data { get { return data; } }
public Skeleton Skeleton { get { return skeleton; } }
public Bone Parent { get { return parent; } }
public ExposedList<Bone> Children { get { return children; } }
/// <summary>The local X translation.</summary>
/// The local X translation.
public float X { get { return x; } set { x = value; } }
/// <summary>The local Y translation.</summary>
/// The local Y translation.
public float Y { get { return y; } set { y = value; } }
/// <summary>The local rotation.</summary>
/// The local rotation.
public float Rotation { get { return rotation; } set { rotation = value; } }
/// <summary>The local scaleX.</summary>
/// The local scaleX.
public float ScaleX { get { return scaleX; } set { scaleX = value; } }
/// <summary>The local scaleY.</summary>
/// The local scaleY.
public float ScaleY { get { return scaleY; } set { scaleY = value; } }
/// <summary>The local shearX.</summary>
/// The local shearX.
public float ShearX { get { return shearX; } set { shearX = value; } }
/// <summary>The local shearY.</summary>
/// The local shearY.
public float ShearY { get { return shearY; } set { shearY = value; } }
/// <summary>The rotation, as calculated by any constraints.</summary>
/// The rotation, as calculated by any constraints.
public float AppliedRotation { get { return arotation; } set { arotation = value; } }
/// <summary>The applied local x translation.</summary>
/// The applied local x translation.
public float AX { get { return ax; } set { ax = value; } }
/// <summary>The applied local y translation.</summary>
/// The applied local y translation.
public float AY { get { return ay; } set { ay = value; } }
/// <summary>The applied local scaleX.</summary>
/// The applied local scaleX.
public float AScaleX { get { return ascaleX; } set { ascaleX = value; } }
/// <summary>The applied local scaleY.</summary>
/// The applied local scaleY.
public float AScaleY { get { return ascaleY; } set { ascaleY = value; } }
/// <summary>The applied local shearX.</summary>
/// The applied local shearX.
public float AShearX { get { return ashearX; } set { ashearX = value; } }
/// <summary>The applied local shearY.</summary>
/// The applied local shearY.
public float AShearY { get { return ashearY; } set { ashearY = value; } }
public float A { get { return a; } }
@ -118,12 +120,12 @@ namespace Spine
public float WorldRotationX { get { return MathUtils.Atan2(c, a) * MathUtils.RadDeg; } }
public float WorldRotationY { get { return MathUtils.Atan2(d, b) * MathUtils.RadDeg; } }
/// <summary>Returns the magnitide (always positive) of the world scale X.</summary>
/// Returns the magnitide (always positive) of the world scale X.
public float WorldScaleX { get { return (float)Math.Sqrt(a * a + c * c); } }
/// <summary>Returns the magnitide (always positive) of the world scale Y.</summary>
/// Returns the magnitide (always positive) of the world scale Y.
public float WorldScaleY { get { return (float)Math.Sqrt(b * b + d * d); } }
/// <param name="parent">May be null.</param>
/// @param parent May be null.
public Bone (BoneData data, Skeleton skeleton, Bone parent) {
if (data == null) throw new ArgumentNullException("data", "data cannot be null.");
if (skeleton == null) throw new ArgumentNullException("skeleton", "skeleton cannot be null.");
@ -133,17 +135,17 @@ namespace Spine
SetToSetupPose();
}
/// <summary>Same as <see cref="UpdateWorldTransform"/>. This method exists for Bone to implement <see cref="Spine.IUpdatable"/>.</summary>
/// Same as <see cref="UpdateWorldTransform"/>. This method exists for Bone to implement <see cref="Spine.IUpdatable"/>.
public void Update () {
UpdateWorldTransform(x, y, rotation, scaleX, scaleY, shearX, shearY);
}
/// <summary>Computes the world transform using the parent bone and this bone's local transform.</summary>
/// Computes the world transform using the parent bone and this bone's local transform.
public void UpdateWorldTransform () {
UpdateWorldTransform(x, y, rotation, scaleX, scaleY, shearX, shearY);
}
/// <summary>Computes the world transform using the parent bone and the specified local transform.</summary>
/// Computes the world transform using the parent bone and the specified local transform.
public void UpdateWorldTransform (float x, float y, float rotation, float scaleX, float scaleY, float shearX, float shearY) {
ax = x;
ay = y;
@ -284,12 +286,12 @@ namespace Spine
shearY = data.shearY;
}
/// <summary>
///
/// Computes the individual applied transform values from the world transform. This can be useful to perform processing using
/// the applied transform after the world transform has been modified directly (eg, by a constraint)..
///
/// Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation.
/// </summary>
///
internal void UpdateAppliedTransform () {
appliedValid = true;
Bone parent = this.parent;
@ -372,11 +374,12 @@ namespace Spine
return MathUtils.Atan2(cos * c + sin * d, cos * a + sin * b) * MathUtils.RadDeg;
}
/// <summary>
///
/// Rotates the world transform the specified amount and sets isAppliedValid to false.
/// </summary>
/// <param name="degrees">Degrees.</param>
public void RotateWorld (float degrees) {
///
/// @param degrees Degrees.
public void RotateWorld (float degrees)
{
float a = this.a, b = this.b, c = this.c, d = this.d;
float cos = MathUtils.CosDeg(degrees), sin = MathUtils.SinDeg(degrees);
this.a = cos * a - sin * c;
@ -386,9 +389,7 @@ namespace Spine
appliedValid = false;
}
override public string ToString () {
return data.name;
}
friend std::ostream& operator <<(std::ostream& os, const Bone& ref);
};
}

View File

@ -31,6 +31,8 @@
#ifndef Spine_Constraint_h
#define Spine_Constraint_h
#include <spine/Updatable.h>
namespace Spine
{
/// The interface for all constraints.
@ -39,7 +41,9 @@ namespace Spine
public:
Constraint();
virtual Constraint();
virtual ~Constraint();
virtual void update() = 0;
/// The ordinal for the order a skeleton's constraints will be applied.
virtual int getOrder() = 0;

View File

@ -0,0 +1,77 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_CurveTimeline_h
#define Spine_CurveTimeline_h
#include <spine/Timeline.h>
#include <vector>
#include <assert.h>
namespace Spine
{
/// Base class for frames that use an interpolation bezier curve.
class CurveTimeline : public Timeline
{
public:
CurveTimeline(int frameCount);
virtual void apply(Skeleton& skeleton, float lastTime, float time, std::vector<Event*>& events, float alpha, MixPose pose, MixDirection direction) = 0;
virtual int getPropertyId() = 0;
int getFrameCount();
void setLinear(int frameIndex);
void setStepped(int frameIndex);
/// Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.
/// cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
/// the difference between the keyframe's values.
void setCurve(int frameIndex, float cx1, float cy1, float cx2, float cy2);
float getCurvePercent(int frameIndex, float percent);
float getCurveType(int frameIndex);
protected:
static const float LINEAR;
static const float STEPPED;
static const float BEZIER;
static const int BEZIER_SIZE;
private:
std::vector<float> _curves; // type, x, y, ...
};
}
#endif /* Spine_CurveTimeline_h */

View File

@ -0,0 +1,39 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_IkConstraint_h
#define Spine_IkConstraint_h
namespace Spine
{
// TODO
}
#endif /* Spine_IkConstraint_h */

View File

@ -0,0 +1,44 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_MathUtil_h
#define Spine_MathUtil_h
#include <math.h>
namespace Spine
{
inline float clamp(float x, float lower, float upper)
{
return fminf(upper, fmaxf(x, lower));
}
}
#endif /* Spine_MathUtil_h */

View File

@ -0,0 +1,46 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_MixDirection_h
#define Spine_MixDirection_h
namespace Spine
{
///
/// Indicates whether a timeline's alpha is mixing out over time toward 0 (the setup or current pose) or mixing in toward 1 (the timeline's pose).
/// See also Timeline::apply(Skeleton&, float, float, std::vector&, float, MixPose, MixDirection)
enum MixDirection
{
MixDirection_In = 0,
MixDirection_Out
};
}
#endif /* Spine_MixDirection_h */

View File

@ -0,0 +1,51 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_MixPose_h
#define Spine_MixPose_h
namespace Spine
{
///
/// Controls how a timeline is mixed with the setup or current pose.
/// See also Timeline::apply(Skeleton&, float, float, std::vector&, float, MixPose, MixDirection)
enum MixPose
{
/// The timeline value is mixed with the setup pose (the current pose is not used).
MixPose_Setup = 0,
/// The timeline value is mixed with the current pose. The setup pose is used as the timeline value before the first key,
/// except for timelines which perform instant transitions, such as DrawOrderTimeline or AttachmentTimeline.
MixPose_Current,
/// The timeline value is mixed with the current pose. No change is made before the first key (the current pose is kept until the first key).
MixPose_CurrentLayered
};
}
#endif /* Spine_MixPose_h */

View File

@ -0,0 +1,39 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_PathConstraint_h
#define Spine_PathConstraint_h
namespace Spine
{
// TODO
}
#endif /* Spine_PathConstraint_h */

View File

@ -0,0 +1,68 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_RotateTimeline_h
#define Spine_RotateTimeline_h
#include <spine/CurveTimeline.h>
namespace Spine
{
class RotateTimeline : public CurveTimeline
{
public:
static const int ENTRIES = 2;
RotateTimeline(int frameCount);
virtual void apply(Skeleton& skeleton, float lastTime, float time, std::vector<Event*>& events, float alpha, MixPose pose, MixDirection direction);
virtual int getPropertyId();
/// Sets the time and value of the specified keyframe.
void setFrame(int frameIndex, float time, float degrees);
int getBoneIndex();
void setBoneIndex(int inValue);
std::vector<float>& getFrames();
void setFrames(std::vector<float> inValue);
private:
static const int PREV_TIME = -2;
static const int PREV_ROTATION = -1;
static const int ROTATION = 1;
int _boneIndex;
std::vector<float> _frames; // time, angle, ...
};
}
#endif /* Spine_RotateTimeline_h */

View File

@ -31,9 +31,753 @@
#ifndef Spine_Skeleton_h
#define Spine_Skeleton_h
#include <string>
#include <vector>
namespace Spine
{
// TODO
class SkeletonData;
class Bone;
class Updatable;
class Slot;
class IkConstraint;
class PathConstraint;
class TransformConstraint;
class Skin;
class Skeleton
{
public:
SkeletonData* getData();
std::vector<Bone*> getBones();
std::vector<Updatable*> getUpdateCacheList();
std::vector<Slot*> getSlots();
std::vector<Slot*> getDrawOrder();
std::vector<IkConstraint*> getIkConstraints();
std::vector<PathConstraint*> getPathConstraints();
std::vector<TransformConstraint*> getTransformConstraints();
Skin* getSkin { get { return skin; } set { skin = value; } }
float getR { get { return r; } set { r = value; } }
float getG { get { return g; } set { g = value; } }
float getB { get { return b; } set { b = value; } }
float getA { get { return a; } set { a = value; } }
float getTime { get { return time; } set { time = value; } }
float getX { get { return x; } set { x = value; } }
float getY { get { return y; } set { y = value; } }
bool getFlipX { get { return flipX; } set { flipX = value; } }
bool getFlipY { get { return flipY; } set { flipY = value; } }
Bone* getRootBone()
{
return _bones.size() == 0 ? nullptr : _bones.at(0);
//get { return bones.Count == 0 ? null : bones.Items[0]; }
}
Skeleton(const SkeletonData& data)
{
if (data == null)
{
throw new ArgumentNullException("data", "data cannot be null.");
}
this.data = data;
bones = new std::vector<Bone>(data.bones.Count);
foreach (BoneData boneData in data.bones)
{
Bone bone;
if (boneData.parent == null)
{
bone = new Bone(boneData, this, null);
}
else
{
Bone parent = bones.Items[boneData.parent.index];
bone = new Bone(boneData, this, parent);
parent.children.Add(bone);
}
bones.Add(bone);
}
slots = new std::vector<Slot>(data.slots.Count);
drawOrder = new std::vector<Slot>(data.slots.Count);
foreach (SlotData slotData in data.slots)
{
Bone bone = bones.Items[slotData.boneData.index];
Slot slot = new Slot(slotData, bone);
slots.Add(slot);
drawOrder.Add(slot);
}
ikConstraints = new std::vector<IkConstraint>(data.ikConstraints.Count);
foreach (IkConstraintData ikConstraintData in data.ikConstraints)
ikConstraints.Add(new IkConstraint(ikConstraintData, this));
transformConstraints = new std::vector<TransformConstraint>(data.transformConstraints.Count);
foreach (TransformConstraintData transformConstraintData in data.transformConstraints)
transformConstraints.Add(new TransformConstraint(transformConstraintData, this));
pathConstraints = new std::vector<PathConstraint> (data.pathConstraints.Count);
foreach (PathConstraintData pathConstraintData in data.pathConstraints)
pathConstraints.Add(new PathConstraint(pathConstraintData, this));
updateCache();
updateWorldTransform();
}
~Skeleton()
{
// TODO
}
/// Caches information about bones and constraints. Must be called if bones, constraints or weighted path attachments are added
/// or removed.
void updateCache()
{
std::vector<IUpdatable> updateCache = this.updateCache;
updateCache.Clear();
this.updateCacheReset.Clear();
std::vector<Bone> bones = this.bones;
for (int i = 0, n = bones.Count; i < n; i++)
{
bones.Items[i].sorted = false;
}
std::vector<IkConstraint> ikConstraints = this.ikConstraints;
var transformConstraints = this.transformConstraints;
var pathConstraints = this.pathConstraints;
int ikCount = IkConstraints.Count, transformCount = transformConstraints.Count, pathCount = pathConstraints.Count;
int constraintCount = ikCount + transformCount + pathCount;
//outer:
for (int i = 0; i < constraintCount; i++)
{
for (int ii = 0; ii < ikCount; ii++)
{
IkConstraint constraint = ikConstraints.Items[ii];
if (constraint.data.order == i)
{
sortIkConstraint(constraint);
goto continue_outer; //continue outer;
}
}
for (int ii = 0; ii < transformCount; ii++)
{
TransformConstraint constraint = transformConstraints.Items[ii];
if (constraint.data.order == i)
{
sortTransformConstraint(constraint);
goto continue_outer; //continue outer;
}
}
for (int ii = 0; ii < pathCount; ii++)
{
PathConstraint constraint = pathConstraints.Items[ii];
if (constraint.data.order == i)
{
sortPathConstraint(constraint);
goto continue_outer; //continue outer;
}
}
continue_outer: {}
}
for (int i = 0, n = bones.Count; i < n; i++)
{
sortBone(bones.Items[i]);
}
}
/// updates the world transform for each bone and applies constraints.
void updateWorldTransform()
{
var updateCacheReset = this.updateCacheReset;
var updateCacheResetItems = updateCacheReset.Items;
for (int i = 0, n = updateCacheReset.Count; i < n; i++)
{
Bone bone = updateCacheResetItems[i];
bone.ax = bone.x;
bone.ay = bone.y;
bone.arotation = bone.rotation;
bone.ascaleX = bone.scaleX;
bone.ascaleY = bone.scaleY;
bone.ashearX = bone.shearX;
bone.ashearY = bone.shearY;
bone.appliedValid = true;
}
var updateItems = this.updateCache.Items;
for (int i = 0, n = updateCache.Count; i < n; i++)
{
updateItems[i].update();
}
}
/// Sets the bones, constraints, and slots to their setup pose values.
void setToSetupPose()
{
setBonesToSetupPose();
setSlotsToSetupPose();
}
/// Sets the bones and constraints to their setup pose values.
void setBonesToSetupPose()
{
var bonesItems = this.bones.Items;
for (int i = 0, n = bones.Count; i < n; i++)
{
bonesItems[i].setToSetupPose();
}
var ikConstraintsItems = this.ikConstraints.Items;
for (int i = 0, n = ikConstraints.Count; i < n; i++)
{
IkConstraint constraint = ikConstraintsItems[i];
constraint.bendDirection = constraint.data.bendDirection;
constraint.mix = constraint.data.mix;
}
var transformConstraintsItems = this.transformConstraints.Items;
for (int i = 0, n = transformConstraints.Count; i < n; i++)
{
TransformConstraint constraint = transformConstraintsItems[i];
TransformConstraintData constraintData = constraint.data;
constraint.rotateMix = constraintData.rotateMix;
constraint.translateMix = constraintData.translateMix;
constraint.scaleMix = constraintData.scaleMix;
constraint.shearMix = constraintData.shearMix;
}
var pathConstraintItems = this.pathConstraints.Items;
for (int i = 0, n = pathConstraints.Count; i < n; i++)
{
PathConstraint constraint = pathConstraintItems[i];
PathConstraintData constraintData = constraint.data;
constraint.position = constraintData.position;
constraint.spacing = constraintData.spacing;
constraint.rotateMix = constraintData.rotateMix;
constraint.translateMix = constraintData.translateMix;
}
}
void setSlotsToSetupPose()
{
var slots = this.slots;
var slotsItems = slots.Items;
drawOrder.Clear();
for (int i = 0, n = slots.Count; i < n; i++)
{
drawOrder.Add(slotsItems[i]);
}
for (int i = 0, n = slots.Count; i < n; i++)
{
slotsItems[i].setToSetupPose();
}
}
/// May be null.
Bone findBone(std::string boneName)
{
if (boneName == null)
{
throw new ArgumentNullException("boneName", "boneName cannot be null.");
}
var bones = this.bones;
var bonesItems = bones.Items;
for (int i = 0, n = bones.Count; i < n; i++)
{
Bone bone = bonesItems[i];
if (bone.data.name == boneName)
{
return bone;
}
}
return null;
}
/// -1 if the bone was not found.
int findBoneIndex(std::string boneName)
{
if (boneName == null) throw new ArgumentNullException("boneName", "boneName cannot be null.");
var bones = this.bones;
var bonesItems = bones.Items;
for (int i = 0, n = bones.Count; i < n; i++)
{
if (bonesItems[i].data.name == boneName)
{
return i;
}
}
return -1;
}
/// May be null.
Slot findSlot(std::string slotName)
{
if (slotName == null)
{
throw new ArgumentNullException("slotName", "slotName cannot be null.");
}
var slots = this.slots;
var slotsItems = slots.Items;
for (int i = 0, n = slots.Count; i < n; i++)
{
Slot slot = slotsItems[i];
if (slot.data.name == slotName)
{
return slot;
}
}
return null;
}
/// -1 if the bone was not found.
int findSlotIndex(std::string slotName)
{
if (slotName == null)
{
throw new ArgumentNullException("slotName", "slotName cannot be null.");
}
var slots = this.slots;
var slotsItems = slots.Items;
for (int i = 0, n = slots.Count; i < n; i++)
{
if (slotsItems[i].data.name.Equals(slotName))
{
return i;
}
}
return -1;
}
/// Sets a skin by name (see setSkin).
void setSkin(std::string skinName)
{
Skin foundSkin = data.FindSkin(skinName);
if (foundSkin == null)
{
throw new ArgumentException("Skin not found: " + skinName, "skinName");
}
setSkin(foundSkin);
}
///
/// <para>Attachments from the new skin are attached if the corresponding attachment from the old skin was attached.
/// If there was no old skin, each slot's setup mode attachment is attached from the new skin.</para>
/// <para>After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling
/// <see cref="Skeleton.setSlotsToSetupPose()"/>.
/// Also, often <see cref="AnimationState.Apply(Skeleton)"/> is called before the next time the
/// skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.</para>
///
/// @param newSkin May be null.
void setSkin(Skin newSkin)
{
if (newSkin != null)
{
if (skin != null)
{
newSkin.AttachAll(this, skin);
}
else
{
std::vector<Slot> slots = this.slots;
for (int i = 0, n = slots.Count; i < n; i++)
{
Slot slot = slots.Items[i];
std::string name = slot.data.attachmentName;
if (name != null)
{
Attachment attachment = newSkin.getAttachment(i, name);
if (attachment != null)
{
slot.Attachment = attachment;
}
}
}
}
}
skin = newSkin;
}
/// May be null.
Attachment getAttachment(std::string slotName, std::string attachmentName)
{
return getAttachment(data.findSlotIndex(slotName), attachmentName);
}
/// May be null.
Attachment getAttachment(int slotIndex, std::string attachmentName)
{
if (attachmentName == null)
{
throw new ArgumentNullException("attachmentName", "attachmentName cannot be null.");
}
if (skin != null)
{
Attachment attachment = skin.getAttachment(slotIndex, attachmentName);
if (attachment != null)
{
return attachment;
}
}
return data.defaultSkin != null ? data.defaultSkin.getAttachment(slotIndex, attachmentName) : null;
}
/// @param attachmentName May be null.
void setAttachment(std::string slotName, std::string attachmentName)
{
if (slotName == null)
{
throw new ArgumentNullException("slotName", "slotName cannot be null.");
}
std::vector<Slot> slots = this.slots;
for (int i = 0, n = slots.Count; i < n; i++)
{
Slot slot = slots.Items[i];
if (slot.data.name == slotName)
{
Attachment attachment = null;
if (attachmentName != null)
{
attachment = getAttachment(i, attachmentName);
if (attachment == null)
{
throw new Exception("Attachment not found: " + attachmentName + ", for slot: " + slotName);
}
}
slot.Attachment = attachment;
return;
}
}
throw new Exception("Slot not found: " + slotName);
}
/// May be null.
IkConstraint findIkConstraint(std::string constraintName)
{
if (constraintName == null)
{
throw new ArgumentNullException("constraintName", "constraintName cannot be null.");
}
std::vector<IkConstraint> ikConstraints = this.ikConstraints;
for (int i = 0, n = ikConstraints.Count; i < n; i++)
{
IkConstraint ikConstraint = ikConstraints.Items[i];
if (ikConstraint.data.name == constraintName) return ikConstraint;
}
return null;
}
/// May be null.
TransformConstraint findTransformConstraint(std::string constraintName)
{
if (constraintName == null)
{
throw new ArgumentNullException("constraintName", "constraintName cannot be null.");
}
std::vector<TransformConstraint> transformConstraints = this.transformConstraints;
for (int i = 0, n = transformConstraints.Count; i < n; i++)
{
TransformConstraint transformConstraint = transformConstraints.Items[i];
if (transformConstraint.data.name == constraintName) return transformConstraint;
}
return null;
}
/// May be null.
PathConstraint findPathConstraint(std::string constraintName)
{
if (constraintName == null)
{
throw new ArgumentNullException("constraintName", "constraintName cannot be null.");
}
std::vector<PathConstraint> pathConstraints = this.pathConstraints;
for (int i = 0, n = pathConstraints.Count; i < n; i++)
{
PathConstraint constraint = pathConstraints.Items[i];
if (constraint.data.name.Equals(constraintName)) return constraint;
}
return null;
}
void update(float delta)
{
time += delta;
}
/// Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.
/// @param x The horizontal distance between the skeleton origin and the left side of the AABB.
/// @param y The vertical distance between the skeleton origin and the bottom side of the AABB.
/// @param width The width of the AABB
/// @param height The height of the AABB.
/// @param vertexBuffer Reference to hold a float[]. May be a null reference. This method will assign it a new float[] with the appropriate size as needed.
void getBounds(out float x, out float y, out float width, out float height, ref float[] vertexBuffer)
{
float[] temp = vertexBuffer;
temp = temp ?? new float[8];
var drawOrderItems = this.drawOrder.Items;
float minX = int.MaxValue, minY = int.MaxValue, maxX = int.MinValue, maxY = int.MinValue;
for (int i = 0, n = this.drawOrder.Count; i < n; i++)
{
Slot slot = drawOrderItems[i];
int verticesLength = 0;
float[] vertices = null;
Attachment attachment = slot.attachment;
var regionAttachment = attachment as RegionAttachment;
if (regionAttachment != null)
{
verticesLength = 8;
vertices = temp;
if (vertices.Length < 8) vertices = temp = new float[8];
regionAttachment.ComputeWorldVertices(slot.bone, temp, 0);
}
else
{
var meshAttachment = attachment as MeshAttachment;
if (meshAttachment != null)
{
MeshAttachment mesh = meshAttachment;
verticesLength = mesh.WorldVerticesLength;
vertices = temp;
if (vertices.Length < verticesLength)
{
vertices = temp = new float[verticesLength];
}
mesh.ComputeWorldVertices(slot, 0, verticesLength, temp, 0);
}
}
if (vertices != null)
{
for (int ii = 0; ii < verticesLength; ii += 2)
{
float vx = vertices[ii], vy = vertices[ii + 1];
minX = Math.Min(minX, vx);
minY = Math.Min(minY, vy);
maxX = Math.Max(maxX, vx);
maxY = Math.Max(maxY, vy);
}
}
}
x = minX;
y = minY;
width = maxX - minX;
height = maxY - minY;
vertexBuffer = temp;
}
private:
SkeletonData* _data;
std::vector<Bone*> _bones;
std::vector<Slot*> _slots;
std::vector<Slot*> _drawOrder;
std::vector<IkConstraint*> _ikConstraints;
std::vector<TransformConstraint*> _transformConstraints;
std::vector<PathConstraint*> _pathConstraints;
std::vector<IUpdatable*> _updateCache = new std::vector<IUpdatable>();
std::vector<Bone*> _updateCacheReset = new std::vector<Bone>();
Skin _skin;
float _r = 1, _g = 1, _b = 1, _a = 1;
float _time;
bool _flipX, _flipY;
float _x, _y;
void sortIkConstraint(IkConstraint constraint)
{
Bone target = constraint.target;
sortBone(target);
var constrained = constraint.bones;
Bone parent = constrained.Items[0];
sortBone(parent);
if (constrained.Count > 1)
{
Bone child = constrained.Items[constrained.Count - 1];
if (!updateCache.Contains(child))
{
updateCacheReset.Add(child);
}
}
updateCache.Add(constraint);
sortReset(parent.children);
constrained.Items[constrained.Count - 1].sorted = true;
}
void sortPathConstraint(PathConstraint constraint)
{
Slot slot = constraint.target;
int slotIndex = slot.data.index;
Bone slotBone = slot.bone;
if (skin != null)
{
sortPathConstraintAttachment(skin, slotIndex, slotBone);
}
if (data.defaultSkin != null && data.defaultSkin != skin)
{
sortPathConstraintAttachment(data.defaultSkin, slotIndex, slotBone);
}
for (int ii = 0, nn = data.skins.Count; ii < nn; ii++)
{
sortPathConstraintAttachment(data.skins.Items[ii], slotIndex, slotBone);
}
Attachment attachment = slot.attachment;
if (attachment is PathAttachment)
{
sortPathConstraintAttachment(attachment, slotBone);
}
var constrained = constraint.bones;
int boneCount = constrained.Count;
for (int i = 0; i < boneCount; i++)
{
sortBone(constrained.Items[i]);
}
updateCache.Add(constraint);
for (int i = 0; i < boneCount; i++)
{
sortReset(constrained.Items[i].children);
}
for (int i = 0; i < boneCount; i++)
{
constrained.Items[i].sorted = true;
}
}
void sortTransformConstraint(TransformConstraint constraint)
{
sortBone(constraint.target);
var constrained = constraint.bones;
int boneCount = constrained.Count;
if (constraint.data.local)
{
for (int i = 0; i < boneCount; i++)
{
Bone child = constrained.Items[i];
sortBone(child.parent);
if (!updateCache.Contains(child))
{
updateCacheReset.Add(child);
}
}
}
else
{
for (int i = 0; i < boneCount; i++)
{
sortBone(constrained.Items[i]);
}
}
updateCache.Add(constraint);
for (int i = 0; i < boneCount; i++)
{
sortReset(constrained.Items[i].children);
}
for (int i = 0; i < boneCount; i++)
{
constrained.Items[i].sorted = true;
}
}
void sortPathConstraintAttachment(Skin skin, int slotIndex, Bone slotBone)
{
foreach (var entry in skin.Attachments)
{
if (entry.Key.slotIndex == slotIndex)
{
sortPathConstraintAttachment(entry.Value, slotBone);
}
}
}
void sortPathConstraintAttachment(Attachment attachment, Bone slotBone)
{
if (!(attachment is PathAttachment)) return;
int[] pathBones = ((PathAttachment)attachment).bones;
if (pathBones == null)
{
sortBone(slotBone);
}
else
{
var bones = this.bones;
for (int i = 0, n = pathBones.Length; i < n;)
{
int nn = pathBones[i++];
nn += i;
while (i < nn)
{
sortBone(bones.Items[pathBones[i++]]);
}
}
}
}
void sortBone(Bone bone)
{
if (bone.sorted)
{
return;
}
Bone parent = bone.parent;
if (parent != null) sortBone(parent);
bone.sorted = true;
updateCache.Add(bone);
}
static void sortReset(std::vector<Bone*>& bones)
{
var bonesItems = bones.Items;
for (int i = 0, n = bones.Count; i < n; i++)
{
Bone bone = bonesItems[i];
if (bone.sorted)
{
sortReset(bone.children);
}
bone.sorted = false;
}
}
};
}
#endif /* Spine_Skeleton_h */

View File

@ -0,0 +1,39 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_SkeletonData_h
#define Spine_SkeletonData_h
namespace Spine
{
// TODO
}
#endif /* Spine_SkeletonData_h */

View File

@ -0,0 +1,68 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_Timeline_h
#define Spine_Timeline_h
#include <spine/MixPose.h>
#include <spine/MixDirection.h>
#include <vector>
namespace Spine
{
class Skeleton;
class Event;
class Timeline
{
public:
Timeline();
virtual ~Timeline();
/// Sets the value(s) for the specified time.
/// @param skeleton The skeleton the timeline is being applied to. This provides access to the bones, slots, and other skeleton components the timeline may change.
/// @param lastTime lastTime The time this timeline was last applied. Timelines such as EventTimeline trigger only at specific times rather than every frame. In that case, the timeline triggers everything between lastTime (exclusive) and time (inclusive).
/// @param time The time within the animation. Most timelines find the key before and the key after this time so they can interpolate between the keys.
/// @param events If any events are fired, they are added to this list. Can be null to ignore firing events or if the timeline does not fire events. May be null.
/// @param alpha alpha 0 applies the current or setup pose value (depending on pose parameter). 1 applies the timeline
/// value. Between 0 and 1 applies a value between the current or setup pose and the timeline value. By adjusting
/// alpha over time, an animation can be mixed in or out. alpha can also be useful to
/// apply animations on top of each other (layered).
/// @param pose Controls how mixing is applied when alpha is than 1.
/// @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline.
virtual void apply(Skeleton& skeleton, float lastTime, float time, std::vector<Event*>& events, float alpha, MixPose pose, MixDirection direction) = 0;
virtual int getPropertyId() = 0;
};
}
#endif /* Spine_Timeline_h */

View File

@ -0,0 +1,56 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_TimelineType_h
#define Spine_TimelineType_h
namespace Spine
{
enum TimelineType
{
TimelineType_Rotate = 0,
TimelineType_Translate,
TimelineType_Scale,
TimelineType_Shear,
TimelineType_Attachment,
TimelineType_Color,
TimelineType_Deform,
TimelineType_Event,
TimelineType_DrawOrder,
TimelineType_IkConstraint,
TimelineType_TransformConstraint,
TimelineType_PathConstraintPosition,
TimelineType_PathConstraintSpacing,
TimelineType_PathConstraintMix,
TimelineType_TwoColor
};
}
#endif /* Spine_TimelineType_h */

View File

@ -0,0 +1,39 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_TransformConstraint_h
#define Spine_TransformConstraint_h
namespace Spine
{
// TODO
}
#endif /* Spine_TransformConstraint_h */

View File

@ -28,7 +28,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#include <spine/Bone.h>
namespace Spine
{
// TODO
std::ostream& operator <<(std::ostream& os, const Bone& ref)
{
os << ref._data._name;
return os;
}
}

View File

@ -0,0 +1,45 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#include <spine/Constraint.h>
namespace Spine
{
Constraint::Constraint()
{
// Empty
}
Constraint::~Constraint()
{
// Empty
}
}

View File

@ -0,0 +1,136 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#include <spine/CurveTimeline.h>
#include <spine/MathUtil.h>
namespace Spine
{
const float CurveTimeline::LINEAR = 0;
const float CurveTimeline::STEPPED = 1;
const float CurveTimeline::BEZIER = 2;
const int CurveTimeline::BEZIER_SIZE = 10 * 2 - 1;
CurveTimeline::CurveTimeline(int frameCount)
{
assert(frameCount > 0);
_curves.reserve((frameCount - 1) * BEZIER_SIZE);
}
int CurveTimeline::getFrameCount()
{
return _curves.size() / BEZIER_SIZE + 1;
}
void CurveTimeline::setLinear(int frameIndex)
{
_curves[frameIndex * BEZIER_SIZE] = LINEAR;
}
void CurveTimeline::setStepped(int frameIndex)
{
_curves[frameIndex * BEZIER_SIZE] = STEPPED;
}
void CurveTimeline::setCurve(int frameIndex, float cx1, float cy1, float cx2, float cy2)
{
float tmpx = (-cx1 * 2 + cx2) * 0.03f, tmpy = (-cy1 * 2 + cy2) * 0.03f;
float dddfx = ((cx1 - cx2) * 3 + 1) * 0.006f, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006f;
float ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;
float dfx = cx1 * 0.3f + tmpx + dddfx * 0.16666667f, dfy = cy1 * 0.3f + tmpy + dddfy * 0.16666667f;
int i = frameIndex * BEZIER_SIZE;
_curves[i++] = BEZIER;
float x = dfx, y = dfy;
for (int n = i + BEZIER_SIZE - 1; i < n; i += 2)
{
_curves[i] = x;
_curves[i + 1] = y;
dfx += ddfx;
dfy += ddfy;
ddfx += dddfx;
ddfy += dddfy;
x += dfx;
y += dfy;
}
}
float CurveTimeline::getCurvePercent(int frameIndex, float percent)
{
percent = clamp(percent, 0, 1);
int i = frameIndex * BEZIER_SIZE;
float type = _curves[i];
if (type == LINEAR)
{
return percent;
}
if (type == STEPPED)
{
return 0;
}
i++;
float x = 0;
for (int start = i, n = i + BEZIER_SIZE - 1; i < n; i += 2)
{
x = _curves[i];
if (x >= percent)
{
float prevX, prevY;
if (i == start)
{
prevX = 0;
prevY = 0;
}
else
{
prevX = _curves[i - 2];
prevY = _curves[i - 1];
}
return prevY + (_curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);
}
}
float y = _curves[i - 1];
return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.
}
float CurveTimeline::getCurveType(int frameIndex)
{
return _curves[frameIndex * BEZIER_SIZE];
}
}

View File

@ -0,0 +1,34 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
namespace Spine
{
// TODO
}

View File

@ -0,0 +1,34 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
namespace Spine
{
// TODO
}

View File

@ -0,0 +1,139 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#include <spine/RotateTimeline.h>
#include <spine/Skeleton.h>
#include <spine/Event.h>
#include <spine/Bone.h>
#include <spine/Animation.h>
namespace Spine
{
RotateTimeline::RotateTimeline(int frameCount) : CurveTimeline(frameCount), _boneIndex(0)
{
_frames.reserve(frameCount << 1);
}
void RotateTimeline::apply(Skeleton& skeleton, float lastTime, float time, std::vector<Event*>& events, float alpha, MixPose pose, MixDirection direction)
{
Bone* bone = skeleton.getBones().at(_boneIndex);
if (time < _frames[0])
{
switch (pose)
{
case MixPose_Setup:
bone->_rotation = bone->_data->_rotation;
return;
case MixPose_Current:
float rr = bone->_data->_rotation - bone->_rotation;
rr -= (16384 - (int)(16384.499999999996 - rr / 360)) * 360;
bone->_rotation += rr * alpha;
return;
}
return;
}
if (time >= _frames[_frames.size() - ENTRIES])
{
// Time is after last frame.
if (pose == MixPose_Setup)
{
bone->_rotation = bone->_data->_rotation + _frames[_frames.size() + PREV_ROTATION] * alpha;
}
else
{
float rr = bone->_data->_rotation + _frames[_frames.size() + PREV_ROTATION] - bone->_rotation;
rr -= (16384 - (int)(16384.499999999996 - rr / 360)) * 360; // Wrap within -180 and 180.
bone->_rotation += rr * alpha;
}
return;
}
// Interpolate between the previous frame and the current frame.
int frame = Animation::binarySearch(_frames, time, ENTRIES);
float prevRotation = _frames[frame + PREV_ROTATION];
float frameTime = _frames[frame];
float percent = getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime));
float r = _frames[frame + ROTATION] - prevRotation;
r -= (16384 - (int)(16384.499999999996 - r / 360)) * 360;
r = prevRotation + r * percent;
if (pose == MixPose_Setup)
{
r -= (16384 - (int)(16384.499999999996 - r / 360)) * 360;
bone->_rotation = bone->_data->_rotation + r * alpha;
}
else
{
r = bone->_data->_rotation + r - bone->_rotation;
r -= (16384 - (int)(16384.499999999996 - r / 360)) * 360;
bone->_rotation += r * alpha;
}
}
int RotateTimeline::getPropertyId()
{
return ((int)TimelineType_Rotate << 24) + _boneIndex;
}
/// Sets the time and value of the specified keyframe.
void RotateTimeline::setFrame(int frameIndex, float time, float degrees)
{
frameIndex <<= 1;
_frames[frameIndex] = time;
_frames[frameIndex + ROTATION] = degrees;
}
int RotateTimeline::getBoneIndex()
{
return _boneIndex;
}
void RotateTimeline::setBoneIndex(int inValue)
{
_boneIndex = inValue;
}
std::vector<float>& RotateTimeline::getFrames()
{
return _frames;
}
void RotateTimeline::setFrames(std::vector<float> inValue)
{
_frames = inValue;
}
}

View File

@ -28,6 +28,17 @@
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#include <spine/Skeleton.h>
#include <spine/SkeletonData.h>
#include <spine/Bone.h>
#include <spine/Updatable.h>
#include <spine/Slot.h>
#include <spine/IkConstraint.h>
#include <spine/PathConstraint.h>
#include <spine/TransformConstraint.h>
#include <spine/Skin.h>
namespace Spine
{
// TODO

View File

@ -0,0 +1,34 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
namespace Spine
{
// TODO
}

View File

@ -0,0 +1,47 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#include <spine/Timeline.h>
#include <spine/Skeleton.h>
#include <spine/Event.h>
namespace Spine
{
Timeline::Timeline()
{
// Empty
}
Timeline::~Timeline()
{
// Empty
}
}

View File

@ -0,0 +1,34 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
namespace Spine
{
// TODO
}

View File

@ -0,0 +1,44 @@
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#include <spine/Updatable.h>
namespace Spine
{
Updatable::Updatable()
{
// Empty
}
Updatable::~Updatable()
{
// Empty
}
}