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 BurnFadeParams_h | |
#define BurnFadeParams_h | |
struct BurnFadeParams { | |
float progress; | |
float scale; | |
float hueRotate; | |
float edgeWidth; | |
float emberRange; | |
}; |
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 | |
public struct AnimatingTorusSystem: System { | |
public init(scene: RealityKit.Scene) {} | |
public func update(context: SceneUpdateContext) { | |
let entities = context.entities(matching: Self.query, | |
updatingSystemWhen: .rendering) | |
for torus in entities.compactMap({ $0 as? LoopingTorusEntity }) { |
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 | |
struct BurnFadeModelView: View { | |
@State var lowLevelMesh: LowLevelMesh? | |
@State var timer: Timer? | |
@State var isForward: Bool = true | |
@State var morphProgress: Float = 0.0 | |
@State var dwellCounter: Int = 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 Foundation | |
struct BladeSegment { | |
var startPosition: SIMD3<Float> | |
var endPosition: SIMD3<Float> | |
var radius: Float | |
init(startPosition: SIMD3<Float>, endPosition: SIMD3<Float>, radius: Float) { | |
self.startPosition = startPosition | |
self.endPosition = endPosition |
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 ExampleAudioFXFiles { | |
case cannonShot | |
case fireworkExplode | |
static let baseURL = URL(string: "https://matt54.github.io/Resources/")! | |
var url: URL { | |
return ExampleAudioFXFiles.baseURL.appendingPathComponent( "\(filenameWithExtension)" ) | |
} |
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 IncrementallyUpdatingMultiPartData { | |
var settings: IncrementallyUpdatingMultiPartSettings | |
// Mesh buffer offsets (set once during initialization) | |
var vertexOffset: Int = 0 | |
var indexOffset: Int = 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 | |
struct MultiPartMeshView: View { | |
let radius: Float = 0.25 | |
var body: some View { | |
RealityView { content in | |
if let mesh = try? createMesh(), | |
let resource = try? MeshResource(from: mesh) |
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 | |
struct BranchSegment { | |
var startPosition: SIMD3<Float> | |
var endPosition: SIMD3<Float> | |
var radius: Float | |
init(startPosition: SIMD3<Float>, endPosition: SIMD3<Float>, radius: Float) { | |
self.startPosition = startPosition | |
self.endPosition = endPosition |
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 MorphingSpherePlaneParams_h | |
#define MorphingSpherePlaneParams_h | |
struct MorphingSpherePlaneParams { | |
int latitudeBands; | |
int longitudeBands; | |
float radius; | |
float morphAmount; | |
}; |
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 MorphingSpherePlaneParams_h | |
#define MorphingSpherePlaneParams_h | |
struct MorphingSpherePlaneParams { | |
int latitudeBands; | |
int longitudeBands; | |
float radius; | |
float morphAmount; | |
}; |
NewerOlder