@@ -4,64 +4,91 @@ import {
44 DatabaseDeleteCallbackOptions ,
55 DatabaseUpdateCallbackOptions ,
66} from "@common/abstract/_types.mjs" ;
7+ import { LightData } from "@common/data/_module.mjs" ;
78import { ControlIcon } from "../containers/_module.mjs" ;
9+ import { RenderFlag } from "../interaction/_types.mjs" ;
810import { LightingLayer } from "../layers/_module.mjs" ;
911import { PointDarknessSource , PointLightSource } from "../sources/_module.mjs" ;
12+ import { LightSourceData } from "../sources/base-light-source.mjs" ;
1013import PlaceableObject from "./placeable-object.mjs" ;
1114
1215export default class AmbientLight <
1316 TDocument extends AmbientLightDocument < Scene | null > = AmbientLightDocument < Scene | null > ,
1417> extends PlaceableObject < TDocument > {
15- constructor ( document : TDocument ) ;
18+ static override embeddedName : "AmbientLight" ;
19+
20+ static override RENDER_FLAGS : Record < string , Partial < RenderFlag > > ;
1621
17- /** The area that is affected by this light */
22+ /**
23+ * The area that is affected by this light
24+ */
1825 field : PIXI . Graphics ;
1926
2027 /**
2128 * A reference to the PointSource object which defines this light or darkness area of effect.
2229 * This is undefined if the AmbientLight does not provide an active source of light.
2330 */
24- lightSource ?: PointDarknessSource < this> | PointLightSource < this> ;
25-
26- /** A reference to the ControlIcon used to configure this light */
27- controlIcon : ControlIcon ;
28-
29- static override embeddedName : "AmbientLight" ;
31+ lightSource : PointDarknessSource < this> | PointLightSource < this> | undefined ;
3032
3133 override get bounds ( ) : PIXI . Rectangle ;
3234
33- /** A convenience accessor to the LightData configuration object */
34- get config ( ) : TDocument [ "config" ] ;
35+ /**
36+ * A convenience accessor to the LightData configuration object
37+ */
38+ get config ( ) : LightData < TDocument > ;
3539
36- /** Test whether a specific AmbientLight source provides global illumination */
40+ /**
41+ * Test whether a specific AmbientLight source provides global illumination
42+ */
3743 get global ( ) : boolean ;
3844
39- /** The maximum radius in pixels of the light field */
45+ /**
46+ * The maximum radius in pixels of the light field
47+ */
4048 get radius ( ) : number ;
4149
42- /** Get the pixel radius of dim light emitted by this light source */
50+ /**
51+ * Get the pixel radius of dim light emitted by this light source
52+ */
4353 get dimRadius ( ) : number ;
4454
45- /** Get the pixel radius of bright light emitted by this light source */
55+ /**
56+ * Get the pixel radius of bright light emitted by this light source
57+ */
4658 get brightRadius ( ) : number ;
4759
48- /** Is this ambient light is currently visible based on its hidden state and the darkness level of the Scene? */
60+ /**
61+ * Is this Ambient Light currently visible? By default, true only if the source actively emits light or darkness.
62+ */
4963 get isVisible ( ) : boolean ;
5064
51- /** Check if the point source is a LightSource instance */
65+ /**
66+ * Check if the point source is a LightSource instance
67+ */
5268 get isLightSource ( ) : boolean ;
5369
54- /** Check if the point source is a DarknessSource instance */
70+ /**
71+ * Check if the point source is a DarknessSource instance
72+ */
5573 get isDarknessSource ( ) : boolean ;
5674
57- /** Does this Ambient Light actively emit darkness light given its properties and the current darkness level of the Scene? */
75+ /**
76+ * Does this Ambient Light actively emit darkness light given
77+ * its properties and the current darkness level of the Scene?
78+ */
5879 get emitsDarkness ( ) : boolean ;
5980
6081 /**
61- * Does this Ambient Light actively emit light given its properties and the current darkness level of the Scene?
82+ * Does this Ambient Light actively emit positive light given
83+ * its properties and the current darkness level of the Scene?
6284 */
6385 get emitsLight ( ) : boolean ;
6486
87+ /**
88+ * Is the source of this Ambient Light disabled?
89+ */
90+ protected _isLightSourceDisabled ( ) : boolean ;
91+
6592 /* -------------------------------------------- */
6693 /* Rendering */
6794 /* -------------------------------------------- */
0 commit comments