diff --git a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/views/PlayerFragment.java b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/views/PlayerFragment.java index 9bae7bc..2e89066 100644 --- a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/views/PlayerFragment.java +++ b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/views/PlayerFragment.java @@ -117,26 +117,6 @@ Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); initGameWindowView(); - - -// parentView.setOnTouchListener(new View.OnTouchListener() { -// @Override -// public boolean onTouch(View v, MotionEvent event) { -// -// if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_MOVE) { -// isTouched = true; -// float maxX = event.getDevice().getMotionRange(MotionEvent.AXIS_X).getMax(); -// float minX = event.getDevice().getMotionRange(MotionEvent.AXIS_X).getMin(); -// float maxY = event.getDevice().getMotionRange(MotionEvent.AXIS_Y).getMax(); -// float minY = event.getDevice().getMotionRange(MotionEvent.AXIS_Y).getMin(); -// touchX = (event.getX() - minX) / (maxX - minX); -// touchY = (event.getY() - minY) / (maxY - minY); -// } else if (event.getAction() == MotionEvent.ACTION_UP) { -// isTouched = false; -// } -// return true; -// } -// }); return parentView; } @@ -160,6 +140,7 @@ camera.setViewLine(new Vector3d(5.0 * charaVector3d.getX(), charaVector3d.getY() - 2.5, 5.0 * charaVector3d.getZ() + touchX));//視線 } + //sampleUiFragmentからそのまま持ってきた public void initGameWindowView() { FragmentManager fragmentManager = getFragmentManager(); @@ -183,14 +164,9 @@ Vector3d charaVector3d = pocha.getDirection(); charaVector3d.normalize();//キャラの向きを単位ベクトルに MotionEvent motionEvent = event.getMotionEvent(); - //super.onTouchEvent(motionEvent); if (motionEvent.getAction() == MotionEvent.ACTION_DOWN || motionEvent.getAction() == MotionEvent.ACTION_MOVE) { isTouched = true; - float maxX = motionEvent.getDevice().getMotionRange(MotionEvent.AXIS_X).getMax() / 2.0f; - float minX = motionEvent.getDevice().getMotionRange(MotionEvent.AXIS_X).getMin(); - float maxY = motionEvent.getDevice().getMotionRange(MotionEvent.AXIS_Y).getMax(); - float minY = motionEvent.getDevice().getMotionRange(MotionEvent.AXIS_Y).getMin(); touchX = (float) (Math.cos(event.getAngle()) * event.getLength()); touchY = (float) (Math.sin(event.getAngle()) * event.getLength());