mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:21:16 +02:00
Merge pull request #6491 from howard-stearns/fix-missing-own-avatar
Restore rendering of one's own avatar.
This commit is contained in:
commit
6d65f1e3b6
1 changed files with 2 additions and 5 deletions
|
@ -96,7 +96,6 @@ Avatar::Avatar(RigPointer rig) :
|
||||||
_moving(false),
|
_moving(false),
|
||||||
_initialized(false),
|
_initialized(false),
|
||||||
_shouldRenderBillboard(true),
|
_shouldRenderBillboard(true),
|
||||||
_shouldSkipRender(true),
|
|
||||||
_voiceSphereID(GeometryCache::UNKNOWN_ID)
|
_voiceSphereID(GeometryCache::UNKNOWN_ID)
|
||||||
{
|
{
|
||||||
// we may have been created in the network thread, but we live in the main thread
|
// we may have been created in the network thread, but we live in the main thread
|
||||||
|
@ -198,12 +197,14 @@ void Avatar::simulate(float deltaTime) {
|
||||||
if (_shouldSkipRender) {
|
if (_shouldSkipRender) {
|
||||||
if (distance < renderDistance * (1.0f - SKIP_HYSTERESIS_PROPORTION)) {
|
if (distance < renderDistance * (1.0f - SKIP_HYSTERESIS_PROPORTION)) {
|
||||||
_shouldSkipRender = false;
|
_shouldSkipRender = false;
|
||||||
|
_skeletonModel.setVisibleInScene(true, qApp->getMain3DScene());
|
||||||
if (!isControllerLogging) { // Test for isMyAvatar is prophylactic. Never occurs in current code.
|
if (!isControllerLogging) { // Test for isMyAvatar is prophylactic. Never occurs in current code.
|
||||||
qCDebug(interfaceapp) << "Rerendering" << (isMyAvatar() ? "myself" : getSessionUUID()) << "for distance" << renderDistance;
|
qCDebug(interfaceapp) << "Rerendering" << (isMyAvatar() ? "myself" : getSessionUUID()) << "for distance" << renderDistance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (distance > renderDistance * (1.0f + SKIP_HYSTERESIS_PROPORTION)) {
|
} else if (distance > renderDistance * (1.0f + SKIP_HYSTERESIS_PROPORTION)) {
|
||||||
_shouldSkipRender = true;
|
_shouldSkipRender = true;
|
||||||
|
_skeletonModel.setVisibleInScene(false, qApp->getMain3DScene());
|
||||||
if (!isControllerLogging) {
|
if (!isControllerLogging) {
|
||||||
qCDebug(interfaceapp) << "Unrendering" << (isMyAvatar() ? "myself" : getSessionUUID()) << "for distance" << renderDistance;
|
qCDebug(interfaceapp) << "Unrendering" << (isMyAvatar() ? "myself" : getSessionUUID()) << "for distance" << renderDistance;
|
||||||
}
|
}
|
||||||
|
@ -609,10 +610,6 @@ void Avatar::fixupModelsInScene() {
|
||||||
// check to see if when we added our models to the scene they were ready, if they were not ready, then
|
// check to see if when we added our models to the scene they were ready, if they were not ready, then
|
||||||
// fix them up in the scene
|
// fix them up in the scene
|
||||||
render::ScenePointer scene = qApp->getMain3DScene();
|
render::ScenePointer scene = qApp->getMain3DScene();
|
||||||
_skeletonModel.setVisibleInScene(!_shouldSkipRender, scene);
|
|
||||||
if (_shouldSkipRender) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
render::PendingChanges pendingChanges;
|
render::PendingChanges pendingChanges;
|
||||||
if (_skeletonModel.isRenderable() && _skeletonModel.needsFixupInScene()) {
|
if (_skeletonModel.isRenderable() && _skeletonModel.needsFixupInScene()) {
|
||||||
_skeletonModel.removeFromScene(scene, pendingChanges);
|
_skeletonModel.removeFromScene(scene, pendingChanges);
|
||||||
|
|
Loading…
Reference in a new issue