From 5ce39b74fdcf338ac56e9a0ef78fd4d8abe0694b Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 14 Oct 2015 13:58:19 -0700 Subject: [PATCH] debugging --- interface/src/Application.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index e0e5003830..7415e7d297 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2054,11 +2054,40 @@ void Application::checkFPS() { _timerStart.start(); } +uint64_t lastReport = usecTimestampNow(); // XXX + + void Application::idle() { if (_aboutToQuit) { return; // bail early, nothing to do here. } + + // XXX + { // XXX + uint64_t now = usecTimestampNow(); + if (now - lastReport > 4 * USECS_PER_SECOND) { + QSharedPointer avatarManager = DependencyManager::get(); + const AvatarHash& avatarHash = avatarManager->getAvatarHash(); + + glm::vec3 myLeftPalm = getMyAvatar()->getLeftPalmPosition(); + qDebug() << "my left palm:" << myLeftPalm; + + QHash::const_iterator i; + for (i = avatarHash.begin(); i != avatarHash.end(); ++i) { + std::shared_ptr otherAvatar = std::static_pointer_cast(i.value()); + if (otherAvatar->getSessionUUID() == getMyAvatar()->getSessionUUID()) { + continue; + } + glm::vec3 theirLeftPalm = otherAvatar->getLeftPalmPosition(); + qDebug() << "their left palm:" << theirLeftPalm; + }; + + lastReport = now; + } + } // XXX + // XXX + // depending on whether we're throttling or not. // Once rendering is off on another thread we should be able to have Application::idle run at start(0) in // perpetuity and not expect events to get backed up.