maxogden/voxel-mesh — pull request #5 by leolannenmaki (2013-02-05 19:06:45+00:00)
Title: Add an option to supply a THREE.js instance to the Mesh constructor

Because transitive dependencies get inserted in to the browserify bundle multiple times (see https://github.com/substack/node-browserify/issues/186) THREE.js can get loaded and instantiated multiple times in a single voxel-engine app.

This causes problems because for example `instanceof` checks fail for objects created in one Three instance and passed to another.

In my case
```javascript
var mesh = new Mesh(voxelData);
game.scene.add(mesh.createSurfaceMesh());
```

Fails because the
```javascript
mesh instanceof Object3d
```
fails inside Three.js