One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

LowLevelInstanceData

class · iOS 26.0+ · SDK 27.1

final class LowLevelInstanceData

Members (10)

init · iOS 26.0+

init

TypeScript
static initInstanceCountInstanceCapacity(instanceCount: number, instanceCapacity: number): LowLevelInstanceData
Swift declaration
init(instanceCount: Int, instanceCapacity: Int) throws

Creates a low-level instance data object with an instance count and capacity. - Parameters: - instanceCount: The number of instances this low-level instance data. - instanceCapacity: The maximum number of instances this low-level instance data can hold.

init · iOS 26.0+

init

TypeScript
static initInstanceCount(instanceCount: number): LowLevelInstanceData
Swift declaration
convenience init(instanceCount: Int) throws

Creates a low-level instance data object with an instance count. This initializer also applies the instance count to ``instanceCapacity``. - Parameter instanceCount: The number of instances in this instance data object.

get · iOS 26.0+

instanceCount

TypeScript
get instanceCount(): number
Swift declaration
final var instanceCount: Int { get set }

The current number of instances in this low-level instance data.

set · iOS 26.0+

instanceCount

TypeScript
set instanceCount(value: number)
Swift declaration
final var instanceCount: Int { get set }

The current number of instances in this low-level instance data.

method · iOS 26.0+

withTransforms

TypeScript
withTransforms(callback: ((arg0: SDKHandle) => void)): void
Swift declaration
final func withTransforms(_ callback: (UnsafeBufferPointer<float4x4>) -> Void)

Reads the per instance transform data synchronously on the CPU. The transform buffer provided is only valid for the lifetime of the callback.

get · iOS 26.0+

instanceCapacity

TypeScript
get instanceCapacity(): number
Swift declaration
final var instanceCapacity: Int { get }

The maximum number of instances this low-level instance data draws when set on a mesh instances component. ``instanceCount`` must be less than or equal to the `instanceCapacity` determined on initialization.

method · iOS 26.0+

withMutableTransforms

TypeScript
withMutableTransforms(callback: ((arg0: SDKHandle) => void)): void
Swift declaration
final func withMutableTransforms(_ callback: (UnsafeMutableBufferPointer<float4x4>) -> Void)

Updates the per instance transform data synchronously on the CPU. The transform buffer provided is only valid for the lifetime of the callback.

method · iOS 26.0+

replaceMutableTransforms

TypeScript
replaceMutableTransforms(callback: ((arg0: SDKHandle) => void)): void
Swift declaration
final func replaceMutableTransforms(_ callback: (UnsafeMutableBufferPointer<float4x4>) -> Void)

Replaces the per instance transform data synchronously on the CPU. The transform buffer's contents are unspecified, and it is the caller's responsibility to populate the buffer with valid data. The transform buffer provided is only valid for the lifetime of the callback.

method · iOS 26.0+

read

TypeScript
read(commandBuffer: SDKHandle): SDKHandle
Swift declaration
final func read(using commandBuffer: any MTLCommandBuffer) -> any MTLBuffer

Retrieves the current per instance transform data, for GPU reading.

method · iOS 26.0+

replace

TypeScript
replace(commandBuffer: SDKHandle): SDKHandle
Swift declaration
final func replace(using commandBuffer: any MTLCommandBuffer) -> any MTLBuffer

Retrieves a Metal buffer that you can use to replace the per instance transform data on GPU using Metal. The transform buffer's contents are in an uninitialized state. The caller supplies the MTLCommandBuffer that they intend to use for transform buffer modifications. RealityKit will wait for the MTLCommandBuffer to complete before utilizing the transform buffer for rendering.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →