mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 21:18:58 +02:00
Adding hand data to head broadcast packet.
This commit is contained in:
parent
014fdcc618
commit
777a00db3e
1 changed files with 9 additions and 4 deletions
|
@ -345,18 +345,23 @@ void Head::render(int faceToFace, float * myLocation)
|
||||||
int Head::getBroadcastData(char* data)
|
int Head::getBroadcastData(char* data)
|
||||||
{
|
{
|
||||||
// Copy data for transmission to the buffer, return length of data
|
// Copy data for transmission to the buffer, return length of data
|
||||||
sprintf(data, "H%f,%f,%f,%f,%f,%f,%f,%f", getRenderPitch() + Pitch, -getRenderYaw() + 180 -Yaw, Roll,
|
sprintf(data, "H%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f",
|
||||||
|
getRenderPitch() + Pitch, -getRenderYaw() + 180 -Yaw, Roll,
|
||||||
position.x + leanSideways, position.y, position.z + leanForward,
|
position.x + leanSideways, position.y, position.z + leanForward,
|
||||||
loudness, averageLoudness);
|
loudness, averageLoudness,
|
||||||
|
hand->getPos().x, hand->getPos().y, hand->getPos().z);
|
||||||
return strlen(data);
|
return strlen(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::parseData(void *data, int size) {
|
void Head::parseData(void *data, int size) {
|
||||||
// parse head data for this agent
|
// parse head data for this agent
|
||||||
sscanf((char *)data, "H%f,%f,%f,%f,%f,%f,%f,%f",
|
glm::vec3 handPos(0,0,0);
|
||||||
|
sscanf((char *)data, "H%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f",
|
||||||
&Pitch, &Yaw, &Roll,
|
&Pitch, &Yaw, &Roll,
|
||||||
&position.x, &position.y, &position.z,
|
&position.x, &position.y, &position.z,
|
||||||
&loudness, &averageLoudness);
|
&loudness, &averageLoudness,
|
||||||
|
&handPos.x, &handPos.y, &handPos.z);
|
||||||
|
if (glm::length(handPos) > 0.0) hand->setPos(handPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::SetNewHeadTarget(float pitch, float yaw)
|
void Head::SetNewHeadTarget(float pitch, float yaw)
|
||||||
|
|
Loading…
Reference in a new issue