Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. bool IsRejecteg(const Vector3& dronePosition, const Vector3& droneForward, const Vector3& targetWaypoint)
  2. {
  3. Vector3 waypoint = targetWaypoint - dronePosition;
  4. if (length(waypoint) >= 10) return true;
  5. float cosA = dot(waypoint, droneForward)/(length(waypoint)*length(droneForward)); //(cosA=dot(x1, x2)/|x1||x2|)
  6. return cosA < 0.5; //(cos60 = 1/2, если угл А < 60, cosA < 1/2, )
  7.  
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement