public class VREnvironment
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
vrBinding
The underlying system VR API.
|
Constructor and Description |
---|
VREnvironment(AppSettings settings) |
Modifier and Type | Method and Description |
---|---|
void |
atttach(AppState appState,
Application application)
Attach the VR environment to the given app state and application.
|
boolean |
compositorAllowed()
Is the VR compositor is active.
|
Application |
getApplication() |
AppState |
getAppState() |
Camera |
getCamera()
Get the
camera used for rendering. |
float |
getDefaultAspect()
Get the default aspect ratio.
|
float |
getDefaultFOV()
Get the default Field Of View (FOV) value.
|
Camera |
getDummyCamera() |
java.lang.Object |
getObserver()
Get the scene observer.
|
AppSettings |
getSettings()
Get the
settings attached to this environment. |
VRBounds |
getVRBounds()
Get the VR bounds.
|
VRGuiManager |
getVRGUIManager()
Get the GUI manager attached to this environment.
|
VRAPI |
getVRHardware()
Get the VR underlying hardware.
|
float |
getVRHeightAdjustment()
Get the VR headset height from the ground.
|
VRInputAPI |
getVRinput()
Get the VR dedicated input.
|
VRMouseManager |
getVRMouseManager()
Get the VR mouse manager attached to this environment.
|
VRViewManager |
getVRViewManager()
Get the VR view manager.
|
boolean |
hasTraditionalGUIOverlay()
Check if the application has a GUI overlay attached.
|
boolean |
initialize()
Initialize this VR environment.
|
boolean |
isInitialized()
Check if the VR environment is initialized.
|
boolean |
isInstanceRendering()
Check if the rendering is instanced (see Geometry instancing).
|
boolean |
isInVR()
Check if the VR mode is enabled.
|
boolean |
isSeatedExperience()
Check if the application is configured as a seated experience.
|
boolean |
isSwapBuffers() |
boolean |
isVRSupported()
Get if the system currently support VR.
|
void |
resetSeatedPose()
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 the
settings attached to this environment. |
void |
setVRBounds(VRBounds bounds)
Set the VR bounds.
|
void |
setVRHeightAdjustment(float amount)
Set the VR headset height from the ground.
|
public int vrBinding
VRConstants.SETTING_VRAPI_OPENVR_VALUE
.public VREnvironment(AppSettings settings)
public VRAPI getVRHardware()
public void setVRBounds(VRBounds bounds)
getVRBounds()
public VRBounds getVRBounds()
setVRBounds(VRBounds)
public VRInputAPI getVRinput()
public VRViewManager getVRViewManager()
public VRGuiManager getVRGUIManager()
public VRMouseManager getVRMouseManager()
public void setSeatedExperience(boolean isSeated)
isSeated
- true
if designed for sitting, false
for standing/roomscaleisSeatedExperience()
public boolean isSeatedExperience()
true
if the application is configured as a seated experience and false
otherwise.setSeatedExperience(boolean)
public void setVRHeightAdjustment(float amount)
amount
- the VR headset height from the ground.getVRHeightAdjustment()
public float getVRHeightAdjustment()
setVRHeightAdjustment(float)
public java.lang.Object getObserver()
camera
.setObserver(Spatial)
public void setObserver(Spatial observer)
camera
.observer
- the scene observer.public float getDefaultFOV()
setDefaultFOV(float)
public void setDefaultFOV(float defaultFOV)
defaultFOV
- the default Field Of View (FOV) value.getDefaultFOV()
public float getDefaultAspect()
setDefaultAspect(float)
public void setDefaultAspect(float defaultAspect)
defaultAspect
- the default aspect ratio.getDefaultAspect()
public AppSettings getSettings()
settings
attached to this environment.settings
attached to this environment.setSettings(AppSettings)
public void setSettings(AppSettings settings)
settings
attached to this environment.settings
- the settings
attached to this environment.getSettings()
public boolean isVRSupported()
true
if the system currently support VR and false
otherwise.public boolean isInVR()
true
if the VR mode is enabled and false
otherwise.public boolean isInstanceRendering()
true
if the rendering is instanced and false
otherwise.public boolean isSwapBuffers()
public boolean hasTraditionalGUIOverlay()
true
if the application has a GUI overlay attached and false
otherwise.public boolean isInitialized()
initialize()
method should set this value to true
true
if the VR environment is initialized and false
otherwise.public boolean compositorAllowed()
true
if the VR compositor is active and false
otherwise.public void resetSeatedPose()
public AppState getAppState()
public Application getApplication()
public Camera getCamera()
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.public Camera getDummyCamera()
public void atttach(AppState appState, Application application)
stateAttached(com.jme3.app.state.AppStateManager)
method
from the app state.appState
- the app state to attach.application
- the application to attach.public boolean initialize()
true
if the VR environment is successfully initialized and false
otherwise.