Only render the Perlin face for the local user.

This commit is contained in:
Andrzej Kapolka 2013-09-17 10:51:33 -07:00
parent a4f79390f4
commit 262365f15f
4 changed files with 7 additions and 7 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 // 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 (b == BODY_BALL_HEAD_BASE) { // the head is rendered as a special
if (alpha > 0.0f) { if (alpha > 0.0f) {
_head.render(alpha); _head.render(alpha, false);
} }
} else if (alpha > 0.0f) { } else if (alpha > 0.0f) {
// Render the body ball sphere // Render the body ball sphere
@ -767,7 +767,7 @@ void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, lookingInMirror); float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, lookingInMirror);
if (alpha > 0.0f) { if (alpha > 0.0f) {
_voxels.render(false); _voxels.render(false);
_head.render(alpha); _head.render(alpha, false);
} }
} }
_hand.render(lookingInMirror); _hand.render(lookingInMirror);

View file

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

View file

@ -43,7 +43,7 @@ public:
void init(); void init();
void reset(); void reset();
void simulate(float deltaTime, bool isMine, float gyroCameraSensitivity); void simulate(float deltaTime, bool isMine, float gyroCameraSensitivity);
void render(float alpha); void render(float alpha, bool isMine);
void renderMohawk(); void renderMohawk();
void setScale(float scale); 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 // 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 (b == BODY_BALL_HEAD_BASE) { // the head is rendered as a special
if (alpha > 0.0f) { if (alpha > 0.0f) {
_head.render(alpha); _head.render(alpha, true);
} }
} else if (alpha > 0.0f) { } else if (alpha > 0.0f) {
// Render the body ball sphere // Render the body ball sphere
@ -614,7 +614,7 @@ void MyAvatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, lookingInMirror); float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, lookingInMirror);
if (alpha > 0.0f) { if (alpha > 0.0f) {
_voxels.render(false); _voxels.render(false);
_head.render(alpha); _head.render(alpha, true);
} }
} }
_hand.render(lookingInMirror); _hand.render(lookingInMirror);