-
Notifications
You must be signed in to change notification settings - Fork 514
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 iOS 11 beta 1 (new framework) #2187
Conversation
Build failure |
src/arkit.cs
Outdated
nuint Count { get; } | ||
|
||
[Export ("points")] | ||
IntPtr Points { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we expose something better ?
src/arkit.cs
Outdated
|
||
[Static] | ||
[Wrap ("(SCNDebugOptions)_ARSCNDebugOptionShowWorldOrigin")] | ||
SCNDebugOptions ShowWorldOrigin { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BindAsAttribute ? Cc @dalexsoto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not recall adding explicit support for Fields + BindAs but it is worth a try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried, not working, opened bug: https://bugzilla.xamarin.com/show_bug.cgi?id=57537
src/arkit.cs
Outdated
|
||
[Static] | ||
[Wrap ("(SCNDebugOptions)_ARSCNDebugOptionShowFeaturePoints")] | ||
SCNDebugOptions ShowFeaturePoints { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
src/scenekit.cs
Outdated
@@ -2329,22 +2331,22 @@ interface SCNSceneRenderer { | |||
interface SCNSceneRendererDelegate { | |||
|
|||
[Export ("renderer:willRenderScene:atTime:")] | |||
void WillRenderScene ([Protocolize]SCNSceneRenderer renderer, SCNScene scene, double timeInSeconds); | |||
void WillRenderScene (ISCNSceneRenderer renderer, SCNScene scene, double timeInSeconds); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That breaks classic and it seems the API is available on macOS (so we still care)
src/scenekit.cs
Outdated
|
||
[Export ("renderer:didRenderScene:atTime:")] | ||
void DidRenderScene ([Protocolize]SCNSceneRenderer renderer, SCNScene scene, double timeInSeconds); | ||
void DidRenderScene (ISCNSceneRenderer renderer, SCNScene scene, double timeInSeconds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
src/scenekit.cs
Outdated
|
||
[Mac (10,10)] | ||
[Export ("renderer:updateAtTime:")] | ||
void Update ([Protocolize]SCNSceneRenderer renderer, double timeInSeconds); | ||
void Update (ISCNSceneRenderer renderer, double timeInSeconds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
src/scenekit.cs
Outdated
|
||
[Mac (10,10)] | ||
[Export ("renderer:didApplyAnimationsAtTime:")] | ||
void DidApplyAnimations ([Protocolize]SCNSceneRenderer renderer, double timeInSeconds); | ||
void DidApplyAnimations (ISCNSceneRenderer renderer, double timeInSeconds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
src/scenekit.cs
Outdated
|
||
[Mac (10,10)] | ||
[Export ("renderer:didSimulatePhysicsAtTime:")] | ||
void DidSimulatePhysics ([Protocolize]SCNSceneRenderer renderer, double timeInSeconds); | ||
void DidSimulatePhysics (ISCNSceneRenderer renderer, double timeInSeconds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good job, just some minor details 👍
src/arkit.cs
Outdated
[BaseType (typeof(NSObject))] | ||
[DisableDefaultCtor] | ||
interface ARCamera : NSCopying | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, Codig guidelines, should be on the above line. Also this is present in all interfaces
src/arkit.cs
Outdated
|
||
[iOS (11,0)] | ||
[NoWatch, NoTV, NoMac] | ||
[BaseType (typeof(NSObject))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, coding guidelines space typeof (NSObject)
, also present in all typeof
declarations
src/arkit.cs
Outdated
[BaseType (typeof(ARAnchor))] | ||
interface ARPlaneAnchor | ||
{ | ||
// [Export ("initWithTransform:")] marked as NS_UNAVAILABLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any constructors? Is [DisableDefaultCtor]
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, it's not available on ARAnchor
so not on ARPlaneAnchor
either.
src/arkit.cs
Outdated
{ | ||
[Internal] | ||
[Field ("ARSCNDebugOptionShowWorldOrigin")] | ||
int _ARSCNDebugOptionShowWorldOrigin { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be nint
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rolfbjarne Here's the enum signature: public enum SCNDebugOptions : nuint
If I use nuint
instead of int
I'm getting: error BI1014: bgen: Unsupported type for Fields: global::System.UInt32
If I use nint
instead of int
I'm getting: ARKit/ARSCNDebugOptions.g.cs(53,65): error CS0030: Cannot convert type 'System.nint' to 'SceneKit.SCNDebugOptions'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it's time to look at the generator again 😄
Both of those (nuint/nint) should work.
src/arkit.cs
Outdated
|
||
[Internal] | ||
[Field ("ARSCNDebugOptionShowFeaturePoints")] | ||
int _ARSCNDebugOptionShowFeaturePoints { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nint
?
d0443db
to
c6a5164
Compare
Build failure |
1 similar comment
Build failure |
Build failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include a link to your test app in the commit message
@spouliot I did, it's on the commit message, the PR message and I will keep it when squashing. |
build |
Build failure |
The intro error is likely because the framework does not exists on the sim |
Build failure |
@spouliot looks like not: https://gist.github.com/VincentDondain/65785d63d6daa85a0b83a54245642616 This is intro on an iOS 11 device with [Model] disabled for ARSessionObserver. |
@VincentDondain The introspection tests are correct 😉 You had in your first commit
If no
|
Aaaaaaaah indeed indeed, nice catch thanks! <3 |
I totally missed that in the first review so we are even 😛 |
Build failure |
Unrelated mtouch failures. Tracked here: https://bugzilla.xamarin.com/show_bug.cgi?id=57601 |
@rolfbjarne and you re-review and approve (especially since there are some |
Build failure |
src/arkit.cs
Outdated
[Field ("ARSCNDebugOptionShowWorldOrigin")] | ||
// FIXME: Could be using [BindAs (typeof (SCNDebugOptions))]: https://bugzilla.xamarin.com/show_bug.cgi?id=57537 | ||
// FIXME: Should be nuint: https://bugzilla.xamarin.com/show_bug.cgi?id=57535 | ||
int _ARSCNDebugOptionShowWorldOrigin { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use nuint
/ nint
/ nfloat
only if XAMCORE_2_0 btw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to use nuint
/nint
for in Unified, otherwise it will be wrong for 64-bit code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check in the test project somewhere? Maybe xamarin/ios-samples, or a personal git repo. This makes it possible for others to fix any bugs 😄
src/arkit.cs
Outdated
[Field ("ARSCNDebugOptionShowWorldOrigin")] | ||
// FIXME: Could be using [BindAs (typeof (SCNDebugOptions))]: https://bugzilla.xamarin.com/show_bug.cgi?id=57537 | ||
// FIXME: Should be nuint: https://bugzilla.xamarin.com/show_bug.cgi?id=57535 | ||
int _ARSCNDebugOptionShowWorldOrigin { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to use nuint
/nint
for in Unified, otherwise it will be wrong for 64-bit code.
src/arkit.cs
Outdated
[Field ("ARSCNDebugOptionShowFeaturePoints")] | ||
// FIXME: Could be using [BindAs (typeof (SCNDebugOptions))]: https://bugzilla.xamarin.com/show_bug.cgi?id=57537 | ||
// FIXME: Should be nuint: https://bugzilla.xamarin.com/show_bug.cgi?id=57535 | ||
int _ARSCNDebugOptionShowFeaturePoints { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same: you must use a type of the right size.
@VincentDondain if you rebase you should be able to use FieldAttribite with enums now |
Woot will try, thanks @dalexsoto ! |
Updated scenekit.cs `SCNSceneRendererDelegate` to avoid: `ARKit/ARSCNViewDelegate.g.cs(189,43): error CS0432: Alias `Iglobal' not found`
- Fixed the generator to avoid `ARKit/ARSCNViewDelegate.g.cs(189,43): error CS0432: Alias 'Iglobal' not found` - ARPointCloud can be tested with this samples: https://www.dropbox.com/s/0xlz0sdzjj4507s/ARPointCloudTest.zip?dl=0 It requires deploying on devices and moving the camera around so ARKit can return some points. After 5 seconds it should print the points. - Fixed styling. - Added missing simd. - Fixed intro tests. Note: not having [Model] on ARSessionObserver got us: ``` [FAIL] iOSApiProtocolTest.ApiProtocolTest.GeneralCase : 1 types do not really conform to the protocol interfaces [FAIL] Could not load ARKit.ARSessionObserver at Introspection.ApiBaseTest.AssertIfErrors (System.String s, System.Object[] parameters) [0x00054] in /Users/vidondai/Documents/xi-xcode9/xamarin-macios/tests/introspection/ApiBaseTest.cs:143 at Introspection.ApiProtocolTest.GeneralCase () [0x001ec] in /Users/vidondai/Documents/xi-xcode9/xamarin-macios/tests/introspection/ApiProtocolTest.cs:342 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /Users/vidondai/Documents/xi-xcode9/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 ```
Need #2233 for the enum with |
Build failure |
1 similar comment
Build failure |
build |
Build failure |
Build success |
Woot ARKit is now green!!! Merging. |
Merge, Merge, Merge!! |
Updated scenekit.cs
SCNSceneRendererDelegate
to avoid:ARKit/ARSCNViewDelegate.g.cs(189,43): error CS0432: Alias 'Iglobal' not found
Part 2
ARKit/ARSCNViewDelegate.g.cs(189,43): error CS0432: Alias 'Iglobal' not found
It requires deploying on devices and moving the camera around so ARKit can return some points. After 5 seconds it should print the points.