mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-10 04:53:04 +02:00
Bug fix for rotation culling in AvatarData::toByteArray()
The commit5a0de0f103
inadvertently introduced a regression in how the AvatarMixer and clients encode AvatarData packets. When encoding packets that with the cullSmallChanges flag set to true, we only include rotations that have changed significantly from the previous packet. A bug was introduced that incorrectly preformed the comparison to detect changed rotations, this needs to handle the case when two quaternions are almost equal but have negative signs. Previously, this was preformed with an absolute value after the 4-component dot product. In commit5a0de0f103
, this absolute value was removed, causing the culling to happen much more frequently. This PR re-introduces that absolute value.
This commit is contained in:
parent
4805d3564a
commit
c0ae95f853
1 changed files with 1 additions and 1 deletions
|
@ -594,7 +594,7 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
|
|||
// The dot product for larger rotations is a lower number.
|
||||
// So if the dot() is less than the value, then the rotation is a larger angle of rotation
|
||||
if (sendAll || last.rotationIsDefaultPose || (!cullSmallChanges && last.rotation != data.rotation)
|
||||
|| (cullSmallChanges && glm::dot(last.rotation, data.rotation) < minRotationDOT) ) {
|
||||
|| (cullSmallChanges && fabsf(glm::dot(last.rotation, data.rotation)) < minRotationDOT) ) {
|
||||
validity |= (1 << validityBit);
|
||||
#ifdef WANT_DEBUG
|
||||
rotationSentCount++;
|
||||
|
|
Loading…
Reference in a new issue