mirror of
https://github.com/overte-org/overte.git
synced 2025-04-24 12:13:36 +02:00
Other people's avatar's look where they are mousing
This commit is contained in:
parent
e32f9f387a
commit
687966c486
2 changed files with 5 additions and 13 deletions
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue