Skip to content

Commit

Permalink
small fix and add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TokageItLab committed Oct 9, 2020
1 parent c92ebf7 commit db3ca58
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
19 changes: 19 additions & 0 deletions doc/classes/Skeleton3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@
</return>
<argument index="0" name="bone_idx" type="int">
</argument>
<argument index="1" name="update_skins" type="bool" default="true">
</argument>
<description>
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.
[b]Note:[/b] If [code]update_skins[/code] is [code]false[/code], the skin will be updated at the end of the thread. If you need only bone global pose, not updating skin will improve performance when calling [method get_bone_global_pose] multiple times in the same thread.
</description>
</method>
<method name="get_bone_name" qualifiers="const">
Expand All @@ -110,6 +113,22 @@
[b]Note:[/b] The parent bone returned will always be less than [code]bone_idx[/code].
</description>
</method>
<method name="get_bone_children">
<return type="int">
</return>
<argument index="0" name="bone_idx" type="int">
</argument>
<description>
Returns the array of bone indexes which is the children of the bone at [code]bone_idx[/code]. If array is empty, then bone has no children.
</description>
</method>
<method name="get_bones_root">
<return type="int">
</return>
<description>
Returns the bone index which is the root of the all bones.
</description>
</method>
<method name="get_bone_pose" qualifiers="const">
<return type="Transform">
</return>
Expand Down
4 changes: 1 addition & 3 deletions scene/3d/skeleton_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,8 @@ void Skeleton3D::_notification(int p_what) {
case NOTIFICATION_UPDATE_SKELETON_BONE_ONLY: {
_update_process_order();
const int *order = process_order.ptr();

Bone *bonesptr = bones.ptrw();
int len = bones.size();

while (dirty_idxes.size() > 0) {
for (int i = 0; i < len; i++) {
int dirty_idx = dirty_idxes.find(order[i], 0);
Expand Down

0 comments on commit db3ca58

Please sign in to comment.