mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-15 12:38:46 +02:00
Merge pull request #1468 from ey6es/master
Fix for "red ball" issue with no skeleton: use avatar position for head
This commit is contained in:
commit
9e49f200a6
3 changed files with 9 additions and 4 deletions
|
@ -194,7 +194,9 @@ void Avatar::simulate(float deltaTime, Transmitter* transmitter) {
|
|||
_skeletonModel.simulate(deltaTime);
|
||||
_head.setBodyRotation(glm::vec3(_bodyPitch, _bodyYaw, _bodyRoll));
|
||||
glm::vec3 headPosition;
|
||||
_skeletonModel.getHeadPosition(headPosition);
|
||||
if (!_skeletonModel.getHeadPosition(headPosition)) {
|
||||
headPosition = _position;
|
||||
}
|
||||
_head.setPosition(headPosition);
|
||||
_head.setScale(_scale);
|
||||
_head.setSkinColor(glm::vec3(SKIN_COLOR[0], SKIN_COLOR[1], SKIN_COLOR[2]));
|
||||
|
|
|
@ -222,8 +222,9 @@ void Head::simulate(float deltaTime, bool isMine) {
|
|||
calculateGeometry();
|
||||
|
||||
// the blend face may have custom eye meshes
|
||||
_faceModel.getEyePositions(_leftEyePosition, _rightEyePosition);
|
||||
|
||||
if (!_faceModel.getEyePositions(_leftEyePosition, _rightEyePosition)) {
|
||||
_leftEyePosition = _rightEyePosition = getPosition();
|
||||
}
|
||||
}
|
||||
|
||||
void Head::calculateGeometry() {
|
||||
|
|
|
@ -282,7 +282,9 @@ void MyAvatar::simulate(float deltaTime, Transmitter* transmitter) {
|
|||
_skeletonModel.simulate(deltaTime);
|
||||
_head.setBodyRotation(glm::vec3(_bodyPitch, _bodyYaw, _bodyRoll));
|
||||
glm::vec3 headPosition;
|
||||
_skeletonModel.getHeadPosition(headPosition);
|
||||
if (!_skeletonModel.getHeadPosition(headPosition)) {
|
||||
headPosition = _position;
|
||||
}
|
||||
_head.setPosition(headPosition);
|
||||
_head.setScale(_scale);
|
||||
_head.setSkinColor(glm::vec3(SKIN_COLOR[0], SKIN_COLOR[1], SKIN_COLOR[2]));
|
||||
|
|
Loading…
Reference in a new issue