mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
repairs to key-framed URL sending through avatar-mixer
This commit is contained in:
parent
7e3442cbd0
commit
adaa36a51d
4 changed files with 19 additions and 11 deletions
|
@ -122,7 +122,9 @@ void broadcastIdentityPacket() {
|
|||
}
|
||||
|
||||
// send out the final packet
|
||||
nodeList->broadcastToNodes(avatarIdentityPacket, NodeSet() << NodeType::Agent);
|
||||
if (avatarIdentityPacket.size() > numPacketHeaderBytes) {
|
||||
nodeList->broadcastToNodes(avatarIdentityPacket, NodeSet() << NodeType::Agent);
|
||||
}
|
||||
}
|
||||
|
||||
void AvatarMixer::nodeKilled(SharedNodePointer killedNode) {
|
||||
|
@ -170,7 +172,11 @@ void AvatarMixer::processDatagram(const QByteArray& dataByteArray, const HifiSoc
|
|||
&& !nodeData->hasSentIdentityBetweenKeyFrames()) {
|
||||
// this avatar changed their identity in some way and we haven't sent a packet in this keyframe
|
||||
QByteArray identityPacket = byteArrayWithPopluatedHeader(PacketTypeAvatarIdentity);
|
||||
identityPacket.append(nodeData->identityByteArray());
|
||||
|
||||
QByteArray individualByteArray = nodeData->identityByteArray();
|
||||
individualByteArray.replace(0, NUM_BYTES_RFC4122_UUID, nodeUUID.toRfc4122());
|
||||
|
||||
identityPacket.append(individualByteArray);
|
||||
|
||||
nodeData->setHasSentIdentityBetweenKeyFrames(true);
|
||||
nodeList->broadcastToNodes(identityPacket, NodeSet() << NodeType::Agent);
|
||||
|
|
|
@ -247,7 +247,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
|
|||
// send the identity packet for our avatar each second to our avatar mixer
|
||||
QTimer* identityPacketTimer = new QTimer();
|
||||
connect(identityPacketTimer, &QTimer::timeout, _myAvatar, &MyAvatar::sendIdentityPacket);
|
||||
silentNodeTimer->start(1000);
|
||||
identityPacketTimer->start(1000);
|
||||
|
||||
QString cachePath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
|
||||
|
||||
|
|
|
@ -179,6 +179,7 @@ void AvatarManager::processAvatarDataPacket(const QByteArray &datagram, const QW
|
|||
}
|
||||
|
||||
void AvatarManager::processAvatarIdentityPacket(const QByteArray &packet) {
|
||||
qDebug() << "Processing an avatar identity packet";
|
||||
// setup a data stream to parse the packet
|
||||
QDataStream identityStream(packet);
|
||||
identityStream.skipRawData(numBytesForPacketHeader(packet));
|
||||
|
@ -186,28 +187,27 @@ void AvatarManager::processAvatarIdentityPacket(const QByteArray &packet) {
|
|||
QUuid nodeUUID;
|
||||
|
||||
while (!identityStream.atEnd()) {
|
||||
identityStream >> nodeUUID;
|
||||
|
||||
QUrl faceMeshURL, skeletonURL;
|
||||
identityStream >> nodeUUID >> faceMeshURL >> skeletonURL;
|
||||
|
||||
// mesh URL for a UUID, find avatar in our list
|
||||
AvatarSharedPointer matchingAvatar = _avatarHash.value(nodeUUID);
|
||||
if (matchingAvatar) {
|
||||
QUrl faceMeshURL, skeletonURL;
|
||||
identityStream >> faceMeshURL >> skeletonURL;
|
||||
|
||||
Avatar* avatar = static_cast<Avatar*>(matchingAvatar.data());
|
||||
|
||||
if (avatar->getHead().getFaceModel().getURL() != faceMeshURL) {
|
||||
if (avatar->getFaceModelURL() != faceMeshURL) {
|
||||
qDebug() << "Changing mesh to" << faceMeshURL.toString() << "for avatar with UUID"
|
||||
<< uuidStringWithoutCurlyBraces(nodeUUID);
|
||||
|
||||
avatar->getHead().getFaceModel().setURL(faceMeshURL);
|
||||
avatar->setFaceModelURL(faceMeshURL);
|
||||
}
|
||||
|
||||
if (avatar->getSkeletonModel().getURL() != skeletonURL) {
|
||||
if (avatar->getFaceModelURL() != skeletonURL) {
|
||||
qDebug() << "Changing skeleton to" << skeletonURL << "for avatar with UUID"
|
||||
<< uuidStringWithoutCurlyBraces(nodeUUID);
|
||||
|
||||
avatar->getSkeletonModel().setURL(skeletonURL);
|
||||
avatar->setFaceModelURL(skeletonURL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -280,6 +280,8 @@ bool AvatarData::hasIdentityChangedAfterParsing(const QByteArray &packet) {
|
|||
|
||||
bool hasIdentityChanged = false;
|
||||
|
||||
qDebug() << faceModelURL;
|
||||
|
||||
if (faceModelURL != _faceModelURL) {
|
||||
setFaceModelURL(faceModelURL);
|
||||
hasIdentityChanged = true;
|
||||
|
|
Loading…
Reference in a new issue