mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-10 20:07:22 +02:00
Fix for "red ball" issue with no skeleton: use avatar position for head
position.
This commit is contained in:
parent
61d3f63f9c
commit
8b2212b6cf
3 changed files with 9 additions and 4 deletions
|
@ -194,7 +194,9 @@ void Avatar::simulate(float deltaTime, Transmitter* transmitter) {
|
||||||
_skeletonModel.simulate(deltaTime);
|
_skeletonModel.simulate(deltaTime);
|
||||||
_head.setBodyRotation(glm::vec3(_bodyPitch, _bodyYaw, _bodyRoll));
|
_head.setBodyRotation(glm::vec3(_bodyPitch, _bodyYaw, _bodyRoll));
|
||||||
glm::vec3 headPosition;
|
glm::vec3 headPosition;
|
||||||
_skeletonModel.getHeadPosition(headPosition);
|
if (!_skeletonModel.getHeadPosition(headPosition)) {
|
||||||
|
headPosition = _position;
|
||||||
|
}
|
||||||
_head.setPosition(headPosition);
|
_head.setPosition(headPosition);
|
||||||
_head.setScale(_scale);
|
_head.setScale(_scale);
|
||||||
_head.setSkinColor(glm::vec3(SKIN_COLOR[0], SKIN_COLOR[1], SKIN_COLOR[2]));
|
_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();
|
calculateGeometry();
|
||||||
|
|
||||||
// the blend face may have custom eye meshes
|
// the blend face may have custom eye meshes
|
||||||
_faceModel.getEyePositions(_leftEyePosition, _rightEyePosition);
|
if (!_faceModel.getEyePositions(_leftEyePosition, _rightEyePosition)) {
|
||||||
|
_leftEyePosition = _rightEyePosition = getPosition();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::calculateGeometry() {
|
void Head::calculateGeometry() {
|
||||||
|
|
|
@ -282,7 +282,9 @@ void MyAvatar::simulate(float deltaTime, Transmitter* transmitter) {
|
||||||
_skeletonModel.simulate(deltaTime);
|
_skeletonModel.simulate(deltaTime);
|
||||||
_head.setBodyRotation(glm::vec3(_bodyPitch, _bodyYaw, _bodyRoll));
|
_head.setBodyRotation(glm::vec3(_bodyPitch, _bodyYaw, _bodyRoll));
|
||||||
glm::vec3 headPosition;
|
glm::vec3 headPosition;
|
||||||
_skeletonModel.getHeadPosition(headPosition);
|
if (!_skeletonModel.getHeadPosition(headPosition)) {
|
||||||
|
headPosition = _position;
|
||||||
|
}
|
||||||
_head.setPosition(headPosition);
|
_head.setPosition(headPosition);
|
||||||
_head.setScale(_scale);
|
_head.setScale(_scale);
|
||||||
_head.setSkinColor(glm::vec3(SKIN_COLOR[0], SKIN_COLOR[1], SKIN_COLOR[2]));
|
_head.setSkinColor(glm::vec3(SKIN_COLOR[0], SKIN_COLOR[1], SKIN_COLOR[2]));
|
||||||
|
|
Loading…
Reference in a new issue