One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

LevelOfDetailComponent

struct · iOS 27.0+ · SDK 27.1

struct LevelOfDetailComponent

A 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.

Members (10)

get · iOS 27.0+

levelSelection

TypeScript
get levelSelection(): LevelOfDetailComponent_LevelSelection
Swift declaration
var levelSelection: LevelOfDetailComponent.LevelSelection

The level selection mode. Defaults to automatic selection based on the strategy.

set · iOS 27.0+

levelSelection

TypeScript
set levelSelection(value: LevelOfDetailComponent_LevelSelection)
Swift declaration
var levelSelection: LevelOfDetailComponent.LevelSelection

The level selection mode. Defaults to automatic selection based on the strategy.

static · iOS 27.0+

addByScreenArea

TypeScript
static addByScreenArea(entity: Entity, levels: Array<{ "entities": Array<Entity>; "minArea": number }>): void
Swift declaration
static 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 · iOS 27.0+

addByCameraDistance

TypeScript
static addByCameraDistance(entity: Entity, levels: Array<{ "entities": Array<Entity>; "maxDistance": number }>): void
Swift declaration
static 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 · iOS 27.0+

addByResolutionMetric

TypeScript
static addByResolutionMetric(entity: Entity, levels: Array<{ "entities": Array<Entity>; "switchingResolutions": LevelOfDetailComponent_SelectionStrategy_ResolutionMetric_DirectionalSwitchingResolutions }>, boundingBox: BoundingBox): void
Swift declaration
static 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 .

init · iOS 27.0+

init

TypeScript
static init(levels: Array<Array<Entity>>, strategy: LevelOfDetailComponent_SelectionStrategy): LevelOfDetailComponent
Swift declaration
init(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 · iOS 27.0+

levels

TypeScript
get levels(): Array<Array<Entity>>
Swift declaration
var levels: [LevelOfDetailComponent.DetailLevel]
set · iOS 27.0+

levels

TypeScript
set levels(value: Array<Array<Entity>>)
Swift declaration
var levels: [LevelOfDetailComponent.DetailLevel]
get · iOS 27.0+

strategy

TypeScript
get strategy(): LevelOfDetailComponent_SelectionStrategy
Swift declaration
var strategy: LevelOfDetailComponent.SelectionStrategy
set · iOS 27.0+

strategy

TypeScript
set strategy(value: LevelOfDetailComponent_SelectionStrategy)
Swift declaration
var strategy: LevelOfDetailComponent.SelectionStrategy

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →