Closed roshanch closed 6 years ago
The onControllerEvent was added in https://github.com/Samsung/GearVRf/pull/1254. You can see the issue it was in response to and additional information. It was an enhancement for a user. You might add something to gvr-controller.
I believe we need to switch to custom events in GVRGearCursorController. They may also wrap the MotionEvents from GVRCursorController for the convenience of clients like the GVRViewSO. Probably oversimplifying it but a MotionEvent cannot carry all the information we need. So we have the onContollerEvent hack.
Sounds good to me. Can we subclass MotionEvent?
No, it is a final class.
added sample code for controllerEvent in gvr-controller, was able to retrieve angular velocity but the acceleration is coming 0 from platform library. Moiz is going to check with HQ.
mActivity.getEventReceiver().addListener(new GVREventListeners.ActivityEvents() {
@Override
public void onControllerEvent(Vector3f position, Quaternionf orientation, android.graphics.PointF touchpadPoint, boolean touched, Vector3f angularAcceleration,
Vector3f angularVelocity) {
Log.e("TAG", ">> onControllerEvent: position " + position);
Log.e("TAG", "<< onControllerEvent: orientation " + orientation);
Log.e("TAG", ">> onControllerEvent: angularAcceleration" + angularAcceleration);
Log.e("TAG", "<< onControllerEvent: angularVelocity " + angularVelocity);
}
});
Planning to merge on Monday.
modifying API to receive angular velocity and acceleration. None of the demos are using onContollerEvent API. Open to suggestions for testing.
GearVRf-DCO-1.0-Signed-off-by: Roshan Chaudhari roshan.c@samsung.com