mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-04 18:10:10 +02:00
Changed 1P view to turn off head rendering when close/inside head rather than showing disembodied neck
This commit is contained in:
parent
3539ec858e
commit
340882a330
1 changed files with 5 additions and 1 deletions
|
@ -316,6 +316,10 @@ void Application::paintGL() {
|
|||
0.0f,
|
||||
//-_myAvatar.getAbsoluteHeadPitch(),
|
||||
0.0f);
|
||||
// Take a look at whether we are inside head, don't render it if so.
|
||||
const float HEAD_RENDER_DISTANCE = 0.5;
|
||||
glm::vec3 distanceToHead(_myCamera.getPosition() - _myAvatar.getSpringyHeadPosition());
|
||||
if (glm::length(distanceToHead) < HEAD_RENDER_DISTANCE) { _myAvatar.setDisplayingHead(false); }
|
||||
|
||||
} else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
|
||||
_myCamera.setTargetPosition(_myAvatar.getHeadPosition());
|
||||
|
@ -1052,7 +1056,7 @@ void Application::setRenderFirstPerson(bool firstPerson) {
|
|||
a.distance = 0.0f;
|
||||
a.tightness = 100.0f;
|
||||
_myCamera.setMode(CAMERA_MODE_FIRST_PERSON, a);
|
||||
_myAvatar.setDisplayingHead(false);
|
||||
_myAvatar.setDisplayingHead(true);
|
||||
|
||||
} else {
|
||||
Camera::CameraFollowingAttributes a;
|
||||
|
|
Loading…
Reference in a new issue