我使用 SceneForm SDK 的示例示例,但是当我们将对象放在检测到的地板上时,我们不能在墙上移动。如何解决?
arFragment.setOnTapArPlaneListener(
(HitResult hitResult, Plane plane, MotionEvent motionEvent) -> {
if (andyRenderable == null) {
return;
}
/* if (plane.getType() != Type.HORIZONTAL_UPWARD_FACING) {
return;
}*/
// Create the Anchor.
Anchor anchor = hitResult.createAnchor();
AnchorNode anchorNode = new AnchorNode(anchor);
anchorNode.setParent(arFragment.getArSceneView().getScene());
// Create the transformable andy and add it to the anchor.
TransformableNode andy = new TransformableNode(arFragment.getTransformationSystem());
andy.setParent(anchorNode);
andy.setRenderable(andyRenderable);
andy.select();
andy.setEnabled(true);
});