/** * Get the GUI manager attached to this app state. * @return the GUI manager attached to this app state. */ public VRGuiManager getVRGUIManager(){ return getVREnvironment().getVRGUIManager(); }
@Override public void update(float tpf) { if (environment != null) { if (environment.hasTraditionalGUIOverlay()) { // update the mouse? environment.getVRMouseManager().update(tpf); // update GUI position? if (environment.getVRGUIManager().isWantsReposition() || environment.getVRGUIManager().getPositioningMode() != VRGUIPositioningMode.MANUAL) { environment.getVRGUIManager().positionGuiNow(tpf); environment.getVRGUIManager().updateGuiQuadGeometricState(); } } } else { throw new IllegalStateException("This VR view manager is not attached to any VR environment."); } }
@Override public void initialize() { logger.config("Initializing VR view manager."); if (environment != null){ initTextureSubmitStructs(); setupCamerasAndViews(); setupVRScene(); moveScreenProcessingToEyes(); if( environment.hasTraditionalGUIOverlay() ) { environment.getVRMouseManager().initialize(); // update the pose to position the gui correctly on start update(0f); environment.getVRGUIManager().positionGui(); } logger.config("Initialized VR view manager [SUCCESS]"); } else { throw new IllegalStateException("This VR view manager is not attached to any VR environment."); } }
@Override public void initialize() { logger.config("Initializing VR view manager."); if (environment != null) { initTextureSubmitStructs(); setupCamerasAndViews(); setupVRScene(); moveScreenProcessingToEyes(); if (environment.hasTraditionalGUIOverlay()) { environment.getVRMouseManager().initialize(); // update the pose to position the gui correctly on start update(0f); environment.getVRGUIManager().positionGui(); } logger.config("Initialized VR view manager [SUCCESS]"); } else { throw new IllegalStateException("This VR view manager is not attached to any VR environment."); } }
@Override public void initialize() { setupCamerasAndViews(); if (environment.hasTraditionalGUIOverlay()) { environment.getVRMouseManager().initialize(); // update the pose to position the gui correctly on start update(0f); environment.getVRGUIManager().positionGui(); } }
@Override public void centerMouse() { if (environment != null){ if (environment.getApplication() != null){ // set mouse in center of the screen if newly added Vector2f size = environment.getVRGUIManager().getCanvasSize(); MouseInput mi = environment.getApplication().getContext().getMouseInput(); AppSettings as = environment.getApplication().getContext().getSettings(); if( mi instanceof GlfwMouseInputVR ) ((GlfwMouseInputVR)mi).setCursorPosition((int)(as.getWidth() / 2f), (int)(as.getHeight() / 2f)); if( environment.isInVR() ) { cursorPos.x = size.x / 2f; cursorPos.y = size.y / 2f; recentCenterCount = 2; } } else { throw new IllegalStateException("This VR environment is not attached to any application."); } } else { throw new IllegalStateException("This VR view manager is not attached to any VR environment."); } }
if( environment.getVRGUIManager().isWantsReposition() || environment.getVRGUIManager().getPositioningMode() != VRGUIPositioningMode.MANUAL ) { environment.getVRGUIManager().positionGuiNow(tpf); environment.getVRGUIManager().updateGuiQuadGeometricState();
if (environment.getVRGUIManager().isWantsReposition() || environment.getVRGUIManager().getPositioningMode() != VRGUIPositioningMode.MANUAL) { environment.getVRGUIManager().positionGuiNow(tpf); environment.getVRGUIManager().updateGuiQuadGeometricState();
if( cursorPos.x > environment.getVRGUIManager().getCanvasSize().x ) cursorPos.x = environment.getVRGUIManager().getCanvasSize().x; if( cursorPos.y > environment.getVRGUIManager().getCanvasSize().y ) cursorPos.y = environment.getVRGUIManager().getCanvasSize().y; } else recentCenterCount--; ((GlfwMouseInputVR)mi).clearDeltas(); mouseImage.setLocalTranslation(currentPos.x, currentPos.y - ySize, environment.getVRGUIManager().getGuiDistance() + 1f);
environment.getVRGUIManager().positionGui();
if( environment.getVRGUIManager().isWantsReposition() || environment.getVRGUIManager().getPositioningMode() != VRGUIPositioningMode.MANUAL ) { environment.getVRGUIManager().positionGuiNow(tpf); environment.getVRGUIManager().updateGuiQuadGeometricState();
cursorPos.x -= avg(lastXmv); cursorPos.y -= avg(lastYmv); Vector2f maxsize = getVREnvironment().getVRGUIManager().getCanvasSize();
cursorPos.x -= avg(lastXmv); cursorPos.y -= avg(lastYmv); Vector2f maxsize = getVREnvironment().getVRGUIManager().getCanvasSize();
cursorPos.x -= avg(lastXmv); cursorPos.y -= avg(lastYmv); Vector2f maxsize = getVREnvironment().getVRGUIManager().getCanvasSize();
cursorPos.x -= avg(lastXmv); cursorPos.y -= avg(lastYmv); Vector2f maxsize = getVREnvironment().getVRGUIManager().getCanvasSize();
@Override public void update(float tpf) { // update VR pose & cameras if( environment.getVRViewManager() != null ) { environment.getVRViewManager().update(tpf); } else if( environment.getObserver() != null ) { environment.getCamera().setFrame(((Spatial)environment.getObserver()).getWorldTranslation(), ((Spatial)environment.getObserver()).getWorldRotation()); } if( environment.isInVR() == false || environment.getVRGUIManager().getPositioningMode() == VRGUIPositioningMode.MANUAL ) { // only update geometric state here if GUI is in manual mode, or not in VR // it will get updated automatically in the viewmanager update otherwise // TODO isn't this done by SimpleApplication? for (Spatial spatial : application.getGuiViewPort().getScenes()) { //spatial.updateLogicalState(tpf); spatial.updateGeometricState(); } } // use the analog control on the first tracked controller to push around the mouse environment.getVRMouseManager().updateAnalogAsMouse(0, null, null, null, tpf); }
getVRGUIManager().setGuiOverdraw(settings.getBoolean(VRConstants.SETTING_GUI_OVERDRAW)); getVRGUIManager().setCurvedSurface(settings.getBoolean(VRConstants.SETTING_GUI_CURVED_SURFACE));
environment.getVRGUIManager().setupGui(getLeftCamera(), getRightCamera(), getLeftViewPort(), getRightViewPort()); } else { throw new IllegalStateException("This VR view manager is not attached to any VR environment.");
environment.getVRGUIManager().setupGui(getLeftCamera(), getRightCamera(), getLeftViewPort(), getRightViewPort());
environment.getVRGUIManager().setupGui(getLeftCamera(), getRightCamera(), getLeftViewPort(), getRightViewPort());