www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: nnyerges on October 18, 2014, 07:27:25 pm

Title: Is there any simple way to implement an object click or touch listener?
Post by: nnyerges on October 18, 2014, 07:27:25 pm
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
Title: Re: Is there any simple way to implement an object click or touch listener?
Post by: EgonOlsen 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) (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.