summaryrefslogtreecommitdiff
path: root/scene/3d/skeleton.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-03-05 16:44:50 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-03-05 16:44:50 +0100
commit5dbf1809c6e3e905b94b8764e99491e608122261 (patch)
tree5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /scene/3d/skeleton.h
parent45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff)
A Whole New World (clang-format edition)
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
Diffstat (limited to 'scene/3d/skeleton.h')
-rw-r--r--scene/3d/skeleton.h50
1 files changed, 25 insertions, 25 deletions
diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h
index 04eb3e9009..7074289724 100644
--- a/scene/3d/skeleton.h
+++ b/scene/3d/skeleton.h
@@ -29,15 +29,15 @@
#ifndef SKELETON_H
#define SKELETON_H
-#include "scene/3d/spatial.h"
#include "rid.h"
+#include "scene/3d/spatial.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
class Skeleton : public Spatial {
- GDCLASS( Skeleton, Spatial );
+ GDCLASS(Skeleton, Spatial);
struct Bone {
@@ -58,7 +58,12 @@ class Skeleton : public Spatial {
List<uint32_t> nodes_bound;
- Bone() { parent=-1; enabled=true; custom_pose_enable=false; disable_rest=false; }
+ Bone() {
+ parent = -1;
+ enabled = true;
+ custom_pose_enable = false;
+ disable_rest = false;
+ }
};
bool rest_global_inverse_dirty;
@@ -70,41 +75,37 @@ class Skeleton : public Spatial {
void _make_dirty();
bool dirty;
-//bind helpers
+ //bind helpers
Array _get_bound_child_nodes_to_bone(int p_bone) const {
Array bound;
- List<Node*> childs;
- get_bound_child_nodes_to_bone(p_bone,&childs);
+ List<Node *> childs;
+ get_bound_child_nodes_to_bone(p_bone, &childs);
- for (int i=0;i<childs.size();i++) {
+ for (int i = 0; i < childs.size(); i++) {
- bound.push_back( childs[i] );
+ bound.push_back(childs[i]);
}
return bound;
}
-
protected:
-
- bool _get(const StringName& p_name,Variant &r_ret) const;
- bool _set(const StringName& p_name, const Variant& p_value);
- void _get_property_list( List<PropertyInfo>* p_list ) const;
+ bool _get(const StringName &p_name, Variant &r_ret) const;
+ bool _set(const StringName &p_name, const Variant &p_value);
+ void _get_property_list(List<PropertyInfo> *p_list) const;
void _notification(int p_what);
static void _bind_methods();
public:
-
enum {
- NOTIFICATION_UPDATE_SKELETON=50
+ NOTIFICATION_UPDATE_SKELETON = 50
};
-
RID get_skeleton() const;
// skeleton creation api
- void add_bone(const String&p_name);
+ void add_bone(const String &p_name);
int find_bone(String p_name) const;
String get_bone_name(int p_bone) const;
@@ -118,35 +119,34 @@ public:
int get_bone_count() const;
- void set_bone_rest(int p_bone, const Transform& p_rest);
+ void set_bone_rest(int p_bone, const Transform &p_rest);
Transform get_bone_rest(int p_bone) const;
Transform get_bone_transform(int p_bone) const;
Transform get_bone_global_pose(int p_bone) const;
- void set_bone_global_pose(int p_bone,const Transform& p_pose);
+ void set_bone_global_pose(int p_bone, const Transform &p_pose);
void set_bone_enabled(int p_bone, bool p_enabled);
bool is_bone_enabled(int p_bone) const;
- void bind_child_node_to_bone(int p_bone,Node *p_node);
- void unbind_child_node_from_bone(int p_bone,Node *p_node);
- void get_bound_child_nodes_to_bone(int p_bone,List<Node*> *p_bound) const;
+ void bind_child_node_to_bone(int p_bone, Node *p_node);
+ void unbind_child_node_from_bone(int p_bone, Node *p_node);
+ void get_bound_child_nodes_to_bone(int p_bone, List<Node *> *p_bound) const;
void clear_bones();
// posing api
- void set_bone_pose(int p_bone, const Transform& p_pose);
+ void set_bone_pose(int p_bone, const Transform &p_pose);
Transform get_bone_pose(int p_bone) const;
- void set_bone_custom_pose(int p_bone, const Transform& p_custom_pose);
+ void set_bone_custom_pose(int p_bone, const Transform &p_custom_pose);
Transform get_bone_custom_pose(int p_bone) const;
void localize_rests(); // used for loaders and tools
Skeleton();
~Skeleton();
-
};
#endif