From 27c4702c7eec983790967f1dfe68b186ab321645 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 21 Feb 2013 14:45:33 -0800 Subject: [PATCH] move to agent head position before drawing it --- interface/src/Head.cpp | 1 - interface/src/main.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index b789fa63d2..31a388c1d7 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -344,7 +344,6 @@ int Head::getBroadcastData(char* data) void Head::parseData(void *data, int size) { // parse head data for this agent - std::cout << "HD: " << (char *)data << "\n"; sscanf((char *)data, "H%f,%f,%f,%f,%f,%f,%f,%f", &Pitch, &Yaw, &Roll, &position.x, &position.y, &position.z, diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 526fbd836e..6f8d4d3101 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -523,7 +523,6 @@ void update_pos(float frametime) const int MAX_BROADCAST_STRING = 200; char broadcast_string[MAX_BROADCAST_STRING]; int broadcast_bytes = myHead.getBroadcastData(broadcast_string); - std::cout << "BS: " << broadcast_string << "\n"; agentList.broadcastToAgents(broadcast_string, broadcast_bytes); } @@ -586,7 +585,11 @@ void display(void) // Render heads of other agents for(std::vector::iterator agent = agentList.agents.begin(); agent != agentList.agents.end(); agent++) { if (agent->linkedData != NULL) { - ((Head *)agent->linkedData)->render(0, &location[0]); + Head *agentHead = (Head *)agent->linkedData; + + glm::vec3 pos = agentHead->getPos(); + glTranslatef(-pos.x, -pos.y, -pos.z); + agentHead->render(0, &location[0]); } }