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
#!/bin/sh | |
UNIVERSAL_OUTPUTFOLDER=../build/ | |
# make the output directory and delete the framework directory | |
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" | |
rm -rf "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" | |
# Step 1. Build Device and Simulator versions | |
set -o pipefail && xctool -workspace "../${WORKSPACE_NAME}" -scheme "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build | xcpretty |
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 UIKit | |
enum Direction { | |
case Left, Right, Up, Down | |
var pointVector: CGPoint { | |
switch self { | |
case Left: return CGPoint(x: -1, y: 0) | |
case Right: return CGPoint(x: 1, y: 0) | |
case Up: return CGPoint(x: 0, y: -1) |
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
extension CMDeviceMotion { | |
func gaze(atOrientation orientation: UIInterfaceOrientation) -> SCNVector4 { | |
let attitude = self.attitude.quaternion | |
let aq = GLKQuaternionMake(Float(attitude.x), Float(attitude.y), Float(attitude.z), Float(attitude.w)) | |
let final: SCNVector4 | |
switch orientation { |