History

Merge pull request #791 from Atlante45/stalking_indicator

Stalking indicator

ZappoMan committed 13 years ago

Commit c93ed452 parents abf64f3 eb9f32b9 files · +83 −8Browse files

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

Unified · Split

interface/src/Application.cpp+52−0
@@ -2292,6 +2292,56 @@ void Application::renderLookatIndicator(glm::vec3 pointOfInterest, Camera& which · 2291 unmodified lines
22922292 renderCircle(haloOrigin, INDICATOR_RADIUS, IDENTITY_UP, NUM_SEGMENTS);
22932293 }
22942294
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+
22952345 void Application::update(float deltaTime) {
22962346
22972347 // Use Transmitter Hand to move hand if connected, else use mouse
@@ -3062,6 +3112,8 @@ void Application::displaySide(Camera& whichCamera) { · 764 unmodified lines
30623112
30633113 // brad's frustum for debugging
30643114 if (_frustumOn->isChecked()) renderViewFrustum(_viewFrustum);
3115+
3116+ renderFollowIndicator();
30653117 }
30663118
30673119 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