This file contains 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 SphereMeshTextureComparisonView: View { | |
let latitudeBands = 128 | |
let longitudeBands = 80 | |
let radius: Float = 0.1 | |
// Metal-related properties | |
let device: MTLDevice |
This file contains 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 AVFoundation | |
import SwiftUI | |
import RealityKit | |
#Preview { LightBeamSynthView() } | |
struct LightBeamSynthView: View { | |
@Environment(\.physicalMetrics) var physicalMetrics | |
@State var outerCylinderEntity: Entity? | |
@State var innerCylinderEntity: Entity? | |
@State var touchEntity: Entity? |
This file contains 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 AVFoundation | |
import SwiftUI | |
import RealityKit | |
struct LaserSynthView: View { | |
@Environment(\.physicalMetrics) var physicalMetrics | |
let signalGenerator = SignalGenerator() | |
@State var outerCylinderEntity: Entity? | |
@State var innerCylinderEntity: Entity? |
This file contains 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 FireballCirclesAddBlendView: View { | |
@State var rootEntity: Entity? | |
@State var sphereTargets: [Entity: SIMD3<Float>] = [:] | |
@State private var rotationAngles: SIMD3<Float> = [0, 0, 0] | |
@State private var modulationTimer: Timer? | |
@State private var lastRotationUpdateTime = CACurrentMediaTime() |
This file contains 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 LowLevelMeshNormalsComparisonView: View { | |
var body: some View { | |
RealityView { content in | |
let sphereWithoutNormals = try! sphereEntity(includeNormals: false) | |
sphereWithoutNormals.position.x = -0.11 | |
let sphereWithNormals = try! sphereEntity(includeNormals: true) |
This file contains 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 Metal | |
struct MetalWavyPlaneView: View { | |
@State private var phase: Float = 0.0 | |
@State private var mesh: LowLevelMesh? | |
@State private var timer: Timer? | |
let resolution = 250 | |
This file contains 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 WavyPlaneView: View { | |
@State private var phase: Float = 0.0 | |
@State private var mesh: LowLevelMesh? | |
@State private var timer: Timer? | |
let resolution = 60 | |
var body: some View { |
This file contains 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 SpotLightBoxView: View { | |
@State private var rootEntity: Entity? | |
@State private var timer: Timer? | |
@State private var childEntityPosition: SIMD3<Float> = [0, 0, 0] | |
@State private var childEntityTargetPosition: SIMD3<Float> = [0, 0, 0] | |
@State private var childEntityMoveSpeed: Float = 0.0005 | |
@State private var rotationAngles: SIMD3<Float> = [0, 0, 0] |
This file contains 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 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
// | |
// Entity+MoveAsync.swift | |
// | |
// Created by Drew Olbrich on 1/15/24. | |
// Copyright © 2024 Lunar Skydiving LLC. All rights reserved. | |
// | |
// MIT License | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal |
NewerOlder