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

HemisphereLight clone(). PointLight and DirectionalLight clean up.

上级 374aa578
......@@ -7,7 +7,7 @@ THREE.DirectionalLight = function ( hex, intensity ) {
THREE.Light.call( this, hex );
this.position = new THREE.Vector3( 0, 1, 0 );
this.position.set( 0, 1, 0 );
this.target = new THREE.Object3D();
this.intensity = ( intensity !== undefined ) ? intensity : 1;
......
......@@ -6,12 +6,24 @@ THREE.HemisphereLight = function ( skyColorHex, groundColorHex, intensity ) {
THREE.Light.call( this, skyColorHex );
this.groundColor = new THREE.Color( groundColorHex );
this.position = new THREE.Vector3( 0, 100, 0 );
this.position.set( 0, 100, 0 );
this.groundColor = new THREE.Color( groundColorHex );
this.intensity = ( intensity !== undefined ) ? intensity : 1;
};
THREE.HemisphereLight.prototype = Object.create( THREE.Light.prototype );
THREE.HemisphereLight.prototype.clone = function () {
var light = new THREE.PointLight();
THREE.Light.prototype.clone.call( this, light );
light.groundColor.copy( this.groundColor );
light.intensity = this.intensity;
return light;
};
......@@ -6,7 +6,6 @@ THREE.PointLight = function ( hex, intensity, distance ) {
THREE.Light.call( this, hex );
this.position = new THREE.Vector3( 0, 0, 0 );
this.intensity = ( intensity !== undefined ) ? intensity : 1;
this.distance = ( distance !== undefined ) ? distance : 0;
......@@ -20,7 +19,6 @@ THREE.PointLight.prototype.clone = function () {
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.
先完成此消息的编辑!
想要评论请 注册