Class: DirectLight
Directional light source. The light of this light source is parallel, for example, sunlight. This light source can generate shadows.
Hierarchy
LightBase
↳
DirectLight
Constructors
Properties
Accessors
- eventDispatcher
- isStart
- transform
- enable
- radius
- indirect
- iesProfiles
- iesProfile
- r
- g
- b
- lightColor
- color
- intensity
- castShadow
- shadowIndex
- castGI
- direction
Methods
- stop
- onUpdate
- onLateUpdate
- onBeforeUpdate
- onCompute
- onGraphic
- onParentChange
- onAddChild
- onRemoveChild
- cloneTo
- copyComponent
- beforeDestroy
- init
- start
- debug
- onEnable
- onDisable
- destroy
Constructors
constructor
• new DirectLight(): DirectLight
Returns
Overrides
LightBase.constructor
Defined in
src/components/lights/DirectLight.ts:16
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
shadowCamera
• shadowCamera: Camera3D
Defined in
src/components/lights/DirectLight.ts:14
name
• name: string
light name
Inherited from
LightBase.name
Defined in
src/components/lights/LightBase.ts:22
size
• size: number
= 1
light size
Inherited from
LightBase.size
Defined in
src/components/lights/LightBase.ts:26
lightData
• lightData: LightData
light source data
Inherited from
LightBase.lightData
Defined in
src/components/lights/LightBase.ts:31
dirFix
• dirFix: number
= 1
fix light direction
Inherited from
LightBase.dirFix
Defined in
src/components/lights/LightBase.ts:36
bindOnChange
• bindOnChange: () => void
Callback function when binding changes
Type declaration
▸ (): void
Callback function when binding changes
Returns
void
Inherited from
LightBase.bindOnChange
Defined in
src/components/lights/LightBase.ts:41
needUpdateShadow
• needUpdateShadow: boolean
= true
Inherited from
LightBase.needUpdateShadow
Defined in
src/components/lights/LightBase.ts:43
realTimeShadow
• realTimeShadow: boolean
= true
Whether to enable real-time rendering of shadows
Inherited from
LightBase.realTimeShadow
Defined in
src/components/lights/LightBase.ts:48
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
radius
• get
radius(): number
Get the radius of a directional light source
Returns
number
Defined in
src/components/lights/DirectLight.ts:40
• set
radius(value
): void
Set the radius of a directional light source
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
src/components/lights/DirectLight.ts:47
indirect
• get
indirect(): number
Get the radius of a directional light source
Returns
number
Defined in
src/components/lights/DirectLight.ts:56
• set
indirect(value
): void
Set the radius of a directional light source
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
src/components/lights/DirectLight.ts:63
iesProfiles
• set
iesProfiles(iesProfiles
): void
Parameters
Name | Type |
---|---|
iesProfiles | IESProfiles |
Returns
void
Inherited from
LightBase.iesProfiles
Defined in
src/components/lights/LightBase.ts:125
iesProfile
• get
iesProfile(): IESProfiles
Returns
Inherited from
LightBase.iesProfile
Defined in
src/components/lights/LightBase.ts:132
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:139
• 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:146
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:154
• 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:161
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:169
• 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:175
lightColor
• get
lightColor(): Color
Get light source color
Returns
Color
Inherited from
LightBase.lightColor
Defined in
src/components/lights/LightBase.ts:183
• 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:190
color
• get
color(): Color
Get light source color
Returns
Color
Inherited from
LightBase.color
Defined in
src/components/lights/LightBase.ts:199
• 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:207
intensity
• get
intensity(): number
Get Illumination intensity of light source
Returns
number
number
Inherited from
LightBase.intensity
Defined in
src/components/lights/LightBase.ts:216
• 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:224
castShadow
• get
castShadow(): boolean
Returns
boolean
Inherited from
LightBase.castShadow
Defined in
src/components/lights/LightBase.ts:240
• 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:233
shadowIndex
• get
shadowIndex(): number
get shadow index at shadow map list
Returns
number
Inherited from
LightBase.shadowIndex
Defined in
src/components/lights/LightBase.ts:247
castGI
• get
castGI(): boolean
get gi is enable
Returns
boolean
boolean
Inherited from
LightBase.castGI
Defined in
src/components/lights/LightBase.ts:256
• 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:263
direction
• get
direction(): Vector3
light source direction
Returns
Vector3
Inherited from
LightBase.direction
Defined in
src/components/lights/LightBase.ts:277
Methods
stop
▸ stop(): void
Returns
void
Inherited from
LightBase.stop
Defined in
src/components/ComponentBase.ts:114
onUpdate
▸ onUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
LightBase.onUpdate
Defined in
src/components/ComponentBase.ts:117
onLateUpdate
▸ onLateUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
LightBase.onLateUpdate
Defined in
src/components/ComponentBase.ts:118
onBeforeUpdate
▸ onBeforeUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
LightBase.onBeforeUpdate
Defined in
src/components/ComponentBase.ts:119
onCompute
▸ onCompute(view?
, command?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
command? | GPUCommandEncoder |
Returns
any
Inherited from
LightBase.onCompute
Defined in
src/components/ComponentBase.ts:120
onGraphic
▸ onGraphic(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
LightBase.onGraphic
Defined in
src/components/ComponentBase.ts:121
onParentChange
▸ onParentChange(lastParent?
, currentParent?
): any
Parameters
Name | Type |
---|---|
lastParent? | Object3D |
currentParent? | Object3D |
Returns
any
Inherited from
LightBase.onParentChange
Defined in
src/components/ComponentBase.ts:122
onAddChild
▸ onAddChild(child
): any
Parameters
Name | Type |
---|---|
child | Object3D |
Returns
any
Inherited from
LightBase.onAddChild
Defined in
src/components/ComponentBase.ts:123
onRemoveChild
▸ onRemoveChild(child
): any
Parameters
Name | Type |
---|---|
child | Object3D |
Returns
any
Inherited from
LightBase.onRemoveChild
Defined in
src/components/ComponentBase.ts:124
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:131
copyComponent
▸ copyComponent(from
): this
Parameters
Name | Type |
---|---|
from | this |
Returns
this
Inherited from
LightBase.copyComponent
Defined in
src/components/ComponentBase.ts:133
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:200
init
▸ init(): void
Returns
void
Overrides
LightBase.init
Defined in
src/components/lights/DirectLight.ts:20
start
▸ start(): void
Returns
void
Overrides
LightBase.start
Defined in
src/components/lights/DirectLight.ts:31
debug
▸ debug(): void
enable light debug gui
Returns
void
Defined in
src/components/lights/DirectLight.ts:90
onEnable
▸ onEnable(): void
Returns
void
Inherited from
LightBase.onEnable
Defined in
src/components/lights/LightBase.ts:114
onDisable
▸ onDisable(): void
Returns
void
Inherited from
LightBase.onDisable
Defined in
src/components/lights/LightBase.ts:119
destroy
▸ destroy(force?
): void
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void
Inherited from
LightBase.destroy