You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello folks. I'd like to know if is possible to detect the touch event using the Cardboard in RajawaliVR. I tried some snippets how to handle the TouchEvent but I have no success.
The events are not fired when I touched the screen when I override the onTouchEvent on RajawaliCardboardRenderer class.
@Override public void onTouchEvent(MotionEvent me) { //The MotionEvent "me" has all of the data you need to make animation based on touch if (me.getAction() == MotionEvent.ACTION_DOWN) { //Called once at the start of the touch System.out.println(me.getAction() + " -- " + me.getX() + ", " + me.getY()); } if (me.getAction() == MotionEvent.ACTION_MOVE) { //Called repeatedly as touch point moves System.out.println(me.getAction() + " -- " + me.getX() + ", " + me.getY()); } if (me.getAction() == MotionEvent.ACTION_UP) { //Called once at the end of the touch System.out.println(me.getAction() + " -- " + me.getX() + ", " + me.getY()); } try { Thread.sleep(15); //Small delay to keep touch events from overflowing and decreasing performance } catch (Exception e) { } }
Regards,
Marcos
The text was updated successfully, but these errors were encountered:
Hello folks. I'd like to know if is possible to detect the touch event using the Cardboard in RajawaliVR. I tried some snippets how to handle the TouchEvent but I have no success.
The events are not fired when I touched the screen when I override the onTouchEvent on RajawaliCardboardRenderer class.
@Override public void onTouchEvent(MotionEvent me) { //The MotionEvent "me" has all of the data you need to make animation based on touch if (me.getAction() == MotionEvent.ACTION_DOWN) { //Called once at the start of the touch System.out.println(me.getAction() + " -- " + me.getX() + ", " + me.getY()); } if (me.getAction() == MotionEvent.ACTION_MOVE) { //Called repeatedly as touch point moves System.out.println(me.getAction() + " -- " + me.getX() + ", " + me.getY()); } if (me.getAction() == MotionEvent.ACTION_UP) { //Called once at the end of the touch System.out.println(me.getAction() + " -- " + me.getX() + ", " + me.getY()); } try { Thread.sleep(15); //Small delay to keep touch events from overflowing and decreasing performance } catch (Exception e) { } }
Regards,
Marcos
The text was updated successfully, but these errors were encountered: