History

Merge branch 'master' of https://github.com/worklist/hifi

atlante45 committed 13 years ago

Commit 55e34552 parents 29062c5 7021d3c11 files · +273 −163Browse files

Showing the changes to interface/src/Application.cpp (1 of 11 files). Show all

Unified · Split

interface/src/Application.cpp+14−1
@@ -2254,7 +2254,7 @@ Avatar* Application::isLookingAtOtherAvatar(glm::vec3& mouseRayOrigin, glm::vec3 · 2253 unmodified lines
22542254 if (node->getLinkedData() != NULL && node->getType() == NODE_TYPE_AGENT) {
22552255 Avatar* avatar = (Avatar *) node->getLinkedData();
22562256 glm::vec3 headPosition = avatar->getHead().getPosition();
2257− if (rayIntersectsSphere(mouseRayOrigin, mouseRayDirection, headPosition, HEAD_SPHERE_RADIUS)) {
2257+ if (rayIntersectsSphere(mouseRayOrigin, mouseRayDirection, headPosition, HEAD_SPHERE_RADIUS * avatar->getScale())) {
22582258 eyePosition = avatar->getHead().getEyePosition();
22592259 _lookatIndicatorScale = avatar->getScale();
22602260 _lookatOtherPosition = headPosition;
@@ -2266,6 +2266,16 @@ Avatar* Application::isLookingAtOtherAvatar(glm::vec3& mouseRayOrigin, glm::vec3 · 5 unmodified lines
22662266 return NULL;
22672267 }
22682268
2269+bool Application::isLookingAtMyAvatar(Avatar* avatar) {
2270+ glm::vec3 theirLookat = avatar->getHead().getLookAtPosition();
2271+ glm::vec3 myHeadPosition = _myAvatar.getHead().getPosition();
2272+
2273+ if (pointInSphere(theirLookat, myHeadPosition, HEAD_SPHERE_RADIUS * _myAvatar.getScale())) {
2274+ return true;
2275+ }
2276+ return false;
2277+}
2278+
22692279 void Application::renderLookatIndicator(glm::vec3 pointOfInterest, Camera& whichCamera) {
22702280
22712281 const float DISTANCE_FROM_HEAD_SPHERE = 0.1f * _lookatIndicatorScale;
@@ -3015,6 +3025,9 @@ void Application::displaySide(Camera& whichCamera) { · 743 unmodified lines
30153025 if (!avatar->isInitialized()) {
30163026 avatar->init();
30173027 }
3028+ if (isLookingAtMyAvatar(avatar)) {
3029+ avatar->getHead().setLookAtPosition(_myCamera.getPosition());
3030+ }
30183031 avatar->render(false, _renderAvatarBalls->isChecked());
30193032 avatar->setDisplayingLookatVectors(_renderLookatOn->isChecked());
30203033 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t