【发布时间】:2022-02-13 03:21:06
【问题描述】:
问题在于它会上升到原点......而不仅仅是旋转自身。
anchorEntity.anchoring = AnchoringComponent(anchor)
anchorEntity.addChild(modelEntityClone)
anchorEntity.addChild(downEntity)
anchorEntity.addChild(sideEntity)
anchorEntity.addChild(rightEntity)
anchorEntity.name = name
arView.scene.addAnchor(anchorEntity)
arView.scene.addAnchor(planeEntity)
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
print("after 3 sec")
let radians = 90.0 * Float.pi / 180.0
let currentMatrix = anchorEntity.transform.matrix
let rotation = simd_float4x4(SCNMatrix4MakeRotation(90.0 * .pi/180, 0,1,0))
let transform = simd_mul(currentMatrix, rotation)
anchorEntity.move(to: transform, relativeTo: nil, duration: 3.0)
}
【问题讨论】:
标签: swift realitykit