Class: LightManager
Creates and updates light components.
Constructors
Constructor
new LightManager(): LightManager;
Returns
LightManager
Methods
Create()
static Create(entity, type): Promise<boolean>;
Creates a light component on an entity.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
type | LightType | The light type to create. |
Returns
Promise<boolean>
A promise that resolves to true if the light component was
created, or false otherwise.
Destroy()
static Destroy(entity): Promise<boolean>;
Removes a light component from an entity.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
Returns
Promise<boolean>
A promise that resolves to true if the light component was
removed, or false otherwise.
HasComponent()
static HasComponent(entity): Promise<boolean>;
Checks whether an entity has a light component.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<boolean>
A promise that resolves to true if the entity has a light
component, or false otherwise.
SetEnabled()
static SetEnabled(entity, enabled): Promise<void>;
Sets whether a light component is enabled.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
enabled | boolean | Whether the light component is enabled. |
Returns
Promise<void>
A promise that resolves when the enabled state has been changed.
GetEnabled()
static GetEnabled(entity): Promise<boolean>;
Gets whether a light component is enabled.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<boolean>
A promise that resolves to true if the light component is
enabled, or false otherwise.
SetType()
static SetType(entity, type): Promise<void>;
Sets the light type.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
type | LightType | The light type to assign. |
Returns
Promise<void>
A promise that resolves when the light type has been changed.
GetType()
static GetType(entity): Promise<LightType>;
Gets the light type.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<LightType>
A promise that resolves to the light type.
SetColor()
static SetColor(entity, rgb): Promise<void>;
Sets the light color.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
rgb | vec3 | The RGB color as a vec3, with each channel in the range [0.0, 1.0]. |
Returns
Promise<void>
A promise that resolves when the color has been changed.
GetColor()
static GetColor(entity): Promise<vec3>;
Gets the light color.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<vec3>
A promise that resolves to the RGB color as a vec3, with each
channel in the range [0.0, 1.0].
SetIntensity()
static SetIntensity(entity, intensity): Promise<void>;
Sets the light intensity.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
intensity | number | The light intensity. |
Returns
Promise<void>
A promise that resolves when the intensity has been changed.
GetIntensity()
static GetIntensity(entity): Promise<number>;
Gets the light intensity.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<number>
A promise that resolves to the light intensity.
SetRange()
static SetRange(entity, range): Promise<void>;
Sets the light range.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
range | number | The light range. |
Returns
Promise<void>
A promise that resolves when the range has been changed.
GetRange()
static GetRange(entity): Promise<number>;
Gets the light range.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<number>
A promise that resolves to the light range.
SetSpotAngle()
static SetSpotAngle(entity, angle): Promise<void>;
Sets the spot angle in degrees.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
angle | number | The spot angle in degrees. |
Returns
Promise<void>
A promise that resolves when the spot angle has been changed.
GetSpotAngle()
static GetSpotAngle(entity): Promise<number>;
Gets the spot angle in degrees.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<number>
A promise that resolves to the spot angle in degrees.
SetShadows()
static SetShadows(entity, mode): Promise<void>;
Sets the shadow mode of a light.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
mode | LightShadowMode | The shadow mode to assign. |
Returns
Promise<void>
A promise that resolves when the shadow mode has been changed.
GetShadows()
static GetShadows(entity): Promise<LightShadowMode>;
Gets the shadow mode of a light.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<LightShadowMode>
A promise that resolves to the shadow mode.