Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all
Unified · Split
| @@ -438,13 +438,15 @@ void Application::paintGL() { · 437 unmodified lines | ||
| 438 | 438 | // set the bounds of rear mirror view |
| 439 | 439 | glViewport(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), _mirrorViewRect.width(), _mirrorViewRect.height()); |
| 440 | 440 | glScissor(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), _mirrorViewRect.width(), _mirrorViewRect.height()); |
| 441 | − updateProjectionMatrix(_mirrorCamera); | |
| 441 | + bool updateViewFrustum = false; | |
| 442 | + updateProjectionMatrix(_mirrorCamera, updateViewFrustum); | |
| 442 | 443 | glEnable(GL_SCISSOR_TEST); |
| 443 | 444 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
| 444 | 445 | |
| 445 | 446 | // render rear mirror view |
| 446 | 447 | glPushMatrix(); |
| 447 | − displaySide(_mirrorCamera); | |
| 448 | + bool selfAvatarOnly = true; | |
| 449 | + displaySide(_mirrorCamera, selfAvatarOnly); | |
| 448 | 450 | glPopMatrix(); |
| 449 | 451 | |
| 450 | 452 | // render rear view tools if mouse is in the bounds |
| @@ -456,7 +458,7 @@ void Application::paintGL() { · 5 unmodified lines | ||
| 456 | 458 | // reset Viewport and projection matrix |
| 457 | 459 | glViewport(0, 0, _glWidget->width(), _glWidget->height()); |
| 458 | 460 | glDisable(GL_SCISSOR_TEST); |
| 459 | − updateProjectionMatrix(); | |
| 461 | + updateProjectionMatrix(_myCamera, updateViewFrustum); | |
| 460 | 462 | } |
| 461 | 463 | |
| 462 | 464 | displayOverlay(); |
| @@ -494,22 +496,28 @@ void Application::updateProjectionMatrix() { · 31 unmodified lines | ||
| 494 | 496 | updateProjectionMatrix(_myCamera); |
| 495 | 497 | } |
| 496 | 498 | |
| 497 | −void Application::updateProjectionMatrix(Camera& camera) { | |
| 499 | +void Application::updateProjectionMatrix(Camera& camera, bool updateViewFrustum) { | |
| 498 | 500 | glMatrixMode(GL_PROJECTION); |
| 499 | 501 | glLoadIdentity(); |
| 500 | − | |
| 501 | − // Tell our viewFrustum about this change, using the application camera | |
| 502 | − loadViewFrustum(camera, _viewFrustum); | |
| 503 | − | |
| 502 | + | |
| 504 | 503 | float left, right, bottom, top, nearVal, farVal; |
| 505 | 504 | glm::vec4 nearClipPlane, farClipPlane; |
| 506 | − computeOffAxisFrustum(left, right, bottom, top, nearVal, farVal, nearClipPlane, farClipPlane); | |
| 507 | 505 | |
| 508 | − // If we're in Display Frustum mode, then we want to use the slightly adjust near/far clip values of the | |
| 509 | − // _viewFrustumOffsetCamera, so that we can see more of the application content in the application's frustum | |
| 510 | − if (Menu::getInstance()->isOptionChecked(MenuOption::DisplayFrustum)) { | |
| 511 | − nearVal = _viewFrustumOffsetCamera.getNearClip(); | |
| 512 | − farVal = _viewFrustumOffsetCamera.getFarClip(); | |
| 506 | + // Tell our viewFrustum about this change, using the application camera | |
| 507 | + if (updateViewFrustum) { | |
| 508 | + loadViewFrustum(camera, _viewFrustum); | |
| 509 | + computeOffAxisFrustum(left, right, bottom, top, nearVal, farVal, nearClipPlane, farClipPlane); | |
| 510 | + | |
| 511 | + // If we're in Display Frustum mode, then we want to use the slightly adjust near/far clip values of the | |
| 512 | + // _viewFrustumOffsetCamera, so that we can see more of the application content in the application's frustum | |
| 513 | + if (Menu::getInstance()->isOptionChecked(MenuOption::DisplayFrustum)) { | |
| 514 | + nearVal = _viewFrustumOffsetCamera.getNearClip(); | |
| 515 | + farVal = _viewFrustumOffsetCamera.getFarClip(); | |
| 516 | + } | |
| 517 | + } else { | |
| 518 | + ViewFrustum tempViewFrustum; | |
| 519 | + loadViewFrustum(camera, tempViewFrustum); | |
| 520 | + tempViewFrustum.computeOffAxisFrustum(left, right, bottom, top, nearVal, farVal, nearClipPlane, farClipPlane); | |
| 513 | 521 | } |
| 514 | 522 | glFrustum(left, right, bottom, top, nearVal, farVal); |
| 515 | 523 | |
| @@ -2508,7 +2516,7 @@ void Application::computeOffAxisFrustum(float& left, float& right, float& bottom · 1992 unmodified lines | ||
| 2508 | 2516 | _viewFrustum.computeOffAxisFrustum(left, right, bottom, top, near, far, nearClipPlane, farClipPlane); |
| 2509 | 2517 | } |
| 2510 | 2518 | |
| 2511 | −void Application::displaySide(Camera& whichCamera) { | |
| 2519 | +void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { | |
| 2512 | 2520 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), "Application::displaySide()"); |
| 2513 | 2521 | // transform by eye offset |
| 2514 | 2522 | |
| @@ -2540,7 +2548,7 @@ void Application::displaySide(Camera& whichCamera) { · 25 unmodified lines | ||
| 2540 | 2548 | // Setup 3D lights (after the camera transform, so that they are positioned in world space) |
| 2541 | 2549 | setupWorldLight(whichCamera); |
| 2542 | 2550 | |
| 2543 | − if (Menu::getInstance()->isOptionChecked(MenuOption::Stars)) { | |
| 2551 | + if (!selfAvatarOnly && Menu::getInstance()->isOptionChecked(MenuOption::Stars)) { | |
| 2544 | 2552 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), |
| 2545 | 2553 | "Application::displaySide() ... stars..."); |
| 2546 | 2554 | if (!_stars.isStarsLoaded()) { |
| @@ -2567,7 +2575,7 @@ void Application::displaySide(Camera& whichCamera) { · 20 unmodified lines | ||
| 2567 | 2575 | } |
| 2568 | 2576 | |
| 2569 | 2577 | // draw the sky dome |
| 2570 | − if (Menu::getInstance()->isOptionChecked(MenuOption::Atmosphere)) { | |
| 2578 | + if (!selfAvatarOnly && Menu::getInstance()->isOptionChecked(MenuOption::Atmosphere)) { | |
| 2571 | 2579 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), |
| 2572 | 2580 | "Application::displaySide() ... atmosphere..."); |
| 2573 | 2581 | _environment.renderAtmospheres(whichCamera); |
| @@ -2580,122 +2588,124 @@ void Application::displaySide(Camera& whichCamera) { · 6 unmodified lines | ||
| 2580 | 2588 | //renderLineToTouchedVoxel(); |
| 2581 | 2589 | //renderThrustAtVoxel(_voxelThrust); |
| 2582 | 2590 | |
| 2583 | − // draw a red sphere | |
| 2584 | − float sphereRadius = 0.25f; | |
| 2585 | − glColor3f(1,0,0); | |
| 2586 | − glPushMatrix(); | |
| 2587 | − glutSolidSphere(sphereRadius, 15, 15); | |
| 2588 | − glPopMatrix(); | |
| 2589 | − | |
| 2590 | − // disable specular lighting for ground and voxels | |
| 2591 | − glMaterialfv(GL_FRONT, GL_SPECULAR, NO_SPECULAR_COLOR); | |
| 2592 | − | |
| 2593 | − //draw a grid ground plane.... | |
| 2594 | − if (Menu::getInstance()->isOptionChecked(MenuOption::GroundPlane)) { | |
| 2595 | − PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | |
| 2596 | − "Application::displaySide() ... ground plane..."); | |
| 2597 | − | |
| 2598 | − // draw grass plane with fog | |
| 2599 | − glEnable(GL_FOG); | |
| 2600 | − glEnable(GL_NORMALIZE); | |
| 2601 | − const float FOG_COLOR[] = { 1.0f, 1.0f, 1.0f, 1.0f }; | |
| 2602 | − glFogfv(GL_FOG_COLOR, FOG_COLOR); | |
| 2603 | − glFogi(GL_FOG_MODE, GL_EXP2); | |
| 2604 | − glFogf(GL_FOG_DENSITY, 0.025f); | |
| 2591 | + if (!selfAvatarOnly) { | |
| 2592 | + // draw a red sphere | |
| 2593 | + float sphereRadius = 0.25f; | |
| 2594 | + glColor3f(1,0,0); | |
| 2605 | 2595 | glPushMatrix(); |
| 2606 | − const float GRASS_PLANE_SIZE = 256.0f; | |
| 2607 | − glTranslatef(-GRASS_PLANE_SIZE * 0.5f, -0.01f, GRASS_PLANE_SIZE * 0.5f); | |
| 2608 | − glScalef(GRASS_PLANE_SIZE, 1.0f, GRASS_PLANE_SIZE); | |
| 2609 | − glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); | |
| 2610 | − glColor3ub(70, 134, 74); | |
| 2611 | − const int GRASS_DIVISIONS = 40; | |
| 2612 | − _geometryCache.renderSquare(GRASS_DIVISIONS, GRASS_DIVISIONS); | |
| 2596 | + glutSolidSphere(sphereRadius, 15, 15); | |
| 2613 | 2597 | glPopMatrix(); |
| 2614 | − glDisable(GL_FOG); | |
| 2615 | − glDisable(GL_NORMALIZE); | |
| 2598 | + | |
| 2599 | + // disable specular lighting for ground and voxels | |
| 2600 | + glMaterialfv(GL_FRONT, GL_SPECULAR, NO_SPECULAR_COLOR); | |
| 2601 | + | |
| 2602 | + //draw a grid ground plane.... | |
| 2603 | + if (Menu::getInstance()->isOptionChecked(MenuOption::GroundPlane)) { | |
| 2604 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | |
| 2605 | + "Application::displaySide() ... ground plane..."); | |
| 2606 | + | |
| 2607 | + // draw grass plane with fog | |
| 2608 | + glEnable(GL_FOG); | |
| 2609 | + glEnable(GL_NORMALIZE); | |
| 2610 | + const float FOG_COLOR[] = { 1.0f, 1.0f, 1.0f, 1.0f }; | |
| 2611 | + glFogfv(GL_FOG_COLOR, FOG_COLOR); | |
| 2612 | + glFogi(GL_FOG_MODE, GL_EXP2); | |
| 2613 | + glFogf(GL_FOG_DENSITY, 0.025f); | |
| 2614 | + glPushMatrix(); | |
| 2615 | + const float GRASS_PLANE_SIZE = 256.0f; | |
| 2616 | + glTranslatef(-GRASS_PLANE_SIZE * 0.5f, -0.01f, GRASS_PLANE_SIZE * 0.5f); | |
| 2617 | + glScalef(GRASS_PLANE_SIZE, 1.0f, GRASS_PLANE_SIZE); | |
| 2618 | + glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); | |
| 2619 | + glColor3ub(70, 134, 74); | |
| 2620 | + const int GRASS_DIVISIONS = 40; | |
| 2621 | + _geometryCache.renderSquare(GRASS_DIVISIONS, GRASS_DIVISIONS); | |
| 2622 | + glPopMatrix(); | |
| 2623 | + glDisable(GL_FOG); | |
| 2624 | + glDisable(GL_NORMALIZE); | |
| 2616 | 2625 | |
| 2617 | − //renderGroundPlaneGrid(EDGE_SIZE_GROUND_PLANE, _audio.getCollisionSoundMagnitude()); | |
| 2618 | − } | |
| 2619 | − // Draw Cloud Particles | |
| 2620 | − if (Menu::getInstance()->isOptionChecked(MenuOption::ParticleCloud)) { | |
| 2621 | − _cloud.render(); | |
| 2622 | − } | |
| 2623 | − // Draw voxels | |
| 2624 | − if (Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) { | |
| 2625 | − PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | |
| 2626 | − "Application::displaySide() ... voxels..."); | |
| 2627 | − if (!Menu::getInstance()->isOptionChecked(MenuOption::DontRenderVoxels)) { | |
| 2628 | − _voxels.render(Menu::getInstance()->isOptionChecked(MenuOption::VoxelTextures)); | |
| 2626 | + //renderGroundPlaneGrid(EDGE_SIZE_GROUND_PLANE, _audio.getCollisionSoundMagnitude()); | |
| 2627 | + } | |
| 2628 | + // Draw Cloud Particles | |
| 2629 | + if (Menu::getInstance()->isOptionChecked(MenuOption::ParticleCloud)) { | |
| 2630 | + _cloud.render(); | |
| 2631 | + } | |
| 2632 | + // Draw voxels | |
| 2633 | + if (Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) { | |
| 2634 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | |
| 2635 | + "Application::displaySide() ... voxels..."); | |
| 2636 | + if (!Menu::getInstance()->isOptionChecked(MenuOption::DontRenderVoxels)) { | |
| 2637 | + _voxels.render(Menu::getInstance()->isOptionChecked(MenuOption::VoxelTextures)); | |
| 2638 | + } | |
| 2629 | 2639 | } |
| 2630 | − } | |
| 2631 | 2640 | |
| 2632 | 2641 | |
| 2633 | − // restore default, white specular | |
| 2634 | − glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR); | |
| 2642 | + // restore default, white specular | |
| 2643 | + glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR); | |
| 2635 | 2644 | |
| 2636 | − // indicate what we'll be adding/removing in mouse mode, if anything | |
| 2637 | − if (_mouseVoxel.s != 0 && whichCamera.getMode() != CAMERA_MODE_MIRROR) { | |
| 2638 | − PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | |
| 2639 | − "Application::displaySide() ... voxels TOOLS UX..."); | |
| 2645 | + // indicate what we'll be adding/removing in mouse mode, if anything | |
| 2646 | + if (_mouseVoxel.s != 0 && whichCamera.getMode() != CAMERA_MODE_MIRROR) { | |
| 2647 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | |
| 2648 | + "Application::displaySide() ... voxels TOOLS UX..."); | |
| 2640 | 2649 | |
| 2641 | − glDisable(GL_LIGHTING); | |
| 2642 | − glPushMatrix(); | |
| 2643 | − glScalef(TREE_SCALE, TREE_SCALE, TREE_SCALE); | |
| 2644 | − if (_nudgeStarted) { | |
| 2645 | − renderNudgeGuide(_nudgeGuidePosition.x, _nudgeGuidePosition.y, _nudgeGuidePosition.z, _nudgeVoxel.s); | |
| 2646 | − renderNudgeGrid(_nudgeVoxel.x, _nudgeVoxel.y, _nudgeVoxel.z, _nudgeVoxel.s, _mouseVoxel.s); | |
| 2650 | + glDisable(GL_LIGHTING); | |
| 2647 | 2651 | glPushMatrix(); |
| 2648 | − glTranslatef(_nudgeVoxel.x + _nudgeVoxel.s * 0.5f, | |
| 2649 | − _nudgeVoxel.y + _nudgeVoxel.s * 0.5f, | |
| 2650 | − _nudgeVoxel.z + _nudgeVoxel.s * 0.5f); | |
| 2651 | − glColor3ub(255, 255, 255); | |
| 2652 | − glLineWidth(4.0f); | |
| 2653 | − glutWireCube(_nudgeVoxel.s); | |
| 2654 | − glPopMatrix(); | |
| 2655 | − } else { | |
| 2656 | − renderMouseVoxelGrid(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s); | |
| 2657 | − } | |
| 2652 | + glScalef(TREE_SCALE, TREE_SCALE, TREE_SCALE); | |
| 2653 | + if (_nudgeStarted) { | |
| 2654 | + renderNudgeGuide(_nudgeGuidePosition.x, _nudgeGuidePosition.y, _nudgeGuidePosition.z, _nudgeVoxel.s); | |
| 2655 | + renderNudgeGrid(_nudgeVoxel.x, _nudgeVoxel.y, _nudgeVoxel.z, _nudgeVoxel.s, _mouseVoxel.s); | |
| 2656 | + glPushMatrix(); | |
| 2657 | + glTranslatef(_nudgeVoxel.x + _nudgeVoxel.s * 0.5f, | |
| 2658 | + _nudgeVoxel.y + _nudgeVoxel.s * 0.5f, | |
| 2659 | + _nudgeVoxel.z + _nudgeVoxel.s * 0.5f); | |
| 2660 | + glColor3ub(255, 255, 255); | |
| 2661 | + glLineWidth(4.0f); | |
| 2662 | + glutWireCube(_nudgeVoxel.s); | |
| 2663 | + glPopMatrix(); | |
| 2664 | + } else { | |
| 2665 | + renderMouseVoxelGrid(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s); | |
| 2666 | + } | |
| 2658 | 2667 | |
| 2659 | − if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelAddMode)) { | |
| 2660 | − // use a contrasting color so that we can see what we're doing | |
| 2661 | − glColor3ub(_mouseVoxel.red + 128, _mouseVoxel.green + 128, _mouseVoxel.blue + 128); | |
| 2662 | − } else { | |
| 2663 | − glColor3ub(_mouseVoxel.red, _mouseVoxel.green, _mouseVoxel.blue); | |
| 2664 | − } | |
| 2668 | + if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelAddMode)) { | |
| 2669 | + // use a contrasting color so that we can see what we're doing | |
| 2670 | + glColor3ub(_mouseVoxel.red + 128, _mouseVoxel.green + 128, _mouseVoxel.blue + 128); | |
| 2671 | + } else { | |
| 2672 | + glColor3ub(_mouseVoxel.red, _mouseVoxel.green, _mouseVoxel.blue); | |
| 2673 | + } | |
| 2665 | 2674 | |
| 2666 | − if (_nudgeStarted) { | |
| 2667 | − // render nudge guide cube | |
| 2668 | − glTranslatef(_nudgeGuidePosition.x + _nudgeVoxel.s*0.5f, | |
| 2669 | − _nudgeGuidePosition.y + _nudgeVoxel.s*0.5f, | |
| 2670 | − _nudgeGuidePosition.z + _nudgeVoxel.s*0.5f); | |
| 2671 | − glLineWidth(4.0f); | |
| 2672 | − glutWireCube(_nudgeVoxel.s); | |
| 2673 | − } else { | |
| 2674 | − glTranslatef(_mouseVoxel.x + _mouseVoxel.s*0.5f, | |
| 2675 | − _mouseVoxel.y + _mouseVoxel.s*0.5f, | |
| 2676 | − _mouseVoxel.z + _mouseVoxel.s*0.5f); | |
| 2677 | − glLineWidth(4.0f); | |
| 2678 | − glutWireCube(_mouseVoxel.s); | |
| 2675 | + if (_nudgeStarted) { | |
| 2676 | + // render nudge guide cube | |
| 2677 | + glTranslatef(_nudgeGuidePosition.x + _nudgeVoxel.s*0.5f, | |
| 2678 | + _nudgeGuidePosition.y + _nudgeVoxel.s*0.5f, | |
| 2679 | + _nudgeGuidePosition.z + _nudgeVoxel.s*0.5f); | |
| 2680 | + glLineWidth(4.0f); | |
| 2681 | + glutWireCube(_nudgeVoxel.s); | |
| 2682 | + } else { | |
| 2683 | + glTranslatef(_mouseVoxel.x + _mouseVoxel.s*0.5f, | |
| 2684 | + _mouseVoxel.y + _mouseVoxel.s*0.5f, | |
| 2685 | + _mouseVoxel.z + _mouseVoxel.s*0.5f); | |
| 2686 | + glLineWidth(4.0f); | |
| 2687 | + glutWireCube(_mouseVoxel.s); | |
| 2688 | + } | |
| 2689 | + glLineWidth(1.0f); | |
| 2690 | + glPopMatrix(); | |
| 2691 | + glEnable(GL_LIGHTING); | |
| 2679 | 2692 | } |
| 2680 | − glLineWidth(1.0f); | |
| 2681 | − glPopMatrix(); | |
| 2682 | − glEnable(GL_LIGHTING); | |
| 2683 | − } | |
| 2684 | 2693 | |
| 2685 | − if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelSelectMode) && _pasteMode && whichCamera.getMode() != CAMERA_MODE_MIRROR) { | |
| 2686 | − PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | |
| 2687 | − "Application::displaySide() ... PASTE Preview..."); | |
| 2694 | + if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelSelectMode) && _pasteMode && whichCamera.getMode() != CAMERA_MODE_MIRROR) { | |
| 2695 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | |
| 2696 | + "Application::displaySide() ... PASTE Preview..."); | |
| 2688 | 2697 | |
| 2689 | − glPushMatrix(); | |
| 2690 | − glTranslatef(_mouseVoxel.x * TREE_SCALE, | |
| 2691 | − _mouseVoxel.y * TREE_SCALE, | |
| 2692 | − _mouseVoxel.z * TREE_SCALE); | |
| 2693 | − glScalef(_mouseVoxel.s, | |
| 2694 | − _mouseVoxel.s, | |
| 2695 | − _mouseVoxel.s); | |
| 2696 | − | |
| 2697 | − _sharedVoxelSystem.render(true); | |
| 2698 | − glPopMatrix(); | |
| 2698 | + glPushMatrix(); | |
| 2699 | + glTranslatef(_mouseVoxel.x * TREE_SCALE, | |
| 2700 | + _mouseVoxel.y * TREE_SCALE, | |
| 2701 | + _mouseVoxel.z * TREE_SCALE); | |
| 2702 | + glScalef(_mouseVoxel.s, | |
| 2703 | + _mouseVoxel.s, | |
| 2704 | + _mouseVoxel.s); | |
| 2705 | + | |
| 2706 | + _sharedVoxelSystem.render(true); | |
| 2707 | + glPopMatrix(); | |
| 2708 | + } | |
| 2699 | 2709 | } |
| 2700 | 2710 | |
| 2701 | 2711 | _myAvatar.renderScreenTint(SCREEN_TINT_BEFORE_AVATARS, whichCamera); |
| @@ -2705,26 +2715,28 @@ void Application::displaySide(Camera& whichCamera) { · 3 unmodified lines | ||
| 2705 | 2715 | "Application::displaySide() ... Avatars..."); |
| 2706 | 2716 | |
| 2707 | 2717 | |
| 2708 | − // Render avatars of other nodes | |
| 2709 | − NodeList* nodeList = NodeList::getInstance(); | |
| 2718 | + if (!selfAvatarOnly) { | |
| 2719 | + // Render avatars of other nodes | |
| 2720 | + NodeList* nodeList = NodeList::getInstance(); | |
| 2710 | 2721 | |
| 2711 | − for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) { | |
| 2712 | − node->lock(); | |
| 2722 | + for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) { | |
| 2723 | + node->lock(); | |
| 2713 | 2724 | |
| 2714 | − if (node->getLinkedData() != NULL && node->getType() == NODE_TYPE_AGENT) { | |
| 2715 | − Avatar *avatar = (Avatar *)node->getLinkedData(); | |
| 2716 | − if (!avatar->isInitialized()) { | |
| 2717 | − avatar->init(); | |
| 2718 | − } | |
| 2719 | − // Set lookAt to myCamera on client side if other avatars are looking at client | |
| 2720 | − if (isLookingAtMyAvatar(avatar)) { | |
| 2721 | − avatar->getHead().setLookAtPosition(whichCamera.getPosition()); | |
| 2725 | + if (node->getLinkedData() != NULL && node->getType() == NODE_TYPE_AGENT) { | |
| 2726 | + Avatar *avatar = (Avatar *)node->getLinkedData(); | |
| 2727 | + if (!avatar->isInitialized()) { | |
| 2728 | + avatar->init(); | |
| 2729 | + } | |
| 2730 | + // Set lookAt to myCamera on client side if other avatars are looking at client | |
| 2731 | + if (isLookingAtMyAvatar(avatar)) { | |
| 2732 | + avatar->getHead().setLookAtPosition(whichCamera.getPosition()); | |
| 2733 | + } | |
| 2734 | + avatar->render(false, Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls)); | |
| 2735 | + avatar->setDisplayingLookatVectors(Menu::getInstance()->isOptionChecked(MenuOption::LookAtVectors)); | |
| 2722 | 2736 | } |
| 2723 | − avatar->render(false, Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls)); | |
| 2724 | − avatar->setDisplayingLookatVectors(Menu::getInstance()->isOptionChecked(MenuOption::LookAtVectors)); | |
| 2725 | − } | |
| 2726 | 2737 | |
| 2727 | − node->unlock(); | |
| 2738 | + node->unlock(); | |
| 2739 | + } | |
| 2728 | 2740 | } |
| 2729 | 2741 | |
| 2730 | 2742 | // Render my own Avatar |