Package com.jme3.app

Class VRApplication

java.lang.Object
com.jme3.app.VRApplication
All Implemented Interfaces:
Application, SystemListener

public abstract class VRApplication extends Object implements Application, SystemListener
Deprecated.
use VRAppState instead.
A JMonkey application dedicated to Virtual Reality. An application that use VR devices (HTC vive, ...) has to extend this one.

This class is no more functional and is deprecated. Please use VRAppState instead.

  • Field Details

    • DEFAULT_FOV

      public float DEFAULT_FOV
      Deprecated.
      The default FOV.
    • DEFAULT_ASPECT

      public float DEFAULT_ASPECT
      Deprecated.
      The default aspect ratio.
    • CONSTRUCT_WITH_OSVR

      public boolean CONSTRUCT_WITH_OSVR
      Deprecated.
      Is the application is based on OSVR (default is false).
    • DISABLE_VR

      public boolean DISABLE_VR
      Deprecated.
      Is the application has not to start within VR mode (default is false).
    • guiNode

      protected Node guiNode
      Deprecated.
    • rootNode

      protected Node rootNode
      Deprecated.
  • Constructor Details

    • VRApplication

      public VRApplication(AppState... initialStates)
      Deprecated.
      Create a new VR application and attach the given app states.
      The application scene is made of a root node that holds the scene spatials and a GUI node that is the root of the Graphical user interface.
      Parameters:
      initialStates - the app states to attach to the application.
    • VRApplication

      public VRApplication()
      Deprecated.
      Create a new VR application.
      The application scene is made of a root node that holds the scene spatials and a GUI node that is the root of the Graphical user interface.
  • Method Details

    • getVRHardware

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

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

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

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

      public OpenVRMouseManager getVRMouseManager()
      Deprecated.
      Get the VR mouse manager attached to this application.
      Returns:
      the VR mouse manager attached to this application.
    • setFrustrumNearFar

      public void setFrustrumNearFar(float near, float far)
      Deprecated.
      Set the frustum values for the application.
      Parameters:
      near - the frustum near value.
      far - the frustum far value.
    • setMirrorWindowSize

      public void setMirrorWindowSize(int width, int height)
      Deprecated.
      Set the mirror window size in pixel.
      Parameters:
      width - the width of the mirror window in pixel.
      height - the height of the mirror window in pixel.
    • setResolutionMultiplier

      public void setResolutionMultiplier(float val)
      Deprecated.
      Set the resolution multiplier.
      Parameters:
      val - the resolution multiplier.
    • compositorAllowed

      public boolean compositorAllowed()
      Deprecated.
      Is the SteamVR compositor is active.
      Returns:
      true if the SteamVR compositor is active and false otherwise.
    • isOSVRSupported

      public boolean isOSVRSupported()
      Deprecated.
      Get if the system currently support VR.
      Returns:
      true if the system currently support VR and false otherwise.
    • simpleUpdate

      public void simpleUpdate(float tpf)
      Deprecated.
      Simple update of the application, this method should contain root node updates. This method is called by the update() method and should not be called manually.
      Parameters:
      tpf - the application time.
    • simpleRender

      public void simpleRender(RenderManager renderManager)
      Deprecated.
      Rendering callback of the application. This method is called by the update() method and should not be called manually.
      Parameters:
      renderManager - the render manager.
    • getCamera

      public Camera getCamera()
      Deprecated.
      we do NOT want to get and modify the distortion scene camera, so return the left viewport camera instead if we are in VR mode
      Specified by:
      getCamera in interface Application
      Returns:
      The main camera for the application
    • getBaseCamera

      public Camera getBaseCamera()
      Deprecated.
      Get the application internal camera.
      Returns:
      the application internal camera.
      See Also:
    • getContext

      public JmeContext getContext()
      Deprecated.
      Specified by:
      getContext in interface Application
      Returns:
      The display context for the application
    • getAssetManager

      public AssetManager getAssetManager()
      Deprecated.
      Specified by:
      getAssetManager in interface Application
      Returns:
      The asset manager for this application.
    • getInputManager

      public InputManager getInputManager()
      Deprecated.
      Specified by:
      getInputManager in interface Application
      Returns:
      the input manager.
    • getStateManager

      public AppStateManager getStateManager()
      Deprecated.
      Specified by:
      getStateManager in interface Application
      Returns:
      the app state manager
    • getRenderManager

      public RenderManager getRenderManager()
      Deprecated.
      Specified by:
      getRenderManager in interface Application
      Returns:
      the render manager
    • getRenderer

      public Renderer getRenderer()
      Deprecated.
      Specified by:
      getRenderer in interface Application
      Returns:
      The renderer for the application
    • getAudioRenderer

      public AudioRenderer getAudioRenderer()
      Deprecated.
      Specified by:
      getAudioRenderer in interface Application
      Returns:
      The audio renderer for the application
    • getListener

      public Listener getListener()
      Deprecated.
      Specified by:
      getListener in interface Application
      Returns:
      The listener object for audio
    • getTimer

      public Timer getTimer()
      Deprecated.
      Specified by:
      getTimer in interface Application
    • handleError

      public void handleError(String errMsg, Throwable t)
      Deprecated.
      Handle the error given in parameters by creating a log entry and a dialog window. Internal use only.
      Specified by:
      handleError in interface SystemListener
      Parameters:
      errMsg - The error message, if any, or null.
      t - Throwable object, or null.
    • gainFocus

      public void gainFocus()
      Deprecated.
      Force the focus gain for the application. Internal use only.
      Specified by:
      gainFocus in interface SystemListener
    • loseFocus

      public void loseFocus()
      Deprecated.
      Force the focus lost for the application. Internal use only.
      Specified by:
      loseFocus in interface SystemListener
    • reshape

      public void reshape(int w, int h)
      Deprecated.
      Reshape the display window. Internal use only.
      Specified by:
      reshape in interface SystemListener
      Parameters:
      w - the new width of the display (in pixels, ≥0)
      h - the new height of the display (in pixels, ≥0)
    • requestClose

      public void requestClose(boolean esc)
      Deprecated.
      Request the application to close. Internal use only.
      Specified by:
      requestClose in interface SystemListener
      Parameters:
      esc - If true, the user pressed ESC to close the application.
    • setSettings

      public void setSettings(AppSettings settings)
      Deprecated.
      Set the display settings to define the display created.

      Examples of display parameters include display frame width and height, pixel color bit depth, z-buffer bits, anti-aliasing samples, update frequency, ...

      If this method is called while the application is already running, then restart() must be called to apply the settings to the display.

      Specified by:
      setSettings in interface Application
      Parameters:
      settings - The settings to set.
    • setTimer

      public void setTimer(Timer timer)
      Deprecated.
      Sets the Timer implementation that will be used for calculating frame times.

      By default, Application will use the Timer as returned by the current JmeContext implementation.
      Specified by:
      setTimer in interface Application
      Parameters:
      timer - the timer to use.
    • getLostFocusBehavior

      public LostFocusBehavior getLostFocusBehavior()
      Deprecated.
      Determine the application's behavior when unfocused.
      Specified by:
      getLostFocusBehavior in interface Application
      Returns:
      The lost focus behavior of the application.
    • setLostFocusBehavior

      public void setLostFocusBehavior(LostFocusBehavior lostFocusBehavior)
      Deprecated.
      Change the application's behavior when unfocused. By default, the application will throttle the update loop so as to not take 100% CPU usage when it is not in focus, e.g. alt-tabbed, minimized, or obstructed by another window.
      Specified by:
      setLostFocusBehavior in interface Application
      Parameters:
      lostFocusBehavior - The new lost focus behavior to use.
      See Also:
    • isPauseOnLostFocus

      public boolean isPauseOnLostFocus()
      Deprecated.
      Get if the application has to pause then it lost the focus.
      Specified by:
      isPauseOnLostFocus in interface Application
      Returns:
      true if pause on lost focus is enabled, false otherwise.
      See Also:
    • setPauseOnLostFocus

      public void setPauseOnLostFocus(boolean pauseOnLostFocus)
      Deprecated.
      Enable or disable pause on lost focus.

      By default, pause on lost focus is enabled. If enabled, the application will stop updating when it loses focus or becomes inactive (e.g. alt-tab). For online or real-time applications, this might not be preferable, so this feature should be set to disabled. For other applications, it is best to keep it on so that CPU usage is not used when not necessary.

      Specified by:
      setPauseOnLostFocus in interface Application
      Parameters:
      pauseOnLostFocus - true to enable pause on lost focus, false otherwise.
      See Also:
    • start

      public void start()
      Deprecated.
      Description copied from interface: Application
      Starts the application. A bug occurring when using LWJGL3 prevents this method from returning until after the application is stopped on macOS.
      Specified by:
      start in interface Application
    • start

      public void start(boolean waitFor)
      Deprecated.
      Starts the application in display mode.
      Specified by:
      start in interface Application
      Parameters:
      waitFor - if true, the method will wait until the application is started.
      See Also:
    • start

      public void start(JmeContext.Type contextType, boolean waitFor)
      Deprecated.
      Starts the application. Creating a rendering context and executing the main loop in a separate thread.
      Parameters:
      contextType - the type of the context to create.
      waitFor - if true, the method will wait until the application is started.
      Throws:
      IllegalArgumentException - if the context type is not supported.
    • moveScreenProcessingToVR

      public void moveScreenProcessingToVR()
      Deprecated.
      Move filters from the main scene into the eye's. This removes filters from the main scene.
    • preconfigureVRApp

      public void preconfigureVRApp(VRApplication.PreconfigParameter parm, boolean value)
      Deprecated.
      Set VR application specific parameter. If making changes to default values, this must be called before the VRApplication starts
      Parameters:
      parm - the parameter to set.
      value - the value of the parameter.
    • setSeatedExperience

      public void setSeatedExperience(boolean isSeated)
      Deprecated.
      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()
      Deprecated.
      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:
    • resetSeatedPose

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

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

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

      public Node getGuiNode()
      Deprecated.
      Get the GUI node from the application.
      Returns:
      the GUI node from the application.
      See Also:
    • setGuiNode

      public void setGuiNode(Node node)
      Deprecated.
      Set the GUI node that is displayed within the GUI viewport. Calling this method involve clearing all the scenes previously attached to the gui viewport.
      Parameters:
      node - the GUI node to attach.
      See Also:
    • getRootNode

      public Node getRootNode()
      Deprecated.
      Get the root node of the application.
      Returns:
      the root node of the application.
    • hasTraditionalGUIOverlay

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

      public Object getObserver()
      Deprecated.
      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)
      Deprecated.
      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.
    • getFinalObserverRotation

      public Quaternion getFinalObserverRotation()
      Deprecated.
      Get the observer final rotation within the scene.
      Returns:
      the observer final rotation within the scene.
      See Also:
    • getFinalObserverPosition

      public Vector3f getFinalObserverPosition()
      Deprecated.
      Get the observer final position within the scene.
      Returns:
      the observer position.
      See Also:
    • setVRHeightAdjustment

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

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

      public ViewPort getLeftViewPort()
      Deprecated.
      Get the VR headset left viewport.
      Returns:
      the VR headset left viewport.
      See Also:
    • getRightViewPort

      public ViewPort getRightViewPort()
      Deprecated.
      Get the VR headset right viewport.
      Returns:
      the VR headset right viewport.
      See Also:
    • setBackgroundColors

      public void setBackgroundColors(ColorRGBA clr)
      Deprecated.
      Set the background color for both left and right view ports.
      Parameters:
      clr - the background color.
    • runQueuedTasks

      protected void runQueuedTasks()
      Deprecated.
      Runs tasks enqueued via enqueue(Callable)
    • update

      public void update()
      Deprecated.
      Description copied from interface: SystemListener
      Callback to update the application state, and render the scene to the back buffer.
      Specified by:
      update in interface SystemListener
    • initialize

      public void initialize()
      Deprecated.
      Description copied from interface: SystemListener
      Callback to indicate the application to initialize. This method is called in the GL/Rendering thread so any GL-dependent resources can be initialized.
      Specified by:
      initialize in interface SystemListener
    • simpleInitApp

      public abstract void simpleInitApp()
      Deprecated.
      Initialize the application. This method has to be overridden by implementations.
    • destroy

      public void destroy()
      Deprecated.
      Destroy the application (release all resources).
      Specified by:
      destroy in interface SystemListener
    • destroyInput

      protected void destroyInput()
      Deprecated.
    • getGuiViewPort

      public ViewPort getGuiViewPort()
      Deprecated.
      Specified by:
      getGuiViewPort in interface Application
      Returns:
      The GUI viewport. Which is used for the on screen statistics and FPS.
    • getViewPort

      public ViewPort getViewPort()
      Deprecated.
      Specified by:
      getViewPort in interface Application
    • enqueue

      public <V> Future<V> enqueue(Callable<V> callable)
      Deprecated.
      Description copied from interface: Application
      Enqueues a task/callable object to execute in the jME3 rendering thread.

      Callables are executed right at the beginning of the main loop. They are executed even if the application is currently paused or out of focus.

      Specified by:
      enqueue in interface Application
      Type Parameters:
      V - type of result returned by the Callable
      Parameters:
      callable - The callable to run in the main jME3 thread
      Returns:
      a new instance
    • enqueue

      public void enqueue(Runnable runnable)
      Deprecated.
      Enqueues a runnable object to execute in the jME3 rendering thread.

      Runnables are executed right at the beginning of the main loop. They are executed even if the application is currently paused or out of focus.

      Specified by:
      enqueue in interface Application
      Parameters:
      runnable - The runnable to run in the main jME3 thread
    • stop

      public void stop()
      Deprecated.
      Requests the context to close, shutting down the main loop and making necessary cleanup operations. Same as calling stop(false)
      Specified by:
      stop in interface Application
      See Also:
    • stop

      public void stop(boolean waitFor)
      Deprecated.
      Requests the context to close, shutting down the main loop and making necessary cleanup operations. After the application has stopped, it cannot be used anymore.
      Specified by:
      stop in interface Application
      Parameters:
      waitFor - true→wait for the context to be fully destroyed, true→don't wait
    • restart

      public void restart()
      Deprecated.
      Restarts the context, applying any changed settings.

      Changes to the AppSettings of this Application are not applied immediately; calling this method forces the context to restart, applying the new settings.

      Specified by:
      restart in interface Application
    • setAppProfiler

      public void setAppProfiler(AppProfiler prof)
      Deprecated.
      Sets an AppProfiler hook that will be called back for specific steps within a single update frame. Value defaults to null.
      Specified by:
      setAppProfiler in interface Application
      Parameters:
      prof - the profiler to use (alias created) or null for none (default=null)
    • getAppProfiler

      public AppProfiler getAppProfiler()
      Deprecated.
      Returns the current AppProfiler hook, or null if none is set.
      Specified by:
      getAppProfiler in interface Application
      Returns:
      the pre-existing instance, or null if none