mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 15:59:49 +02:00
Merge pull request #768 from ZappoMan/bug_fixes
added back getUprightEyeLevelPosition() - stabilizes view
This commit is contained in:
commit
a6c2683b1a
3 changed files with 8 additions and 1 deletions
|
@ -406,7 +406,7 @@ void Application::paintGL() {
|
||||||
|
|
||||||
} else if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) {
|
} else if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) {
|
||||||
_myCamera.setTightness(0.0f); // In first person, camera follows head exactly without delay
|
_myCamera.setTightness(0.0f); // In first person, camera follows head exactly without delay
|
||||||
_myCamera.setTargetPosition(_myAvatar.getEyePosition());
|
_myCamera.setTargetPosition(_myAvatar.getUprightEyeLevelPosition());
|
||||||
_myCamera.setTargetRotation(_myAvatar.getHead().getCameraOrientation());
|
_myCamera.setTargetRotation(_myAvatar.getHead().getCameraOrientation());
|
||||||
|
|
||||||
} else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
|
} else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
|
||||||
|
|
|
@ -368,6 +368,12 @@ glm::vec3 Avatar::getUprightHeadPosition() const {
|
||||||
return _position + getWorldAlignedOrientation() * glm::vec3(0.0f, _pelvisToHeadLength, 0.0f);
|
return _position + getWorldAlignedOrientation() * glm::vec3(0.0f, _pelvisToHeadLength, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glm::vec3 Avatar::getUprightEyeLevelPosition() 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);
|
||||||
|
}
|
||||||
|
|
||||||
glm::vec3 Avatar::getEyePosition() {
|
glm::vec3 Avatar::getEyePosition() {
|
||||||
const float EYE_UP_OFFSET = 0.36f;
|
const float EYE_UP_OFFSET = 0.36f;
|
||||||
const float EYE_FRONT_OFFSET = 0.8f;
|
const float EYE_FRONT_OFFSET = 0.8f;
|
||||||
|
|
|
@ -170,6 +170,7 @@ public:
|
||||||
glm::vec3 getGravity () const { return _gravity; }
|
glm::vec3 getGravity () const { return _gravity; }
|
||||||
|
|
||||||
glm::vec3 getUprightHeadPosition() const;
|
glm::vec3 getUprightHeadPosition() const;
|
||||||
|
glm::vec3 getUprightEyeLevelPosition() const;
|
||||||
glm::vec3 getEyePosition();
|
glm::vec3 getEyePosition();
|
||||||
|
|
||||||
AvatarVoxelSystem* getVoxels() { return &_voxels; }
|
AvatarVoxelSystem* getVoxels() { return &_voxels; }
|
||||||
|
|
Loading…
Reference in a new issue