Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift ARCore在语义上是否与ARKit';s";“让飞机锚定”吗;?_Swift_Kotlin_Augmented Reality_Arkit_Arcore - Fatal编程技术网

Swift ARCore在语义上是否与ARKit';s";“让飞机锚定”吗;?

Swift ARCore在语义上是否与ARKit';s";“让飞机锚定”吗;?,swift,kotlin,augmented-reality,arkit,arcore,Swift,Kotlin,Augmented Reality,Arkit,Arcore,我想知道在ARCore/Kotlin中是否有类似的语义结构,比如ARKit/Swift中的guard let语句 let anchor: ARAnchor? guard let planeAnchor = anchor as? ARPlaneAnchor else { print("condition not met") return } 我想我已经找到了ARCore的planeAnchor与Elvis操作符和safe cast操作符所需的语义: public class

我想知道在
ARCore
/
Kotlin
中是否有类似的语义结构,比如
ARKit
/
Swift
中的
guard let
语句

let anchor: ARAnchor?

guard let planeAnchor = anchor as? ARPlaneAnchor else { 
    print("condition not met")
    return 
}

我想我已经找到了ARCore的
planeAnchor
Elvis操作符safe cast操作符所需的语义:

public class CenterPosePlaneAnchor { ... }

val anchor: Anchor?
val info = "condition not met"

val planeAnchor = anchor as? CenterPosePlaneAnchor ?: return println(info)