connect 2 bones (with ang and vec)

Posted By: Toon

connect 2 bones (with ang and vec) - 07/12/12 16:06

okay...I got this code to work:

Code:
vec_for_bone(axe_vec.x,player,"righthand");
ang_for_bone(axe_ang.pan,player,"righthand");
vec_set(my.x,axe_vec);
vec_set(my.pan,axe_ang);



But what I want is to set "Bone" from the axe entity (my) to the position of the "righthand" position (so not the just the pivot-point of the axe model (my). How can I do that?
Posted By: rayp

Re: connect 2 bones (with ang and vec) - 07/12/12 16:20

In most games this is done by setting the axe into the correct pos and then applying it to the right hand bone. Normally weapons have no "pos-bones" except for gunbrasses and so on. The code you need you already have. ^^

Code:
VECTOR _p,_a;
vec_for_bone(_p, ThePlayer, "Righthand");
ang_for_bone(_a, ThePlayer, "Righthand");
vec_set(Axe.x, _p.x); //set the axe to the right hand
vec_set(Axe.pan, _a); //and rotate it with the animation of the bone



regards
© 2024 lite-C Forums