mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-10 04:36:57 +08:00
[godot] Clean-up SpinePathConstraintData, rename common.h
This commit is contained in:
parent
f9fd3f54d4
commit
676a7443dd
@ -27,11 +27,11 @@
|
|||||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "SpineAnimation.h"
|
#include "SpineAnimation.h"
|
||||||
#include "SpineSkeleton.h"
|
#include "SpineSkeleton.h"
|
||||||
#include "SpineEvent.h"
|
#include "SpineEvent.h"
|
||||||
#include "SpineTimeline.h"
|
#include "SpineTimeline.h"
|
||||||
|
#include "SpineCommon.h"
|
||||||
|
|
||||||
#include "core/method_bind_ext.gen.inc"
|
#include "core/method_bind_ext.gen.inc"
|
||||||
|
|
||||||
|
|||||||
@ -27,8 +27,8 @@
|
|||||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "SpineAnimationState.h"
|
#include "SpineAnimationState.h"
|
||||||
|
#include "SpineCommon.h"
|
||||||
|
|
||||||
void SpineAnimationState::_bind_methods() {
|
void SpineAnimationState::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("update", "delta"), &SpineAnimationState::update, DEFVAL(0));
|
ClassDB::bind_method(D_METHOD("update", "delta"), &SpineAnimationState::update, DEFVAL(0));
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "SpineAttachment.h"
|
#include "SpineAttachment.h"
|
||||||
#include "common.h"
|
#include "SpineCommon.h"
|
||||||
|
|
||||||
void SpineAttachment::_bind_methods() {
|
void SpineAttachment::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("get_attachment_name"), &SpineAttachment::get_attachment_name);
|
ClassDB::bind_method(D_METHOD("get_attachment_name"), &SpineAttachment::get_attachment_name);
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
#include "SpineBone.h"
|
#include "SpineBone.h"
|
||||||
#include "SpineSprite.h"
|
#include "SpineSprite.h"
|
||||||
#include "SpineSkeleton.h"
|
#include "SpineSkeleton.h"
|
||||||
#include "common.h"
|
#include "SpineCommon.h"
|
||||||
|
|
||||||
void SpineBone::_bind_methods() {
|
void SpineBone::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("update_world_transform"), &SpineBone::update_world_transform);
|
ClassDB::bind_method(D_METHOD("update_world_transform"), &SpineBone::update_world_transform);
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "SpineBoneData.h"
|
#include "SpineBoneData.h"
|
||||||
#include "common.h"
|
#include "SpineCommon.h"
|
||||||
|
|
||||||
void SpineBoneData::_bind_methods() {
|
void SpineBoneData::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("get_index"), &SpineBoneData::get_index);
|
ClassDB::bind_method(D_METHOD("get_index"), &SpineBoneData::get_index);
|
||||||
@ -192,4 +192,4 @@ Color SpineBoneData::get_color() {
|
|||||||
void SpineBoneData::set_color(Color color) {
|
void SpineBoneData::set_color(Color color) {
|
||||||
SPINE_CHECK(bone_data,)
|
SPINE_CHECK(bone_data,)
|
||||||
bone_data->getColor().set(color.r, color.g, color.b, color.a);
|
bone_data->getColor().set(color.r, color.g, color.b, color.a);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,4 +64,15 @@ void SpineConstant::_bind_methods() {
|
|||||||
BIND_ENUM_CONSTANT(TransformMode_NoRotationOrReflection)
|
BIND_ENUM_CONSTANT(TransformMode_NoRotationOrReflection)
|
||||||
BIND_ENUM_CONSTANT(TransformMode_NoScale)
|
BIND_ENUM_CONSTANT(TransformMode_NoScale)
|
||||||
BIND_ENUM_CONSTANT(TransformMode_NoScaleOrReflection)
|
BIND_ENUM_CONSTANT(TransformMode_NoScaleOrReflection)
|
||||||
|
|
||||||
|
BIND_ENUM_CONSTANT(PositionMode_Fixed)
|
||||||
|
BIND_ENUM_CONSTANT(PositionMode_Percent)
|
||||||
|
|
||||||
|
BIND_ENUM_CONSTANT(SpacingMode_Length)
|
||||||
|
BIND_ENUM_CONSTANT(SpacingMode_Fixed)
|
||||||
|
BIND_ENUM_CONSTANT(SpacingMode_Percent)
|
||||||
|
|
||||||
|
BIND_ENUM_CONSTANT(RotateMode_Tangent)
|
||||||
|
BIND_ENUM_CONSTANT(RotateMode_Chain)
|
||||||
|
BIND_ENUM_CONSTANT(RotateMode_ChainScale)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,11 +81,31 @@ public:
|
|||||||
TransformMode_NoScale,
|
TransformMode_NoScale,
|
||||||
TransformMode_NoScaleOrReflection
|
TransformMode_NoScaleOrReflection
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum PositionMode {
|
||||||
|
PositionMode_Fixed = 0,
|
||||||
|
PositionMode_Percent
|
||||||
|
};
|
||||||
|
|
||||||
|
enum SpacingMode {
|
||||||
|
SpacingMode_Length = 0,
|
||||||
|
SpacingMode_Fixed,
|
||||||
|
SpacingMode_Percent
|
||||||
|
};
|
||||||
|
|
||||||
|
enum RotateMode {
|
||||||
|
RotateMode_Tangent = 0,
|
||||||
|
RotateMode_Chain,
|
||||||
|
RotateMode_ChainScale
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
VARIANT_ENUM_CAST(SpineConstant::MixBlend);
|
VARIANT_ENUM_CAST(SpineConstant::MixBlend);
|
||||||
VARIANT_ENUM_CAST(SpineConstant::MixDirection);
|
VARIANT_ENUM_CAST(SpineConstant::MixDirection);
|
||||||
VARIANT_ENUM_CAST(SpineConstant::PropertyId);
|
VARIANT_ENUM_CAST(SpineConstant::PropertyId);
|
||||||
VARIANT_ENUM_CAST(SpineConstant::TransformMode);
|
VARIANT_ENUM_CAST(SpineConstant::TransformMode);
|
||||||
|
VARIANT_ENUM_CAST(SpineConstant::PositionMode);
|
||||||
|
VARIANT_ENUM_CAST(SpineConstant::SpacingMode);
|
||||||
|
VARIANT_ENUM_CAST(SpineConstant::RotateMode);
|
||||||
|
|
||||||
#endif//GODOT_SPINECONSTANT_H
|
#endif//GODOT_SPINECONSTANT_H
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include "SpineConstraintData.h"
|
#include "SpineConstraintData.h"
|
||||||
#include <spine/ConstraintData.h>
|
#include <spine/ConstraintData.h>
|
||||||
#include "common.h"
|
#include "SpineCommon.h"
|
||||||
|
|
||||||
void SpineConstraintData::_bind_methods() {
|
void SpineConstraintData::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("get_constraint_name"), &SpineConstraintData::get_constraint_name);
|
ClassDB::bind_method(D_METHOD("get_constraint_name"), &SpineConstraintData::get_constraint_name);
|
||||||
|
|||||||
@ -28,8 +28,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "SpineEvent.h"
|
#include "SpineEvent.h"
|
||||||
#include <spine/Event.h>
|
#include "SpineCommon.h"
|
||||||
#include "common.h"
|
|
||||||
|
|
||||||
void SpineEvent::_bind_methods() {
|
void SpineEvent::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("get_data"), &SpineEvent::get_data);
|
ClassDB::bind_method(D_METHOD("get_data"), &SpineEvent::get_data);
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "SpineEventData.h"
|
#include "SpineEventData.h"
|
||||||
#include "common.h"
|
#include "SpineCommon.h"
|
||||||
|
|
||||||
void SpineEventData::_bind_methods() {
|
void SpineEventData::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("get_event_name"), &SpineEventData::get_event_name);
|
ClassDB::bind_method(D_METHOD("get_event_name"), &SpineEventData::get_event_name);
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include "SpineIkConstraint.h"
|
#include "SpineIkConstraint.h"
|
||||||
#include "SpineBone.h"
|
#include "SpineBone.h"
|
||||||
#include "common.h"
|
#include "SpineCommon.h"
|
||||||
|
|
||||||
void SpineIkConstraint::_bind_methods() {
|
void SpineIkConstraint::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("update"), &SpineIkConstraint::update);
|
ClassDB::bind_method(D_METHOD("update"), &SpineIkConstraint::update);
|
||||||
|
|||||||
@ -28,8 +28,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "SpineIkConstraintData.h"
|
#include "SpineIkConstraintData.h"
|
||||||
|
#include "SpineCommon.h"
|
||||||
#include "common.h"
|
|
||||||
|
|
||||||
void SpineIkConstraintData::_bind_methods() {
|
void SpineIkConstraintData::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("get_bones"), &SpineIkConstraintData::get_bones);
|
ClassDB::bind_method(D_METHOD("get_bones"), &SpineIkConstraintData::get_bones);
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class SpineIkConstraintData : public SpineConstraintData {
|
|||||||
GDCLASS(SpineIkConstraintData, SpineConstraintData)
|
GDCLASS(SpineIkConstraintData, SpineConstraintData)
|
||||||
|
|
||||||
spine::IkConstraintData *get_spine_constraint_data() { return (spine::IkConstraintData *)get_spine_object(); }
|
spine::IkConstraintData *get_spine_constraint_data() { return (spine::IkConstraintData *)get_spine_object(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
@ -49,31 +49,31 @@ public:
|
|||||||
Array get_bones();
|
Array get_bones();
|
||||||
|
|
||||||
Ref<SpineBoneData> get_target();
|
Ref<SpineBoneData> get_target();
|
||||||
|
|
||||||
void set_target(Ref<SpineBoneData> v);
|
void set_target(Ref<SpineBoneData> v);
|
||||||
|
|
||||||
int get_bend_direction();
|
int get_bend_direction();
|
||||||
|
|
||||||
void set_bend_direction(int v);
|
void set_bend_direction(int v);
|
||||||
|
|
||||||
bool get_compress();
|
bool get_compress();
|
||||||
|
|
||||||
void set_compress(bool v);
|
void set_compress(bool v);
|
||||||
|
|
||||||
bool get_stretch();
|
bool get_stretch();
|
||||||
|
|
||||||
void set_stretch(bool v);
|
void set_stretch(bool v);
|
||||||
|
|
||||||
bool get_uniform();
|
bool get_uniform();
|
||||||
|
|
||||||
void set_uniform(bool v);
|
void set_uniform(bool v);
|
||||||
|
|
||||||
float get_mix();
|
float get_mix();
|
||||||
|
|
||||||
void set_mix(float v);
|
void set_mix(float v);
|
||||||
|
|
||||||
float get_softness();
|
float get_softness();
|
||||||
|
|
||||||
void set_softness(float v);
|
void set_softness(float v);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include "SpinePathConstraint.h"
|
#include "SpinePathConstraint.h"
|
||||||
#include "SpineBone.h"
|
#include "SpineBone.h"
|
||||||
#include "common.h"
|
#include "SpineCommon.h"
|
||||||
|
|
||||||
void SpinePathConstraint::_bind_methods() {
|
void SpinePathConstraint::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("update"), &SpinePathConstraint::update);
|
ClassDB::bind_method(D_METHOD("update"), &SpinePathConstraint::update);
|
||||||
|
|||||||
@ -28,10 +28,10 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "SpinePathConstraintData.h"
|
#include "SpinePathConstraintData.h"
|
||||||
|
#include "SpineCommon.h"
|
||||||
|
|
||||||
void SpinePathConstraintData::_bind_methods() {
|
void SpinePathConstraintData::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("get_all_bone_data"), &SpinePathConstraintData::get_bones);
|
ClassDB::bind_method(D_METHOD("get_bones"), &SpinePathConstraintData::get_bones);
|
||||||
ClassDB::bind_method(D_METHOD("get_target"), &SpinePathConstraintData::get_target);
|
ClassDB::bind_method(D_METHOD("get_target"), &SpinePathConstraintData::get_target);
|
||||||
ClassDB::bind_method(D_METHOD("set_target", "V"), &SpinePathConstraintData::set_target);
|
ClassDB::bind_method(D_METHOD("set_target", "V"), &SpinePathConstraintData::set_target);
|
||||||
ClassDB::bind_method(D_METHOD("get_position_mode"), &SpinePathConstraintData::get_position_mode);
|
ClassDB::bind_method(D_METHOD("get_position_mode"), &SpinePathConstraintData::get_position_mode);
|
||||||
@ -52,117 +52,121 @@ void SpinePathConstraintData::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("set_mix_x", "V"), &SpinePathConstraintData::set_mix_x);
|
ClassDB::bind_method(D_METHOD("set_mix_x", "V"), &SpinePathConstraintData::set_mix_x);
|
||||||
ClassDB::bind_method(D_METHOD("get_mix_y"), &SpinePathConstraintData::get_mix_y);
|
ClassDB::bind_method(D_METHOD("get_mix_y"), &SpinePathConstraintData::get_mix_y);
|
||||||
ClassDB::bind_method(D_METHOD("set_mix_y", "V"), &SpinePathConstraintData::set_mix_y);
|
ClassDB::bind_method(D_METHOD("set_mix_y", "V"), &SpinePathConstraintData::set_mix_y);
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(POSITIONMODE_FIXED);
|
|
||||||
BIND_ENUM_CONSTANT(POSITIONMODE_PERCENT);
|
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(SPACINGMODE_LENGTH);
|
|
||||||
BIND_ENUM_CONSTANT(SPACINGMODE_FIXED);
|
|
||||||
BIND_ENUM_CONSTANT(SPACINGMODE_PERCENT);
|
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(ROTATEMODE_TANGENT);
|
|
||||||
BIND_ENUM_CONSTANT(ROTATEMODE_CHAIN);
|
|
||||||
BIND_ENUM_CONSTANT(ROTATEMODE_CHAINSCALE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SpinePathConstraintData::SpinePathConstraintData() {}
|
|
||||||
SpinePathConstraintData::~SpinePathConstraintData() {}
|
|
||||||
|
|
||||||
Array SpinePathConstraintData::get_bones() {
|
Array SpinePathConstraintData::get_bones() {
|
||||||
auto bs = get_spine_constraint_data()->getBones();
|
Array result;
|
||||||
Array gd_bs;
|
SPINE_CHECK(get_spine_constraint_data(), result)
|
||||||
gd_bs.resize(bs.size());
|
auto bones = get_spine_constraint_data()->getBones();
|
||||||
for (size_t i = 0; i < bs.size(); ++i) {
|
result.resize((int)bones.size());
|
||||||
if (bs[i] == NULL) gd_bs[i] = Ref<SpineBoneData>(NULL);
|
for (int i = 0; i < bones.size(); ++i) {
|
||||||
else {
|
Ref<SpineBoneData> bone_ref(memnew(SpineBoneData));
|
||||||
Ref<SpineBoneData> gd_b(memnew(SpineBoneData));
|
bone_ref->set_spine_object(bones[i]);
|
||||||
gd_b->set_spine_object(bs[i]);
|
result[i] = bone_ref;
|
||||||
gd_bs[i] = gd_b;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return gd_bs;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<SpineSlotData> SpinePathConstraintData::get_target() {
|
Ref<SpineSlotData> SpinePathConstraintData::get_target() {
|
||||||
auto s = get_spine_constraint_data()->getTarget();
|
SPINE_CHECK(get_spine_constraint_data(), nullptr)
|
||||||
if (s == NULL) return NULL;
|
auto slot = get_spine_constraint_data()->getTarget();
|
||||||
Ref<SpineSlotData> gd_s(memnew(SpineSlotData));
|
if (!slot) return nullptr;
|
||||||
gd_s->set_spine_object(s);
|
Ref<SpineSlotData> slot_ref(memnew(SpineSlotData));
|
||||||
return gd_s;
|
slot_ref->set_spine_object(slot);
|
||||||
|
return slot_ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpinePathConstraintData::set_target(Ref<SpineSlotData> v) {
|
void SpinePathConstraintData::set_target(Ref<SpineSlotData> v) {
|
||||||
if (v.is_valid()) {
|
SPINE_CHECK(get_spine_constraint_data(),)
|
||||||
get_spine_constraint_data()->setTarget(v->get_spine_object());
|
get_spine_constraint_data()->setTarget(v.is_valid() ? v->get_spine_object() : nullptr);
|
||||||
} else {
|
|
||||||
get_spine_constraint_data()->setTarget(NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SpinePathConstraintData::PositionMode SpinePathConstraintData::get_position_mode() {
|
SpineConstant::PositionMode SpinePathConstraintData::get_position_mode() {
|
||||||
auto m = (int) get_spine_constraint_data()->getPositionMode();
|
SPINE_CHECK(get_spine_constraint_data(), SpineConstant::PositionMode_Fixed)
|
||||||
return (PositionMode) m;
|
return (SpineConstant::PositionMode) get_spine_constraint_data()->getPositionMode();
|
||||||
}
|
|
||||||
void SpinePathConstraintData::set_position_mode(PositionMode v) {
|
|
||||||
auto m = (int) v;
|
|
||||||
get_spine_constraint_data()->setPositionMode((spine::PositionMode) m);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SpinePathConstraintData::SpacingMode SpinePathConstraintData::get_spacing_mode() {
|
void SpinePathConstraintData::set_position_mode(SpineConstant::PositionMode v) {
|
||||||
auto m = (int) get_spine_constraint_data()->getSpacingMode();
|
SPINE_CHECK(get_spine_constraint_data(),)
|
||||||
return (SpacingMode) m;
|
get_spine_constraint_data()->setPositionMode((spine::PositionMode)v);
|
||||||
}
|
|
||||||
void SpinePathConstraintData::set_spacing_mode(SpacingMode v) {
|
|
||||||
auto m = (int) v;
|
|
||||||
get_spine_constraint_data()->setSpacingMode((spine::SpacingMode) m);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SpinePathConstraintData::RotateMode SpinePathConstraintData::get_rotate_mode() {
|
SpineConstant::SpacingMode SpinePathConstraintData::get_spacing_mode() {
|
||||||
auto m = (int) get_spine_constraint_data()->getRotateMode();
|
SPINE_CHECK(get_spine_constraint_data(),SpineConstant::SpacingMode_Fixed)
|
||||||
return (RotateMode) m;
|
return (SpineConstant::SpacingMode) get_spine_constraint_data()->getSpacingMode();
|
||||||
}
|
}
|
||||||
void SpinePathConstraintData::set_rotate_mode(RotateMode v) {
|
|
||||||
auto m = (int) v;
|
void SpinePathConstraintData::set_spacing_mode(SpineConstant::SpacingMode v) {
|
||||||
get_spine_constraint_data()->setRotateMode((spine::RotateMode) m);
|
SPINE_CHECK(get_spine_constraint_data(),)
|
||||||
|
get_spine_constraint_data()->setSpacingMode((spine::SpacingMode) v);
|
||||||
|
}
|
||||||
|
|
||||||
|
SpineConstant::RotateMode SpinePathConstraintData::get_rotate_mode() {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(),SpineConstant::RotateMode_Tangent)
|
||||||
|
return (SpineConstant::RotateMode)get_spine_constraint_data()->getRotateMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SpinePathConstraintData::set_rotate_mode(SpineConstant::RotateMode v) {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(),)
|
||||||
|
get_spine_constraint_data()->setRotateMode((spine::RotateMode) v);
|
||||||
}
|
}
|
||||||
|
|
||||||
float SpinePathConstraintData::get_offset_rotation() {
|
float SpinePathConstraintData::get_offset_rotation() {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(), 0)
|
||||||
return get_spine_constraint_data()->getOffsetRotation();
|
return get_spine_constraint_data()->getOffsetRotation();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpinePathConstraintData::set_offset_rotation(float v) {
|
void SpinePathConstraintData::set_offset_rotation(float v) {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(),)
|
||||||
get_spine_constraint_data()->setOffsetRotation(v);
|
get_spine_constraint_data()->setOffsetRotation(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
float SpinePathConstraintData::get_position() {
|
float SpinePathConstraintData::get_position() {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(), 0)
|
||||||
return get_spine_constraint_data()->getPosition();
|
return get_spine_constraint_data()->getPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpinePathConstraintData::set_position(float v) {
|
void SpinePathConstraintData::set_position(float v) {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(),)
|
||||||
get_spine_constraint_data()->setPosition(v);
|
get_spine_constraint_data()->setPosition(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
float SpinePathConstraintData::get_spacing() {
|
float SpinePathConstraintData::get_spacing() {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(), 0)
|
||||||
return get_spine_constraint_data()->getSpacing();
|
return get_spine_constraint_data()->getSpacing();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpinePathConstraintData::set_spacing(float v) {
|
void SpinePathConstraintData::set_spacing(float v) {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(),)
|
||||||
get_spine_constraint_data()->setSpacing(v);
|
get_spine_constraint_data()->setSpacing(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
float SpinePathConstraintData::get_mix_rotate() {
|
float SpinePathConstraintData::get_mix_rotate() {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(), 0)
|
||||||
return get_spine_constraint_data()->getMixRotate();
|
return get_spine_constraint_data()->getMixRotate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpinePathConstraintData::set_mix_rotate(float v) {
|
void SpinePathConstraintData::set_mix_rotate(float v) {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(),)
|
||||||
get_spine_constraint_data()->setMixRotate(v);
|
get_spine_constraint_data()->setMixRotate(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
float SpinePathConstraintData::get_mix_x() {
|
float SpinePathConstraintData::get_mix_x() {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(), 0)
|
||||||
return get_spine_constraint_data()->getMixX();
|
return get_spine_constraint_data()->getMixX();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpinePathConstraintData::set_mix_x(float v) {
|
void SpinePathConstraintData::set_mix_x(float v) {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(),)
|
||||||
get_spine_constraint_data()->setMixX(v);
|
get_spine_constraint_data()->setMixX(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
float SpinePathConstraintData::get_mix_y() {
|
float SpinePathConstraintData::get_mix_y() {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(), 0)
|
||||||
return get_spine_constraint_data()->getMixY();
|
return get_spine_constraint_data()->getMixY();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpinePathConstraintData::set_mix_y(float v) {
|
void SpinePathConstraintData::set_mix_y(float v) {
|
||||||
|
SPINE_CHECK(get_spine_constraint_data(),)
|
||||||
get_spine_constraint_data()->setMixY(v);
|
get_spine_constraint_data()->setMixY(v);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
#define GODOT_SPINEPATHCONSTRAINTDATA_H
|
#define GODOT_SPINEPATHCONSTRAINTDATA_H
|
||||||
|
|
||||||
#include "SpineConstraintData.h"
|
#include "SpineConstraintData.h"
|
||||||
|
#include "SpineConstant.h"
|
||||||
#include "SpineBoneData.h"
|
#include "SpineBoneData.h"
|
||||||
#include "SpineSlotData.h"
|
#include "SpineSlotData.h"
|
||||||
#include <spine/PathConstraintData.h>
|
#include <spine/PathConstraintData.h>
|
||||||
@ -39,65 +40,54 @@ class SpinePathConstraintData : public SpineConstraintData {
|
|||||||
GDCLASS(SpinePathConstraintData, SpineConstraintData);
|
GDCLASS(SpinePathConstraintData, SpineConstraintData);
|
||||||
|
|
||||||
spine::PathConstraintData *get_spine_constraint_data() { return (spine::PathConstraintData *)get_spine_object(); }
|
spine::PathConstraintData *get_spine_constraint_data() { return (spine::PathConstraintData *)get_spine_object(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SpinePathConstraintData();
|
SpinePathConstraintData() = default;
|
||||||
~SpinePathConstraintData();
|
~SpinePathConstraintData() = default;
|
||||||
|
|
||||||
enum PositionMode {
|
|
||||||
POSITIONMODE_FIXED = 0,
|
|
||||||
POSITIONMODE_PERCENT
|
|
||||||
};
|
|
||||||
|
|
||||||
enum SpacingMode {
|
|
||||||
SPACINGMODE_LENGTH = 0,
|
|
||||||
SPACINGMODE_FIXED,
|
|
||||||
SPACINGMODE_PERCENT
|
|
||||||
};
|
|
||||||
|
|
||||||
enum RotateMode {
|
|
||||||
ROTATEMODE_TANGENT = 0,
|
|
||||||
ROTATEMODE_CHAIN,
|
|
||||||
ROTATEMODE_CHAINSCALE
|
|
||||||
};
|
|
||||||
|
|
||||||
Array get_bones();
|
Array get_bones();
|
||||||
|
|
||||||
Ref<SpineSlotData> get_target();
|
Ref<SpineSlotData> get_target();
|
||||||
|
|
||||||
void set_target(Ref<SpineSlotData> v);
|
void set_target(Ref<SpineSlotData> v);
|
||||||
|
|
||||||
PositionMode get_position_mode();
|
SpineConstant::PositionMode get_position_mode();
|
||||||
void set_position_mode(PositionMode v);
|
|
||||||
|
|
||||||
SpacingMode get_spacing_mode();
|
void set_position_mode(SpineConstant::PositionMode v);
|
||||||
void set_spacing_mode(SpacingMode v);
|
|
||||||
|
|
||||||
RotateMode get_rotate_mode();
|
SpineConstant::SpacingMode get_spacing_mode();
|
||||||
void set_rotate_mode(RotateMode v);
|
|
||||||
|
void set_spacing_mode(SpineConstant::SpacingMode v);
|
||||||
|
|
||||||
|
SpineConstant::RotateMode get_rotate_mode();
|
||||||
|
|
||||||
|
void set_rotate_mode(SpineConstant::RotateMode v);
|
||||||
|
|
||||||
float get_offset_rotation();
|
float get_offset_rotation();
|
||||||
|
|
||||||
void set_offset_rotation(float v);
|
void set_offset_rotation(float v);
|
||||||
|
|
||||||
float get_position();
|
float get_position();
|
||||||
|
|
||||||
void set_position(float v);
|
void set_position(float v);
|
||||||
|
|
||||||
float get_spacing();
|
float get_spacing();
|
||||||
|
|
||||||
void set_spacing(float v);
|
void set_spacing(float v);
|
||||||
|
|
||||||
float get_mix_rotate();
|
float get_mix_rotate();
|
||||||
|
|
||||||
void set_mix_rotate(float v);
|
void set_mix_rotate(float v);
|
||||||
|
|
||||||
float get_mix_x();
|
float get_mix_x();
|
||||||
|
|
||||||
void set_mix_x(float v);
|
void set_mix_x(float v);
|
||||||
|
|
||||||
float get_mix_y();
|
float get_mix_y();
|
||||||
|
|
||||||
void set_mix_y(float v);
|
void set_mix_y(float v);
|
||||||
};
|
};
|
||||||
|
|
||||||
VARIANT_ENUM_CAST(SpinePathConstraintData::PositionMode);
|
|
||||||
VARIANT_ENUM_CAST(SpinePathConstraintData::SpacingMode);
|
|
||||||
VARIANT_ENUM_CAST(SpinePathConstraintData::RotateMode);
|
|
||||||
#endif//GODOT_SPINEPATHCONSTRAINTDATA_H
|
#endif//GODOT_SPINEPATHCONSTRAINTDATA_H
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user