Class: SpotLight

SpotLight

new SpotLight(position, targetPosition, options)

Spotlight category.

Name Type Description
position Cartesian3

光源位置(笛卡尔世界坐标)。

targetPosition Cartesian3

目标点位置(笛卡尔世界坐标),决定聚光方向。

options Object optional

Contains the following attributes:

Name Type Default Description
color Color Color.WHITE optional

Light source color.

intensity Number 2 optional

Light intensity.

distance Number 100 optional

The distance that light can reach, measured in meters.

decay Number 1 optional

The attenuation factor of the light source, the smaller it is, the smaller the attenuation with distance, and the brighter it is.

angle Number Math.PI / 6 optional

Focus range, in radians. //* @ param {Number} [options. enum bra=0.0] Half shadow angle, in radians. // * @param {Number} [options.exponent = 10.0] 。

Members

angleNumber

Get or set the spotlight range, default to Math.PI/6, in radians.

colorColor

Get or set the color of the light source, default is white.

decayNumber

Get or set the attenuation factor of the spotlight light source, the smaller it is, the smaller the attenuation with distance, and the brighter it will be.

distanceNumber

Get or set the distance that spotlight can reach, default is 100 meters.

readonly idNumber

Obtain the spotlight ID.

intensityNumber

Get or set the light intensity of the spotlight.

readonly lightColorColor

Get the color of the spotlight.

positionCartesian3

获取或设置点光源位置,笛卡尔世界坐标。

targetPositionCartesian3

获取或设置聚光灯目标点位置,决定聚光方向,笛卡尔世界坐标。