/
Skeleton.hx
202 lines (162 loc) · 6.62 KB
/
Skeleton.hx
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
Skeleton provides a hierarchical interface for managing bones, including pose, rest and animation (see `godot.Animation`). It can also use ragdoll physics.
The overall transform of a bone with respect to the skeleton is determined by the following hierarchical order: rest pose, custom pose and pose.
Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it not the actual global/world transform of the bone.
**/
@:libType
@:csNative
@:native("Godot.Skeleton")
@:autoBuild(godot.Godot.buildUserClass())
extern class Skeleton extends godot.Spatial {
/**
`skeleton_updated` signal.
**/
public var onSkeletonUpdated(get, never):Signal<Void->Void>;
@:dox(hide) @:noCompletion inline function get_onSkeletonUpdated():Signal<Void->Void> {
return new Signal(this, "skeleton_updated", Signal.SignalHandlerVoidVoid.connectSignal, Signal.SignalHandlerVoidVoid.disconnectSignal, Signal.SignalHandlerVoidVoid.isSignalConnected);
}
@:native("NotificationUpdateSkeleton")
public static var NOTIFICATION_UPDATE_SKELETON(default, never):Int;
@:native("new")
public function new():Void;
/**
Adds a bone, with name `name`. `godot.Skeleton.getBoneCount` will become the bone index.
**/
@:native("AddBone")
public function addBone(name:std.String):Void;
/**
Returns the bone index that matches `name` as its name.
**/
@:native("FindBone")
public function findBone(name:std.String):Int;
/**
Returns the name of the bone at index `index`.
**/
@:native("GetBoneName")
public function getBoneName(boneIdx:Int):std.String;
@:native("SetBoneName")
public function setBoneName(boneIdx:Int, name:std.String):Void;
/**
Returns the bone index which is the parent of the bone at `bone_idx`. If -1, then bone has no parent.
Note: The parent bone returned will always be less than `bone_idx`.
**/
@:native("GetBoneParent")
public function getBoneParent(boneIdx:Int):Int;
/**
Sets the bone index `parent_idx` as the parent of the bone at `bone_idx`. If -1, then bone has no parent.
Note: `parent_idx` must be less than `bone_idx`.
**/
@:native("SetBoneParent")
public function setBoneParent(boneIdx:Int, parentIdx:Int):Void;
/**
Returns the amount of bones in the skeleton.
**/
@:native("GetBoneCount")
public function getBoneCount():Int;
@:native("UnparentBoneAndRest")
public function unparentBoneAndRest(boneIdx:Int):Void;
/**
Returns the rest transform for a bone `bone_idx`.
**/
@:native("GetBoneRest")
public function getBoneRest(boneIdx:Int):godot.Transform;
/**
Sets the rest transform for bone `bone_idx`.
**/
@:native("SetBoneRest")
public function setBoneRest(boneIdx:Int, rest:godot.Transform):Void;
@:native("RegisterSkin")
public function registerSkin(skin:godot.Skin):godot.SkinReference;
@:native("LocalizeRests")
public function localizeRests():Void;
@:native("SetBoneDisableRest")
public function setBoneDisableRest(boneIdx:Int, disable:Bool):Void;
@:native("IsBoneRestDisabled")
public function isBoneRestDisabled(boneIdx:Int):Bool;
/**
Deprecated soon.
**/
@:native("BindChildNodeToBone")
public function bindChildNodeToBone(boneIdx:Int, node:godot.Node):Void;
/**
Deprecated soon.
**/
@:native("UnbindChildNodeFromBone")
public function unbindChildNodeFromBone(boneIdx:Int, node:godot.Node):Void;
/**
Deprecated soon.
**/
@:native("GetBoundChildNodesToBone")
public function getBoundChildNodesToBone(boneIdx:Int):godot.collections.Array;
/**
Clear all the bones in this skeleton.
**/
@:native("ClearBones")
public function clearBones():Void;
/**
Returns the pose transform of the specified bone. Pose is applied on top of the custom pose, which is applied on top the rest pose.
**/
@:native("GetBonePose")
public function getBonePose(boneIdx:Int):godot.Transform;
/**
Sets the pose transform for bone `bone_idx`.
**/
@:native("SetBonePose")
public function setBonePose(boneIdx:Int, pose:godot.Transform):Void;
@:native("ClearBonesGlobalPoseOverride")
public function clearBonesGlobalPoseOverride():Void;
#if doc_gen
@:native("SetBoneGlobalPoseOverride")
public function setBoneGlobalPoseOverride(boneIdx:Int, pose:godot.Transform, amount:Single, ?persistent:Bool):Void;
#else
@:native("SetBoneGlobalPoseOverride")
public overload function setBoneGlobalPoseOverride(boneIdx:Int, pose:godot.Transform, amount:Single):Void;
@:native("SetBoneGlobalPoseOverride")
public overload function setBoneGlobalPoseOverride(boneIdx:Int, pose:godot.Transform, amount:Single, persistent:Bool):Void;
#end
/**
Returns the overall transform of the specified bone, with respect to the skeleton. Being relative to the skeleton frame, this is not the actual "global" transform of the bone.
**/
@:native("GetBoneGlobalPose")
public function getBoneGlobalPose(boneIdx:Int):godot.Transform;
/**
Returns the overall transform of the specified bone, with respect to the skeleton, but without any global pose overrides. Being relative to the skeleton frame, this is not the actual "global" transform of the bone.
**/
@:native("GetBoneGlobalPoseNoOverride")
public function getBoneGlobalPoseNoOverride(boneIdx:Int):godot.Transform;
/**
Returns the custom pose of the specified bone. Custom pose is applied on top of the rest pose.
**/
@:native("GetBoneCustomPose")
public function getBoneCustomPose(boneIdx:Int):godot.Transform;
@:native("SetBoneCustomPose")
public function setBoneCustomPose(boneIdx:Int, customPose:godot.Transform):Void;
@:native("PhysicalBonesStopSimulation")
public function physicalBonesStopSimulation():Void;
#if doc_gen
/**
@param bones If the parameter is null, then the default value is new Godot.Collections.Array { }
**/
@:native("PhysicalBonesStartSimulation")
public function physicalBonesStartSimulation(?bones:godot.collections.Array):Void;
#else
/**
@param bones If the parameter is null, then the default value is new Godot.Collections.Array { }
**/
@:native("PhysicalBonesStartSimulation")
public overload function physicalBonesStartSimulation():Void;
/**
@param bones If the parameter is null, then the default value is new Godot.Collections.Array { }
**/
@:native("PhysicalBonesStartSimulation")
public overload function physicalBonesStartSimulation(bones:godot.collections.Array):Void;
#end
@:native("PhysicalBonesAddCollisionException")
public function physicalBonesAddCollisionException(exception:godot.RID):Void;
@:native("PhysicalBonesRemoveCollisionException")
public function physicalBonesRemoveCollisionException(exception:godot.RID):Void;
}