Merge branch 'master' of https://github.com/worklist/hifi into fix_key_press_event

This commit is contained in:
atlante45 2013-08-02 17:17:35 -07:00
commit d765b58551
3 changed files with 23 additions and 19 deletions

View file

@ -2233,7 +2233,8 @@ void Application::update(float deltaTime) {
_myAvatar.getHead().setLookAtPosition(lookAtSpot);
} else {
// Just look in direction of the mouse ray
glm::vec3 myLookAtFromMouse(mouseRayOrigin + mouseRayDirection);
const float FAR_AWAY_STARE = TREE_SCALE;
glm::vec3 myLookAtFromMouse(mouseRayOrigin + mouseRayDirection * FAR_AWAY_STARE);
_myAvatar.getHead().setLookAtPosition(myLookAtFromMouse);
}
@ -2926,8 +2927,9 @@ void Application::displaySide(Camera& whichCamera) {
_myAvatar.getHead().setLookAtPosition(_myCamera.getPosition());
}
_myAvatar.render(_lookingInMirror->isChecked(), _renderAvatarBalls->isChecked());
_myAvatar.setDisplayingLookatVectors(_renderLookatOn->isChecked());
if (_renderLookatIndicatorOn->isChecked() && _isLookingAtOtherAvatar) {
if (_renderLookatIndicatorOn->isChecked()) {
renderLookatIndicator(_lookatOtherPosition, whichCamera);
}
}

View file

@ -465,9 +465,12 @@ void FrameGrabber::grabFrame() {
color = image;
}
const int ENCODED_FACE_WIDTH = 128;
const int ENCODED_FACE_HEIGHT = 128;
int encodedWidth;
int encodedHeight;
int depthBitrateMultiplier = 1;
float colorBitrateMultiplier = 1.0f;
float depthBitrateMultiplier = 1.0f;
Mat faceTransform;
float aspectRatio;
if (_videoSendMode == FULL_FRAME_VIDEO) {
@ -476,6 +479,7 @@ void FrameGrabber::grabFrame() {
encodedWidth = color.cols;
encodedHeight = color.rows;
aspectRatio = FULL_FRAME_ASPECT;
colorBitrateMultiplier = 4.0f;
} else {
// if we don't have a search window (yet), try using the face cascade
@ -510,11 +514,9 @@ void FrameGrabber::grabFrame() {
Rect imageBounds(0, 0, color.cols, color.rows);
_searchWindow = Rect(clip(faceBounds.tl(), imageBounds), clip(faceBounds.br(), imageBounds));
}
const int ENCODED_FACE_WIDTH = 128;
const int ENCODED_FACE_HEIGHT = 128;
encodedWidth = ENCODED_FACE_WIDTH;
encodedHeight = ENCODED_FACE_HEIGHT;
depthBitrateMultiplier = 2;
depthBitrateMultiplier = 2.0f;
// correct for 180 degree rotations
if (faceRect.angle < -90.0f) {
@ -595,7 +597,7 @@ void FrameGrabber::grabFrame() {
// initialize encoder context(s)
vpx_codec_enc_cfg_t codecConfig;
vpx_codec_enc_config_default(vpx_codec_vp8_cx(), &codecConfig, 0);
codecConfig.rc_target_bitrate = encodedWidth * encodedHeight *
codecConfig.rc_target_bitrate = ENCODED_FACE_WIDTH * ENCODED_FACE_HEIGHT * colorBitrateMultiplier *
codecConfig.rc_target_bitrate / codecConfig.g_w / codecConfig.g_h;
codecConfig.g_w = encodedWidth;
codecConfig.g_h = encodedHeight;

View file

@ -163,21 +163,21 @@ int Face::processVideoMessage(unsigned char* packetData, size_t dataBytes) {
int ybr = ysrc[image->w + 1];
ysrc += 2;
tl[0] = ytl + redOffset;
tl[1] = ytl - greenOffset;
tl[2] = ytl + blueOffset;
tl[0] = saturate_cast<uchar>(ytl + redOffset);
tl[1] = saturate_cast<uchar>(ytl - greenOffset);
tl[2] = saturate_cast<uchar>(ytl + blueOffset);
tr[0] = ytr + redOffset;
tr[1] = ytr - greenOffset;
tr[2] = ytr + blueOffset;
tr[0] = saturate_cast<uchar>(ytr + redOffset);
tr[1] = saturate_cast<uchar>(ytr - greenOffset);
tr[2] = saturate_cast<uchar>(ytr + blueOffset);
bl[0] = ybl + redOffset;
bl[1] = ybl - greenOffset;
bl[2] = ybl + blueOffset;
bl[0] = saturate_cast<uchar>(ybl + redOffset);
bl[1] = saturate_cast<uchar>(ybl - greenOffset);
bl[2] = saturate_cast<uchar>(ybl + blueOffset);
br[0] = ybr + redOffset;
br[1] = ybr - greenOffset;
br[2] = ybr + blueOffset;
br[0] = saturate_cast<uchar>(ybr + redOffset);
br[1] = saturate_cast<uchar>(ybr - greenOffset);
br[2] = saturate_cast<uchar>(ybr + blueOffset);
}
yline += image->stride[0] * 2;
vline += image->stride[1];