Add an option to supply a THREE.js instance to the Mesh constructor #5

Merged
merged 1 commit into from Feb 5, 2013

Conversation

Projects
None yet
2 participants
Contributor

leolannenmaki commented Feb 5, 2013

Because transitive dependencies get inserted in to the browserify bundle multiple times (see substack/node-browserify#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

var mesh = new Mesh(voxelData);
game.scene.add(mesh.createSurfaceMesh());

Fails because the

mesh instanceof Object3d

fails inside Three.js

maxogden added a commit that referenced this pull request Feb 5, 2013

Merge pull request #5 from leolannenmaki/workaround-for-threejs-multi…
…ple-instantiation

Add an option to supply a THREE.js instance to the Mesh constructor

@maxogden maxogden merged commit 530fe51 into maxogden:master Feb 5, 2013

Owner

maxogden commented Feb 5, 2013

Thanks! Any idea how we could fix three.js?

Contributor

leolannenmaki commented Feb 5, 2013

Sorry, no idea. It seems riddled with instanceof checks.

@maxogden maxogden referenced this pull request in mrdoob/three.js Feb 5, 2013

Closed

Add examples\js\loaders\* to the npm three package #3041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment