three
Version:
JavaScript 3D library
74 lines (60 loc) • 1.27 kB
TypeScript
import { Color } from './../math/Color';
import { Vector3 } from '../math/Vector3';
import { Object3D } from './../core/Object3D';
import { SpotLightShadow } from './SpotLightShadow';
import { Light } from './Light';
/**
* A point light that can cast shadow in one direction.
*/
export class SpotLight extends Light {
constructor(
color?: Color | string | number,
intensity?: number,
distance?: number,
angle?: number,
penumbra?: number,
decay?: number
);
/**
* @default 'SpotLight'
*/
type: string;
/**
* @default THREE.Object3D.DefaultUp
*/
position: Vector3;
/**
* Spotlight focus points at target.position.
* @default new THREE.Object3D()
*/
target: Object3D;
/**
* Light's intensity.
* @default 1
*/
intensity: number;
/**
* If non-zero, light will attenuate linearly from maximum intensity at light position down to zero at distance.
* @default 0
*/
distance: number;
/**
* Maximum extent of the spotlight, in radians, from its direction.
* @default Math.PI / 3.
*/
angle: number;
/**
* @default 1
*/
decay: number;
/**
* @default new THREE.SpotLightShadow()
*/
shadow: SpotLightShadow;
power: number;
/**
* @default 0
*/
penumbra: number;
readonly isSpotLight: true;
}