VECTOR bone_pos, *to_target;
ANGLE bone_angle;
vec_for_bone(bone_pos, entity, "bone");
to_target = vec_diff(NULL, target_position, bone_pos);
vec_to_angle(bone_angle, to_target);
// Take the entity's pan rotation into account.
bone_angle.pan -= entity.pan;
// To make this work with tilt and roll as well, we would have to
// transform the target position into the entity's local space.
ent_bonereset_all(entity);
ent_bonerotate(entity, "bone", bone_angle);