From a743b7aa23cddb5dc1d7771bcae0893f6c0d473b Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sat, 7 Jun 2025 01:43:48 +0200 Subject: [PATCH] [cpp] 4.3 porting WIP --- .../spine-cpp/include/spine/BoneTimeline.h | 47 ++++++++ .../include/spine/ConstraintTimeline.h | 47 ++++++++ .../include/spine/IkConstraintPose.h | 81 +++++++++++++ spine-cpp/spine-cpp/include/spine/Inherit.h | 1 + spine-cpp/spine-cpp/include/spine/MixBlend.h | 24 +++- .../spine-cpp/include/spine/MixDirection.h | 6 +- .../include/spine/PathConstraintPose.h | 76 +++++++++++++ spine-cpp/spine-cpp/include/spine/Physics.h | 10 +- .../include/spine/PhysicsConstraintPose.h | 80 +++++++++++++ spine-cpp/spine-cpp/include/spine/Pose.h | 55 +++++++++ spine-cpp/spine-cpp/include/spine/PosedData.h | 101 +++++++++++++++++ .../spine-cpp/include/spine/PositionMode.h | 3 + .../spine-cpp/include/spine/RotateMode.h | 5 + .../spine-cpp/include/spine/SliderPose.h | 57 ++++++++++ .../spine-cpp/include/spine/SlotTimeline.h | 47 ++++++++ .../spine-cpp/include/spine/SpacingMode.h | 3 + spine-cpp/spine-cpp/include/spine/spine.h | 9 ++ .../spine-cpp/src/spine/BoneTimeline.cpp | 38 +++++++ .../src/spine/ConstraintTimeline.cpp | 38 +++++++ .../spine-cpp/src/spine/IkConstraintPose.cpp | 88 +++++++++++++++ .../src/spine/PathConstraintPose.cpp | 88 +++++++++++++++ .../src/spine/PhysicsConstraintPose.cpp | 106 ++++++++++++++++++ spine-cpp/spine-cpp/src/spine/SliderPose.cpp | 61 ++++++++++ 23 files changed, 1062 insertions(+), 9 deletions(-) create mode 100644 spine-cpp/spine-cpp/include/spine/BoneTimeline.h create mode 100644 spine-cpp/spine-cpp/include/spine/ConstraintTimeline.h create mode 100644 spine-cpp/spine-cpp/include/spine/IkConstraintPose.h create mode 100644 spine-cpp/spine-cpp/include/spine/PathConstraintPose.h create mode 100644 spine-cpp/spine-cpp/include/spine/PhysicsConstraintPose.h create mode 100644 spine-cpp/spine-cpp/include/spine/Pose.h create mode 100644 spine-cpp/spine-cpp/include/spine/PosedData.h create mode 100644 spine-cpp/spine-cpp/include/spine/SliderPose.h create mode 100644 spine-cpp/spine-cpp/include/spine/SlotTimeline.h create mode 100644 spine-cpp/spine-cpp/src/spine/BoneTimeline.cpp create mode 100644 spine-cpp/spine-cpp/src/spine/ConstraintTimeline.cpp create mode 100644 spine-cpp/spine-cpp/src/spine/IkConstraintPose.cpp create mode 100644 spine-cpp/spine-cpp/src/spine/PathConstraintPose.cpp create mode 100644 spine-cpp/spine-cpp/src/spine/PhysicsConstraintPose.cpp create mode 100644 spine-cpp/spine-cpp/src/spine/SliderPose.cpp diff --git a/spine-cpp/spine-cpp/include/spine/BoneTimeline.h b/spine-cpp/spine-cpp/include/spine/BoneTimeline.h new file mode 100644 index 000000000..9ea945c01 --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/BoneTimeline.h @@ -0,0 +1,47 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef Spine_BoneTimeline_h +#define Spine_BoneTimeline_h + +#include + +namespace spine { + /// An interface for timelines which change the property of a bone. + class SP_API BoneTimeline { + public: + BoneTimeline(); + virtual ~BoneTimeline(); + + /// The index of the bone in Skeleton::getBones() that will be changed when this timeline is applied. + virtual int getBoneIndex() = 0; + }; +} + +#endif \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/ConstraintTimeline.h b/spine-cpp/spine-cpp/include/spine/ConstraintTimeline.h new file mode 100644 index 000000000..417665f5a --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/ConstraintTimeline.h @@ -0,0 +1,47 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef Spine_ConstraintTimeline_h +#define Spine_ConstraintTimeline_h + +#include + +namespace spine { + /// An interface for timelines which change the property of a constraint. + class SP_API ConstraintTimeline { + public: + ConstraintTimeline(); + virtual ~ConstraintTimeline(); + + /// The index of the constraint in Skeleton::getConstraints() that will be changed when this timeline is applied. + virtual int getConstraintIndex() = 0; + }; +} + +#endif \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/IkConstraintPose.h b/spine-cpp/spine-cpp/include/spine/IkConstraintPose.h new file mode 100644 index 000000000..213f02d98 --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/IkConstraintPose.h @@ -0,0 +1,81 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef Spine_IkConstraintPose_h +#define Spine_IkConstraintPose_h + +#include +#include + +namespace spine { + + /// Stores the current pose for an IK constraint. + class SP_API IkConstraintPose : public Pose { + RTTI_DECL + + public: + IkConstraintPose(); + virtual ~IkConstraintPose(); + + virtual void set(IkConstraintPose& pose) override; + + /// A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. + /// + /// For two bone IK: if the parent bone has local nonuniform scale, the child bone's local Y translation is set to 0. + float getMix(); + void setMix(float mix); + + /// For two bone IK, the target bone's distance from the maximum reach of the bones where rotation begins to slow. The bones + /// will not straighten completely until the target is this far out of range. + float getSoftness(); + void setSoftness(float softness); + + /// For two bone IK, controls the bend direction of the IK bones, either 1 or -1. + int getBendDirection(); + void setBendDirection(int bendDirection); + + /// For one bone IK, when true and the target is too close, the bone is scaled to reach it. + bool getCompress(); + void setCompress(bool compress); + + /// When true and the target is out of range, the parent bone is scaled to reach it. + /// + /// For two bone IK: 1) the child bone's local Y translation is set to 0, 2) stretch is not applied if getSoftness() is + /// > 0, and 3) if the parent bone has local nonuniform scale, stretch is not applied. + bool getStretch(); + void setStretch(bool stretch); + + private: + int _bendDirection; + bool _compress, _stretch; + float _mix, _softness; + }; +} + +#endif /* Spine_IkConstraintPose_h */ \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/Inherit.h b/spine-cpp/spine-cpp/include/spine/Inherit.h index fcc3a74d8..d6408fa1f 100644 --- a/spine-cpp/spine-cpp/include/spine/Inherit.h +++ b/spine-cpp/spine-cpp/include/spine/Inherit.h @@ -31,6 +31,7 @@ #define Spine_TransformMode_h namespace spine { + /// Determines how a bone inherits world transforms from parent bones. enum Inherit { Inherit_Normal = 0, Inherit_OnlyTranslation, diff --git a/spine-cpp/spine-cpp/include/spine/MixBlend.h b/spine-cpp/spine-cpp/include/spine/MixBlend.h index 3aa0faf89..8265beb32 100644 --- a/spine-cpp/spine-cpp/include/spine/MixBlend.h +++ b/spine-cpp/spine-cpp/include/spine/MixBlend.h @@ -32,12 +32,32 @@ namespace spine { -/// Controls how a timeline is mixed with the setup or current pose. -/// See also Timeline::apply(Skeleton&, float, float, Vector&, float, Blend, MixDirection) + /// Controls how timeline values are mixed with setup pose values or current pose values when a timeline is applied with + /// alpha < 1. + /// + /// See Timeline::apply(). enum MixBlend { + /// Transitions between the setup and timeline values (the current value is not used). Before the first frame, the setup + /// value is used. + /// + /// MixBlend_Setup is intended to transition to or from the setup pose, not for animations layered on top of others. MixBlend_Setup = 0, + /// Transitions between the current and timeline values. Before the first frame, transitions between the current and setup + /// values. Timelines which perform instant transitions, such as DrawOrderTimeline or AttachmentTimeline, use + /// the setup value before the first frame. + /// + /// MixBlend_First is intended for the first animations applied, not for animations layered on top of others. MixBlend_First, + /// Transitions between the current and timeline values. No change is made before the first frame. + /// + /// MixBlend_Replace is intended for animations layered on top of others, not for the first animations applied. MixBlend_Replace, + /// Transitions between the current value and the current plus timeline values. No change is made before the first frame. + /// + /// MixBlend_Add is intended for animations layered on top of others, not for the first animations applied. + /// + /// Properties set by additive animations must be set manually or by another animation before applying the additive + /// animations, else the property values will increase each time the additive animations are applied. MixBlend_Add }; } diff --git a/spine-cpp/spine-cpp/include/spine/MixDirection.h b/spine-cpp/spine-cpp/include/spine/MixDirection.h index dbb12870c..0ba09a5c9 100644 --- a/spine-cpp/spine-cpp/include/spine/MixDirection.h +++ b/spine-cpp/spine-cpp/include/spine/MixDirection.h @@ -32,8 +32,10 @@ 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, Vector&, float, MixPose, MixDirection) + /// Indicates whether a timeline's alpha is mixing out over time toward 0 (the setup or current pose value) or + /// mixing in toward 1 (the timeline's value). Some timelines use this to decide how values are applied. + /// + /// See Timeline::apply(). enum MixDirection { MixDirection_In = 0, MixDirection_Out diff --git a/spine-cpp/spine-cpp/include/spine/PathConstraintPose.h b/spine-cpp/spine-cpp/include/spine/PathConstraintPose.h new file mode 100644 index 000000000..2bc70e0aa --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/PathConstraintPose.h @@ -0,0 +1,76 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef Spine_PathConstraintPose_h +#define Spine_PathConstraintPose_h + +#include +#include + +namespace spine { + /// Stores a pose for a path constraint. + class SP_API PathConstraintPose : public Pose { + RTTI_DECL + + private: + float _position; + float _spacing; + float _mixRotate; + float _mixX; + float _mixY; + + public: + PathConstraintPose(); + virtual ~PathConstraintPose(); + + virtual void set(PathConstraintPose& pose) override; + + /// The position along the path. + float getPosition(); + void setPosition(float position); + + /// The spacing between bones. + float getSpacing(); + void setSpacing(float spacing); + + /// A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. + float getMixRotate(); + void setMixRotate(float mixRotate); + + /// A percentage (0-1) that controls the mix between the constrained and unconstrained translation X. + float getMixX(); + void setMixX(float mixX); + + /// A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y. + float getMixY(); + void setMixY(float mixY); + }; +} + +#endif \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/Physics.h b/spine-cpp/spine-cpp/include/spine/Physics.h index e7b9f7a10..de486f465 100644 --- a/spine-cpp/spine-cpp/include/spine/Physics.h +++ b/spine-cpp/spine-cpp/include/spine/Physics.h @@ -30,19 +30,19 @@ #ifndef Spine_Physics_h #define Spine_Physics_h -/** Determines how physics and other non-deterministic updates are applied. */ +/// Determines how physics and other non-deterministic updates are applied. namespace spine { enum Physics { - /** Physics are not updated or applied. */ + /// Physics are not updated or applied. Physics_None, - /** Physics are reset to the current pose. */ + /// Physics are reset to the current pose. Physics_Reset, - /** Physics are updated and the pose from physics is applied. */ + /// Physics are updated and the pose from physics is applied. Physics_Update, - /** Physics are not updated but the pose from physics is applied. */ + /// Physics are not updated but the pose from physics is applied. Physics_Pose }; } diff --git a/spine-cpp/spine-cpp/include/spine/PhysicsConstraintPose.h b/spine-cpp/spine-cpp/include/spine/PhysicsConstraintPose.h new file mode 100644 index 000000000..b5a57633e --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/PhysicsConstraintPose.h @@ -0,0 +1,80 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef Spine_PhysicsConstraintPose_h +#define Spine_PhysicsConstraintPose_h + +#include +#include + +namespace spine { + /// Stores a pose for a physics constraint. + class SP_API PhysicsConstraintPose : public Pose { + RTTI_DECL + + private: + float _inertia; + float _strength; + float _damping; + float _massInverse; + float _wind; + float _gravity; + float _mix; + + public: + PhysicsConstraintPose(); + virtual ~PhysicsConstraintPose(); + + virtual void set(PhysicsConstraintPose& pose) override; + + float getInertia(); + void setInertia(float inertia); + + float getStrength(); + void setStrength(float strength); + + float getDamping(); + void setDamping(float damping); + + float getMassInverse(); + void setMassInverse(float massInverse); + + float getWind(); + void setWind(float wind); + + float getGravity(); + void setGravity(float gravity); + + /// A percentage (0-1) that controls the mix between the constrained and unconstrained poses. + float getMix(); + void setMix(float mix); + }; +} + +#endif \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/Pose.h b/spine-cpp/spine-cpp/include/spine/Pose.h new file mode 100644 index 000000000..819acb317 --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/Pose.h @@ -0,0 +1,55 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef Spine_Pose_h +#define Spine_Pose_h + +#include + +namespace spine { + template + class SP_API Pose : public SpineObject { + public: + Pose(); + virtual ~Pose(); + + /// Sets the pose values. + virtual void set(P& pose) = 0; + }; + + template + Pose

