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.
Methods
addLevelState
async addLevelState(startAt: number, levelState: LevelStateInterface): Promise<void, Error>
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: Promise<void, Error>
clear
async clear(): Promise<void, Error>
Returns:
Type: Promise<void, Error>
getLevelStates
Get the level states ordered by startAt distance.
async getLevelStates(): Promise<Array<{ startAt: number, levelState: LevelStateInterface }>, Error>
Returns:
Type: Promise < Array< { startAt: number, levelState: LevelStateInterface } >, Error >
isActive
async isActive(): Promise<boolean, Error>
Returns:
Type: Promise<boolean, Error>
removeLevelState
async removeLevelState(startAt: number): Promise<void, Error>
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: Promise<void, Error>
setActive
async setActive(active: boolean): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
active | boolean | Yes | - |
Returns:
Type: Promise<void, Error>