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
class EventDispatcher | |
constructor: () -> | |
@_listeners = {} | |
addEventListener: (type, listener) -> | |
return unless typeof listener == 'function' | |
@_listeners[type] ?= [] | |
for l in @_listeners[type] | |
return if l == listener | |
@_listeners[type].push(listener) |
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
package net.alumican.as3.utils | |
{ | |
public class MathUtil | |
{ | |
static public function map(value:Number, srcMin:Number, srcMax:Number, dstMin:Number, dstMax:Number):Number | |
{ | |
value = value < srcMin ? srcMin : value > srcMax ? srcMax : value; | |
return dstMin + (dstMax - dstMin) * (value - srcMin) / (srcMax - srcMin); | |
} | |
} |
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
#include "testApp.h" | |
//-------------------------------------------------------------- | |
void testApp::setup() | |
{ | |
ofSetDataPathRoot("data/"); | |
ofBackground(0); | |
//setup recognizer | |
recognizer = zinnia::Recognizer::create(); |
NewerOlder