void MeshPrimitiveTest::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex) { switch (evt) { case Touch::TOUCH_PRESS: if (x < 75 && y < 50) { // Toggle Vsync if the user touches the top left corner setVsync(!isVsync()); } else { _touchPoint.set(x, y); } break; case Touch::TOUCH_RELEASE: _touchPoint.set(-1.0f, -1.0f); break; case Touch::TOUCH_MOVE: if (_touchPoint.x > 0.0f && _touchPoint.y > 0.0f) { float deltaX = x - _touchPoint.x; float deltaY = y - _touchPoint.y; _tilt.x -= deltaX; _tilt.y += deltaY; _touchPoint.set(x, y); } break; }; }
void Audio3DTest::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex) { switch (evt) { case Touch::TOUCH_PRESS: if (x < 75 && y < 50) { // Toggle Vsync if the user touches the top left corner setVsync(!isVsync()); } _prevX = x; _prevY = y; break; case Touch::TOUCH_RELEASE: _prevX = 0; _prevY = 0; break; case Touch::TOUCH_MOVE: { int deltaX = x - _prevX; int deltaY = y - _prevY; _prevX = x; _prevY = y; float pitch = -MATH_DEG_TO_RAD(deltaY * 0.5f); float yaw = MATH_DEG_TO_RAD(deltaX * 0.5f); _fpCamera.rotate(yaw, pitch); break; } }; }
void CreateSceneSample::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex) { switch (evt) { case Touch::TOUCH_PRESS: if (x < 75 && y < 50) { // Toggle Vsync if the user touches the top left corner setVsync(!isVsync()); } break; case Touch::TOUCH_RELEASE: break; case Touch::TOUCH_MOVE: break; }; }
void TriangleSample::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex) { switch (evt) { case Touch::TOUCH_PRESS: if (x < 75 && y < 50) { // Toggle Vsync if the user touches the top left corner setVsync(!isVsync()); } else { // Reverse the spin direction if the user touches the screen. _spinDirection *= -1.0f; } break; case Touch::TOUCH_RELEASE: break; case Touch::TOUCH_MOVE: break; }; }