- Vector tree = treePos[0];
- Vector distanceVec = position - tree;
- float dot = front.X * distanceVec.X + front.Z * distanceVec.Z;
- float lenghtF = sqrt(pow(front.X, 2) + pow(front.Z, 2));
- float lenghtT = sqrt(pow(distanceVec.X, 2) + pow(distanceVec.Z, 2));
- float angle = acos(dot/(lenghtF * lenghtT)) * 180/M_PI;