PointLight.js 799 字节
Newer Older
M
Mr.doob 已提交
1
/**
M
Mr.doob 已提交
2
 * @author mrdoob / http://mrdoob.com/
M
Mr.doob 已提交
3 4
 */

5

M
Mr.doob 已提交
6
THREE.PointLight = function ( color, intensity, distance, decay ) {
M
Mr.doob 已提交
7

8
	THREE.Light.call( this, color, intensity );
M
Mr.doob 已提交
9

10 11
	this.type = 'PointLight';

12
	this.distance = ( distance !== undefined ) ? distance : 0;
M
Mr.doob 已提交
13
	this.decay = ( decay !== undefined ) ? decay : 1;	// for physically correct lights, should be 2.
M
Mr.doob 已提交
14

M
Mr.doob 已提交
15
	this.shadow = new THREE.LightShadow( new THREE.PerspectiveCamera( 90, 1, 1, 500 ) );
16

M
Mr.doob 已提交
17 18
};

19
THREE.PointLight.prototype = Object.create( THREE.Light.prototype );
20
THREE.PointLight.prototype.constructor = THREE.PointLight;
21

22
THREE.PointLight.prototype.copy = function ( source ) {
23

24 25 26 27 28
	THREE.Light.prototype.copy.call( this, source );

	this.distance = source.distance;
	this.decay = source.decay;

M
Mr.doob 已提交
29
	this.shadow = source.shadow.clone();
30

31
	return this;
32 33

};