Package com.jme3.util
Class VRGuiManager
java.lang.Object
com.jme3.util.VRGuiManager
A class dedicated to the management and the display of a Graphical User Interface (GUI) within a VR environment.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVRGuiManager(VREnvironment environment) Create a new GUI manager attached to the given app state. -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustGuiDistance(float adjustAmount) Adjust the GUI distance from the observer.Get the GUI canvas size.Get the ratio between theGUI canvas sizeand the application main windows (if available) or the screen size.floatGet the GUI distance from the observer.floatGet the GUI scale.floatGet the GUIpositioning mode.booleanGet if the GUI has to use curved surface.booleanGet if the GUI has to be displayed even if it is behind objects.booleanvoidInform this manager that it has to position the GUI.voidpositionGuiNow(float tpf) Position the GUI without delay.voidsetCurvedSurface(boolean set) Set if the GUI has to use curved surface.voidsetGuiDistance(float newGuiDistance) Set the GUI distance from the observer.voidsetGuiOverdraw(boolean set) Set if the GUI has to be displayed even if it is behind objects.voidsetGuiScale(float scale) Set the GUI scale.voidsetPositioningElasticity(float elastic) Makes auto GUI positioning happen not immediately, but like an elastic connected to the headset.voidSet the GUIpositioning mode.voidSet up the GUI.voidsetWantsReposition(boolean wantsReposition) voidUpdate the GUI geometric state.
-
Field Details
-
wantsReposition
protected boolean wantsReposition
-
-
Constructor Details
-
VRGuiManager
Create a new GUI manager attached to the given app state.- Parameters:
environment- the VR environment to which this manager is attached to.
-
-
Method Details
-
isWantsReposition
public boolean isWantsReposition() -
setWantsReposition
public void setWantsReposition(boolean wantsReposition) -
setPositioningElasticity
public void setPositioningElasticity(float elastic) Makes auto GUI positioning happen not immediately, but like an elastic connected to the headset. Setting to 0 disables (default) Higher settings make it track the headset quicker.- Parameters:
elastic- amount of elasticity
-
getPositioningElasticity
public float getPositioningElasticity() -
getPositioningMode
Get the GUIpositioning mode.- Returns:
- the GUI
positioning mode. - See Also:
-
setPositioningMode
Set the GUIpositioning mode.- Parameters:
mode- the GUIpositioning mode.- See Also:
-
getCanvasSize
Get the GUI canvas size. This method return the size in pixels of the GUI available area within the VR view.- Returns:
- the GUI canvas size. This method return the size in pixels of the GUI available area within the VR view.
-
getCanvasToWindowRatio
Get the ratio between theGUI canvas sizeand the application main windows (if available) or the screen size.- Returns:
- the ratio between the
GUI canvas sizeand the application main windows (if available). - See Also:
-
positionGui
public void positionGui()Inform this manager that it has to position the GUI. -
updateGuiQuadGeometricState
public void updateGuiQuadGeometricState()Update the GUI geometric state. This method should be called after GUI modification. -
positionGuiNow
public void positionGuiNow(float tpf) Position the GUI without delay.- Parameters:
tpf- the time per frame.
-
getGuiDistance
public float getGuiDistance()Get the GUI distance from the observer.- Returns:
- the GUI distance from the observer.
- See Also:
-
setGuiDistance
public void setGuiDistance(float newGuiDistance) Set the GUI distance from the observer.- Parameters:
newGuiDistance- the GUI distance from the observer.- See Also:
-
getGUIScale
public float getGUIScale()Get the GUI scale.- Returns:
- the GUI scale.
- See Also:
-
setGuiScale
public void setGuiScale(float scale) Set the GUI scale.- Parameters:
scale- the GUI scale.- See Also:
-
adjustGuiDistance
public void adjustGuiDistance(float adjustAmount) Adjust the GUI distance from the observer. This method increment / decrement theGUI distanceby the given value.- Parameters:
adjustAmount- the increment (if positive) / decrement (if negative) value of the GUI distance.
-
setupGui
Set up the GUI.- Parameters:
leftCam- the left-eye camera.rightCam- the right-eye camera.left- the left-eye viewport.right- the right-eye viewport.
-
isCurverSurface
public boolean isCurverSurface()Get if the GUI has to use curved surface.- Returns:
trueif the GUI has to use curved surface andfalseotherwise.- See Also:
-
setCurvedSurface
public void setCurvedSurface(boolean set) Set if the GUI has to use curved surface.- Parameters:
set-trueif the GUI has to use curved surface andfalseotherwise.- See Also:
-
isGuiOverdraw
public boolean isGuiOverdraw()Get if the GUI has to be displayed even if it is behind objects.- Returns:
trueif the GUI has to use curved surface andfalseotherwise.- See Also:
-
setGuiOverdraw
public void setGuiOverdraw(boolean set) Set if the GUI has to be displayed even if it is behind objects.- Parameters:
set-trueif the GUI has to use curved surface andfalseotherwise.- See Also:
-