提交 efa4d964 编写于 作者: M Mr.doob

Improved PointLight clone.

上级 321a0226
......@@ -367,7 +367,10 @@ var Viewport = function ( signals ) {
if ( selected === camera ) return;
signals.objectAdded.dispatch( selected.clone() );
var object = selected.clone();
signals.objectAdded.dispatch( object );
signals.objectSelected.dispatch( object );
} );
......
......@@ -12,3 +12,15 @@ THREE.Light = function ( hex ) {
};
THREE.Light.prototype = Object.create( THREE.Object3D.prototype );
THREE.Light.prototype.clone = function ( light ) {
if ( light === undefined ) light = new THREE.Light();
THREE.Object3D.prototype.clone.call( this, light );
light.color.copy( this.color );
return light;
};
......@@ -18,7 +18,8 @@ THREE.PointLight.prototype.clone = function () {
var light = new THREE.PointLight();
light.color.copy( this.color );
THREE.Light.prototype.clone.call( this, light );
light.position.copy( this.position );
light.intensity = this.intensity;
light.distance = this.distance;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册