forked from scottkunkel/spine_runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpineBone.h
139 lines (92 loc) · 2.37 KB
/
SpineBone.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
//
// Created by Raymond_Lx on 2020/6/6.
//
#ifndef GODOT_SPINEBONE_H
#define GODOT_SPINEBONE_H
#include "core/variant_parser.h"
#include <scene/2d/node_2d.h>
#include <scene/2d/node_2d.h>
#include <spine/spine.h>
#include "SpineBoneData.h"
#include "SpineIkConstraint.h"
#include "SpinePathConstraint.h"
#include "SpineTransformConstraint.h"
class SpineSkeleton;
class SpineBone : public Reference {
GDCLASS(SpineBone, Reference);
protected:
static void _bind_methods();
private:
spine::Bone *bone;
public:
SpineBone();
~SpineBone();
inline void set_spine_object(spine::Bone *b){
bone = b;
}
inline spine::Bone *get_spine_object(){
return bone;
}
void update_world_transform();
void set_to_setup_pose();
Vector2 world_to_local(Vector2 world_position);
Vector2 local_to_world(Vector2 local_position);
float world_to_local_rotation(float world_rotation);
float local_to_world_rotation(float local_rotation);
void rotate_world(float degrees);
float get_world_to_local_rotation_x();
float get_world_to_local_rotation_y();
Ref<SpineBoneData> get_data();
Ref<SpineSkeleton> get_skeleton();
Ref<SpineBone> get_parent();
Array get_children();
float get_x();
void set_x(float v);
float get_y();
void set_y(float v);
float get_rotation();
void set_rotation(float v);
float get_scale_x();
void set_scale_x(float v);
float get_scale_y();
void set_scale_y(float v);
float get_shear_x();
void set_shear_x(float v);
float get_shear_y();
void set_shear_y(float v);
float get_applied_rotation();
void set_applied_rotation(float v);
float get_a_x();
void set_a_x(float v);
float get_a_y();
void set_a_y(float v);
float get_a_scale_x();
void set_a_scale_x(float v);
float get_a_scale_y();
void set_a_scale_y(float v);
float get_a_shear_x();
void set_a_shear_x(float v);
float get_a_shear_y();
void set_a_shear_y(float v);
float get_a();
void set_a(float v);
float get_b();
void set_b(float v);
float get_c();
void set_c(float v);
float get_d();
void set_d(float v);
float get_world_x();
void set_world_x(float v);
float get_world_y();
void set_world_y(float v);
float get_world_rotation_x();
float get_world_rotation_y();
float get_world_scale_x();
float get_world_scale_y();
bool is_active();
void set_active(bool v);
// External feature functions
void apply_world_transform_2d(Variant o);
};
#endif //GODOT_SPINEBONE_H