/** * Get the observer final rotation within the scene. * @return the observer final rotation within the scene. * @see #getFinalObserverPosition() */ public Quaternion getFinalObserverRotation() { if( environment.getVRViewManager() == null ) { if( environment.getObserver() == null ) { return environment.getCamera().getRotation(); } else { return ((Spatial)environment.getObserver()).getWorldRotation(); } } if( environment.getObserver() == null ) { tempq.set(environment.getDummyCamera().getRotation()); } else { tempq.set(((Spatial)environment.getObserver()).getWorldRotation()); } return tempq.multLocal(environment.getVRHardware().getOrientation()); }
@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); }
/** * Get the observer final position within the scene. * @return the observer position. * @see #getFinalObserverRotation() */ public Vector3f getFinalObserverPosition() { if( environment.getVRViewManager() == null ) { if( environment.getObserver() == null ) { return environment.getCamera().getLocation(); } else{ return ((Spatial)environment.getObserver()).getWorldTranslation(); } } Vector3f pos = environment.getVRHardware().getPosition(); if( environment.getObserver() == null ) { environment.getDummyCamera().getRotation().mult(pos, pos); return pos.addLocal(environment.getDummyCamera().getLocation()); } else { ((Spatial)environment.getObserver()).getWorldRotation().mult(pos, pos); return pos.addLocal(((Spatial)environment.getObserver()).getWorldTranslation()); } }
Camera origCam = environment.getCamera(); float fFar = origCam.getFrustumFar(); float fNear = origCam.getFrustumNear();
if (environment.getApplication() != null){ Camera origCam = environment.getCamera(); float fFar = origCam.getFrustumFar(); float fNear = origCam.getFrustumNear();
Camera origCam = environment.getCamera(); float fFar = origCam.getFrustumFar(); float fNear = origCam.getFrustumNear();
Camera origCam = environment.getCamera(); float fFar = origCam.getFrustumFar(); float fNear = origCam.getFrustumNear();