mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-17 22:08:44 +02:00
Merge branch 'master' of https://github.com/worklist/hifi
This commit is contained in:
commit
f268797bde
1 changed files with 10 additions and 7 deletions
|
@ -79,8 +79,10 @@ const int MIRROR_VIEW_TOP_PADDING = 5;
|
||||||
const int MIRROR_VIEW_LEFT_PADDING = 10;
|
const int MIRROR_VIEW_LEFT_PADDING = 10;
|
||||||
const int MIRROR_VIEW_WIDTH = 265;
|
const int MIRROR_VIEW_WIDTH = 265;
|
||||||
const int MIRROR_VIEW_HEIGHT = 215;
|
const int MIRROR_VIEW_HEIGHT = 215;
|
||||||
const float MAX_ZOOM_DISTANCE = 0.3f;
|
const float MIRROR_FULLSCREEN_DISTANCE = 0.2f;
|
||||||
const float MIN_ZOOM_DISTANCE = 2.0f;
|
const float MIRROR_REARVIEW_DISTANCE = 0.3f;
|
||||||
|
const float MIRROR_REARVIEW_BODY_DISTANCE = 1.f;
|
||||||
|
|
||||||
|
|
||||||
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) {
|
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) {
|
||||||
fprintf(stdout, "%s", message.toLocal8Bit().constData());
|
fprintf(stdout, "%s", message.toLocal8Bit().constData());
|
||||||
|
@ -379,8 +381,9 @@ void Application::paintGL() {
|
||||||
|
|
||||||
} else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
|
} else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
|
||||||
_myCamera.setTightness(0.0f);
|
_myCamera.setTightness(0.0f);
|
||||||
_myCamera.setDistance(MAX_ZOOM_DISTANCE);
|
float headHeight = _myAvatar.getHead().calculateAverageEyePosition().y - _myAvatar.getPosition().y;
|
||||||
_myCamera.setTargetPosition(_myAvatar.getHead().calculateAverageEyePosition());
|
_myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _myAvatar.getScale());
|
||||||
|
_myCamera.setTargetPosition(_myAvatar.getPosition() + glm::vec3(0, headHeight, 0));
|
||||||
_myCamera.setTargetRotation(_myAvatar.getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f)));
|
_myCamera.setTargetRotation(_myAvatar.getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,10 +438,10 @@ void Application::paintGL() {
|
||||||
|
|
||||||
bool eyeRelativeCamera = false;
|
bool eyeRelativeCamera = false;
|
||||||
if (_rearMirrorTools->getZoomLevel() == BODY) {
|
if (_rearMirrorTools->getZoomLevel() == BODY) {
|
||||||
_mirrorCamera.setDistance(MIN_ZOOM_DISTANCE);
|
_mirrorCamera.setDistance(MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar.getScale());
|
||||||
_mirrorCamera.setTargetPosition(_myAvatar.getChestJointPosition());
|
_mirrorCamera.setTargetPosition(_myAvatar.getChestJointPosition());
|
||||||
} else { // HEAD zoom level
|
} else { // HEAD zoom level
|
||||||
_mirrorCamera.setDistance(MAX_ZOOM_DISTANCE);
|
_mirrorCamera.setDistance(MIRROR_REARVIEW_DISTANCE * _myAvatar.getScale());
|
||||||
if (_myAvatar.getSkeletonModel().isActive() && _myAvatar.getHead().getFaceModel().isActive()) {
|
if (_myAvatar.getSkeletonModel().isActive() && _myAvatar.getHead().getFaceModel().isActive()) {
|
||||||
// as a hack until we have a better way of dealing with coordinate precision issues, reposition the
|
// as a hack until we have a better way of dealing with coordinate precision issues, reposition the
|
||||||
// face/body so that the average eye position lies at the origin
|
// face/body so that the average eye position lies at the origin
|
||||||
|
|
Loading…
Reference in a new issue