One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

ModelSortGroup

struct · iOS 18.0+ · SDK 27.1

struct ModelSortGroup

A group that you assign to multiple entities to tell the renderer what order and how to render the entities in the group. Each model sort group relates model entities to each other so that you can define what order the renderer draws them. Pass the same model sort group instance to each ``ModelSortGroupComponent`` whose entity you want to group, along with an order number for that entity within the group. ```swift let group1 = ModelSortGroup() entityA.components.set( ModelSortGroupComponent(group: group1, order: 0) ) entityB.components.set( ModelSortGroupComponent(group: group1, order: 1) ) ``` In the example above, the renderer draws `entityA` before `entityB`. Each `ModelSortGroup` instance represent a unique group. ```swift let group2 = ModelSortGroup() entityC.components.set( ModelSortGroupComponent(group: group2, order: 2) ) entityD.components.set( ModelSortGroupComponent(group: group2, order: 3) ) ``` In this example, `entityC` and `entityD` are in the same group as each other, but in a different group than `entityA` and `entityB`.

Members (6)

get · iOS 18.0+

planarUIInline

TypeScript
static get planarUIInline(): ModelSortGroup
Swift declaration
static let planarUIInline: ModelSortGroup

A model sort group that instructs the renderer to draw a model's mesh along with a SwiftUI layer that's coincident with the mesh. See ``ModelSortGroup/PlanarUIPlacement-swift.enum`` for usage.

get · iOS 18.0+

planarUIPlacement

TypeScript
get planarUIPlacement(): (ModelSortGroup_PlanarUIPlacement) | null
Swift declaration
var planarUIPlacement: ModelSortGroup.PlanarUIPlacement? { get }

A planar placement instance that controls how the renderer draws a model relative to a planar mesh or a SwiftUI view that's coplanar and overlapping. Set to `nil` when the renderer doesn't need planar sort the group. setting the property to `nil`.

get · iOS 18.0+

planarUIAlwaysBehind

TypeScript
static get planarUIAlwaysBehind(): ModelSortGroup
Swift declaration
static let planarUIAlwaysBehind: ModelSortGroup

A model sort group that instructs the renderer to draw a model's mesh behind a SwiftUI layer that's coincident with the mesh. See ``ModelSortGroup/PlanarUIPlacement-swift.enum`` for usage.

get · iOS 18.0+

planarUIAlwaysInFront

TypeScript
static get planarUIAlwaysInFront(): ModelSortGroup
Swift declaration
static let planarUIAlwaysInFront: ModelSortGroup

A model sort group that instructs the renderer to draw a model's mesh in front of a SwiftUI layer that's coincident with the mesh. See ``ModelSortGroup/PlanarUIPlacement-swift.enum`` for usage.

init · iOS 18.0+

init

TypeScript
static init(depthPass?: (ModelSortGroup_DepthPass) | null): ModelSortGroup
Swift declaration
init(depthPass: ModelSortGroup.DepthPass? = nil)

Creates a model sort group with an optional depth pass. - Parameter depthPass: A depth pass instance that tells the group how to draw the model entity's color relative to its depth.

get · iOS 18.0+

depthPass

TypeScript
get depthPass(): (ModelSortGroup_DepthPass) | null
Swift declaration
var depthPass: ModelSortGroup.DepthPass? { get }

A depth pass that controls when the renderer draws the depth of model entities in the group relative to their color. You can tell the renderer to draw the depth and color together by setting the value to `nil`.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →