9

In my Android application, I have a bunch of meshes in a collection that are moving around in 3D space. I want something to happen to the mesh when any one of the moving mesh (objects) are touched. How can I detect which object has been tapped / clicked?

L1ghtk3ira
  • 3,021
  • 6
  • 31
  • 70
ace
  • 11,526
  • 39
  • 113
  • 193

2 Answers2

5

In your View, you will need to override onTouchEvent() and determine if the touch event occurred on one of your objects. The Android Dev Blog has some examples on handling touch events.

Robby Pond
  • 73,164
  • 16
  • 126
  • 119
3

Ray picking.

Community
  • 1
  • 1
genpfault
  • 51,148
  • 11
  • 85
  • 139