mirror of
https://github.com/overte-org/overte.git
synced 2025-08-13 05:56:56 +02:00
Let's use the "eye level" position.
This commit is contained in:
parent
0881cd4c92
commit
052c8246fa
3 changed files with 5 additions and 4 deletions
|
@ -353,7 +353,7 @@ void Application::paintGL() {
|
|||
|
||||
} else if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) {
|
||||
_myCamera.setTightness(0.0f); // In first person, camera follows head exactly without delay
|
||||
_myCamera.setTargetPosition(_myAvatar.getHeadJointPosition());
|
||||
_myCamera.setTargetPosition(_myAvatar.getEyeLevelPosition());
|
||||
_myCamera.setTargetRotation(_myAvatar.getHead().getCameraOrientation());
|
||||
|
||||
} else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
|
||||
|
|
|
@ -577,10 +577,11 @@ glm::vec3 MyAvatar::getUprightHeadPosition() const {
|
|||
return _position + getWorldAlignedOrientation() * glm::vec3(0.0f, _pelvisToHeadLength, 0.0f);
|
||||
}
|
||||
|
||||
glm::vec3 MyAvatar::getUprightEyeLevelPosition() const {
|
||||
glm::vec3 MyAvatar::getEyeLevelPosition() const {
|
||||
const float EYE_UP_OFFSET = 0.36f;
|
||||
glm::vec3 up = getWorldAlignedOrientation() * IDENTITY_UP;
|
||||
return _position + up * _scale * BODY_BALL_RADIUS_HEAD_BASE * EYE_UP_OFFSET + glm::vec3(0.0f, _pelvisToHeadLength, 0.0f);
|
||||
return _position + _skeleton.joint[AVATAR_JOINT_TORSO].rotation *
|
||||
(up * _scale * BODY_BALL_RADIUS_HEAD_BASE * EYE_UP_OFFSET + glm::vec3(0.0f, _pelvisToHeadLength, 0.0f));
|
||||
}
|
||||
|
||||
float MyAvatar::getBallRenderAlpha(int ball, bool lookingInMirror) const {
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
Avatar* getLeadingAvatar() const { return _leadingAvatar; }
|
||||
glm::vec3 getGravity() const { return _gravity; }
|
||||
glm::vec3 getUprightHeadPosition() const;
|
||||
glm::vec3 getUprightEyeLevelPosition() const;
|
||||
glm::vec3 getEyeLevelPosition() const;
|
||||
|
||||
// get/set avatar data
|
||||
void saveData(QSettings* settings);
|
||||
|
|
Loading…
Reference in a new issue