::Pose() { + } + + template + Pose

::~Pose() { + } +} + +#endif \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/PosedData.h b/spine-cpp/spine-cpp/include/spine/PosedData.h new file mode 100644 index 000000000..8cbd4dbd0 --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/PosedData.h @@ -0,0 +1,101 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef Spine_PosedData_h +#define Spine_PosedData_h + +#include +#include + +namespace spine { + template + class Pose; + + /// The base class for all constrained datas. + template + class SP_API PosedData : public SpineObject { + private: + spine::String _name; + P* _setup; + bool _skinRequired; + + public: + PosedData(const spine::String& name, P* setup); + virtual ~PosedData(); + + /// The constraint's name, which is unique across all constraints in the skeleton of the same type. + const spine::String& getName(); + + P* getSetupPose(); + + /// When true, Skeleton::updateWorldTransform(Physics) only updates this constraint if the Skeleton::getSkin() + /// contains this constraint. + /// + /// See Skin::getConstraints(). + bool getSkinRequired(); + void setSkinRequired(bool skinRequired); + + virtual spine::String toString(); + }; + + template + PosedData

::PosedData(const spine::String& name, P* setup) : _name(name), _setup(setup), _skinRequired(false) { + } + + template + PosedData

::~PosedData() { + } + + template + const spine::String& PosedData

