Package com.jme3.app
Class VRAppState
java.lang.Object
com.jme3.app.state.AbstractAppState
com.jme3.app.VRAppState
- All Implemented Interfaces:
AppState
Deprecated.
The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR).
For new Virtual Reality projects, use user libraries that provide OpenXR support.
See Virtual Reality JME wiki section
for more information.
A JMonkey app state dedicated to Virtual Reality.
An application that want to use VR devices (HTC vive, ...) has to use this app state.
As this app state and the main
As this app state and the main
application
have to share application settings
,
the common way to use this app state is:- To create
application settings
and set the VR related settings (seeVRConstants
). - To instantiate this app state with the created settings.
- To instantiate the main
application
and to attach it to the created settings (withsetSettings(AppSettings)
). - To start the main
application
.
-
Field Summary
Modifier and TypeFieldDescriptionboolean
Deprecated.Is the application has not to start within VR mode (default isfalse
).static final String
Deprecated.Fields inherited from class com.jme3.app.state.AbstractAppState
initialized
-
Constructor Summary
ConstructorDescriptionVRAppState
(VREnvironment environment) Deprecated.Create a new default VR app state that relies on the givenVR environment
.VRAppState
(AppSettings settings, VREnvironment environment) Deprecated.The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
Deprecated.Called byAppStateManager
when transitioning thisAppState
from terminating to detached.Deprecated.Get theApplication
to which this app state is attached.Deprecated.Get the observer final position within the scene.Deprecated.Get the observer final rotation within the scene.Deprecated.Get the VR headset left viewport.Deprecated.Get the scene observer.Deprecated.Get the VR headset right viewport.Deprecated.Get thesettings
attached to this app state.Deprecated.Get thestate manager
to which this app state is attached.Deprecated.Return theVR environment
on which this app state relies.Deprecated.Get the GUI manager attached to this app state.Deprecated.Get the VR underlying hardware.Deprecated.Get the VR dedicated input.Deprecated.Get the VR mouse manager attached to this app state.Deprecated.Get the VR view manager.void
initialize
(AppStateManager stateManager, Application app) Deprecated.Called byAppStateManager
when transitioning thisAppState
from initializing to running.
This will happen on the next iteration through the update loop afterAppStateManager.attach(com.jme3.app.state.AppState)
was called.boolean
Deprecated.Check if the rendering is instanced (see Geometry instancing).void
Deprecated.Move filters from the main scene into the eye's.void
Deprecated.Called after all rendering commands are flushed.protected void
processSettings
(AppSettings settings) Deprecated.Process the attached settings and apply changes to this app state.void
render
(RenderManager rm) Deprecated.Render the state.void
Deprecated.Set the background color for both left and right view ports.void
setFrustrumNearFar
(float near, float far) Deprecated.Set the frustum values for the application.void
setMirrorWindowSize
(int width, int height) Deprecated.Set the mirror window size in pixel.void
setObserver
(Spatial observer) Deprecated.Set the scene observer.void
setResolutionMultiplier
(float val) Deprecated.Set the resolution multiplier.void
setSettings
(AppSettings settings) Deprecated.Set thesettings
attached to this app state.void
simpleRender
(RenderManager renderManager) Deprecated.Rendering callback of the app state.void
simpleUpdate
(float tpf) Deprecated.Simple update of the app state, this method should contain any spatial updates.void
stateAttached
(AppStateManager stateManager) Deprecated.Called byAppStateManager.attach(com.jme3.app.state.AppState)
when transitioning thisAppState
from detached to initializing.void
stateDetached
(AppStateManager stateManager) Deprecated.Called byAppStateManager.detach(com.jme3.app.state.AppState)
when transitioning thisAppState
from running to terminating.void
update
(float tpf) Deprecated.Called to update theAppState
.Methods inherited from class com.jme3.app.state.AbstractAppState
getId, isEnabled, isInitialized, setEnabled, setId
-
Field Details
-
ID
Deprecated.- See Also:
-
DISABLE_VR
public boolean DISABLE_VRDeprecated.Is the application has not to start within VR mode (default isfalse
).
-
-
Constructor Details
-
VRAppState
Deprecated.Create a new default VR app state that relies on the givenVR environment
.- Parameters:
environment
- theVR environment
that this app state is using.
-
VRAppState
Deprecated.The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). For new Virtual Reality projects, use user libraries that provide OpenXR support. See Virtual Reality JME wiki section for more information.Create a new VR app state with given settings. The app state relies on the givenVR environment
.- Parameters:
settings
- the settings to use.environment
- theVR environment
that this app state is using.
-
-
Method Details
-
simpleUpdate
public void simpleUpdate(float tpf) Deprecated.Simple update of the app state, this method should contain any spatial updates. This method is called by theupdate()
method and should not be called manually.- Parameters:
tpf
- the application time.
-
simpleRender
Deprecated.Rendering callback of the app state. This method is called by theupdate()
method and should not be called manually.- Parameters:
renderManager
- therender manager
.
-
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.
-
moveScreenProcessingToVR
public void moveScreenProcessingToVR()Deprecated.Move filters from the main scene into the eye's. This removes filters from the main scene. -
getFinalObserverRotation
Deprecated.Get the observer final rotation within the scene.- Returns:
- the observer final rotation within the scene.
- See Also:
-
getFinalObserverPosition
Deprecated.Get the observer final position within the scene.- Returns:
- the observer position.
- See Also:
-
getLeftViewPort
Deprecated.Get the VR headset left viewport.- Returns:
- the VR headset left viewport.
- See Also:
-
getRightViewPort
Deprecated.Get the VR headset right viewport.- Returns:
- the VR headset right viewport.
- See Also:
-
setBackgroundColors
Deprecated.Set the background color for both left and right view ports.- Parameters:
clr
- the background color.
-
getApplication
Deprecated.Get theApplication
to which this app state is attached.- Returns:
- the
Application
to which this app state is attached. - See Also:
-
getStateManager
Deprecated.Get thestate manager
to which this app state is attached.- Returns:
- the
state manager
to which this app state is attached. - See Also:
-
getObserver
Deprecated.Get the scene observer. If no observer has been set, this method returns the application camera.- Returns:
- the scene observer.
- See Also:
-
setObserver
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.
-
isInstanceRendering
public boolean isInstanceRendering()Deprecated.Check if the rendering is instanced (see Geometry instancing).- Returns:
true
if the rendering is instanced andfalse
otherwise.
-
getVREnvironment
Deprecated.Return theVR environment
on which this app state relies.- Returns:
- the
VR environment
on which this app state relies.
-
getVRHardware
Deprecated.Get the VR underlying hardware.- Returns:
- the VR underlying hardware.
-
getVRinput
Deprecated.Get the VR dedicated input.- Returns:
- the VR dedicated input.
-
getVRViewManager
Deprecated.Get the VR view manager.- Returns:
- the VR view manager.
-
getVRGUIManager
Deprecated.Get the GUI manager attached to this app state.- Returns:
- the GUI manager attached to this app state.
-
getVRMouseManager
Deprecated.Get the VR mouse manager attached to this app state.- Returns:
- the VR mouse manager attached to this application.
-
getSettings
Deprecated.Get thesettings
attached to this app state.- Returns:
- the
settings
attached to this app state. - See Also:
-
setSettings
Deprecated.Set thesettings
attached to this app state.- Parameters:
settings
- thesettings
attached to this app state.- See Also:
-
update
public void update(float tpf) Deprecated.Description copied from interface:AppState
Called to update theAppState
. This method will be called every render pass if theAppState
is both attached and enabled.- Specified by:
update
in interfaceAppState
- Overrides:
update
in classAbstractAppState
- Parameters:
tpf
- Time since the last call to update(), in seconds.
-
render
Deprecated.Description copied from interface:AppState
Render the state. This method will be called every render pass if theAppState
is both attached and enabled.- Specified by:
render
in interfaceAppState
- Overrides:
render
in classAbstractAppState
- Parameters:
rm
- RenderManager
-
postRender
public void postRender()Deprecated.Description copied from interface:AppState
Called after all rendering commands are flushed. This method will be called every render pass if theAppState
is both attached and enabled.- Specified by:
postRender
in interfaceAppState
- Overrides:
postRender
in classAbstractAppState
-
initialize
Deprecated.Description copied from interface:AppState
Called byAppStateManager
when transitioning thisAppState
from initializing to running.
This will happen on the next iteration through the update loop afterAppStateManager.attach(com.jme3.app.state.AppState)
was called.AppStateManager
will call this only from the update loop inside the rendering thread. This means is it safe to modify the scene graph from this method.- Specified by:
initialize
in interfaceAppState
- Overrides:
initialize
in classAbstractAppState
- Parameters:
stateManager
- The state managerapp
- The application
-
stateAttached
Deprecated.Description copied from interface:AppState
Called byAppStateManager.attach(com.jme3.app.state.AppState)
when transitioning thisAppState
from detached to initializing.There is no assumption about the thread from which this function is called, therefore it is unsafe to modify the scene graph from this method. Please use
AppState.initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application)
instead.- Specified by:
stateAttached
in interfaceAppState
- Overrides:
stateAttached
in classAbstractAppState
- Parameters:
stateManager
- State manager to which the state was attached to.
-
cleanup
public void cleanup()Deprecated.Description copied from interface:AppState
Called byAppStateManager
when transitioning thisAppState
from terminating to detached. This method is called the following render pass after theAppState
has been detached and is always called once and only once for each timeinitialize()
is called. Either when theAppState
is detached or when the application terminates (if it terminates normally).- Specified by:
cleanup
in interfaceAppState
- Overrides:
cleanup
in classAbstractAppState
-
stateDetached
Deprecated.Description copied from interface:AppState
Called byAppStateManager.detach(com.jme3.app.state.AppState)
when transitioning thisAppState
from running to terminating.There is no assumption about the thread from which this function is called, therefore it is unsafe to modify the scene graph from this method. Please use
AppState.cleanup()
instead.- Specified by:
stateDetached
in interfaceAppState
- Overrides:
stateDetached
in classAbstractAppState
- Parameters:
stateManager
- The state manager from which the state was detached from.
-
processSettings
Deprecated.Process the attached settings and apply changes to this app state.- Parameters:
settings
- the app settings to process.
-