mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 14:09:01 +02:00
commit
a568e71e37
7 changed files with 145 additions and 52 deletions
BIN
interface/resources/images/close.png
Normal file
BIN
interface/resources/images/close.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
16
interface/resources/images/close.svg
Normal file
16
interface/resources/images/close.svg
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||||
|
<title>close</title>
|
||||||
|
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
||||||
|
<defs></defs>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||||
|
<g id="close" sketch:type="MSLayerGroup" transform="translate(2.000000, 2.000000)">
|
||||||
|
<g id="close-button">
|
||||||
|
<circle d="M14.8148148,29.6296296 C22.9968115,29.6296296 29.6296296,22.9968115 29.6296296,14.8148148 C29.6296296,6.63281812 22.9968115,0 14.8148148,0 C6.63281812,0 0,6.63281812 0,14.8148148 C0,22.9968115 6.63281812,29.6296296 14.8148148,29.6296296 Z M14.8148148,29.6296296" id="background" fill="#FFFFFF" cx="14.8148148" cy="14.8148148" r="14.8148148"></circle>
|
||||||
|
<circle d="M15.7036966,30.8654803 C24.0773189,30.8654803 30.8654803,24.0773189 30.8654803,15.7036966 C30.8654803,7.33007426 24.0773189,0.541912889 15.7036966,0.541912889 C7.33007426,0.541912889 0.541912889,7.33007426 0.541912889,15.7036966 C0.541912889,24.0773189 7.33007426,30.8654803 15.7036966,30.8654803 Z M15.7036966,30.8654803" id="circle" stroke="#000000" stroke-width="4" cx="15.7036966" cy="15.7036966" r="15.1617837"></circle>
|
||||||
|
<path d="M7.5368995,7.83319579 L23.5562405,23.8525368" id="topdown" stroke="#000000" stroke-width="4px" stroke-dasharray="0"></path>
|
||||||
|
<path d="M8.14743772,23.5562661 L23.592926,8.11077784" id="botup" stroke="#000000" stroke-width="4px" stroke-dasharray="0"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
|
@ -85,6 +85,12 @@ const int STARTUP_JITTER_SAMPLES = PACKET_LENGTH_SAMPLES_PER_CHANNEL / 2;
|
||||||
// Startup optimistically with small jitter buffer that
|
// Startup optimistically with small jitter buffer that
|
||||||
// will start playback on the second received audio packet.
|
// will start playback on the second received audio packet.
|
||||||
|
|
||||||
|
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 int MIRROR_ICON_SIZE = 16;
|
||||||
|
const int MIRROR_CLOSE_ICON_PADDING = 5;
|
||||||
|
|
||||||
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());
|
||||||
|
@ -253,12 +259,12 @@ void Application::restoreSizeAndPosition() {
|
||||||
|
|
||||||
settings->beginGroup("Window");
|
settings->beginGroup("Window");
|
||||||
|
|
||||||
float x = loadSetting(settings, "x", 0);
|
int x = (int)loadSetting(settings, "x", 0);
|
||||||
float y = loadSetting(settings, "y", 0);
|
int y = (int)loadSetting(settings, "y", 0);
|
||||||
_window->move(x, y);
|
_window->move(x, y);
|
||||||
|
|
||||||
int width = loadSetting(settings, "width", available.width());
|
int width = (int)loadSetting(settings, "width", available.width());
|
||||||
int height = loadSetting(settings, "height", available.height());
|
int height = (int)loadSetting(settings, "height", available.height());
|
||||||
_window->resize(width, height);
|
_window->resize(width, height);
|
||||||
|
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
@ -361,20 +367,7 @@ void Application::paintGL() {
|
||||||
|
|
||||||
glEnable(GL_LINE_SMOOTH);
|
glEnable(GL_LINE_SMOOTH);
|
||||||
|
|
||||||
if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
|
if (OculusManager::isConnected()) {
|
||||||
_myCamera.setTightness (100.0f);
|
|
||||||
glm::vec3 targetPosition = _myAvatar.getUprightHeadPosition();
|
|
||||||
if (_myAvatar.getHead().getBlendFace().isActive()) {
|
|
||||||
// make sure we're aligned to the blend face eyes
|
|
||||||
glm::vec3 leftEyePosition, rightEyePosition;
|
|
||||||
if (_myAvatar.getHead().getBlendFace().getEyePositions(leftEyePosition, rightEyePosition, true)) {
|
|
||||||
targetPosition = (leftEyePosition + rightEyePosition) * 0.5f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_myCamera.setTargetPosition(targetPosition);
|
|
||||||
_myCamera.setTargetRotation(_myAvatar.getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f)));
|
|
||||||
|
|
||||||
} else if (OculusManager::isConnected()) {
|
|
||||||
_myCamera.setUpShift (0.0f);
|
_myCamera.setUpShift (0.0f);
|
||||||
_myCamera.setDistance (0.0f);
|
_myCamera.setDistance (0.0f);
|
||||||
_myCamera.setTightness (0.0f); // Camera is directly connected to head without smoothing
|
_myCamera.setTightness (0.0f); // Camera is directly connected to head without smoothing
|
||||||
|
@ -435,6 +428,37 @@ void Application::paintGL() {
|
||||||
|
|
||||||
_glowEffect.render();
|
_glowEffect.render();
|
||||||
|
|
||||||
|
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
|
||||||
|
glm::vec3 targetPosition = _myAvatar.getUprightHeadPosition();
|
||||||
|
_mirrorCamera.setDistance(0.2f);
|
||||||
|
_mirrorCamera.setTargetPosition(targetPosition);
|
||||||
|
_mirrorCamera.setTargetRotation(_myAvatar.getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f)));
|
||||||
|
_mirrorCamera.update(1.0f/_fps);
|
||||||
|
|
||||||
|
// set the bounds of rear mirror view
|
||||||
|
glViewport(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), _mirrorViewRect.width(), _mirrorViewRect.height());
|
||||||
|
glScissor(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), _mirrorViewRect.width(), _mirrorViewRect.height());
|
||||||
|
updateProjectionMatrix(_mirrorCamera);
|
||||||
|
glEnable(GL_SCISSOR_TEST);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
|
// render rear mirror view
|
||||||
|
glPushMatrix();
|
||||||
|
displaySide(_mirrorCamera);
|
||||||
|
glPopMatrix();
|
||||||
|
|
||||||
|
// render rear view tools if mouse is in the bounds
|
||||||
|
QPoint mousePosition = _glWidget->mapFromGlobal(QCursor::pos());
|
||||||
|
if (_mirrorViewRect.contains(mousePosition.x(), mousePosition.y())) {
|
||||||
|
displayRearMirrorTools();
|
||||||
|
}
|
||||||
|
|
||||||
|
// reset Viewport and projection matrix
|
||||||
|
glViewport(0, 0, _glWidget->width(), _glWidget->height());
|
||||||
|
glDisable(GL_SCISSOR_TEST);
|
||||||
|
updateProjectionMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
displayOverlay();
|
displayOverlay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,6 +481,8 @@ void Application::resetCamerasOnResizeGL(Camera& camera, int width, int height)
|
||||||
void Application::resizeGL(int width, int height) {
|
void Application::resizeGL(int width, int height) {
|
||||||
resetCamerasOnResizeGL(_viewFrustumOffsetCamera, width, height);
|
resetCamerasOnResizeGL(_viewFrustumOffsetCamera, width, height);
|
||||||
resetCamerasOnResizeGL(_myCamera, width, height);
|
resetCamerasOnResizeGL(_myCamera, width, height);
|
||||||
|
|
||||||
|
_mirrorViewRect = QRect(MIRROR_VIEW_LEFT_PADDING, MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT);
|
||||||
|
|
||||||
glViewport(0, 0, width, height); // shouldn't this account for the menu???
|
glViewport(0, 0, width, height); // shouldn't this account for the menu???
|
||||||
|
|
||||||
|
@ -465,11 +491,15 @@ void Application::resizeGL(int width, int height) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::updateProjectionMatrix() {
|
void Application::updateProjectionMatrix() {
|
||||||
|
updateProjectionMatrix(_myCamera);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Application::updateProjectionMatrix(Camera& camera) {
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
|
||||||
// Tell our viewFrustum about this change, using the application camera
|
// Tell our viewFrustum about this change, using the application camera
|
||||||
loadViewFrustum(_myCamera, _viewFrustum);
|
loadViewFrustum(camera, _viewFrustum);
|
||||||
|
|
||||||
float left, right, bottom, top, nearVal, farVal;
|
float left, right, bottom, top, nearVal, farVal;
|
||||||
glm::vec4 nearClipPlane, farClipPlane;
|
glm::vec4 nearClipPlane, farClipPlane;
|
||||||
|
@ -999,7 +1029,7 @@ void Application::mouseMoveEvent(QMouseEvent* event) {
|
||||||
if (activeWindow() == _window) {
|
if (activeWindow() == _window) {
|
||||||
_mouseX = event->x();
|
_mouseX = event->x();
|
||||||
_mouseY = event->y();
|
_mouseY = event->y();
|
||||||
|
|
||||||
// detect drag
|
// detect drag
|
||||||
glm::vec3 mouseVoxelPos(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z);
|
glm::vec3 mouseVoxelPos(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z);
|
||||||
if (!_justEditedVoxel && mouseVoxelPos != _lastMouseVoxelPos) {
|
if (!_justEditedVoxel && mouseVoxelPos != _lastMouseVoxelPos) {
|
||||||
|
@ -1037,6 +1067,14 @@ void Application::mousePressEvent(QMouseEvent* event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
|
||||||
|
QRect closeIconRect = QRect(MIRROR_CLOSE_ICON_PADDING + _mirrorViewRect.left(), MIRROR_CLOSE_ICON_PADDING + _mirrorViewRect.top(), MIRROR_ICON_SIZE, MIRROR_ICON_SIZE);
|
||||||
|
|
||||||
|
if (closeIconRect.contains(_mouseX, _mouseY)) {
|
||||||
|
Menu::getInstance()->triggerOption(MenuOption::Mirror);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!_palette.isActive() && (!_isHoverVoxel || _lookatTargetAvatar)) {
|
if (!_palette.isActive() && (!_isHoverVoxel || _lookatTargetAvatar)) {
|
||||||
_pieMenu.mousePressEvent(_mouseX, _mouseY);
|
_pieMenu.mousePressEvent(_mouseX, _mouseY);
|
||||||
}
|
}
|
||||||
|
@ -1613,8 +1651,15 @@ void Application::init() {
|
||||||
_myAvatar.setPosition(START_LOCATION);
|
_myAvatar.setPosition(START_LOCATION);
|
||||||
_myCamera.setMode(CAMERA_MODE_FIRST_PERSON);
|
_myCamera.setMode(CAMERA_MODE_FIRST_PERSON);
|
||||||
_myCamera.setModeShiftRate(1.0f);
|
_myCamera.setModeShiftRate(1.0f);
|
||||||
_myAvatar.setDisplayingLookatVectors(false);
|
_myAvatar.setDisplayingLookatVectors(false);
|
||||||
|
|
||||||
|
_mirrorCamera.setMode(CAMERA_MODE_MIRROR);
|
||||||
|
_mirrorCamera.setAspectRatio((float)MIRROR_VIEW_WIDTH / (float)MIRROR_VIEW_HEIGHT);
|
||||||
|
_mirrorCamera.setFieldOfView(70);
|
||||||
|
_mirrorViewRect = QRect(MIRROR_VIEW_LEFT_PADDING, MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT);
|
||||||
|
|
||||||
|
switchToResourcesParentIfRequired();
|
||||||
|
_closeTextureId = _glWidget->bindTexture(QImage("./resources/images/close.png"));
|
||||||
|
|
||||||
OculusManager::connect();
|
OculusManager::connect();
|
||||||
if (OculusManager::isConnected()) {
|
if (OculusManager::isConnected()) {
|
||||||
|
@ -2080,12 +2125,7 @@ void Application::update(float deltaTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!OculusManager::isConnected()) {
|
if (!OculusManager::isConnected()) {
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::FirstPerson)) {
|
||||||
if (_myCamera.getMode() != CAMERA_MODE_MIRROR) {
|
|
||||||
_myCamera.setMode(CAMERA_MODE_MIRROR);
|
|
||||||
_myCamera.setModeShiftRate(100.0f);
|
|
||||||
}
|
|
||||||
} else if (Menu::getInstance()->isOptionChecked(MenuOption::FirstPerson)) {
|
|
||||||
if (_myCamera.getMode() != CAMERA_MODE_FIRST_PERSON) {
|
if (_myCamera.getMode() != CAMERA_MODE_FIRST_PERSON) {
|
||||||
_myCamera.setMode(CAMERA_MODE_FIRST_PERSON);
|
_myCamera.setMode(CAMERA_MODE_FIRST_PERSON);
|
||||||
_myCamera.setModeShiftRate(1.0f);
|
_myCamera.setModeShiftRate(1.0f);
|
||||||
|
@ -2098,7 +2138,7 @@ void Application::update(float deltaTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::OffAxisProjection)) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::OffAxisProjection)) {
|
||||||
float xSign = Menu::getInstance()->isOptionChecked(MenuOption::Mirror) ? 1.0f : -1.0f;
|
float xSign = _myCamera.getMode() == CAMERA_MODE_MIRROR ? 1.0f : -1.0f;
|
||||||
if (_faceshift.isActive()) {
|
if (_faceshift.isActive()) {
|
||||||
const float EYE_OFFSET_SCALE = 0.025f;
|
const float EYE_OFFSET_SCALE = 0.025f;
|
||||||
glm::vec3 position = _faceshift.getHeadTranslation() * EYE_OFFSET_SCALE;
|
glm::vec3 position = _faceshift.getHeadTranslation() * EYE_OFFSET_SCALE;
|
||||||
|
@ -2389,7 +2429,7 @@ void Application::displayOculus(Camera& whichCamera) {
|
||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
gluOrtho2D(0, _glWidget->width(), 0, _glWidget->height());
|
gluOrtho2D(0, _glWidget->width(), 0, _glWidget->height());
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
// for reference on setting these values, see SDK file Samples/OculusRoomTiny/RenderTiny_Device.cpp
|
// for reference on setting these values, see SDK file Samples/OculusRoomTiny/RenderTiny_Device.cpp
|
||||||
|
@ -2466,13 +2506,6 @@ void Application::computeOffAxisFrustum(float& left, float& right, float& bottom
|
||||||
float& far, glm::vec4& nearClipPlane, glm::vec4& farClipPlane) const {
|
float& far, glm::vec4& nearClipPlane, glm::vec4& farClipPlane) const {
|
||||||
|
|
||||||
_viewFrustum.computeOffAxisFrustum(left, right, bottom, top, near, far, nearClipPlane, farClipPlane);
|
_viewFrustum.computeOffAxisFrustum(left, right, bottom, top, near, far, nearClipPlane, farClipPlane);
|
||||||
|
|
||||||
// when mirrored, we must flip left and right
|
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
|
|
||||||
float tmp = left;
|
|
||||||
left = -right;
|
|
||||||
right = -tmp;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::displaySide(Camera& whichCamera) {
|
void Application::displaySide(Camera& whichCamera) {
|
||||||
|
@ -2480,7 +2513,7 @@ void Application::displaySide(Camera& whichCamera) {
|
||||||
// transform by eye offset
|
// transform by eye offset
|
||||||
|
|
||||||
// flip x if in mirror mode (also requires reversing winding order for backface culling)
|
// flip x if in mirror mode (also requires reversing winding order for backface culling)
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
|
if (whichCamera.getMode() == CAMERA_MODE_MIRROR) {
|
||||||
glScalef(-1.0f, 1.0f, 1.0f);
|
glScalef(-1.0f, 1.0f, 1.0f);
|
||||||
glFrontFace(GL_CW);
|
glFrontFace(GL_CW);
|
||||||
|
|
||||||
|
@ -2601,7 +2634,7 @@ void Application::displaySide(Camera& whichCamera) {
|
||||||
glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR);
|
glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR);
|
||||||
|
|
||||||
// indicate what we'll be adding/removing in mouse mode, if anything
|
// indicate what we'll be adding/removing in mouse mode, if anything
|
||||||
if (_mouseVoxel.s != 0) {
|
if (_mouseVoxel.s != 0 && whichCamera.getMode() != CAMERA_MODE_MIRROR) {
|
||||||
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
||||||
"Application::displaySide() ... voxels TOOLS UX...");
|
"Application::displaySide() ... voxels TOOLS UX...");
|
||||||
|
|
||||||
|
@ -2649,7 +2682,7 @@ void Application::displaySide(Camera& whichCamera) {
|
||||||
glEnable(GL_LIGHTING);
|
glEnable(GL_LIGHTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelSelectMode) && _pasteMode) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelSelectMode) && _pasteMode && whichCamera.getMode() != CAMERA_MODE_MIRROR) {
|
||||||
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
||||||
"Application::displaySide() ... PASTE Preview...");
|
"Application::displaySide() ... PASTE Preview...");
|
||||||
|
|
||||||
|
@ -2685,7 +2718,7 @@ void Application::displaySide(Camera& whichCamera) {
|
||||||
}
|
}
|
||||||
// Set lookAt to myCamera on client side if other avatars are looking at client
|
// Set lookAt to myCamera on client side if other avatars are looking at client
|
||||||
if (isLookingAtMyAvatar(avatar)) {
|
if (isLookingAtMyAvatar(avatar)) {
|
||||||
avatar->getHead().setLookAtPosition(_myCamera.getPosition());
|
avatar->getHead().setLookAtPosition(whichCamera.getPosition());
|
||||||
}
|
}
|
||||||
avatar->render(false, Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls));
|
avatar->render(false, Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls));
|
||||||
avatar->setDisplayingLookatVectors(Menu::getInstance()->isOptionChecked(MenuOption::LookAtVectors));
|
avatar->setDisplayingLookatVectors(Menu::getInstance()->isOptionChecked(MenuOption::LookAtVectors));
|
||||||
|
@ -2695,10 +2728,10 @@ void Application::displaySide(Camera& whichCamera) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render my own Avatar
|
// Render my own Avatar
|
||||||
if (_myCamera.getMode() == CAMERA_MODE_MIRROR && !_faceshift.isActive()) {
|
if (whichCamera.getMode() == CAMERA_MODE_MIRROR && !_faceshift.isActive()) {
|
||||||
_myAvatar.getHead().setLookAtPosition(_myCamera.getPosition());
|
_myAvatar.getHead().setLookAtPosition(whichCamera.getPosition());
|
||||||
}
|
}
|
||||||
_myAvatar.render(Menu::getInstance()->isOptionChecked(MenuOption::Mirror),
|
_myAvatar.render(whichCamera.getMode() == CAMERA_MODE_MIRROR,
|
||||||
Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls));
|
Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls));
|
||||||
_myAvatar.setDisplayingLookatVectors(Menu::getInstance()->isOptionChecked(MenuOption::LookAtVectors));
|
_myAvatar.setDisplayingLookatVectors(Menu::getInstance()->isOptionChecked(MenuOption::LookAtVectors));
|
||||||
|
|
||||||
|
@ -2710,7 +2743,7 @@ void Application::displaySide(Camera& whichCamera) {
|
||||||
_myAvatar.renderScreenTint(SCREEN_TINT_AFTER_AVATARS, whichCamera);
|
_myAvatar.renderScreenTint(SCREEN_TINT_AFTER_AVATARS, whichCamera);
|
||||||
|
|
||||||
// Render the world box
|
// Render the world box
|
||||||
if (!Menu::getInstance()->isOptionChecked(MenuOption::Mirror) && Menu::getInstance()->isOptionChecked(MenuOption::Stats)) {
|
if (whichCamera.getMode() != CAMERA_MODE_MIRROR && Menu::getInstance()->isOptionChecked(MenuOption::Stats)) {
|
||||||
renderWorldBox();
|
renderWorldBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2722,7 +2755,7 @@ void Application::displaySide(Camera& whichCamera) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// brad's frustum for debugging
|
// brad's frustum for debugging
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::DisplayFrustum)) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::DisplayFrustum) && whichCamera.getMode() != CAMERA_MODE_MIRROR) {
|
||||||
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
||||||
"Application::displaySide() ... renderViewFrustum...");
|
"Application::displaySide() ... renderViewFrustum...");
|
||||||
renderViewFrustum(_viewFrustum);
|
renderViewFrustum(_viewFrustum);
|
||||||
|
@ -2803,7 +2836,6 @@ void Application::displayOverlay() {
|
||||||
//noiseTest(_glWidget->width(), _glWidget->height());
|
//noiseTest(_glWidget->width(), _glWidget->height());
|
||||||
|
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::HeadMouse)
|
if (Menu::getInstance()->isOptionChecked(MenuOption::HeadMouse)
|
||||||
&& !Menu::getInstance()->isOptionChecked(MenuOption::Mirror)
|
|
||||||
&& USING_INVENSENSE_MPU9150) {
|
&& USING_INVENSENSE_MPU9150) {
|
||||||
// Display small target box at center or head mouse target that can also be used to measure LOD
|
// Display small target box at center or head mouse target that can also be used to measure LOD
|
||||||
glColor3f(1.0, 1.0, 1.0);
|
glColor3f(1.0, 1.0, 1.0);
|
||||||
|
@ -2955,7 +2987,7 @@ void Application::displayOverlay() {
|
||||||
if (_pieMenu.isDisplayed()) {
|
if (_pieMenu.isDisplayed()) {
|
||||||
_pieMenu.render();
|
_pieMenu.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3782,3 +3814,42 @@ void* Application::networkReceive(void* args) {
|
||||||
void Application::packetSentNotification(ssize_t length) {
|
void Application::packetSentNotification(ssize_t length) {
|
||||||
_bandwidthMeter.outputStream(BandwidthMeter::VOXELS).updateValue(length);
|
_bandwidthMeter.outputStream(BandwidthMeter::VOXELS).updateValue(length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Application::displayRearMirrorTools() {
|
||||||
|
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glPushMatrix();
|
||||||
|
glLoadIdentity();
|
||||||
|
gluOrtho2D(_mirrorViewRect.left(), _mirrorViewRect.right(), _mirrorViewRect.bottom(), _mirrorViewRect.top());
|
||||||
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
glDisable(GL_LIGHTING);
|
||||||
|
|
||||||
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, _closeTextureId);
|
||||||
|
|
||||||
|
glColor3f(1, 1, 1);
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
|
||||||
|
int lp = MIRROR_CLOSE_ICON_PADDING + _mirrorViewRect.left();
|
||||||
|
int tp = MIRROR_CLOSE_ICON_PADDING + _mirrorViewRect.top();
|
||||||
|
int lwp = MIRROR_ICON_SIZE + lp;
|
||||||
|
int twp = MIRROR_ICON_SIZE + tp;
|
||||||
|
|
||||||
|
glTexCoord2f(1, 1);
|
||||||
|
glVertex2f(lp, tp);
|
||||||
|
|
||||||
|
glTexCoord2f(0, 1);
|
||||||
|
glVertex2f(lwp, tp);
|
||||||
|
|
||||||
|
glTexCoord2f(0, 0);
|
||||||
|
glVertex2f(lwp, twp);
|
||||||
|
|
||||||
|
glTexCoord2f(1, 0);
|
||||||
|
glVertex2f(lp, twp);
|
||||||
|
|
||||||
|
glEnd();
|
||||||
|
|
||||||
|
glPopMatrix();
|
||||||
|
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
|
}
|
||||||
|
|
|
@ -196,6 +196,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
void resetCamerasOnResizeGL(Camera& camera, int width, int height);
|
void resetCamerasOnResizeGL(Camera& camera, int width, int height);
|
||||||
void updateProjectionMatrix();
|
void updateProjectionMatrix();
|
||||||
|
void updateProjectionMatrix(Camera& camera);
|
||||||
|
|
||||||
static bool sendVoxelsOperation(VoxelNode* node, void* extraData);
|
static bool sendVoxelsOperation(VoxelNode* node, void* extraData);
|
||||||
static void processAvatarURLsMessage(unsigned char* packetData, size_t dataBytes);
|
static void processAvatarURLsMessage(unsigned char* packetData, size_t dataBytes);
|
||||||
|
@ -240,7 +241,9 @@ private:
|
||||||
static void attachNewHeadToNode(Node *newNode);
|
static void attachNewHeadToNode(Node *newNode);
|
||||||
static void* networkReceive(void* args); // network receive thread
|
static void* networkReceive(void* args); // network receive thread
|
||||||
|
|
||||||
void findAxisAlignment();
|
void findAxisAlignment();
|
||||||
|
|
||||||
|
void displayRearMirrorTools();
|
||||||
|
|
||||||
QMainWindow* _window;
|
QMainWindow* _window;
|
||||||
QGLWidget* _glWidget;
|
QGLWidget* _glWidget;
|
||||||
|
@ -292,6 +295,9 @@ private:
|
||||||
|
|
||||||
Camera _myCamera; // My view onto the world
|
Camera _myCamera; // My view onto the world
|
||||||
Camera _viewFrustumOffsetCamera; // The camera we use to sometimes show the view frustum from an offset mode
|
Camera _viewFrustumOffsetCamera; // The camera we use to sometimes show the view frustum from an offset mode
|
||||||
|
Camera _mirrorCamera; // Cammera for mirror view
|
||||||
|
QRect _mirrorViewRect;
|
||||||
|
GLuint _closeTextureId;
|
||||||
|
|
||||||
Environment _environment;
|
Environment _environment;
|
||||||
|
|
||||||
|
|
|
@ -840,9 +840,9 @@ bool Audio::eventuallyAnalyzePing() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Audio::renderToolIcon(int screenHeigh) {
|
void Audio::renderToolIcon(int screenHeight) {
|
||||||
|
|
||||||
_iconBounds = QRect(ICON_LEFT, screenHeigh - BOTTOM_PADDING, ICON_SIZE, ICON_SIZE);
|
_iconBounds = QRect(ICON_LEFT, screenHeight - BOTTOM_PADDING, ICON_SIZE, ICON_SIZE);
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, _micTextureId);
|
glBindTexture(GL_TEXTURE_2D, _micTextureId);
|
||||||
|
|
|
@ -23,7 +23,7 @@ const float CAMERA_THIRD_PERSON_MODE_DISTANCE = 1.5f;
|
||||||
const float CAMERA_THIRD_PERSON_MODE_TIGHTNESS = 8.0f;
|
const float CAMERA_THIRD_PERSON_MODE_TIGHTNESS = 8.0f;
|
||||||
|
|
||||||
const float CAMERA_MIRROR_MODE_UP_SHIFT = 0.0f;
|
const float CAMERA_MIRROR_MODE_UP_SHIFT = 0.0f;
|
||||||
const float CAMERA_MIRROR_MODE_DISTANCE = 0.3f;
|
const float CAMERA_MIRROR_MODE_DISTANCE = 0.17f;
|
||||||
const float CAMERA_MIRROR_MODE_TIGHTNESS = 100.0f;
|
const float CAMERA_MIRROR_MODE_TIGHTNESS = 100.0f;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -597,7 +597,7 @@ float MyAvatar::getBallRenderAlpha(int ball, bool lookingInMirror) const {
|
||||||
|
|
||||||
void MyAvatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
|
void MyAvatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
|
||||||
|
|
||||||
if (Application::getInstance()->getCamera()->getMode() == CAMERA_MODE_FIRST_PERSON) {
|
if (Application::getInstance()->getCamera()->getMode() == CAMERA_MODE_FIRST_PERSON && !lookingInMirror) {
|
||||||
// Dont display body, only the hand
|
// Dont display body, only the hand
|
||||||
_hand.render(lookingInMirror);
|
_hand.render(lookingInMirror);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue