我已经构建了一个在Unity上的ARCOre预览1包上运行的应用程序。我知道谷歌在预览2中做了重大改变。 我的问题是,为了在预览2上运行我的ARCore预览1应用程序,我必须做出哪些更改?
答案 0 :(得分:1)
查看预览2示例应用程序中的代码并相应地更新代码。例如,以下是将对象正确实例化为AR场景的新代码:
if (Session.Raycast(touch.position.x, touch.position.y, raycastFilter, out hit))
{
var andyObject = Instantiate(AndyAndroidPrefab, hit.Pose.position,
hit.Pose.rotation);
// Create an anchor to allow ARCore to track the hitpoint
// as understanding of the physical world evolves.
var anchor = hit.Trackable.CreateAnchor(hit.Pose);
// Andy should look at the camera but still be flush with the plane.
andyObject.transform.LookAt(FirstPersonCamera.transform);
andyObject.transform.rotation = Quaternion.Euler(0.0f,
andyObject.transform.rotation.eulerAngles.y,
andyObject.transform.rotation.z);
// Make Andy model a child of the anchor.
andyObject.transform.parent = anchor.transform;
}
答案 1 :(得分:0)
常见
预览1使用可在预览2中更改Ar-Core服务的Tango Core服务。
处理自动屏幕旋转。
某些类被改变,就像之后的某些原因一样。
对于用户:
介绍AR贴纸
对于开发者:
用于Android NDK的新C API,它补充了我们现有的Java,Unity和Unreal SDK;
让AR应用暂停和恢复AR会话的功能,例如让用户在接听电话后返回AR应用;
提高锚点,平面查找和点云API的准确性和运行时效率。
答案 2 :(得分:0)
我已将我的应用从预览1更新为预览2.并且它不是很多。它有一些小的API更改,如点击标记,Pose.position等。在这里发布更改日志可能是愚蠢的。我建议你可以提交以下步骤:
这不是一项繁琐的工作,我也可以用5到10分钟来升级它。
干杯!