Skip to content

Instantly share code, notes, and snippets.

var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module)if(Module.hasOwnProperty(key))moduleOverrides[key]=Module[key];var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function";var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;
if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);if(!ret&&filename!=nodePath["resolve"](filename)){filename=path.join(__dirname,"..","src",filename);ret=nodeFS["readFileSync"](filename)}if(ret&&
!binary)ret=ret.toString();
@zilluss
zilluss / gist:219a4c32feb59c3a0222
Created April 22, 2015 09:15
Test case for b2ParticleSystem.GetParticleCount() and b2ParticleSystem.GetPositionBuffer()
function TestCreateParticle() {
var psd = new b2ParticleSystemDef();
var particleSystem= world.CreateParticleSystem(psd);
var expectedParticleCount = 50;
for(var i = 0; i < expectedParticleCount; i++) {
var pd = new b2ParticleDef();
pd.position = new b2Vec2(i, 0);
particleSystem.CreateParticle(pd);
}