LevelOfDetails
LevelsOfDetails is a class used to update an AdsumObject depending on the distance to the camera.
Only one state will be applied at a time.
Meaning if you have state A starting at 10 & B starting at 50 then at distance 60 only B will be applied.
Properties
active
Type | Read-Only | Defaults | Description |
---|---|---|---|
boolean | No | true | Is the levelOfDetails applied. Use this to disable it by object |
Methods
addLevelState
addLevelState(startAt: number, levelState: LevelStateInterface): LevelOfDetails
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
startAt | number | Yes | - | The distance in meters at which the effect should apply |
levelState | LevelStateInterface | Yes | - | The effect to apply. You can provide any custom object implementing that interface. |
Returns:
Type: LevelOfDetails
clear
clear(): LevelOfDetails
Returns:
Type: LevelOfDetails
getLevelStates
Get the level states ordered by startAt distance.
getLevelStates(): Array<{startAt: number, levelState: AbstractLevelState}>
Returns:
Type: Array< { startAt: number, levelState: LevelStateInterface } >
removeLevelState
removeLevelState(startAt: number): LevelOfDetails
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
startAt | number | Yes | - | The distance in meters at which the effect should apply |
levelState | LevelStateInterface | Yes | - | The effect to apply. You can provide any custom object implementing that interface. |
Returns:
Type: LevelOfDetails