【问题标题】:Not able to delete renderable in Arcore using anchornodes无法使用锚节点删除 Arcore 中的可渲染对象
【发布时间】:2019-09-03 08:34:43
【问题描述】:

我已尽力删除可渲染对象,但单击按钮后可渲染对象并没有消失。我得到了 stackoverflow 类似帖子的帮助,但即使在应用以下代码后,我也无法删除可渲染对象。 我正在使用虚拟设备进行测试。

button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        if(anchorNode!=null){
            arFragment.getArSceneView().getScene().removeChild(anchorNode);
            anchorNode.getAnchor().detach();
            anchorNode.setParent(null);
            anchorNode = null;

            Toast.makeText(MainActivity.this, "Test Delete - anchorNode removed", Toast.LENGTH_SHORT).show();
        } else {
            Toast.makeText(MainActivity.this, "Test Delete - markAnchorNode was null", Toast.LENGTH_SHORT).show();
        }
    }
});

请告诉我解决方法

【问题讨论】:

标签: java android augmented-reality arcore


【解决方案1】:

你必须删除你使用了setRenderable()Node, [在这种情况下] 确保在 anchorNode 对象上呈现 Renderable

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-18
    • 1970-01-01
    • 2020-10-14
    • 1970-01-01
    相关资源
    最近更新 更多