From d4bad3421fb9fc2d1b92f3e73a54ab5bcb3b1729 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Mon, 16 Dec 2013 21:49:15 -0800 Subject: [PATCH] fix: get velocity from either hand or fingertip according to where ball is thrown from --- interface/src/avatar/Hand.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/src/avatar/Hand.cpp b/interface/src/avatar/Hand.cpp index c78b6271a4..fea593a653 100755 --- a/interface/src/avatar/Hand.cpp +++ b/interface/src/avatar/Hand.cpp @@ -143,6 +143,7 @@ void Hand::simulateToyBall(PalmData& palm, const glm::vec3& fingerTipPosition, f // create the ball, call MakeParticle, and use the resulting ParticleEditHandle to // manage the newly created particle. // Create a particle on the particle server + qDebug("Created New Ball\n"); glm::vec3 ballPosition = ballFromHand ? palm.getPosition() : fingerTipPosition; _ballParticleEditHandles[handID] = Application::getInstance()->makeParticle( ballPosition / (float)TREE_SCALE, @@ -172,16 +173,15 @@ void Hand::simulateToyBall(PalmData& palm, const glm::vec3& fingerTipPosition, f _toyBallInHand[handID] = false; glm::vec3 ballPosition = ballFromHand ? palm.getPosition() : fingerTipPosition; - glm::vec3 handVelocity = palm.getRawVelocity(); - glm::vec3 fingerTipVelocity = palm.getTipVelocity(); + glm::vec3 ballVelocity = ballFromHand ? palm.getRawVelocity() : palm.getTipVelocity(); glm::quat avatarRotation = _owningAvatar->getOrientation(); - glm::vec3 toyBallVelocity = avatarRotation * fingerTipVelocity; + ballVelocity = avatarRotation * ballVelocity; // ball is no longer in hand... _ballParticleEditHandles[handID]->updateParticle(ballPosition / (float)TREE_SCALE, TOY_BALL_RADIUS / (float) TREE_SCALE, TOY_BALL_ON_SERVER_COLOR[_whichBallColor[handID]], - toyBallVelocity / (float)TREE_SCALE, + ballVelocity / (float)TREE_SCALE, TOY_BALL_GRAVITY / (float) TREE_SCALE, TOY_BALL_DAMPING, NOT_IN_HAND,