Apply lens distance ratio
This commit is contained in:
parent
e889857cd8
commit
f27fd17b59
|
|
@ -5,6 +5,7 @@ Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property Camera camera
|
required property Camera camera
|
||||||
|
required property var fovDetails
|
||||||
|
|
||||||
property var displayResolution: effect.displayResolution
|
property var displayResolution: effect.displayResolution
|
||||||
property real diagonalFOV: effect.diagonalFOV
|
property real diagonalFOV: effect.diagonalFOV
|
||||||
|
|
@ -19,8 +20,14 @@ Item {
|
||||||
id: displays
|
id: displays
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateCamera(rotation) {
|
function updateCamera() {
|
||||||
camera.eulerRotation = rotation;
|
camera.eulerRotation = applyLookAhead(
|
||||||
|
effect.imuRotations[0],
|
||||||
|
effect.imuRotations[1],
|
||||||
|
effect.imuTimeElapsedMs,
|
||||||
|
lookAheadMS(effect.imuTimestamp, effect.lookAheadConfig, -1)
|
||||||
|
);
|
||||||
|
camera.position = effect.imuRotations[0].times(Qt.vector3d(0, 0, -fovDetails.lensDistancePixels));
|
||||||
}
|
}
|
||||||
|
|
||||||
// how far to look ahead is how old the IMU data is plus a constant that is either the default for this device or an override
|
// how far to look ahead is how old the IMU data is plus a constant that is either the default for this device or an override
|
||||||
|
|
@ -68,12 +75,7 @@ Item {
|
||||||
running: true
|
running: true
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (effect.imuRotations && effect.imuRotations.length > 0) {
|
if (effect.imuRotations && effect.imuRotations.length > 0) {
|
||||||
updateCamera(applyLookAhead(
|
updateCamera();
|
||||||
effect.imuRotations[0],
|
|
||||||
effect.imuRotations[1],
|
|
||||||
effect.imuTimeElapsedMs,
|
|
||||||
lookAheadMS(effect.imuTimestamp, effect.lookAheadConfig, -1)
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ Item {
|
||||||
id: cameraController
|
id: cameraController
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
camera: camera
|
camera: camera
|
||||||
|
fovDetails: fovDetails
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue