Skip to content

Commit

Permalink
[arkit] Update for Xcode 9 GM (#2681)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentDondain authored and spouliot committed Sep 14, 2017
1 parent 81ebb7b commit 05dde4c
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 11 deletions.
110 changes: 110 additions & 0 deletions src/arkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@

using System;
using System.ComponentModel;
using XamCore.AVFoundation;
using XamCore.CoreFoundation;
using XamCore.CoreGraphics;
using XamCore.CoreMedia;
using XamCore.CoreVideo;
using XamCore.Foundation;
using XamCore.ObjCRuntime;
using XamCore.Metal;
using XamCore.SpriteKit;
using XamCore.SceneKit;
using XamCore.UIKit;

using Vector2 = global::OpenTK.Vector2;
using Vector3 = global::OpenTK.NVector3;
using Matrix3 = global::OpenTK.NMatrix3;
using Matrix4 = global::OpenTK.NMatrix4;
Expand Down Expand Up @@ -187,6 +190,12 @@ interface ARFrame : NSCopying {
[Export ("capturedImage")]
CVPixelBuffer CapturedImage { get; }

[NullAllowed, Export ("capturedDepthData", ArgumentSemantic.Strong)]
AVDepthData CapturedDepthData { get; }

[Export ("capturedDepthDataTimestamp")]
double CapturedDepthDataTimestamp { get; }

[Export ("camera", ArgumentSemantic.Copy)]
ARCamera Camera { get; }

Expand Down Expand Up @@ -467,6 +476,7 @@ interface ARSessionDelegate : ARSessionObserver {
[iOS (11,0)]
[NoWatch, NoTV, NoMac]
[BaseType (typeof (NSObject))]
[Abstract]
[DisableDefaultCtor]
interface ARConfiguration : NSCopying {

Expand Down Expand Up @@ -509,6 +519,106 @@ interface ARSCNDebugOptions {
[Field ("ARSCNDebugOptionShowFeaturePoints")]
SCNDebugOptions ShowFeaturePoints { get; }
}

[iOS (11,0)]
[NoWatch, NoTV, NoMac]
[Protocol]
interface ARTrackable {
[Abstract]
[Export ("isTracked")]
bool IsTracked { get; }
}

[iOS (11,0)]
[NoWatch, NoTV, NoMac]
[BaseType (typeof(ARConfiguration))]
interface ARFaceTrackingConfiguration {}

[iOS (11,0)]
[NoWatch, NoTV, NoMac]
[BaseType (typeof(ARAnchor))]
interface ARFaceAnchor : ARTrackable {
[Export ("geometry")]
ARFaceGeometry Geometry { get; }

/* Will come in next PR
// @property (readonly, nonatomic) NSDictionary<ARBlendShapeLocation,NSNumber *> * _Nonnull blendShapes;
[Export ("blendShapes")]
NSDictionary<NSString, NSNumber> BlendShapes { get; }
*/
}

[iOS (11,0)]
[NoWatch, NoTV, NoMac]
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
interface ARFaceGeometry : NSCopying {
/* Will come in next PR
[Export ("initWithBlendShapes:")]
IntPtr Constructor (NSDictionary<NSString, NSNumber> blendShapes);
*/

[Export ("vertexCount")]
nuint VertexCount { get; }

[Export ("vertices")]
Vector3 Vertices {
[MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")]
get;
}

[Export ("textureCoordinateCount")]
nuint TextureCoordinateCount { get; }

[Export ("textureCoordinates")]
Vector2 TextureCoordinates {
[MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")]
get;
}

[Export ("triangleCount")]
nuint TriangleCount { get; }

[Export ("triangleIndices")]
short TriangleIndices { get; }
}

[iOS (11,0)]
[NoWatch, NoTV, NoMac]
[BaseType (typeof(SCNGeometry))]
[DisableDefaultCtor]
interface ARSCNFaceGeometry {
[Static]
[Export ("faceGeometryWithDevice:")]
[return: NullAllowed]
ARSCNFaceGeometry CreateFaceGeometry (IMTLDevice device);

[Static]
[Export ("faceGeometryWithDevice:fillMesh:")]
[return: NullAllowed]
ARSCNFaceGeometry CreateFaceGeometry (IMTLDevice device, bool fillMesh);

[Export ("updateFromFaceGeometry:")]
void Update (ARFaceGeometry faceGeometry);
}

[iOS (11,0)]
[NoWatch, NoTV, NoMac]
[BaseType (typeof(ARLightEstimate))]
[DisableDefaultCtor]
interface ARDirectionalLightEstimate {
[Export ("sphericalHarmonicsCoefficients", ArgumentSemantic.Copy)]
NSData SphericalHarmonicsCoefficients { get; }

[Export ("primaryLightDirection")]
Vector3 PrimaryLightDirection {
[MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")]
get;
}

[Export ("primaryLightIntensity")]
nfloat PrimaryLightIntensity { get; }
}
}

#endif // XAMCORE_2_0
11 changes: 0 additions & 11 deletions tests/xtro-sharpie/ios.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,9 @@

# ARKit

## API_DEPRECATED_WITH_REPLACEMENT("projectionMatrixForOrientation:viewportSize:zNear:zFar:", ios(11.0, 11.0));
!missing-selector! ARCamera::projectionMatrixWithViewportSize:orientation:zNear:zFar: not bound
## API_DEPRECATED_WITH_REPLACEMENT("displayTransformForOrientation:viewportSize:", ios(11.0, 11.0));
!missing-selector! ARFrame::displayTransformWithViewportSize:orientation: not bound
## NS_SWIFT_UNAVAILABLE("Use run(_:options:) instead")
!missing-selector! ARSession::runWithConfiguration: not bound

#ARKit

## new, but deprecated (in beta 5), types - but still in headers
!missing-type! ARSessionConfiguration not bound
!missing-type! ARWorldTrackingSessionConfiguration not bound


# AssetLibrary

## typedef is used + untyped enum in ALAssetsLibrary.h: typedef NSUInteger ALAssetsGroupType;
Expand Down

0 comments on commit 05dde4c

Please sign in to comment.