Unity + ARKit 学习使用

在 iOS11 ARkit , CoreML ,SiriKit,HomeKit ,HealthKit,等 其中ARkit , CoreML是最好玩的,为啥这样说那, 领导要求.
ARkit 使用 Visual inertial Odometry(视觉惯性里程计,VIO)来精确跟踪现实世界中的真实场景,VIO 可以将传感器数据和 CoreMotion的数据融合在一起,来提高精确信息.ARKIT 还可以利用摄像头传感器来估算场景中的光线强度,从而在虚拟物体上提供合适的光照.

要解决的问题

1,arkit插件 所有类功能说明 https://zhuanlan.zhihu.com/p/29048586
2,自动化编译到指定工程
3,facetracking 支持的设备系统要求 iphoneX+ ios11.3+ iphone6s+ ios11+ ipadpro+
4,模型文档使用服务器下载后放到沙盒中使用 做的特殊处理问题

https://blog.csdn.net/baidu_25743639/article/details/72898081

将unity项目集成至原工程

1,将unity与iOS工程放置与同一根目录,将Unity工程中的ClassesDataLibraries、‘MapFileParser.sh’文件夹复制到自己的工程根目录。

参考资料
Unity ARKit Plugin 分析
iOS与Unity3d的交互实现
iOS与Unity3d交互
在IOS APP中反复打开和关闭Unity页面
Using the Unity ARKit Plugin to Create Apps for the iPhone & iPad
资料集
Unity ARKit Plugin 分析
SceneKit-RenderLoop渲染循环

遇到的坑

1、/Users/ak/Desktop/philm/code/Philm/Classes/Unity/UnityInterface.h:187:1: Unknown type name ‘bool’
答:
加代码 #include

Having the issue in Unity 2018.1.4f1 as well. Adding #include solved it as well.
However, the bool is only needed for some specific methods, a WWW-related method in my case. Probably only the “more-likely-depricated methods” are bools in these files?
So probably everyone having the problem and planning to update the project in future: Check which methods exactly use them and think about using other ones.
Nevertheless this IS a bug and should be fixed (again).
https://issuetracker.unity3d.com/issues/ios-compile-errors-in-generated-xcode-project-in-unityrendering-dot-h-and-unityinterface-dot-h-for-unknown-type-name-bool

2、clang: warning: argument unused during compilation: ‘-mno-thumb’ [-Wunused-command-line-argument]
/Users/ak/Desktop/philm/code/Philm/Classes/Native/Bulk_UnityEngine.TextRenderingModule_0.cpp:3802:2: error: cannot use ‘try’ with exceptions disabled

3,/Users/ak/Desktop/11112/aro_run_in_main_pro/Libraries/UnityARKitPlugin/Plugins/iOS/UnityARKit/NativeInterface/ARSessionNative.mm:1117:1: Control reaches end of non-void function
解决办法: Mismatched Return Type -> NO

4、启动后直接 crash === was compiled with optimization - stepping may behave oddly; variables may not be available.

答: 1)在xcode 的 Custom Compiler Flags -> Other C Flags 中添加:DRUNTIME_IL2CPP=1
  2) 通過關閉編譯優化。在BuildSetting中分別設置LLVM Code Generation和Swift Code Generation 中的Optimization Level 為None

5、资料链接
官方模式下载地址
Vision 圖像識別框架的使用
官方文档Using Vision in Real Time with ARKit
iOS-ARKit】创建多用户AR体验-Creating a Multiuser AR Experience
SceneKit 的前世今生

你可能感兴趣的:(Unity3d)