It is unclear to me how the whole thing has to be implemented in SwiftUI.
Currently:
After an input (for example moving the camera) the renderer function is called correctly.
Goal:
The renderer function should also be called without needing input.
Setup:
Currently:
After an input (for example moving the camera) the renderer function is called correctly.
Goal:
The renderer function should also be called without needing input.
Setup:
Code Block struct ContentView: View { @ObservedObject var gameData : GameViewModel var body: some View { SceneView( scene: gameData.scene, pointOfView: gameData.camera, options: [ .allowsCameraControl ], delegate: gameData ) } }
Code Block class GameViewModel: NSObject, ObservableObject { ... }
Code Block extension GameViewModel: SCNSceneRendererDelegate { func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) { ... } }