use of com.jme3.system.jopenvr.VRControllerState_t in project jmonkeyengine by jMonkeyEngine.
the class OpenVRInput method getAxisRaw.
@Override
public Vector2f getAxisRaw(int controllerIndex, VRInputType forAxis) {
VRControllerState_t cs = cStates[OpenVRInput.controllerIndex[controllerIndex]];
switch(forAxis) {
default:
return null;
case ViveTriggerAxis:
tempAxis.x = cs.rAxis[1].x;
tempAxis.y = tempAxis.x;
break;
case ViveTrackpadAxis:
tempAxis.x = cs.rAxis[0].x;
tempAxis.y = cs.rAxis[0].y;
break;
}
return tempAxis;
}
use of com.jme3.system.jopenvr.VRControllerState_t in project jmonkeyengine by jMonkeyEngine.
the class OpenVRInput method init.
@Override
public boolean init() {
logger.config("Initialize OpenVR input.");
for (int i = 0; i < JOpenVRLibrary.k_unMaxTrackedDeviceCount; i++) {
rotStore[i] = new Quaternion();
posStore[i] = new Vector3f();
cStates[i] = new VRControllerState_t();
cStates[i].setAutoSynch(false);
cStates[i].setAutoRead(false);
cStates[i].setAutoWrite(false);
lastCallAxis[i] = new Vector2f();
needsNewVelocity[i] = true;
needsNewAngVelocity[i] = true;
logger.config(" Input " + (i + 1) + "/" + JOpenVRLibrary.k_unMaxTrackedDeviceCount + " binded.");
}
return true;
}
use of com.jme3.system.jopenvr.VRControllerState_t in project jmonkeyengine by jMonkeyEngine.
the class OpenVRInput method getAxis.
@Override
public Vector2f getAxis(int controllerIndex, VRInputType forAxis) {
VRControllerState_t cs = cStates[OpenVRInput.controllerIndex[controllerIndex]];
switch(forAxis) {
default:
return null;
case ViveTriggerAxis:
tempAxis.x = cs.rAxis[1].x;
tempAxis.y = tempAxis.x;
break;
case ViveTrackpadAxis:
tempAxis.x = cs.rAxis[0].x;
tempAxis.y = cs.rAxis[0].y;
break;
}
tempAxis.x *= axisMultiplier;
tempAxis.y *= axisMultiplier;
return tempAxis;
}
Aggregations