History

Merge branch 'master' of https://github.com/worklist/hifi into touchLook

Philip Rosedale committed 13 years ago

Commit ebd5c482 parents 120bbbd c93ed4513 files · +126 −27Browse files

Showing the changes to interface/src/Application.cpp (1 of 13 files). Show all

Unified · Split

interface/src/Application.cpp+57−0
@@ -1944,6 +1944,7 @@ void Application::initMenu() { · 1943 unmodified lines
19441944 (_fullScreenMode = optionsMenu->addAction("Fullscreen", this, SLOT(setFullscreen(bool)), Qt::Key_F))->setCheckable(true);
19451945 optionsMenu->addAction("Webcam", &_webcam, SLOT(setEnabled(bool)))->setCheckable(true);
19461946 optionsMenu->addAction("Toggle Skeleton Tracking", &_webcam, SLOT(setSkeletonTrackingOn(bool)))->setCheckable(true);
1947+ (_wantCollisionsOn = optionsMenu->addAction("Turn collisions On", this, SLOT(toggleWantCollisionsOn())))->setCheckable(true);
19471948 optionsMenu->addAction("Cycle Webcam Send Mode", _webcam.getGrabber(), SLOT(cycleVideoSendMode()));
19481949 optionsMenu->addAction("Go Home", this, SLOT(goHome()), Qt::CTRL | Qt::Key_G);
19491950
@@ -2137,6 +2138,10 @@ void Application::toggleMixedSong() { · 187 unmodified lines
21372138 }
21382139 }
21392140
2141+void Application::toggleWantCollisionsOn() {
2142+ _myAvatar.setWantCollisionsOn(_wantCollisionsOn->isChecked());
2143+}
2144+
21402145 void Application::resetSongMixMenuItem() {
21412146 if (_audio.getSongFileBytes() == 0) {
21422147 _rawAudioMicrophoneMix->setText("Mix RAW Song");
@@ -2287,6 +2292,56 @@ void Application::renderLookatIndicator(glm::vec3 pointOfInterest, Camera& which · 144 unmodified lines
22872292 renderCircle(haloOrigin, INDICATOR_RADIUS, IDENTITY_UP, NUM_SEGMENTS);
22882293 }
22892294
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+
22902345 void Application::update(float deltaTime) {
22912346
22922347 // Use Transmitter Hand to move hand if connected, else use mouse
@@ -3054,6 +3109,8 @@ void Application::displaySide(Camera& whichCamera) { · 761 unmodified lines
30543109
30553110 // brad's frustum for debugging
30563111 if (_frustumOn->isChecked()) renderViewFrustum(_viewFrustum);
3112+
3113+ renderFollowIndicator();
30573114 }
30583115
30593116 void Application::displayOverlay() {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t