Top Fields Constructors Methods
jogamp.opengl.oculusvr

public Class OVRStereoDevice

extends Object
implements StereoDevice
Class Inheritance
All Implemented Interfaces
com.jogamp.opengl.util.stereo.StereoDevice
Imports
com.jogamp.nativewindow.util.Dimension, .DimensionImmutable, .PointImmutable, .Rectangle, .RectangleImmutable, com.jogamp.oculusvr.OVR, .OvrHmdContext, .ovrEyeRenderDesc, .ovrFovPort, .ovrHmdDesc, .ovrSizei, .ovrTrackingState, com.jogamp.opengl.math.FovHVHalves, com.jogamp.opengl.math.geom.Frustum, com.jogamp.opengl.util.stereo.LocationSensorParameter, .StereoDevice, .StereoDeviceFactory, .StereoDeviceRenderer, .StereoUtil

Field Summary

Modifier and TypeField and Description
private static final float[]
DEFAULT_EYE_POSITION_OFFSET

1.6 up, 5 forward

private final FovHVHalves[]
public final int
private final String
private final int
private final int[]
private final StereoDeviceFactory
public OvrHmdContext
public ovrHmdDesc
private final LocationSensorParameter
private final int
private final PointImmutable
private final int
private final int
private final DimensionImmutable
private boolean
private final int
private final int
private int

Constructor Summary

AccessConstructor and Description
public
OVRStereoDevice(final StereoDeviceFactory factory, final ovrHmdDesc hmdDesc, final int deviceIndex)

Method Summary

Modifier and TypeMethod and Description
public final StereoDeviceRenderer
createRenderer(final int distortionBits, final int
desired texture count for post-processing, see StereoDeviceRenderer#getTextureCount() and StereoDeviceRenderer#ppAvailable()
textureCount
,
final float[]
eye position offset, e.g. getDefaultEyePositionOffset().
eyePositionOffset
,
final FovHVHalves[]
FovHVHalves[] field-of-view per eye, e.g. getDefaultFOV(). May contain only one value for monoscopic devices, see getEyeRenderOrder().
eyeFov
,
final float pixelsPerDisplayPixel, final int textureUnit)

Implements com.jogamp.opengl.util.stereo.StereoDevice.createRenderer.

Create a new StereoDeviceRenderer instance.
public final void
public float[]
public final FovHVHalves[]
getDefaultFOV()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getDefaultFOV.

Returns the device default FovHVHalves for all supported eyes in natural order, i.e. left and right if supported.
public final int
getEnabledSensorBits()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getEnabledSensorBits.

Returns the actual used sensor capability bits, e.g. SENSOR_ORIENTATION, SENSOR_POSITION in case the device supports them and if they are enabled.
public final int[]
getEyeRenderOrder()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getEyeRenderOrder.

Returns an array of the preferred eye rendering order.
public final StereoDeviceFactory
getFactory()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getFactory.

Return the factory used to create this device.
public final LocationSensorParameter
public final int
getMinimumDistortionBits()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getMinimumDistortionBits.

Returns the minimum distortion compensation bits as required by the StereoDeviceRenderer, e.g. StereoDeviceRenderer#DISTORTION_BARREL in case the stereoscopic display uses [a]spherical lenses.
public final PointImmutable
getPosition()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getPosition.

If operation within a device spanning virtual desktop, returns the device position.
public final int
public int
getRequiredRotation()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getRequiredRotation.

Returns the CCW rotation as required by this display device.
public final boolean
getSensorsStarted()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getSensorsStarted.

Return true if sensors have been started, false otherwise.
public final int
public final int
public final DimensionImmutable
getSurfaceSize()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getSurfaceSize.

Returns the required surface size in pixel in target space.
public boolean
isValid()

Implements com.jogamp.opengl.util.stereo.StereoDevice.isValid.

Returns true, if instance is created and not disposed, otherwise returns false.
public final void
resetLocationSensorOrigin()

Implements com.jogamp.opengl.util.stereo.StereoDevice.resetLocationSensorOrigin.

Sets the location sensor's origin of this device to the current position.
public final boolean
startSensors(final int
the desired optional sensors
desiredSensorBits
,
final int
the required sensors
requiredSensorBits
)

Implements com.jogamp.opengl.util.stereo.StereoDevice.startSensors.

