Merge pull request #945 from ey6es/master

Initialization order fix, only render Perlin face for local user.
This commit is contained in:
Andrzej Kapolka 2013-09-17 11:00:07 -07:00
commit 00506b1a84
5 changed files with 12 additions and 12 deletions

View file

@ -723,7 +723,7 @@ void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
// Always render other people, and render myself when beyond threshold distance
if (b == BODY_BALL_HEAD_BASE) { // the head is rendered as a special
if (alpha > 0.0f) {
_head.render(alpha);
_head.render(alpha, false);
}
} else if (alpha > 0.0f) {
// Render the body ball sphere
@ -767,7 +767,7 @@ void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, lookingInMirror);
if (alpha > 0.0f) {
_voxels.render(false);
_head.render(alpha);
_head.render(alpha, false);
}
}
_hand.render(lookingInMirror);

View file

@ -322,7 +322,7 @@ void Head::calculateGeometry() {
+ up * _scale * NOSE_UPTURN;
}
void Head::render(float alpha) {
void Head::render(float alpha, bool isMine) {
_renderAlpha = alpha;
if (!_face.render(alpha)) {
@ -331,7 +331,7 @@ void Head::render(float alpha) {
glEnable(GL_DEPTH_TEST);
glEnable(GL_RESCALE_NORMAL);
if (Menu::getInstance()->isOptionChecked(MenuOption::UsePerlinFace)) {
if (Menu::getInstance()->isOptionChecked(MenuOption::UsePerlinFace) && isMine) {
_perlinFace.render();
} else {
renderMohawk();

View file

@ -43,7 +43,7 @@ public:
void init();
void reset();
void simulate(float deltaTime, bool isMine, float gyroCameraSensitivity);
void render(float alpha);
void render(float alpha, bool isMine);
void renderMohawk();
void setScale(float scale);

View file

@ -557,7 +557,7 @@ void MyAvatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
// Always render other people, and render myself when beyond threshold distance
if (b == BODY_BALL_HEAD_BASE) { // the head is rendered as a special
if (alpha > 0.0f) {
_head.render(alpha);
_head.render(alpha, true);
}
} else if (alpha > 0.0f) {
// Render the body ball sphere
@ -614,7 +614,7 @@ void MyAvatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, lookingInMirror);
if (alpha > 0.0f) {
_voxels.render(false);
_head.render(alpha);
_head.render(alpha, true);
}
}
_hand.render(lookingInMirror);

View file

@ -28,6 +28,10 @@ Faceshift::Faceshift() :
_rightBlink(0.0f),
_leftEyeOpen(0.0f),
_rightEyeOpen(0.0f),
_leftBlinkIndex(0), // see http://support.faceshift.com/support/articles/35129-export-of-blendshapes
_rightBlinkIndex(1),
_leftEyeOpenIndex(8),
_rightEyeOpenIndex(9),
_browDownLeft(0.0f),
_browDownRight(0.0f),
_browUpCenter(0.0f),
@ -35,6 +39,7 @@ Faceshift::Faceshift() :
_browUpRight(0.0f),
_browDownLeftIndex(-1),
_browDownRightIndex(-1),
_browUpCenterIndex(16),
_browUpLeftIndex(-1),
_browUpRightIndex(-1),
_mouthSize(0.0f),
@ -42,11 +47,6 @@ Faceshift::Faceshift() :
_mouthSmileRight(0),
_mouthSmileLeftIndex(-1),
_mouthSmileRightIndex(0),
_leftBlinkIndex(0), // see http://support.faceshift.com/support/articles/35129-export-of-blendshapes
_rightBlinkIndex(1),
_leftEyeOpenIndex(8),
_rightEyeOpenIndex(9),
_browUpCenterIndex(16),
_jawOpenIndex(21),
_longTermAverageEyePitch(0.0f),
_longTermAverageEyeYaw(0.0f),