mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +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_WIDTH = 265;
|
||||
const int MIRROR_VIEW_HEIGHT = 215;
|
||||
const float MAX_ZOOM_DISTANCE = 0.3f;
|
||||
const float MIN_ZOOM_DISTANCE = 2.0f;
|
||||
const float MIRROR_FULLSCREEN_DISTANCE = 0.2f;
|
||||
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) {
|
||||
fprintf(stdout, "%s", message.toLocal8Bit().constData());
|
||||
|
@ -379,11 +381,12 @@ void Application::paintGL() {
|
|||
|
||||
} else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
|
||||
_myCamera.setTightness(0.0f);
|
||||
_myCamera.setDistance(MAX_ZOOM_DISTANCE);
|
||||
_myCamera.setTargetPosition(_myAvatar.getHead().calculateAverageEyePosition());
|
||||
float headHeight = _myAvatar.getHead().calculateAverageEyePosition().y - _myAvatar.getPosition().y;
|
||||
_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)));
|
||||
}
|
||||
|
||||
|
||||
// Update camera position
|
||||
_myCamera.update( 1.f/_fps );
|
||||
|
||||
|
@ -435,10 +438,10 @@ void Application::paintGL() {
|
|||
|
||||
bool eyeRelativeCamera = false;
|
||||
if (_rearMirrorTools->getZoomLevel() == BODY) {
|
||||
_mirrorCamera.setDistance(MIN_ZOOM_DISTANCE);
|
||||
_mirrorCamera.setDistance(MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar.getScale());
|
||||
_mirrorCamera.setTargetPosition(_myAvatar.getChestJointPosition());
|
||||
} else { // HEAD zoom level
|
||||
_mirrorCamera.setDistance(MAX_ZOOM_DISTANCE);
|
||||
_mirrorCamera.setDistance(MIRROR_REARVIEW_DISTANCE * _myAvatar.getScale());
|
||||
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
|
||||
// face/body so that the average eye position lies at the origin
|
||||
|
|
Loading…
Reference in a new issue