simtable/st-api — pull request #10 by mariusnita (2014-06-20 23:25:33+00:00)
Title: switch models world from "2d array of objects" to "object of typed arrays

This is kind of a huge commit, and there's a lot more to be done.

I'm switching worlds from being a 2d array of objects to being objects of 1d typed arrays.

So before we had
```js
water.world[x][y] == {
volume: 1,
elevation: 2,
siltFloating: 3
}
```
Now, for the same (x,y) we have:
```js
idx = water.width * y + x;
water.world.volume[idx] == 1
water.world.elevation[idx] == 2
water.world.siltFloating[idx] == 3
```
These arrays are typed contiguous arrays like `Uint32Array`, `Float32Array`, etc.

There's more to be done. Sampling is especially inefficient, as I kept the previous interface. So when you `water.sample(x,y)`, that samples *all* the arrays and builds an object to return. Sampling should probably then specify a field to sample.