Package com.jme3.input.vr.osvr
Class OSVR
java.lang.Object
com.jme3.input.vr.osvr.OSVR
- All Implemented Interfaces:
- VRAPI
A class that wraps an OSVR system.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic byte[]The default J String.static final intThe left eye index.static final com.ochafik.lang.jnaerator.runtime.NativeSizeThe size of the left eye.static final intThe right eye index.static final com.ochafik.lang.jnaerator.runtime.NativeSizeThe size of the right eye.static final intThe first viewer index.static byte[]The default OpenGL String.
- 
Constructor SummaryConstructorsConstructorDescriptionOSVR(VREnvironment environment) Create a new OSVR system attached to the givenVR environment.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddestroy()Close the link with underlying VR system and free all attached resources.com.sun.jna.PointerGet the object that wraps natively the VR compositor.intGet the Head Mounted Device (HMD) display frequency.voidRead and update the eye info from the underlying OSVR system.Returns the transform between the view space and left eye space.Returns the transform between the view space and right eye space.Get the Head Mounted Device (HMD) left eye projection matrix.Get the Head Mounted Device (HMD) right eye projection matrix.Get the Head Mounted Device (HMD) left eye pose (position of the eye from the head) as avector.Get the Head Mounted Device (HMD) right eye pose (position of the eye from the head) as avector.floatGet the Head Mounted Device (HMD) interpupilar distance in meters.getName()Get the name of the underlying VR system.Get the Head Mounted Device (HMD) orientation.Get the Head Mounted Device (HMD) position.voidgetPositionAndOrientation(Vector3f storePos, Quaternion storeRot) Get the Head Mounted Device (HMD) position and orientation.voidgetRenderSize(Vector2f store) Get the size of a Head Mounted Device (HMD) rendering area in pixels.Get the seated to absolute position.getType()Get the Head Mounted Device (HMD) type.Get the input provided by the underlying VR system.Get the object that wraps natively the VR system.voidGrab the current GLFW context.booleanhandleRenderBufferPresent(OSVR_ViewportDescription.ByValue leftView, OSVR_ViewportDescription.ByValue rightView, OSVR_RenderBufferOpenGL.ByValue leftBuffer, OSVR_RenderBufferOpenGL.ByValue rightBuffer) Access to the underlying OSVR structures.booleanInitialize this object from a VR system.booleaninitVRCompositor(boolean allowed) Initialize the VR compositor that will be used for rendering.booleanCheck if the VR API is initialized.voidprintLatencyInfoToConsole(boolean set) Set if latency information has to be logged.voidreset()Reset the VR system.voidsetFlipEyes(boolean set) Flip the left and right eye.booleanEnable context sharing.voidUpdate Head Mounted Device (HMD) pose internal storage.
- 
Field Details- 
FIRST_VIEWERpublic static final int FIRST_VIEWERThe first viewer index.- See Also:
 
- 
EYE_LEFTpublic static final int EYE_LEFTThe left eye index.- See Also:
 
- 
EYE_RIGHTpublic static final int EYE_RIGHTThe right eye index.- See Also:
 
- 
EYE_LEFT_SIZEpublic static final com.ochafik.lang.jnaerator.runtime.NativeSize EYE_LEFT_SIZEThe size of the left eye.
- 
EYE_RIGHT_SIZEpublic static final com.ochafik.lang.jnaerator.runtime.NativeSize EYE_RIGHT_SIZEThe size of the right eye.
- 
defaultJStringpublic static byte[] defaultJStringThe default J String.
- 
OpenGLStringpublic static byte[] OpenGLStringThe default OpenGL String.
 
