Author Topic: Is there any simple way to implement an object click or touch listener?  (Read 463 times)

Offline nnyerges

  • byte
  • *
  • Posts: 18
    • View Profile
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
« Last Edit: October 18, 2014, 07:33:28 pm by nnyerges »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Is there any simple way to implement an object click or touch listener?
« Reply #1 on: October 18, 2014, 09:35:29 pm »
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.