Constructor
new Glodon.Bimface.Light.LightManager(lightManagerConfig)
Parameters:
Name | Type | Description |
---|---|---|
lightManagerConfig | Glodon.Bimface.Light.LightManagerConfig | 光源管理器配置项 |
Methods
addLight(light)
添加单个光源
Parameters:
Name | Type | Description |
---|---|---|
light | Object | 光源对象,包括SpotLight,DirectionalLight等 |
Returns:
Type | Description |
---|---|
String |
光源对象ID |
clear()
清除所有光源对象,对场景中默认的7盏灯不生效
enableAllLights(enable)
开启/关闭所有光源对象
Parameters:
Name | Type | Description |
---|---|---|
enable | Boolean | 开启/关闭光源对象 |
enableLightsById(ids, enable)
根据ID列表开启/关闭光源对象
Parameters:
Name | Type | Description |
---|---|---|
ids | Array | 光源对象ID列表 |
enable | Boolean | 开启/关闭光源对象 |
enableShadowsById(ids, isEnabled)
根据ID列表设置是否产生阴影
Parameters:
Name | Type | Description |
---|---|---|
ids | Array | 光源对象ID列表 |
isEnabled | Boolean | 光源是否产生阴影 |
getAllDirectionalLights()
获取所有方向光光源对象
Returns:
Type | Description |
---|---|
Array |
方向光光源对象列表 |
getAllFillLights()
获取所有辅助光光源对象
Returns:
Type | Description |
---|---|
Array |
辅助光光源对象列表 |
getAllLights()
获取管理器内的所有光源对象
Returns:
Type | Description |
---|---|
Array |
光源对象列表 |
getAllSpotLights()
获取所有聚光灯光源对象
Returns:
Type | Description |
---|---|
Array |
聚光灯光源对象列表 |
getCSMLight()
获取CSMLight对象
Returns:
Type | Description |
---|---|
Glodon.Bimface.Light.CSMLight |
CSMLight对象 |
getLightById(id)
根据ID获取光源对象
Parameters:
Name | Type | Description |
---|---|---|
id | String | 光源对象id |
Returns:
Type | Description |
---|---|
Object |
光源对象 |
removeLightsById(ids)
根据ID列表移除光源对象,对场景中默认的7盏灯不生效
Parameters:
Name | Type | Description |
---|---|---|
ids | Array | 光源对象ID列表 |
update()
更新光源效果