Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[arkit] Update for beta 4 #2370

Merged
merged 2 commits into from
Jul 25, 2017
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
12 changes: 12 additions & 0 deletions runtime/bindings-generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1915,6 +1915,18 @@ static IEnumerable<FunctionData> GetFunctionData ()
}
);

data.Add (
new FunctionData {
Comment = " // Matrix4 func (/* UIInterfaceOrientation */ nint)",
Prefix = "simd__",
Variants = Variants.All,
ReturnType = Types.Matrix4f,
Parameters = new ParameterData[] {
new ParameterData { TypeData = Types.NInt },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rolfbjarne why is NInt works here ?
since it did not for the previous declaration, which only builds fine if Int32 and Int64 are used ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a very good question. I'll have a look.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spouliot I can't get the previous declaration to fail if I use NInt, so I'm not sure why it failed. Also if any native type (NInt/NUInt/NFloat) is used in the signature, the binding generator will automatically generate both a 32-bit and 64-bit version of the functions as well, so it should have worked.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see what Jenkins says: PR #2440.

},
}
);

// We must expand functions with native types to their actual type as well.
for (int i = data.Count - 1; i >= 0; i--) {
if (!data [i].HasNativeType)
Expand Down
11 changes: 9 additions & 2 deletions src/arkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ Matrix4 ProjectionMatrix {
[Export ("projectionMatrixWithViewportSize:orientation:zNear:zFar:")]
[MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")]
Matrix4 GetProjectionMatrix (CGSize viewportSize, UIInterfaceOrientation orientation, nfloat zNear, nfloat zFar);

[Export ("viewMatrixForOrientation:")]
[MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")]
Matrix4 GetViewMatrix (UIInterfaceOrientation orientation);
}

[iOS (11,0)]
Expand All @@ -183,10 +187,10 @@ interface ARFrame : NSCopying {
[Export ("anchors", ArgumentSemantic.Copy)]
ARAnchor[] Anchors { get; }

[NullAllowed, Export ("lightEstimate", ArgumentSemantic.Copy)]
[NullAllowed, Export ("lightEstimate", ArgumentSemantic.Strong)]
ARLightEstimate LightEstimate { get; }

[NullAllowed, Export ("rawFeaturePoints")]
[NullAllowed, Export ("rawFeaturePoints", ArgumentSemantic.Strong)]
ARPointCloud RawFeaturePoints { get; }

[Export ("hitTest:types:")]
Expand Down Expand Up @@ -232,6 +236,9 @@ interface ARLightEstimate {

[Export ("ambientIntensity")]
nfloat AmbientIntensity { get; }

[Export ("ambientColorTemperature")]
nfloat AmbientColorTemperature { get; }
}

[iOS (11,0)]
Expand Down