Download node_modules/three/src/lights/Light.js from SimWorld-AI/industrial-harbor-viewer: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/src/lights/Light.js
- Command line
-
hf download hf://spaces/SimWorld-AI/industrial-harbor-viewer/node_modules/three/src/lights/Light.js
-
curl -L -o Light.js https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/src/lights/Light.js
1.17 kB
| import { Object3D } from '../core/Object3D.js'; | |
| import { Color } from '../math/Color.js'; | |
| class Light extends Object3D { | |
| constructor( color, intensity = 1 ) { | |
| super(); | |
| this.isLight = true; | |
| this.type = 'Light'; | |
| this.color = new Color( color ); | |
| this.intensity = intensity; | |
| } | |
| dispose() { | |
| // Empty here in base class; some subclasses override. | |
| } | |
| copy( source, recursive ) { | |
| super.copy( source, recursive ); | |
| this.color.copy( source.color ); | |
| this.intensity = source.intensity; | |
| return this; | |
| } | |
| toJSON( meta ) { | |
| const data = super.toJSON( meta ); | |
| data.object.color = this.color.getHex(); | |
| data.object.intensity = this.intensity; | |
| if ( this.groundColor !== undefined ) data.object.groundColor = this.groundColor.getHex(); | |
| if ( this.distance !== undefined ) data.object.distance = this.distance; | |
| if ( this.angle !== undefined ) data.object.angle = this.angle; | |
| if ( this.decay !== undefined ) data.object.decay = this.decay; | |
| if ( this.penumbra !== undefined ) data.object.penumbra = this.penumbra; | |
| if ( this.shadow !== undefined ) data.object.shadow = this.shadow.toJSON(); | |
| return data; | |
| } | |
| } | |
| export { Light }; | |