Other people's avatar's look where they are mousing

This commit is contained in:
Philip Rosedale 2013-06-13 14:04:51 -07:00
parent e32f9f387a
commit 687966c486
2 changed files with 5 additions and 13 deletions

View file

@ -1449,6 +1449,10 @@ void Application::update(float deltaTime) {
// tell my avatar the posiion and direction of the ray projected ino the world based on the mouse position
_myAvatar.setMouseRay(mouseRayOrigin, mouseRayDirection);
// Set where I am looking based on my mouse ray (so that other people can see)
glm::vec3 myLookAtFromMouse(mouseRayOrigin - mouseRayDirection);
_myAvatar.getHead().setLookAtPosition(myLookAtFromMouse);
// If we are dragging on a voxel, add thrust according to the amount the mouse is dragging
const float VOXEL_GRAB_THRUST = 5.0f;
@ -2045,9 +2049,7 @@ void Application::displaySide(Camera& whichCamera) {
// Render my own Avatar
if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
_myAvatar.getHead().setLookAtPosition(_myCamera.getPosition());
} else {
_myAvatar.getHead().setLookAtPosition(glm::vec3(0.0f, 0.0f, 0.0f));
}
}
_myAvatar.render(_lookingInMirror->isChecked(), _renderAvatarBalls->isChecked());
_myAvatar.setDisplayingLookatVectors(_renderLookatOn->isChecked());
}

View file

@ -615,16 +615,6 @@ void Avatar::simulate(float deltaTime, Transmitter* transmitter) {
}
}
// set head lookat position
/*
if (!_owningAgent) {
if (_interactingOther) {
_head.setLookAtPosition(_interactingOther->calculateAverageEyePosition());
} else {
_head.setLookAtPosition(glm::vec3(0.0f, 0.0f, 0.0f)); // 0,0,0 represents NOT looking at anything
}
}*/
_head.setBodyRotation (glm::vec3(_bodyPitch, _bodyYaw, _bodyRoll));
_head.setPosition(_bodyBall[ BODY_BALL_HEAD_BASE ].position);
_head.setScale (_bodyBall[ BODY_BALL_HEAD_BASE ].radius);