From: Rudolf Polzer Date: Tue, 12 Feb 2013 10:29:35 +0000 (+0100) Subject: enable animation blending; do up/down aiming with it well now X-Git-Tag: xonotic-v0.7.0~93 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4d78b499bece3ccbed3a2168a71cbb2f03308f91;p=xonotic%2Fxonotic-data.pk3dir.git enable animation blending; do up/down aiming with it well now --- diff --git a/models/player/gak.iqm_0.txt b/models/player/gak.iqm_0.txt index 8aa741981..9a6f52401 100644 --- a/models/player/gak.iqm_0.txt +++ b/models/player/gak.iqm_0.txt @@ -3,5 +3,9 @@ species alien sex Male weight 85 age 16 +bone_upperbody spine2 +bone_aim spine2 +bone_weapon bip01 r hand +fixbone 1 Lightweight Xonotic Solider diff --git a/models/player/gakarmored.iqm_0.txt b/models/player/gakarmored.iqm_0.txt index 06ff3550b..3a7b199ac 100644 --- a/models/player/gakarmored.iqm_0.txt +++ b/models/player/gakarmored.iqm_0.txt @@ -3,5 +3,9 @@ species alien sex Male weight 90 age 20 +bone_upperbody spine2 +bone_aim spine2 +bone_weapon bip01 r hand +fixbone 1 Heavyweight Xonotic Solider diff --git a/models/player/gakmasked.iqm_0.txt b/models/player/gakmasked.iqm_0.txt index aff4f75ac..72e694771 100644 --- a/models/player/gakmasked.iqm_0.txt +++ b/models/player/gakmasked.iqm_0.txt @@ -3,5 +3,9 @@ species alien sex Male weight 87 age 18 +bone_upperbody spine2 +bone_aim spine2 +bone_weapon bip01 r hand +fixbone 1 Mediumweight Xonotic Solider diff --git a/models/player/ignis.iqm_0.txt b/models/player/ignis.iqm_0.txt index 7597e410a..ea1cb7a30 100644 --- a/models/player/ignis.iqm_0.txt +++ b/models/player/ignis.iqm_0.txt @@ -3,5 +3,9 @@ species human sex Male weight 88 age 31 +bone_upperbody spine2 +bone_aim spine2 +bone_weapon bip01 r hand +fixbone 1 Heavyweight Xonotic Solider diff --git a/models/player/ignishalfmasked.iqm_0.txt b/models/player/ignishalfmasked.iqm_0.txt index fd72a02f3..8c3be3371 100644 --- a/models/player/ignishalfmasked.iqm_0.txt +++ b/models/player/ignishalfmasked.iqm_0.txt @@ -3,5 +3,9 @@ species human sex Male weight 90 age 31 +bone_upperbody spine2 +bone_aim spine2 +bone_weapon bip01 r hand +fixbone 1 Heavyweight Xonotic Solider diff --git a/models/player/ignismasked.iqm_0.txt b/models/player/ignismasked.iqm_0.txt index d1c85665f..c5944ca4c 100644 --- a/models/player/ignismasked.iqm_0.txt +++ b/models/player/ignismasked.iqm_0.txt @@ -3,5 +3,9 @@ species human sex Male weight 92 age 31 +bone_upperbody spine2 +bone_aim spine2 +bone_weapon bip01 r hand +fixbone 1 Heavyweight Xonotic Solider diff --git a/models/player/megaerebus.iqm_0.txt b/models/player/megaerebus.iqm_0.txt index b4e2aa85a..2e7cfba0b 100644 --- a/models/player/megaerebus.iqm_0.txt +++ b/models/player/megaerebus.iqm_0.txt @@ -3,5 +3,9 @@ species human sex Male weight 210 age 26 +bone_upperbody spine2 +bone_aim spine2 +bone_weapon bip01 r hand +fixbone 1 Heavyweight Xonotic Solider diff --git a/models/player/nyx.iqm_0.txt b/models/player/nyx.iqm_0.txt index 9fb92f647..714f8212b 100644 --- a/models/player/nyx.iqm_0.txt +++ b/models/player/nyx.iqm_0.txt @@ -3,5 +3,9 @@ species human sex Female weight 100 age 24 +bone_upperbody spine2 +bone_aim spine2 +bone_weapon bip01 r hand +fixbone 1 Heavyweight Xonotic Soldier diff --git a/models/player/pyria.iqm_0.txt b/models/player/pyria.iqm_0.txt index 2c52f6085..47c8ef1ae 100644 --- a/models/player/pyria.iqm_0.txt +++ b/models/player/pyria.iqm_0.txt @@ -3,5 +3,9 @@ species human sex Female weight 57 age 53 +bone_upperbody spine2 +bone_aim spine2 +bone_weapon bip01 r hand +fixbone 1 Necro Warrior diff --git a/models/player/seraphina.iqm_0.txt b/models/player/seraphina.iqm_0.txt index 6b4fcf630..a64d0c221 100644 --- a/models/player/seraphina.iqm_0.txt +++ b/models/player/seraphina.iqm_0.txt @@ -3,5 +3,9 @@ species human sex Female weight 89 age 31 +bone_upperbody spine2 +bone_aim spine2 +bone_weapon bip01 r hand +fixbone 1 Heavyweight Xonotic Solider diff --git a/models/player/seraphinamasked.iqm_0.txt b/models/player/seraphinamasked.iqm_0.txt index 47763590e..d3e9cf1f2 100644 --- a/models/player/seraphinamasked.iqm_0.txt +++ b/models/player/seraphinamasked.iqm_0.txt @@ -3,5 +3,9 @@ species human sex Female weight 90 age 31 +bone_upperbody spine2 +bone_aim spine2 +bone_weapon bip01 r hand +fixbone 1 Heavyweight Xonotic Solider diff --git a/models/player/umbra.iqm_0.txt b/models/player/umbra.iqm_0.txt index 21f4c80d9..a8fa91814 100644 --- a/models/player/umbra.iqm_0.txt +++ b/models/player/umbra.iqm_0.txt @@ -3,5 +3,9 @@ species human sex Female weight 61 age 25 +bone_upperbody spine2 +bone_aim spine2 +bone_weapon bip01 r hand +fixbone 1 Lightweight Xonotic Solider diff --git a/qcsrc/client/player_skeleton.qc b/qcsrc/client/player_skeleton.qc index a731d3a1a..d51ac0d9f 100644 --- a/qcsrc/client/player_skeleton.qc +++ b/qcsrc/client/player_skeleton.qc @@ -59,17 +59,24 @@ void skeleton_markbones(entity e) } } -void skeleton_fixbone(entity e, vector ang) +void skel_set_boneabs(float s, float bone, vector absorg) { - if(!e.bone_upperbody) - return; - float s = e.skeletonindex; + vector absang = fixedvectoangles2(v_forward, v_up); + + vector parentorg = skel_get_boneabs(s, skel_get_boneparent(s, bone)); + vector parentang = fixedvectoangles2(v_forward, v_up); + + vector relang = AnglesTransform_LeftDivide(parentang, absang); + vector relorg = AnglesTransform_Apply(AnglesTransform_Invert(parentang), absorg - parentorg); - skel_get_boneabs(s, e.bone_upperbody); - vector ang_cur = fixedvectoangles2(v_forward, v_up); - vector fix = AnglesTransform_LeftDivide(ang_cur, ang); - fixedmakevectors(fix); - skel_mul_bone(s, e.bone_upperbody, '0 0 0'); + fixedmakevectors(relang); + skel_set_bone(s, bone, relorg); + + /* + vector neworg = skel_get_boneabs(s, bone); + print(sprintf("ANG: want: %v, got: %v\n", absang, fixedvectoangles2(v_forward, v_up))); + print(sprintf("ORG: want: %v, got: %v\n", absorg, neworg)); + */ } void free_skeleton_from_frames(entity e) @@ -143,19 +150,18 @@ void skeleton_from_frames(entity e) if(e.fixbone) { // FIX IT - skeleton_fixbone(e, fixbone_oldangles); + vector org = skel_get_boneabs(s, e.bone_upperbody); + fixedmakevectors(fixbone_oldangles); + skel_set_boneabs(s, e.bone_upperbody, org); } if(e.bone_aim) { - vector aim = '-1 0 0' * self.v_angle_x; - - skel_get_boneabs(s, e.bone_aim); + vector aim = '1 0 0' * bound(-90, self.v_angle_x, 90); + vector org = skel_get_boneabs(s, e.bone_aim); vector ang_cur = fixedvectoangles2(v_forward, v_up); vector ang = AnglesTransform_Multiply(aim, ang_cur); - vector fix = AnglesTransform_LeftDivide(ang_cur, ang); - fixedmakevectors(fix); - skel_mul_bone(s, e.bone_aim, '0 0 0'); - + fixedmakevectors(ang); + skel_set_boneabs(s, e.bone_aim, org); } }