This file contains hidden or 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
| import SpriteKit | |
| import SwiftUI | |
| import Combine | |
| enum ControlUpdate { | |
| case tap(UITapGestureRecognizer) // print SpriteKit coordinate | |
| case doubleTap // reset camera | |
| case pan(UIPanGestureRecognizer) // move camera |
This file contains hidden or 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
| // | |
| // RealityRendererView.swift | |
| // RealityRendererTest | |
| // | |
| // Created by Arthur Schiller on 11.01.24. | |
| // | |
| import SwiftUI | |
| import Metal | |
| import MetalKit |
This file contains hidden or 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
| // Used to detect specific issue with JSON decoding | |
| func decodeOrReport(data: Data) { | |
| do { | |
| let _ = try JSONDecoder().decode(WidgetResponse.self, from: data) | |
| print("\n\n👍ALL GOOD\n\n") | |
| } catch DecodingError.keyNotFound( let key, let context) { | |
| print("\n\n⛔️FAILED TO DECODE\n\n") | |
| print("could not find key \(key) in JSON: \(context.debugDescription)") | |
| } catch DecodingError.valueNotFound( let type, let context) { | |
| print("\n\n⛔️FAILED TO DECODE\n\n") |
This file contains hidden or 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
| // | |
| // RealityRendererView.swift | |
| // RealityRendererTest | |
| // | |
| // Created by Arthur Schiller on 11.01.24. | |
| // | |
| // Change Log: by Yasuhito Nagatomo | |
| // - Added ImageBasedLighting, Mar 2, 2024 | |
| // - Added Camera a rotation animation, Mar 2, 2024 |
This file contains hidden or 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
| import SwiftUI | |
| import RealityKit | |
| import Combine | |
| struct ContentView: View { | |
| @Environment(\.realityKitScene) var scene: RealityKit.Scene? | |
| @State private var didAddEntitySubscription: Cancellable? |
OlderNewer