-
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.
added basic example view. added the same example to docc.
- Loading branch information
1 parent
40ee7fe
commit 325587f
Showing
6 changed files
with
88 additions
and
27 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 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