void addFace(ofMesh& mesh, ofVec3f a, ofVec3f b, ofVec3f c) {
ofVec3f normal = ((b - a).cross(c - a)).normalize();
mesh.addNormal(normal);
mesh.addVertex(a);
mesh.addNormal(normal);
mesh.addVertex(b);
mesh.addNormal(normal);
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
| #!/usr/bin/env rake | |
| Dir.glob('*.rake').each { |r| import r } |
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 empty, get, set, | |
| __hasProp = {}.hasOwnProperty; | |
| get = Ember.get; | |
| set = Ember.set; | |
| empty = function(obj) { | |
| var key; | |
| for (key in obj) { | |
| if (!__hasProp.call(obj, key)) continue; |
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
| // Support routines for automatically reporting user timing for common analytics platforms | |
| // Currently supports Google Analytics, Boomerang and SOASTA mPulse | |
| // In the case of boomerang, you will need to map the event names you want reported | |
| // to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable: | |
| // rumMapping = {'aft': 'custom0'}; | |
| (function() { | |
| var wtt = function(n, t, b) { | |
| t = Math.round(t); | |
| if (t >= 0 && t < 3600000) { | |
| // Google Analytics |
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
| /** | |
| * `Ember.MergedArray` is an array that observes multiple other arrays (called source arrays) for changes and includes | |
| * all items from all source arrays in an efficient way. | |
| * | |
| * Usage: | |
| * | |
| * ```javascript | |
| * var obj = Ember.Object.create({ | |
| * people: [ | |
| * { |
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
| # So, this is pretty horrible. If we just encode using btoa, any UTF-8 chars cause an error. | |
| # If we use either of the workarounds on MDN[1], the £ sign is encoded wrong. I suspect | |
| # Excel totally sucking at encodings is the reason why. So, the workaround is, to use | |
| # the MDN workaround on chars with values > 255, and allow chars 0-255 to be encoded | |
| # as is with btoa. Note that if you use either of the workarounds on MDN, chars | |
| # 128-255 will be encoded as UTF-8, which includeds the £ sign. This will cause excel | |
| # to choke on these chars. Excel will still choke on chars > 255, but at least the £ | |
| # sign works now... | |
| # [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding |
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
| /*jshint browser:true */ | |
| /*global DS:true, io:true, App:true */ | |
| (function() { | |
| 'use strict'; | |
| // Initializer for Models | |
| window.Models = {}; | |
| console.warn("Don't pollute the global namespace with Models!"); |
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
| Application.LoadingTransitionMixin = Ember.Mixin.create | |
| afterModel: (model, transition) -> | |
| previousRoute = @get('router').previousRoute | |
| if previousRoute | |
| @get('router').previousRoute.cleanUp() | |
| cleanUp: -> | |
| deferredPromise = new Ember.Deferred() | |
| @controller.set('cleanUpPromise', deferredPromise) |
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
| App.Router.map(function() { | |
| this.resource('post', { path: '/posts/:post_id' }); | |
| }); | |
| App.PostRoute = Ember.Route.extend({ | |
| model: function(params) { | |
| return this.store.find('post', params.post_id); | |
| } | |
| }); |