diff options
author | Sven Gothel <[email protected]> | 2015-07-20 03:59:57 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-07-20 03:59:57 +0200 |
commit | 5d58f63300771843687db18ad4da67c5882fd52e (patch) | |
tree | da6d53e0f985dc862635f7733e1a7f675b8d9b87 /src/oculusvr | |
parent | d99b7bf16fe316a10784e9588408ab28b204e506 (diff) |
Bug 1151 - Fix using DK1 on OVR 0.5*; Minor changes
Diffstat (limited to 'src/oculusvr')
-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; } |