mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
more debugging of referentials
This commit is contained in:
parent
d6873f7b6c
commit
4e38cb7c68
2 changed files with 8 additions and 0 deletions
|
@ -64,6 +64,7 @@ ModelReferential::ModelReferential(const QUuid& entityID, EntityTree* tree, Avat
|
|||
|
||||
void ModelReferential::update() {
|
||||
const EntityItem* item = _tree->findEntityByID(_entityID);
|
||||
qDebug() << "ModelReferential::update() _entityID=" << _entityID << " item=" << item;
|
||||
if (!isValid() || item == NULL || _avatar == NULL) {
|
||||
return;
|
||||
}
|
||||
|
@ -90,12 +91,14 @@ qDebug() << "ModelReferential::update() _refPosition=" << _refPosition << " QThr
|
|||
int ModelReferential::packExtraData(unsigned char* destinationBuffer) const {
|
||||
QByteArray encodedEntityID = _entityID.toRfc4122();
|
||||
memcpy(destinationBuffer, encodedEntityID.constData(), encodedEntityID.size());
|
||||
qDebug() << "ModelReferential::packExtraData() encodedEntityID.size()=" << encodedEntityID.size();
|
||||
return encodedEntityID.size();
|
||||
}
|
||||
|
||||
int ModelReferential::unpackExtraData(const unsigned char *sourceBuffer, int size) {
|
||||
QByteArray encodedEntityID((const char*)sourceBuffer, NUM_BYTES_RFC4122_UUID);
|
||||
_entityID = QUuid::fromRfc4122(encodedEntityID);
|
||||
qDebug() << "ModelReferential::unpackExtraData() encodedEntityID.size()=" << encodedEntityID.size() << " _entityID=" << _entityID;
|
||||
return NUM_BYTES_RFC4122_UUID;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,8 @@ int Referential::packReferential(unsigned char* destinationBuffer) const {
|
|||
*sizePosition = size; // write extra data size in saved spot here
|
||||
destinationBuffer += size;
|
||||
|
||||
qDebug() << "Referential::packReferential() size=" << (int)size;
|
||||
|
||||
return destinationBuffer - startPosition;
|
||||
}
|
||||
|
||||
|
@ -60,6 +62,9 @@ int Referential::unpackReferential(const unsigned char* sourceBuffer) {
|
|||
sourceBuffer += unpack(sourceBuffer);
|
||||
|
||||
char expectedSize = *sourceBuffer++;
|
||||
|
||||
qDebug() << "Referential::unpackReferential() expectedSize=" << (int)expectedSize;
|
||||
|
||||
char bytesRead = unpackExtraData(sourceBuffer, expectedSize);
|
||||
_isValid = (bytesRead == expectedSize);
|
||||
if (!_isValid) {
|
||||
|
|
Loading…
Reference in a new issue