Package com.jme3.input.vr
Interface VRAPI
- All Known Implementing Classes:
LWJGLOpenVR
,OculusVR
,OpenVR
,OSVR
public interface VRAPI
An interface that represents a VR system. This interface has to be implemented in order to wrap underlying VR system (OpenVR, OSVR, ...)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Close the link with underlying VR system and free all attached resources.Get the object that wraps natively the VR compositor.int
Get the Head Mounted Device (HMD) display frequency.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
.float
Get 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.void
getPositionAndOrientation
(Vector3f storePos, Quaternion storeRot) Get the Head Mounted Device (HMD) position and orientation.void
getRenderSize
(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.boolean
Initialize this object from a VR system.boolean
initVRCompositor
(boolean allowed) Initialize the VR compositor that will be used for rendering.boolean
Check if the VR API is initialized.void
printLatencyInfoToConsole
(boolean set) Set if latency information has to be logged.void
reset()
Reset the VR system.void
setFlipEyes
(boolean set) Flip the left and right eye.void
Update Head Mounted Device (HMD) pose internal storage.
-
Method Details
-
initialize
boolean initialize()Initialize this object from a VR system. All the native bindings to underlying VR system should be done within this method.- Returns:
true
if the initialization is a success andfalse
otherwise.
-
initVRCompositor
boolean initVRCompositor(boolean allowed) Initialize the VR compositor that will be used for rendering.- Parameters:
allowed
-true
if the use of VR compositor is allowed andfalse
otherwise.- Returns:
true
if the initialization is a success andfalse
otherwise.
-
getVRSystem
Object getVRSystem()Get the object that wraps natively the VR system.- Returns:
- the object that wraps natively the VR system.
-
getCompositor
Object getCompositor()Get the object that wraps natively the VR compositor.- Returns:
- the object that wraps natively the VR system.
-
getName
String getName()Get the name of the underlying VR system.- Returns:
- the name of the underlying VR system.
-
getVRinput
VRInputAPI getVRinput()Get the input provided by the underlying VR system.- Returns:
- the input provided by the underlying VR system.
-
setFlipEyes
void setFlipEyes(boolean set) Flip the left and right eye.- Parameters:
set
-true
if the eyes has to be flipped andfalse
otherwise.
-
printLatencyInfoToConsole
void printLatencyInfoToConsole(boolean set) Set if latency information has to be logged.- Parameters:
set
-true
if latency information has to be logged andfalse
otherwise.
-
getDisplayFrequency
int getDisplayFrequency()Get the Head Mounted Device (HMD) display frequency.- Returns:
- the Head Mounted Device (HMD) display frequency.
-
destroy
void destroy()Close the link with underlying VR system and free all attached resources. -
isInitialized
boolean isInitialized()Check if the VR API is initialized.- Returns:
true
if the VR API is initialized andfalse
otherwise.- See Also:
-
reset
void reset()Reset 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). -
getRenderSize
Get the size of a Head Mounted Device (HMD) rendering area in pixels.- Parameters:
store
- the size of a Head Mounted Device (HMD) rendering area in pixels (modified).
-
getInterpupillaryDistance
float getInterpupillaryDistance()Get the Head Mounted Device (HMD) interpupilar distance in meters.- Returns:
- the Head Mounted Device (HMD) interpupilar distance in meters.
-
getOrientation
Quaternion getOrientation()Get the Head Mounted Device (HMD) orientation.- Returns:
- the Head Mounted Device (HMD) orientation.
-
getPosition
Vector3f getPosition()Get the Head Mounted Device (HMD) position.- Returns:
- the Head Mounted Device (HMD) orientation.
-
getPositionAndOrientation
Get the Head Mounted Device (HMD) position and orientation.- Parameters:
storePos
- the Head Mounted Device (HMD) position (modified).storeRot
- the Head Mounted Device (HMD) rotation (modified).
-
updatePose
void updatePose()Update Head Mounted Device (HMD) pose internal storage. This method should be called before other calls to HMD position/orientation access. -
getHMDMatrixProjectionLeftEye
Get the Head Mounted Device (HMD) left eye projection matrix.- Parameters:
cam
- the camera attached to the left eye.- Returns:
- the Head Mounted Device (HMD) left eye projection matrix.
-
getHMDMatrixProjectionRightEye
Get the Head Mounted Device (HMD) right eye projection matrix.- Parameters:
cam
- the camera attached to the right eye.- Returns:
- the Head Mounted Device (HMD) right eye projection matrix.
-
getHMDVectorPoseLeftEye
Vector3f getHMDVectorPoseLeftEye()Get the Head Mounted Device (HMD) left eye pose (position of the eye from the head) as avector
.- Returns:
- the Head Mounted Device (HMD) left eye pose as a
vector
.
-
getHMDVectorPoseRightEye
Vector3f getHMDVectorPoseRightEye()Get the Head Mounted Device (HMD) right eye pose (position of the eye from the head) as avector
.- Returns:
- the Head Mounted Device (HMD) right eye pose as a
vector
.
-
getHMDMatrixPoseLeftEye
Matrix4f getHMDMatrixPoseLeftEye()Returns 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).- Returns:
- the transform between the view space and eye space.
-
getHMDMatrixPoseRightEye
Matrix4f getHMDMatrixPoseRightEye()Returns 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).- Returns:
- the transform between the view space and eye space.
-
getType
HmdType getType()Get the Head Mounted Device (HMD) type.- Returns:
- the Head Mounted Device (HMD) type.
-
getSeatedToAbsolutePosition
Vector3f getSeatedToAbsolutePosition()Get the seated to absolute position.- Returns:
- the seated to absolute position.
-