mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 20:58:38 +02:00
bug fix for sensorToWorld translation transmission
This commit is contained in:
parent
c6ea64926c
commit
6be737993e
1 changed files with 4 additions and 3 deletions
|
@ -220,9 +220,9 @@ QByteArray AvatarData::toByteArray(bool cullSmallChanges, bool sendAll) {
|
||||||
packOrientationQuatToSixBytes(header->sensorToWorldQuat, glmExtractRotation(sensorToWorldMatrix));
|
packOrientationQuatToSixBytes(header->sensorToWorldQuat, glmExtractRotation(sensorToWorldMatrix));
|
||||||
glm::vec3 scale = extractScale(sensorToWorldMatrix);
|
glm::vec3 scale = extractScale(sensorToWorldMatrix);
|
||||||
packFloatScalarToSignedTwoByteFixed((uint8_t*)&header->sensorToWorldScale, scale.x, SENSOR_TO_WORLD_SCALE_RADIX);
|
packFloatScalarToSignedTwoByteFixed((uint8_t*)&header->sensorToWorldScale, scale.x, SENSOR_TO_WORLD_SCALE_RADIX);
|
||||||
header->sensorToWorldTrans[0] = sensorToWorldMatrix[0][3];
|
header->sensorToWorldTrans[0] = sensorToWorldMatrix[3][0];
|
||||||
header->sensorToWorldTrans[1] = sensorToWorldMatrix[1][3];
|
header->sensorToWorldTrans[1] = sensorToWorldMatrix[3][1];
|
||||||
header->sensorToWorldTrans[2] = sensorToWorldMatrix[2][3];
|
header->sensorToWorldTrans[2] = sensorToWorldMatrix[3][2];
|
||||||
|
|
||||||
setSemiNibbleAt(header->flags, KEY_STATE_START_BIT, _keyState);
|
setSemiNibbleAt(header->flags, KEY_STATE_START_BIT, _keyState);
|
||||||
// hand state
|
// hand state
|
||||||
|
@ -518,6 +518,7 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
||||||
unpackFloatScalarFromSignedTwoByteFixed((int16_t*)&header->sensorToWorldScale, &sensorToWorldScale, SENSOR_TO_WORLD_SCALE_RADIX);
|
unpackFloatScalarFromSignedTwoByteFixed((int16_t*)&header->sensorToWorldScale, &sensorToWorldScale, SENSOR_TO_WORLD_SCALE_RADIX);
|
||||||
glm::vec3 sensorToWorldTrans(header->sensorToWorldTrans[0], header->sensorToWorldTrans[1], header->sensorToWorldTrans[2]);
|
glm::vec3 sensorToWorldTrans(header->sensorToWorldTrans[0], header->sensorToWorldTrans[1], header->sensorToWorldTrans[2]);
|
||||||
glm::mat4 sensorToWorldMatrix = createMatFromScaleQuatAndPos(glm::vec3(sensorToWorldScale), sensorToWorldQuat, sensorToWorldTrans);
|
glm::mat4 sensorToWorldMatrix = createMatFromScaleQuatAndPos(glm::vec3(sensorToWorldScale), sensorToWorldQuat, sensorToWorldTrans);
|
||||||
|
|
||||||
_sensorToWorldMatrixCache.set(sensorToWorldMatrix);
|
_sensorToWorldMatrixCache.set(sensorToWorldMatrix);
|
||||||
|
|
||||||
{ // bitFlags and face data
|
{ // bitFlags and face data
|
||||||
|
|
Loading…
Reference in a new issue