Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created January 31, 2021 19:40
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/0458f854382d3f8c91db415c3195b271 to your computer and use it in GitHub Desktop.
Save sturdysturge/0458f854382d3f8c91db415c3195b271 to your computer and use it in GitHub Desktop.
import SwiftUI
import RealityKit
struct ContentView : View {
@State var moving = false
@State var rotation = Float()
@State var speed = Float()
let boxAnchor = try! Experience.loadBox()
var body: some View {
ZStack {
AnyViewRepresentable {
let arView = ARView(frame: .zero)
arView.scene.anchors.append(boxAnchor)
return arView
}
DriveView(moving: $moving, rotation: $rotation, speed: $speed,
rotationChanged: rotationChanged, onTimer: onTimer)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment