mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-10 10:34:56 +02:00
removed stray comments
This commit is contained in:
parent
6a11ddc349
commit
97831e61f0
4 changed files with 20 additions and 20 deletions
|
@ -57,6 +57,7 @@ void MyHead::simulate(float deltaTime) {
|
|||
|
||||
auto eyeTracker = DependencyManager::get<EyeTracker>();
|
||||
_isEyeTrackerConnected = eyeTracker->isTracking();
|
||||
// if eye tracker is connected we should get the data here.
|
||||
}
|
||||
Parent::simulate(deltaTime);
|
||||
}
|
||||
|
|
|
@ -93,7 +93,6 @@ void Head::simulate(float deltaTime) {
|
|||
const float FULLY_OPEN = 0.0f;
|
||||
const float FULLY_CLOSED = 1.0f;
|
||||
if (getHasProceduralBlinkFaceMovement()) {
|
||||
//qCDebug(avatars_renderer) << "in the blink code " << _owningAvatar->getName();
|
||||
// Detect transition from talking to not; force blink after that and a delay
|
||||
bool forceBlink = false;
|
||||
const float TALKING_LOUDNESS = 100.0f;
|
||||
|
@ -143,7 +142,6 @@ void Head::simulate(float deltaTime) {
|
|||
|
||||
// use data to update fake Faceshift blendshape coefficients
|
||||
if (getHasAudioEnabledFaceMovement()) {
|
||||
//qCDebug(avatars_renderer) << "in the audio face code";
|
||||
// Update audio attack data for facial animation (eyebrows and mouth)
|
||||
float audioAttackAveragingRate = (10.0f - deltaTime * NORMAL_HZ) / 10.0f; // --> 0.9 at 60 Hz
|
||||
_audioAttack = audioAttackAveragingRate * _audioAttack +
|
||||
|
@ -175,7 +173,6 @@ void Head::simulate(float deltaTime) {
|
|||
_transientBlendshapeCoefficients);
|
||||
|
||||
if (getHasProceduralEyeFaceMovement()) {
|
||||
//qCDebug(avatars_renderer) << "in the eye face code";
|
||||
applyEyelidOffset(getOrientation());
|
||||
}
|
||||
|
||||
|
|
|
@ -522,17 +522,14 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
|
|||
auto faceTrackerInfo = reinterpret_cast<AvatarDataPacket::FaceTrackerInfo*>(destinationBuffer);
|
||||
const auto& blendshapeCoefficients = _headData->getBlendshapeCoefficients();
|
||||
|
||||
//for (int i = 0; i < blendshapeCoefficients.size(); i++) {
|
||||
// qCWarning(avatars) << "blend coeff " << i << " " << blendshapeCoefficients[i];
|
||||
//}
|
||||
|
||||
//note: we don't use the blink and average loudness, we just use the numBlendShapes and
|
||||
// compute the procedural info on the client side.
|
||||
faceTrackerInfo->leftEyeBlink = _headData->_leftEyeBlink;
|
||||
faceTrackerInfo->rightEyeBlink = _headData->_rightEyeBlink;
|
||||
faceTrackerInfo->averageLoudness = _headData->_averageLoudness;
|
||||
faceTrackerInfo->browAudioLift = _headData->_browAudioLift;
|
||||
faceTrackerInfo->numBlendshapeCoefficients = blendshapeCoefficients.size();
|
||||
destinationBuffer += sizeof(AvatarDataPacket::FaceTrackerInfo);
|
||||
//qCWarning(avatars) << "face tracker info left eye blink " << faceTrackerInfo->leftEyeBlink;
|
||||
|
||||
memcpy(destinationBuffer, blendshapeCoefficients.data(), blendshapeCoefficients.size() * sizeof(float));
|
||||
destinationBuffer += blendshapeCoefficients.size() * sizeof(float);
|
||||
|
@ -999,7 +996,7 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
|||
// hand state, stored as a semi-nibble plus a bit in the bitItems
|
||||
// we store the hand state as well as other items in a shared bitset. The hand state is an octal, but is split
|
||||
// into two sections to maintain backward compatibility. The bits are ordered as such (0-7 left to right).
|
||||
// AA 6/1/18 added three more flags here for procedural audio, blink, and eye saccade enabled
|
||||
// AA 6/1/18 added three more flags bits 8,9, and 10 for procedural audio, blink, and eye saccade enabled
|
||||
// +---+-----+-----+--+--+--+--+-----+
|
||||
// |x,x|H0,H1|x,x,x|H2|Au|Bl|Ey|xxxxx|
|
||||
// +---+-----+-----+--+--+--+--+-----+
|
||||
|
@ -1124,25 +1121,23 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
|||
}
|
||||
|
||||
if (hasFaceTrackerInfo) {
|
||||
//qCWarning(avatars) << "parsing face tracker info ";
|
||||
auto startSection = sourceBuffer;
|
||||
|
||||
PACKET_READ_CHECK(FaceTrackerInfo, sizeof(AvatarDataPacket::FaceTrackerInfo));
|
||||
auto faceTrackerInfo = reinterpret_cast<const AvatarDataPacket::FaceTrackerInfo*>(sourceBuffer);
|
||||
sourceBuffer += sizeof(AvatarDataPacket::FaceTrackerInfo);
|
||||
//qCWarning(avatars) << "parse data left eye blink " << faceTrackerInfo->leftEyeBlink;
|
||||
|
||||
//_headData->_leftEyeBlink = faceTrackerInfo->leftEyeBlink;
|
||||
//_headData->_rightEyeBlink = faceTrackerInfo->rightEyeBlink;
|
||||
//_headData->_averageLoudness = faceTrackerInfo->averageLoudness;
|
||||
//_headData->_browAudioLift = faceTrackerInfo->browAudioLift;
|
||||
|
||||
int numCoefficients = faceTrackerInfo->numBlendshapeCoefficients;
|
||||
const int coefficientsSize = sizeof(float) * numCoefficients;
|
||||
sourceBuffer += sizeof(AvatarDataPacket::FaceTrackerInfo);
|
||||
|
||||
PACKET_READ_CHECK(FaceTrackerCoefficients, coefficientsSize);
|
||||
_headData->_blendshapeCoefficients.resize(numCoefficients); // make sure there's room for the copy!
|
||||
_headData->_transientBlendshapeCoefficients.resize(numCoefficients);
|
||||
|
||||
//only copy the blendshapes to headData not the procedural face info
|
||||
memcpy(_headData->_blendshapeCoefficients.data(), sourceBuffer, coefficientsSize);
|
||||
sourceBuffer += coefficientsSize;
|
||||
|
||||
int numBytesRead = sourceBuffer - startSection;
|
||||
_faceTrackerRate.increment(numBytesRead);
|
||||
_faceTrackerUpdateRate.increment();
|
||||
|
|
|
@ -79,14 +79,21 @@ const quint32 AVATAR_MOTION_SCRIPTABLE_BITS =
|
|||
// Bitset of state flags - we store the key state, hand state, Faceshift, eye tracking, and existence of
|
||||
// referential data in this bit set. The hand state is an octal, but is split into two sections to maintain
|
||||
// backward compatibility. The bits are ordered as such (0-7 left to right).
|
||||
// +-----+-----+-+-+-+--+
|
||||
// |K0,K1|H0,H1|F|E|R|H2|
|
||||
// +-----+-----+-+-+-+--+
|
||||
// AA 6/1/18 added three more flags bits 8,9, and 10 for procedural audio, blink, and eye saccade enabled
|
||||
//
|
||||
// +-----+-----+-+-+-+--+--+--+--+-----+
|
||||
// |K0,K1|H0,H1|F|E|R|H2|Au|Bl|Ey|xxxxx|
|
||||
// +-----+-----+-+-+-+--+--+--+--+-----+
|
||||
//
|
||||
// Key state - K0,K1 is found in the 1st and 2nd bits
|
||||
// Hand state - H0,H1,H2 is found in the 3rd, 4th, and 8th bits
|
||||
// Face tracker - F is found in the 5th bit
|
||||
// Eye tracker - E is found in the 6th bit
|
||||
// Referential Data - R is found in the 7th bit
|
||||
// Procedural audio to mouth movement is enabled 8th bit
|
||||
// Procedural Blink is enabled 9th bit
|
||||
// Procedural Eyelid is enabled 10th bit
|
||||
|
||||
const int KEY_STATE_START_BIT = 0; // 1st and 2nd bits
|
||||
const int HAND_STATE_START_BIT = 2; // 3rd and 4th bits
|
||||
const int IS_FACE_TRACKER_CONNECTED = 4; // 5th bit
|
||||
|
|
Loading…
Reference in a new issue