From 9a4a0e2819a595fe97f6f1e1ac43d440284dbd7c Mon Sep 17 00:00:00 2001 From: Eric Johnston Date: Tue, 6 Aug 2013 12:44:29 -0700 Subject: [PATCH] Rave glove adjustments per Ryan's requests: hide fingers and arms when raving, center hands in front of face. --- interface/src/avatar/Avatar.cpp | 11 +++++++++++ interface/src/avatar/Hand.cpp | 10 ++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 0b6484c8a7..747f9dff93 100755 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -1373,6 +1373,17 @@ void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) { for (int b = 0; b < NUM_AVATAR_BODY_BALLS; b++) { float alpha = getBallRenderAlpha(b, lookingInMirror); + // When in rave glove mode, don't show the arms at all. + if (_hand.isRaveGloveActive()) { + if (b == BODY_BALL_LEFT_ELBOW + || b == BODY_BALL_LEFT_WRIST + || b == BODY_BALL_LEFT_FINGERTIPS + || b == BODY_BALL_RIGHT_ELBOW + || b == BODY_BALL_RIGHT_WRIST + || b == BODY_BALL_RIGHT_FINGERTIPS) { + continue; + } + } // 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) { diff --git a/interface/src/avatar/Hand.cpp b/interface/src/avatar/Hand.cpp index 43b7bfc2e3..b960f8e56b 100755 --- a/interface/src/avatar/Hand.cpp +++ b/interface/src/avatar/Hand.cpp @@ -64,10 +64,10 @@ void Hand::simulate(float deltaTime, bool isMine) { } void Hand::calculateGeometry() { - glm::vec3 offset(0.2, -0.2, -0.3); // place the hand in front of the face where we can see it + const glm::vec3 leapHandsOffsetFromFace(0.0, -0.2, -0.3); // place the hand in front of the face where we can see it Head& head = _owningAvatar->getHead(); - _basePosition = head.getPosition() + head.getOrientation() * offset; + _basePosition = head.getPosition() + head.getOrientation() * leapHandsOffsetFromFace; _baseOrientation = head.getOrientation(); // generate finger tip balls.... @@ -154,8 +154,10 @@ void Hand::render(bool lookingInMirror) { if ( SHOW_LEAP_HAND ) { //renderLeapHands(); - renderLeapFingerTrails(); - renderLeapHandSpheres(); + if (!isRaveGloveActive()) { + renderLeapFingerTrails(); + renderLeapHandSpheres(); + } } }