Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is the method you must implement:
- Direction testWayPoint(const Vector3& dronePosition, const Vector3& droneForward,
- const Vector3& targetWaypoint, const Vector3& worldUp)
- {
- Vector3 target_forward = targetWaypoint;
- subtract(targetWaypoint, dronePosition, target_forward);
- auto len = length(target_forward);
- if (len <= 10.) // i. Less than 10 units away.
- {
- Vector3 target_normal_forward = target_forward;
- normalize(target_normal_forward);
- float cosA = dot(target_normal_forward, droneForward) / (length(target_normal_forward) * length(droneForward));
- if (cosA >= 0.5) //(cos60 = 1/2, если угл А < 60, cosA < 1/2, ) //ii. Inside a 60 degree cone centered around the drone's 'forward' vector.
- {
- }
- }
- return REJECTED;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement