Skip to content

Commit

Permalink
Adds doc for SpotLight - WhitestormJS#189
Browse files Browse the repository at this point in the history
Former-commit-id: 8b665b2
  • Loading branch information
hirako2000 committed Jun 20, 2017
1 parent d7d5b38 commit 3cff6d5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/components/lights/SpotLight.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
import {SpotLight as SpotLightNative} from 'three';
import {LightComponent} from '../../core/LightComponent';

/**
* @class SpotLight
* @category components/lights
* @description SpotLight creates spot light that can cast shadow in one direction. <br/><br/>
* It has the same parameters as AmbientLight in light, but it also supports pos and target. <br/><br/>
* SpotLight affects meshes with lambert and phong material.
* @param {Object} [params={light: {color: 0xffffff, intensity: 1, distance: 100, angle: Math.PI / 3, exponent: 0, decay: 1}}] - The params.
* @extends LightComponent
* @memberof module:components/lights
* @example <caption>Creating a SpotLight that falls down from vec3(10, 20, 10) to vec3(0, 0, 0)</caption>
* new LightComponent({
* light: {
* color: 0x00ff00,
* intensity: 3,
* distance: 1000
* },
*
* position: [10, 20, 10]
* }).addTo(app);
*/
class SpotLight extends LightComponent {
static defaults = {
...LightComponent.defaults,
Expand Down

0 comments on commit 3cff6d5

Please sign in to comment.