public class StereoUtil extends Object
Constructor and Description |
---|
StereoUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
distortionBitsToString(int distortionBits)
|
static float[] |
getHorizPupilCenterFromLeft(float screenWidthInMeters,
float interpupillaryDistanceInMeters)
Return the horizontal pupil center from the left side for both eyes in the range [0..1].
|
static void |
getSBSUpstreamPMV(ViewerPose viewerPose,
StereoDeviceRenderer.Eye eye,
float zNear,
float zFar,
float[] mat4Projection,
float[] mat4Modelview)
Calculates the Side By Side, SBS, projection- and modelview matrix for one eye.
|
static float |
getVertPupilCenterFromTop(float screenHeightInMeters,
float pupilCenterFromScreenTopInMeters)
Return the vertical pupil center from the screen top in the range [0..1].
|
static String |
sensorBitsToString(int sensorBits)
|
static boolean |
usesBarrelDistortion(int distortionBits)
|
static boolean |
usesChromaticDistortion(int distortionBits)
|
static boolean |
usesOrientationSensor(int sensorBits)
|
static boolean |
usesPositionSensor(int sensorBits)
|
static boolean |
usesTimewarpDistortion(int distortionBits)
|
static boolean |
usesVignetteDistortion(int distortionBits)
|
static boolean |
usesYawCorrectionSensor(int sensorBits)
|
public static float getVertPupilCenterFromTop(float screenHeightInMeters, float pupilCenterFromScreenTopInMeters)
screenHeightInMeters
- pupilCenterFromScreenTopInMeters
- public static float[] getHorizPupilCenterFromLeft(float screenWidthInMeters, float interpupillaryDistanceInMeters)
<-------------left eye------------->| |<-----------right eye--------------> <------------------------------------screenSizeInMeters.Width-----------------------------------> <------interpupillaryDistanceInMeters------> <--centerFromLeftInMeters-> ^ center of pupil
screenWidthInMeters
- interpupillaryDistanceInMeters
- public static boolean usesBarrelDistortion(int distortionBits)
public static boolean usesTimewarpDistortion(int distortionBits)
public static boolean usesChromaticDistortion(int distortionBits)
public static boolean usesVignetteDistortion(int distortionBits)
public static String distortionBitsToString(int distortionBits)
public static boolean usesOrientationSensor(int sensorBits)
public static boolean usesYawCorrectionSensor(int sensorBits)
public static boolean usesPositionSensor(int sensorBits)
public static String sensorBitsToString(int sensorBits)
public static void getSBSUpstreamPMV(ViewerPose viewerPose, StereoDeviceRenderer.Eye eye, float zNear, float zFar, float[] mat4Projection, float[] mat4Modelview)
#updateViewerPose(int)
must be called upfront.
This method merely exist as an example implementation to compute the matrices,
which shall be adopted by the
upstream client code
.
viewerPose
- eye
- zNear
- frustum near valuezFar
- frustum far valuemat4Projection
- float[16] projection matrix resultmat4Modelview
- float[16] modelview matrix resultCopyright 2010 JogAmp Community.