it doesn't work for a model that is currently animating, mainly because my models need to blend rather than just animate, so i'm using ent_blend on most of the animations, i've even tried reset the bone to it's position, like this:
Code:
function bone_to_angle (e1, bone_, angle)
{
ent1 = e1;
var defpos1[3];
var newpos1[3];
var defpan1[3];
var newpan1[3];
var defpan2[3];
var rotate_ang[3];
ang_for_bone(defpan2, ent1, bone_);
ang_for_bone(defpan1, ent1, bone_);
vec_for_bone (defpos1, ent1, bone_);
ent_bonereset (ent1, bone_);
ang_for_bone(newpan1, ent1, bone_);
vec_for_bone (newpos1, ent1, bone_);
vec_sub (defpos1.x, newpos1.x);
vec_sub (defpan1, newpan1);
ent_bonemove (me, bone_, defpos1);
rotate_ang[0] = defpan2[0] + angle[0];
rotate_ang[1] = defpan2[1] + angle[1];
rotate_ang[2] = defpan2[2] + angle[2];
ent_bonerotate_parent(ent1, bone_, vector (rotate_ang[0], rotate_ang[1], rotate_ang[2]));
}
what this does is calculates the bone's positions before it resets them and then attempts to put them back at those positions, and add a new angle to them, allowing them to point to something while still animating, but it doesn't work at all, the bone locks somewhere between where it started and where it should be, and starts spinning around in midair

funny for the first few times you see it...
i apply it to the code like this:
bone_to_angle (me, "bone9", vector(0,tilt__,0));
the other way i do it is like this:
Code:
function bone_to_angle (e1, bone_, angle)
{
ent1 = e1;
var defpos1[3];
var newpos1[3];
vec_for_bone (defpos1, ent1, bone_);
ent_bonereset (ent1, bone_);
vec_for_bone (newpos1, ent1, bone_);
vec_sub (defpos1.x, newpos1.x);
ent_bonemove (me, bone_, defpos1);
ent_bonerotate_parent(ent1, bone_, vector (angle[0], angle[1], angle[2]));
}
this results in something more stable, but when the you rotate the entity then the bone stretches out of place...
what i want to do with this is set it back to the original pan, tilt, and roll angles and then add the new angle to it, perhaps you could show me how, jcl?
note: i made sure that i ran these functions after animation
wouldn't it just be easier to be able to set a bone's pan through exact vector calculations?