Closed amit-iottive closed 7 months ago
Hi
Currently I am working on sample-gltf-viewer repo. I have used SingleTapListener but on click of model every time I get same entity name.
inner class SingleTapListener : GestureDetector.SimpleOnGestureListener() {
override fun onSingleTapUp(event: MotionEvent): Boolean { modelViewer.view.pick( event.x.toInt(), surfaceView.height - event.y.toInt(), surfaceView.handler, { val name = modelViewer.asset!!.getName(it.renderable) Log.v("Filament", "Picked ${it.renderable}: " + name) }, ) return super.onSingleTapUp(event) }
}
I have tried to get entity info by foreach loop and I am able to fetch all entity info.
modelViewer.scene.forEach() { Log.e("Filament","Entity>>>"+it.toString()+" Name>>>"+ modelViewer.asset!!.getName(it)) }
Is there any way to implement modelViewer.scene click listener?
OS: Android
I have attached Gltf model screenshot for your reference.
Let's use the duplication discussion for follow-up: https://github.com/google/filament/discussions/7745
Hi
Currently I am working on sample-gltf-viewer repo. I have used SingleTapListener but on click of model every time I get same entity name.
inner class SingleTapListener : GestureDetector.SimpleOnGestureListener() {
}
I have tried to get entity info by foreach loop and I am able to fetch all entity info.
modelViewer.scene.forEach() { Log.e("Filament","Entity>>>"+it.toString()+" Name>>>"+ modelViewer.asset!!.getName(it)) }
Is there any way to implement modelViewer.scene click listener?
OS: Android
I have attached Gltf model screenshot for your reference.