Skip to content

Commit

Permalink
updated builds
Browse files Browse the repository at this point in the history
  • Loading branch information
schteppe committed Oct 25, 2014
1 parent 7a93d50 commit 5e3d60d
Show file tree
Hide file tree
Showing 4 changed files with 416 additions and 353 deletions.
14 changes: 13 additions & 1 deletion build/cannon.demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,12 @@ CANNON.Demo.prototype.addVisual = function(body){
}
};

CANNON.Demo.prototype.addVisuals = function(bodies){
for (var i = 0; i < bodies.length; i++) {
this.addVisual(bodies[i]);
}
};

CANNON.Demo.prototype.removeVisual = function(body){
if(body.visualref){
var bodies = this.bodies,
Expand All @@ -954,11 +960,17 @@ CANNON.Demo.prototype.removeVisual = function(body){
}
}
body.visualref.visualId = null;
this. scene.remove(body.visualref);
this.scene.remove(body.visualref);
body.visualref = null;
}
};

CANNON.Demo.prototype.removeAllVisuals = function(){
while(this.bodies.length) {
this.removeVisual(this.bodies[0]);
}
};

CANNON.Demo.prototype.shape2mesh = function(body){
var wireframe = this.settings.renderMode === "wireframe";
var obj = new THREE.Object3D();
Expand Down
Loading

0 comments on commit 5e3d60d

Please sign in to comment.