提交 ca8ba14a 编写于 作者: C CMP

Implement Scene.clone #3032

The object returnen by the scene's clone method is now a fully valid scene and
can be used in rendering.
上级 3810681a
......@@ -14506,6 +14506,25 @@ THREE.Scene.prototype.__removeObject = function ( object ) {
};
THREE.Scene.prototype.clone = function (object) {
if ( object === undefined ) object = new THREE.Scene();
THREE.Object3D.prototype.clone.call(this, object);
if(this.fog !== null) {
object.fog = this.fog.clone();
}
if(this.overrideMaterial !== null) {
object.overrideMaterial = this.overrideMaterial.clone();
}
object.autoUpdate = this.autoUpdate;
object.matrixAutoUpdate = this.matrixAutoUpdate;
return object;
};
/**
* @author mrdoob / http://mrdoob.com/
* @author alteredq / http://alteredqualia.com/
......
此差异已折叠。
......@@ -109,3 +109,22 @@ THREE.Scene.prototype.__removeObject = function ( object ) {
}
};
THREE.Scene.prototype.clone = function (object) {
if ( object === undefined ) object = new THREE.Scene();
THREE.Object3D.prototype.clone.call(this, object);
if(this.fog !== null) {
object.fog = this.fog.clone();
}
if(this.overrideMaterial !== null) {
object.overrideMaterial = this.overrideMaterial.clone();
}
object.autoUpdate = this.autoUpdate;
object.matrixAutoUpdate = this.matrixAutoUpdate;
return object;
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册