Start desired and required sensors.
public final boolean
public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

DEFAULT_EYE_POSITION_OFFSETback to summary
private static final float[] DEFAULT_EYE_POSITION_OFFSET

1.6 up, 5 forward

defaultEyeFovback to summary
private final FovHVHalves[] defaultEyeFov
deviceIndexback to summary
public final int deviceIndex
deviceNameback to summary
private final String deviceName
dkVersionback to summary
private final int dkVersion
eyeRenderOrderback to summary
private final int[] eyeRenderOrder
factoryback to summary
private final StereoDeviceFactory factory
handleback to summary
public OvrHmdContext handle
hmdDescback to summary
public ovrHmdDesc hmdDesc
locationSensorParamsback to summary
private final LocationSensorParameter locationSensorParams
minimumDistortionBitsback to summary
private final int minimumDistortionBits
positionback to summary
private final PointImmutable position
recommendedDistortionBitsback to summary
private final int recommendedDistortionBits
requiredRotationback to summary
private final int requiredRotation
resolutionback to summary
private final DimensionImmutable resolution
sensorsStartedback to summary
private boolean sensorsStarted
supportedDistortionBitsback to summary
private final int supportedDistortionBits
supportedSensorBitsback to summary
private final int supportedSensorBits
usedSensorBitsback to summary
private int usedSensorBits

Constructor Detail

OVRStereoDeviceback to summary
public OVRStereoDevice(final StereoDeviceFactory factory, final ovrHmdDesc hmdDesc, final int deviceIndex)

Method Detail

createRendererback to summary
public final StereoDeviceRenderer createRenderer(final int distortionBits, final int textureCount, final float[] eyePositionOffset, final FovHVHalves[] eyeFov, final float pixelsPerDisplayPixel, final int textureUnit)

Implements com.jogamp.opengl.util.stereo.StereoDevice.createRenderer.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.createRenderer.

Create a new StereoDeviceRenderer instance.

Parameters
distortionBits:int

StereoDeviceRenderer distortion bits, e.g. StereoDeviceRenderer#DISTORTION_BARREL, etc, see getRecommendedDistortionBits().

textureCount:int

desired texture count for post-processing, see StereoDeviceRenderer#getTextureCount() and StereoDeviceRenderer#ppAvailable()

eyePositionOffset:float[]

eye position offset, e.g. getDefaultEyePositionOffset().

eyeFov:FovHVHalves[]

FovHVHalves[] field-of-view per eye, e.g. getDefaultFOV(). May contain only one value for monoscopic devices, see getEyeRenderOrder().

Annotations
@Override
disposeback to summary
public final void dispose()

Implements com.jogamp.opengl.util.stereo.StereoDevice.dispose.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.dispose.

Disposes this StereoDevice, if valid.

Implementation shall stop sensors and free all resources.

Annotations
@Override
getDefaultEyePositionOffsetback to summary
public float[] getDefaultEyePositionOffset()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getDefaultEyePositionOffset.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getDefaultEyePositionOffset.

Return the device default eye position offset for createRenderer(int, int, float[], FovHVHalves[], float).

Result is an array of float values for

  • right (positive)
  • up (positive)
  • forward (negative)

Annotations
@Override
getDefaultFOVback to summary
public final FovHVHalves[] getDefaultFOV()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getDefaultFOV.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getDefaultFOV.

Returns the device default FovHVHalves for all supported eyes in natural order, i.e. left and right if supported.

Monoscopic devices return an array length of one, without the value for the right-eye!

Annotations
@Override
getEnabledSensorBitsback to summary
public final int getEnabledSensorBits()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getEnabledSensorBits.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getEnabledSensorBits.

Returns the actual used sensor capability bits, e.g. SENSOR_ORIENTATION, SENSOR_POSITION in case the device supports them and if they are enabled.

Annotations
@Override
getEyeRenderOrderback to summary
public final int[] getEyeRenderOrder()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getEyeRenderOrder.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getEyeRenderOrder.

Returns an array of the preferred eye rendering order. The array length reflects the supported eye count.

Monoscopic devices only support one eye, where stereoscopic device two eyes.

Annotations
@Override
getFactoryback to summary
public final StereoDeviceFactory getFactory()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getFactory.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getFactory.

Return the factory used to create this device.

