Package com.jogamp.opengl.util.stereo
Interface StereoDevice
-
public interface StereoDevice
Interface describing a native stereoscopic device
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEBUG
static boolean
DUMP_DATA
static int
SENSOR_ORIENTATION
Sensor Bit: Orientation trackingstatic int
SENSOR_POSITION
Sensor Bit: Positional trackingstatic int
SENSOR_YAW_CORRECTION
Sensor Bit: Yaw correction
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StereoDeviceRenderer
createRenderer(int distortionBits, int textureCount, Vec3f eyePositionOffset, FovHVHalves[] eyeFov, float pixelsPerDisplayPixel, int textureUnit)
Create a newStereoDeviceRenderer
instance.void
dispose()
Disposes thisStereoDevice
, ifvalid
.Vec3f
getDefaultEyePositionOffset()
Return the device default eye position offset for#createRenderer(int, int, Vec3f, FovHVHalves[], float)
.FovHVHalves[]
getDefaultFOV()
Returns the device defaultFovHVHalves
for all supported eyes in natural order, i.e.int
getEnabledSensorBits()
Returns the actual used sensor capability bits, e.g.int[]
getEyeRenderOrder()
Returns an array of the preferred eye rendering order.StereoDeviceFactory
getFactory()
Return the factory used to create this device.LocationSensorParameter
getLocationSensorParams()
Returns theLocationSensorParameter
of the device ifSENSOR_POSITION
issupported
, otherwise returnsnull
.int
getMinimumDistortionBits()
Returns the minimum distortion compensation bits as required by theStereoDeviceRenderer
, e.g.PointImmutable
getPosition()
If operation within a device spanning virtual desktop, returns the device position.int
getRecommendedDistortionBits()
Returns the recommended distortion compensation bits for theStereoDeviceRenderer
, e.g.int
getRequiredRotation()
Returns the CCW rotation as required by this display device.boolean
getSensorsStarted()
Return true if sensors have been started, false otherwise.int
getSupportedDistortionBits()
Returns the supported distortion compensation of theStereoDeviceRenderer
, e.g.int
getSupportedSensorBits()
Returns the supported sensor capability bits, e.g.DimensionImmutable
getSurfaceSize()
Returns the required surface size in pixel in target space.boolean
isValid()
void
resetLocationSensorOrigin()
Sets the location sensor's origin of this device to the current position.boolean
startSensors(int desiredSensorBits, int requiredSensorBits)
Start desired and required sensors.boolean
stopSensors()
Stop sensors.
-
-
-
Field Detail
-
DEBUG
static final boolean DEBUG
-
DUMP_DATA
static final boolean DUMP_DATA
-
SENSOR_ORIENTATION
static final int SENSOR_ORIENTATION
Sensor Bit: Orientation tracking- See Also:
- Constant Field Values
-
SENSOR_YAW_CORRECTION
static final int SENSOR_YAW_CORRECTION
Sensor Bit: Yaw correction- See Also:
- Constant Field Values
-
SENSOR_POSITION
static final int SENSOR_POSITION
Sensor Bit: Positional tracking- See Also:
- Constant Field Values
-
-
Method Detail
-
getFactory
StereoDeviceFactory getFactory()
Return the factory used to create this device.
-
dispose
void dispose()
-
isValid
boolean isValid()
-
getPosition
PointImmutable getPosition()
If operation within a device spanning virtual desktop, returns the device position.Otherwise simply 0/0.
-
getSurfaceSize
DimensionImmutable getSurfaceSize()
Returns the required surface size in pixel in target space.
-
getRequiredRotation
int getRequiredRotation()
Returns the CCW rotation as required by this display device.
-
getDefaultEyePositionOffset
Vec3f getDefaultEyePositionOffset()
Return the device default eye position offset for#createRenderer(int, int, Vec3f, FovHVHalves[], float)
.Result is an array of float values for
- right (positive)
- up (positive)
- forward (negative)
- Returns:
-
getDefaultFOV
FovHVHalves[] getDefaultFOV()
Returns the device defaultFovHVHalves
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!
-
getLocationSensorParams
LocationSensorParameter getLocationSensorParams()
Returns theLocationSensorParameter
of the device ifSENSOR_POSITION
issupported
, otherwise returnsnull
.
-
resetLocationSensorOrigin
void resetLocationSensorOrigin()
Sets the location sensor's origin of this device to the current position.In case
SENSOR_POSITION
is notsupported
, this method is a no-op.
-
startSensors
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
- the desired optional sensorsrequiredSensorBits
- the required sensors- See Also:
stopSensors()
,getSensorsStarted()
,getSupportedSensorBits()
,getEnabledSensorBits()
-
stopSensors
boolean stopSensors()
Stop sensors. Returns true if action was successful, otherwise false.
-
getSensorsStarted
boolean getSensorsStarted()
Return true if sensors have been started, false otherwise.
-
getSupportedSensorBits
int getSupportedSensorBits()
Returns the supported sensor capability bits, e.g.SENSOR_ORIENTATION
,SENSOR_POSITION
of theStereoDevice
.
-
getEnabledSensorBits
int getEnabledSensorBits()
Returns the actual used sensor capability bits, e.g.SENSOR_ORIENTATION
,SENSOR_POSITION
in case thedevice supports
them and if they are enabled.
-
getEyeRenderOrder
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.
-
getSupportedDistortionBits
int getSupportedDistortionBits()
Returns the supported distortion compensation of theStereoDeviceRenderer
, e.g.StereoDeviceRenderer.DISTORTION_BARREL
,StereoDeviceRenderer.DISTORTION_CHROMATIC
, etc.
-
getRecommendedDistortionBits
int getRecommendedDistortionBits()
Returns the recommended distortion compensation bits for theStereoDeviceRenderer
, e.g.StereoDeviceRenderer.DISTORTION_BARREL
,StereoDeviceRenderer.DISTORTION_CHROMATIC
StereoDeviceRenderer.DISTORTION_VIGNETTE
.User shall use the recommended distortion compensation to achieve a distortion free view.
-
getMinimumDistortionBits
int getMinimumDistortionBits()
Returns the minimum distortion compensation bits as required by theStereoDeviceRenderer
, e.g.StereoDeviceRenderer.DISTORTION_BARREL
in case the stereoscopic display uses [a]spherical lenses.Minimum distortion compensation bits are being enforced by the
StereoDeviceRenderer
.
-
createRenderer
StereoDeviceRenderer createRenderer(int distortionBits, int textureCount, Vec3f eyePositionOffset, FovHVHalves[] eyeFov, float pixelsPerDisplayPixel, int textureUnit)
Create a newStereoDeviceRenderer
instance.- Parameters:
distortionBits
-StereoDeviceRenderer
distortion bits, e.g.StereoDeviceRenderer.DISTORTION_BARREL
, etc, seegetRecommendedDistortionBits()
.textureCount
- desired texture count for post-processing, seeStereoDeviceRenderer.getTextureCount()
andStereoDeviceRenderer.ppAvailable()
eyePositionOffset
- eye position offset, e.g.getDefaultEyePositionOffset()
.eyeFov
- FovHVHalves[] field-of-view per eye, e.g.getDefaultFOV()
. May contain only one value for monoscopic devices, seegetEyeRenderOrder()
.pixelsPerDisplayPixel
-textureUnit
-- Returns:
-
-