Merge pull request #6491 from howard-stearns/fix-missing-own-avatar

Restore rendering of one's own avatar.
This commit is contained in:
Anthony Thibault 2015-11-25 15:46:50 -08:00
commit 6d65f1e3b6

View file

@ -96,7 +96,6 @@ Avatar::Avatar(RigPointer rig) :
_moving(false),
_initialized(false),
_shouldRenderBillboard(true),
_shouldSkipRender(true),
_voiceSphereID(GeometryCache::UNKNOWN_ID)
{
// 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 (distance < renderDistance * (1.0f - SKIP_HYSTERESIS_PROPORTION)) {
_shouldSkipRender = false;
_skeletonModel.setVisibleInScene(true, qApp->getMain3DScene());
if (!isControllerLogging) { // Test for isMyAvatar is prophylactic. Never occurs in current code.
qCDebug(interfaceapp) << "Rerendering" << (isMyAvatar() ? "myself" : getSessionUUID()) << "for distance" << renderDistance;
}
}
} else if (distance > renderDistance * (1.0f + SKIP_HYSTERESIS_PROPORTION)) {
_shouldSkipRender = true;
_skeletonModel.setVisibleInScene(false, qApp->getMain3DScene());
if (!isControllerLogging) {
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
// fix them up in the scene
render::ScenePointer scene = qApp->getMain3DScene();
_skeletonModel.setVisibleInScene(!_shouldSkipRender, scene);
if (_shouldSkipRender) {
return;
}
render::PendingChanges pendingChanges;
if (_skeletonModel.isRenderable() && _skeletonModel.needsFixupInScene()) {
_skeletonModel.removeFromScene(scene, pendingChanges);