Annotations
@Override
getLocationSensorParamsback to summary
public final LocationSensorParameter getLocationSensorParams()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getLocationSensorParams.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getLocationSensorParams.

Returns the LocationSensorParameter of the device if SENSOR_POSITION is supported, otherwise returns null.

Annotations
@Override
getMinimumDistortionBitsback to summary
public final int getMinimumDistortionBits()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getMinimumDistortionBits.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getMinimumDistortionBits.

Returns the minimum distortion compensation bits as required by the StereoDeviceRenderer, e.g. StereoDeviceRenderer#DISTORTION_BARREL in case the stereoscopic display uses [a]spherical lenses.

Minimum distortion compensation bits are being enforced by the StereoDeviceRenderer.

Annotations
@Override
getPositionback to summary
public final PointImmutable getPosition()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getPosition.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getPosition.

If operation within a device spanning virtual desktop, returns the device position.

Otherwise simply 0/0.

Annotations
@Override
getRecommendedDistortionBitsback to summary
public final int getRecommendedDistortionBits()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getRecommendedDistortionBits.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getRecommendedDistortionBits.

Returns the recommended distortion compensation bits for the StereoDeviceRenderer, e.g. StereoDeviceRenderer#DISTORTION_BARREL, StereoDeviceRenderer#DISTORTION_CHROMATIC StereoDeviceRenderer#DISTORTION_VIGNETTE.

User shall use the recommended distortion compensation to achieve a distortion free view.

Annotations
@Override
getRequiredRotationback to summary
public int getRequiredRotation()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getRequiredRotation.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getRequiredRotation.

Returns the CCW rotation as required by this display device.

Annotations
@Override
getSensorsStartedback to summary
public final boolean getSensorsStarted()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getSensorsStarted.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getSensorsStarted.

Return true if sensors have been started, false otherwise.

Annotations
@Override
getSupportedDistortionBitsback to summary
public final int getSupportedDistortionBits()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getSupportedDistortionBits.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getSupportedDistortionBits.

Returns the supported distortion compensation of the StereoDeviceRenderer, e.g. StereoDeviceRenderer#DISTORTION_BARREL, StereoDeviceRenderer#DISTORTION_CHROMATIC, etc.

Annotations
@Override
getSupportedSensorBitsback to summary
public final int getSupportedSensorBits()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getSupportedSensorBits.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getSupportedSensorBits.

Returns the supported sensor capability bits, e.g. SENSOR_ORIENTATION, SENSOR_POSITION of the StereoDevice.

Annotations
@Override
getSurfaceSizeback to summary
public final DimensionImmutable getSurfaceSize()

Implements com.jogamp.opengl.util.stereo.StereoDevice.getSurfaceSize.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.getSurfaceSize.

Returns the required surface size in pixel in target space.

Annotations
@Override
isValidback to summary
public boolean isValid()

Implements com.jogamp.opengl.util.stereo.StereoDevice.isValid.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.isValid.

Returns true, if instance is created and not disposed, otherwise returns false.

Annotations
@Override
resetLocationSensorOriginback to summary
public final void resetLocationSensorOrigin()

Implements com.jogamp.opengl.util.stereo.StereoDevice.resetLocationSensorOrigin.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.resetLocationSensorOrigin.

Sets the location sensor's origin of this device to the current position.

In case SENSOR_POSITION is not supported, this method is a no-op.

Annotations
@Override
startSensorsback to summary
public final boolean startSensors(final int desiredSensorBits, final int requiredSensorBits)

Implements com.jogamp.opengl.util.stereo.StereoDevice.startSensors.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.startSensors.

Start desired and required sensors. Returns true if action was successful, otherwise false.

Method fails if required sensors are not supported.

Parameters
desiredSensorBits:int

the desired optional sensors

requiredSensorBits:int

the required sensors

Annotations
@Override
stopSensorsback to summary
public final boolean stopSensors()

Implements com.jogamp.opengl.util.stereo.StereoDevice.stopSensors.

Doc from com.jogamp.opengl.util.stereo.StereoDevice.stopSensors.

Stop sensors. Returns true if action was successful, otherwise false.

Annotations
@Override
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
updateUsedSensorBitsback to summary
pack-priv void updateUsedSensorBits(final ovrTrackingState trackingState)