more cleanup

This commit is contained in:
ZappoMan 2017-01-23 16:03:07 -08:00
parent 81b5a3c585
commit 6801099cd9
4 changed files with 1 additions and 24 deletions

View file

@ -417,10 +417,6 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
if (hasJointData) {
QReadLocker readLock(&_jointDataLock);
int rotationSentCount = 0;
int translationSentCount = 0;
// joint rotation data
int numJoints = _jointData.size();
*destinationBuffer++ = (uint8_t)numJoints;
@ -440,7 +436,6 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
}
}
float minRotationDOT = !distanceAdjust ? AVATAR_MIN_ROTATION_DOT : getDistanceBasedMinRotationDOT(viewerPosition);
auto distance = glm::distance(_globalPosition, viewerPosition);
for (int i = 0; i < _jointData.size(); i++) {
const JointData& data = _jointData[i];

View file

@ -180,9 +180,7 @@ namespace AvatarDataPacket {
const size_t LOOK_AT_POSITION_SIZE = 12;
PACKED_BEGIN struct AudioLoudness {
uint8_t audioLoudness; // current loudness of microphone, clamped to MAX_AUDIO_LOUDNESS and
// scaled by AUDIO_LOUDNESS_SCALE typical values 0 to 255 or once
// rescaled 0.0 to 1000.0
uint8_t audioLoudness; // current loudness of microphone compressed with packFloatGainToByte()
} PACKED_END;
const size_t AUDIO_LOUDNESS_SIZE = 1;

View file

@ -81,18 +81,6 @@ int unpackFloatScalarFromSignedTwoByteFixed(const int16_t* byteFixedPointer, flo
return sizeof(int16_t);
}
// Allows sending of fixed-point numbers: radix 1 makes 15.1 number, radix 8 makes 8.8 number, etc
int packFloatScalarToSignedOneByteFixed(unsigned char* buffer, float scalar, int radix) {
uint8_t outVal = (uint8_t)(scalar * (float)(1 << radix));
memcpy(buffer, &outVal, sizeof(uint8_t));
return sizeof(outVal);
}
int unpackFloatScalarFromSignedOneByteFixed(const uint8_t* byteFixedPointer, float* destinationPointer, int radix) {
*destinationPointer = *byteFixedPointer / (float)(1 << radix);
return sizeof(uint8_t);
}
int packFloatVec3ToSignedTwoByteFixed(unsigned char* destBuffer, const glm::vec3& srcVector, int radix) {
const unsigned char* startPosition = destBuffer;
destBuffer += packFloatScalarToSignedTwoByteFixed(destBuffer, srcVector.x, radix);

View file

@ -125,10 +125,6 @@ int unpackFloatFromByte(const unsigned char* buffer, float& value, float scaleBy
int packFloatScalarToSignedTwoByteFixed(unsigned char* buffer, float scalar, int radix);
int unpackFloatScalarFromSignedTwoByteFixed(const int16_t* byteFixedPointer, float* destinationPointer, int radix);
// Allows sending of fixed-point numbers: radix 1 makes 7.1 number, radix 4 makes 4.4 number, etc
int unpackFloatScalarFromSignedOneByteFixed(const uint8_t* byteFixedPointer, float* destinationPointer, int radix);
int packFloatScalarToSignedOneByteFixed(unsigned char* buffer, float scalar, int radix);
// A convenience for sending vec3's as fixed-point floats
int packFloatVec3ToSignedTwoByteFixed(unsigned char* destBuffer, const glm::vec3& srcVector, int radix);
int unpackFloatVec3FromSignedTwoByteFixed(const unsigned char* sourceBuffer, glm::vec3& destination, int radix);