mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-23 03:45:56 +10:00
This buggy pattern ("something = parameter || nonzero value") exists at more places though elsewhere setting to zero doesn't make that much sense (e.g. in geometries).
Not sure if we should change it everywhere to proper pattern ("something = ( parameter !== undefined ) ? parameter : value").
Maybe it would be good for establishing habit. I remember fixing this buggy pattern long ago but it just keeps popping up.
17 lines
448 B
JavaScript
17 lines
448 B
JavaScript
/**
|
|
* @author mr.doob / http://mrdoob.com/
|
|
*/
|
|
|
|
THREE.DirectionalLight = function ( hex, intensity, distance ) {
|
|
|
|
THREE.Light.call( this, hex );
|
|
|
|
this.position = new THREE.Vector3( 0, 1, 0 );
|
|
this.intensity = ( intensity !== undefined ) ? intensity : 1;
|
|
this.distance = ( distance !== undefined ) ? distance : 0;
|
|
|
|
};
|
|
|
|
THREE.DirectionalLight.prototype = new THREE.Light();
|
|
THREE.DirectionalLight.prototype.constructor = THREE.DirectionalLight;
|