Skip to content

Commit

Permalink
Sort by distance
Browse files Browse the repository at this point in the history
  • Loading branch information
Danijel Huis authored and Danijel Huis committed Jun 22, 2017
1 parent 033a789 commit aa469b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion HDAugmentedReality/Classes/ARTrackingManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class ARTrackingManager: NSObject, CLLocationManagerDelegate
Value of 1 means no smoothing, should be greater than 0. Default value is 0.05
*/
public var headingFilterFactor: Double = 0.05
private var _headingFilterFactor: Double = 0
private var _headingFilterFactor: Double = 0.05


/**
Expand Down
8 changes: 4 additions & 4 deletions HDAugmentedReality/Classes/ARViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ open class ARViewController: UIViewController, ARTrackingManagerDelegate
return self.annotations
}

fileprivate func reload(reloadType currentReload: ARViewController.ReloadType)
open func reload(reloadType currentReload: ARViewController.ReloadType)
{
// Explanation why pendingHighestRankingReload is used: if this method is called in this order:
// 1. currentReload = annotationsChanged, arStatus.ready = false
Expand All @@ -305,7 +305,7 @@ open class ARViewController: UIViewController, ARTrackingManagerDelegate
self.presenter.reload(annotations: self.annotations, reloadType: highestRankingReload)
}

fileprivate func calculateDistancesForAnnotations()
open func calculateDistancesForAnnotations()
{
guard let userLocation = self.arStatus.userLocation else { return }

Expand All @@ -314,10 +314,10 @@ open class ARViewController: UIViewController, ARTrackingManagerDelegate
annotation.distanceFromUser = annotation.location.distance(from: userLocation)
}

//self.annotations = self.annotations.sorted { $0.distanceFromUser < $1.distanceFromUser }
self.annotations = self.annotations.sorted { $0.distanceFromUser < $1.distanceFromUser }
}

fileprivate func calculateAzimuthsForAnnotations()
open func calculateAzimuthsForAnnotations()
{
guard let userLocation = self.arStatus.userLocation else { return }

Expand Down

0 comments on commit aa469b4

Please sign in to comment.