addByResolutionMetric(to:levels:boundingBox:)
Adds Level of Detail configuration using resolution metric-based switching to an entity.
Declaration
static func addByResolutionMetric(to entity: Entity, levels: [(entities: LevelOfDetailComponent.DetailLevel, switchingResolutions: LevelOfDetailComponent.SelectionStrategy.ResolutionMetric.DirectionalSwitchingResolutions)], boundingBox: BoundingBox)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 .
Discussion
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.