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
| // Odd Manipulation Component Behaviors | |
| struct ImmersiveView: View { | |
| var body: some View { | |
| RealityView { content in | |
| let box1 = ModelEntity( | |
| mesh: .generateBox(size: 0.5, cornerRadius: 0.01), | |
| materials: [ | |
| SimpleMaterial(color: .blue, isMetallic: true) | |
| ] |
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? |
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 | |
| struct ImmersiveView: View { | |
| var body: some View { | |
| RealityView { content in | |
| // .postPass was the only one that had any visible effect for me | |
| let sortGroup = ModelSortGroup(depthPass: .postPass) | |
| // this represents some UI and should always be drawn in front of everything else |
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
| #if DEBUG | |
| import Combine | |
| private var loadInjectionOnce: () = { | |
| guard objc_getClass("InjectionClient") == nil else { | |
| return | |
| } | |
| #if targetEnvironment(simulator) | |
| // Running on Simulator |
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
| import SwiftUI | |
| import RealityKit | |
| struct AnimationDemoView: View { | |
| @Environment(\.realityKitScene) var scene: RealityKit.Scene? | |
| init() { | |
| // register System and Component – Important! | |
| AnimationSystem.registerSystem() | |
| AnimationComponent.registerComponent() |
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 { load } from '@loaders.gl/core'; | |
| import { LoaderContext } from '@loaders.gl/core'; | |
| import { Tiles3DLoader } from '@loaders.gl/3d-tiles'; | |
| import { Tileset3D } from '@loaders.gl/tiles'; | |
| import { WebMercatorViewport } from '@deck.gl/core'; | |
| const apiKey = '<insertKey>'; | |
| async function fetchRootTileset() { | |
| const baseURL = 'https://tile.googleapis.com' |
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
| // | |
| // RaymarchPostProcessing.metal | |
| // RealityKit Ray Marching | |
| // | |
| // Created by Arthur Schiller on 02.10.22. | |
| // | |
| #include <metal_stdlib> | |
| using namespace metal; |
NewerOlder