mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 20:55:10 +02:00
Don't simulate avatars' models when they're being rendered as billboards.
Closes #2165.
This commit is contained in:
parent
a2a90aa547
commit
0361f46832
3 changed files with 11 additions and 12 deletions
|
@ -135,10 +135,10 @@ void Avatar::simulate(float deltaTime) {
|
||||||
|
|
||||||
getHand()->simulate(deltaTime, false);
|
getHand()->simulate(deltaTime, false);
|
||||||
_skeletonModel.setLODDistance(getLODDistance());
|
_skeletonModel.setLODDistance(getLODDistance());
|
||||||
_skeletonModel.simulate(deltaTime, _shouldRenderBillboard);
|
glm::vec3 headPosition = _position;
|
||||||
glm::vec3 headPosition;
|
if (!_shouldRenderBillboard) {
|
||||||
if (!_skeletonModel.getHeadPosition(headPosition)) {
|
_skeletonModel.simulate(deltaTime);
|
||||||
headPosition = _position;
|
_skeletonModel.getHeadPosition(headPosition);
|
||||||
}
|
}
|
||||||
Head* head = getHead();
|
Head* head = getHead();
|
||||||
head->setPosition(headPosition);
|
head->setPosition(headPosition);
|
||||||
|
|
|
@ -58,7 +58,7 @@ void Head::reset() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Head::simulate(float deltaTime, bool isMine, bool delayLoad) {
|
void Head::simulate(float deltaTime, bool isMine, bool billboard) {
|
||||||
|
|
||||||
// Update audio trailing average for rendering facial animations
|
// Update audio trailing average for rendering facial animations
|
||||||
Faceshift* faceshift = Application::getInstance()->getFaceshift();
|
Faceshift* faceshift = Application::getInstance()->getFaceshift();
|
||||||
|
@ -75,7 +75,7 @@ void Head::simulate(float deltaTime, bool isMine, bool delayLoad) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_isFaceshiftConnected) {
|
if (!(_isFaceshiftConnected || billboard)) {
|
||||||
// Update eye saccades
|
// Update eye saccades
|
||||||
const float AVERAGE_MICROSACCADE_INTERVAL = 0.50f;
|
const float AVERAGE_MICROSACCADE_INTERVAL = 0.50f;
|
||||||
const float AVERAGE_SACCADE_INTERVAL = 4.0f;
|
const float AVERAGE_SACCADE_INTERVAL = 4.0f;
|
||||||
|
@ -161,11 +161,10 @@ void Head::simulate(float deltaTime, bool isMine, bool delayLoad) {
|
||||||
if (!isMine) {
|
if (!isMine) {
|
||||||
_faceModel.setLODDistance(static_cast<Avatar*>(_owningAvatar)->getLODDistance());
|
_faceModel.setLODDistance(static_cast<Avatar*>(_owningAvatar)->getLODDistance());
|
||||||
}
|
}
|
||||||
_faceModel.simulate(deltaTime, delayLoad);
|
_leftEyePosition = _rightEyePosition = getPosition();
|
||||||
|
if (!billboard) {
|
||||||
// the blend face may have custom eye meshes
|
_faceModel.simulate(deltaTime);
|
||||||
if (!_faceModel.getEyePositions(_leftEyePosition, _rightEyePosition)) {
|
_faceModel.getEyePositions(_leftEyePosition, _rightEyePosition);
|
||||||
_leftEyePosition = _rightEyePosition = getPosition();
|
|
||||||
}
|
}
|
||||||
_eyePosition = calculateAverageEyePosition();
|
_eyePosition = calculateAverageEyePosition();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
void reset();
|
void reset();
|
||||||
void simulate(float deltaTime, bool isMine, bool delayLoad = false);
|
void simulate(float deltaTime, bool isMine, bool billboard = false);
|
||||||
void render(float alpha);
|
void render(float alpha);
|
||||||
void setScale(float scale);
|
void setScale(float scale);
|
||||||
void setPosition(glm::vec3 position) { _position = position; }
|
void setPosition(glm::vec3 position) { _position = position; }
|
||||||
|
|
Loading…
Reference in a new issue