sceneview-android
sceneview-android copied to clipboard
Select 3d object jetpack compose.
Hello everyone! I created an AR application with jetpack compose. I added 5 models to the screen using a tap, I did everything as in the example. When I use
val modelInstances = remember { mutableListOf<ModelInstance>() }
val childNodes = rememberNodes()
onGestureListener = rememberOnGestureListener(
onSingleTapConfirmed = { motionEvent, node ->
}
)
I can't find 'node ->' in 'childNodes' PS - Objects are added correctly. The childNodes list is the correct size.
How can I select multiple objects to change their color and delete them?
I was able to change the color of the selected model. Tell me, is this the optimal solution?
onGestureListener = rememberOnGestureListener(
onSingleTapConfirmed = { motionEvent, node ->
if (node != null) {
val nodes = node.childNodes
val renderableNodes = nodes.mapNotNull {
it as? ModelNode.RenderableNode
}
renderableNodes.forEach {
it.materialInstance.setColor(colorModel.copy(0.1f))
}
}
}
)
The question remains - how can I select certain models in order to delete them later? If I do childNodes.indexOf(node) - I get an exception
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.