bool RotateBody( tag_t rotaBody, double fromVec[3], double targVec[3],double rotaOri[3])
{
double commPerp[3];
double angle = 0;
double romatrixb[12];
int rotstatus = 0;
UF_VEC3_cross(fromVec, targVec, commPerp);
UF_VEC3_angle_between(fromVec, targVec, commPerp,&angle);
double roangle = (angle * 180 / 3.14159265358979323846);
int n_obj = 1;
int move_cope = 1;
int dest_layer = 0;
int trace_curves = 1;
int status = 0;
tag_t moveTag = NULL_TAG;
tag_t trace_curve_group = NULL_TAG;
if (angle>0)
{
FTN(uf5945)(rotaOri, commPerp, &roangle, romatrixb, &rotstatus);
FTN(uf5947)(romatrixb, &rotaBody, &n_obj, &move_cope, &dest_layer, &trace_curves, &moveTag, &trace_curve_group, &status);
}
if (status == 0 )
{
return true;
}
else
{
return false;
}
}