diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 3f64436ff3..57a754cae1 100755 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -57,7 +57,6 @@ const float HEAD_RATE_MAX = 50.f; const float SKIN_COLOR[] = {1.0, 0.84, 0.66}; const float DARK_SKIN_COLOR[] = {0.9, 0.78, 0.63}; const int NUM_BODY_CONE_SIDES = 9; -const bool usingBigSphereCollisionTest = true; const float chatMessageScale = 0.0015; const float chatMessageHeight = 0.20; @@ -88,8 +87,6 @@ Avatar::Avatar(Node* owningNode) : _head(this), _hand(this), _ballSpringsInitialized(false), - _TEST_bigSphereRadius(0.5f), - _TEST_bigSpherePosition(5.0f, _TEST_bigSphereRadius, 5.0f), _bodyYawDelta(0.0f), _movedHandOffset(0.0f, 0.0f, 0.0f), _mode(AVATAR_MODE_STANDING), @@ -365,12 +362,6 @@ void Avatar::simulate(float deltaTime, Transmitter* transmitter, float gyroCamer // update body balls updateBodyBalls(deltaTime); - - // test for avatar collision response with the big sphere - if (usingBigSphereCollisionTest && _isCollisionsOn) { - updateCollisionWithSphere(_TEST_bigSpherePosition, _TEST_bigSphereRadius, deltaTime); - } - //apply the head lean values to the ball positions... if (USING_HEAD_LEAN) { if (fabs(_head.getLeanSideways() + _head.getLeanForward()) > 0.0f) { @@ -449,32 +440,6 @@ void Avatar::updateHandMovementAndTouching(float deltaTime, bool enableHandMovem } } -void Avatar::updateCollisionWithSphere(glm::vec3 position, float radius, float deltaTime) { - float myBodyApproximateBoundingRadius = 1.0f; - glm::vec3 vectorFromMyBodyToBigSphere(_position - position); - - float distanceToBigSphere = glm::length(vectorFromMyBodyToBigSphere); - if (distanceToBigSphere < myBodyApproximateBoundingRadius + radius) { - for (int b = 0; b < NUM_AVATAR_BODY_BALLS; b++) { - glm::vec3 vectorFromBallToBigSphereCenter(_bodyBall[b].position - position); - float distanceToBigSphereCenter = glm::length(vectorFromBallToBigSphereCenter); - float combinedRadius = _bodyBall[b].radius + radius; - - if (distanceToBigSphereCenter < combinedRadius) { - if (distanceToBigSphereCenter > 0.0) { - glm::vec3 directionVector = vectorFromBallToBigSphereCenter / distanceToBigSphereCenter; - - float penetration = 1.0 - (distanceToBigSphereCenter / combinedRadius); - glm::vec3 collisionForce = vectorFromBallToBigSphereCenter * penetration; - - _velocity += collisionForce * 40.0f * deltaTime; - _bodyBall[b].position = position + directionVector * combinedRadius; - } - } - } - } -} - static TextRenderer* textRenderer() { static TextRenderer* renderer = new TextRenderer(SANS_FONT_FAMILY, 24, -1, false, TextRenderer::SHADOW_EFFECT); return renderer; diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index 9108a0f515..1dd316f160 100755 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -203,8 +203,6 @@ protected: Hand _hand; Skeleton _skeleton; bool _ballSpringsInitialized; - float _TEST_bigSphereRadius; - glm::vec3 _TEST_bigSpherePosition; float _bodyYawDelta; glm::vec3 _movedHandOffset; AvatarBall _bodyBall[ NUM_AVATAR_BODY_BALLS ]; @@ -234,7 +232,6 @@ protected: glm::vec3 getBodyUpDirection() const { return getOrientation() * IDENTITY_UP; } glm::vec3 getBodyFrontDirection() const { return getOrientation() * IDENTITY_FRONT; } glm::quat computeRotationFromBodyToWorldUp(float proportion = 1.0f) const; - void updateCollisionWithSphere(glm::vec3 position, float radius, float deltaTime); void updateBodyBalls(float deltaTime); void updateArmIKAndConstraints(float deltaTime); void setScale(const float scale); diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index beb56ec708..342a9945ef 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -193,11 +193,6 @@ void MyAvatar::simulate(float deltaTime, Transmitter* transmitter, float gyroCam // update body balls updateBodyBalls(deltaTime); - - // test for avatar collision response with the big sphere - if (usingBigSphereCollisionTest && _isCollisionsOn) { - updateCollisionWithSphere(_TEST_bigSpherePosition, _TEST_bigSphereRadius, deltaTime); - } // add thrust to velocity _velocity += _thrust * deltaTime; @@ -421,16 +416,6 @@ static TextRenderer* textRenderer() { } void MyAvatar::render(bool lookingInMirror, bool renderAvatarBalls) { - - if (usingBigSphereCollisionTest) { - // show TEST big sphere - glColor4f(0.5f, 0.6f, 0.8f, 0.7); - glPushMatrix(); - glTranslatef(_TEST_bigSpherePosition.x, _TEST_bigSpherePosition.y, _TEST_bigSpherePosition.z); - glScalef(_TEST_bigSphereRadius, _TEST_bigSphereRadius, _TEST_bigSphereRadius); - glutSolidSphere(1, 20, 20); - glPopMatrix(); - } if (Application::getInstance()->getAvatar()->getHand().isRaveGloveActive()) { _hand.setRaveLights(RAVE_LIGHTS_AVATAR);