Skip to content

Commit

Permalink
Improving Instructions & Feedback (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio914 authored Jul 6, 2021
1 parent 110ef7e commit dedb826
Show file tree
Hide file tree
Showing 10 changed files with 877 additions and 403 deletions.
2 changes: 1 addition & 1 deletion Instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You might also need to calibrate again after you install a new VR application/ga

- Take your headset and the right controller.

- Now, put your headset on and walk in front of the camera, then bring your right controller's trigger button as close as possible to the camera and press the right controller's trigger button or the "A" button.
- Now, put your headset on and walk in front of the camera, bring your right controller's trigger button as close as possible to the camera, touch the tip of the right controller on the camera, and then press the right controller's trigger button or the "A" button.

<img src="Images/instructions/calibration_2.jpg" width="300" />

Expand Down
4 changes: 4 additions & 0 deletions RealityMixer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
A30A6990267AB94A002647C5 /* UIColor+Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = A30A698F267AB94A002647C5 /* UIColor+Image.swift */; };
A30B22EA2693D9F2005EB78F /* CameraPermissionHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = A30B22E92693D9F2005EB78F /* CameraPermissionHelper.swift */; };
A319DCB1264891CF00CDAE58 /* ARConfigurationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = A319DCB0264891CF00CDAE58 /* ARConfigurationFactory.swift */; };
A31C0A2026435F980059A492 /* avatar2.usdz in Resources */ = {isa = PBXBuildFile; fileRef = A31C0A1C26435F980059A492 /* avatar2.usdz */; };
A31C0A2126435F980059A492 /* avatar1.usdz in Resources */ = {isa = PBXBuildFile; fileRef = A31C0A1D26435F980059A492 /* avatar1.usdz */; };
Expand Down Expand Up @@ -94,6 +95,7 @@
/* Begin PBXFileReference section */
3E1B214525678AF60084847C /* RealityMixer.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = RealityMixer.xcconfig; sourceTree = "<group>"; };
A30A698F267AB94A002647C5 /* UIColor+Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Image.swift"; sourceTree = "<group>"; };
A30B22E92693D9F2005EB78F /* CameraPermissionHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraPermissionHelper.swift; sourceTree = "<group>"; };
A319DCB0264891CF00CDAE58 /* ARConfigurationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ARConfigurationFactory.swift; sourceTree = "<group>"; };
A31C0A1C26435F980059A492 /* avatar2.usdz */ = {isa = PBXFileReference; lastKnownFileType = file.usdz; path = avatar2.usdz; sourceTree = "<group>"; };
A31C0A1D26435F980059A492 /* avatar1.usdz */ = {isa = PBXFileReference; lastKnownFileType = file.usdz; path = avatar1.usdz; sourceTree = "<group>"; };
Expand Down Expand Up @@ -208,6 +210,7 @@
A319DCB0264891CF00CDAE58 /* ARConfigurationFactory.swift */,
A338B362265B25E500099827 /* ARKitHelpers.swift */,
A3EEFFBE26890AE200A0DC19 /* ChromaKeyMaskBuilder.swift */,
A30B22E92693D9F2005EB78F /* CameraPermissionHelper.swift */,
);
path = Misc;
sourceTree = "<group>";
Expand Down Expand Up @@ -561,6 +564,7 @@
A3228605255B864900FF3200 /* AudioDataHeader.m in Sources */,
A328D8B4253C8C4000B90E62 /* MixedRealityConnectionViewController.swift in Sources */,
A324161E2554DABE008D4B90 /* InitialViewController.swift in Sources */,
A30B22EA2693D9F2005EB78F /* CameraPermissionHelper.swift in Sources */,
A32285AA2558050600FF3200 /* AboutViewController.swift in Sources */,
A328D8D1253C917300B90E62 /* OculusMRC.mm in Sources */,
A36C9163263779E700D64107 /* ReadyPlayerMeAvatar.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ final class CalibrationConnectionViewController: UIViewController {

@IBOutlet private weak var scaleSegmentedControl: UISegmentedControl!
@IBOutlet private weak var poorPerformanceWarningLabel: UILabel!

@IBOutlet private weak var showInstructionsButton: UIButton!
@IBOutlet private weak var instructionsContainer: UIStackView!
@IBOutlet private weak var infoLabel: UILabel!
@IBOutlet private weak var secondInfoLabel: UILabel!
@IBOutlet private weak var thirdInfoLabel: UILabel!

private let networkConfigurationStorage = NetworkConfigurationStorage()

init() {
Expand All @@ -32,6 +36,8 @@ final class CalibrationConnectionViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
title = "Calibration"
showInstructionsButton.isHidden = false
instructionsContainer.isHidden = true

addressTextField.delegate = self
portTextField.delegate = self
Expand Down Expand Up @@ -76,19 +82,7 @@ final class CalibrationConnectionViewController: UIViewController {
"""
}

@objc private func backAction() {
navigationController?.dismiss(animated: true, completion: nil)
}

@IBAction func connectAction(_ sender: Any) {

guard let address = addressTextField.text, !address.isEmpty,
let portText = portTextField.text, !portText.isEmpty,
let port = Int32(portText)
else {
return
}

private func startConnection(address: String, port: Int32) {
let connectionAlert = UIAlertController(title: "Connecting...", message: nil, preferredStyle: .alert)

present(connectionAlert, animated: true, completion: { [weak self] in
Expand All @@ -104,7 +98,13 @@ final class CalibrationConnectionViewController: UIViewController {

let alert = UIAlertController(
title: "Error",
message: "Unable to connect: \(error)",
message: """
Unable to connect (\(error)).
• Make sure that this device and the Quest are connected to the same WiFi network.
• Make sure that the Quest is running the Oculus MRC calibration app.
""",
preferredStyle: .alert
)

Expand Down Expand Up @@ -133,10 +133,45 @@ final class CalibrationConnectionViewController: UIViewController {
})
}

// MARK: - Actions

@objc private func backAction() {
navigationController?.dismiss(animated: true, completion: nil)
}

@IBAction func connectAction(_ sender: Any) {

guard let address = addressTextField.text, !address.isEmpty,
let portText = portTextField.text, !portText.isEmpty,
let port = Int32(portText)
else {
return
}

CameraPermissionHelper.ensurePermission(from: self, completion: { [weak self] in
self?.startConnection(address: address, port: port)
})
}

@IBAction private func scaleFactorChanged(_ sender: Any) {
poorPerformanceWarningLabel.isHidden = scaleSegmentedControl.selectedSegmentIndex < 2
}

@IBAction private func openScaleFactorInstructions(_ sender: Any) {
let alert = UIAlertController(
title: "Resolution Scale Factor",
message: """
Use this setting to select the resolution of the Mixed Reality video.
Smaller factors will result in better performance and lower quality.
""",
preferredStyle: .alert
)

alert.addAction(.init(title: "OK", style: .default, handler: nil))
present(alert, animated: true, completion: nil)
}

@IBAction private func downloadMRCAction(_ sender: Any) {
UIApplication.shared.open(Definitions.oculusMRCapp, options: [:], completionHandler: nil)
}
Expand All @@ -145,6 +180,15 @@ final class CalibrationConnectionViewController: UIViewController {
guard let url = URL(string: UIApplication.openSettingsURLString) else { return }
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}

@IBAction func showInstructionsAction(_ sender: Any) {
showInstructionsButton.isHidden = true
instructionsContainer.isHidden = false
scrollView.flashScrollIndicators()
UIView.animate(withDuration: 0.1, animations: {
self.view.layoutIfNeeded()
})
}
}

extension CalibrationConnectionViewController: CalibrationViewControllerDelegate {
Expand Down
Loading

0 comments on commit dedb826

Please sign in to comment.