Skip to content

Instantly share code, notes, and snippets.

//
// ContentView.swift
// Emitter
//
// Created by localuser on 18.04.23.
//
import SwiftUI
import Combine
import Algorithms
//
// ContentViewA.swift
// Emitter
//
// Created by localuser on 18.04.23.
//
import Foundation
import SwiftUI
class GameScene: SKScene, SKPhysicsContactDelegate {
var ball:SKSpriteNode!
var paddle:SKSpriteNode!
var begin = true
let points = Position.shared
override init() {
super.init()
}
import SwiftUI
import SceneKit
import ARKit
import Combine
let actionPublisher = PassthroughSubject<Int,Never>()
var actionSubscriber:AnyCancellable!
var setSquare = PassthroughSubject<Int,Never>()
let tts = AVSpeechSynthesizer()
import SwiftUI
import ARKit
struct Fonts {
static func avenirNextCondensedBold (size: CGFloat) -> Font {
return Font.custom("AvenirNextCondensed-Bold", size: size)
}
static func neutonRegular (size: CGFloat) -> Font {
return Font.custom("Neuton-Regular", size: size)
}
//
// ContentView.swift
// ARKit3
//
// Created by localuser on 25.12.22.
//
import SwiftUI
import ARKit
import Combine
if angle < 8 {
looked.outOfRange = false
switch looked.gazeX {
case "eyesLeft":
talk.speaker(words: ["right"])
sphereNode.simdPosition = SIMD3(x: 1, y: height, z: -6)
sphereNode.geometry?.firstMaterial?.diffuse.contents = UIColor.blue.withAlphaComponent(1)
//looked.paused = true
case "eyesRight":
do {
let model = try
eyesClassifier1(configuration: config)
let prediction = try model.prediction(eyeLookIn_L: eyeLookIn_L!, eyeLookOut_L: eyeLookOut_L!, eyeLookIn_R: eyeLookIn_R!, eyeLookOut_R: eyeLookOut_R!, eyeLookDown_L: eyeLookDown_L!, eyeLookDown_R: eyeLookDown_R!, eyeLookUp_L: eyeLookUp_L!, eyeLookUp_L_1: eyeLookUp_L!, faceX: 0, faceY: 0)
looked.gazeX = prediction.direction
} catch {
print("model error")
}
import Foundation
import AVFoundation
import Combine
var nextPage = PassthroughSubject<Void,Never>()
var reporter = PassthroughSubject<String, Never>()
class speaking: NSObject, AVSpeechSynthesizerDelegate {
var synth:AVSpeechSynthesizer!
var lastWords = ""