- 
- 
Constructor Details- 
OSVRCreate a new OSVR system attached to the givenVR environment.- Parameters:
- environment- the- VR environmentto which the input is attached.
 
 
- 
- 
Method Details- 
handleRenderBufferPresentpublic boolean handleRenderBufferPresent(OSVR_ViewportDescription.ByValue leftView, OSVR_ViewportDescription.ByValue rightView, OSVR_RenderBufferOpenGL.ByValue leftBuffer, OSVR_RenderBufferOpenGL.ByValue rightBuffer) Access to the underlying OSVR structures.- Parameters:
- leftView- the left viewport.
- rightView- the right viewport.
- leftBuffer- the left buffer.
- rightBuffer- the right buffer.
- Returns:
- trueif the structure are accessible and- falseotherwise.
 
- 
initializepublic boolean initialize()Description copied from interface:VRAPIInitialize this object from a VR system. All the native bindings to underlying VR system should be done within this method.- Specified by:
- initializein interface- VRAPI
- Returns:
- trueif the initialization is a success and- falseotherwise.
 
- 
grabGLFWContextpublic void grabGLFWContext()Grab the current GLFW context.
- 
initVRCompositorpublic boolean initVRCompositor(boolean allowed) Description copied from interface:VRAPIInitialize the VR compositor that will be used for rendering.- Specified by:
- initVRCompositorin interface- VRAPI
- Parameters:
- allowed-- trueif the use of VR compositor is allowed and- falseotherwise.
- Returns:
- trueif the initialization is a success and- falseotherwise.
 
- 
getVRSystemDescription copied from interface:VRAPIGet the object that wraps natively the VR system.- Specified by:
- getVRSystemin interface- VRAPI
- Returns:
- the object that wraps natively the VR system.
 
- 
getCompositorpublic com.sun.jna.Pointer getCompositor()Description copied from interface:VRAPIGet the object that wraps natively the VR compositor.- Specified by:
- getCompositorin interface- VRAPI
- Returns:
- the object that wraps natively the VR system.
 
- 
getNameDescription copied from interface:VRAPIGet the name of the underlying VR system.
- 
getVRinputDescription copied from interface:VRAPIGet the input provided by the underlying VR system.- Specified by:
- getVRinputin interface- VRAPI
- Returns:
- the input provided by the underlying VR system.
 
- 
setFlipEyespublic void setFlipEyes(boolean set) Description copied from interface:VRAPIFlip the left and right eye.- Specified by:
- setFlipEyesin interface- VRAPI
- Parameters:
- set-- trueif the eyes has to be flipped and- falseotherwise.
 
- 
printLatencyInfoToConsolepublic void printLatencyInfoToConsole(boolean set) Description copied from interface:VRAPISet if latency information has to be logged.- Specified by:
- printLatencyInfoToConsolein interface- VRAPI
- Parameters:
- set-- trueif latency information has to be logged and- falseotherwise.
 
- 
getDisplayFrequencypublic int getDisplayFrequency()Description copied from interface:VRAPIGet the Head Mounted Device (HMD) display frequency.- Specified by:
- getDisplayFrequencyin interface- VRAPI
- Returns:
- the Head Mounted Device (HMD) display frequency.
 
- 
destroypublic void destroy()Description copied from interface:VRAPIClose the link with underlying VR system and free all attached resources.
- 
isInitializedpublic boolean isInitialized()Description copied from interface:VRAPICheck if the VR API is initialized.- Specified by:
- isInitializedin interface- VRAPI
- Returns:
- trueif the VR API is initialized and- falseotherwise.
- See Also:
 
- 
resetpublic void reset()Description copied from interface:VRAPIReset the VR system. After a call to this method, the current position of the HMD should be the origin (i-e the observer without any combined transformation).
- 
getRenderSizeDescription copied from interface:VRAPIGet the size of a Head Mounted Device (HMD) rendering area in pixels.- Specified by:
- getRenderSizein interface- VRAPI
- Parameters:
- store- the size of a Head Mounted Device (HMD) rendering area in pixels (modified).
 
- 
getEyeInfopublic void getEyeInfo()Read and update the eye info from the underlying OSVR system.
- 
getInterpupillaryDistancepublic float getInterpupillaryDistance()Description copied from interface:VRAPIGet the Head Mounted Device (HMD) interpupilar distance in meters.- Specified by:
- getInterpupillaryDistancein interface- VRAPI
- Returns:
- the Head Mounted Device (HMD) interpupilar distance in meters.
 
