support tap-and-drag
This commit is contained in:
parent
758435fd63
commit
989d510673
@ -197,13 +197,16 @@ public class MyRenderer implements GLSurfaceView.Renderer
|
|||||||
|
|
||||||
public boolean onTouchEvent(MotionEvent e)
|
public boolean onTouchEvent(MotionEvent e)
|
||||||
{
|
{
|
||||||
if (e.getAction() == MotionEvent.ACTION_DOWN)
|
if (e.getAction() == MotionEvent.ACTION_DOWN ||
|
||||||
|
e.getAction() == MotionEvent.ACTION_MOVE)
|
||||||
{
|
{
|
||||||
float x = m_aspect * ((e.getX() / (float) m_width) * 2.0f - 1.0f);
|
float x = m_aspect * ((e.getX() / (float) m_width) * 2.0f - 1.0f);
|
||||||
float y = -((e.getY() / (float) m_height) * 2.0f - 1.0f);
|
float y = -((e.getY() / (float) m_height) * 2.0f - 1.0f);
|
||||||
|
|
||||||
m_x = x;
|
m_x = x;
|
||||||
m_y = y;
|
m_y = y;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user