mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:17:02 +02:00
fix broken builds from last commit, pull new avatar data in VoxelAgentData
This commit is contained in:
parent
5c091a51a6
commit
e71f21b7bf
6 changed files with 12 additions and 11 deletions
|
@ -63,7 +63,7 @@ int main(int argc, char* argv[])
|
||||||
agentList->startPingUnknownAgentsThread();
|
agentList->startPingUnknownAgentsThread();
|
||||||
|
|
||||||
sockaddr *agentAddress = new sockaddr;
|
sockaddr *agentAddress = new sockaddr;
|
||||||
char *packetData = new char[MAX_PACKET_SIZE];
|
unsigned char *packetData = new unsigned char[MAX_PACKET_SIZE];
|
||||||
ssize_t receivedBytes = 0;
|
ssize_t receivedBytes = 0;
|
||||||
|
|
||||||
unsigned char *broadcastPacket = new unsigned char[MAX_PACKET_SIZE];
|
unsigned char *broadcastPacket = new unsigned char[MAX_PACKET_SIZE];
|
||||||
|
@ -101,7 +101,7 @@ int main(int argc, char* argv[])
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// hand this off to the AgentList
|
// hand this off to the AgentList
|
||||||
agentList->processAgentData(agentAddress, (void *)packetData, receivedBytes);
|
agentList->processAgentData(agentAddress, packetData, receivedBytes);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -411,7 +411,7 @@ void *receiveAudioViaUDP(void *args) {
|
||||||
}
|
}
|
||||||
if (packetsReceivedThisPlayback == 1) gettimeofday(&firstPlaybackTimer, NULL);
|
if (packetsReceivedThisPlayback == 1) gettimeofday(&firstPlaybackTimer, NULL);
|
||||||
|
|
||||||
ringBuffer->parseData(receivedData, PACKET_LENGTH_BYTES);
|
ringBuffer->parseData((unsigned char *)receivedData, PACKET_LENGTH_BYTES);
|
||||||
|
|
||||||
previousReceiveTime = currentReceiveTime;
|
previousReceiveTime = currentReceiveTime;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1174,7 +1174,7 @@ void Head::SetNewHeadTarget(float pitch, float yaw) {
|
||||||
YawTarget = 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
|
// Read a packet from a transmitter app, process the data
|
||||||
float accX, accY, accZ,
|
float accX, accY, accZ,
|
||||||
graX, graY, graZ,
|
graX, graY, graZ,
|
||||||
|
|
|
@ -139,7 +139,7 @@ class Head : public AvatarData {
|
||||||
|
|
||||||
void renderBody();
|
void renderBody();
|
||||||
void renderHead( int faceToFace, int isMine );
|
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);
|
void simulate(float);
|
||||||
|
|
||||||
|
|
|
@ -81,10 +81,10 @@ unsigned int AgentList::getSocketListenPort() {
|
||||||
return socketListenPort;
|
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]) {
|
switch (((char *)packetData)[0]) {
|
||||||
case PACKET_HEADER_DOMAIN: {
|
case PACKET_HEADER_DOMAIN: {
|
||||||
updateList((unsigned char *)packetData, dataBytes);
|
updateList(packetData, dataBytes);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PACKET_HEADER_PING: {
|
case PACKET_HEADER_PING: {
|
||||||
|
|
|
@ -27,9 +27,10 @@ VoxelAgentData* VoxelAgentData::clone() const {
|
||||||
return new VoxelAgentData(*this);
|
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
|
// pull the position from the interface agent data packet
|
||||||
sscanf((char *)data,
|
memcpy(&position, sourceBuffer, sizeof(float) * 3);
|
||||||
"H%*f,%*f,%*f,%f,%f,%f",
|
|
||||||
&position[0], &position[1], &position[2]);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue