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 2e89066..d019d30 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 @@ -3,19 +3,15 @@ import android.os.Bundle; import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; -import android.widget.FrameLayout; -import android.widget.LinearLayout; import org.ntlab.radishforandroidstudio.R; import org.ntlab.radishforandroidstudio.framework.RWT.RWTPad; -import org.ntlab.radishforandroidstudio.framework.RWT.RWTSurfaceView; import org.ntlab.radishforandroidstudio.framework.RWT.RWTUIFragment; import org.ntlab.radishforandroidstudio.framework.animation.Animation3D; import org.ntlab.radishforandroidstudio.framework.event.PadEvent; @@ -124,15 +120,17 @@ protected void progress(long interval) { Velocity3D curV = pocha.getVelocity(); if (isTouched) { - pocha.rotY(0.1 * (0.5f - touchX) * (double) (interval / 15.0)); + pocha.rotY(0.001 * (0.5f - touchX) * (double) (interval / 15.0)); curV.setX(pocha.getDirection().getX() * 200.0 * (0.5f - touchY)); - curV.setZ(pocha.getDirection().getZ() * 200.0 * (0.5f - touchY)); + curV.setZ(pocha.getDirection().getZ() * 200.0 * (0.5f - touchX)); pocha.setVelocity(curV); + } else { curV.setX(0.0); curV.setZ(0.0); pocha.setVelocity(curV); } + Vector3d charaVector3d = pocha.getDirection(); charaVector3d.normalize();//キャラの向きを単位ベクトルに camera.setViewPoint(pocha.getPosition()