mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 18:44:00 +02:00
Calculate head height based on skeleton model mesh if no head model
This fixes the problem of some skeleton models with heads having display names rendering through them.
This commit is contained in:
parent
08c95555dd
commit
913527eaa3
1 changed files with 4 additions and 3 deletions
|
@ -1017,10 +1017,11 @@ float Avatar::getHeadHeight() const {
|
|||
if (!extents.isEmpty()) {
|
||||
return extents.maximum.y - extents.minimum.y;
|
||||
}
|
||||
|
||||
extents = _skeletonModel.getMeshExtents();
|
||||
glm::vec3 neckPosition;
|
||||
glm::vec3 headPosition;
|
||||
if (_skeletonModel.getNeckPosition(neckPosition) && _skeletonModel.getHeadPosition(headPosition)) {
|
||||
return glm::distance(neckPosition, headPosition);
|
||||
if (!extents.isEmpty() && _skeletonModel.getNeckPosition(neckPosition)) {
|
||||
return extents.maximum.y / 2.0f - neckPosition.y + _position.y;
|
||||
}
|
||||
const float DEFAULT_HEAD_HEIGHT = 0.1f;
|
||||
return DEFAULT_HEAD_HEIGHT;
|
||||
|
|
Loading…
Reference in a new issue