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
| #!/usr/bin/env bash | |
| # Default values for percentages | |
| DEFAULT_WIRED_LIMIT_PERCENT=85 | |
| DEFAULT_WIRED_LWM_PERCENT=75 | |
| # Read input parameters or use default values | |
| WIRED_LIMIT_PERCENT=${1:-$DEFAULT_WIRED_LIMIT_PERCENT} | |
| WIRED_LWM_PERCENT=${2:-$DEFAULT_WIRED_LWM_PERCENT} |
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 RealityKit | |
| import SwiftUI | |
| struct BubbleRealityView: View { | |
| @State private var currentEntity: Entity? | |
| @State private var morphFactor: Float = 0.0 | |
| @State private var frameDuration: TimeInterval = 0.0 | |
| @State private var lastUpdateTime = CACurrentMediaTime() | |
| static let animationFrameDuration: TimeInterval = 1.0 / 120.0 |
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 RealityKit | |
| import SwiftUI | |
| import GameplayKit | |
| struct MorphingSphereRealityView: View { | |
| @State private var currentEntity: Entity? | |
| @State private var morphFactor: Float = 0.0 | |
| @State private var frameDuration: TimeInterval = 0.0 | |
| @State private var lastUpdateTime = CACurrentMediaTime() | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| extension ModelComponent { | |
| /// Dump the MeshResource.Model | |
| func dumpMeshResourceModel() { | |
| let printSIMD3Float = { (value: SIMD3<Float>) in | |
| print("(\(value.x), \(value.y), \(value.z)), ", terminator: "") | |
| } | |
| let printSIMD2Float = { (value: SIMD2<Float>) in | |
| print("(\(value.x), \(value.y)), ", terminator: "") | |
| } |
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
| // 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
| // You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
| (() => { | |
| const SHOW_SIDES = false; // color sides of DOM nodes? | |
| const COLOR_SURFACE = true; // color tops of DOM nodes? | |
| const COLOR_RANDOM = false; // randomise color? | |
| const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
| const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
| const THICKNESS = 20; // thickness of layers | |
| const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
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 | |
| // prerequisites in Info.plist: NSUserActivityTypes contains type, UIApplicationSceneManifest/UIApplicationSupportsMultipleScenes = YES | |
| // accepts NSUserActivity.targetContentIdentifier = type | |
| // see also: https://developer.apple.com/documentation/swiftui/scene/handlesexternalevents(matching:) | |
| struct UserActivityWindowGroup<Content: View, Payload: Codable>: Scene { | |
| var type: String | |
| @ViewBuilder var content: (Payload) -> Content | |
| init(type: String, payloadType: Payload.Type, @ViewBuilder content: @escaping (Payload) -> Content) { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| struct ContentView: View { | |
| var body: some View { | |
| VStack { | |
| HStack { | |
| Spacer() | |
| Button { } label: { | |
| Image(systemName: "power") | |
| .resizable() | |
| .aspectRatio(contentMode: .fill) | |
| .padding() |
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 |
NewerOlder