mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 20:26:55 +02:00
Context: Maintain orientation of eye offset matrix.
This commit is contained in:
parent
f6d724241c
commit
4b9998e53e
1 changed files with 10 additions and 3 deletions
|
@ -50,12 +50,19 @@ Backend::TransformCamera Backend::TransformCamera::getEyeCamera(int eye,
|
||||||
TransformCamera result = *this;
|
TransformCamera result = *this;
|
||||||
Transform eyeView = view;
|
Transform eyeView = view;
|
||||||
Transform eyePreviousView = previousView;
|
Transform eyePreviousView = previousView;
|
||||||
|
glm::vec3 eyePosition = extractTranslation(stereo._eyeViews[eye]);
|
||||||
|
glm::quat eyeOrientation = glmExtractRotation(stereo._eyeViews[eye]);
|
||||||
|
glm::vec3 eyePreviousPosition = extractTranslation(prevStereo._eyeViews[eye]);
|
||||||
|
glm::quat eyePreviousOrientation = glmExtractRotation(prevStereo._eyeViews[eye]);
|
||||||
if (!stereo._skybox) {
|
if (!stereo._skybox) {
|
||||||
eyeView.postTranslate(-Vec3(stereo._eyeViews[eye][3]));
|
eyeView.postRotate(eyeOrientation).postTranslate(eyePosition);
|
||||||
eyePreviousView.postTranslate(-Vec3(prevStereo._eyeViews[eye][3]));
|
eyePreviousView.postRotate(eyePreviousOrientation).postTranslate(eyePreviousPosition);
|
||||||
} else {
|
} else {
|
||||||
// FIXME: If "skybox" the ipd is set to 0 for now, let s try to propose a better solution for this in the future
|
// FIXME: If "skybox" the ipd is set to 0 for now, let s try to propose a better solution for this in the future
|
||||||
eyePreviousView.setTranslation(vec3());
|
// XRTODO: maybe this is responsible for reprojection-like stutters?
|
||||||
|
//eyePreviousView.setTranslation(vec3());
|
||||||
|
eyeView.postRotate(eyeOrientation);
|
||||||
|
eyePreviousView.postRotate(eyePreviousOrientation);
|
||||||
}
|
}
|
||||||
result._projection = stereo._eyeProjections[eye];
|
result._projection = stereo._eyeProjections[eye];
|
||||||
Mat4 previousProjection = prevStereo._eyeProjections[eye];
|
Mat4 previousProjection = prevStereo._eyeProjections[eye];
|
||||||
|
|
Loading…
Reference in a new issue