├── Pods ├── Target Support Files │ ├── SwiftTracer-Core │ │ ├── SwiftTracer-Core.xcconfig │ │ ├── SwiftTracer-Core-prefix.pch │ │ ├── SwiftTracer-Core.modulemap │ │ ├── SwiftTracer-Core-dummy.m │ │ ├── SwiftTracer-Core-umbrella.h │ │ ├── SwiftTracer-Core-Private.xcconfig │ │ └── Info.plist │ └── Pods-SwiftTracer │ │ ├── Pods-SwiftTracer.modulemap │ │ ├── Pods-SwiftTracer-dummy.m │ │ ├── Pods-SwiftTracer-umbrella.h │ │ ├── Pods-SwiftTracer.debug.xcconfig │ │ ├── Pods-SwiftTracer.release.xcconfig │ │ ├── Info.plist │ │ ├── Pods-SwiftTracer-acknowledgements.markdown │ │ ├── Pods-SwiftTracer-acknowledgements.plist │ │ ├── Pods-SwiftTracer-frameworks.sh │ │ └── Pods-SwiftTracer-resources.sh ├── SwiftTracer-Core │ ├── README.md │ ├── Sources │ │ ├── Geometry │ │ │ ├── Shape.swift │ │ │ ├── Plane.swift │ │ │ ├── Sphere.swift │ │ │ └── Box.swift │ │ ├── Lights │ │ │ └── PointLight.swift │ │ ├── Misc │ │ │ ├── Ray.swift │ │ │ ├── Intersection.swift │ │ │ ├── Scene.swift │ │ │ ├── Camera.swift │ │ │ ├── Material.swift │ │ │ ├── Color.swift │ │ │ └── Renderer.swift │ │ └── Math │ │ │ └── Vector.swift │ └── LICENSE ├── Manifest.lock ├── Local Podspecs │ └── SwiftTracer-Core.podspec.json └── Pods.xcodeproj │ ├── xcshareddata │ └── xcschemes │ │ └── SwiftTracer-Core.xcscheme │ └── project.pbxproj ├── Gemfile ├── images └── render-1.png ├── Podfile ├── Podfile.lock ├── SwiftTracer.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── README.md ├── SwiftTracer.xcworkspace └── contents.xcworkspacedata ├── SwiftTracerTests └── Info.plist ├── .gitignore ├── LICENSE ├── SwiftTracer ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── Views │ └── PixelRenderView.swift ├── UI │ ├── SwiftTracer.MainViewController.xib │ └── SwiftTracer.EditMaterialWindowController.xib ├── Controllers │ ├── Window Controllers │ │ └── EditMaterialWindowController.swift │ └── View Controllers │ │ └── MainViewController.swift ├── AppDelegate.swift └── Base.lproj │ └── MainMenu.xib └── Gemfile.lock /Pods/Target Support Files/SwiftTracer-Core/SwiftTracer-Core.xcconfig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'cocoapods', '~> 1.1.0' 4 | -------------------------------------------------------------------------------- /images/render-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k0nserv/SwiftTracer/HEAD/images/render-1.png -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftTracer-Core/SwiftTracer-Core-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/README.md: -------------------------------------------------------------------------------- 1 | SwiftTracer-Core 2 | =========== 3 | 4 | Core rendering mechanics for [SwiftTracer](https://github.com/k0nserv/SwiftTracer) 5 | 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_SwiftTracer { 2 | umbrella header "Pods-SwiftTracer-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftTracer-Core/SwiftTracer-Core.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftTracer_Core { 2 | umbrella header "SwiftTracer-Core-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SwiftTracer : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SwiftTracer 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftTracer-Core/SwiftTracer-Core-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SwiftTracer_Core : NSObject 3 | @end 4 | @implementation PodsDummy_SwiftTracer_Core 5 | @end 6 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.10' 2 | 3 | inhibit_all_warnings! 4 | 5 | def import_pods 6 | pod 'SwiftTracer-Core', '~> 0.0.2' 7 | end 8 | 9 | target :SwiftTracer do 10 | use_frameworks! 11 | import_pods 12 | end 13 | 14 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SwiftTracer-Core (0.0.2) 3 | 4 | DEPENDENCIES: 5 | - SwiftTracer-Core (~> 0.0.2) 6 | 7 | SPEC CHECKSUMS: 8 | SwiftTracer-Core: 54dc69adfebdaf850cd83894782ab4473466e648 9 | 10 | COCOAPODS: 0.38.2 11 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SwiftTracer-Core (0.0.2) 3 | 4 | DEPENDENCIES: 5 | - SwiftTracer-Core (~> 0.0.2) 6 | 7 | SPEC CHECKSUMS: 8 | SwiftTracer-Core: 54dc69adfebdaf850cd83894782ab4473466e648 9 | 10 | COCOAPODS: 0.38.2 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_SwiftTracerVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_SwiftTracerVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftTracer-Core/SwiftTracer-Core-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double SwiftTracer_CoreVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char SwiftTracer_CoreVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /SwiftTracer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SwiftTracer 2 | =========== 3 | 4 | A OSX frontend for the SwiftTracer project. 5 | Under the hood [SwitftTracer-Core](https://github.com/k0nserv/SwiftTracer-Core) is used for rendering. 6 | 7 | 8 | Renders 9 | ------- 10 | 11 | ![](images/render-1.png) 12 | -------------------------------------------------------------------------------- /SwiftTracer.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Geometry/Shape.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Shape.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | public protocol Shape { 13 | var material: Material { get } 14 | func intersectWithRay(ray: Ray) -> Intersection? 15 | } -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftTracer-Core/SwiftTracer-Core-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "SwiftTracer-Core.xcconfig" 2 | CODE_SIGN_IDENTITY = 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SwiftTracer-Core" "${PODS_ROOT}/Headers/Public" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_ROOT = ${SRCROOT} 7 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Lights/PointLight.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PointLight.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | public class PointLight { 10 | public let color: Color 11 | public let position: Vector 12 | public let intensity: Double 13 | 14 | public init(color: Color, position: Vector, intensity: Double) { 15 | self.color = color 16 | self.position = position 17 | self.intensity = intensity 18 | } 19 | } -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/SwiftTracer_Core.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "SwiftTracer_Core" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-SwiftTracer 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer.release.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/SwiftTracer_Core.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "SwiftTracer_Core" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-SwiftTracer 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Local Podspecs/SwiftTracer-Core.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SwiftTracer-Core", 3 | "version": "0.0.1", 4 | "license": { 5 | "type": "MIT" 6 | }, 7 | "homepage": "https://github.com/k0nserv/SwiftTracer-Core", 8 | "authors": { 9 | "Hugo Tunius": "h@tunius.se" 10 | }, 11 | "summary": "SwiftTracer core rendering logic. OS independant", 12 | "source": { 13 | "git": "https://github.com/k0nserv/SwiftTracer-Core.git", 14 | "tag": "0.0.1" 15 | }, 16 | "source_files": "Sources/*/*.swift", 17 | "platforms": { 18 | "ios": "8.0", 19 | "osx": "10.10" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Misc/Ray.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Ray.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | public struct Ray { 10 | public let origin: Vector 11 | public let direction: Vector 12 | 13 | // The refraction index of the medium 14 | // in which the ray's origin resides 15 | public let mediumRefractionIndex: Double 16 | 17 | public init(origin: Vector, direction: Vector) { 18 | self.init(origin: origin, direction: direction, mediumRefractionIndex: 1.0) 19 | } 20 | 21 | public init(origin: Vector, direction: Vector, mediumRefractionIndex: Double) { 22 | self.origin = origin 23 | self.direction = direction 24 | self.mediumRefractionIndex = mediumRefractionIndex 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SwiftTracerTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Misc/Intersection.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Intersection.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | public class Intersection { 10 | public let t: Double 11 | public let point: Vector 12 | public let normal: Vector 13 | public let shape: Shape 14 | // Wether or not the hit is 15 | // from inside the shape itself 16 | public let inside: Bool 17 | 18 | convenience init (t: Double, point: Vector, normal: Vector, shape: Shape) { 19 | self.init(t: t, point: point, normal: normal, shape: shape, inside: false) 20 | } 21 | 22 | 23 | init(t: Double, point: Vector, normal: Vector, shape: Shape, inside: Bool) { 24 | self.t = t 25 | self.point = point 26 | self.normal = normal 27 | self.shape = shape 28 | self.inside = inside 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftTracer/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftTracer-Core/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.0.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Misc/Scene.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Scene.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | public class Scene { 10 | public let objects: [Shape] 11 | public let lights: [PointLight] 12 | public let clearColor: Color 13 | 14 | public init(objects: [Shape], lights: [PointLight], clearColor: Color) { 15 | self.objects = objects 16 | self.lights = lights 17 | self.clearColor = clearColor 18 | } 19 | 20 | 21 | public func intersect(ray: Ray) -> Intersection? { 22 | var closestHit: Intersection? 23 | 24 | for object: Shape in objects { 25 | if let hit = object.intersectWithRay(ray) { 26 | if let previousHit = closestHit where hit.t < previousHit.t { 27 | closestHit = hit 28 | } else if closestHit == nil { 29 | closestHit = hit 30 | } 31 | } 32 | } 33 | 34 | return closestHit 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Hugo Tunius 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Geometry/Plane.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Plane.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | public class Plane { 13 | public let position: Vector 14 | public let normal: Vector 15 | public let material: Material 16 | 17 | public init(position: Vector, normal: Vector, material: Material) { 18 | self.position = position 19 | self.normal = normal 20 | self.material = material 21 | } 22 | } 23 | 24 | extension Plane : Shape { 25 | public func intersectWithRay(ray: Ray) -> Intersection? { 26 | let denominator = normal.dot(ray.direction) 27 | if abs(denominator) < 1e-5 { 28 | return nil 29 | } 30 | 31 | let t = (position - ray.origin).dot(normal) / denominator 32 | 33 | if t >= 1e-5 { 34 | let intersectionPoint = ray.origin + ray.direction * t 35 | return Intersection(t: t, point: intersectionPoint, normal: normal, shape: self) 36 | } 37 | 38 | return nil 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Hugo Tunius 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SwiftTracer/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /SwiftTracer/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2015 Hugo Tunius. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SwiftTracer-Core 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2015 Hugo Tunius 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | Generated by CocoaPods - http://cocoapods.org 29 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Geometry/Sphere.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Sphere.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | #if os(Linux) 12 | import Glibc 13 | #else 14 | import Darwin.C 15 | #endif 16 | 17 | public class Sphere { 18 | public let radius: Double 19 | public let center: Vector 20 | public let material: Material 21 | 22 | public init(radius: Double, center: Vector, material: Material) { 23 | self.radius = radius 24 | self.center = center 25 | self.material = material 26 | } 27 | } 28 | 29 | extension Sphere : Shape { 30 | public func intersectWithRay(ray: Ray) -> Intersection? { 31 | let V = ray.origin - center 32 | let a = ray.direction.dot(V) 33 | let b = -a 34 | let c = pow(a, 2) - pow(V.length(), 2) + pow(radius, 2) 35 | 36 | if (c < 0) { 37 | return nil 38 | } 39 | 40 | let t1 = b + sqrt(c) 41 | let t2 = b - sqrt(c) 42 | 43 | var t: Double? 44 | var hit = false 45 | var inside = false 46 | 47 | if t1 > 0.01 { 48 | if t2 < 0.0 { 49 | t = t1 50 | hit = true 51 | inside = true 52 | } else { 53 | t = t2 54 | hit = true 55 | } 56 | } 57 | 58 | if hit { 59 | assert(nil != t) 60 | let intersectionPoint = ray.origin + ray.direction * t! 61 | let N = (intersectionPoint - center).normalize() 62 | return Intersection(t: t!, point: intersectionPoint, normal: N, shape: self, inside: inside) 63 | } 64 | 65 | return nil 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Misc/Camera.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Camera.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | #if os(Linux) 10 | import Glibc 11 | #else 12 | import Darwin.C 13 | #endif 14 | 15 | public struct Camera { 16 | public let fov: Double 17 | public let width: Int 18 | public let height: Int 19 | public let aspectRatio: Double 20 | 21 | private let x0: Double 22 | private let y0: Double 23 | 24 | public init(fov: Double, width: Int, height: Int) { 25 | self.fov = fov 26 | self.width = width 27 | self.height = height 28 | self.aspectRatio = Double(height) / Double(width) 29 | let verticalFov = self.fov * aspectRatio 30 | self.x0 = sin(fov * 0.5) 31 | self.y0 = sin(verticalFov * 0.5) 32 | } 33 | 34 | func createRay(x x: Int, y: Int, xSample: UInt, ySample: UInt, samplesPerPixel: UInt) -> Ray { 35 | let sampleWidth = Double(width * Int(samplesPerPixel)) 36 | let sampleHeight = Double(height * Int(samplesPerPixel)) 37 | let px = (Double(x * Int(samplesPerPixel) + Int(xSample)) * 2) / sampleWidth - 1 38 | let py = (Double(y * Int(samplesPerPixel) + Int(ySample)) * 2) / sampleHeight - 1 39 | let direction = Vector(x: px * x0, y: py * y0, z: 1.0) 40 | 41 | return Ray(origin: Vector(x: 0, y: 0, z: 0), direction: direction.normalize()) 42 | } 43 | 44 | public func createRay(x x: Int, y: Int) -> Ray{ 45 | return createRay(x: x, y: y, xSample: 0, ySample: 0, samplesPerPixel: 1) 46 | } 47 | 48 | public func cameraWithNewResolution(newWidth newWidth: Int, newHeight: Int) -> Camera { 49 | return Camera(fov: self.fov, width: newWidth, height: newHeight) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Misc/Material.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Material.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | public class Material { 10 | public var color: Color = Color.Black 11 | public var ambientCoefficient: Double = 0.2 12 | public var diffuseCoefficient: Double = 0.2 13 | public var specularCoefficient: Double = 0.0 14 | 15 | public var reflectionCoefficient: Double = 0.0 16 | public var isReflective: Bool { 17 | get { 18 | return reflectionCoefficient > 0.0 19 | } 20 | } 21 | 22 | public var refractionCoefficient: Double? 23 | 24 | public convenience init(color: Color, ambientCoefficient: Double, diffuseCoefficient: Double) { 25 | self.init(color: color, ambientCoefficient: ambientCoefficient, diffuseCoefficient: diffuseCoefficient, specularCoefficient: 0.0, reflectionCoefficient: 0.0, refractionCoefficient: nil) 26 | } 27 | 28 | public init(color: Color, ambientCoefficient: Double, diffuseCoefficient: Double, specularCoefficient: Double, reflectionCoefficient: Double, refractionCoefficient: Double?) { 29 | self.color = color 30 | self.ambientCoefficient = ambientCoefficient 31 | self.diffuseCoefficient = diffuseCoefficient 32 | self.specularCoefficient = specularCoefficient 33 | self.reflectionCoefficient = reflectionCoefficient 34 | self.refractionCoefficient = refractionCoefficient 35 | } 36 | 37 | public func copy() -> Material { 38 | return Material(color: color, ambientCoefficient: ambientCoefficient, diffuseCoefficient: diffuseCoefficient, specularCoefficient: specularCoefficient, reflectionCoefficient: reflectionCoefficient, refractionCoefficient: refractionCoefficient) 39 | } 40 | } -------------------------------------------------------------------------------- /SwiftTracer/Views/PixelRenderView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PixelRenderView.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import SwiftTracer_Core 11 | 12 | protocol PixelRenderViewDelegate: class { 13 | func rightMouseClickedAt(x x: CGFloat, y: CGFloat, event: NSEvent) 14 | } 15 | 16 | class PixelRenderView: NSView { 17 | var pixels: [Color] = [] { 18 | didSet { 19 | rawPixels = UnsafeMutablePointer(pixels) 20 | } 21 | } 22 | weak var delegate: PixelRenderViewDelegate? 23 | private var rawPixels: UnsafeMutablePointer = UnsafeMutablePointer() 24 | 25 | override func drawRect(dirtyRect: NSRect) { 26 | super.drawRect(dirtyRect) 27 | if pixels.count == 0 { 28 | return 29 | } 30 | 31 | let rep = NSBitmapImageRep(bitmapDataPlanes: &rawPixels, 32 | pixelsWide: Int(bounds.size.width), 33 | pixelsHigh: Int(bounds.size.height), 34 | bitsPerSample: 8, 35 | samplesPerPixel: 4, 36 | hasAlpha: true, 37 | isPlanar: false, 38 | colorSpaceName: NSDeviceRGBColorSpace, 39 | bytesPerRow: Int(bounds.size.width) * 4, 40 | bitsPerPixel: 32) 41 | guard let r = rep else { 42 | return 43 | } 44 | 45 | r.drawInRect(dirtyRect) 46 | } 47 | 48 | override func rightMouseUp(theEvent: NSEvent) { 49 | guard let d = delegate else { 50 | return 51 | } 52 | 53 | let location = theEvent.locationInWindow 54 | let center = convertPoint(location, fromView: nil) 55 | 56 | d.rightMouseClickedAt(x: center.x, y: center.y, event: theEvent) 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (2.3.4) 5 | activesupport (4.2.7.1) 6 | i18n (~> 0.7) 7 | json (~> 1.7, >= 1.7.7) 8 | minitest (~> 5.1) 9 | thread_safe (~> 0.3, >= 0.3.4) 10 | tzinfo (~> 1.1) 11 | claide (1.0.1) 12 | cocoapods (1.1.1) 13 | activesupport (>= 4.0.2, < 5) 14 | claide (>= 1.0.1, < 2.0) 15 | cocoapods-core (= 1.1.1) 16 | cocoapods-deintegrate (>= 1.0.1, < 2.0) 17 | cocoapods-downloader (>= 1.1.2, < 2.0) 18 | cocoapods-plugins (>= 1.0.0, < 2.0) 19 | cocoapods-search (>= 1.0.0, < 2.0) 20 | cocoapods-stats (>= 1.0.0, < 2.0) 21 | cocoapods-trunk (>= 1.1.1, < 2.0) 22 | cocoapods-try (>= 1.1.0, < 2.0) 23 | colored (~> 1.2) 24 | escape (~> 0.0.4) 25 | fourflusher (~> 2.0.1) 26 | gh_inspector (~> 1.0) 27 | molinillo (~> 0.5.1) 28 | nap (~> 1.0) 29 | xcodeproj (>= 1.3.3, < 2.0) 30 | cocoapods-core (1.1.1) 31 | activesupport (>= 4.0.2, < 5) 32 | fuzzy_match (~> 2.0.4) 33 | nap (~> 1.0) 34 | cocoapods-deintegrate (1.0.1) 35 | cocoapods-downloader (1.1.2) 36 | cocoapods-plugins (1.0.0) 37 | nap 38 | cocoapods-search (1.0.0) 39 | cocoapods-stats (1.0.0) 40 | cocoapods-trunk (1.1.1) 41 | nap (>= 0.8, < 2.0) 42 | netrc (= 0.7.8) 43 | cocoapods-try (1.1.0) 44 | colored (1.2) 45 | escape (0.0.4) 46 | fourflusher (2.0.1) 47 | fuzzy_match (2.0.4) 48 | gh_inspector (1.0.2) 49 | i18n (0.7.0) 50 | json (1.8.3) 51 | minitest (5.10.1) 52 | molinillo (0.5.4) 53 | nanaimo (0.2.3) 54 | nap (1.1.0) 55 | netrc (0.7.8) 56 | thread_safe (0.3.5) 57 | tzinfo (1.2.2) 58 | thread_safe (~> 0.1) 59 | xcodeproj (1.4.1) 60 | CFPropertyList (~> 2.3.3) 61 | activesupport (>= 3) 62 | claide (>= 1.0.1, < 2.0) 63 | colored (~> 1.2) 64 | nanaimo (~> 0.2.0) 65 | 66 | PLATFORMS 67 | ruby 68 | 69 | DEPENDENCIES 70 | cocoapods (~> 1.1.0) 71 | 72 | BUNDLED WITH 73 | 1.12.5 74 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2015 Hugo Tunius 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | Title 40 | SwiftTracer-Core 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - http://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/SwiftTracer-Core.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 47 | 48 | 54 | 55 | 57 | 58 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Geometry/Box.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Box.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 31/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class Box { 12 | public let material: Material 13 | public let min: Vector 14 | public let max: Vector 15 | 16 | public init(min: Vector, max: Vector, material: Material) { 17 | self.min = min 18 | self.max = max 19 | self.material = material 20 | } 21 | } 22 | 23 | extension Box: Shape { 24 | public func intersectWithRay(ray: Ray) -> Intersection? { 25 | var tmin, tmax, tymin, tymax, tzmin, tzmax: Double 26 | 27 | if ray.direction.x >= 0 { 28 | tmin = (min.x - ray.origin.x) / ray.direction.x 29 | tmax = (max.x - ray.origin.x) / ray.direction.x 30 | } else { 31 | tmin = (max.x - ray.origin.x) / ray.direction.x 32 | tmax = (min.x - ray.origin.x) / ray.direction.x 33 | } 34 | 35 | if ray.direction.y >= 0 { 36 | tymin = (min.y - ray.origin.y) / ray.direction.y 37 | tymax = (max.y - ray.origin.y) / ray.direction.y 38 | } else { 39 | tymin = (max.y - ray.origin.y) / ray.direction.y 40 | tymax = (min.y - ray.origin.y) / ray.direction.y 41 | } 42 | 43 | if tmin > tymax || tymin > tmax { 44 | return nil 45 | } 46 | 47 | if tymin > tmin { 48 | tmin = tymin 49 | } 50 | 51 | if tymax < tmax { 52 | tmax = tymax 53 | } 54 | 55 | if ray.direction.z >= 0 { 56 | tzmin = (min.z - ray.origin.z) / ray.direction.z 57 | tzmax = (max.z - ray.origin.z) / ray.direction.z 58 | } else { 59 | tzmin = (max.z - ray.origin.z) / ray.direction.z 60 | tzmax = (min.z - ray.origin.z) / ray.direction.z 61 | } 62 | 63 | if tmin > tzmax || tzmax > tmax { 64 | return nil 65 | } 66 | 67 | if tzmin > tmin { 68 | tmin = tzmin 69 | } 70 | if (tzmax < tmax) { 71 | tmax = tzmax 72 | } 73 | 74 | let center = Vector(x: max.x - min.x, y: max.y - min.y, z: max.z - min.z) 75 | let hitPoint = ray.origin + ray.direction * tmin 76 | return Intersection(t: tmin, point: hitPoint, normal: (hitPoint - center).normalize(), shape: self) 77 | } 78 | } -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | else 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | fi 16 | 17 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | 19 | if [ -L "${source}" ]; then 20 | echo "Symlinked..." 21 | source="$(readlink "${source}")" 22 | fi 23 | 24 | # use filter instead of exclude so missing patterns dont' throw errors 25 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 26 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 27 | 28 | # Resign the code if required by the build settings to avoid unstable apps 29 | code_sign_if_enabled "${destination}/$(basename "$1")" 30 | 31 | # Embed linked Swift runtime libraries 32 | local basename 33 | basename="$(basename "$1" | sed -E s/\\..+// && exit ${PIPESTATUS[0]})" 34 | local swift_runtime_libs 35 | swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/${basename}.framework/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 36 | for lib in $swift_runtime_libs; do 37 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 38 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 39 | code_sign_if_enabled "${destination}/${lib}" 40 | done 41 | } 42 | 43 | # Signs a framework with the provided identity 44 | code_sign_if_enabled() { 45 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 46 | # Use the current code_sign_identitiy 47 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 48 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 49 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 50 | fi 51 | } 52 | 53 | 54 | if [[ "$CONFIGURATION" == "Debug" ]]; then 55 | install_framework 'Pods-SwiftTracer/SwiftTracer_Core.framework' 56 | fi 57 | if [[ "$CONFIGURATION" == "Release" ]]; then 58 | install_framework 'Pods-SwiftTracer/SwiftTracer_Core.framework' 59 | fi 60 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Math/Vector.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Vector.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | #if os(Linux) 10 | import Glibc 11 | #else 12 | import Darwin.C 13 | #endif 14 | 15 | public struct Vector : Equatable { 16 | public let x: Double 17 | public let y: Double 18 | public let z: Double 19 | 20 | public init(x: Double, y: Double, z: Double) { 21 | self.x = x 22 | self.y = y 23 | self.z = z 24 | } 25 | 26 | public func dot(other: Vector) -> Double { 27 | return x * other.x + y * other.y + z * other.z 28 | } 29 | 30 | public func cross(other: Vector) -> Vector { 31 | let x0 = y * other.z - z * other.y 32 | let y0 = z * other.x - x * other.z 33 | let z0 = x * other.y - y * other.x 34 | return Vector(x: x0, y: y0, z: z0) 35 | } 36 | 37 | public func length() -> Double { 38 | return sqrt(dot(self)) 39 | } 40 | 41 | public func normalize() -> Vector { 42 | let l = length() 43 | if l == 0 { 44 | return Vector(x: 0.0, y: 0.0, z: 0.0) 45 | } 46 | 47 | return Vector(x: (x / l), y: (y / l), z: (z / l)) 48 | } 49 | 50 | public func reflect(normal: Vector) -> Vector { 51 | return self - normal * 2 * self.dot(normal) 52 | } 53 | 54 | func fuzzyEquals(other: Vector) -> Bool { 55 | var result = true 56 | 57 | result = result && abs(x - other.x) < 0.001 58 | result = result && abs(y - other.y) < 0.001 59 | result = result && abs(z - other.z) < 0.001 60 | 61 | return result 62 | } 63 | } 64 | 65 | public func ==(left: Vector, right: Vector) -> Bool { 66 | return left.x == right.x && 67 | left.y == right.y && 68 | left.z == right.z 69 | } 70 | 71 | public func -(left: Vector, right: Vector) -> Vector { 72 | return newVector(left: left, right: right) { 73 | $0 - $1 74 | } 75 | } 76 | 77 | public func +(left: Vector, right: Vector) -> Vector { 78 | return newVector(left: left, right: right) { 79 | $0 + $1 80 | } 81 | } 82 | 83 | public func *(left: Vector, right: Vector) -> Vector { 84 | return newVector(left: left, right: right) { 85 | $0 * $1 86 | } 87 | } 88 | 89 | public prefix func -(left: Vector) -> Vector { 90 | return left * -1 91 | } 92 | 93 | public func *(left: Vector, right: Double) -> Vector { 94 | return Vector(x: left.x * right, y: left.y * right, z: left.z * right) 95 | } 96 | 97 | 98 | private func newVector(left left: Vector, right: Vector, closure: (Double, Double) -> Double) -> Vector { 99 | return Vector(x: closure(left.x, right.x), y: closure(left.y, right.y), z: closure(left.z, right.z)) 100 | } 101 | 102 | -------------------------------------------------------------------------------- /SwiftTracer/UI/SwiftTracer.MainViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Misc/Color.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Color.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | #if os(Linux) 10 | import Glibc 11 | #else 12 | import Darwin.C 13 | #endif 14 | 15 | public typealias Color = UInt32 16 | 17 | public extension Color { 18 | public static let Black = Color(r: 0.0, g: 0.0, b: 0.0) 19 | 20 | public var r: UInt8 { 21 | get { 22 | return UInt8((self & 0x000000FF) >> 0) 23 | } 24 | } 25 | 26 | public var g: UInt8 { 27 | get { 28 | return UInt8((self & 0x0000FF00) >> 8) 29 | } 30 | } 31 | 32 | public var b: UInt8 { 33 | get { 34 | return UInt8((self & 0x00FF0000) >> 16) 35 | } 36 | } 37 | 38 | public var a: UInt8 { 39 | get { 40 | return UInt8((self & 0xFF000000) >> 24) 41 | } 42 | } 43 | 44 | public var rd: Double { 45 | get { 46 | return Double(r) / 255.0 47 | } 48 | } 49 | 50 | public var gd: Double { 51 | get { 52 | return Double(g) / 255.0 53 | } 54 | } 55 | 56 | public var bd: Double { 57 | get { 58 | return Double(b) / 255.0 59 | } 60 | } 61 | 62 | 63 | public init(r: UInt8, g: UInt8, b: UInt8) { 64 | self = 0xFF000000 65 | self = self | UInt32(r) << 0 66 | self = self | UInt32(g) << 8 67 | self = self | UInt32(b) << 16 68 | } 69 | 70 | public init(r: Double, g: Double, b: Double) { 71 | let rNormalized = Color.clampValue(Int32(255.0 * r)) 72 | let gNormalized = Color.clampValue(Int32(255.0 * g)) 73 | let bNormalized = Color.clampValue(Int32(255.0 * b)) 74 | 75 | self.init(r: rNormalized, 76 | g: gNormalized, 77 | b: bNormalized) 78 | } 79 | 80 | public init(_ color: UInt32) { 81 | self = color 82 | } 83 | 84 | private static func clampValue(value: Int32) -> UInt8 { 85 | if value < 0 { 86 | return 0 87 | } 88 | 89 | if value > UINT8_MAX { 90 | return UInt8(UINT8_MAX) 91 | } 92 | 93 | return UInt8(value) 94 | } 95 | } 96 | 97 | 98 | public func *(left: Color, right: Double) -> Color { 99 | return Color(r: Color.clampValue(Int32(Double(left.r) * right)), 100 | g: Color.clampValue(Int32(Double(left.g) * right)), 101 | b: Color.clampValue(Int32(Double(left.b) * right))) 102 | } 103 | 104 | public func *(left: Color, right: Color) -> Color { 105 | return Color(r: left.rd * right.rd, g: left.gd * right.gd, b: left.bd * right.bd) 106 | } 107 | 108 | public func +(left: Color, right: Color) -> Color { 109 | return Color(r: Color.clampValue(Int32(left.r) + Int32(right.r)), g: Color.clampValue(Int32(left.g) + Int32(right.g)) , b: Color.clampValue(Int32(left.b) + Int32(right.b))) 110 | } 111 | 112 | 113 | public func -(left: Color, right: Color) -> Color { 114 | return Color(r: Color.clampValue(Int32(left.r) - Int32(right.r)), g: Color.clampValue(Int32(left.g) - Int32(right.g)) , b: Color.clampValue(Int32(left.b) - Int32(right.b))) 115 | } 116 | -------------------------------------------------------------------------------- /SwiftTracer/Controllers/Window Controllers/EditMaterialWindowController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EditMaterialWindowController.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 31/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import SwiftTracer_Core 11 | 12 | protocol EditMaterialWindowControllerDelegate: class { 13 | func editWindowWillClose() 14 | func renderSceneRequest() 15 | } 16 | 17 | 18 | private enum SliderTags: Int { 19 | case Ambient = 500 20 | case Diffuse = 501 21 | case Specular = 502 22 | case Reflective = 503 23 | } 24 | 25 | class EditMaterialWindowController: NSWindowController { 26 | weak var delegate: EditMaterialWindowControllerDelegate? = nil 27 | var material: Material! 28 | @IBOutlet weak var colorWell: NSColorWell! 29 | @IBOutlet weak var ambientSlider: NSSlider! 30 | @IBOutlet weak var diffuseSlider: NSSlider! 31 | @IBOutlet weak var specularSlider: NSSlider! 32 | @IBOutlet weak var reflectiveSlider: NSSlider! 33 | 34 | override init(window: NSWindow!) { 35 | super.init(window: window) 36 | } 37 | 38 | required init?(coder: NSCoder) { 39 | super.init(coder: coder) 40 | } 41 | 42 | convenience init(material: Material) { 43 | self.init(windowNibName: "SwiftTracer.EditMaterialWindowController") 44 | self.material = material 45 | } 46 | 47 | override func windowDidLoad() { 48 | super.windowDidLoad() 49 | window?.title = "Material properties" 50 | window?.delegate = self 51 | 52 | colorWell.color = NSColor(calibratedRed: CGFloat(material.color.rd), green: CGFloat(material.color.gd), blue: CGFloat(material.color.gd), alpha: 1.0) 53 | ambientSlider.doubleValue = material.ambientCoefficient 54 | diffuseSlider.doubleValue = material.diffuseCoefficient 55 | specularSlider.doubleValue = material.specularCoefficient 56 | reflectiveSlider.doubleValue = material.reflectionCoefficient 57 | } 58 | 59 | @IBAction func didChangeColor(sender: AnyObject) { 60 | let c = sender as! NSColorWell 61 | let color = c.color 62 | material.color = Color(r: Double(color.redComponent), g: Double(color.greenComponent), b: Double(color.blueComponent)) 63 | } 64 | 65 | @IBAction func sliderDidChangeValue(sender: AnyObject) { 66 | let s = sender as! NSSlider 67 | 68 | switch s.tag { 69 | case SliderTags.Ambient.rawValue: 70 | material.ambientCoefficient = s.doubleValue 71 | case SliderTags.Diffuse.rawValue: 72 | material.diffuseCoefficient = s.doubleValue 73 | case SliderTags.Specular.rawValue: 74 | material.specularCoefficient = s.doubleValue 75 | case SliderTags.Reflective.rawValue: 76 | material.reflectionCoefficient = s.doubleValue 77 | default: break 78 | } 79 | } 80 | @IBAction func didTapRenderScene(sender: AnyObject) { 81 | guard let d = delegate else { 82 | return 83 | } 84 | 85 | d.renderSceneRequest() 86 | } 87 | } 88 | 89 | extension EditMaterialWindowController: NSWindowDelegate { 90 | func windowWillClose(notification: NSNotification) { 91 | guard let d = delegate else { 92 | return 93 | } 94 | 95 | d.editWindowWillClose() 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /SwiftTracer/Controllers/View Controllers/MainViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import SwiftTracer_Core 11 | 12 | class MainViewController: NSViewController { 13 | var materialEditWindow: EditMaterialWindowController? 14 | var renderer: Renderer? 15 | @IBOutlet weak var pixelView: PixelRenderView! 16 | @IBOutlet weak var activityIndicator: NSProgressIndicator! 17 | 18 | init?(renderer: Renderer) { 19 | self.renderer = renderer 20 | super.init(nibName: nil, bundle: nil) 21 | } 22 | 23 | required init?(coder: NSCoder) { 24 | super.init(coder: coder) 25 | } 26 | 27 | override func viewDidLoad() { 28 | super.viewDidLoad() 29 | 30 | pixelView.delegate = self 31 | renderer!.delegate = self 32 | renderer!.render() 33 | activityIndicator.startAnimation(nil) 34 | // Do view setup here. 35 | } 36 | 37 | private func startRendering() { 38 | pixelView.hidden = true 39 | activityIndicator.hidden = false 40 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0)) { 41 | self.renderer!.render() 42 | } 43 | } 44 | } 45 | 46 | extension MainViewController : NSWindowDelegate { 47 | func windowDidResize(notification: NSNotification) { 48 | view.frame = (view.window?.contentView?.bounds)! 49 | pixelView!.frame = view.bounds 50 | 51 | renderer!.camera = renderer!.camera.cameraWithNewResolution(newWidth: Int(self.view.frame.width), newHeight: Int(self.view.frame.height)) 52 | renderer!.abortRendering() 53 | startRendering() 54 | } 55 | } 56 | 57 | extension MainViewController : RendererDelegate { 58 | func didFinishRendering(pixels: [Color], duration: NSTimeInterval) { 59 | NSLog("Rendering took \(duration) seconds") 60 | dispatch_async(dispatch_get_main_queue()) { 61 | if let pv = self.pixelView { 62 | pv.pixels = pixels 63 | pv.setNeedsDisplayInRect(pv.bounds) 64 | self.activityIndicator.hidden = true 65 | self.pixelView.hidden = false 66 | } 67 | } 68 | } 69 | } 70 | 71 | extension MainViewController : PixelRenderViewDelegate { 72 | func rightMouseClickedAt(x x: CGFloat, y: CGFloat, event: NSEvent) { 73 | guard let r = renderer else { 74 | return 75 | } 76 | 77 | let ray = r.camera.createRay(x: Int(x), y: Int(y)) 78 | let hit = r.scene.intersect(ray) 79 | 80 | guard let h = hit else { 81 | return 82 | } 83 | 84 | let menu = NSMenu(title: "") 85 | let item = NSMenuItem(title: "Edit Material", action: Selector("editMaterial:"), keyEquivalent: "") 86 | item.representedObject = h as AnyObject 87 | item.target = self 88 | menu.addItem(item) 89 | 90 | NSMenu.popUpContextMenu(menu, withEvent: event, forView: pixelView) 91 | } 92 | 93 | internal func editMaterial(sender: NSMenuItem) { 94 | guard let intersection = sender.representedObject as! Intersection? else { 95 | assert(false, "editMaterial: expects sender.representedObject to be of type Intersection") 96 | return 97 | } 98 | 99 | materialEditWindow = EditMaterialWindowController(material: intersection.shape.material) 100 | materialEditWindow!.showWindow(self) 101 | view.window?.makeKeyAndOrderFront(materialEditWindow!.window) 102 | materialEditWindow!.window?.makeKeyWindow() 103 | materialEditWindow!.delegate = self 104 | } 105 | } 106 | 107 | extension MainViewController: EditMaterialWindowControllerDelegate { 108 | func editWindowWillClose() { 109 | renderer!.abortRendering() 110 | startRendering() 111 | } 112 | 113 | func renderSceneRequest() { 114 | renderer!.abortRendering() 115 | startRendering() 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /SwiftTracer/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import SwiftTracer_Core 11 | 12 | @NSApplicationMain 13 | class AppDelegate: NSObject, NSApplicationDelegate { 14 | 15 | @IBOutlet weak var window: NSWindow! 16 | var mainController: MainViewController? 17 | 18 | func applicationDidFinishLaunching(aNotification: NSNotification) { 19 | if let contentView = window.contentView { 20 | let width = Int(contentView.frame.size.width) 21 | let height = Int(contentView.frame.size.height) 22 | let camera = Camera(fov: 0.785398163, width: width, height: height) 23 | mainController = MainViewController(renderer: Renderer(scene: buildScene(), camera: camera, maxDepth: 20)) 24 | // This is veeeeery slow 25 | mainController?.renderer?.superSampling = .On(2) 26 | window.delegate = mainController 27 | 28 | window.contentView?.addSubview(mainController!.view) 29 | mainController!.view.frame = contentView.bounds 30 | } 31 | } 32 | 33 | func applicationWillTerminate(aNotification: NSNotification) { 34 | // Insert code here to tear down your application 35 | } 36 | 37 | private func buildScene() -> Scene { 38 | let wallMaterial = Material(color: Color(r: 1.0, g: 1.0, b: 1.0), 39 | ambientCoefficient: 0.6, 40 | diffuseCoefficient: 0.3) 41 | let floor = Plane(position: Vector(x: 0.0, y: -1.0, z: 0.0), normal: Vector(x: 0.0, y: 1.0, z: 0.0), material: wallMaterial.copy()) 42 | let frontWall = Plane(position: Vector(x: 0.0, y: 0.0, z: 50.0), normal: Vector(x: 0.0, y: 0.0, z: -1.0), material: wallMaterial.copy()) 43 | let roof = Plane(position: Vector(x: 0.0, y: 15.0, z: 0.0), normal: Vector(x: 0.0, y: -1.0, z: 0.0), material: wallMaterial.copy()) 44 | 45 | // rgb(7%, 32%, 57%) 46 | let leftWallMaterial = Material(color: Color(r: 0.07, g: 0.32, b: 0.57), 47 | ambientCoefficient: 0.6, 48 | diffuseCoefficient: 0.3) 49 | let leftWall = Plane(position: Vector(x: -7.0, y: 0.0, z: 0.0), normal: Vector(x: 1.0, y: 0.0, z: 0.0), material: leftWallMaterial) 50 | 51 | let backWallMaterial = Material(color: Color.Black, 52 | ambientCoefficient: 0.0, 53 | diffuseCoefficient: 0.0) 54 | let backWall = Plane(position: Vector(x: 0.0, y: 0.0, z: -1), normal: Vector(x: 0.0, y: 0.0, z: 1.0), material: backWallMaterial) 55 | 56 | // rgb(57%, 7%, 7%) 57 | let rightWallMaterial = Material(color: Color(r: 0.7, g: 0.32, b: 0.57), 58 | ambientCoefficient: 0.6, 59 | diffuseCoefficient: 0.3) 60 | let rightWall = Plane(position: Vector(x: 7.0, y: 0.0, z: 0.0), normal: Vector(x: -1.0, y: 0.0, z: 0.0), material: rightWallMaterial) 61 | 62 | let reflectiveMaterial = Material(color: Color.Black, 63 | ambientCoefficient: 0.6, 64 | diffuseCoefficient: 0.3, 65 | specularCoefficient: 0.4, 66 | reflectionCoefficient: 0.6, 67 | refractionCoefficient: nil) 68 | let s1 = Sphere(radius: 0.5, center: Vector(x: -1.5, y: 0.0, z: 10.0), material: reflectiveMaterial) 69 | 70 | let refractiveMaterial = Material(color: Color(r: 1.0, g: 1.0, b: 1.0), 71 | ambientCoefficient: 0.0, 72 | diffuseCoefficient: 0.4, 73 | specularCoefficient: 0.4, 74 | reflectionCoefficient: 0.0, 75 | refractionCoefficient: 1.5) 76 | let s2 = Sphere(radius: 0.5, center: Vector(x: -0.6, y: 0.6, z: 8.0), material: refractiveMaterial) 77 | 78 | let greenMaterial = Material(color: Color(r: 0.1, g: 0.74, b: 0.23), ambientCoefficient: 0.5, diffuseCoefficient: 0.3, specularCoefficient: 0.0, reflectionCoefficient: 0.0, refractionCoefficient: nil) 79 | let s3 = Sphere(radius: 0.5, center: Vector(x: 0.0, y: 1.2, z: 12.0), material: greenMaterial) 80 | 81 | let light = PointLight(color: Color(r: 1.0, g: 1.0, b: 1.0), position: Vector(x: 0, y: 10, z: 8), intensity: 0.6) 82 | 83 | return Scene(objects: [floor, roof, frontWall, leftWall, rightWall, backWall, s1, s2, s3], lights: [light], clearColor: Color.Black) 84 | } 85 | } 86 | 87 | 88 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /Pods/SwiftTracer-Core/Sources/Misc/Renderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Renderer.swift 3 | // SwiftTracer 4 | // 5 | // Created by Hugo Tunius on 09/08/15. 6 | // Copyright © 2015 Hugo Tunius. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | #if os(Linux) 12 | import Glibc 13 | #else 14 | import Darwin.C 15 | #endif 16 | 17 | public protocol RendererDelegate { 18 | func didFinishRendering(pixels: [Color], duration: NSTimeInterval) 19 | } 20 | 21 | public enum SuperSampling { 22 | case Off 23 | // Number of samples per dimensions 24 | // Example: On(4) is 4x4, 4 samples for x and 4 for y 25 | case On(UInt) 26 | } 27 | 28 | public struct Renderer { 29 | private static let epsilon: Double = 1e-12 30 | public let scene: Scene 31 | public let maxDepth: Int 32 | public var camera: Camera 33 | public var pixels: [Color] 34 | public var delegate: RendererDelegate? 35 | public var superSampling: SuperSampling { 36 | didSet { 37 | switch superSampling { 38 | case .Off: 39 | samplesPerPixel = 1 40 | case .On(let samplesPerPixel): 41 | self.samplesPerPixel = samplesPerPixel 42 | } 43 | } 44 | } 45 | private var startTime: NSDate = NSDate() 46 | private var samplesPerPixel: UInt 47 | private var isRendering = false 48 | 49 | public init(scene: Scene, camera: Camera, maxDepth: Int) { 50 | self.scene = scene 51 | self.camera = camera 52 | self.pixels = [] 53 | self.maxDepth = maxDepth 54 | self.superSampling = .Off 55 | self.samplesPerPixel = 1 56 | } 57 | 58 | public mutating func render() { 59 | isRendering = true 60 | var result: [Color] = Array(count: camera.width * camera.height, repeatedValue: scene.clearColor) 61 | startTime = NSDate() 62 | 63 | 64 | for y in 0.. result.count { 80 | // HACK: When isRendering is turned off in another 81 | // thread the next line might still cause an index out of bounds 82 | // error. This fixes the problem slightly, but it's a 83 | // horrible solution. 84 | // TODO: Think of a better way to deal with interupting rendering 85 | // midway and doing rendering in the background 86 | return 87 | } 88 | var avgR = 0.0 89 | var avgG = 0.0 90 | var avgB = 0.0 91 | 92 | for c in colors { 93 | avgR += c.rd 94 | avgG += c.gd 95 | avgB += c.bd 96 | } 97 | 98 | result[index] = Color(r: avgR / Double(colors.count), 99 | g: avgG / Double(colors.count), 100 | b: avgB / Double(colors.count)) 101 | } 102 | } 103 | 104 | pixels = result 105 | 106 | if let d = delegate { 107 | let duration = NSDate().timeIntervalSinceDate(startTime) 108 | d.didFinishRendering(pixels, duration: duration) 109 | } 110 | isRendering = false 111 | } 112 | 113 | public mutating func abortRendering() { 114 | isRendering = false 115 | } 116 | 117 | private mutating func traceRay(ray: Ray, depth: Int) -> Color { 118 | if depth == 0 { 119 | return Color.Black 120 | } 121 | 122 | var result = scene.clearColor 123 | let closestHit = scene.intersect(ray) 124 | 125 | if let hit = closestHit { 126 | result = shade(hit, originalRay: ray) 127 | if hit.shape.material.isReflective { 128 | result = result + calculateReflection(hit, originalRay: ray, currentDepth: depth) 129 | } 130 | 131 | if let refractionCoefficient = hit.shape.material.refractionCoefficient { 132 | result = result + calculateRefraction(refractionCoefficient, hit: hit, originalRay: ray, currentDepth: depth) 133 | } 134 | } 135 | 136 | 137 | return result 138 | } 139 | 140 | private func shade(intersection: Intersection, originalRay: Ray) -> Color { 141 | let material = intersection.shape.material 142 | var result = material.color * material.ambientCoefficient 143 | 144 | for light in scene.lights { 145 | var inShadow = false 146 | let distanceToLight = (intersection.point - light.position).length() 147 | let lightDirection = (light.position - intersection.point).normalize() 148 | let ray = Ray(origin: intersection.point + lightDirection * Renderer.epsilon, 149 | direction: lightDirection) 150 | 151 | for object in scene.objects { 152 | if let hit = object.intersectWithRay(ray) where hit.t < distanceToLight { 153 | inShadow = true 154 | break 155 | } 156 | } 157 | 158 | let lightColor = light.color * light.intensity 159 | var dot = lightDirection.dot(intersection.normal) 160 | if dot > 0 && !inShadow { 161 | result = result + lightColor * (dot * material.diffuseCoefficient) 162 | } 163 | 164 | dot = originalRay.direction.dot(lightDirection.reflect(intersection.normal)) 165 | if dot > 0 && !inShadow { 166 | let spec = pow(dot, 20) * material.specularCoefficient 167 | result = result + lightColor * spec 168 | } 169 | } 170 | return result 171 | } 172 | 173 | private mutating func calculateReflection(hit: Intersection, originalRay: Ray, currentDepth: Int) -> Color { 174 | let newDirection = originalRay.direction.reflect(hit.normal).normalize() 175 | let newRay = Ray(origin: hit.point + hit.point * newDirection * Renderer.epsilon, 176 | direction: newDirection) 177 | let reflectiveColor = traceRay(newRay, depth: currentDepth - 1) 178 | return reflectiveColor * hit.shape.material.reflectionCoefficient 179 | } 180 | 181 | private mutating func calculateRefraction(refractionCoefficient: Double, hit: Intersection, originalRay: Ray, currentDepth: Int) -> Color { 182 | var rCoeff = refractionCoefficient 183 | if hit.inside { // Leaving refractive material 184 | rCoeff = 1.0 185 | } 186 | let n = originalRay.mediumRefractionIndex / rCoeff 187 | var N = hit.normal 188 | if hit.inside { 189 | N = -N 190 | } 191 | let cosI = (N.dot(originalRay.direction)) 192 | let c2 = 1.0 - n * n * (1.0 - cosI * cosI) 193 | if c2 > 0.0 { 194 | let T = (originalRay.direction * n + N * (n * cosI - sqrt(c2))).normalize() 195 | let newRay = Ray(origin: hit.point + hit.point * T * Renderer.epsilon, 196 | direction: T, 197 | mediumRefractionIndex: rCoeff) 198 | let refractionColor = traceRay(newRay, depth: currentDepth - 1) 199 | let absorbance = hit.shape.material.color * 0.15 * -hit.t 200 | let transparency = Color(r: exp(absorbance.rd), g: exp(absorbance.gd), b: exp(absorbance.bd)) 201 | return refractionColor * transparency 202 | } 203 | 204 | return Color.Black 205 | } 206 | } 207 | -------------------------------------------------------------------------------- /SwiftTracer/UI/SwiftTracer.EditMaterialWindowController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | -------------------------------------------------------------------------------- /SwiftTracer.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 022257EEE959F98A4B88698C /* Pods_SwiftTracer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39DBE398AEE7B4E74343A282 /* Pods_SwiftTracer.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 11 | D64F04AF1B9481D700E4B4BE /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D64F04AE1B9481D700E4B4BE /* MainViewController.swift */; }; 12 | D64F04B21B94829100E4B4BE /* EditMaterialWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D64F04B11B94829100E4B4BE /* EditMaterialWindowController.swift */; }; 13 | D64F04B51B9482B500E4B4BE /* SwiftTracer.MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D64F04B41B9482B500E4B4BE /* SwiftTracer.MainViewController.xib */; }; 14 | D64F04B71B94832100E4B4BE /* SwiftTracer.EditMaterialWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D64F04B61B94832100E4B4BE /* SwiftTracer.EditMaterialWindowController.xib */; }; 15 | D65F16E41B77B5D200866F61 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D65F16E31B77B5D200866F61 /* AppDelegate.swift */; }; 16 | D65F16E61B77B5D200866F61 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D65F16E51B77B5D200866F61 /* Assets.xcassets */; }; 17 | D65F16E91B77B5D200866F61 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = D65F16E71B77B5D200866F61 /* MainMenu.xib */; }; 18 | D65F17191B77D09800866F61 /* PixelRenderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D65F17181B77D09800866F61 /* PixelRenderView.swift */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | D65F16F01B77B5D200866F61 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = D65F16D81B77B5D200866F61 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = D65F16DF1B77B5D200866F61; 27 | remoteInfo = SwiftTracer; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 23105C873D60711CC26036C6 /* Pods-SwiftTracer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftTracer.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer.release.xcconfig"; sourceTree = ""; }; 33 | 39DBE398AEE7B4E74343A282 /* Pods_SwiftTracer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftTracer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 96C6502E9AB4C8A6E709E74C /* Pods-SwiftTracer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftTracer.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer.debug.xcconfig"; sourceTree = ""; }; 35 | D64F04AE1B9481D700E4B4BE /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; 36 | D64F04B11B94829100E4B4BE /* EditMaterialWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditMaterialWindowController.swift; sourceTree = ""; }; 37 | D64F04B41B9482B500E4B4BE /* SwiftTracer.MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SwiftTracer.MainViewController.xib; sourceTree = ""; }; 38 | D64F04B61B94832100E4B4BE /* SwiftTracer.EditMaterialWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SwiftTracer.EditMaterialWindowController.xib; sourceTree = ""; }; 39 | D65F16E01B77B5D200866F61 /* SwiftTracer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftTracer.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | D65F16E31B77B5D200866F61 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 41 | D65F16E51B77B5D200866F61 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 42 | D65F16E81B77B5D200866F61 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 43 | D65F16EA1B77B5D200866F61 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | D65F16EF1B77B5D200866F61 /* SwiftTracerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftTracerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | D65F16F51B77B5D200866F61 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | D65F17181B77D09800866F61 /* PixelRenderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PixelRenderView.swift; sourceTree = ""; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | D65F16DD1B77B5D200866F61 /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | 022257EEE959F98A4B88698C /* Pods_SwiftTracer.framework in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | D65F16EC1B77B5D200866F61 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 4C6DDDFE5E93CBC831BEAC56 /* Frameworks */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 39DBE398AEE7B4E74343A282 /* Pods_SwiftTracer.framework */, 72 | ); 73 | name = Frameworks; 74 | sourceTree = ""; 75 | }; 76 | 9BC56728AC1C24DD3811BE92 /* Pods */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 96C6502E9AB4C8A6E709E74C /* Pods-SwiftTracer.debug.xcconfig */, 80 | 23105C873D60711CC26036C6 /* Pods-SwiftTracer.release.xcconfig */, 81 | ); 82 | name = Pods; 83 | sourceTree = ""; 84 | }; 85 | D64F04AA1B94819D00E4B4BE /* Controllers */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | D64F04B01B94827100E4B4BE /* Window Controllers */, 89 | D64F04AD1B9481CD00E4B4BE /* View Controllers */, 90 | ); 91 | path = Controllers; 92 | sourceTree = ""; 93 | }; 94 | D64F04AD1B9481CD00E4B4BE /* View Controllers */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | D64F04AE1B9481D700E4B4BE /* MainViewController.swift */, 98 | ); 99 | path = "View Controllers"; 100 | sourceTree = ""; 101 | }; 102 | D64F04B01B94827100E4B4BE /* Window Controllers */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | D64F04B11B94829100E4B4BE /* EditMaterialWindowController.swift */, 106 | ); 107 | path = "Window Controllers"; 108 | sourceTree = ""; 109 | }; 110 | D64F04B31B94829C00E4B4BE /* UI */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | D64F04B61B94832100E4B4BE /* SwiftTracer.EditMaterialWindowController.xib */, 114 | D64F04B41B9482B500E4B4BE /* SwiftTracer.MainViewController.xib */, 115 | ); 116 | path = UI; 117 | sourceTree = ""; 118 | }; 119 | D65F16D71B77B5D200866F61 = { 120 | isa = PBXGroup; 121 | children = ( 122 | D65F16E21B77B5D200866F61 /* SwiftTracer */, 123 | D65F16F21B77B5D200866F61 /* SwiftTracerTests */, 124 | D65F16E11B77B5D200866F61 /* Products */, 125 | 9BC56728AC1C24DD3811BE92 /* Pods */, 126 | 4C6DDDFE5E93CBC831BEAC56 /* Frameworks */, 127 | ); 128 | sourceTree = ""; 129 | }; 130 | D65F16E11B77B5D200866F61 /* Products */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | D65F16E01B77B5D200866F61 /* SwiftTracer.app */, 134 | D65F16EF1B77B5D200866F61 /* SwiftTracerTests.xctest */, 135 | ); 136 | name = Products; 137 | sourceTree = ""; 138 | }; 139 | D65F16E21B77B5D200866F61 /* SwiftTracer */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | D64F04B31B94829C00E4B4BE /* UI */, 143 | D64F04AA1B94819D00E4B4BE /* Controllers */, 144 | D65F17171B77D08200866F61 /* Views */, 145 | D65F16E31B77B5D200866F61 /* AppDelegate.swift */, 146 | D65F16E51B77B5D200866F61 /* Assets.xcassets */, 147 | D65F16E71B77B5D200866F61 /* MainMenu.xib */, 148 | D65F16EA1B77B5D200866F61 /* Info.plist */, 149 | ); 150 | path = SwiftTracer; 151 | sourceTree = ""; 152 | }; 153 | D65F16F21B77B5D200866F61 /* SwiftTracerTests */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | D65F16F51B77B5D200866F61 /* Info.plist */, 157 | ); 158 | path = SwiftTracerTests; 159 | sourceTree = ""; 160 | }; 161 | D65F17171B77D08200866F61 /* Views */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | D65F17181B77D09800866F61 /* PixelRenderView.swift */, 165 | ); 166 | path = Views; 167 | sourceTree = ""; 168 | }; 169 | /* End PBXGroup section */ 170 | 171 | /* Begin PBXNativeTarget section */ 172 | D65F16DF1B77B5D200866F61 /* SwiftTracer */ = { 173 | isa = PBXNativeTarget; 174 | buildConfigurationList = D65F16F81B77B5D200866F61 /* Build configuration list for PBXNativeTarget "SwiftTracer" */; 175 | buildPhases = ( 176 | EFEBAB36CAB6062163C64D86 /* Check Pods Manifest.lock */, 177 | D65F16DC1B77B5D200866F61 /* Sources */, 178 | D65F16DD1B77B5D200866F61 /* Frameworks */, 179 | D65F16DE1B77B5D200866F61 /* Resources */, 180 | 77E9E0B7C0CD6F445A6DA053 /* Embed Pods Frameworks */, 181 | 57834604344EDFE4AEC46151 /* Copy Pods Resources */, 182 | ); 183 | buildRules = ( 184 | ); 185 | dependencies = ( 186 | ); 187 | name = SwiftTracer; 188 | productName = SwiftTracer; 189 | productReference = D65F16E01B77B5D200866F61 /* SwiftTracer.app */; 190 | productType = "com.apple.product-type.application"; 191 | }; 192 | D65F16EE1B77B5D200866F61 /* SwiftTracerTests */ = { 193 | isa = PBXNativeTarget; 194 | buildConfigurationList = D65F16FB1B77B5D200866F61 /* Build configuration list for PBXNativeTarget "SwiftTracerTests" */; 195 | buildPhases = ( 196 | D65F16EB1B77B5D200866F61 /* Sources */, 197 | D65F16EC1B77B5D200866F61 /* Frameworks */, 198 | D65F16ED1B77B5D200866F61 /* Resources */, 199 | ); 200 | buildRules = ( 201 | ); 202 | dependencies = ( 203 | D65F16F11B77B5D200866F61 /* PBXTargetDependency */, 204 | ); 205 | name = SwiftTracerTests; 206 | productName = SwiftTracerTests; 207 | productReference = D65F16EF1B77B5D200866F61 /* SwiftTracerTests.xctest */; 208 | productType = "com.apple.product-type.bundle.unit-test"; 209 | }; 210 | /* End PBXNativeTarget section */ 211 | 212 | /* Begin PBXProject section */ 213 | D65F16D81B77B5D200866F61 /* Project object */ = { 214 | isa = PBXProject; 215 | attributes = { 216 | LastSwiftUpdateCheck = 0710; 217 | LastUpgradeCheck = 0700; 218 | ORGANIZATIONNAME = "Hugo Tunius"; 219 | TargetAttributes = { 220 | D65F16DF1B77B5D200866F61 = { 221 | CreatedOnToolsVersion = 7.0; 222 | }; 223 | D65F16EE1B77B5D200866F61 = { 224 | CreatedOnToolsVersion = 7.0; 225 | TestTargetID = D65F16DF1B77B5D200866F61; 226 | }; 227 | }; 228 | }; 229 | buildConfigurationList = D65F16DB1B77B5D200866F61 /* Build configuration list for PBXProject "SwiftTracer" */; 230 | compatibilityVersion = "Xcode 3.2"; 231 | developmentRegion = English; 232 | hasScannedForEncodings = 0; 233 | knownRegions = ( 234 | en, 235 | Base, 236 | ); 237 | mainGroup = D65F16D71B77B5D200866F61; 238 | productRefGroup = D65F16E11B77B5D200866F61 /* Products */; 239 | projectDirPath = ""; 240 | projectRoot = ""; 241 | targets = ( 242 | D65F16DF1B77B5D200866F61 /* SwiftTracer */, 243 | D65F16EE1B77B5D200866F61 /* SwiftTracerTests */, 244 | ); 245 | }; 246 | /* End PBXProject section */ 247 | 248 | /* Begin PBXResourcesBuildPhase section */ 249 | D65F16DE1B77B5D200866F61 /* Resources */ = { 250 | isa = PBXResourcesBuildPhase; 251 | buildActionMask = 2147483647; 252 | files = ( 253 | D64F04B71B94832100E4B4BE /* SwiftTracer.EditMaterialWindowController.xib in Resources */, 254 | D65F16E61B77B5D200866F61 /* Assets.xcassets in Resources */, 255 | D65F16E91B77B5D200866F61 /* MainMenu.xib in Resources */, 256 | D64F04B51B9482B500E4B4BE /* SwiftTracer.MainViewController.xib in Resources */, 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | D65F16ED1B77B5D200866F61 /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | /* End PBXResourcesBuildPhase section */ 268 | 269 | /* Begin PBXShellScriptBuildPhase section */ 270 | 57834604344EDFE4AEC46151 /* Copy Pods Resources */ = { 271 | isa = PBXShellScriptBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | ); 275 | inputPaths = ( 276 | ); 277 | name = "Copy Pods Resources"; 278 | outputPaths = ( 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | shellPath = /bin/sh; 282 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer-resources.sh\"\n"; 283 | showEnvVarsInLog = 0; 284 | }; 285 | 77E9E0B7C0CD6F445A6DA053 /* Embed Pods Frameworks */ = { 286 | isa = PBXShellScriptBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | ); 290 | inputPaths = ( 291 | ); 292 | name = "Embed Pods Frameworks"; 293 | outputPaths = ( 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | shellPath = /bin/sh; 297 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer-frameworks.sh\"\n"; 298 | showEnvVarsInLog = 0; 299 | }; 300 | EFEBAB36CAB6062163C64D86 /* Check Pods Manifest.lock */ = { 301 | isa = PBXShellScriptBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | ); 305 | inputPaths = ( 306 | ); 307 | name = "Check Pods Manifest.lock"; 308 | outputPaths = ( 309 | ); 310 | runOnlyForDeploymentPostprocessing = 0; 311 | shellPath = /bin/sh; 312 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 313 | showEnvVarsInLog = 0; 314 | }; 315 | /* End PBXShellScriptBuildPhase section */ 316 | 317 | /* Begin PBXSourcesBuildPhase section */ 318 | D65F16DC1B77B5D200866F61 /* Sources */ = { 319 | isa = PBXSourcesBuildPhase; 320 | buildActionMask = 2147483647; 321 | files = ( 322 | D65F16E41B77B5D200866F61 /* AppDelegate.swift in Sources */, 323 | D65F17191B77D09800866F61 /* PixelRenderView.swift in Sources */, 324 | D64F04B21B94829100E4B4BE /* EditMaterialWindowController.swift in Sources */, 325 | D64F04AF1B9481D700E4B4BE /* MainViewController.swift in Sources */, 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | }; 329 | D65F16EB1B77B5D200866F61 /* Sources */ = { 330 | isa = PBXSourcesBuildPhase; 331 | buildActionMask = 2147483647; 332 | files = ( 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | }; 336 | /* End PBXSourcesBuildPhase section */ 337 | 338 | /* Begin PBXTargetDependency section */ 339 | D65F16F11B77B5D200866F61 /* PBXTargetDependency */ = { 340 | isa = PBXTargetDependency; 341 | target = D65F16DF1B77B5D200866F61 /* SwiftTracer */; 342 | targetProxy = D65F16F01B77B5D200866F61 /* PBXContainerItemProxy */; 343 | }; 344 | /* End PBXTargetDependency section */ 345 | 346 | /* Begin PBXVariantGroup section */ 347 | D65F16E71B77B5D200866F61 /* MainMenu.xib */ = { 348 | isa = PBXVariantGroup; 349 | children = ( 350 | D65F16E81B77B5D200866F61 /* Base */, 351 | ); 352 | name = MainMenu.xib; 353 | sourceTree = ""; 354 | }; 355 | /* End PBXVariantGroup section */ 356 | 357 | /* Begin XCBuildConfiguration section */ 358 | D65F16F61B77B5D200866F61 /* Debug */ = { 359 | isa = XCBuildConfiguration; 360 | buildSettings = { 361 | ALWAYS_SEARCH_USER_PATHS = NO; 362 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 363 | CLANG_CXX_LIBRARY = "libc++"; 364 | CLANG_ENABLE_MODULES = YES; 365 | CLANG_ENABLE_OBJC_ARC = YES; 366 | CLANG_WARN_BOOL_CONVERSION = YES; 367 | CLANG_WARN_CONSTANT_CONVERSION = YES; 368 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 369 | CLANG_WARN_EMPTY_BODY = YES; 370 | CLANG_WARN_ENUM_CONVERSION = YES; 371 | CLANG_WARN_INT_CONVERSION = YES; 372 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 373 | CLANG_WARN_UNREACHABLE_CODE = YES; 374 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 375 | CODE_SIGN_IDENTITY = "-"; 376 | COPY_PHASE_STRIP = NO; 377 | DEBUG_INFORMATION_FORMAT = dwarf; 378 | ENABLE_STRICT_OBJC_MSGSEND = YES; 379 | ENABLE_TESTABILITY = YES; 380 | GCC_C_LANGUAGE_STANDARD = gnu99; 381 | GCC_DYNAMIC_NO_PIC = NO; 382 | GCC_NO_COMMON_BLOCKS = YES; 383 | GCC_OPTIMIZATION_LEVEL = 0; 384 | GCC_PREPROCESSOR_DEFINITIONS = ( 385 | "DEBUG=1", 386 | "$(inherited)", 387 | ); 388 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 389 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 390 | GCC_WARN_UNDECLARED_SELECTOR = YES; 391 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 392 | GCC_WARN_UNUSED_FUNCTION = YES; 393 | GCC_WARN_UNUSED_VARIABLE = YES; 394 | MACOSX_DEPLOYMENT_TARGET = 10.10; 395 | MTL_ENABLE_DEBUG_INFO = YES; 396 | ONLY_ACTIVE_ARCH = YES; 397 | SDKROOT = macosx; 398 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 399 | }; 400 | name = Debug; 401 | }; 402 | D65F16F71B77B5D200866F61 /* Release */ = { 403 | isa = XCBuildConfiguration; 404 | buildSettings = { 405 | ALWAYS_SEARCH_USER_PATHS = NO; 406 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 407 | CLANG_CXX_LIBRARY = "libc++"; 408 | CLANG_ENABLE_MODULES = YES; 409 | CLANG_ENABLE_OBJC_ARC = YES; 410 | CLANG_WARN_BOOL_CONVERSION = YES; 411 | CLANG_WARN_CONSTANT_CONVERSION = YES; 412 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 413 | CLANG_WARN_EMPTY_BODY = YES; 414 | CLANG_WARN_ENUM_CONVERSION = YES; 415 | CLANG_WARN_INT_CONVERSION = YES; 416 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 417 | CLANG_WARN_UNREACHABLE_CODE = YES; 418 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 419 | CODE_SIGN_IDENTITY = "-"; 420 | COPY_PHASE_STRIP = NO; 421 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 422 | ENABLE_NS_ASSERTIONS = NO; 423 | ENABLE_STRICT_OBJC_MSGSEND = YES; 424 | GCC_C_LANGUAGE_STANDARD = gnu99; 425 | GCC_NO_COMMON_BLOCKS = YES; 426 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 427 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 428 | GCC_WARN_UNDECLARED_SELECTOR = YES; 429 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 430 | GCC_WARN_UNUSED_FUNCTION = YES; 431 | GCC_WARN_UNUSED_VARIABLE = YES; 432 | MACOSX_DEPLOYMENT_TARGET = 10.10; 433 | MTL_ENABLE_DEBUG_INFO = NO; 434 | SDKROOT = macosx; 435 | }; 436 | name = Release; 437 | }; 438 | D65F16F91B77B5D200866F61 /* Debug */ = { 439 | isa = XCBuildConfiguration; 440 | baseConfigurationReference = 96C6502E9AB4C8A6E709E74C /* Pods-SwiftTracer.debug.xcconfig */; 441 | buildSettings = { 442 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 443 | COMBINE_HIDPI_IMAGES = YES; 444 | INFOPLIST_FILE = SwiftTracer/Info.plist; 445 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 446 | PRODUCT_BUNDLE_IDENTIFIER = org.hugotunius.SwiftTracer; 447 | PRODUCT_NAME = "$(TARGET_NAME)"; 448 | }; 449 | name = Debug; 450 | }; 451 | D65F16FA1B77B5D200866F61 /* Release */ = { 452 | isa = XCBuildConfiguration; 453 | baseConfigurationReference = 23105C873D60711CC26036C6 /* Pods-SwiftTracer.release.xcconfig */; 454 | buildSettings = { 455 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 456 | COMBINE_HIDPI_IMAGES = YES; 457 | GCC_OPTIMIZATION_LEVEL = fast; 458 | INFOPLIST_FILE = SwiftTracer/Info.plist; 459 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 460 | PRODUCT_BUNDLE_IDENTIFIER = org.hugotunius.SwiftTracer; 461 | PRODUCT_NAME = "$(TARGET_NAME)"; 462 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 463 | }; 464 | name = Release; 465 | }; 466 | D65F16FC1B77B5D200866F61 /* Debug */ = { 467 | isa = XCBuildConfiguration; 468 | buildSettings = { 469 | BUNDLE_LOADER = "$(TEST_HOST)"; 470 | COMBINE_HIDPI_IMAGES = YES; 471 | INFOPLIST_FILE = SwiftTracerTests/Info.plist; 472 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 473 | PRODUCT_BUNDLE_IDENTIFIER = org.hugotunius.SwiftTracerTests; 474 | PRODUCT_NAME = "$(TARGET_NAME)"; 475 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftTracer.app/Contents/MacOS/SwiftTracer"; 476 | }; 477 | name = Debug; 478 | }; 479 | D65F16FD1B77B5D200866F61 /* Release */ = { 480 | isa = XCBuildConfiguration; 481 | buildSettings = { 482 | BUNDLE_LOADER = "$(TEST_HOST)"; 483 | COMBINE_HIDPI_IMAGES = YES; 484 | INFOPLIST_FILE = SwiftTracerTests/Info.plist; 485 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 486 | PRODUCT_BUNDLE_IDENTIFIER = org.hugotunius.SwiftTracerTests; 487 | PRODUCT_NAME = "$(TARGET_NAME)"; 488 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftTracer.app/Contents/MacOS/SwiftTracer"; 489 | }; 490 | name = Release; 491 | }; 492 | /* End XCBuildConfiguration section */ 493 | 494 | /* Begin XCConfigurationList section */ 495 | D65F16DB1B77B5D200866F61 /* Build configuration list for PBXProject "SwiftTracer" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | D65F16F61B77B5D200866F61 /* Debug */, 499 | D65F16F71B77B5D200866F61 /* Release */, 500 | ); 501 | defaultConfigurationIsVisible = 0; 502 | defaultConfigurationName = Release; 503 | }; 504 | D65F16F81B77B5D200866F61 /* Build configuration list for PBXNativeTarget "SwiftTracer" */ = { 505 | isa = XCConfigurationList; 506 | buildConfigurations = ( 507 | D65F16F91B77B5D200866F61 /* Debug */, 508 | D65F16FA1B77B5D200866F61 /* Release */, 509 | ); 510 | defaultConfigurationIsVisible = 0; 511 | defaultConfigurationName = Release; 512 | }; 513 | D65F16FB1B77B5D200866F61 /* Build configuration list for PBXNativeTarget "SwiftTracerTests" */ = { 514 | isa = XCConfigurationList; 515 | buildConfigurations = ( 516 | D65F16FC1B77B5D200866F61 /* Debug */, 517 | D65F16FD1B77B5D200866F61 /* Release */, 518 | ); 519 | defaultConfigurationIsVisible = 0; 520 | defaultConfigurationName = Release; 521 | }; 522 | /* End XCConfigurationList section */ 523 | }; 524 | rootObject = D65F16D81B77B5D200866F61 /* Project object */; 525 | } 526 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0412BE67F84D56AEF519D9C73A591BE3 /* Renderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = A458559A01A2C6FFB542D9F6DD5242D0 /* Renderer.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 11 | 191C11F44BFC467A86A7303EDEDCB617 /* Pods-SwiftTracer-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 605A5331794F7D4445C2C31996EBD0A2 /* Pods-SwiftTracer-dummy.m */; }; 12 | 1D2D5BCC922F9CD61ECF178DC0EC05D7 /* Scene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41198EC0C41983EBDD662B9617E7C708 /* Scene.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 13 | 2EB9CA17FCE3ED552FEEB6271C5163AD /* Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71A2BF48ACE9466BE25B61BF69646182 /* Color.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 14 | 2F253BE3588422AA80260468FB64A10F /* SwiftTracer-Core-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 29A2C76C6CED5E0B5BB1FA45DDD980C0 /* SwiftTracer-Core-dummy.m */; }; 15 | 4C47DB9AA4BBD25AFF3FD39914DD5842 /* Ray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98D3D3AB85B6630A128B3D24D311B5F1 /* Ray.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 16 | 6B46A5F143A5196927F86612EA2DAECB /* Sphere.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD7D18B9CE16D22896D515A8ACC07131 /* Sphere.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 17 | 74EB9807D3CB3C49154D2709BA331739 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 105EB5F6CFC19A8D7F2FBC79EA67B1F4 /* Cocoa.framework */; }; 18 | 79CDF42C8C5EB0A760909BDE3F8431FA /* Pods-SwiftTracer-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 387ED4D0BD95C4A9900A96646C4C7ECD /* Pods-SwiftTracer-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 19 | 95B1D932C361D1FDAA66BBA8778FFEB6 /* Shape.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BBE2E12749E831AC4E580A118210EB4 /* Shape.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 20 | 99180EB1ACC4C17689ADC9857FE46B7F /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 105EB5F6CFC19A8D7F2FBC79EA67B1F4 /* Cocoa.framework */; }; 21 | 99A2C1DE412F1559A8D655D6224FF845 /* Plane.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF0412549D348794738E4D8ECC9187E0 /* Plane.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 22 | ADA06CB34BB10588A2E7E145A4A5A57E /* Intersection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7C8DBDDA35E68F9199F7EF3FCD744 /* Intersection.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 23 | AF13766EAEF40DA1482B30FB5A4B5180 /* Box.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7A4859F2F027BEB5919D4FA77032292 /* Box.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 24 | DB5AEBA28DD830EF8F906C616DD01915 /* PointLight.swift in Sources */ = {isa = PBXBuildFile; fileRef = 530331B0DCF08BA226112A53B862E559 /* PointLight.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 25 | DE869166C4A424DD527830CBD3886251 /* SwiftTracer-Core-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F46E0FE2C439136160965B23222FBDFB /* SwiftTracer-Core-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 26 | E0AE8E82C55ECAD7740E0A1E8064B6E2 /* Material.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7002F6DF2B400CAC8B5F9C7ABA1FB39 /* Material.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 27 | EDF1B43EEF00768B53EF719E3A59E87C /* Camera.swift in Sources */ = {isa = PBXBuildFile; fileRef = A79565798D0FF449928AF4479C82C055 /* Camera.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 28 | F9FC06ADB54DD2750D33891A56F3E543 /* Vector.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9341EABACDAAA7EE24A25E2143C6127 /* Vector.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 29 | /* End PBXBuildFile section */ 30 | 31 | /* Begin PBXContainerItemProxy section */ 32 | 00D7C1DD57233767EF523EB68E6F5277 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 72C83FE4EF3495485C5B3FEA0D0CD73E; 37 | remoteInfo = "SwiftTracer-Core"; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 105EB5F6CFC19A8D7F2FBC79EA67B1F4 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; }; 43 | 1AB7C8DBDDA35E68F9199F7EF3FCD744 /* Intersection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Intersection.swift; path = Sources/Misc/Intersection.swift; sourceTree = ""; }; 44 | 1D3E46C66450BE302D8BBDED9A073936 /* Pods-SwiftTracer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwiftTracer.debug.xcconfig"; sourceTree = ""; }; 45 | 24417B4047FCB4803B533FAD410B526B /* Pods-SwiftTracer.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwiftTracer.modulemap"; sourceTree = ""; }; 46 | 29A2C76C6CED5E0B5BB1FA45DDD980C0 /* SwiftTracer-Core-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SwiftTracer-Core-dummy.m"; sourceTree = ""; }; 47 | 2BFF46340D81D218A493F6A5AA6FA71F /* Pods-SwiftTracer-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwiftTracer-frameworks.sh"; sourceTree = ""; }; 48 | 387ED4D0BD95C4A9900A96646C4C7ECD /* Pods-SwiftTracer-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwiftTracer-umbrella.h"; sourceTree = ""; }; 49 | 39F43385C9B45BF4637E71E028B763BB /* Pods-SwiftTracer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwiftTracer.release.xcconfig"; sourceTree = ""; }; 50 | 41198EC0C41983EBDD662B9617E7C708 /* Scene.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Scene.swift; path = Sources/Misc/Scene.swift; sourceTree = ""; }; 51 | 530331B0DCF08BA226112A53B862E559 /* PointLight.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PointLight.swift; path = Sources/Lights/PointLight.swift; sourceTree = ""; }; 52 | 54ED6975A84FFAF221C367586A75AC3C /* SwiftTracer-Core-Private.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "SwiftTracer-Core-Private.xcconfig"; sourceTree = ""; }; 53 | 605A5331794F7D4445C2C31996EBD0A2 /* Pods-SwiftTracer-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwiftTracer-dummy.m"; sourceTree = ""; }; 54 | 69DCB8570A5EADEC77A998965DDB66A2 /* Pods-SwiftTracer-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwiftTracer-acknowledgements.plist"; sourceTree = ""; }; 55 | 6D04A53A9FAFE8BA267D995C010C1BD3 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | 71A2BF48ACE9466BE25B61BF69646182 /* Color.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Color.swift; path = Sources/Misc/Color.swift; sourceTree = ""; }; 57 | 74E1C215791F77C3F0C8C87CAE3A37DD /* SwiftTracer_Core.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftTracer_Core.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | 7AA6FEA76FA0A3946C34DA4FB35B072E /* SwiftTracer-Core.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "SwiftTracer-Core.xcconfig"; sourceTree = ""; }; 59 | 8883D8FBBE3E4FC56C3D296D4AD420DD /* SwiftTracer-Core-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SwiftTracer-Core-prefix.pch"; sourceTree = ""; }; 60 | 90C5165436D3128562E7ED13421A6C6D /* Pods_SwiftTracer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftTracer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | 98D3D3AB85B6630A128B3D24D311B5F1 /* Ray.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Ray.swift; path = Sources/Misc/Ray.swift; sourceTree = ""; }; 62 | 9BBE2E12749E831AC4E580A118210EB4 /* Shape.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Shape.swift; path = Sources/Geometry/Shape.swift; sourceTree = ""; }; 63 | A3C65BC77BBA869CD874AA09574971F8 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 64 | A458559A01A2C6FFB542D9F6DD5242D0 /* Renderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Renderer.swift; path = Sources/Misc/Renderer.swift; sourceTree = ""; }; 65 | A79565798D0FF449928AF4479C82C055 /* Camera.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Camera.swift; path = Sources/Misc/Camera.swift; sourceTree = ""; }; 66 | A7F226395F52B445D7EEAFA3D4AF16A0 /* Pods-SwiftTracer-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwiftTracer-acknowledgements.markdown"; sourceTree = ""; }; 67 | BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 68 | BF0412549D348794738E4D8ECC9187E0 /* Plane.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Plane.swift; path = Sources/Geometry/Plane.swift; sourceTree = ""; }; 69 | C9341EABACDAAA7EE24A25E2143C6127 /* Vector.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Vector.swift; path = Sources/Math/Vector.swift; sourceTree = ""; }; 70 | C9877A99AFFB436E907E99BE65E3B0D4 /* Pods-SwiftTracer-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwiftTracer-resources.sh"; sourceTree = ""; }; 71 | CD7D18B9CE16D22896D515A8ACC07131 /* Sphere.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sphere.swift; path = Sources/Geometry/Sphere.swift; sourceTree = ""; }; 72 | D7002F6DF2B400CAC8B5F9C7ABA1FB39 /* Material.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Material.swift; path = Sources/Misc/Material.swift; sourceTree = ""; }; 73 | D80747AC508FEBADE627A24C7231C369 /* SwiftTracer-Core.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "SwiftTracer-Core.modulemap"; sourceTree = ""; }; 74 | E7A4859F2F027BEB5919D4FA77032292 /* Box.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Box.swift; path = Sources/Geometry/Box.swift; sourceTree = ""; }; 75 | F46E0FE2C439136160965B23222FBDFB /* SwiftTracer-Core-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SwiftTracer-Core-umbrella.h"; sourceTree = ""; }; 76 | /* End PBXFileReference section */ 77 | 78 | /* Begin PBXFrameworksBuildPhase section */ 79 | 013E4B1110B49D54A6F1874212BDDCB8 /* Frameworks */ = { 80 | isa = PBXFrameworksBuildPhase; 81 | buildActionMask = 2147483647; 82 | files = ( 83 | 99180EB1ACC4C17689ADC9857FE46B7F /* Cocoa.framework in Frameworks */, 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | BBA9C3B26A96FF0E133D2EFAAE1D65AE /* Frameworks */ = { 88 | isa = PBXFrameworksBuildPhase; 89 | buildActionMask = 2147483647; 90 | files = ( 91 | 74EB9807D3CB3C49154D2709BA331739 /* Cocoa.framework in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | 22674FB28843A90D87B73AD65EC70B3A /* Support Files */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | A3C65BC77BBA869CD874AA09574971F8 /* Info.plist */, 102 | D80747AC508FEBADE627A24C7231C369 /* SwiftTracer-Core.modulemap */, 103 | 7AA6FEA76FA0A3946C34DA4FB35B072E /* SwiftTracer-Core.xcconfig */, 104 | 54ED6975A84FFAF221C367586A75AC3C /* SwiftTracer-Core-Private.xcconfig */, 105 | 29A2C76C6CED5E0B5BB1FA45DDD980C0 /* SwiftTracer-Core-dummy.m */, 106 | 8883D8FBBE3E4FC56C3D296D4AD420DD /* SwiftTracer-Core-prefix.pch */, 107 | F46E0FE2C439136160965B23222FBDFB /* SwiftTracer-Core-umbrella.h */, 108 | ); 109 | name = "Support Files"; 110 | path = "../Target Support Files/SwiftTracer-Core"; 111 | sourceTree = ""; 112 | }; 113 | 2BCCF9E7DC08FAEC719B6A6C0F7D57AD /* OS X */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 105EB5F6CFC19A8D7F2FBC79EA67B1F4 /* Cocoa.framework */, 117 | ); 118 | name = "OS X"; 119 | sourceTree = ""; 120 | }; 121 | 39E9EE8210D861DFD82346C1F5EB7218 /* Frameworks */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 2BCCF9E7DC08FAEC719B6A6C0F7D57AD /* OS X */, 125 | ); 126 | name = Frameworks; 127 | sourceTree = ""; 128 | }; 129 | 3D2D07F40EAC42CC8B5E531B141E8DEA /* SwiftTracer-Core */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | E7A4859F2F027BEB5919D4FA77032292 /* Box.swift */, 133 | A79565798D0FF449928AF4479C82C055 /* Camera.swift */, 134 | 71A2BF48ACE9466BE25B61BF69646182 /* Color.swift */, 135 | 1AB7C8DBDDA35E68F9199F7EF3FCD744 /* Intersection.swift */, 136 | D7002F6DF2B400CAC8B5F9C7ABA1FB39 /* Material.swift */, 137 | BF0412549D348794738E4D8ECC9187E0 /* Plane.swift */, 138 | 530331B0DCF08BA226112A53B862E559 /* PointLight.swift */, 139 | 98D3D3AB85B6630A128B3D24D311B5F1 /* Ray.swift */, 140 | A458559A01A2C6FFB542D9F6DD5242D0 /* Renderer.swift */, 141 | 41198EC0C41983EBDD662B9617E7C708 /* Scene.swift */, 142 | 9BBE2E12749E831AC4E580A118210EB4 /* Shape.swift */, 143 | CD7D18B9CE16D22896D515A8ACC07131 /* Sphere.swift */, 144 | C9341EABACDAAA7EE24A25E2143C6127 /* Vector.swift */, 145 | 22674FB28843A90D87B73AD65EC70B3A /* Support Files */, 146 | ); 147 | path = "SwiftTracer-Core"; 148 | sourceTree = ""; 149 | }; 150 | 7DB346D0F39D3F0E887471402A8071AB = { 151 | isa = PBXGroup; 152 | children = ( 153 | BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */, 154 | 39E9EE8210D861DFD82346C1F5EB7218 /* Frameworks */, 155 | D615CAE7CA51FC71CC1E410ACC13236F /* Pods */, 156 | CCA510CFBEA2D207524CDA0D73C3B561 /* Products */, 157 | AE9DE4F7E2D72417C802A6D5A459FEF3 /* Targets Support Files */, 158 | ); 159 | sourceTree = ""; 160 | }; 161 | A6E7CDF887899BB9D3BA5EBBB9CA2A93 /* Pods-SwiftTracer */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | 6D04A53A9FAFE8BA267D995C010C1BD3 /* Info.plist */, 165 | 24417B4047FCB4803B533FAD410B526B /* Pods-SwiftTracer.modulemap */, 166 | A7F226395F52B445D7EEAFA3D4AF16A0 /* Pods-SwiftTracer-acknowledgements.markdown */, 167 | 69DCB8570A5EADEC77A998965DDB66A2 /* Pods-SwiftTracer-acknowledgements.plist */, 168 | 605A5331794F7D4445C2C31996EBD0A2 /* Pods-SwiftTracer-dummy.m */, 169 | 2BFF46340D81D218A493F6A5AA6FA71F /* Pods-SwiftTracer-frameworks.sh */, 170 | C9877A99AFFB436E907E99BE65E3B0D4 /* Pods-SwiftTracer-resources.sh */, 171 | 387ED4D0BD95C4A9900A96646C4C7ECD /* Pods-SwiftTracer-umbrella.h */, 172 | 1D3E46C66450BE302D8BBDED9A073936 /* Pods-SwiftTracer.debug.xcconfig */, 173 | 39F43385C9B45BF4637E71E028B763BB /* Pods-SwiftTracer.release.xcconfig */, 174 | ); 175 | name = "Pods-SwiftTracer"; 176 | path = "Target Support Files/Pods-SwiftTracer"; 177 | sourceTree = ""; 178 | }; 179 | AE9DE4F7E2D72417C802A6D5A459FEF3 /* Targets Support Files */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | A6E7CDF887899BB9D3BA5EBBB9CA2A93 /* Pods-SwiftTracer */, 183 | ); 184 | name = "Targets Support Files"; 185 | sourceTree = ""; 186 | }; 187 | CCA510CFBEA2D207524CDA0D73C3B561 /* Products */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 90C5165436D3128562E7ED13421A6C6D /* Pods_SwiftTracer.framework */, 191 | 74E1C215791F77C3F0C8C87CAE3A37DD /* SwiftTracer_Core.framework */, 192 | ); 193 | name = Products; 194 | sourceTree = ""; 195 | }; 196 | D615CAE7CA51FC71CC1E410ACC13236F /* Pods */ = { 197 | isa = PBXGroup; 198 | children = ( 199 | 3D2D07F40EAC42CC8B5E531B141E8DEA /* SwiftTracer-Core */, 200 | ); 201 | name = Pods; 202 | sourceTree = ""; 203 | }; 204 | /* End PBXGroup section */ 205 | 206 | /* Begin PBXHeadersBuildPhase section */ 207 | 3552581959F62F5FB127CD8A100C9E25 /* Headers */ = { 208 | isa = PBXHeadersBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | DE869166C4A424DD527830CBD3886251 /* SwiftTracer-Core-umbrella.h in Headers */, 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | AA7EF90F4B565559EDE725B50C092E7C /* Headers */ = { 216 | isa = PBXHeadersBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | 79CDF42C8C5EB0A760909BDE3F8431FA /* Pods-SwiftTracer-umbrella.h in Headers */, 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | }; 223 | /* End PBXHeadersBuildPhase section */ 224 | 225 | /* Begin PBXNativeTarget section */ 226 | 72C83FE4EF3495485C5B3FEA0D0CD73E /* SwiftTracer-Core */ = { 227 | isa = PBXNativeTarget; 228 | buildConfigurationList = 18F8A94C4CE603AD2E37F1DD4A5F81DA /* Build configuration list for PBXNativeTarget "SwiftTracer-Core" */; 229 | buildPhases = ( 230 | 023D233219F525D615BD7C856BD8A7A2 /* Sources */, 231 | BBA9C3B26A96FF0E133D2EFAAE1D65AE /* Frameworks */, 232 | 3552581959F62F5FB127CD8A100C9E25 /* Headers */, 233 | ); 234 | buildRules = ( 235 | ); 236 | dependencies = ( 237 | ); 238 | name = "SwiftTracer-Core"; 239 | productName = "SwiftTracer-Core"; 240 | productReference = 74E1C215791F77C3F0C8C87CAE3A37DD /* SwiftTracer_Core.framework */; 241 | productType = "com.apple.product-type.framework"; 242 | }; 243 | B2F444E54EC5A2F75EF874BC6B6E6ED4 /* Pods-SwiftTracer */ = { 244 | isa = PBXNativeTarget; 245 | buildConfigurationList = 4C536F368838FBBB6E00D2AA475C844D /* Build configuration list for PBXNativeTarget "Pods-SwiftTracer" */; 246 | buildPhases = ( 247 | 49A6C847F7BEB32296072D455C87E98E /* Sources */, 248 | 013E4B1110B49D54A6F1874212BDDCB8 /* Frameworks */, 249 | AA7EF90F4B565559EDE725B50C092E7C /* Headers */, 250 | ); 251 | buildRules = ( 252 | ); 253 | dependencies = ( 254 | 0FCC4F8BE58374BE81748A186CEEFB19 /* PBXTargetDependency */, 255 | ); 256 | name = "Pods-SwiftTracer"; 257 | productName = "Pods-SwiftTracer"; 258 | productReference = 90C5165436D3128562E7ED13421A6C6D /* Pods_SwiftTracer.framework */; 259 | productType = "com.apple.product-type.framework"; 260 | }; 261 | /* End PBXNativeTarget section */ 262 | 263 | /* Begin PBXProject section */ 264 | D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { 265 | isa = PBXProject; 266 | attributes = { 267 | LastSwiftUpdateCheck = 0700; 268 | LastUpgradeCheck = 0700; 269 | }; 270 | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; 271 | compatibilityVersion = "Xcode 3.2"; 272 | developmentRegion = English; 273 | hasScannedForEncodings = 0; 274 | knownRegions = ( 275 | en, 276 | ); 277 | mainGroup = 7DB346D0F39D3F0E887471402A8071AB; 278 | productRefGroup = CCA510CFBEA2D207524CDA0D73C3B561 /* Products */; 279 | projectDirPath = ""; 280 | projectRoot = ""; 281 | targets = ( 282 | B2F444E54EC5A2F75EF874BC6B6E6ED4 /* Pods-SwiftTracer */, 283 | 72C83FE4EF3495485C5B3FEA0D0CD73E /* SwiftTracer-Core */, 284 | ); 285 | }; 286 | /* End PBXProject section */ 287 | 288 | /* Begin PBXSourcesBuildPhase section */ 289 | 023D233219F525D615BD7C856BD8A7A2 /* Sources */ = { 290 | isa = PBXSourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | AF13766EAEF40DA1482B30FB5A4B5180 /* Box.swift in Sources */, 294 | EDF1B43EEF00768B53EF719E3A59E87C /* Camera.swift in Sources */, 295 | 2EB9CA17FCE3ED552FEEB6271C5163AD /* Color.swift in Sources */, 296 | ADA06CB34BB10588A2E7E145A4A5A57E /* Intersection.swift in Sources */, 297 | E0AE8E82C55ECAD7740E0A1E8064B6E2 /* Material.swift in Sources */, 298 | 99A2C1DE412F1559A8D655D6224FF845 /* Plane.swift in Sources */, 299 | DB5AEBA28DD830EF8F906C616DD01915 /* PointLight.swift in Sources */, 300 | 4C47DB9AA4BBD25AFF3FD39914DD5842 /* Ray.swift in Sources */, 301 | 0412BE67F84D56AEF519D9C73A591BE3 /* Renderer.swift in Sources */, 302 | 1D2D5BCC922F9CD61ECF178DC0EC05D7 /* Scene.swift in Sources */, 303 | 95B1D932C361D1FDAA66BBA8778FFEB6 /* Shape.swift in Sources */, 304 | 6B46A5F143A5196927F86612EA2DAECB /* Sphere.swift in Sources */, 305 | 2F253BE3588422AA80260468FB64A10F /* SwiftTracer-Core-dummy.m in Sources */, 306 | F9FC06ADB54DD2750D33891A56F3E543 /* Vector.swift in Sources */, 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | }; 310 | 49A6C847F7BEB32296072D455C87E98E /* Sources */ = { 311 | isa = PBXSourcesBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | 191C11F44BFC467A86A7303EDEDCB617 /* Pods-SwiftTracer-dummy.m in Sources */, 315 | ); 316 | runOnlyForDeploymentPostprocessing = 0; 317 | }; 318 | /* End PBXSourcesBuildPhase section */ 319 | 320 | /* Begin PBXTargetDependency section */ 321 | 0FCC4F8BE58374BE81748A186CEEFB19 /* PBXTargetDependency */ = { 322 | isa = PBXTargetDependency; 323 | name = "SwiftTracer-Core"; 324 | target = 72C83FE4EF3495485C5B3FEA0D0CD73E /* SwiftTracer-Core */; 325 | targetProxy = 00D7C1DD57233767EF523EB68E6F5277 /* PBXContainerItemProxy */; 326 | }; 327 | /* End PBXTargetDependency section */ 328 | 329 | /* Begin XCBuildConfiguration section */ 330 | 17532D5161C1124C14DDEF6EE27B0D3A /* Debug */ = { 331 | isa = XCBuildConfiguration; 332 | baseConfigurationReference = 54ED6975A84FFAF221C367586A75AC3C /* SwiftTracer-Core-Private.xcconfig */; 333 | buildSettings = { 334 | COMBINE_HIDPI_IMAGES = YES; 335 | CURRENT_PROJECT_VERSION = 0.0.2; 336 | DEFINES_MODULE = YES; 337 | DYLIB_COMPATIBILITY_VERSION = 0.0.2; 338 | DYLIB_CURRENT_VERSION = "$(CURRENT_PROJECT_VERSION)"; 339 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 340 | ENABLE_STRICT_OBJC_MSGSEND = YES; 341 | FRAMEWORK_VERSION = A; 342 | GCC_PREFIX_HEADER = "Target Support Files/SwiftTracer-Core/SwiftTracer-Core-prefix.pch"; 343 | INFOPLIST_FILE = "Target Support Files/SwiftTracer-Core/Info.plist"; 344 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 345 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 346 | MACOSX_DEPLOYMENT_TARGET = 10.10; 347 | MODULEMAP_FILE = "Target Support Files/SwiftTracer-Core/SwiftTracer-Core.modulemap"; 348 | MTL_ENABLE_DEBUG_INFO = YES; 349 | PRODUCT_NAME = SwiftTracer_Core; 350 | SDKROOT = macosx; 351 | SKIP_INSTALL = YES; 352 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 353 | VERSIONING_SYSTEM = "apple-generic"; 354 | VERSION_INFO_PREFIX = ""; 355 | }; 356 | name = Debug; 357 | }; 358 | 1E621D6BF749EDCE77ACBE7C6D464E29 /* Debug */ = { 359 | isa = XCBuildConfiguration; 360 | buildSettings = { 361 | ALWAYS_SEARCH_USER_PATHS = NO; 362 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 363 | CLANG_CXX_LIBRARY = "libc++"; 364 | CLANG_ENABLE_MODULES = YES; 365 | CLANG_ENABLE_OBJC_ARC = YES; 366 | CLANG_WARN_BOOL_CONVERSION = YES; 367 | CLANG_WARN_CONSTANT_CONVERSION = YES; 368 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 369 | CLANG_WARN_EMPTY_BODY = YES; 370 | CLANG_WARN_ENUM_CONVERSION = YES; 371 | CLANG_WARN_INT_CONVERSION = YES; 372 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 373 | CLANG_WARN_UNREACHABLE_CODE = YES; 374 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 375 | COPY_PHASE_STRIP = NO; 376 | GCC_C_LANGUAGE_STANDARD = gnu99; 377 | GCC_DYNAMIC_NO_PIC = NO; 378 | GCC_OPTIMIZATION_LEVEL = 0; 379 | GCC_PREPROCESSOR_DEFINITIONS = ( 380 | "DEBUG=1", 381 | "$(inherited)", 382 | ); 383 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 384 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 385 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 386 | GCC_WARN_UNDECLARED_SELECTOR = YES; 387 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 388 | GCC_WARN_UNUSED_FUNCTION = YES; 389 | GCC_WARN_UNUSED_VARIABLE = YES; 390 | MACOSX_DEPLOYMENT_TARGET = 10.10; 391 | ONLY_ACTIVE_ARCH = YES; 392 | STRIP_INSTALLED_PRODUCT = NO; 393 | SYMROOT = "${SRCROOT}/../build"; 394 | }; 395 | name = Debug; 396 | }; 397 | 2F831A85A9EFAECF785264F556D439E2 /* Release */ = { 398 | isa = XCBuildConfiguration; 399 | baseConfigurationReference = 39F43385C9B45BF4637E71E028B763BB /* Pods-SwiftTracer.release.xcconfig */; 400 | buildSettings = { 401 | COMBINE_HIDPI_IMAGES = YES; 402 | CURRENT_PROJECT_VERSION = 1; 403 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 404 | DEFINES_MODULE = YES; 405 | DYLIB_COMPATIBILITY_VERSION = 1; 406 | DYLIB_CURRENT_VERSION = 1; 407 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 408 | ENABLE_STRICT_OBJC_MSGSEND = YES; 409 | FRAMEWORK_VERSION = A; 410 | INFOPLIST_FILE = "Target Support Files/Pods-SwiftTracer/Info.plist"; 411 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 412 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 413 | MACOSX_DEPLOYMENT_TARGET = 10.10; 414 | MODULEMAP_FILE = "Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer.modulemap"; 415 | MTL_ENABLE_DEBUG_INFO = NO; 416 | OTHER_LDFLAGS = ""; 417 | OTHER_LIBTOOLFLAGS = ""; 418 | PODS_ROOT = "$(SRCROOT)"; 419 | PRODUCT_NAME = Pods_SwiftTracer; 420 | SDKROOT = macosx; 421 | SKIP_INSTALL = YES; 422 | VERSIONING_SYSTEM = "apple-generic"; 423 | VERSION_INFO_PREFIX = ""; 424 | }; 425 | name = Release; 426 | }; 427 | 39397A809534DAD8BF0806F12C3C62AB /* Debug */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 1D3E46C66450BE302D8BBDED9A073936 /* Pods-SwiftTracer.debug.xcconfig */; 430 | buildSettings = { 431 | COMBINE_HIDPI_IMAGES = YES; 432 | CURRENT_PROJECT_VERSION = 1; 433 | DEFINES_MODULE = YES; 434 | DYLIB_COMPATIBILITY_VERSION = 1; 435 | DYLIB_CURRENT_VERSION = 1; 436 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 437 | ENABLE_STRICT_OBJC_MSGSEND = YES; 438 | FRAMEWORK_VERSION = A; 439 | INFOPLIST_FILE = "Target Support Files/Pods-SwiftTracer/Info.plist"; 440 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 441 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 442 | MACOSX_DEPLOYMENT_TARGET = 10.10; 443 | MODULEMAP_FILE = "Target Support Files/Pods-SwiftTracer/Pods-SwiftTracer.modulemap"; 444 | MTL_ENABLE_DEBUG_INFO = YES; 445 | OTHER_LDFLAGS = ""; 446 | OTHER_LIBTOOLFLAGS = ""; 447 | PODS_ROOT = "$(SRCROOT)"; 448 | PRODUCT_NAME = Pods_SwiftTracer; 449 | SDKROOT = macosx; 450 | SKIP_INSTALL = YES; 451 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 452 | VERSIONING_SYSTEM = "apple-generic"; 453 | VERSION_INFO_PREFIX = ""; 454 | }; 455 | name = Debug; 456 | }; 457 | 5577A3F22A37686E40DB6863D68D476C /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | ALWAYS_SEARCH_USER_PATHS = NO; 461 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 462 | CLANG_CXX_LIBRARY = "libc++"; 463 | CLANG_ENABLE_MODULES = YES; 464 | CLANG_ENABLE_OBJC_ARC = YES; 465 | CLANG_WARN_BOOL_CONVERSION = YES; 466 | CLANG_WARN_CONSTANT_CONVERSION = YES; 467 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 468 | CLANG_WARN_EMPTY_BODY = YES; 469 | CLANG_WARN_ENUM_CONVERSION = YES; 470 | CLANG_WARN_INT_CONVERSION = YES; 471 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 472 | CLANG_WARN_UNREACHABLE_CODE = YES; 473 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 474 | COPY_PHASE_STRIP = YES; 475 | ENABLE_NS_ASSERTIONS = NO; 476 | GCC_C_LANGUAGE_STANDARD = gnu99; 477 | GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1"; 478 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 479 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 480 | GCC_WARN_UNDECLARED_SELECTOR = YES; 481 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 482 | GCC_WARN_UNUSED_FUNCTION = YES; 483 | GCC_WARN_UNUSED_VARIABLE = YES; 484 | MACOSX_DEPLOYMENT_TARGET = 10.10; 485 | STRIP_INSTALLED_PRODUCT = NO; 486 | SYMROOT = "${SRCROOT}/../build"; 487 | VALIDATE_PRODUCT = YES; 488 | }; 489 | name = Release; 490 | }; 491 | 9BBC8DE8DD94B5D9980156B49C05D28F /* Release */ = { 492 | isa = XCBuildConfiguration; 493 | baseConfigurationReference = 54ED6975A84FFAF221C367586A75AC3C /* SwiftTracer-Core-Private.xcconfig */; 494 | buildSettings = { 495 | COMBINE_HIDPI_IMAGES = YES; 496 | CURRENT_PROJECT_VERSION = 0.0.2; 497 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 498 | DEFINES_MODULE = YES; 499 | DYLIB_COMPATIBILITY_VERSION = 0.0.2; 500 | DYLIB_CURRENT_VERSION = "$(CURRENT_PROJECT_VERSION)"; 501 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 502 | ENABLE_STRICT_OBJC_MSGSEND = YES; 503 | FRAMEWORK_VERSION = A; 504 | GCC_PREFIX_HEADER = "Target Support Files/SwiftTracer-Core/SwiftTracer-Core-prefix.pch"; 505 | INFOPLIST_FILE = "Target Support Files/SwiftTracer-Core/Info.plist"; 506 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 507 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 508 | MACOSX_DEPLOYMENT_TARGET = 10.10; 509 | MODULEMAP_FILE = "Target Support Files/SwiftTracer-Core/SwiftTracer-Core.modulemap"; 510 | MTL_ENABLE_DEBUG_INFO = NO; 511 | PRODUCT_NAME = SwiftTracer_Core; 512 | SDKROOT = macosx; 513 | SKIP_INSTALL = YES; 514 | VERSIONING_SYSTEM = "apple-generic"; 515 | VERSION_INFO_PREFIX = ""; 516 | }; 517 | name = Release; 518 | }; 519 | /* End XCBuildConfiguration section */ 520 | 521 | /* Begin XCConfigurationList section */ 522 | 18F8A94C4CE603AD2E37F1DD4A5F81DA /* Build configuration list for PBXNativeTarget "SwiftTracer-Core" */ = { 523 | isa = XCConfigurationList; 524 | buildConfigurations = ( 525 | 17532D5161C1124C14DDEF6EE27B0D3A /* Debug */, 526 | 9BBC8DE8DD94B5D9980156B49C05D28F /* Release */, 527 | ); 528 | defaultConfigurationIsVisible = 0; 529 | defaultConfigurationName = Release; 530 | }; 531 | 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { 532 | isa = XCConfigurationList; 533 | buildConfigurations = ( 534 | 1E621D6BF749EDCE77ACBE7C6D464E29 /* Debug */, 535 | 5577A3F22A37686E40DB6863D68D476C /* Release */, 536 | ); 537 | defaultConfigurationIsVisible = 0; 538 | defaultConfigurationName = Release; 539 | }; 540 | 4C536F368838FBBB6E00D2AA475C844D /* Build configuration list for PBXNativeTarget "Pods-SwiftTracer" */ = { 541 | isa = XCConfigurationList; 542 | buildConfigurations = ( 543 | 39397A809534DAD8BF0806F12C3C62AB /* Debug */, 544 | 2F831A85A9EFAECF785264F556D439E2 /* Release */, 545 | ); 546 | defaultConfigurationIsVisible = 0; 547 | defaultConfigurationName = Release; 548 | }; 549 | /* End XCConfigurationList section */ 550 | }; 551 | rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 552 | } 553 | -------------------------------------------------------------------------------- /SwiftTracer/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | Default 539 | 540 | 541 | 542 | 543 | 544 | 545 | Left to Right 546 | 547 | 548 | 549 | 550 | 551 | 552 | Right to Left 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | Default 564 | 565 | 566 | 567 | 568 | 569 | 570 | Left to Right 571 | 572 | 573 | 574 | 575 | 576 | 577 | Right to Left 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | --------------------------------------------------------------------------------