Skip to content

Instantly share code, notes, and snippets.

@wizard1066
Created January 15, 2023 20:30
Show Gist options
  • Save wizard1066/fd60615d90a973e11ba4ed757ecea9c5 to your computer and use it in GitHub Desktop.
Save wizard1066/fd60615d90a973e11ba4ed757ecea9c5 to your computer and use it in GitHub Desktop.
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":
talk.speaker(words: ["left"])
sphereNode.simdPosition = SIMD3(x: -1, y: height, z: -6)
sphereNode.geometry?.firstMaterial?.diffuse.contents = UIColor.blue.withAlphaComponent(1)
//looked.paused = true
case "eyesDown":
talk.speaker(words: ["down"])
sphereNode.simdPosition = SIMD3(x: 0, y: height - 1, z: -6)
sphereNode.geometry?.firstMaterial?.diffuse.contents = UIColor.red.withAlphaComponent(1)
//looked.paused = true
case "eyesUp":
talk.speaker(words: ["up"])
sphereNode.simdPosition = SIMD3(x: 0, y: height + 1, z: -6)
sphereNode.geometry?.firstMaterial?.diffuse.contents = UIColor.red.withAlphaComponent(1)
//looked.paused = true
case "eyesLeftUp":
talk.speaker(words: ["high right"])
sphereNode.simdPosition = SIMD3(x: 1, y: height + 1, z: -6)
sphereNode.geometry?.firstMaterial?.diffuse.contents = UIColor.orange.withAlphaComponent(1)
//looked.paused = true
case "eyesRightUp":
talk.speaker(words: ["high left"])
sphereNode.simdPosition = SIMD3(x: -1, y: height + 1, z: -6)
sphereNode.geometry?.firstMaterial?.diffuse.contents = UIColor.orange.withAlphaComponent(1)
//looked.paused = true
case "eyesLeftDown":
talk.speaker(words: ["low right"])
sphereNode.simdPosition = SIMD3(x: 1, y: height - 1, z: -6)
sphereNode.geometry?.firstMaterial?.diffuse.contents = UIColor.yellow.withAlphaComponent(1)
//looked.paused = true
case "eyesRightDown":
talk.speaker(words: ["low left"])
sphereNode.simdPosition = SIMD3(x: -1, y: height - 1, z: -6)
sphereNode.geometry?.firstMaterial?.diffuse.contents = UIColor.yellow.withAlphaComponent(1)
//looked.paused = true
default:
break
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment