summaryrefslogtreecommitdiff
path: root/scene/animation
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/animation
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/animation')
-rw-r--r--scene/animation/animation_player.cpp17
-rw-r--r--scene/animation/animation_tree_player.cpp8
-rw-r--r--scene/animation/animation_tree_player.h2
3 files changed, 17 insertions, 10 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index eb3954af20..c0d1e62e07 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -246,8 +246,9 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim) {
if (a->track_get_path(i).get_subname_count() == 1 && Object::cast_to<Skeleton>(child)) {
- bone_idx = Object::cast_to<Skeleton>(child)->find_bone(a->track_get_path(i).get_subname(0));
- if (bone_idx == -1) {
+ Skeleton *sk = Object::cast_to<Skeleton>(child);
+ bone_idx = sk->find_bone(a->track_get_path(i).get_subname(0));
+ if (bone_idx == -1 || sk->is_bone_ignore_animation(bone_idx)) {
continue;
}
@@ -579,16 +580,14 @@ void AnimationPlayer::_animation_process2(float p_delta) {
}
void AnimationPlayer::_animation_update_transforms() {
+ {
+ Transform t;
+ for (int i = 0; i < cache_update_size; i++) {
- for (int i = 0; i < cache_update_size; i++) {
+ TrackNodeCache *nc = cache_update[i];
- TrackNodeCache *nc = cache_update[i];
+ ERR_CONTINUE(nc->accum_pass != accum_pass);
- ERR_CONTINUE(nc->accum_pass != accum_pass);
-
- if (nc->spatial) {
-
- Transform t;
t.origin = nc->loc_accum;
t.basis.set_quat_scale(nc->rot_accum, nc->scale_accum);
if (nc->skeleton && nc->bone_idx >= 0) {
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp
index afdb8b6f71..ce5b372d72 100644
--- a/scene/animation/animation_tree_player.cpp
+++ b/scene/animation/animation_tree_player.cpp
@@ -812,6 +812,12 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
t.value = t.object->get_indexed(t.subpath);
t.value.zero();
+
+ if (t.skeleton) {
+ t.skip = t.skeleton->is_bone_ignore_animation(t.bone_idx);
+ } else {
+ t.skip = false;
+ }
}
/* STEP 2 PROCESS ANIMATIONS */
@@ -884,7 +890,7 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
Track &t = E->get();
- if (!t.object)
+ if (t.skip || !t.object)
continue;
if (t.subpath.size()) { // value track
diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h
index 873ff8a9da..09d6f6fcb4 100644
--- a/scene/animation/animation_tree_player.h
+++ b/scene/animation/animation_tree_player.h
@@ -107,6 +107,8 @@ private:
Vector3 scale;
Variant value;
+
+ bool skip;
};
typedef Map<TrackKey, Track> TrackMap;