@@ -62,7 +62,9 @@ protected void onCreate(Bundle bundle) {
62
62
if (ControllerClient .isControllerServiceExisted (this )) {
63
63
mControllerManager = new CVControllerManager (this );
64
64
mControllerManager .setListener (this );
65
- mType = 1 ;
65
+ mType = 1 ; // Neo2
66
+ // Enable high res
67
+ PicovrSDK .SetEyeBufferSize (1920 , 1920 );
66
68
} else {
67
69
mHbManager = new HbManager (this );
68
70
mHbManager .InitServices ();
@@ -148,11 +150,11 @@ private void updateControllers() {
148
150
}
149
151
CVController main = mControllerManager .getMainController ();
150
152
if (main != null ) {
151
- updateController (hand , main );
153
+ updateController (1 , main );
152
154
}
153
155
CVController sub = mControllerManager .getSubController ();
154
156
if (sub != null ) {
155
- updateController (1 - hand , sub );
157
+ updateController (0 , sub );
156
158
}
157
159
} else if (mHbManager != null ) {
158
160
update3DofController ();
@@ -202,7 +204,7 @@ private void update3DofController() {
202
204
}
203
205
204
206
private void updateController (int aIndex , @ NonNull CVController aController ) {
205
- final float kMax = 25500 .0f ;
207
+ final float kMax = 255 .0f ;
206
208
final float kHalfMax = kMax / 2.0f ;
207
209
boolean connected = aController .getConnectState () > 0 ;
208
210
if (!connected ) {
@@ -213,15 +215,11 @@ private void updateController(int aIndex, @NonNull CVController aController) {
213
215
float axisY = 0.0f ;
214
216
int [] stick = aController .getTouchPad ();
215
217
if (stick .length >= 2 ) {
216
- //Log.e(LOGTAG, "stick[" + aIndex + "] " + stick[0] + " " + stick[1]);
217
- /*
218
218
axisY = ((float )stick [0 ] - kHalfMax ) / kHalfMax ;
219
219
axisX = ((float )stick [1 ] - kHalfMax ) / kHalfMax ;
220
220
if (axisX < 0.1f && axisX > -0.1f ) { axisX = 0.0f ; }
221
221
if (axisY < 0.1f && axisY > -0.1f ) { axisY = 0.0f ; }
222
- */
223
- axisY = (float )stick [0 ] / kMax ;
224
- axisX = (float )stick [1 ] / kMax ;
222
+
225
223
} else {
226
224
stick = new int [2 ];
227
225
}
@@ -289,12 +287,10 @@ public void surfaceChangedCallBack(int width, int height) {
289
287
}
290
288
291
289
// CVControllerListener
292
- /*
293
290
@ Override
294
291
public void onBindSuccess () {
295
292
296
293
}
297
- */
298
294
299
295
@ Override
300
296
public void onBindFail () {
@@ -313,11 +309,12 @@ public void onConnectStateChanged(int serialNum, int state) {
313
309
@ Override
314
310
public void onMainControllerChanged (int serialNum ) {
315
311
}
316
- /*
312
+
317
313
@ Override
318
- public void onChannelChanged(int var1, int var2) {
314
+ public void onChannelChanged (int i , int i1 ) {
315
+
319
316
}
320
- */
317
+
321
318
protected native void nativeOnCreate ();
322
319
protected native void nativeInitialize (int width , int height , Object aAssetManager , int type , int focusIndex );
323
320
protected native void nativeShutdown ();
0 commit comments