-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from maxxfrazer/update-docc
Updated DocC Examples - Updated Swift version to fix DocC Implementation - Marked old delegate methods as deprecated
- Loading branch information
Showing
8 changed files
with
118 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// BasicARView.swift | ||
// FocusEntity-Example | ||
// | ||
// Created by Max Cobb on 12/04/2023. | ||
// Copyright © 2023 Max Cobb. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import RealityKit | ||
import FocusEntity | ||
import ARKit | ||
|
||
struct BasicARView: UIViewRepresentable { | ||
typealias UIViewType = ARView | ||
func makeUIView(context: Context) -> ARView { | ||
let arView = ARView(frame: .zero) | ||
let arConfig = ARWorldTrackingConfiguration() | ||
arConfig.planeDetection = [.horizontal, .vertical] | ||
arView.session.run(arConfig) | ||
_ = FocusEntity(on: arView, style: .classic()) | ||
return arView | ||
} | ||
func updateUIView(_ uiView: ARView, context: Context) {} | ||
} | ||
|
||
struct BasicARView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
BasicARView() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# ``FocusEntity`` | ||
|
||
Visualise the camera focus in Augmented Reality. | ||
|
||
## Overview | ||
|
||
FocusEntity lets you see exactly where the centre of the view will sit in the AR space. To add FocusEntity to your scene: | ||
|
||
```swift | ||
let focusSquare = FocusEntity(on: <#ARView#>, focus: .classic) | ||
``` | ||
|
||
To make a whole SwiftUI View with a FocusEntity: | ||
|
||
```swift | ||
struct BasicARView: UIViewRepresentable { | ||
typealias UIViewType = ARView | ||
func makeUIView(context: Context) -> ARView { | ||
let arView = ARView(frame: .zero) | ||
let arConfig = ARWorldTrackingConfiguration() | ||
arConfig.planeDetection = [.horizontal, .vertical] | ||
arView.session.run(arConfig) | ||
_ = FocusEntity(on: arView, style: .classic()) | ||
return arView | ||
} | ||
func updateUIView(_ uiView: ARView, context: Context) {} | ||
} | ||
``` | ||
|
||
## Topics | ||
|
||
### FocusEntity | ||
|
||
- ``FocusEntity/FocusEntity`` | ||
- ``FocusEntityComponent`` | ||
- ``HasFocusEntity`` | ||
|
||
### Events | ||
|
||
Use the ``FocusEntityDelegate`` to catch events such as changing the plane anchor or otherwise a change of state. | ||
|
||
- ``FocusEntityDelegate`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters