Is there any simple way to implement an object click or touch listener?

Started by nnyerges, October 18, 2014, 07:27:25 PM

Previous topic - Next topic

nnyerges

Hi,

Simple question:
Is there any "simple way" (far away more simpler than the "picking coding") to implement an object click or touch listener, like Androids view setOnClickListener or setOnTouchListener?
Chears..

EDITED:
Disclaimer: for an 3DS loaded object

EgonOlsen

I don't see how it gets much simpler than these three or four lines of code that the actual picking approach needs, but anyway...if all you care about is the object itself and not the distance, you can use http://www.jpct.net/jpct-ae/doc/com/threed/jpct/World.html#checkCollision(com.threed.jpct.SimpleVector, com.threed.jpct.SimpleVector, float) as well. You still have to convert the touch coordinates to 3d just like the picking example does it though.