use of com.jme3.system.jopenvr.VR_IVRChaperone_FnTable in project jmonkeyengine by jMonkeyEngine.
the class VRBounds method init.
/**
* Initialize the VR bounds.
* @return <code>true</code> if the initialization is a success and <code>false</code> otherwise.
*/
public static boolean init() {
logger.config("Initialize VR bounds...");
if (vrChaperone == null) {
vrChaperone = new VR_IVRChaperone_FnTable(JOpenVRLibrary.VR_GetGenericInterface(JOpenVRLibrary.IVRChaperone_Version, OpenVR.hmdErrorStore).getPointer());
if (vrChaperone != null) {
vrChaperone.setAutoSynch(false);
vrChaperone.read();
FloatByReference fbX = new FloatByReference();
FloatByReference fbZ = new FloatByReference();
vrChaperone.GetPlayAreaSize.apply(fbX, fbZ);
playSize = new Vector2f(fbX.getValue(), fbZ.getValue());
logger.config("Initialize VR bounds [SUCCESS]");
// init success
return true;
}
logger.warning("Initialize VR bounds [FAILED].");
// failed to init
return false;
}
logger.config("Initialize VR bounds already done.");
// already initialized
return true;
}
Aggregations