Contents

init(url:vertexDescriptor:bufferAllocator:)

Initializes an asset from the file at the specified URL, using the specified vertex descriptor and buffer allocator.

Declaration

init(url URL: URL?, vertexDescriptor: MDLVertexDescriptor?, bufferAllocator: (any MDLMeshBufferAllocator)?)

Parameters

  • URL:

    A URL specifying the location an asset file.

  • vertexDescriptor:

    An object describing the vertex data format to be loaded from the asset, or nil to use the asset’s vertex buffers as found in the file.

  • bufferAllocator:

    The allocator object to use for loading mesh data from the asset, or nil to use a default allocator.

Return Value

A new asset object.

Discussion

Using this initializer is equivalent to using the init(url:vertexDescriptor:bufferAllocator:preserveTopology:error:) initializer, passing false for the preserveTopology parameter and ignoring errors.

See Also

Creating an Asset