summaryrefslogtreecommitdiff
path: root/scene/3d/skeleton.h
diff options
context:
space:
mode:
authorAndreaCatania <info@andreacatania.com>2017-10-03 18:49:32 +0200
committerAndrea Catania <info@andreacatania.com>2018-05-07 21:03:16 +0200
commit9e57a07fb60fcd6c55bd51cf63d4c3cf4c6a3b26 (patch)
treeccf404b982a662dfba1c3c5d663ba16b6f7ba2e3 /scene/3d/skeleton.h
parent8c30337565326f313e398f6428eda5cb17614f14 (diff)
Implemented ragdoll
Implementing ragdoll Implementing ragdoll Implementing ragdoll Implementing ragdoll Implementing ragdoll a Implemented implicit hierarchy. Improved Added some physics properties Added bone offset to preserve COM, partially fixed scaling work in progress WIP wip Implemented Joint Gizmos Implemented pin joint joint Implemented all joints
Diffstat (limited to 'scene/3d/skeleton.h')
-rw-r--r--scene/3d/skeleton.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h
index d693670055..f0e71c8b4f 100644
--- a/scene/3d/skeleton.h
+++ b/scene/3d/skeleton.h
@@ -37,6 +37,8 @@
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
+
+class PhysicalBone;
class Skeleton : public Spatial {
GDCLASS(Skeleton, Spatial);
@@ -48,6 +50,8 @@ class Skeleton : public Spatial {
bool enabled;
int parent;
+ bool ignore_animation;
+
bool disable_rest;
Transform rest;
Transform rest_global_inverse;
@@ -60,13 +64,19 @@ class Skeleton : public Spatial {
Transform transform_final;
+ PhysicalBone *physical_bone;
+ PhysicalBone *cache_parent_physical_bone;
+
List<uint32_t> nodes_bound;
Bone() {
parent = -1;
enabled = true;
+ ignore_animation = false;
custom_pose_enable = false;
disable_rest = false;
+ physical_bone = NULL;
+ cache_parent_physical_bone = NULL;
}
};
@@ -118,6 +128,9 @@ public:
void unparent_bone_and_rest(int p_bone);
+ void set_bone_ignore_animation(int p_bone, bool p_ignore);
+ bool is_bone_ignore_animation(int p_bone) const;
+
void set_bone_disable_rest(int p_bone, bool p_disable);
bool is_bone_rest_disabled(int p_bone) const;
@@ -149,6 +162,25 @@ public:
void localize_rests(); // used for loaders and tools
+ // Physical bone API
+
+ void bind_physical_bone_to_bone(int p_bone, PhysicalBone *p_physical_bone);
+ void unbind_physical_bone_from_bone(int p_bone);
+
+ PhysicalBone *get_physical_bone(int p_bone);
+ PhysicalBone *get_physical_bone_parent(int p_bone);
+
+private:
+ /// This is a slow API os it's cached
+ PhysicalBone *_get_physical_bone_parent(int p_bone);
+ void _rebuild_physical_bones_cache();
+
+public:
+ void physical_bones_simulation(bool start);
+ void physical_bones_add_collision_exception(RID p_exception);
+ void physical_bones_remove_collision_exception(RID p_exception);
+
+public:
Skeleton();
~Skeleton();
};