levelSelection
TypeScriptget levelSelection(): LevelOfDetailComponent_LevelSelectionSwift declarationvar levelSelection: LevelOfDetailComponent.LevelSelectionThe level selection mode. Defaults to automatic selection based on the strategy.
struct · iOS 27.0+ · SDK 27.1
struct LevelOfDetailComponentA component that enables Level of Detail (LOD) optimization for entities with multiple detail levels. The component allows entities to automatically show/hide child entities based on viewing conditions, reducing rendering complexity for distant or small objects.
get levelSelection(): LevelOfDetailComponent_LevelSelectionSwift declarationvar levelSelection: LevelOfDetailComponent.LevelSelectionThe level selection mode. Defaults to automatic selection based on the strategy.
set levelSelection(value: LevelOfDetailComponent_LevelSelection)Swift declarationvar levelSelection: LevelOfDetailComponent.LevelSelectionThe level selection mode. Defaults to automatic selection based on the strategy.
static addByScreenArea(entity: Entity, levels: Array<{ "entities": Array<Entity>; "minArea": number }>): voidSwift declarationstatic func addByScreenArea(to entity: Entity, levels: [(entities: LevelOfDetailComponent.DetailLevel, minArea: Float)])Adds Level of Detail configuration using screen area-based switching to an entity. Each level pairs a set of entities with a minimum screen area threshold. Entities within a level are shown or hidden together. Thresholds must be in descending order and in the range [0.0, 1.0]. Each entity in the provided levels is added as a child of the entity the component will be added to. Children not included in any level are unaffected by LOD switching. - Parameter levels: An array of levels, where each level specifies the entities to display and the minimum projected screen area (0.0-1.0) at which they are visible.
static addByCameraDistance(entity: Entity, levels: Array<{ "entities": Array<Entity>; "maxDistance": number }>): voidSwift declarationstatic func addByCameraDistance(to entity: Entity, levels: [(entities: LevelOfDetailComponent.DetailLevel, maxDistance: Float)])Adds Level of Detail configuration using distance-based switching to an entity . Each level pairs a set of entities with a maximum camera distance threshold. Entities within a level are shown or hidden together. Thresholds must be in ascending order; the last threshold is typically `.infinity`. Each entity in the provided levels is added as a child of the entity the component will be added to. Children not included in any level are unaffected by LOD switching. - Parameter levels: An array of levels, where each level specifies the entities to display and the maximum camera distance at which they are visible.
static addByResolutionMetric(entity: Entity, levels: Array<{ "entities": Array<Entity>; "switchingResolutions": LevelOfDetailComponent_SelectionStrategy_ResolutionMetric_DirectionalSwitchingResolutions }>, boundingBox: BoundingBox): voidSwift declarationstatic func addByResolutionMetric(to entity: Entity, levels: [(entities: LevelOfDetailComponent.DetailLevel, switchingResolutions: LevelOfDetailComponent.SelectionStrategy.ResolutionMetric.DirectionalSwitchingResolutions)], boundingBox: BoundingBox)Adds Level of Detail configuration using resolution metric-based switching to an entity. Each level pairs a set of entities with a directional switching resolutions struct. Level 0 should have an empty directional switching resolutions struct. Entities within a level are shown or hidden together. Each entity in the provided levels is added as a child of the entity the component will be added to. Children not included in any level are unaffected by LOD switching. - Parameters: - levels: An array of levels, where each level specifies the entities to display and the level's associated directional switching resolutions. - boundingBox: The bounding box of the entity used when calculating the switching resolutions .
static init(levels: Array<Array<Entity>>, strategy: LevelOfDetailComponent_SelectionStrategy): LevelOfDetailComponentSwift declarationinit(levels: [LevelOfDetailComponent.DetailLevel], switchingAt strategy: LevelOfDetailComponent.SelectionStrategy)Creates a new Level of Detail component. - Parameters: - levels: Array of detail levels, where each level contains entities to show at that level. - strategy: The selection strategy with threshold values.
get levels(): Array<Array<Entity>>Swift declarationvar levels: [LevelOfDetailComponent.DetailLevel]set levels(value: Array<Array<Entity>>)Swift declarationvar levels: [LevelOfDetailComponent.DetailLevel]get strategy(): LevelOfDetailComponent_SelectionStrategySwift declarationvar strategy: LevelOfDetailComponent.SelectionStrategyset strategy(value: LevelOfDetailComponent_SelectionStrategy)Swift declarationvar strategy: LevelOfDetailComponent.SelectionStrategyNo declarations were skipped in this snapshot.