diff --git a/build/three.js b/build/three.js index df344682fb01525625f468de86fbc1d617f7767a..b63a8fa54296e9f3f9e72efa3fdc4858211ac915 100644 --- a/build/three.js +++ b/build/three.js @@ -7712,6 +7712,7 @@ THREE.Object3D.prototype = { if ( object.name !== '' ) data.name = object.name; if ( JSON.stringify( object.userData ) !== '{}' ) data.userData = object.userData; + if ( object.script !== undefined ) data.script = object.script.source; if ( object.visible !== true ) data.visible = object.visible; if ( object instanceof THREE.PerspectiveCamera ) { @@ -7825,6 +7826,8 @@ THREE.Object3D.prototype = { object.userData = JSON.parse( JSON.stringify( this.userData ) ); + if ( this.script !== undefined ) object.script = this.script.clone(); + if ( recursive === true ) { for ( var i = 0; i < this.children.length; i ++ ) { @@ -11039,6 +11042,18 @@ THREE.Script = function ( source ) { this.source = source; }; + +THREE.Script.prototype = { + + constructor: THREE.Script, + + clone: function () { + + return new THREE.Script( this.source ); + + } + +} // File:src/cameras/Camera.js /** @@ -13476,6 +13491,7 @@ THREE.ObjectLoader.prototype = { if ( data.visible !== undefined ) object.visible = data.visible; if ( data.userData !== undefined ) object.userData = data.userData; + if ( data.script !== undefined ) object.script = new THREE.Script( data.script ); if ( data.children !== undefined ) { diff --git a/build/three.min.js b/build/three.min.js index e7bba1f5539fe461aea6959d8c0a504f2d1e45b0..388add25a87381a28be6ddf2f68712a829410e6b 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -161,11 +161,11 @@ a,"can't be added as a child of itself."),this;a instanceof THREE.Object3D?(void traverse:function(a){a(this);for(var b=0,c=this.children.length;be&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d