UNPKG

1.38 kBTypeScriptView Raw
1import { ColorRepresentation } from "../math/Color.js";
2import { Light } from "./Light.js";
3
4/**
5 * This light globally illuminates all objects in the scene equally.
6 * @remarks This light cannot be used to cast shadows as it does not have a direction.
7 * @example
8 * ```typescript
9 * const light = new THREE.AmbientLight(0x404040); // soft white light
10 * scene.add(light);
11 * ```
12 * @see {@link https://threejs.org/docs/index.html#api/en/lights/AmbientLight | Official Documentation}
13 * @see {@link https://github.com/mrdoob/three.js/blob/master/src/lights/AmbientLight.js | Source}
14 */
15export class AmbientLight extends Light<undefined> {
16 /**
17 * Creates a new {@link AmbientLight}.
18 * @param color Numeric value of the RGB component of the color. Default `0xffffff`
19 * @param intensity Numeric value of the light's strength/intensity. Expects a `Float`. Default `1`
20 */
21 constructor(color?: ColorRepresentation, intensity?: number);
22
23 /**
24 * Read-only flag to check if a given object is of type {@link AmbientLight}.
25 * @remarks This is a _constant_ value
26 * @defaultValue `true`
27 */
28 readonly isAmbientLight: true;
29
30 /**
31 * A Read-only _string_ to check if `this` object type.
32 * @remarks Sub-classes will update this value.
33 * @defaultValue `AmbientLight`
34 */
35 override readonly type: string | "AmbientLight";
36}