fix broken builds from last commit, pull new avatar data in VoxelAgentData

This commit is contained in:
Stephen Birarda 2013-04-16 11:59:03 -07:00
parent 5c091a51a6
commit e71f21b7bf
6 changed files with 12 additions and 11 deletions

View file

@ -63,7 +63,7 @@ int main(int argc, char* argv[])
agentList->startPingUnknownAgentsThread();
sockaddr *agentAddress = new sockaddr;
char *packetData = new char[MAX_PACKET_SIZE];
unsigned char *packetData = new unsigned char[MAX_PACKET_SIZE];
ssize_t receivedBytes = 0;
unsigned char *broadcastPacket = new unsigned char[MAX_PACKET_SIZE];
@ -101,7 +101,7 @@ int main(int argc, char* argv[])
break;
default:
// hand this off to the AgentList
agentList->processAgentData(agentAddress, (void *)packetData, receivedBytes);
agentList->processAgentData(agentAddress, packetData, receivedBytes);
break;
}
}

View file

@ -411,7 +411,7 @@ void *receiveAudioViaUDP(void *args) {
}
if (packetsReceivedThisPlayback == 1) gettimeofday(&firstPlaybackTimer, NULL);
ringBuffer->parseData(receivedData, PACKET_LENGTH_BYTES);
ringBuffer->parseData((unsigned char *)receivedData, PACKET_LENGTH_BYTES);
previousReceiveTime = currentReceiveTime;
}

View file

@ -1174,7 +1174,7 @@ void Head::SetNewHeadTarget(float pitch, float yaw) {
YawTarget = yaw;
}
void Head::processTransmitterData(unsigned char *packetData, int numBytes) {
void Head::processTransmitterData(unsigned char* packetData, int numBytes) {
// Read a packet from a transmitter app, process the data
float accX, accY, accZ,
graX, graY, graZ,

View file

@ -139,7 +139,7 @@ class Head : public AvatarData {
void renderBody();
void renderHead( int faceToFace, int isMine );
void renderOrientataionDirections( glm::vec3 position, Orientation orientation, float size );
void renderOrientationDirections( glm::vec3 position, Orientation orientation, float size );
void simulate(float);

View file

@ -81,10 +81,10 @@ unsigned int AgentList::getSocketListenPort() {
return socketListenPort;
}
void AgentList::processAgentData(sockaddr *senderAddress, void *packetData, size_t dataBytes) {
void AgentList::processAgentData(sockaddr *senderAddress, unsigned char *packetData, size_t dataBytes) {
switch (((char *)packetData)[0]) {
case PACKET_HEADER_DOMAIN: {
updateList((unsigned char *)packetData, dataBytes);
updateList(packetData, dataBytes);
break;
}
case PACKET_HEADER_PING: {

View file

@ -27,9 +27,10 @@ VoxelAgentData* VoxelAgentData::clone() const {
return new VoxelAgentData(*this);
}
void VoxelAgentData::parseData(void *data, int size) {
void VoxelAgentData::parseData(unsigned char* sourceBuffer, int numBytes) {
// push past the packet header
sourceBuffer++;
// pull the position from the interface agent data packet
sscanf((char *)data,
"H%*f,%*f,%*f,%f,%f,%f",
&position[0], &position[1], &position[2]);
memcpy(&position, sourceBuffer, sizeof(float) * 3);
}