This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package simulation.collision | |
{ | |
import math.vec2; | |
public class AABB | |
{ | |
public var min:vec2; | |
public var max:vec2; | |
public function AABB(xmin:Number, ymin:Number, xmax:Number, ymax:Number) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uniform sampler2D texture; | |
varying vec2 uv; | |
void main(){ | |
vec2 size = textureSize(texture); | |
vec2 puv = uv*size; | |
vec2 hfw = 0.5*fwidth(puv); | |
vec2 fl = floor(puv - 0.5) + 0.5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var codeset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
var base = codeset.length; | |
function encode(intStr) { | |
var hash = ""; | |
intStr = parseInt(intStr); | |
while (intStr > 0) { | |
hash = self.codeset[parseInt(intStr % base)] + hash; | |
intStr = Math.floor(intStr / base); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* PROG1.C */ | |
/* Simple Hashing LZ77 Sliding Dictionary Compression Program */ | |
/* By Rich Geldreich, Jr. October, 1993 */ | |
/* Originally compiled with QuickC v2.5 in the small model. */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <ctype.h> | |
/* set this to 1 for a greedy encoder */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Linear Congruential Generator | |
// Variant of a Lehman Generator | |
var lcg = (function() { | |
// Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes | |
// m is basically chosen to be large (as it is the max period) | |
// and for its relationships to a and c | |
var m = 4294967296, | |
// a - 1 should be divisible by m's prime factors | |
a = 1664525, | |
// c and m should be co-prime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* RC4-drop[256] (aka MARK-4) implementation in JavaScript. | |
* | |
* @module rc4 | |
*/ | |
/** | |
* @class RC4 | |
* @static | |
*/ |