Created
February 16, 2020 05:19
-
-
Save shibuiwilliam/5d4941c317efcad60ba5443a34c93862 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun placeAnchor(hitResult: HitResult, | |
renderable: Renderable){ | |
val anchor = hitResult.createAnchor() | |
placedAnchors.add(anchor) | |
val anchorNode = AnchorNode(anchor).apply { | |
isSmoothed = true | |
setParent(arFragment!!.arSceneView.scene) | |
} | |
placedAnchorNodes.add(anchorNode) | |
val node = TransformableNode(arFragment!!.transformationSystem) | |
.apply{ | |
this.rotationController.isEnabled = false | |
this.scaleController.isEnabled = false | |
this.translationController.isEnabled = true | |
this.renderable = renderable | |
setParent(anchorNode) | |
} | |
arFragment!!.arSceneView.scene.addOnUpdateListener(this) | |
arFragment!!.arSceneView.scene.addChild(anchorNode) | |
node.select() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment