Package com.jme3.app
Class VREnvironment
java.lang.Object
com.jme3.app.VREnvironment
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
atttach
(AppState appState, Application application) Attach the VR environment to the given app state and application.boolean
Is the VR compositor is active.Get thecamera
used for rendering.float
Get the default aspect ratio.float
Get the default Field Of View (FOV) value.Get the scene observer.Get thesettings
attached to this environment.Get the VR bounds.Get the GUI manager attached to this environment.Get the VR underlying hardware.float
Get the VR headset height from the ground.Get the VR dedicated input.Get the VR mouse manager attached to this environment.Get the VR view manager.boolean
Check if the application has a GUI overlay attached.boolean
Initialize this VR environment.boolean
Check if the VR environment is initialized.boolean
Check if the rendering is instanced (see Geometry instancing).boolean
isInVR()
Check if the VR mode is enabled.boolean
Check if the application is configured as a seated experience.boolean
boolean
Get if the system currently support VR.void
Reset headset pose if seating experience.void
setDefaultAspect
(float defaultAspect) Set the default aspect ratio.void
setDefaultFOV
(float defaultFOV) Set the default Field Of View (FOV) value.void
setObserver
(Spatial observer) Set the scene observer.void
setSeatedExperience
(boolean isSeated) Can be used to change seated experience during runtime.void
setSettings
(AppSettings settings) Set thesettings
attached to this environment.void
setVRBounds
(VRBounds bounds) Set the VR bounds.void
setVRHeightAdjustment
(float amount) Set the VR headset height from the ground.
-
Field Details
-
vrBinding
public int vrBindingThe underlying system VR API. By default, set toVRConstants.SETTING_VRAPI_OPENVR_VALUE
.
-
-
Constructor Details
-
VREnvironment
-
-
Method Details
-
getVRHardware
Get the VR underlying hardware.- Returns:
- the VR underlying hardware.
-
setVRBounds
Set the VR bounds.- See Also:
-
getVRBounds
Get the VR bounds.- Returns:
- the VR bounds.
- See Also:
-
getVRinput
Get the VR dedicated input.- Returns:
- the VR dedicated input.
-
getVRViewManager
Get the VR view manager.- Returns:
- the VR view manager.
-
getVRGUIManager
Get the GUI manager attached to this environment.- Returns:
- the GUI manager attached to this environment.
-
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 andfalse
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
Get the scene observer. If no observer has been set, this method return the applicationcamera
.- Returns:
- the scene observer.
- See Also:
-
setObserver
Set the scene observer. The VR headset will be linked to it. If no observer is set, the VR headset is linked to the applicationcamera
.- 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
Get thesettings
attached to this environment.- Returns:
- the
settings
attached to this environment. - See Also:
-
setSettings
Set thesettings
attached to this environment.- Parameters:
settings
- thesettings
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 andfalse
otherwise.
-
isInVR
public boolean isInVR()Check if the VR mode is enabled.- Returns:
true
if the VR mode is enabled andfalse
otherwise.
-
isInstanceRendering
public boolean isInstanceRendering()Check if the rendering is instanced (see Geometry instancing).- Returns:
true
if the rendering is instanced andfalse
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 andfalse
otherwise.
-
isInitialized
public boolean isInitialized()Check if the VR environment is initialized. A call to theinitialize()
method should set this value totrue
- Returns:
true
if the VR environment is initialized andfalse
otherwise.
-
compositorAllowed
public boolean compositorAllowed()Is the VR compositor is active.- Returns:
true
if the VR compositor is active andfalse
otherwise.
-
resetSeatedPose
public void resetSeatedPose()Reset headset pose if seating experience. -
getAppState
-
getApplication
-
getCamera
Get thecamera
used for rendering. If the VR mode isactive
, this method return a dummy camera, otherwise, this method return the camera of the attached application.- Returns:
- the camera attached used for rendering.
-
getDummyCamera
-
atttach
Attach the VR environment to the given app state and application. This method should be called within thestateAttached(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 andfalse
otherwise.
-