diff --git a/app/src/picovr/cpp/DeviceDelegatePicoVR.cpp b/app/src/picovr/cpp/DeviceDelegatePicoVR.cpp index 98d9453f5..4f174c437 100644 --- a/app/src/picovr/cpp/DeviceDelegatePicoVR.cpp +++ b/app/src/picovr/cpp/DeviceDelegatePicoVR.cpp @@ -180,23 +180,21 @@ struct DeviceDelegatePicoVR::State { controllerDelegate->SetButtonState(i, ControllerDelegate::BUTTON_OTHERS, 5, false, false); } - // float axes[kNumAxes] = { controller.axisX , -controller.axisY }; - float axes[kNumAxes] = { 0.0f, 0.0f }; + float axes[kNumAxes] = { controller.axisX , -controller.axisY }; controllerDelegate->SetAxes(i, axes, kNumAxes); - /* + if (type == kTypeNeo2) { if (!triggerPressed) { controllerDelegate->SetScrolledDelta(i, -controller.axisX, controller.axisY); } } else { - */ if (controller.touched) { controllerDelegate->SetTouchPosition(i, controller.axisX, controller.axisY); } else { controllerDelegate->EndTouch(i); } - //} + } vrb::Matrix transform = controller.transform; if (renderMode == device::RenderMode::StandAlone) { diff --git a/app/src/picovr/java/org/mozilla/vrbrowser/PlatformActivity.java b/app/src/picovr/java/org/mozilla/vrbrowser/PlatformActivity.java index 96e277bec..615fd59a6 100644 --- a/app/src/picovr/java/org/mozilla/vrbrowser/PlatformActivity.java +++ b/app/src/picovr/java/org/mozilla/vrbrowser/PlatformActivity.java @@ -62,7 +62,9 @@ protected void onCreate(Bundle bundle) { if (ControllerClient.isControllerServiceExisted(this)) { mControllerManager = new CVControllerManager(this); mControllerManager.setListener(this); - mType = 1; + mType = 1; // Neo2 + // Enable high res + PicovrSDK.SetEyeBufferSize(1920, 1920); } else { mHbManager = new HbManager(this); mHbManager.InitServices(); @@ -148,11 +150,11 @@ private void updateControllers() { } CVController main = mControllerManager.getMainController(); if (main != null) { - updateController(hand, main); + updateController(1, main); } CVController sub = mControllerManager.getSubController(); if (sub != null) { - updateController(1 - hand, sub); + updateController(0, sub); } } else if (mHbManager != null) { update3DofController(); @@ -202,7 +204,7 @@ private void update3DofController() { } private void updateController(int aIndex, @NonNull CVController aController) { - final float kMax = 25500.0f; + final float kMax = 255.0f; final float kHalfMax = kMax / 2.0f; boolean connected = aController.getConnectState() > 0; if (!connected) { @@ -213,15 +215,11 @@ private void updateController(int aIndex, @NonNull CVController aController) { float axisY = 0.0f; int[] stick = aController.getTouchPad(); if (stick.length >= 2) { - //Log.e(LOGTAG, "stick[" + aIndex + "] " + stick[0] + " " + stick[1]); - /* axisY = ((float)stick[0] - kHalfMax) / kHalfMax; axisX = ((float)stick[1] - kHalfMax) / kHalfMax; if (axisX < 0.1f && axisX > -0.1f) { axisX = 0.0f; } if (axisY < 0.1f && axisY > -0.1f) { axisY = 0.0f; } - */ - axisY = (float)stick[0] / kMax; - axisX = (float)stick[1] / kMax; + } else { stick = new int[2]; } @@ -289,12 +287,10 @@ public void surfaceChangedCallBack(int width, int height) { } // CVControllerListener - /* @Override public void onBindSuccess() { } - */ @Override public void onBindFail() { @@ -313,11 +309,12 @@ public void onConnectStateChanged(int serialNum, int state) { @Override public void onMainControllerChanged(int serialNum) { } -/* + @Override - public void onChannelChanged(int var1, int var2) { + public void onChannelChanged(int i, int i1) { + } -*/ + protected native void nativeOnCreate(); protected native void nativeInitialize(int width, int height, Object aAssetManager, int type, int focusIndex); protected native void nativeShutdown(); diff --git a/third_party_hash b/third_party_hash index f7b587c7f..3b096aded 100644 --- a/third_party_hash +++ b/third_party_hash @@ -1 +1 @@ -9430d0b729ccd09ed1641798090552769942b351 +5f3f613fa1ec0991a4e49753cb0546f4ddb95dbe