Class: Light
Point light source. A single point light source that illuminates all directions. A common example is to simulate the light emitted by a light bulb, where a point light source cannot create shadows.
Hierarchy
LightBase
↳
Light
Constructors
Properties
Accessors
- eventDispatcher
- isStart
- transform
- enable
- range
- at
- radius
- quadratic
- iesProfiles
- iesProfile
- r
- g
- b
- lightColor
- color
- intensity
- castShadow
- shadowIndex
- castGI
- direction
Methods
- stop
- onLateUpdate
- onBeforeUpdate
- onCompute
- onParentChange
- cloneTo
- copyComponent
- beforeDestroy
- init
- start
- onUpdate
- onGraphic
- debug
- debugDraw
- onEnable
- onDisable
- destroy
Constructors
constructor
• new Light()
Overrides
LightBase.constructor
Defined in
src/components/lights/Light.ts:17
Properties
object3D
• object3D: Object3D
= null
owner object3D
Inherited from
LightBase.object3D
Defined in
src/components/ComponentBase.ts:17
isDestroyed
• Optional
isDestroyed: boolean
Inherited from
LightBase.isDestroyed
Defined in
src/components/ComponentBase.ts:38
name
• name: string
light name
Inherited from
LightBase.name
Defined in
src/components/lights/LightBase.ts:21
size
• size: number
= 1
light size
Inherited from
LightBase.size
Defined in
src/components/lights/LightBase.ts:25
lightData
• lightData: LightData
light source data
Inherited from
LightBase.lightData
Defined in
src/components/lights/LightBase.ts:30
dirFix
• dirFix: number
= 1
fix light direction
Inherited from
LightBase.dirFix
Defined in
src/components/lights/LightBase.ts:35
bindOnChange
• bindOnChange: () => void
Type declaration
▸ (): void
Callback function when binding changes
Returns
void
Inherited from
LightBase.bindOnChange
Defined in
src/components/lights/LightBase.ts:40
needUpdateShadow
• needUpdateShadow: boolean
= true
Inherited from
LightBase.needUpdateShadow
Defined in
src/components/lights/LightBase.ts:42
realTimeShadow
• realTimeShadow: boolean
= true
Whether to enable real-time rendering of shadows
Inherited from
LightBase.realTimeShadow
Defined in
src/components/lights/LightBase.ts:47
Accessors
eventDispatcher
• get
eventDispatcher(): CEventDispatcher
Returns
Inherited from
LightBase.eventDispatcher
Defined in
src/components/ComponentBase.ts:23
• set
eventDispatcher(value
): void
Parameters
Name | Type |
---|---|
value | CEventDispatcher |
Returns
void
Inherited from
LightBase.eventDispatcher
Defined in
src/components/ComponentBase.ts:28
isStart
• get
isStart(): boolean
Returns
boolean
Inherited from
LightBase.isStart
Defined in
src/components/ComponentBase.ts:40
transform
• get
transform(): Transform
Return the Transform component attached to the Object3D.
Returns
Inherited from
LightBase.transform
Defined in
src/components/ComponentBase.ts:47
enable
• get
enable(): boolean
Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.
Returns
boolean
Inherited from
LightBase.enable
Defined in
src/components/ComponentBase.ts:68
• set
enable(value
): void
Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
LightBase.enable
Defined in
src/components/ComponentBase.ts:54
range
• get
range(): number
Get the range of the light source
Returns
number
Defined in
src/components/lights/Light.ts:35
• set
range(value
): void
Set the range of the light source
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
src/components/lights/Light.ts:43
at
• get
at(): number
Get the illumination distance of the light source
Memberof
PointLight
Returns
number
Defined in
src/components/lights/Light.ts:54
• set
at(value
): void
Set the illumination distance of the light source
Memberof
PointLight
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
src/components/lights/Light.ts:65
radius
• get
radius(): number
Get the radius to control the light
Returns
number
Defined in
src/components/lights/Light.ts:73
• set
radius(value
): void
Set the radius of the control light
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
src/components/lights/Light.ts:80
quadratic
• get
quadratic(): number
Get the radius to control the light
Returns
number
Defined in
src/components/lights/Light.ts:88
• set
quadratic(value
): void
Set the radius of the control light
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
src/components/lights/Light.ts:95
iesProfiles
• set
iesProfiles(iesProfiles
): void
Parameters
Name | Type |
---|---|
iesProfiles | IESProfiles |
Returns
void
Inherited from
LightBase.iesProfiles
Defined in
src/components/lights/LightBase.ts:117
iesProfile
• get
iesProfile(): IESProfiles
Returns
Inherited from
LightBase.iesProfile
Defined in
src/components/lights/LightBase.ts:124
r
• get
r(): number
Get the red component of the lighting color
Returns
number
Inherited from
LightBase.r
Defined in
src/components/lights/LightBase.ts:131
• set
r(value
): void
Set the red component of the lighting color
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Inherited from
LightBase.r
Defined in
src/components/lights/LightBase.ts:138
g
• get
g(): number
Get the green component of the lighting color
Returns
number
Inherited from
LightBase.g
Defined in
src/components/lights/LightBase.ts:146
• set
g(value
): void
Set the green component of the lighting color
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Inherited from
LightBase.g
Defined in
src/components/lights/LightBase.ts:153
b
• get
b(): number
Get the blue component of the lighting color
Returns
number
Inherited from
LightBase.b
Defined in
src/components/lights/LightBase.ts:161
• set
b(value
): void
Set the blue component of the lighting color
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Inherited from
LightBase.b
Defined in
src/components/lights/LightBase.ts:167
lightColor
• get
lightColor(): Color
Get light source color
Returns
Color
Inherited from
LightBase.lightColor
Defined in
src/components/lights/LightBase.ts:175
• set
lightColor(value
): void
Set light source color
Parameters
Name | Type |
---|---|
value | Color |
Returns
void
Inherited from
LightBase.lightColor
Defined in
src/components/lights/LightBase.ts:182
color
• get
color(): Color
Get light source color
Returns
Color
Inherited from
LightBase.color
Defined in
src/components/lights/LightBase.ts:191
• set
color(value
): void
Set light source color
Parameters
Name | Type |
---|---|
value | Color |
Returns
void
Inherited from
LightBase.color
Defined in
src/components/lights/LightBase.ts:199
intensity
• get
intensity(): number
Get Illumination intensity of light source
Returns
number
number
Inherited from
LightBase.intensity
Defined in
src/components/lights/LightBase.ts:208
• set
intensity(value
): void
Set Illumination intensity of light source
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Inherited from
LightBase.intensity
Defined in
src/components/lights/LightBase.ts:216
castShadow
• get
castShadow(): boolean
Returns
boolean
Inherited from
LightBase.castShadow
Defined in
src/components/lights/LightBase.ts:232
• set
castShadow(value
): void
Cast Light Shadow
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
LightBase.castShadow
Defined in
src/components/lights/LightBase.ts:225
shadowIndex
• get
shadowIndex(): number
get shadow index at shadow map list
Returns
number
Inherited from
LightBase.shadowIndex
Defined in
src/components/lights/LightBase.ts:239
castGI
• get
castGI(): boolean
get gi is enable
Returns
boolean
boolean
Inherited from
LightBase.castGI
Defined in
src/components/lights/LightBase.ts:248
• set
castGI(value
): void
set gi is enable
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
LightBase.castGI
Defined in
src/components/lights/LightBase.ts:255
direction
• get
direction(): Vector3
light source direction
Returns
Vector3
Inherited from
LightBase.direction
Defined in
src/components/lights/LightBase.ts:269
Methods
stop
▸ stop(): void
Returns
void
Inherited from
LightBase.stop
Defined in
src/components/ComponentBase.ts:114
onLateUpdate
▸ Optional
onLateUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
LightBase.onLateUpdate
Defined in
src/components/ComponentBase.ts:118
onBeforeUpdate
▸ Optional
onBeforeUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
LightBase.onBeforeUpdate
Defined in
src/components/ComponentBase.ts:119
onCompute
▸ Optional
onCompute(view?
, command?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
command? | GPUCommandEncoder |
Returns
any
Inherited from
LightBase.onCompute
Defined in
src/components/ComponentBase.ts:120
onParentChange
▸ Optional
onParentChange(lastParent?
, currentParent?
): any
Parameters
Name | Type |
---|---|
lastParent? | Object3D |
currentParent? | Object3D |
Returns
any
Inherited from
LightBase.onParentChange
Defined in
src/components/ComponentBase.ts:122
cloneTo
▸ cloneTo(obj
): void
clone component data to target object3D
Parameters
Name | Type | Description |
---|---|---|
obj | Object3D | target object3D |
Returns
void
Inherited from
LightBase.cloneTo
Defined in
src/components/ComponentBase.ts:129
copyComponent
▸ copyComponent(from
): Light
Parameters
Name | Type |
---|---|
from | Light |
Returns
Inherited from
LightBase.copyComponent
Defined in
src/components/ComponentBase.ts:131
beforeDestroy
▸ beforeDestroy(force?
): void
before release this component, object refrences are not be set null now.
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void
Inherited from
LightBase.beforeDestroy
Defined in
src/components/ComponentBase.ts:198
init
▸ init(): void
Returns
void
Overrides
LightBase.init
Defined in
src/components/lights/Light.ts:21
start
▸ start(): void
Returns
void
Overrides
LightBase.start
Defined in
src/components/lights/Light.ts:102
onUpdate
▸ onUpdate(): void
Returns
void
Overrides
LightBase.onUpdate
Defined in
src/components/lights/Light.ts:107
onGraphic
▸ onGraphic(view?
): void
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
void
Overrides
LightBase.onGraphic
Defined in
src/components/lights/Light.ts:111
debug
▸ debug(): void
enable GUI debug
Returns
void
Defined in
src/components/lights/Light.ts:125
debugDraw
▸ debugDraw(show
): void
Parameters
Name | Type |
---|---|
show | boolean |
Returns
void
Defined in
src/components/lights/Light.ts:128
onEnable
▸ onEnable(): void
Returns
void
Inherited from
LightBase.onEnable
Defined in
src/components/lights/LightBase.ts:106
onDisable
▸ onDisable(): void
Returns
void
Inherited from
LightBase.onDisable
Defined in
src/components/lights/LightBase.ts:111
destroy
▸ destroy(force?
): void
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void
Inherited from
LightBase.destroy