Cloud Gaming is a great way to enjoy graphically demanding games on Apple Vision Pro.
Since Safari on visionOS does not support PWA mode, here is how you can access cloud gaming services on Apple Vision Pro.
extension MeshResource { | |
static func generateSpecificSphere(radius: Float, latitudeBands: Int = 10, longitudeBands: Int = 10) throws -> MeshResource { | |
let vertexCount = (latitudeBands + 1) * (longitudeBands + 1) | |
let indexCount = latitudeBands * longitudeBands * 6 | |
var desc = MyVertex.descriptor | |
desc.vertexCapacity = vertexCount | |
desc.indexCapacity = indexCount | |
let mesh = try LowLevelMesh(descriptor: desc) |
import RealityKit | |
import SwiftUI | |
struct FibonacciLatticeView: View { | |
@State private var rotationAngles: SIMD3<Float> = [0, 0, 0] | |
@State private var modulationTimer: Timer? | |
@State private var time: Double = 0.0 | |
@State private var lastRotationUpdateTime = CACurrentMediaTime() | |
let overallSphereRadius: Float = 0.0875 |
Cloud Gaming is a great way to enjoy graphically demanding games on Apple Vision Pro.
Since Safari on visionOS does not support PWA mode, here is how you can access cloud gaming services on Apple Vision Pro.
/* | |
* Copyright (C) 2023 Daniel Levi | |
* | |
* Originally based on Apple's header for WebKit. The file within this repo | |
* named LICENSE_APPLE contains the copyright notice provided by Apple | |
* | |
* This header is based on my own disassembly of libMobileGestalt and contains | |
* 760 keys that should support any iOS version up until iOS 17. | |
* | |
*/ |
// | |
// RoundedPolygon.swift | |
// | |
// Created by Nate on 2022-10-17. | |
// | |
import SwiftUI | |
struct RoundedPolygon: Shape { | |
func scrollViewDidScroll(_ scrollView: UIScrollView) { | |
for (i, view) in scrollView.subviews.enumerated() { | |
var ty = 0.0 | |
if scrollView.contentOffset.y < 0 { | |
// We're scrolling past the top of the scroll view. | |
// Translate each item in the scroll view by some amount based on its index and scroll offset. | |
ty = CGFloat(i) * abs(offsetY) / 8.0 * pow(1.12, CGFloat(i)) | |
} | |
view.transform = CGAffineTransform(translationX: 0, y: ty) | |
} |
import UIKit | |
protocol StepAnimatable { | |
/// Start a sequence where you add each step in the `addSteps` closure. Use the provided `AnimationSequence` object | |
/// to add each step which should either be an actual animation or a delay. | |
/// The `completion` closure is executed when the last animation has finished. | |
/// - Parameters: | |
/// - addSteps: Closure used to add steps to the provided `AnimationSequence` object | |
/// - completion: Executed when the last animation has finished. |
extension CATransaction { | |
/// Executes the provided `actions` closure wrapped in `CATransaction`. | |
/// Optionally adds all the specific properties to commit the transaction with | |
/// - Parameters: | |
/// - duration: Duration of transaction | |
/// - timingFunction: Specific timing function to use with transaction | |
/// - disableActions: Wether actual animation should happen during transaction | |
/// - actions: What to do while transaction is commited | |
/// - completion: Closure to be executed when transaction is completes | |
/// |
import Foundation | |
extension CFRunLoop { | |
static func performNext(work: @escaping () -> Void) { | |
CFRunLoopPerformBlock(CFRunLoopGetMain(), CFRunLoopMode.defaultMode.rawValue, work) | |
} | |
} |
global.THREE = require("three"); | |
const canvasSketch = require('canvas-sketch'); | |
const Random = require('canvas-sketch-util/random'); | |
const gradientHeight = 512; | |
const settings = { | |
dimensions: [ 2048, gradientHeight * 2 ] | |
}; |