Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. // This is the method you must implement:
  2. Direction testWayPoint(const Vector3& dronePosition, const Vector3& droneForward,
  3.     const Vector3& targetWaypoint, const Vector3& worldUp)
  4. {
  5.     Vector3 target_forward = targetWaypoint;
  6.     subtract(targetWaypoint, dronePosition, target_forward);
  7.     auto len = length(target_forward);
  8.    
  9.     if (len <= 10.) //  i. Less than 10 units away.
  10.     {
  11.         Vector3 target_normal_forward = target_forward;
  12.         normalize(target_normal_forward);
  13.        
  14.         float cosA = dot(target_normal_forward, droneForward) / (length(target_normal_forward) * length(droneForward));
  15.         if (cosA >= 0.5) //(cos60 = 1/2, если угл А < 60, cosA < 1/2, )  //ii. Inside a 60 degree cone centered around the drone's 'forward' vector.
  16.         {
  17.  
  18.         }
  19.     }
  20.  
  21.     return REJECTED;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement