Package com.jme3.app

Class VREnvironment

java.lang.Object
com.jme3.app.VREnvironment

public class VREnvironment extends Object
  • Field Details

  • Constructor Details

    • VREnvironment

      public VREnvironment(AppSettings settings)
  • Method Details

    • getVRHardware

      public VRAPI getVRHardware()
      Get the VR underlying hardware.
      Returns:
      the VR underlying hardware.
    • setVRBounds

      public void setVRBounds(VRBounds bounds)
      Set the VR bounds.
      See Also:
    • getVRBounds

      public VRBounds getVRBounds()
      Get the VR bounds.
      Returns:
      the VR bounds.
      See Also:
    • getVRinput

      public VRInputAPI getVRinput()
      Get the VR dedicated input.
      Returns:
      the VR dedicated input.
    • getVRViewManager

      public VRViewManager getVRViewManager()
      Get the VR view manager.
      Returns:
      the VR view manager.
    • getVRGUIManager

      public VRGuiManager getVRGUIManager()
      Get the GUI manager attached to this environment.
      Returns:
      the GUI manager attached to this environment.
    • getVRMouseManager

      public VRMouseManager getVRMouseManager()
      Get the VR mouse manager attached to this environment.
      Returns:
      the VR mouse manager attached to this environment.
    • setSeatedExperience

      public void setSeatedExperience(boolean isSeated)
      Can be used to change seated experience during runtime.
      Parameters:
      isSeated - true if designed for sitting, false for standing/roomscale
      See Also:
    • isSeatedExperience

      public boolean isSeatedExperience()
      Check if the application is configured as a seated experience.
      Returns:
      true if the application is configured as a seated experience and false otherwise.
      See Also:
    • setVRHeightAdjustment

      public void setVRHeightAdjustment(float amount)
      Set the VR headset height from the ground.
      Parameters:
      amount - the VR headset height from the ground.
      See Also:
    • getVRHeightAdjustment

      public float getVRHeightAdjustment()
      Get the VR headset height from the ground.
      Returns:
      the VR headset height from the ground.
      See Also:
    • getObserver

      public Object getObserver()
      Get the scene observer. If no observer has been set, this method return the application camera.
      Returns:
      the scene observer.
      See Also:
    • setObserver

      public void setObserver(Spatial observer)
      Set the scene observer. The VR headset will be linked to it. If no observer is set, the VR headset is linked to the application camera.
      Parameters:
      observer - the scene observer.
    • getDefaultFOV

      public float getDefaultFOV()
      Get the default Field Of View (FOV) value.
      Returns:
      the default Field Of View (FOV) value.
      See Also:
    • setDefaultFOV

      public void setDefaultFOV(float defaultFOV)
      Set the default Field Of View (FOV) value.
      Parameters:
      defaultFOV - the default Field Of View (FOV) value.
      See Also:
    • getDefaultAspect

      public float getDefaultAspect()
      Get the default aspect ratio.
      Returns:
      the default aspect ratio.
      See Also:
    • setDefaultAspect

      public void setDefaultAspect(float defaultAspect)
      Set the default aspect ratio.
      Parameters:
      defaultAspect - the default aspect ratio.
      See Also:
    • getSettings

      public AppSettings getSettings()
      Get the settings attached to this environment.
      Returns:
      the settings attached to this environment.
      See Also:
    • setSettings

      public void setSettings(AppSettings settings)
      Set the settings attached to this environment.
      Parameters:
      settings - the settings attached to this environment.
      See Also:
    • isVRSupported

      public boolean isVRSupported()
      Get if the system currently support VR.
      Returns:
      true if the system currently support VR and false otherwise.
    • isInVR

      public boolean isInVR()
      Check if the VR mode is enabled.
      Returns:
      true if the VR mode is enabled and false otherwise.
    • isInstanceRendering

      public boolean isInstanceRendering()
      Check if the rendering is instanced (see Geometry instancing).
      Returns:
      true if the rendering is instanced and false otherwise.
    • isSwapBuffers

      public boolean isSwapBuffers()
    • hasTraditionalGUIOverlay

      public boolean hasTraditionalGUIOverlay()
      Check if the application has a GUI overlay attached.
      Returns:
      true if the application has a GUI overlay attached and false otherwise.
    • isInitialized

      public boolean isInitialized()
      Check if the VR environment is initialized. A call to the initialize() method should set this value to true
      Returns:
      true if the VR environment is initialized and false otherwise.
    • compositorAllowed

      public boolean compositorAllowed()
      Is the VR compositor is active.
      Returns:
      true if the VR compositor is active and false otherwise.
    • resetSeatedPose

      public void resetSeatedPose()
      Reset headset pose if seating experience.
    • getAppState

      public AppState getAppState()
    • getApplication

      public Application getApplication()
    • getCamera

      public Camera getCamera()
      Get the camera used for rendering. If the VR mode is active, this method return a dummy camera, otherwise, this method return the camera of the attached application.
      Returns:
      the camera attached used for rendering.
    • getDummyCamera

      public Camera getDummyCamera()
    • atttach

      public void atttach(AppState appState, Application application)
      Attach the VR environment to the given app state and application. This method should be called within the stateAttached(com.jme3.app.state.AppStateManager) method from the app state.
      Parameters:
      appState - the app state to attach.
      application - the application to attach.
    • initialize

      public boolean initialize()
      Initialize this VR environment. This method enable the system bindings and configure all the VR system modules. A call to this method has to be made before any use of VR capabilities.
      Returns:
      true if the VR environment is successfully initialized and false otherwise.