This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Based on example C# code from http://forum.unity3d.com/threads/evenly-distributed-points-on-a-surface-of-a-sphere.26138/#post-2031195 | |
| // objects is an array of THREE.js 3D Objects | |
| function positionObjectsOnSphereSurface(objects) { | |
| var radius = 900; | |
| var n = objects.length; | |
| var inc = Math.PI * (3 - Math.sqrt(5)); | |
| var off = 2 / n; | |
| var x = 0; | |
| var y = 0; | |
| var z = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Define our relationships | |
| var map = {}; | |
| map[THING] = RELATED_THING; | |
| // match method — searches for key and reurns value if not searches for value and returns key otherwise returns undefined. | |
| var match = function(value) | |
| { | |
| if (map.hasOwnProperty(value)) | |
| { | |
| return map[value]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp'), | |
| sass = require('gulp-ruby-sass'), | |
| livereload = require('gulp-livereload'), | |
| rename = require('gulp-rename'), | |
| autoprefixer = require('gulp-autoprefixer'); | |
| var paths = { | |
| styles: './css/demo.scss', | |
| html: 'index.html' | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var findKey = function(obj, value) | |
| { | |
| var key = null; | |
| for (var prop in obj) | |
| { | |
| if (obj.hasOwnProperty(prop)) | |
| { | |
| if (obj[prop] === value) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
| buildNumber=$(($buildNumber + 1)) | |
| /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifdef DEBUG | |
| #define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
| #else | |
| #define DLog(...) | |
| #endif |