Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InfoLabel includes additional heading data #203

Merged
merged 12 commits into from Jun 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ARKit+CoreLocation/Base.lproj/Main.storyboard
Expand Up @@ -30,7 +30,7 @@
<constraints>
<constraint firstAttribute="height" constant="56" id="xET-RT-kxh"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<fontDescription key="fontDescription" name="CourierNewPSMT" family="Courier New" pointSize="10"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
Expand Down
6 changes: 6 additions & 0 deletions ARKit+CoreLocation/POIViewController.swift
Expand Up @@ -287,6 +287,12 @@ extension POIViewController {
if let eulerAngles = sceneLocationView.currentEulerAngles {
infoLabel.text!.append("Euler x: \(eulerAngles.x.short), y: \(eulerAngles.y.short), z: \(eulerAngles.z.short)\n")
}

if let eulerAngles = sceneLocationView.currentEulerAngles,
let heading = sceneLocationView.sceneLocationManager.locationManager.heading,
let headingAccuracy = sceneLocationView.sceneLocationManager.locationManager.headingAccuracy {
infoLabel.text!.append("Heading: \((((0 - eulerAngles.y.radiansToDegrees) + 360).truncatingRemainder(dividingBy: 360) ).short)° • \(Float(heading).short)° • \(headingAccuracy)°\n")
}

let comp = Calendar.current.dateComponents([.hour, .minute, .second, .nanosecond], from: Date())
if let hour = comp.hour, let minute = comp.minute, let second = comp.second, let nanosecond = comp.nanosecond {
Expand Down