Top Description Fields Methods
com.jogamp.opengl.util.stereo

public Interface StereoDevice

Known Direct Implementers
jogamp.opengl.oculusvr.OVRStereoDevice, jogamp.opengl.util.stereo.GenericStereoDevice
Imports
com.jogamp.nativewindow.util.DimensionImmutable, .PointImmutable, jogamp.opengl.Debug, com.jogamp.opengl.math.FovHVHalves

Interface describing a native stereoscopic device

Field Summary

Modifier and TypeField and Description
public static final boolean
public static final boolean
public static final int
SENSOR_ORIENTATION

Sensor Bit: Orientation tracking

public static final int
SENSOR_POSITION

Sensor Bit: Positional tracking

public static final int
SENSOR_YAW_CORRECTION

Sensor Bit: Yaw correction

Method Summary

Modifier and TypeMethod and Description
public 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)

Create a new StereoDeviceRenderer instance.

public void
dispose()

Disposes this StereoDevice, if valid.

public float[]
public FovHVHalves[]
getDefaultFOV()

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

public int
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 int[]
getEyeRenderOrder()

Returns an array of the preferred eye rendering order.

public StereoDeviceFactory
getFactory()

Return the factory used to create this device.

public LocationSensorParameter
getLocationSensorParams()

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

public int
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 PointImmutable
getPosition()

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

public int
public int
getRequiredRotation()

Returns the CCW rotation as required by this display device.

public boolean
getSensorsStarted()

Return true if sensors have been started, false otherwise.

public int
public int
getSupportedSensorBits()

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

public DimensionImmutable
getSurfaceSize()

Returns the required surface size in pixel in target space.

public boolean
isValid()

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

public void
resetLocationSensorOrigin()

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

public boolean
startSensors(int
the desired optional sensors
desiredSensorBits
,
int
the required sensors
requiredSensorBits
)

Start desired and required sensors.

public boolean
stopSensors()

Stop sensors.

Field Detail

DEBUGback to summary
public static final boolean DEBUG
DUMP_DATAback to summary
public static final boolean DUMP_DATA
SENSOR_ORIENTATIONback to summary
public static final int SENSOR_ORIENTATION

Sensor Bit: Orientation tracking

SENSOR_POSITIONback to summary
public static final int SENSOR_POSITION

Sensor Bit: Positional tracking

SENSOR_YAW_CORRECTIONback to summary
public static final int SENSOR_YAW_CORRECTION

Sensor Bit: Yaw correction

Method Detail

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

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().

disposeback to summary
public void dispose()

Disposes this StereoDevice, if valid.

Implementation shall stop sensors and free all resources.

getDefaultEyePositionOffsetback to summary
public float[] 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)

getDefaultFOVback to summary
public FovHVHalves[] 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!

getEnabledSensorBitsback to summary
public int 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.

See Also
startSensors(int, int), stopSensors(), getSensorsStarted(), getSupportedSensorBits()
getEyeRenderOrderback to summary
public int[] 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.

getFactoryback to summary
public StereoDeviceFactory getFactory()

Return the factory used to create this device.

getLocationSensorParamsback to summary
public LocationSensorParameter getLocationSensorParams()

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

getMinimumDistortionBitsback to summary
public int 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.

See Also
getSupportedDistortionBits(), getRecommendedDistortionBits(), StereoDeviceRenderer#getDistortionBits(), createRenderer(int, int, float[], FovHVHalves[], float, int)
getPositionback to summary
public PointImmutable getPosition()

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

Otherwise simply 0/0.

getRecommendedDistortionBitsback to summary
public int 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.

See Also
StereoDeviceRenderer#getDistortionBits(), createRenderer(int, int, float[], FovHVHalves[], float, int), getSupportedDistortionBits(), getMinimumDistortionBits()
getRequiredRotationback to summary
public int getRequiredRotation()

Returns the CCW rotation as required by this display device.

getSensorsStartedback to summary
public boolean getSensorsStarted()

Return true if sensors have been started, false otherwise.

See Also
startSensors(int, int), stopSensors(), getSupportedSensorBits(), getEnabledSensorBits()
getSupportedDistortionBitsback to summary
public int getSupportedDistortionBits()

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

See Also
StereoDeviceRenderer#getDistortionBits(), createRenderer(int, int, float[], FovHVHalves[], float, int), getRecommendedDistortionBits(), getMinimumDistortionBits()
getSupportedSensorBitsback to summary
public int getSupportedSensorBits()

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

See Also
startSensors(int, int), stopSensors(), getSensorsStarted(), getEnabledSensorBits()
getSurfaceSizeback to summary
public DimensionImmutable getSurfaceSize()

Returns the required surface size in pixel in target space.

isValidback to summary
public boolean isValid()

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

resetLocationSensorOriginback to summary
public void 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.

startSensorsback to summary
public boolean startSensors(int desiredSensorBits, int requiredSensorBits)

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

See Also
stopSensors(), getSensorsStarted(), getSupportedSensorBits(), getEnabledSensorBits()
stopSensorsback to summary
public boolean stopSensors()

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

See Also
startSensors(int, int), getSensorsStarted(), getSupportedSensorBits(), getEnabledSensorBits()