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 | |
| @MainActor | |
| @Observable | |
| class AppModel { | |
| enum ImmersiveSpaceState { | |
| case closed | |
| case inTransition | |
| case open | |
| } |
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 ARKit | |
| import CoreHaptics | |
| import GameController | |
| import RealityKit | |
| import SwiftUI | |
| struct ImmersiveLaserPenMeasurementView: View { | |
| @State private var stylusManager = StylusLaserPenManager() | |
| var body: some View { |
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 | |
| @MainActor | |
| @Observable | |
| class AppModel { | |
| let immersiveSpaceID = "ImmersiveSpace" | |
| enum ImmersiveSpaceState { | |
| case closed | |
| case inTransition | |
| case open |
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 Foundation | |
| import ModelIO | |
| import simd | |
| nonisolated func loadMeshWithModelIO(from url: URL) throws -> TriangleMesh { | |
| let asset = MDLAsset(url: url) | |
| guard asset.count > 0 else { | |
| throw NSError(domain: "ModelIO", code: 1, userInfo: [NSLocalizedDescriptionKey: "No objects found in file"]) | |
| } |
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 Foundation | |
| enum EasingCurve { | |
| case linear | |
| case easeIn(Float) | |
| case easeOut(Float) | |
| case easeInOut(Float) | |
| func apply(_ t: Float) -> Float { | |
| let t = max(0, min(1, t)) |
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 Metal | |
| import RealityKit | |
| import SwiftUI | |
| #Preview { ExtrudedTextLowLevelMeshView() } | |
| struct ExtrudedTextLowLevelMeshView: View { | |
| @State var lowLevelMesh: LowLevelMesh? | |
| @State var originalVerticesBuffer: MTLBuffer? | |
| @State var timer: Timer? | |
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 Foundation | |
| enum EasingCurve { | |
| case linear | |
| case easeIn(Float) | |
| case easeOut(Float) | |
| case easeInOut(Float) | |
| func apply(_ t: Float) -> Float { | |
| let t = max(0, min(1, t)) |
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
| #ifndef MarchingCubesColorBlobParams_h | |
| #define MarchingCubesColorBlobParams_h | |
| #include <simd/simd.h> | |
| typedef struct { | |
| simd_float3 center; | |
| float radius; | |
| simd_float3 color; | |
| float _pad; | |
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
| #ifndef MarchingCubesBlobParams_h | |
| #define MarchingCubesBlobParams_h | |
| #include <simd/simd.h> | |
| typedef struct { | |
| simd_float3 center; | |
| float radius; | |
| } Sphere; |
NewerOlder