source: other-projects/playing-in-the-street/summer-2013/trunk/Playing-in-the-Street-WPF/Content/Web/mrdoob-three.js-4862f5f/src/lights/SpotLight.js@ 28897

Last change on this file since 28897 was 28897, checked in by davidb, 10 years ago

GUI front-end to server base plus web page content

File size: 1.3 KB
Line 
1/**
2 * @author alteredq / http://alteredqualia.com/
3 */
4
5THREE.SpotLight = function ( hex, intensity, distance, angle, exponent ) {
6
7 THREE.Light.call( this, hex );
8
9 this.position.set( 0, 1, 0 );
10 this.target = new THREE.Object3D();
11
12 this.intensity = ( intensity !== undefined ) ? intensity : 1;
13 this.distance = ( distance !== undefined ) ? distance : 0;
14 this.angle = ( angle !== undefined ) ? angle : Math.PI / 3;
15 this.exponent = ( exponent !== undefined ) ? exponent : 10;
16
17 this.castShadow = false;
18 this.onlyShadow = false;
19
20 //
21
22 this.shadowCameraNear = 50;
23 this.shadowCameraFar = 5000;
24 this.shadowCameraFov = 50;
25
26 this.shadowCameraVisible = false;
27
28 this.shadowBias = 0;
29 this.shadowDarkness = 0.5;
30
31 this.shadowMapWidth = 512;
32 this.shadowMapHeight = 512;
33
34 //
35
36 this.shadowMap = null;
37 this.shadowMapSize = null;
38 this.shadowCamera = null;
39 this.shadowMatrix = null;
40
41};
42
43THREE.SpotLight.prototype = Object.create( THREE.Light.prototype );
44
45THREE.SpotLight.prototype.clone = function () {
46
47 var light = new THREE.SpotLight();
48
49 THREE.Light.prototype.clone.call( this, light );
50
51 light.target = this.target.clone();
52
53 light.intensity = this.intensity;
54 light.distance = this.distance;
55 light.angle = this.angle;
56 light.exponent = this.exponent;
57
58 light.castShadow = this.castShadow;
59 light.onlyShadow = this.onlyShadow;
60
61 return light;
62
63};
Note: See TracBrowser for help on using the repository browser.