- 
getOrientationDescription copied from interface:VRAPIGet the Head Mounted Device (HMD) orientation.- Specified by:
- getOrientationin interface- VRAPI
- Returns:
- the Head Mounted Device (HMD) orientation.
 
- 
getPositionDescription copied from interface:VRAPIGet the Head Mounted Device (HMD) position.- Specified by:
- getPositionin interface- VRAPI
- Returns:
- the Head Mounted Device (HMD) orientation.
 
- 
getPositionAndOrientationDescription copied from interface:VRAPIGet the Head Mounted Device (HMD) position and orientation.- Specified by:
- getPositionAndOrientationin interface- VRAPI
- Parameters:
- storePos- the Head Mounted Device (HMD) position (modified).
- storeRot- the Head Mounted Device (HMD) rotation (modified).
 
- 
updatePosepublic void updatePose()Description copied from interface:VRAPIUpdate Head Mounted Device (HMD) pose internal storage. This method should be called before other calls to HMD position/orientation access.- Specified by:
- updatePosein interface- VRAPI
 
- 
getHMDMatrixProjectionLeftEyeDescription copied from interface:VRAPIGet the Head Mounted Device (HMD) left eye projection matrix.- Specified by:
- getHMDMatrixProjectionLeftEyein interface- VRAPI
- Parameters:
- cam- the camera attached to the left eye.
- Returns:
- the Head Mounted Device (HMD) left eye projection matrix.
 
- 
getHMDMatrixProjectionRightEyeDescription copied from interface:VRAPIGet the Head Mounted Device (HMD) right eye projection matrix.- Specified by:
- getHMDMatrixProjectionRightEyein interface- VRAPI
- Parameters:
- cam- the camera attached to the right eye.
- Returns:
- the Head Mounted Device (HMD) right eye projection matrix.
 
- 
getHMDVectorPoseLeftEyeDescription copied from interface:VRAPIGet the Head Mounted Device (HMD) left eye pose (position of the eye from the head) as avector.- Specified by:
- getHMDVectorPoseLeftEyein interface- VRAPI
- Returns:
- the Head Mounted Device (HMD) left eye pose as a vector.
 
- 
getHMDVectorPoseRightEyeDescription copied from interface:VRAPIGet the Head Mounted Device (HMD) right eye pose (position of the eye from the head) as avector.- Specified by:
- getHMDVectorPoseRightEyein interface- VRAPI
- Returns:
- the Head Mounted Device (HMD) right eye pose as a vector.
 
- 
getSeatedToAbsolutePositionDescription copied from interface:VRAPIGet the seated to absolute position.- Specified by:
- getSeatedToAbsolutePositionin interface- VRAPI
- Returns:
- the seated to absolute position.
 
- 
getHMDMatrixPoseLeftEyeDescription copied from interface:VRAPIReturns the transform between the view space and left eye space. Eye space is the per-eye flavor of view space that provides stereo disparity. Instead of Model * View * Projection the model is Model * View * Eye * Projection. Normally View and Eye will be multiplied together and treated as View. This matrix incorporates the user's interpupillary distance (IPD).- Specified by:
- getHMDMatrixPoseLeftEyein interface- VRAPI
- Returns:
- the transform between the view space and eye space.
 
- 
getHMDMatrixPoseRightEyeDescription copied from interface:VRAPIReturns the transform between the view space and right eye space. Eye space is the per-eye flavor of view space that provides stereo disparity. Instead of Model * View * Projection the model is Model * View * Eye * Projection. Normally View and Eye will be multiplied together and treated as View. This matrix incorporates the user's interpupillary distance (IPD).- Specified by:
- getHMDMatrixPoseRightEyein interface- VRAPI
- Returns:
- the transform between the view space and eye space.
 
- 
getTypeDescription copied from interface:VRAPIGet the Head Mounted Device (HMD) type.
 
-