Swift 我的资产没有';当我从ARGeoTrackingConfiguration切换到ARWorldTrackingConfiguration时,t将持续并出现
中断的代码将资源加载到ARView.session中,并且它们呈现良好。问题是,我找不到一种方法来阻止它们朝向摄像机。我希望能够绕着它们走,所以我正在切换配置Swift 我的资产没有';当我从ARGeoTrackingConfiguration切换到ARWorldTrackingConfiguration时,t将持续并出现,swift,arkit,realitykit,arworldmap,Swift,Arkit,Realitykit,Arworldmap,中断的代码将资源加载到ARView.session中,并且它们呈现良好。问题是,我找不到一种方法来阻止它们朝向摄像机。我希望能够绕着它们走,所以我正在切换配置 func placeAnchorEntity(entity:Entity, anchor: ARGeoAnchor, text:String){ print(entity.debugDescription) let
func placeAnchorEntity(entity:Entity, anchor: ARGeoAnchor, text:String){
print(entity.debugDescription)
let geoAnchorEntity = AnchorEntity(anchor: anchor)
let scale = self.objectScaleValue!
entity.scale = SIMD3<Float>(scale, scale, scale)
let orientation = simd_quatf.init(angle: -Float.pi/3.5, axis: self.orientationAxis)
entity.orientation = orientation
entity.position = objectPosition
geoAnchorEntity.addChild(entity)
print("I'm the children description! \(geoAnchorEntity.children.description)")
self.arView.scene.addAnchor(geoAnchorEntity)
我是否需要包括任何会话方法/管道?我为地理追踪和纵火行动准备了它们。
非常感谢
奖金问题:
我这样做是为了能够访问ARConfiguration.WorldAlignment.gravity/gravity和heading,并在用户走动时使资源停留在一个地方。基本上,不是由摄像机引导的。在ARGeoTrackingConfiguration中有没有办法做到这一点
var arWorldTracking = ARWorldTrackingConfiguration.init()
arWorldTracking.worldAlignment = .gravity
arWorldTracking.frameSemantics.insert(.personSegmentationWithDepth)
arView.session.run(arWorldTracking)
self.trackingStateLabel.text = "\n -- \(text) Object placed ✅ at \(String(describing: self.objectCoordinate))"
}