Exemplo n.º 1
0
    private List <Waypoint> ConverPositionsToWaypoints(List <Vector3> positions, float cameraAngle)
    {
        List <Waypoint> waypoints = new List <Waypoint>();

        for (int i = 0; i < positions.Count - 1; i++)
        {
            Vector3 current = positions[i];
            Vector3 next    = positions[i + 1];
            waypoints.Add(new Waypoint(current, MissionHelper.CalculateRotationBetweenWaypoints(current, next, cameraAngle)));
        }

        waypoints.Add(new Waypoint(positions[positions.Count - 1], waypoints[waypoints.Count - 1].droneRotation));
        return(waypoints);
    }
Exemplo n.º 2
0
    protected override List <Waypoint> CalculateWaypoints()
    {
        List <Vector3>  positions = CalculatePositions();
        List <Waypoint> waypoints = new List <Waypoint>();

        for (int i = 0; i < positions.Count - 1; i++)
        {
            Vector3 current = positions[i];
            Vector3 next    = positions[i + 1];
            waypoints.Add(new Waypoint(current, MissionHelper.CalculateRotationBetweenWaypoints(current, next, cameraAngle)));
        }

        if (waypoints.Count > 0)
        {
            waypoints.Add(new Waypoint(positions[positions.Count - 1], waypoints[waypoints.Count - 1].droneRotation));
        }
        else
        {
            waypoints.Add(new Waypoint(positions[0], Quaternion.AngleAxis(cameraAngle, Vector3.right)));
        }
        return(waypoints);
    }