Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions stdlib/public/SDK/ARKit/ARKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,60 @@ extension ARPlaneGeometry {
return Array(buffer)
}
}

@available(iOS, introduced: 12.0)
extension ARPlaneAnchor {
/**
A value describing the classification of a plane anchor.
*/
public enum Classification {

public enum Status {

/** Plane classification is currently unavailable. */
case notAvailable

/** ARKit has not yet determined the classification of this plane. */
case undetermined

/** ARKit is confident the plane is not any of the known classes. */
case unknown
}

/** The classification is not any of the known classes. */
case none(Status)

case wall

case floor

case ceiling

case table

case seat
}


/**
Classification of the plane.
*/
public var classification: ARPlaneAnchor.Classification {
switch __classification {
case .wall: return .wall
case .floor: return .floor
case .ceiling: return .ceiling
case .table: return .table
case .seat: return .seat
case .none: fallthrough
default:
switch __classificationStatus {
case .notAvailable: return .none(.notAvailable)
case .unknown: return .none(.unknown)
case .undetermined: fallthrough
case .known: fallthrough
default: return .none(.undetermined)
}
}
}
}
8 changes: 4 additions & 4 deletions stdlib/public/SDK/Metal/Metal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ extension MTLRenderCommandEncoder {
public func useHeaps(_ heaps: [MTLHeap]) {
__use(heaps, count: heaps.count)
}
#if os(macOS)
@available(macOS 10.13, *)

#if os(macOS) || os(iOS)
@available(macOS 10.13, iOS 12.0, *)
public func setViewports(_ viewports: [MTLViewport]) {
__setViewports(viewports, count: viewports.count)
}

@available(macOS 10.13, *)
@available(macOS 10.13, iOS 12.0, *)
public func setScissorRects(_ scissorRects: [MTLScissorRect]) {
__setScissorRects(scissorRects, count: scissorRects.count)
}
Expand Down