public class OculusVR extends java.lang.Object implements VRAPI
A few notes about the Oculus coordinate system:
Constructor and Description |
---|
OculusVR(VREnvironment environment) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Close the link with underlying VR system and free all attached resources.
|
void |
findHMDTextureSize() |
long |
getChain(int eye) |
java.lang.Void |
getCompositor()
Get the object that wraps natively the VR compositor.
|
int |
getDisplayFrequency()
Get the Head Mounted Device (HMD) display frequency.
|
VREnvironment |
getEnvironment() |
org.lwjgl.ovr.OVRPosef |
getEyePose(int eye) |
org.lwjgl.ovr.OVRFovPort |
getFovPort() |
FrameBuffer[] |
getFramebuffers(int eye) |
org.lwjgl.ovr.OVRPosef |
getHeadPose() |
Matrix4f |
getHMDMatrixPoseLeftEye()
Returns the transform between the view space and left eye space.
|
Matrix4f |
getHMDMatrixPoseRightEye()
Returns the transform between the view space and right eye space.
|
Matrix4f |
getHMDMatrixProjectionLeftEye(Camera cam)
Get the Head Mounted Device (HMD) left eye projection matrix.
|
Matrix4f |
getHMDMatrixProjectionRightEye(Camera cam)
Get the Head Mounted Device (HMD) right eye projection matrix.
|
Vector3f |
getHMDVectorPoseLeftEye()
Get the Head Mounted Device (HMD) left eye pose (position of the eye from the head) as a
vector . |
Vector3f |
getHMDVectorPoseRightEye()
Get the Head Mounted Device (HMD) right eye pose (position of the eye from the head) as a
vector . |
float |
getInterpupillaryDistance()
Get the Head Mounted Device (HMD) interpupilar distance in meters.
|
org.lwjgl.ovr.OVRLayerEyeFov |
getLayer0() |
org.lwjgl.PointerBuffer |
getLayers() |
java.lang.String |
getName()
Get the name of the underlying VR system.
|
Quaternion |
getOrientation()
Get the Head Mounted Device (HMD) orientation.
|
Vector3f |
getPosition()
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.
|
Vector3f |
getSeatedToAbsolutePosition()
Get the seated to absolute position.
|
long |
getSessionPointer() |
HmdType |
getType()
Get the Head Mounted Device (HMD) type.
|
OculusVRInput |
getVRinput()
Get the input provided by the underlying VR system.
|
java.lang.Void |
getVRSystem()
Get the object that wraps natively the VR system.
|
boolean |
initialize()
Initialize this object from a VR system.
|
boolean |
initVRCompositor(boolean set)
Initialize the VR compositor that will be used for rendering.
|
boolean |
isInitialized()
Check if the VR API is initialized.
|
static Matrix4f |
matrixO2J(org.lwjgl.ovr.OVRMatrix4f from,
Matrix4f to)
Copy the values from a LibOVR matrix into a jMonkeyEngine matrix.
|
void |
printLatencyInfoToConsole(boolean set)
Set if latency information has to be logged.
|
static Quaternion |
quatO2J(org.lwjgl.ovr.OVRQuatf from,
Quaternion to)
Copy the values from a LibOVR quaternion into a jMonkeyEngine quaternion.
|
void |
reset()
Reset the VR system.
|
void |
setFlipEyes(boolean set)
Flip the left and right eye..
|
void |
setupFramebuffers(int eye)
Create a framebuffer for an eye.
|
void |
setupLayers() |
void |
updatePose()
Update Head Mounted Device (HMD) pose internal storage.
|
static Vector3f |
vecO2J(org.lwjgl.ovr.OVRVector3f from,
Vector3f to)
Copy the values from a LibOVR vector into a jMonkeyEngine vector.
|
public OculusVR(VREnvironment environment)
public OculusVRInput getVRinput()
VRAPI
getVRinput
in interface VRAPI
public java.lang.String getName()
VRAPI
public int getDisplayFrequency()
VRAPI
getDisplayFrequency
in interface VRAPI
public boolean initialize()
VRAPI
initialize
in interface VRAPI
true
if the initialization is a success and false
otherwise.public void updatePose()
VRAPI
updatePose
in interface VRAPI
public boolean isInitialized()
VRAPI
isInitialized
in interface VRAPI
true
if the VR API is initialized and false
otherwise.VRAPI.initialize()
public void destroy()
VRAPI
public void reset()
VRAPI
public void getRenderSize(Vector2f store)
VRAPI
getRenderSize
in interface VRAPI
store
- the size of a Head Mounted Device (HMD) rendering area in pixels (modified).public float getInterpupillaryDistance()
VRAPI
getInterpupillaryDistance
in interface VRAPI
public Quaternion getOrientation()
VRAPI
getOrientation
in interface VRAPI
public Vector3f getPosition()
VRAPI
getPosition
in interface VRAPI
public void getPositionAndOrientation(Vector3f storePos, Quaternion storeRot)
VRAPI
getPositionAndOrientation
in interface VRAPI
storePos
- the Head Mounted Device (HMD) position (modified).storeRot
- the Head Mounted Device (HMD) rotation (modified).public Matrix4f getHMDMatrixProjectionLeftEye(Camera cam)
VRAPI
getHMDMatrixProjectionLeftEye
in interface VRAPI
cam
- the camera attached to the left eye.public Matrix4f getHMDMatrixProjectionRightEye(Camera cam)
VRAPI
getHMDMatrixProjectionRightEye
in interface VRAPI
cam
- the camera attached to the right eye.public Vector3f getHMDVectorPoseLeftEye()
VRAPI
vector
.getHMDVectorPoseLeftEye
in interface VRAPI
vector
.public Vector3f getHMDVectorPoseRightEye()
VRAPI
vector
.getHMDVectorPoseRightEye
in interface VRAPI
vector
.public Vector3f getSeatedToAbsolutePosition()
VRAPI
getSeatedToAbsolutePosition
in interface VRAPI
public Matrix4f getHMDMatrixPoseLeftEye()
VRAPI
getHMDMatrixPoseLeftEye
in interface VRAPI
public Matrix4f getHMDMatrixPoseRightEye()
VRAPI
getHMDMatrixPoseRightEye
in interface VRAPI
public HmdType getType()
VRAPI
public boolean initVRCompositor(boolean set)
VRAPI
initVRCompositor
in interface VRAPI
set
- true
if the use of VR compositor is allowed and false
otherwise.true
if the initialization is a success and false
otherwise.public void printLatencyInfoToConsole(boolean set)
VRAPI
printLatencyInfoToConsole
in interface VRAPI
set
- true
if latency information has to be logged and false
otherwise.public void setFlipEyes(boolean set)
VRAPI
setFlipEyes
in interface VRAPI
set
- true
if the eyes has to be flipped and false
otherwise.public java.lang.Void getCompositor()
VRAPI
getCompositor
in interface VRAPI
public java.lang.Void getVRSystem()
VRAPI
getVRSystem
in interface VRAPI
public void findHMDTextureSize()
public void setupLayers()
public void setupFramebuffers(int eye)
public static Matrix4f matrixO2J(org.lwjgl.ovr.OVRMatrix4f from, Matrix4f to)
from
- The matrix to copy from.to
- The matrix to copy to.to
argument.public static Quaternion quatO2J(org.lwjgl.ovr.OVRQuatf from, Quaternion to)
from
- The quaternion to copy from.to
- The quaternion to copy to.to
argument.public static Vector3f vecO2J(org.lwjgl.ovr.OVRVector3f from, Vector3f to)
from
- The vector to copy from.to
- The vector to copy to.to
argument.public long getSessionPointer()
public long getChain(int eye)
public FrameBuffer[] getFramebuffers(int eye)
public org.lwjgl.PointerBuffer getLayers()
public org.lwjgl.ovr.OVRLayerEyeFov getLayer0()
public org.lwjgl.ovr.OVRFovPort getFovPort()
public org.lwjgl.ovr.OVRPosef getHeadPose()
public org.lwjgl.ovr.OVRPosef getEyePose(int eye)
public VREnvironment getEnvironment()