diff options
Diffstat (limited to 'src/oculusvr/classes/jogamp')
-rw-r--r-- | src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDevice.java | 23 | ||||
-rw-r--r-- | src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java | 4 |
2 files changed, 19 insertions, 8 deletions
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDevice.java b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDevice.java index 44bf13cd3..5025e80c5 100644 --- a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDevice.java +++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDevice.java @@ -86,14 +86,6 @@ public class OVRStereoDevice implements StereoDevice { this.deviceIndex = deviceIndex; this.hmdDesc = hmdDesc; - { - final FovHVHalves posFov = FovHVHalves.byRadians(hmdDesc.getCameraFrustumHFovInRadians(), - hmdDesc.getCameraFrustumVFovInRadians()); - final float posZNear = hmdDesc.getCameraFrustumNearZInMeters(); - final float posZFar = hmdDesc.getCameraFrustumFarZInMeters(); - locationSensorParams = new LocationSensorParameter(new Frustum.FovDesc(posFov, posZNear, posZFar)); - } - final ovrFovPort[] defaultOVREyeFov = hmdDesc.getDefaultEyeFov(0, new ovrFovPort[ovrHmdDesc.getEyeRenderOrderArrayLength()]); defaultEyeFov = new FovHVHalves[defaultOVREyeFov.length]; for(int i=0; i<defaultEyeFov.length; i++) { @@ -108,6 +100,21 @@ public class OVRStereoDevice implements StereoDevice { usedSensorBits = 0; supportedSensorBits = OVRUtil.ovrTrackingCaps2SensorBits(hmdDesc.getTrackingCaps()); + LocationSensorParameter _locationSensorParams = null; + if( StereoUtil.usesPositionSensor(supportedSensorBits)) { + try { + final FovHVHalves posFov = FovHVHalves.byRadians(hmdDesc.getCameraFrustumHFovInRadians(), + hmdDesc.getCameraFrustumVFovInRadians()); + final float posZNear = hmdDesc.getCameraFrustumNearZInMeters(); + final float posZFar = hmdDesc.getCameraFrustumFarZInMeters(); + _locationSensorParams = new LocationSensorParameter(new Frustum.FovDesc(posFov, posZNear, posZFar)); + } catch (final IllegalArgumentException iae) { + // probably zNear/zFar issue .. + System.err.println(iae.getMessage()); + } + } + locationSensorParams = _locationSensorParams; + // DK1 delivers unrotated resolution in target orientation // DK2 delivers rotated resolution in target orientation, monitor screen is rotated 90deg clockwise deviceName = hmdDesc.getDisplayDeviceNameAsString(); diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java index 5487ca087..95565dd0f 100644 --- a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java +++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java @@ -553,6 +553,10 @@ public class OVRStereoDeviceRenderer implements StereoDeviceRenderer { final ovrVector3f pos = pose.getPosition(); viewerPose.setPosition(pos.getX(), pos.getY(), pos.getZ()); OVRUtil.copyToQuaternion(pose.getOrientation(), viewerPose.orientation); + + // System.err.println("Viewer: "+OVRUtil.toString(pos)); + // System.err.println("Camera: "+OVRUtil.toString(trackingState.getCameraPose().getPosition())); + // System.err.println("Leveld: "+OVRUtil.toString(trackingState.getLeveledCameraPose().getPosition())); return viewerPose; } |