Showing the changes to interface/src/Application.cpp (1 of 8 files). Show all
Unified · Split
| @@ -126,6 +126,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 125 unmodified lines | ||
| 126 | 126 | _mouseVoxelScale(1.0f / 1024.0f), |
| 127 | 127 | _mouseVoxelScaleInitialized(false), |
| 128 | 128 | _justEditedVoxel(false), |
| 129 | + _isHighlightVoxel(false), | |
| 129 | 130 | _nudgeStarted(false), |
| 130 | 131 | _lookingAlongX(false), |
| 131 | 132 | _lookingAwayFromOrigin(true), |
| @@ -1765,8 +1766,6 @@ void Application::init() { · 1633 unmodified lines | ||
| 1765 | 1766 | _voxelShader.init(); |
| 1766 | 1767 | _pointShader.init(); |
| 1767 | 1768 | |
| 1768 | − _handControl.setScreenDimensions(_glWidget->width(), _glWidget->height()); | |
| 1769 | − | |
| 1770 | 1769 | _headMouseX = _mouseX = _glWidget->width() / 2; |
| 1771 | 1770 | _headMouseY = _mouseY = _glWidget->height() / 2; |
| 1772 | 1771 | QCursor::setPos(_headMouseX, _headMouseY); |
| @@ -1991,6 +1990,24 @@ void Application::renderFollowIndicator() { · 218 unmodified lines | ||
| 1991 | 1990 | } |
| 1992 | 1991 | } |
| 1993 | 1992 | |
| 1993 | +void Application::renderHighlightVoxel(VoxelDetail voxel) { | |
| 1994 | + glDisable(GL_LIGHTING); | |
| 1995 | + glPushMatrix(); | |
| 1996 | + glScalef(TREE_SCALE, TREE_SCALE, TREE_SCALE); | |
| 1997 | + //printf("Render: %.6f,%.6f,%.6f %.8f\n", voxel.x, voxel.y, voxel.z, | |
| 1998 | + // voxel.s); | |
| 1999 | + const float EDGE_EXPAND = 1.01f; | |
| 2000 | + //glColor3ub(voxel.red + 128, voxel.green + 128, voxel.blue + 128); | |
| 2001 | + glColor3ub(255, 0, 0); | |
| 2002 | + | |
| 2003 | + glTranslatef(voxel.x + voxel.s * 0.5f, | |
| 2004 | + voxel.y + voxel.s * 0.5f, | |
| 2005 | + voxel.z + voxel.s * 0.5f); | |
| 2006 | + glLineWidth(4.0f); | |
| 2007 | + glutWireCube(_mouseVoxel.s * EDGE_EXPAND); | |
| 2008 | + glPopMatrix(); | |
| 2009 | +} | |
| 2010 | + | |
| 1994 | 2011 | void Application::updateAvatars(float deltaTime, glm::vec3 mouseRayOrigin, glm::vec3 mouseRayDirection) { |
| 1995 | 2012 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| 1996 | 2013 | PerformanceWarning warn(showWarnings, "Application::updateAvatars()"); |
| @@ -2236,11 +2253,6 @@ void Application::updateHandAndTouch(float deltaTime) { · 239 unmodified lines | ||
| 2236 | 2253 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| 2237 | 2254 | PerformanceWarning warn(showWarnings, "Application::updateHandAndTouch()"); |
| 2238 | 2255 | |
| 2239 | − // walking triggers the handControl to stop | |
| 2240 | − if (_myAvatar.getMode() == AVATAR_MODE_WALKING) { | |
| 2241 | − _handControl.stop(); | |
| 2242 | − } | |
| 2243 | − | |
| 2244 | 2256 | // Update from Touch |
| 2245 | 2257 | if (_isTouchPressed) { |
| 2246 | 2258 | float TOUCH_YAW_SCALE = -0.25f; |
| @@ -3025,6 +3037,11 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 778 unmodified lines | ||
| 3025 | 3037 | // restore default, white specular |
| 3026 | 3038 | glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR); |
| 3027 | 3039 | |
| 3040 | + // Render the highlighted voxel | |
| 3041 | + if (_isHighlightVoxel) { | |
| 3042 | + renderHighlightVoxel(_highlightVoxel); | |
| 3043 | + } | |
| 3044 | + | |
| 3028 | 3045 | // indicate what we'll be adding/removing in mouse mode, if anything |
| 3029 | 3046 | if (_mouseVoxel.s != 0 && whichCamera.getMode() != CAMERA_MODE_MIRROR) { |
| 3030 | 3047 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), |
| @@ -3048,7 +3065,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 17 unmodified lines | ||
| 3048 | 3065 | } else { |
| 3049 | 3066 | renderMouseVoxelGrid(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s); |
| 3050 | 3067 | } |
| 3051 | − | |
| 3068 | + | |
| 3052 | 3069 | if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelAddMode)) { |
| 3053 | 3070 | // use a contrasting color so that we can see what we're doing |
| 3054 | 3071 | glColor3ub(_mouseVoxel.red + 128, _mouseVoxel.green + 128, _mouseVoxel.blue + 128); |