Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created January 11, 2021 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sturdysturge/048e0a0203c230a9f8cb76ef58b84c24 to your computer and use it in GitHub Desktop.
Save sturdysturge/048e0a0203c230a9f8cb76ef58b84c24 to your computer and use it in GitHub Desktop.
import RealityKit
import SwiftUI
struct ContentView : View {
static let arView = ARView(frame: UIScreen.main.bounds)
static let boxAnchor = try! Experience.loadBox()
static let steelBox = boxAnchor.steelBox!
static let waypoint = ModelEntity(mesh: .generatePlane(width: 0.1, depth: 0.1))
static let speed = Float(0.2)
var body: some View {
GeometryReader { geometry in
ZStack {
ARViewContainer(boxAnchor: Self.boxAnchor, arView: Self.arView, waypoint: Self.waypoint)
Text("⚀")
.font(.largeTitle)
.frame(maxWidth: .infinity, maxHeight: .infinity)
MoveButton {
// Self.setWaypoint(centre: geometry.frame(in: .global).centre)
}
}
}
.edgesIgnoringSafeArea(.all)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment