Showing the changes to interface/src/Application.cpp (1 of 13 files). Show all
Unified · Split
| @@ -1944,6 +1944,7 @@ void Application::initMenu() { · 1943 unmodified lines | |||
| 1944 | (_fullScreenMode = optionsMenu->addAction("Fullscreen", this, SLOT(setFullscreen(bool)), Qt::Key_F))->setCheckable(true); | 1944 | (_fullScreenMode = optionsMenu->addAction("Fullscreen", this, SLOT(setFullscreen(bool)), Qt::Key_F))->setCheckable(true); |
| 1945 | optionsMenu->addAction("Webcam", &_webcam, SLOT(setEnabled(bool)))->setCheckable(true); | 1945 | optionsMenu->addAction("Webcam", &_webcam, SLOT(setEnabled(bool)))->setCheckable(true); |
| 1946 | optionsMenu->addAction("Toggle Skeleton Tracking", &_webcam, SLOT(setSkeletonTrackingOn(bool)))->setCheckable(true); | 1946 | optionsMenu->addAction("Toggle Skeleton Tracking", &_webcam, SLOT(setSkeletonTrackingOn(bool)))->setCheckable(true); |
| 1947 | (_wantCollisionsOn = optionsMenu->addAction("Turn collisions On", this, SLOT(toggleWantCollisionsOn())))->setCheckable(true); | ||
| 1947 | optionsMenu->addAction("Cycle Webcam Send Mode", _webcam.getGrabber(), SLOT(cycleVideoSendMode())); | 1948 | optionsMenu->addAction("Cycle Webcam Send Mode", _webcam.getGrabber(), SLOT(cycleVideoSendMode())); |
| 1948 | optionsMenu->addAction("Go Home", this, SLOT(goHome()), Qt::CTRL | Qt::Key_G); | 1949 | optionsMenu->addAction("Go Home", this, SLOT(goHome()), Qt::CTRL | Qt::Key_G); |
| 1949 | 1950 | ||
| @@ -2137,6 +2138,10 @@ void Application::toggleMixedSong() { · 187 unmodified lines | |||
| 2137 | } | 2138 | } |
| 2138 | } | 2139 | } |
| 2139 | 2140 | ||
| 2141 | void Application::toggleWantCollisionsOn() { | ||
| 2142 | _myAvatar.setWantCollisionsOn(_wantCollisionsOn->isChecked()); | ||
| 2143 | } | ||
| 2144 | |||
| 2140 | void Application::resetSongMixMenuItem() { | 2145 | void Application::resetSongMixMenuItem() { |
| 2141 | if (_audio.getSongFileBytes() == 0) { | 2146 | if (_audio.getSongFileBytes() == 0) { |
| 2142 | _rawAudioMicrophoneMix->setText("Mix RAW Song"); | 2147 | _rawAudioMicrophoneMix->setText("Mix RAW Song"); |
| @@ -2287,6 +2292,56 @@ void Application::renderLookatIndicator(glm::vec3 pointOfInterest, Camera& which · 144 unmodified lines | |||
| 2287 | renderCircle(haloOrigin, INDICATOR_RADIUS, IDENTITY_UP, NUM_SEGMENTS); | 2292 | renderCircle(haloOrigin, INDICATOR_RADIUS, IDENTITY_UP, NUM_SEGMENTS); |
| 2288 | } | 2293 | } |
| 2289 | 2294 | ||
| 2295 | void Application::renderFollowIndicator() { | ||
| 2296 | NodeList* nodeList = NodeList::getInstance(); | ||
| 2297 | |||
| 2298 | glLineWidth(5); | ||
| 2299 | glBegin(GL_LINES); | ||
| 2300 | for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); ++node) { | ||
| 2301 | if (node->getLinkedData() != NULL && node->getType() == NODE_TYPE_AGENT) { | ||
| 2302 | Avatar* avatar = (Avatar *) node->getLinkedData(); | ||
| 2303 | Avatar* leader = NULL; | ||
| 2304 | |||
| 2305 | if (avatar->getLeaderID() != UNKNOWN_NODE_ID) { | ||
| 2306 | if (avatar->getLeaderID() == NodeList::getInstance()->getOwnerID()) { | ||
| 2307 | leader = &_myAvatar; | ||
| 2308 | } else { | ||
| 2309 | for (NodeList::iterator it = nodeList->begin(); it != nodeList->end(); ++it) { | ||
| 2310 | if(it->getNodeID() == avatar->getLeaderID() | ||
| 2311 | && it->getType() == NODE_TYPE_AGENT) { | ||
| 2312 | leader = (Avatar*) it->getLinkedData(); | ||
| 2313 | } | ||
| 2314 | } | ||
| 2315 | } | ||
| 2316 | |||
| 2317 | if (leader != NULL) { | ||
| 2318 | glColor3f(1.f, 0.f, 0.f); | ||
| 2319 | glVertex3f(avatar->getPosition().x, | ||
| 2320 | avatar->getPosition().y, | ||
| 2321 | avatar->getPosition().z); | ||
| 2322 | glColor3f(0.f, 1.f, 0.f); | ||
| 2323 | glVertex3f(leader->getPosition().x, | ||
| 2324 | leader->getPosition().y, | ||
| 2325 | leader->getPosition().z); | ||
| 2326 | } | ||
| 2327 | } | ||
| 2328 | } | ||
| 2329 | } | ||
| 2330 | |||
| 2331 | if (_myAvatar.getLeadingAvatar() != NULL) { | ||
| 2332 | glColor3f(1.f, 0.f, 0.f); | ||
| 2333 | glVertex3f(_myAvatar.getPosition().x, | ||
| 2334 | _myAvatar.getPosition().y, | ||
| 2335 | _myAvatar.getPosition().z); | ||
| 2336 | glColor3f(0.f, 1.f, 0.f); | ||
| 2337 | glVertex3f(_myAvatar.getLeadingAvatar()->getPosition().x, | ||
| 2338 | _myAvatar.getLeadingAvatar()->getPosition().y, | ||
| 2339 | _myAvatar.getLeadingAvatar()->getPosition().z); | ||
| 2340 | } | ||
| 2341 | |||
| 2342 | glEnd(); | ||
| 2343 | } | ||
| 2344 | |||
| 2290 | void Application::update(float deltaTime) { | 2345 | void Application::update(float deltaTime) { |
| 2291 | 2346 | ||
| 2292 | // Use Transmitter Hand to move hand if connected, else use mouse | 2347 | // Use Transmitter Hand to move hand if connected, else use mouse |
| @@ -3054,6 +3109,8 @@ void Application::displaySide(Camera& whichCamera) { · 761 unmodified lines | |||
| 3054 | 3109 | ||
| 3055 | // brad's frustum for debugging | 3110 | // brad's frustum for debugging |
| 3056 | if (_frustumOn->isChecked()) renderViewFrustum(_viewFrustum); | 3111 | if (_frustumOn->isChecked()) renderViewFrustum(_viewFrustum); |
| 3112 | |||
| 3113 | renderFollowIndicator(); | ||
| 3057 | } | 3114 | } |
| 3058 | 3115 | ||
| 3059 | void Application::displayOverlay() { | 3116 | void Application::displayOverlay() { |