::getName() { + return _name; + } + + template + P* PosedData

::getSetupPose() { + return _setup; + } + + template + bool PosedData

::getSkinRequired() { + return _skinRequired; + } + + template + void PosedData

::setSkinRequired(bool skinRequired) { + _skinRequired = skinRequired; + } + + template + spine::String PosedData

::toString() { + return _name; + } +} + +#endif \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/PositionMode.h b/spine-cpp/spine-cpp/include/spine/PositionMode.h index ee5b4b06c..8226b37b6 100644 --- a/spine-cpp/spine-cpp/include/spine/PositionMode.h +++ b/spine-cpp/spine-cpp/include/spine/PositionMode.h @@ -31,6 +31,9 @@ #define Spine_PositionMode_h namespace spine { + /// Controls how the first bone is positioned along the path. + /// + /// @see https://esotericsoftware.com/spine-path-constraints#Position-mode Position mode in the Spine User Guide. enum PositionMode { PositionMode_Fixed = 0, PositionMode_Percent diff --git a/spine-cpp/spine-cpp/include/spine/RotateMode.h b/spine-cpp/spine-cpp/include/spine/RotateMode.h index fd3e37333..2a1c5142f 100644 --- a/spine-cpp/spine-cpp/include/spine/RotateMode.h +++ b/spine-cpp/spine-cpp/include/spine/RotateMode.h @@ -31,9 +31,14 @@ #define Spine_RotateMode_h namespace spine { + /// Controls how bones are rotated, translated, and scaled to match the path. + /// + /// @see https://esotericsoftware.com/spine-path-constraints#Rotate-Mix Rotate mode in the Spine User Guide. enum RotateMode { RotateMode_Tangent = 0, RotateMode_Chain, + /// When chain scale, constrained bones should all have the same parent. That way when the path constraint scales a bone, it + /// doesn't affect other constrained bones. RotateMode_ChainScale }; } diff --git a/spine-cpp/spine-cpp/include/spine/SliderPose.h b/spine-cpp/spine-cpp/include/spine/SliderPose.h new file mode 100644 index 000000000..b4153428a --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/SliderPose.h @@ -0,0 +1,57 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef Spine_SliderPose_h +#define Spine_SliderPose_h + +#include +#include + +namespace spine { + /// Stores a pose for a slider. + class SP_API SliderPose : public Pose { + RTTI_DECL + private: + float _time, _mix; + + public: + SliderPose(); + virtual ~SliderPose(); + + virtual void set(SliderPose& pose) override; + + float getTime(); + void setTime(float time); + + float getMix(); + void setMix(float mix); + }; +} + +#endif \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/SlotTimeline.h b/spine-cpp/spine-cpp/include/spine/SlotTimeline.h new file mode 100644 index 000000000..f1b0c4023 --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/SlotTimeline.h @@ -0,0 +1,47 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef Spine_SlotTimeline_h +#define Spine_SlotTimeline_h + +#include + +namespace spine { + + /// An interface for timelines which change the property of a slot. + class SP_API SlotTimeline { + public: + virtual ~SlotTimeline() {} + + /// The index of the slot in Skeleton::getSlots() that will be changed when this timeline is applied. + virtual int getSlotIndex() = 0; + }; +} + +#endif /* Spine_SlotTimeline_h */ \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/SpacingMode.h b/spine-cpp/spine-cpp/include/spine/SpacingMode.h index 84a311ba8..85b45681e 100644 --- a/spine-cpp/spine-cpp/include/spine/SpacingMode.h +++ b/spine-cpp/spine-cpp/include/spine/SpacingMode.h @@ -31,6 +31,9 @@ #define Spine_SpacingMode_h namespace spine { + /// Controls how bones after the first bone are positioned along the path. + /// + /// @see https://esotericsoftware.com/spine-path-constraints#Spacing-mode Spacing mode in the Spine User Guide. enum SpacingMode { SpacingMode_Length = 0, SpacingMode_Fixed, diff --git a/spine-cpp/spine-cpp/include/spine/spine.h b/spine-cpp/spine-cpp/include/spine/spine.h index ab3e5414e..e617de641 100644 --- a/spine-cpp/spine-cpp/include/spine/spine.h +++ b/spine-cpp/spine-cpp/include/spine/spine.h @@ -41,12 +41,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -59,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -71,14 +74,18 @@ #include #include #include +#include #include #include #include #include #include #include +#include +#include #include #include +#include #include #include #include @@ -95,8 +102,10 @@ #include #include #include +#include #include #include +#include #include #include #include diff --git a/spine-cpp/spine-cpp/src/spine/BoneTimeline.cpp b/spine-cpp/spine-cpp/src/spine/BoneTimeline.cpp new file mode 100644 index 000000000..fae0dd334 --- /dev/null +++ b/spine-cpp/spine-cpp/src/spine/BoneTimeline.cpp @@ -0,0 +1,38 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#include + +using namespace spine; + +BoneTimeline::BoneTimeline() { +} + +BoneTimeline::~BoneTimeline() { +} \ No newline at end of file diff --git a/spine-cpp/spine-cpp/src/spine/ConstraintTimeline.cpp b/spine-cpp/spine-cpp/src/spine/ConstraintTimeline.cpp new file mode 100644 index 000000000..24d64093f --- /dev/null +++ b/spine-cpp/spine-cpp/src/spine/ConstraintTimeline.cpp @@ -0,0 +1,38 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#include + +using namespace spine; + +ConstraintTimeline::ConstraintTimeline() { +} + +ConstraintTimeline::~ConstraintTimeline() { +} \ No newline at end of file diff --git a/spine-cpp/spine-cpp/src/spine/IkConstraintPose.cpp b/spine-cpp/spine-cpp/src/spine/IkConstraintPose.cpp new file mode 100644 index 000000000..df32f7f5d --- /dev/null +++ b/spine-cpp/spine-cpp/src/spine/IkConstraintPose.cpp @@ -0,0 +1,88 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#include + +using namespace spine; + +RTTI_IMPL_NOPARENT(IkConstraintPose) + +IkConstraintPose::IkConstraintPose() : _bendDirection(0), _compress(false), _stretch(false), _mix(0), _softness(0) { +} + +IkConstraintPose::~IkConstraintPose() { +} + +void IkConstraintPose::set(IkConstraintPose& pose) { + _mix = pose._mix; + _softness = pose._softness; + _bendDirection = pose._bendDirection; + _compress = pose._compress; + _stretch = pose._stretch; +} + +float IkConstraintPose::getMix() { + return _mix; +} + +void IkConstraintPose::setMix(float mix) { + _mix = mix; +} + +float IkConstraintPose::getSoftness() { + return _softness; +} + +void IkConstraintPose::setSoftness(float softness) { + _softness = softness; +} + +int IkConstraintPose::getBendDirection() { + return _bendDirection; +} + +void IkConstraintPose::setBendDirection(int bendDirection) { + _bendDirection = bendDirection; +} + +bool IkConstraintPose::getCompress() { + return _compress; +} + +void IkConstraintPose::setCompress(bool compress) { + _compress = compress; +} + +bool IkConstraintPose::getStretch() { + return _stretch; +} + +void IkConstraintPose::setStretch(bool stretch) { + _stretch = stretch; +} \ No newline at end of file diff --git a/spine-cpp/spine-cpp/src/spine/PathConstraintPose.cpp b/spine-cpp/spine-cpp/src/spine/PathConstraintPose.cpp new file mode 100644 index 000000000..0e305ec80 --- /dev/null +++ b/spine-cpp/spine-cpp/src/spine/PathConstraintPose.cpp @@ -0,0 +1,88 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#include + +using namespace spine; + +RTTI_IMPL_NOPARENT(PathConstraintPose) + +PathConstraintPose::PathConstraintPose() : Pose(), _position(0), _spacing(0), _mixRotate(0), _mixX(0), _mixY(0) { +} + +PathConstraintPose::~PathConstraintPose() { +} + +void PathConstraintPose::set(PathConstraintPose& pose) { + _position = pose._position; + _spacing = pose._spacing; + _mixRotate = pose._mixRotate; + _mixX = pose._mixX; + _mixY = pose._mixY; +} + +float PathConstraintPose::getPosition() { + return _position; +} + +void PathConstraintPose::setPosition(float position) { + _position = position; +} + +float PathConstraintPose::getSpacing() { + return _spacing; +} + +void PathConstraintPose::setSpacing(float spacing) { + _spacing = spacing; +} + +float PathConstraintPose::getMixRotate() { + return _mixRotate; +} + +void PathConstraintPose::setMixRotate(float mixRotate) { + _mixRotate = mixRotate; +} + +float PathConstraintPose::getMixX() { + return _mixX; +} + +void PathConstraintPose::setMixX(float mixX) { + _mixX = mixX; +} + +float PathConstraintPose::getMixY() { + return _mixY; +} + +void PathConstraintPose::setMixY(float mixY) { + _mixY = mixY; +} \ No newline at end of file diff --git a/spine-cpp/spine-cpp/src/spine/PhysicsConstraintPose.cpp b/spine-cpp/spine-cpp/src/spine/PhysicsConstraintPose.cpp new file mode 100644 index 000000000..81e527c65 --- /dev/null +++ b/spine-cpp/spine-cpp/src/spine/PhysicsConstraintPose.cpp @@ -0,0 +1,106 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#include + +using namespace spine; + +RTTI_IMPL_NOPARENT(PhysicsConstraintPose) + +PhysicsConstraintPose::PhysicsConstraintPose() : Pose(), _inertia(0), _strength(0), _damping(0), _massInverse(0), _wind(0), _gravity(0), _mix(0) { +} + +PhysicsConstraintPose::~PhysicsConstraintPose() { +} + +void PhysicsConstraintPose::set(PhysicsConstraintPose& pose) { + _inertia = pose._inertia; + _strength = pose._strength; + _damping = pose._damping; + _massInverse = pose._massInverse; + _wind = pose._wind; + _gravity = pose._gravity; + _mix = pose._mix; +} + +float PhysicsConstraintPose::getInertia() { + return _inertia; +} + +void PhysicsConstraintPose::setInertia(float inertia) { + _inertia = inertia; +} + +float PhysicsConstraintPose::getStrength() { + return _strength; +} + +void PhysicsConstraintPose::setStrength(float strength) { + _strength = strength; +} + +float PhysicsConstraintPose::getDamping() { + return _damping; +} + +void PhysicsConstraintPose::setDamping(float damping) { + _damping = damping; +} + +float PhysicsConstraintPose::getMassInverse() { + return _massInverse; +} + +void PhysicsConstraintPose::setMassInverse(float massInverse) { + _massInverse = massInverse; +} + +float PhysicsConstraintPose::getWind() { + return _wind; +} + +void PhysicsConstraintPose::setWind(float wind) { + _wind = wind; +} + +float PhysicsConstraintPose::getGravity() { + return _gravity; +} + +void PhysicsConstraintPose::setGravity(float gravity) { + _gravity = gravity; +} + +float PhysicsConstraintPose::getMix() { + return _mix; +} + +void PhysicsConstraintPose::setMix(float mix) { + _mix = mix; +} \ No newline at end of file diff --git a/spine-cpp/spine-cpp/src/spine/SliderPose.cpp b/spine-cpp/spine-cpp/src/spine/SliderPose.cpp new file mode 100644 index 000000000..f0293523c --- /dev/null +++ b/spine-cpp/spine-cpp/src/spine/SliderPose.cpp @@ -0,0 +1,61 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 LLC 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 + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#include + +using namespace spine; + +RTTI_IMPL_NOPARENT(SliderPose) + +SliderPose::SliderPose() : _time(0), _mix(0) { +} + +SliderPose::~SliderPose() { +} + +void SliderPose::set(SliderPose& pose) { + _time = pose._time; + _mix = pose._mix; +} + +float SliderPose::getTime() { + return _time; +} + +void SliderPose::setTime(float time) { + this->_time = time; +} + +float SliderPose::getMix() { + return _mix; +} + +void SliderPose::setMix(float mix) { + this->_mix = mix; +} \ No newline at end of file