Skip to content

Commit 2481bba

Browse files
committed
Update swift-4.1-branch to build with Xcode 9.3 beta 1
1 parent 73d6cf2 commit 2481bba

File tree

1 file changed

+53
-4
lines changed

1 file changed

+53
-4
lines changed

stdlib/public/SDK/ARKit/ARKit.swift

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ extension ARCamera {
2727

2828
/** Tracking is limited due to a lack of features visible to the camera. */
2929
case insufficientFeatures
30+
31+
/** Tracking is limited due to a relocalization in progress. */
32+
@available(iOS, introduced: 11.3)
33+
case relocalizing
3034
}
3135

3236
/** Tracking is not available. */
@@ -49,10 +53,20 @@ extension ARCamera {
4953
case .limited:
5054
let reason: TrackingState.Reason
5155

52-
switch __trackingStateReason {
53-
case .initializing: reason = .initializing
54-
case .excessiveMotion: reason = .excessiveMotion
55-
default: reason = .insufficientFeatures
56+
if #available(iOS 11.3, *) {
57+
switch __trackingStateReason {
58+
case .initializing: reason = .initializing
59+
case .relocalizing: reason = .relocalizing
60+
case .excessiveMotion: reason = .excessiveMotion
61+
default: reason = .insufficientFeatures
62+
}
63+
}
64+
else {
65+
switch __trackingStateReason {
66+
case .initializing: reason = .initializing
67+
case .excessiveMotion: reason = .excessiveMotion
68+
default: reason = .insufficientFeatures
69+
}
5670
}
5771

5872
return .limited(reason)
@@ -105,3 +119,38 @@ extension ARFaceGeometry {
105119
return Array(buffer)
106120
}
107121
}
122+
123+
@available(iOS, introduced: 11.3)
124+
extension ARPlaneGeometry {
125+
/**
126+
The mesh vertices of the geometry.
127+
*/
128+
@nonobjc public var vertices: [vector_float3] {
129+
let buffer = UnsafeBufferPointer(start: __vertices, count: Int(__vertexCount))
130+
return Array(buffer)
131+
}
132+
133+
/**
134+
The texture coordinates of the geometry.
135+
*/
136+
@nonobjc public var textureCoordinates: [vector_float2] {
137+
let buffer = UnsafeBufferPointer(start: __textureCoordinates, count: Int(__textureCoordinateCount))
138+
return Array(buffer)
139+
}
140+
141+
/**
142+
The triangle indices of the geometry.
143+
*/
144+
@nonobjc public var triangleIndices: [Int16] {
145+
let buffer = UnsafeBufferPointer(start: __triangleIndices, count: Int(triangleCount * 3))
146+
return Array(buffer)
147+
}
148+
149+
/**
150+
The vertices of the geometry's outermost boundary.
151+
*/
152+
@nonobjc public var boundaryVertices: [vector_float3] {
153+
let buffer = UnsafeBufferPointer(start: __boundaryVertices, count: Int(__boundaryVertexCount))
154+
return Array(buffer)
155+
}
156+
}

0 commit comments

Comments
 (0)