Package com.jme3.app
Class VREnvironment
java.lang.Object
com.jme3.app.VREnvironment
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidatttach(AppState appState, Application application) Attach the VR environment to the given app state and application.booleanIs the VR compositor is active.Get thecameraused for rendering.floatGet the default aspect ratio.floatGet the default Field Of View (FOV) value.Get the scene observer.Get thesettingsattached to this environment.Get the VR bounds.Get the GUI manager attached to this environment.Get the VR underlying hardware.floatGet 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.booleanCheck if the application has a GUI overlay attached.booleanInitialize this VR environment.booleanCheck if the VR environment is initialized.booleanCheck if the rendering is instanced (see Geometry instancing).booleanisInVR()Check if the VR mode is enabled.booleanCheck if the application is configured as a seated experience.booleanbooleanGet if the system currently support VR.voidReset headset pose if seating experience.voidsetDefaultAspect(float defaultAspect) Set the default aspect ratio.voidsetDefaultFOV(float defaultFOV) Set the default Field Of View (FOV) value.voidsetObserver(Spatial observer) Set the scene observer.voidsetSeatedExperience(boolean isSeated) Can be used to change seated experience during runtime.voidsetSettings(AppSettings settings) Set thesettingsattached to this environment.voidsetVRBounds(VRBounds bounds) Set the VR bounds.voidsetVRHeightAdjustment(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-trueif designed for sitting,falsefor standing/roomscale- See Also:
-
isSeatedExperience
public boolean isSeatedExperience()Check if the application is configured as a seated experience.- Returns:
trueif the application is configured as a seated experience andfalseotherwise.- 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 thesettingsattached to this environment.- Returns:
- the
settingsattached to this environment. - See Also:
-
setSettings
Set thesettingsattached to this environment.- Parameters:
settings- thesettingsattached to this environment.- See Also:
-
isVRSupported
public boolean isVRSupported()Get if the system currently support VR.- Returns:
trueif the system currently support VR andfalseotherwise.
-
isInVR
public boolean isInVR()Check if the VR mode is enabled.- Returns:
trueif the VR mode is enabled andfalseotherwise.
-
isInstanceRendering
public boolean isInstanceRendering()Check if the rendering is instanced (see Geometry instancing).- Returns:
trueif the rendering is instanced andfalseotherwise.
-
isSwapBuffers
public boolean isSwapBuffers() -
hasTraditionalGUIOverlay
public boolean hasTraditionalGUIOverlay()Check if the application has a GUI overlay attached.- Returns:
trueif the application has a GUI overlay attached andfalseotherwise.
-
isInitialized
public boolean isInitialized()Check if the VR environment is initialized. A call to theinitialize()method should set this value totrue- Returns:
trueif the VR environment is initialized andfalseotherwise.
-
compositorAllowed
public boolean compositorAllowed()Is the VR compositor is active.- Returns:
trueif the VR compositor is active andfalseotherwise.
-
resetSeatedPose
public void resetSeatedPose()Reset headset pose if seating experience. -
getAppState
-
getApplication
-
getCamera
Get thecameraused 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:
trueif the VR environment is successfully initialized andfalseotherwise.
-