如何删除ARCore中已经放置在场景中的所有transformableNodes?

时间:2019-05-22 08:51:23

标签: android arcore

放置它们后,我需要从场景中删除所有节点,我添加了此代码以在场景中放置transformableNodes

val anchorNode = AnchorNode(anchor)
    val transformableNode = TransformableNode(arFragment.transformationSystem)
    transformableNode.setParent(anchorNode)
    transformableNode.renderable = viewRenderable
    arFragment.arSceneView.scene.addChild(anchorNode)
    transformableNode.select()

放置AnchorNodes之后,我要从场景中删除所有transformableNodes

1 个答案:

答案 0 :(得分:0)

经过多次尝试,我找到了答案

for (node in nodesList){
        node.isEnabled = false
        arFragment.arSceneView.scene.removeChild(node)
    }